This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dlopen and static linking


On Tue, May 27, Jakub Jelinek wrote:

> On Tue, May 27, 2003 at 01:06:10PM +0200, Thorsten Kukuk wrote:
> > 
> > Hi,
> > 
> > Appendend is a test case for dlopen, where a static program dlopens
> > a shared library which dlopens another shared library. The second
> > dlopen always seg.faults for me (call a, a.shared works).
> > 
> > Should this work or not? If this should not be worked, we need to
> > fix RPM, which is static linked and calles dlopen.
> 
> rpm is fixed, it is not statically linked anymore.
> ldd /bin/rpm
>         librpm-4.2.so => /usr/lib/librpm-4.2.so (0x40032000)
>         librpmdb-4.2.so => /usr/lib/librpmdb-4.2.so (0x40087000)
>         librpmio-4.2.so => /usr/lib/librpmio-4.2.so (0x40166000)
>         libpopt.so.0 => /usr/lib/libpopt.so.0 (0x401c4000)
>         libelf.so.1 => /usr/lib/libelf.so.1 (0x401cc000)
>         libpthread.so.0 => /lib/tls/libpthread.so.0 (0x401dc000)
>         librt.so.1 => /lib/tls/librt.so.1 (0x401ea000)
>         libbz2.so.1 => /usr/lib/libbz2.so.1 (0x401fe000)
>         libc.so.6 => /lib/tls/libc.so.6 (0x00e80000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> But I'm afraid there are other statically linked apps which use NSS,
> so the dlopen from dlopen either needs to be avoided, or fixed.

No, rpm is not fixed, /usr/lib/rpm/rpmi is static linked and does call
getpwnam/getpwuid. So we really need to forbid static linked binaries
to call NSS functions (like Solaris does) or we need a fix for dlopen,
so that a dlopened library from a static linked binary can call dlopen
itself, too. I don't know if the last one is possible, but with a
static linked RPM we will get big trouble with my new nss_compat module.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Deutschherrnstr. 15-19        D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B


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