[systemd-devel] [PATCH] build-sys: remove --gc-sections to fix debugging

Lennart Poettering lennart at poettering.net
Sun Nov 30 16:06:12 PST 2014


On Mon, 24.11.14 20:00, Peter Wu (peter at lekensteyn.nl) wrote:

> The --gc-sections linker option triggers a bug in the gold linker[1] which
> results in a bogus .eh_frame section making debugging harder: gdb backtraces
> stop at a library built by systemd and libunwind simply segfaults.

To my knowledge libunwind is mostly obsolete, and libelfutils should
be used instead.

> Workaround by that bug by removing the option. The additional disk space
> saved by this option is marginal anyway (less than 1%). To illustrate this, see
> this `du -ks` on the installed files:
> 
>     83548   without-gc-sections/install
>     25796   without-gc-sections/install-strip
>     83432   with-gc-sections/install
>     25752   with-gc-sections/install-strip
> 
>  [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=17639

Are you sure you built the non-debug build?

The reason we use gc-sections logic is that much of what we hae in
src/shared/ is linked into every single binary we have even though
most binaries need only very little of it. We rely on the linker to
remove all the bits that are unnecessary hence.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list