[PATCH/AARCH64] Fix elfNN_aarch64_howto_from_bfd_reloc for BFD_RELOC_AARCH64_NONE and ILP32
Andrew Pinski
andrew.pinski@caviumnetworks.com
Tue Jul 23 21:45:00 GMT 2013
Hi,
The problem here is that the type inside elfNN_aarch64_howto_table
for BFD_RELOC_AARCH64_NONE is 0 since that is the relocation number of
NONE so we return NULL from elfNN_aarch64_howto_from_bfd_reloc but
when really wanted to return a real howto. This happens with TLS
relaxation code when it is recording a relocation as being none.
This fixes the problem by explicitly checking for
BFD_RELOC_AARCH64_NONE and returning elfNN_aarch64_howto_none.
OK? Built and tested on aarch64-elf and aarch64-linux-gnu (with a few
extra patches which adds ilp32 support).
Thanks,
Andrew
ChangeLog:
* elfnn-aarch64.c (elfNN_aarch64_howto_from_bfd_reloc): Handle
BFD_RELOC_AARCH64_NONE explicitly.
-------------- 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 21:39:27 -0000
@@ -1465,6 +1465,9 @@ elfNN_aarch64_howto_from_bfd_reloc (bfd_
if (elfNN_aarch64_howto_table[code - BFD_RELOC_AARCH64_RELOC_START].type)
return &elfNN_aarch64_howto_table[code - BFD_RELOC_AARCH64_RELOC_START];
+ if (code == BFD_RELOC_AARCH64_NONE)
+ return &elfNN_aarch64_howto_none;
+
return NULL;
}
More information about the Binutils
mailing list