glibc only with optimization?

Carlos O'Donell carlos@systemhalted.org
Sat Sep 8 03:13:00 GMT 2007


On 9/7/07, Simon Peter <dn.tlp@gmx.net> wrote:
> > > > error: #error "glibc cannot be compiled without optimization"
> > > Why is that?
> > Refer to list archives from April 19.
>
> Thanks for the pointer, but the information given there is still
> insufficient to me. The last mail posted in the thread from April 19
> states that inlining is necessary. Now why is that?

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 gcc will not inline functions. The early
startup of the dynamic loader will make function calls via an
unrelocated PLT and crash.

Cheers,
Carlos.



More information about the Libc-alpha mailing list