[AArch64] PR ld/21532, Allow COPY relocation elimination

Jiong Wang jiong.wang@foss.arm.com
Wed Jun 7 15:17:00 GMT 2017


   As discussed at the PR, this patch tries to avoid COPY relocation generation
and propagate the original relocation into runtime if it was relocating on
writable section.  The ELIMINATE_COPY_RELOCS has been set to true and it's
underlying infrastructure has been improved so that the COPY reloc elimination
at least working on absoluate relocations (ABS64) on AArch64 and testcases on
the PR has passed.

   There are several other relocation types might need similar supports as well,
I will try to post following up patches to clean up them.

   no regression on cross and native ld check.

   OK for trunk?

   
2017-06-07  Jiong Wang  <jiong.wang@arm.com>
bfd/
         PR ld/21532
         * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
         (elfNN_aarch64_final_link_relocate): Also propagate relocations to
         runtime for copy relocation elimination cases.
         (alias_readonly_dynrelocs): New function.
         (elfNN_aarch64_adjust_dynamic_symbol): Keep the dynamic relocs instead
         of generating copy relocation if it is not against read-only sections.
         (elfNN_aarch64_check_relocs): Likewise.

ld/
         * testsuite/ld-aarch64/copy-reloc-eliminate.d: New test.
         * testsuite/ld-aarch64/copy-reloc-exe-eliminate.s: New test source file.
         * testsuite/ld-aarch64/aarch64-elf.exp: Run new testcase.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elim-copy.patch
Type: text/x-patch
Size: 5571 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170607/3c0d6b9a/attachment.bin>


More information about the Binutils mailing list