This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Please try this testcase on Solaris.
- From: "H . J . Lu" <hjl at lucon dot org>
- To: David Abrahams <david dot abrahams at rcn dot com>
- Cc: GNU C Library <libc-alpha at sources dot redhat dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 19 May 2002 09:55:44 -0700
- Subject: Re: Please try this testcase on Solaris.
- References: <20020519075448.A21491@lucon.org>
On Sun, May 19, 2002 at 07:54:48AM -0700, H . J . Lu wrote:
> Here is a small testcase in C. I got
>
> ./main global lazy
> dlopen flags: RTLD_GLOBAL | RTLD_LAZY:
> module1.so: 1
> module2.so: 1
> ./main global now
> dlopen flags: RTLD_GLOBAL | RTLD_NOW:
> module1.so: 1
> module2.so: 1
> ./main local lazy
> dlopen flags: RTLD_LOCAL | RTLD_LAZY:
> module1.so: 1
> module2.so: 0
> ./main local now
> dlopen flags: RTLD_LOCAL | RTLD_NOW:
> module1.so: 1
> module2.so: 0
>
> under Linux. Could someone please send me the output on Solaris? I tend
> to believe this is a dynamic linker bug in Linux. Both module1.so and
> module2.so are linked against libbar.so. But libbar.so has an undefined
> symbol which is defined in both module1.so and module2.so. I guess in
> this case, the local scope of module1.so and module2.so should also
> include the local scope of libbar.so.
>
I think it is really a glibc bug. The problem is when you dlopen a DSO,
which has DT_NEED entries, symbol resolution will go wrong if some DT_NEED
entries have been loaded already with RTLD_LOCAL. I can come up with other
testcases to show this bug.
H.J.