]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
strip: Don't check target_defaulted in input BFD
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Jul 2025 15:53:11 +0000 (08:53 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 31 Jul 2025 00:45:38 +0000 (17:45 -0700)
commit8e885fece150ee97e5b0e78363e7fe9888ae9c29
tree0bedc5a9060d6f3406328bc463fc79ae8aed89cd
parent9af083a959a03ef068e1b7869263dddb4fb913c3
strip: Don't check target_defaulted in input BFD

The target_defaulted field in BFD is set to true if the target isn't
specified.  After

commit 717a38e9a02109fcbcb18bb2ec3aa251e2ad0a0d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun May 4 05:12:46 2025 +0800

    strip: Add GCC LTO IR support

the target is set to "plugin" if BFD supports plugin when the target
isn't specified nor default.  Update strip to check the input target,
instead of the target_defaulted field in input BFD.

PR binutils/33230
* objcopy.c (copy_object): Add a bool argument, target_defaulted,
to indicate if the input target isn't specified nor default.
Check it instead of ibfd->target_defaulted.
(copy_archive): Add a bool argument, target_defaulted, and pass
it to copy_object.
(copy_file): Set target_defaulted to true if the input target
isn't specified and pass it to copy_archive and copy_object.
* testsuite/binutils-all/x86-64/pr33230.obj.bz2: New file.
* testsuite/binutils-all/x86-64/x86-64.exp: Run PR binutils/33230
tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
binutils/objcopy.c
binutils/testsuite/binutils-all/x86-64/pr33230.obj.bz2 [new file with mode: 0644]
binutils/testsuite/binutils-all/x86-64/x86-64.exp