This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Please try this testcase on Solaris.
- From: "H . J . Lu" <hjl at lucon dot org>
- To: "Martin v. Loewis" <martin at v dot loewis dot de>
- Cc: David Abrahams <david dot abrahams at rcn dot com>,GNU C Library <libc-alpha at sources dot redhat dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 19 May 2002 13:02:57 -0700
- Subject: Re: Please try this testcase on Solaris.
- References: <20020519075448.A21491@lucon.org> <m3adqw7ylo.fsf@mira.informatik.hu-berlin.de>
On Sun, May 19, 2002 at 08:59:31PM +0200, Martin v. Loewis wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
>
> > Could someone please send me the output on Solaris?
>
> On Solaris, I get
>
> ./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
>
> So it looks identical.
But the C++ testcase works fine on your Solaris? I am very curious
about how it works on Solaris. Anyway, we have a strange situation
here:
1. A has undefined symbol, foo, and B's behavior depends on the
definition of foo.
2. B has DT_NEEDED for A and has a difinition of foo.
3. C has DT_NEEDED for A and has a difinition of foo.
When both B and C are dlopened with RTLD_LOCAL, A may not work right
if the same A in memory is used for both B and C since foo in B may be
different from foo in A. I can come up with other testcases to show it.
I don't know if/how the dynamic linker should handle it.
H.J.