]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[Morello] Pad section alignment to account for capability range format
authorSiddhesh Poyarekar <siddesh.poyarekar@arm.com>
Fri, 11 Sep 2020 03:48:11 +0000 (09:18 +0530)
committerLuis Machado <luis.machado@linaro.org>
Tue, 20 Oct 2020 18:04:26 +0000 (15:04 -0300)
commit7ff36d1a856fce85c7ad854270289815758a8816
tree89452b35cd6d65c63613b6a8916445221fd55639
parentfa6ca5e254bb95725389f8eb87cd426def4e23f1
[Morello] Pad section alignment to account for capability range format

The capability format has limitations on the alignment and length of
capability bounds and are subject to rounding.  Add alignment and
padding at the boundaries of such long (typically >16M) sections so
that any capabilities referencing these sections do not end up
overlapping into neighbouring sections.

There are two cases where this is in use.  The first and most
important due to the current implementation is the range for PCC,
which needs to span all executable sections and all PLT and GOT
sections.  The other case is for linker and ldscript defined symbols
that may be used in dynamic relocations.

bfd/ChangeLog:

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

* elfnn-aarch64.c (elf_aarch64_link_hash_table): New member.
(section_start_symbol, c64_valid_cap_range, exponent): Move
up.
(sec_change_queue): New structure.
(queue_section_padding, record_section_change,
elfNN_c64_resize_sections): New functions.
(bfd_elfNN_aarch64_init_maps): Add info argument.  Adjust
callers.
* elfxx-aarch64.h (bfd_elf64_aarch64_init_maps,
bfd_elf32_aarch64_init_maps): Add info argument.
(elf64_c64_resize_sections, elf32_c64_resize_sections): New
function declarations.

ld/ChangeLog:

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

* emultempl/aarch64elf.em (elf64_c64_pad_section): New
function.
(gld${EMULATION_NAME}_after_allocation): Resize C64 sections.
* ldlang.c (lang_add_newdot): New function.
* ldlang.h (lang_add_newdot): New function declaration.
* testsuite/ld-aarch64/aarch64-elf.exp: Add new test.
* testsuite/ld-aarch64/morello-sec-round.d: New file.
* testsuite/ld-aarch64/morello-sec-round.ld: New file.
* testsuite/ld-aarch64/morello-sec-round.s: New file.
bfd/ChangeLog
bfd/elfnn-aarch64.c
bfd/elfxx-aarch64.h
ld/ChangeLog
ld/emultempl/aarch64elf.em
ld/ldlang.c
ld/ldlang.h
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/morello-sec-round.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-sec-round.ld [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-sec-round.s [new file with mode: 0644]