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
So its basically saying that the inlining should be left on,
so can you please tell me if there is some way possible through
which I can retrieve the symbol names in-program, maybe using
the debugging symbols or something because I really need it.
On Tue, Jun 17, 2008 at 10:51 PM, Carlos O'Donell
<carlos@systemhalted.org> wrote:
> 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.
> ~~~
>
--
Vinu Rajashekhar,
3rd Year Dual Degree Student,
Deptt of Computer Science & Engg,
IIT Kharagpur,
India.