msys2 / msys2-pacman

A friendly fork of https://gitlab.archlinux.org/pacman/pacman
GNU General Public License v2.0
21 stars 12 forks source link

libpacman: Do strip all symbols from EXEs and DLLs #20

Closed lhmouse closed 6 months ago

lhmouse commented 1 year ago

This matches the case for 'EXEC (Executable file)' below.

Passing --strip-all instead of --strip-unneeded to strip can make installed executables a bit smaller. For example, stripping all symbols from /mingw64/bin/gcc.exe can reduce its size from 2,351,500 to 2,344,448 (-7,052).

Microsoft documentation also suggests that there should be no symbol in PE files; see references about PointerToSymbolTable and NumberOfSymbols.

Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format Signed-off-by: LIU Hao lh_mouse@126.com

lazka commented 6 months ago

Since I never responded here:

And I think someone on IRC suggested back then, that the stripped information here could in theory be used to debug pseudo relocations, and there is no replacement information for that. Not that we use that anywhere right now, but something to consider.

lhmouse commented 6 months ago

I think this can be closed for now.