[systemd-bugs] [Bug 86666] Use of gold linker breaks debugging

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 28 02:12:09 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=86666

--- Comment #3 from Peter Wu <peter at lekensteyn.nl> ---
(In reply to Zbigniew Jedrzejewski-Szmek from comment #2)
> (In reply to Peter Wu from comment #0)
> >  - The debugging section gets dropped, making the /usr/lib/debug/ files
> >    useless.
> What about this? What are the symptoms?

This is a bug different from the .eh_frame gold linker issue but also hurts the
debugging experience:

The cause was mentioned in the IRC channel. For some reason, libtool does not
keep the -g option during linking (rm libgudev-1.0.la .libs/libgudev-1.0.so* &&
make libgudev-1.0.la V=1):

/bin/sh ./libtool  --tag=CC   --mode=link gcc -std=gnu99 -pipe [-W, -I, etc.]
-g -O2 -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections
-Wl,--print-gc-sections -Wl,-z,relro -Wl,-z,now -pie -Wl,-fuse-ld=gold  
-version-info 2:0:2 -export-dynamic -no-undefined
-Wl,--version-script=../src/gudev/libgudev-1.0.sym  -o libgudev-1.0.la -rpath
/usr/lib src/gudev/libgudev_1_0_la-gudevclient.lo
src/gudev/libgudev_1_0_la-gudevdevice.lo
src/gudev/libgudev_1_0_la-gudevenumerator.lo
src/gudev/libgudev_1_0_la-gudevmarshal.lo
src/gudev/libgudev_1_0_la-gudevenumtypes.lo libudev.la -lgio-2.0 -lgobject-2.0
-lglib-2.0  -ldl 

libtool: link: gcc -shared  -fPIC -DPIC 
src/gudev/.libs/libgudev_1_0_la-gudevclient.o
src/gudev/.libs/libgudev_1_0_la-gudevdevice.o
src/gudev/.libs/libgudev_1_0_la-gudevenumerator.o
src/gudev/.libs/libgudev_1_0_la-gudevmarshal.o
src/gudev/.libs/libgudev_1_0_la-gudevenumtypes.o   -Wl,-rpath
-Wl,/tmp/systemd/build/.libs ./.libs/libudev.so -lrt -lcap -lgio-2.0
-lgobject-2.0 -lglib-2.0 -ldl  -flto -pthread -O2 -Wl,--as-needed
-Wl,--no-undefined -Wl,--gc-sections -Wl,--print-gc-sections -Wl,-z -Wl,relro
-Wl,-z -Wl,now -Wl,-fuse-ld=gold
-Wl,--version-script=../src/gudev/libgudev-1.0.sym   -pthread -Wl,-soname
-Wl,libgudev-1.0.so.0 -o .libs/libgudev-1.0.so.0.2.0

After the above steps, there are no debug sections:

    objdump -h .libs/libgudev-1.0.so.0 | grep debug

With '-g' appended to the libtool command above, the output is non-empty:

 27 .debug_info   0000b5be  0000000000000000  0000000000000000  0000a01a  2**0
 28 .debug_abbrev 00000d5b  0000000000000000  0000000000000000  000155d8  2**0
 29 .debug_loc    00007f25  0000000000000000  0000000000000000  00016333  2**0
 30 .debug_aranges 00000090  0000000000000000  0000000000000000  0001e258  2**0
 31 .debug_ranges 00000460  0000000000000000  0000000000000000  0001e2e8  2**0
 32 .debug_line   00000e11  0000000000000000  0000000000000000  0001e748  2**0
 33 .debug_str    00002b19  0000000000000000  0000000000000000  0001f559  2**0

This is with GCC 4.9.2.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20141128/1cca15ce/attachment.html>


More information about the systemd-bugs mailing list