Time to stop stripping binaries?

M. Warner Losh imp at bsdimp.com
Wed Jun 23 04:30:34 UTC 2010


In message: <AANLkTilk5JNhVkE7gXE4zXZbJ_AdnR7rDDec5qXMm9EU at mail.gmail.com>
            Garrett Cooper <gcooper at freebsd.org> writes:
: On Tue, Jun 22, 2010 at 5:08 PM, Adrian Chadd <adrian at freebsd.org> wrote:
: > On 23 June 2010 02:09, Garrett Cooper <gcooper at freebsd.org> wrote:
: >
: >>> ISTR someone pointing out that there's a "magical" (ie, I don't
: >>> understand it) way to optionally have debugging symbols as extra
: >>> file(s), rather than having to ship extremely large shared libraries
: >>> by default.
: >>
: >>    See this link:
: >> http://old.nabble.com/-gcc--separate-debug-infos-td21591416.html .
: >> It's similar to what I've seen some internal groups do before in the
: >> past.
: >
: > People-who-know-the-build-system-well, how hard would it be to build
: > libraries with this option?
: >
: > People-who-know-binutils-and-gdb-and-relevant-libraries-well, what
: > magic needs to happen to teach programs about this? (eg gdb, gprof,
: > pmcstat, etc?)
: 
:     Speaking only for gdb, it's trivial from a user perspective to
: pick up the debug symbols:
: 
: add-symbol-file <debug-symbols> <addr>
: 
:     where <addr> is 0 for the application.
:     IIRC there are modifications that people have made to gdb to pick
: up debug symbols for libraries, but I'm a bit hazy here.

I think this is an orthogonal issue to what I'm trying to accomplish.
What is being suggested is a wholesale change in how we build to pass
along -g<whatever> everywhere.  While this has its merits, it isn't
what I'm proposing.  The debug symbols here are much more extensive
than the simple 'don't strip' that I'm suggesting.  Those symbols are
just the globals that ld puts into the binary.  It gives us a amount
of information at a cheap cost, both in terms of implementation
complexity and in terms of extra disk space.

The debug info that's being proposed here is not that cheap, and quite
extensive.  That's why it is segregated to another file.  This might
be worth doing as well, but is quite a different beast.

Warner


More information about the freebsd-arch mailing list