Using strip on multiple files using wildcards fails since Binutils 2.44

Nick Clifton nickc@redhat.com
Tue Mar 18 12:17:40 GMT 2025


Hi Markus,

>     strip strip --strip-unneeded -w -p "prefix-*.exe"
> 
> failes with
> strip: 'prefix-*.exe': No such file
> 
> FYI: I've not checked whether this has also changed for the Linux variant.
> 
> Is this a regression or was the usage of a wildcard file-pattern never intended?

Neither.  It is due to the fact that you have enclosed the pattern in double
quotes, so it is not expanded by the shell.  If you try:

   strip --strip-unneeded -p prefix-*.exe

Then the command should work and all of the indicated files should be stripped.

Note: the -w option is intended to tell strip that other command line arguments
which take symbol names as parameters might in fact use regular expressions rather
than just straightforward strings.  So for example:

   strip -N "foo*" a.exe

will strip a symbol called "foo*" from a.exe but not a symbol called "foobar" or
"foo" etc.  (Not that you are likely to have a symbol called foo* in a.exe...)
Whereas:

   strip -w -N "foo*" a.exe

will strip "foo*" and "foobar" and "foo" and anything that matches foo*.


Cheers
   Nick



More information about the Binutils mailing list