]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld: Ignore .note.gnu.build-id when placing orphaned notes
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 20 Sep 2024 03:32:26 +0000 (11:32 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Sep 2024 11:43:08 +0000 (19:43 +0800)
commit052940eba6fcd2b9f359f03ee205e9cd4dfb1575
tree3059ad8867781822e9b9a99d0b16efd4df6a40ab
parent174e5e38b92c2cd381feffa644de2b12ce0980a8
ld: Ignore .note.gnu.build-id when placing orphaned notes

The commits:

e8e10743f7b Add --rosegment option to BFD linker to stop the '-z separate-code' from generating two read-only segments.
bf6d7087de0 ld: Move the .note.build-id section to near the start of the memory map

place .note.gnu.build-id before text sections when --rosegment is used.
Ignore .note.gnu.build-id when placing orphaned notes if --rosegment and
-z separate-code are used together to avoid putting any note sections
between .note.gnu.build-id and text sections in the same PT_LOAD segment.

PR ld/32191
* ldlang.c (lang_insert_orphan): Ignore .note.gnu.build-id when
placing orphaned notes.
* testsuite/ld-elf/pr23658-1a.d: Pass --no-rosegment to ld.
* testsuite/ld-elf/pr23658-1c.d: Likewise.
* testsuite/ld-elf/pr23658-1e.d: New file.
* testsuite/ld-elf/pr23658-1f.d: Likewise.
* testsuite/ld-i386/i386.exp: Run PR ld/32191 test.
* testsuite/ld-i386/pr32191.d: New file.
* testsuite/ld-x86-64/lam-u48.rd: Updated.
* testsuite/ld-x86-64/lam-u57.rd: Likewise.
* testsuite/ld-x86-64/pr32191-x32.d: New file.
* testsuite/ld-x86-64/pr32191.d: Likewise.
* testsuite/ld-x86-64/pr32191.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/32191 tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
13 files changed:
ld/ldlang.c
ld/testsuite/ld-elf/pr23658-1a.d
ld/testsuite/ld-elf/pr23658-1c.d
ld/testsuite/ld-elf/pr23658-1e.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr23658-1f.d [new file with mode: 0644]
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-i386/pr32191.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/lam-u48.rd
ld/testsuite/ld-x86-64/lam-u57.rd
ld/testsuite/ld-x86-64/pr32191-x32.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr32191.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pr32191.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp