RFC: Should AArch64 *_NC relocs complain on overflow ?

Nick Clifton nickc@redhat.com
Mon Feb 8 12:39:00 GMT 2016


Hi Marcus, Hi Jiong,

> NC relocations do complain if the relocation requires some minimum alignment 
> and the final relocated value does not meet that requirement.  Consider, for 
> example, instructions with an implicit scaling of an address offset, 
> relocations used for those instruction, including the NC form will gripe if 
> the offset being inserted into the instruction is not a multiple of the 
> implicit scaling implied.

OK that makes sense, 

It would be nice if we could generate a more helpful warning message for the user.
What do you think of a patch like the one below ?  With this applied we get output 
like the following:

1.c:(.text+0x4): relocation truncated to fit: R_AARCH64_LDST32_ABS_LO12_NC against symbol `var_2' defined in COMMON section in tmpdir/dump1.o
1.c:(.text+0x4): warning: Possibly the symbol is being referenced via a differently aligned type to its declaration>, no expected output

Cheers
  Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aarch64-reloc-overflow.patch
Type: text/x-patch
Size: 3724 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160208/67c7c944/attachment.bin>


More information about the Binutils mailing list