This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Should AArch64 *_NC relocs complain on overflow ?


Nick Clifton writes:

>>  IMHO, the safest way is, in
>>    "_bfd_aarch64_elf_put_addend", we return something like
>>    "bfd_reloc_unaligned" which is an general warning, 
>
> That means make changes to the generic parts of the BFD library, which I would
> prefer to avoid unless really necessary.  But if 
>
>> something like
>>    "relocation against unaligned value warning."
>
> But that will not help ordinary programmers who will not understand why
> there is an alignment mismatch.  Given that the overflown relocation error
> has turned up more than once in real production code, and confused the
> programmers who then report bugs against the linker, I think that it is
> in our interests to be as helpful as possible.
>
> How about this rewording instead:
>
>   One possible cause of this error is that the symbol is being
>   referenced in the indicated code as if it had a larger 
>   alignment than was declared where it was defined.

I don't have objection on this.

As looks to me linking errors are always debug nightmare for user
compared with compile errors, therefore improving the warning accuracy
make sense.

+	      if (addend & ((1 << howto->rightshift) - 1)
+		  /* FIXME: Are we testing all of the appropriate reloc
+		     types here ?  */
+		  && (real_r_type == BFD_RELOC_AARCH64_LDST16_LO12
+		      || real_r_type == BFD_RELOC_AARCH64_LDST32_LO12
+		      || real_r_type == BFD_RELOC_AARCH64_LDST64_LO12
+		      || real_r_type == BFD_RELOC_AARCH64_LDST128_LO12))
+		{

I'd suggest add "LD_PREL_LO19" to the check list, then we will give this
particular unalignment warning for all normal data access load/sotre
relocation types which are particularly useful to external users.

Thanks

--
Jiong


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]