]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
binutils: Don't complain plugin with all LTO sections removed
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 14 May 2025 23:30:06 +0000 (07:30 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 15 May 2025 00:43:58 +0000 (08:43 +0800)
commitd1851edfe9d2469330568c289adb81ee7b128bfe
treefdf9300927a681a9a7eb69d68db13c9cb46a00df
parent11e2fe837957c596c3c8868c54968d1646f60447
binutils: Don't complain plugin with all LTO sections removed

When all LTO sections have been removed, the BFD lto_type is set to
lto_non_ir_object by bfd_set_lto_type.  In this case, don't complain
needing a plugin when seeing a LTO slim symbol.

bfd/

PR binutils/32967
* archive.c (_bfd_compute_and_write_armap): Call
bfd_lto_slim_symbol_p to check LTO slim symbol.
* bfd-in2.h: Generated.
* bfd.c (bfd_lto_slim_symbol_p): New.

binutils/

PR binutils/32967
* nm.c (filter_symbols): Call bfd_lto_slim_symbol_p to check
LTO slim symbol.

ld/

PR binutils/32967
* testsuite/ld-plugin/lto-binutils.exp: Run PR binutils/32967
tests.
* testsuite/ld-plugin/strip-1a-s-all.nd: New file.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
bfd/archive.c
bfd/bfd-in2.h
bfd/bfd.c
binutils/nm.c
ld/testsuite/ld-plugin/lto-binutils.exp
ld/testsuite/ld-plugin/strip-1a-s-all.nd [new file with mode: 0644]