This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: problem in glibc backtrace done inside nptl library
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Vinu Rajashekhar" <vinutheraj at gmail dot com>
- Cc: "Neal H. Walfield" <neal at walfield dot org>, libc-help at sourceware dot org
- Date: Tue, 17 Jun 2008 16:51:32 -0400
- Subject: Re: problem in glibc backtrace done inside nptl library
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=FjUas/kyP3iqX/Jcvf/2r8hBK+5aYsx3yOjmbULIBso=; b=Ws84/bTH0YNdky9Bn44CxBUZymRu6vPlIoP0SyCsMj4gGXn7Bg7lt+Vv3E9O3Yfpas K6k2zDs21LNxQ/JnqCTGPpVdHk9ml7mT46cmDl47DBodAiYwdCPbulR6VNkyEr9Dj/4d 0hngc4Xk8z7lhnyREphVh1aP2yByf5gjHjXmE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=U7jHC6NdBuEQyTg5W7LhWZzla2er6T49OK0qTNLluunTBS/QA6IaUjM+ZKXf4+tjPf tGkgcZ1lirC7hPxwBOT9sdsmcQ4jxU96qSNGWjW/vMImSnwFdAd4peMcRK5A6dHCuw0F oPKT6Gi82OZtyMttF6U3zaCwN02lOtd+ov9T0=
- References: <c81a07350806170627x35bbe780q460fd2c576f0e3aa@mail.gmail.com> <874p7sqhmd.wl%neal@walfield.org> <c81a07350806170726wa8d5e1ev7e55a7abfc05e3a9@mail.gmail.com> <c81a07350806170817x5f423f32q50b4f4b5c50ac4f0@mail.gmail.com> <c81a07350806170927g79d128a8k2aefb4b2c2ed9100@mail.gmail.com>
On Tue, Jun 17, 2008 at 12:27 PM, Vinu Rajashekhar <vinutheraj@gmail.com> wrote:
> I used addr2line function and it is showing the functions,
> but I used the -fno-inline and -fno-inline-functions in compiling the files
> like pthread_mutex_init.c and other nptl files, is there something else
> I need to add to make it not inline like in the linking stage ?
>
> I couldnt use the -O0 flag because there is some problem during glibc build
> if I use that.
>From the glibc FAQ:
~~~
1.23. Why do I get:
`#error "glibc cannot be compiled without optimization"',
when trying to compile GNU libc with GNU CC?
{AJ,CO} There are a couple of reasons why the GNU C library will not work
correctly if it is not complied with optimzation.
In the early startup of the dynamic loader (_dl_start), before
relocation of the PLT, you cannot make function calls. You must inline
the functions you will use during early startup, or call compiler
builtins (__builtin_*).
Without optimizations enabled GNU CC will not inline functions. The
early startup of the dynamic loader will make function calls via an
unrelocated PLT and crash.
Without auditing the dynamic linker code it would be difficult to remove
this requirement.
Another reason is that nested functions must be inlined in many cases to
avoid executable stacks.
In practice there is no reason to compile without optimizations, therefore
we require that GNU libc be compiled with optimizations enabled.
~~~