]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - ld/testsuite/ld-aarch64/aarch64-elf.exp
Adjust which sections we resize for precise bounds
authorMatthew Malcomson <matthew.malcomson@arm.com>
Mon, 21 Feb 2022 13:18:30 +0000 (13:18 +0000)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Mon, 21 Feb 2022 13:19:24 +0000 (13:19 +0000)
commitea41358b032f2811271c78ea45186aea95dbe3e1
tree826fa4426186a90ea5f9aefce7ca6774d410160c
parentbc64cc9049a93b057b31864ed5c75f234a548673
Adjust which sections we resize for precise bounds

Before this change we would ensure the ability for precise bounds on any
section which had a linker defined symbol pointing in it *unless* that
linker defined symbol looked like a section starting symbol.

In that case we would adjust the *next* section if the current section
had no padding between this one and the next.

I believe this was a mistake.  The testcase we add here is a simple case
of having a `__data_relro_start` symbol in the .data.rel.ro section, and
that would not ensure that the .data.rel.ro section were precisely
padded.  The change we make here is to perform padding for precise
bounds on all sections with linker defined symbols in them *and* the
next section if there is no padding between this and the next section.

This is a huge overfit and we do it for the reason described in the
existing comment (that we have no information on the offset of this
symbol within the output section).

In the future we may want to remove this padding for linker script
defined symbols which do not look like section start symbols.  We would
do this in conjunction with changing the bounds we put on such linker
script defined symbols.  This would be for another patch.
bfd/elfnn-aarch64.c
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/morello-sec-round-choose-linker-syms.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-sec-round-choose-linker-syms.ld [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-sec-round-choose-linker-syms.s [new file with mode: 0644]