]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
elf: Clear the SEC_ALLOC bit for NOLOAD note sections
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 13 Mar 2025 18:52:00 +0000 (11:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 14 Mar 2025 22:59:02 +0000 (15:59 -0700)
commitd87be451ebbf831d44ac168ca9ea2b79ab5a79b3
tree661cf269efff62c359f22c734fa9a9ed4d810f34
parent5cac5ee6be6a4c5668b119c0e2967a5967ba6b35
elf: Clear the SEC_ALLOC bit for NOLOAD note sections

When generating an ELF output file, if a note section is marked as
NOLOAD, clear the SEC_ALLOC bit so that it won't be treated as an
SHF_ALLOC section, like a .bss style section.

PR ld/32787
* ld.texi: Update NOLOAD for ELF output files.
* ldlang.c (lang_add_section): Clear the SEC_ALLOC bit for NOLOAD
note sections for ELF output files.
* testsuite/ld-elf/pr32787.d: New file.
* testsuite/ld-elf/pr32787.t: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
ld/ld.texi
ld/ldlang.c
ld/testsuite/ld-elf/pr32787.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr32787.t [new file with mode: 0644]