]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[Morello] Add symbol markers for reloc section for static binaries
authorSiddhesh Poyarekar <siddesh.poyarekar@arm.com>
Fri, 11 Sep 2020 03:48:10 +0000 (09:18 +0530)
committerLuis Machado <luis.machado@linaro.org>
Tue, 20 Oct 2020 18:04:13 +0000 (15:04 -0300)
commit8d4edc5f8e3b0129cedf409b32f07a7af637456b
treeed68f8ff47b2de8b34876b79ffe9b5003ad2b2ea
parenta1bdea65c73350a0dbcb1e68aaa0e6454a2dd9a1
[Morello] Add symbol markers for reloc section for static binaries

Add symbols __cap_dynrelocs_start and __cap_dynrelocs_end to mark the
start and end of the .rela.dyn section when building a static
executable without PIE.  This allows the runtime startup to traverse
the section and initialise capabilities without having to read the ELF
headers.

All relocations must be of type R_C64_RELATIVE and have the following
properties:

- Frag contains the base of the capability to be initialised
- Frag + 8 has the size and permissions encoded into 56 and 8 bits
  respectively
- Addend is the offset from the capability base

bfd/ChangeLog:

2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Emit
relative C64 relocations for static binaries early.
(aarch64_elf_init_got_section): Add capability relocations to
SRELCAPS for non-PIE static binaries.
(elfNN_aarch64_allocate_dynrelocs): Likewise.
(elfNN_aarch64_always_size_sections): Emit
__cap_dynrelocs_start and __cap_dynrelocs_end.
bfd/ChangeLog
bfd/elfnn-aarch64.c