[PATCH] strip: Treat "default" output_target as unspecified
H.J. Lu
hjl.tools@gmail.com
Thu Jul 31 03:49:25 GMT 2025
On Wed, Jul 30, 2025 at 7:35 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Wed, Jul 30, 2025 at 06:49:08PM -0700, H.J. Lu wrote:
> > On Wed, Jul 30, 2025 at 6:27 PM Alan Modra <amodra@gmail.com> wrote:
> > > Yes, I typoed that. The tests need some tweaking as they both fail
> > > with --enable-targets=all.
> > >
> >
> > Like this?
>
> That will do I guess. It would be nicer to run readelf and check the
> machine if strip succeeded.
Run readelf uncovered an output_target bug. "default" output_target
should be treated as unspecified. Here is the patch to fix it with tests.
OK for master?
> > diff --git a/binutils/testsuite/binutils-all/x86-64/x86-64.exp
> > b/binutils/testsuite/binutils-all/x86-64/x86-64.exp
> > index a3fe6b13a7c..89f12fe15a6 100644
> > --- a/binutils/testsuite/binutils-all/x86-64/x86-64.exp
> > +++ b/binutils/testsuite/binutils-all/x86-64/x86-64.exp
> > @@ -261,7 +261,10 @@ set test $subdir/[file tail $t]
> > set testname [file rootname $test]
> > verbose $testname
> > set obj tmpdir/pr33230.o
> > -if {[catch "system \"bzip2 -dc $t > $obj\""] != 0} {
> > +catch "exec $STRIP --help" got
> > +if { [regexp "elf64-littleaarch64" $got] } {
> > + untested "$testname"
> > +} elseif { [catch "system \"bzip2 -dc $t > $obj\""] != 0 } {
> > untested "bzip2 -dc ($testname)"
> > } else {
> > set cmd "$STRIP $obj -o ${obj}.strip"
> >
> > --
> > H.J.
>
> --
> Alan Modra
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-strip-Treat-default-output_target-as-unspecified.patch
Type: text/x-patch
Size: 4076 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250730/409e3565/attachment-0001.bin>
More information about the Binutils
mailing list