]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
ld: Don't define section symbols for excluded sections master
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Jul 2026 07:10:36 +0000 (15:10 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Jul 2026 10:55:11 +0000 (18:55 +0800)
commitd1268210b6f6eddd267a4ebe4b7d36b802af628d
tree84f27b2dadd09161a23bbd60cb3026d246ef4631
parent0d22d419a4b60672acf5555f5479fcf6956018a1
ld: Don't define section symbols for excluded sections

When the SEC_EXCLUDE bit is set on a section, for example, sections with
the SHF_EXCLUDE flag bit set in ELF input, the contents of the section
are excluded by the linker for non-relocatable output.  Define  __start,
__stop, .startof. and .sizeof. symbols for relocatable link or if the
SEC_EXCLUDE bit on the section is cleared.

PR ld/34448
* ldlang.c (lang_init_start_stop): Call lang_define_start_stop
for relocatable link or if the SEC_EXCLUDE bit on the section
is cleared.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
ld/ldlang.c