tech-userlevel archive

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

Re: dlopen() and libpthread

On Tue, Oct 23, 2012 at 07:17:10AM +0200, Emmanuel Dreyfus wrote:
> Emmanuel Dreyfus <> wrote:
> > Rmoving the requirement for libpthread to be linked at startup time will
> > not be easy. linking with -lpthreead any program that can use dlopen seems
> > overkill. Let the administrator set LD_PRELOAD=/usr/lib/
> > seems an acceptable workaround.
> > 
> > We could have a generic way of setting envirnoement variables for setuid
> > binaries. What about something like /etc/suenv.d/$progname? 
> Another idea: is it possible to patch an already linked binary to add
> -lpthread? 

Well, not unless there are adequate gaps between the existing elf
header sections.

You might be able to make every program use by replacing
the (that the dynamic linker finds) with a stub library that
has .NEEDED entries for the real and


David Laight:

Home | Main Index | Thread Index | Old Index