[Bug 1318027] Re: gccgo binaries cannot be stripped
Michael Hudson-Doyle
michael.hudson+lp at canonical.com
Wed Mar 23 20:30:12 UTC 2016
I asked about this upstream and the consensus was that stripping
binaries compiled with the gc toolchain should work and does work as far
as anyone knows: https://groups.google.com/forum/#!topic/golang-
dev/ABppMOjYP6w . So the advice to avoid stripping Go binaries is
officially rescinded. Report breakages!
Gccgo is a different matter: binaries built with gccgo must not be
stripped. We could open a dialogue upstream as to how this requirement
could be lifted, but this has not happened yet TTBOMK.
** Summary changed:
- Go binaries cannot be stripped
+ gccgo binaries cannot be stripped
** Changed in: golang (Ubuntu)
Status: New => Fix Released
** Package changed: gcc-4.9 (Ubuntu) => gccgo-6 (Ubuntu)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.9 in Ubuntu.
https://bugs.launchpad.net/bugs/1318027
Title:
gccgo binaries cannot be stripped
Status in gccgo-6 package in Ubuntu:
New
Status in golang package in Ubuntu:
Fix Released
Status in golang package in Debian:
Fix Released
Bug description:
Binaries built with gccgo-4.9 in utopic cannot be stripped at all.
Doing so causes the binaries to be un-runnable due to lack of
debugging symbols:
$ ./debian/nuntium/usr/bin/nuntium
2014/05/09 19:10:41 Connection error: Unknown address type
$ DH_VERBOSE=1 dh_strip -a
strip --remove-section=.comment --remove-section=.note debian/nuntium/usr/bin/nuntium
strip --remove-section=.comment --remove-section=.note debian/nuntium-decode-cli/usr/bin/nuntium-decode-cli
$ ./debian/nuntium/usr/bin/nuntium
no debug info in ELF executable errno -1
fatal error: no debug info in ELF executable
runtime stack:
no debug info in ELF executable errno -1
panic during panic
$
This problem does not manifest when building with golang-gc.
The problem is also reproducible when calling 'strip --strip-debug';
although this removes substantially fewer symbols, there are still
some go-related symbols that are removed according to objdump -x:
@@ -871,7 +853,6 @@
0000000000471380 l O .data 00000000000002f8 C.382
000000000044e520 l O .rodata 0000000000000028 C191
0000000000471680 l O .data 0000000000000028 C.383
-0000000000000000 l df *ABS* 0000000000000000 contenttype.go
00000000004513b0 l O .rodata 0000000000000010 C0
00000000004513c0 l O .rodata 0000000000000010 C1
00000000004513d0 l O .rodata 0000000000000010 C2
But even passing --keep-file-symbols to strip does not give me a
working binary.
So it looks like gccgo has a hard dependency on the contents of the
debugging sections of the binary, which gc does not.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gccgo-6/+bug/1318027/+subscriptions
More information about the foundations-bugs
mailing list