tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dlopen fails from static binary



On Mon, Apr 18, 2016 at 09:57:22AM +0200, Martin Husemann wrote:
> On Mon, Apr 18, 2016 at 07:42:57AM +0000, Emmanuel Dreyfus wrote:
> > src/lib/libc/dlfcn/dlfcn_elf.c says:
> > /*
> >  * For ELF, the dynamic linker directly resolves references to its
> >  * services to functions inside the dynamic linker itself.  These
> >  * weak-symbol stubs are necessary so that "ld" won't complain about
> >  * undefined symbols.  The stubs are executed only when the program is  
> >  * linked statically, or when a given service isn't implemented in the
> >  * dynamic linker.  They must return an error if called, and they must
> >  * be weak symbols so that the dynamic linker can override them.
> >  */
> 
> Ah yes, but is there a reason we have that .o in our libc.a?

Because it normally creates more problems than it fixes to leave it out.
It will become more useful soon, so most of this discussion is kind of
idle nitpicking anyway...

Joerg


Home | Main Index | Thread Index | Old Index