This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: Function symbol retention after stripping
- From: Douglas, William <william dot douglas at intel dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 26 Jun 2012 15:26:49 -0700
- Subject: Re: Function symbol retention after stripping
On Mon, May 7, 2012 at 2:04 PM, Douglas, William
<william.douglas@intel.com> wrote:
> On Mon, May 7, 2012 at 12:35 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> It sounds like you want strip -g, which has existed for many years.
>
> That's what I'm seeing right now when I try it. That is very confusing
> as on a different system last week I had strip -g -f when you don't
> have access to the debuginfo file it outputs showing ?? for the
> function names but if I readelf the binaries on this system I clearly
> see functions in the symtab table. I'll have to get back on that
> system tomorrow and see what I did/missed, thanks.
Coming back to this finally. The problem I was running into was that
the libraries were being stripped on the machine I had initially
tested this on causing the the problem I was running into where
debuginfo missing caused outputs of ?? in the backtrace.
Minimal example with glib getting the strip -g treatment is the
following crash.c:
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
int main(void)
{
char *c ;
c = g_malloc(5);
g_free(c);
g_free(c);
}
$ gcc -g $(pkg-config --cflags glib-2.0 --libs glib-2.0) crash.c -o crash
$ gdb crash
(gdb) run
(gdb) bt
#0 0x00007ffff77279e5 in raise () from /lib64/libc.so.6
#1 0x00007ffff7729198 in abort () from /lib64/libc.so.6
#2 0x0000000000000020 in ?? ()
#3 0x0000000000000000 in ?? ()
Is there something I'm doing wrong or is this not expected to work?