[PATCH/AARCH64] Fix 32bit reloc for ILP32

Andrew Pinski andrew.pinski@caviumnetworks.com
Tue Jul 23 22:31:00 GMT 2013


Hi,
  The problem here is that if we have a negative value due to the
difference of a symbol and a constant value.  This is produced by
variable tracking inside gcc; producing:
.4byte .LANCHOR0-380
in the debugging info.

This patch fixes the problem by changing the complain on overflow for
ILP32 for the 32bit reloc to be signed based rather than unsigned.

OK?  Build and tested on aarch64-elf and aarch64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

bfd/ChangeLog:
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Change AARCH64_R (ABS32)'s
complain_on_overflow for ILP32 to be complain_overflow_signed.
-------------- next part --------------
? bfd/.elfnn-aarch64.c.swp
? ld/autom4te.cache
? ld/emulparams/aarch64linux32.sh
? ld/emulparams/aarch64linux32b.sh
Index: bfd/elfnn-aarch64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfnn-aarch64.c,v
retrieving revision 1.7
diff -u -p -r1.7 elfnn-aarch64.c
--- bfd/elfnn-aarch64.c	3 Jul 2013 17:23:24 -0000	1.7
+++ bfd/elfnn-aarch64.c	23 Jul 2013 22:18:07 -0000
@@ -344,7 +344,11 @@ static reloc_howto_type elfNN_aarch64_ho
 	 32,			/* bitsize */
 	 FALSE,			/* pc_relative */
 	 0,			/* bitpos */
+#if ARCH_SIZE == 64
 	 complain_overflow_unsigned,	/* complain_on_overflow */
+#else
+	 complain_overflow_signed,	/* complain_on_overflow */
+#endif
 	 bfd_elf_generic_reloc,	/* special_function */
 	 AARCH64_R_STR (ABS32),	/* name */
 	 FALSE,			/* partial_inplace */


More information about the Binutils mailing list