https://sourceware.org/bugzilla/show_bug.cgi?id=33271
--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <h...@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9b383903e73cd01f2fbe9728d0c31fea765ba8d6 commit 9b383903e73cd01f2fbe9728d0c31fea765ba8d6 Author: H.J. Lu <hjl.to...@gmail.com> Date: Tue Aug 12 12:02:08 2025 -0700 strip: Treat slim GCC/LLVM IR objects the same Slim LLVM IR object is a standalone file whose first 4 bytes are 'B', 'C', 0xc0, 0xde. GCC IR object is regular ELF object with sections whose names start with .gnu.lto_.* or .gnu.debuglto_.*. GCC IR object uses a .gnu.lto_.lto.<some_hash> section to encode the LTO bytecode information: struct lto_section { int16_t major_version; int16_t minor_version; unsigned char slim_object; /* Flags is a private field that is not defined publicly. */ uint16_t flags; }; In slim GCC IR object, the slim_object field is non-zero. Strip should treat slim GCC/LLVM IR objects the same. Since strip won't change slim LLVM IR objects, it should leave slim GCC IR object unchanged even when asked to remove all IR objects: 1. Set the lto_type field to lto_slim_ir_object for slim LLVM IR object. 2. Always copy slim IR object as unknown object. bfd/ PR binutils/33271 * format.c (bfd_set_lto_type): Set the lto_type field to lto_slim_ir_object for slim LLVM IR object. binutils/ PR binutils/33271 * objcopy.c (lto_sections_removed): Removed. (copy_archive): Always copy slim IR object as unknown object. (copy_file): Likewise. (strip_main): Updated. ld/ PR binutils/33271 * testsuite/ld-plugin/lto-binutils.exp: Don't check if fat IR is available when running slim IR tests. * testsuite/ld-plugin/strip-1a-s-all.nd: Expect full symbol list. Signed-off-by: H.J. Lu <hjl.to...@gmail.com> -- You are receiving this mail because: You are on the CC list for the bug.