[AArch64] PR18279, fix handling of GOT entry for local symbol
Jiong Wang
jiong.wang@arm.com
Mon Apr 20 16:22:00 GMT 2015
I reproduced on current binutils-gdb HEAD. The reason is as what RTH has
explained we are handling GOT entry for local symbol incorrectly thus
that relocation still relocate the symbol itself instead of the
associated GOT entry. While the symbol itself may contains value not
8bytes aligned, then trigger alignment check errors.
Even worse, if that symbol contains a value 8bytes aligned, then we pass
the later alignment check, report nothing, and generate buggy binary
silently.
The patch will handle GOT entry for local symbol as the following:
* apply the relocation using GOT entry address.
* generate a R_AARCH64_RELATIVE relocation for the GOT entry, so the local
symbol's address could be updated with the shared object's runtime base address.
OK for trunk?
no regression on binutils-gdb native test.
pass the testcase given by David.
pass my small "exectuable + .so" execution test, verified the runtime behavior is OK.
2015-04-20 Jiong. Wang <jiong.wang@arm.com>
bfd/
PR18279
* elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
GOT_NORMAL for both sgot/srelgot section.
(elfNN_aarch64_final_link_relocate): Relocate against GOT entry
address and generate necessary runtime relocation for GOT entry.
--
Regards,
Jiong
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kkk.patch
Type: text/x-diff
Size: 3348 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150420/c3055b95/attachment.bin>
More information about the Binutils
mailing list