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.
On Mon, May 20, 2002 at 07:14:42PM +0200, Martin v. Loewis wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
>
> > But the C++ testcase works fine on your Solaris?
>
> For me, this is only hearsay so far, I have not verified this
> myself. I believe Jason Merrill has, and came to the conclusion that
> even though ld.so appears to work the same, that RTTI matching still
> behaves different, without further investigating why.
>
> I'll see whether I can get further details.
>
> > Anyway, we have a strange situation here:
>
> I agree.
>
>
> > 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.
>
> I think it should: As David Abrahams suggests, the dynamic linker
> should resolve all references for foo to the definiton in B (thus
> ignoring the definition in C, just as it would with RTLD_GLOBAL).
It may not work right since C may want to use its own definition of foo.
I think we can do
1. A can't have undefined symbols which are defined in B or C.
2. Loading A with RTLD_LOCAL first should override definition in B/C
loaded with RTLD_LOCAL. That is Jason's #5. It doesn't seem to work
on Linux. I am trying to find a testcase in C.
H.J.