NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
toolchain/52233: Static binaries are exceptionally massive
>Number: 52233
>Category: toolchain
>Synopsis: Static binaries are exceptionally massive
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 14 15:05:00 +0000 2017
>Originator: coypu
>Release: NetBSD 7.99.71
>Organization:
>Environment:
NetBSD loggy 7.99.71 NetBSD 7.99.71 (SAFE) #0: Sat May 13 15:28:53 IDT 2017 fly@loggy:/usr/src/sys/arch/amd64/compile/SAFE amd64
>Description:
% cat test.c
void main() {;}
% gcc -static -o static test.c
% ls -lh static
-rwxr-xr-x 1 fly users 228K May 14 17:35 static
>How-To-Repeat:
>Fix:
highlights from digging:
- nm says lots of citrus, string stuff, what's pulling it in?
- objdump says I have a huge function called _lwp_setprivate - but that's just a short syscall. gdb seems to find the correct definition.
- xxd finds a lot of dead space containing:
0002e550: 0800 0000 0800 0000 0800 0000 0800 0000 ................
0002e560: 1b00 0000 0100 0000 0000 0000 002a 2a2a .............***
0002e570: 204e 6f20 4c61 6265 6c20 5072 6f76 6964 No Label Provid
0002e580: 6564 202a 2a2a 0000 f1cf 0200 0000 0000 ed ***..........
0002e590: 0000 0000 0000 0000 0800 0000 0800 0000 ................
0002e5a0: 0c00 0000 0c00 0000 1b00 0000 0100 0000 ................
0002e5b0: 0000 0000 0000 0000 002a 2a2a 204e 6f20 .........*** No
0002e5c0: 4c61 6265 6c20 5072 6f76 6964 6564 202a Label Provided *
0002e5d0: 2a2a 0000 f1cf 0200 0000 0000 0000 0000 **..............
0002e5e0: 0000 0000 0800 0000 0e00 0000 1400 0000 ................
0002e5f0: 1400 0000 1b00 0000 0100 0000 0000 0000 ................
and so on...
this remains even after calling strip.
Home |
Main Index |
Thread Index |
Old Index