]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/elfnn-aarch64.c
Switch __cap_dynrelocs* to __rela_dyn* symbols
authorMatthew Malcomson <matthew.malcomson@arm.com>
Tue, 18 Jan 2022 10:54:13 +0000 (10:54 +0000)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Tue, 18 Jan 2022 10:54:13 +0000 (10:54 +0000)
commitd6cf562af412479f6b86666450c8ef1109f4e4a0
tree65e51dd4e8c15a8fe180220a9e30ea2c1b1bfd66
parentf3ecc5c84e9806a10435f4fc8b43b66b6e2bb877
Switch __cap_dynrelocs* to __rela_dyn* symbols

The name has been changed in LLVM, so we adjust it in binutils to match.

We also move where these symbols are created.  Previously they were
created in elfNN_aarch64_always_size_sections, but we move this to
elfNN_aarch64_size_dynamic_sections.

We do the moving since these symbols are supposed to span all dynamic
capability relocations stored in the .rela.dyn section for static
executables.  In the case of a static binary we place relocations for
the GOT into this section as well as internal relocations.

These relocations for the GOT are handled in
elfNN_aarch64_size_dynamic_sections, which is called *after*
elfNN_aarch64_always_size_sections.  The size of this section is only
fully known after those GOT relocations are managed, so the position
these symbols should be placed in is only known at that point.  Hence we
only initialise the __rela_dyn* symbols at that point.

2021-10-06  Matthew Malcomson  <matthew.malcomson@arm.com>
ChangeLog:

* bfd/elfnn-aarch64.c (elfNN_aarch64_always_size_sections): Move
initialisation of __rela_dyn* symbols ...
(elfNN_aarch64_size_dynamic_sections): ... to here.
* ld/testsuite/ld-aarch64/aarch64-elf.exp: Run new tests.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-1.d: New test.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-1.s: New test.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-2.d: New test.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-2.s: New test.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-3.d: New test.
* ld/testsuite/ld-aarch64/emit-morello-reloc-markers-3.s: New test.
bfd/elfnn-aarch64.c
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-1.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-1.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-2.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-2.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-3.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-morello-reloc-markers-3.s [new file with mode: 0644]