[AArch64] Improve PC-relative relocation check for shared library
Jiong Wang
jiong.wang@arm.com
Thu Apr 16 09:42:00 GMT 2015
For PC relative relocation against external symbol, both defined &
undefined, we should reject them when building shared library, as we
don't propagate them to runtime, and AArch64 dynamic linker doesn't
support any of them. This is also what x86 backend is doing.
Currently, when generating .so, for PC-relative relocation against
external undefined symbol, we are silently generating wrong
binary. while when it's external symbol defined in other .so, we will
trigger unresolved_reloc_p check, while it's better to remind user to
rebuild the code with -fPIC explicitly
OK for trunk?
thanks.
2015-04-16 Jiong. Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
PC-relative relocation for external symbol.
ld/testsuite/
* ld-aarch64/pcrel.s: New testcase.
* ld-aarch64/pcrel_pic_defiend_local.d: New expect file.
* ld-aarch64/pcrel_pic_undefined.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run them.
--
Regards,
Jiong
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcrel.patch
Type: text/x-diff
Size: 4454 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150416/58bf2c07/attachment.bin>
More information about the Binutils
mailing list