Here is a patch to allow stripping PE32 files (.exe and .dll) Reproducible: Always
Created attachment 282753 [details, diff] prepstrip-BJA-mingw.diff
(In reply to comment #1) > Created attachment 282753 [details, diff] > prepstrip-BJA-mingw.diff This also include a simplification while handling `file' output
Hum, this have impact when you compile things like mono that generate PE32 binaries and libs as prepstrip doesn't check the EM_TYPE of found files. This needs some tweak
With find -or, you need parenthesis, like this: find "$@" -type f \( -name '*.a' -or -name '*.exe' -or -name '*.dll' \) For testing purposes, I tried running strip on some of the *.dll files I have installed in /usr/lib/wine/fakedlls/ by wine, but strip says "File format not recognized" for these files. For the same files, file -b says "PE32 executable (DLL) Intel 80386, for MS Windows".
(In reply to comment #4) > With find -or, you need parenthesis, like this: > > find "$@" -type f \( -name '*.a' -or -name '*.exe' -or -name '*.dll' \) > > For testing purposes, I tried running strip on some of the *.dll files I have > installed in /usr/lib/wine/fakedlls/ by wine, but strip says "File format not > recognized" for these files. For the same files, file -b says "PE32 executable > (DLL) Intel 80386, for MS Windows". Oh yes, in my case I use {i686,x86_64}-w64-mingw32-strip in a crossdev env so binutils can detect the correct binary format.
(In reply to comment #4) > but strip says "File format not > recognized" for these files. That's why prepstrip should detect only EM_MACHINE file. Isn't it ?
(In reply to comment #6) > That's why prepstrip should detect only EM_MACHINE file. Isn't it ? Perhaps. I'm not familiar enough with this stuff. (In reply to comment #3) > Hum, this have impact when you compile things like mono that generate PE32 > binaries and libs as prepstrip doesn't check the EM_TYPE of found files. > > > This needs some tweak Are you working on an updated patch then? Or should we apply the existing patch as-is?
(In reply to comment #7) > (In reply to comment #6) > > That's why prepstrip should detect only EM_MACHINE file. Isn't it ? > > Perhaps. I'm not familiar enough with this stuff. > > (In reply to comment #3) > > Hum, this have impact when you compile things like mono that generate PE32 > > binaries and libs as prepstrip doesn't check the EM_TYPE of found files. > > > > > > This needs some tweak > > Are you working on an updated patch then ? Yes I am with a low resolution delay, I'd like to add some PE detection to pax-utils first. > Or should we apply the existing patch > as-is? No, not yet :) I'll keep this bug up to date