This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Static binary, .so plugins that are static too - can it be done


On Sun, Jul 29, 2001 at 07:10:31AM -0700, H . J . Lu wrote:

> Just for the record, dlopen in a static binary is not supported in most
> of OSes using the ELF format. The GNU C library has limited support for
> it, which is mainly for NSS. That means if it doesn't work for you now,
> it probably never will.

I tried to open a .a, which obviously does not work. I haven't yet succeded
in making a 'static binary' that has an ELF header - if you pass ld both
-static and -shared it gets in an endless loop that did not terminate after
half an hour.

> BTW, I don't know why someone wants to dlopen in a static binary. It is
> a very bad idea to begin with.

The only reason is that I wanted to be able to distribute a static binary
version of my program (customer didn't want any library version hassle).
This program dlopen()s at runtime certain .so's which are database backend
modules. These .so's must also be static, because otherwise I did not
distribute a static version, and still depend on ld-linux.so etc.

The problem has been resolved now using a chroot, which has some security
benefits too.

Thanks for your time.

Regards,

bert

-- 
http://www.PowerDNS.com      Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]