This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/16805] dynamic library not getting reinitialized on multiple calls to dlopen()
- From: "neleai at seznam dot cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 20 Jun 2014 10:38:00 +0000
- Subject: [Bug dynamic-link/16805] dynamic library not getting reinitialized on multiple calls to dlopen()
- Auto-submitted: auto-generated
- References: <bug-16805-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16805
--- Comment #5 from Ondrej Bilka <neleai at seznam dot cz> ---
On Fri, Jun 13, 2014 at 04:38:14PM +0000, jason at redhat dot com wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16805
>
> Jason Merrill <jason at redhat dot com> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |jason at redhat dot com
>
> --- Comment #4 from Jason Merrill <jason at redhat dot com> ---
> (In reply to Dave Johansen from comment #2)
> > From reading the comments on the gcc bugzilla and revision history of this
> > change, it appears that it was made as an optimization to improve
> > performance.
>
> It's not an optimization, it's necessary for correctness in the situation where
> you have
>
> plugin A
> weak foo
> plugin B
> weak foo
> library C
> weak foo
>
> and plugins A and B depend on library C. When the program loads A with
> RTLD_LOCAL, references to foo in A and C bind to the definition in A. When the
> program then loads B, references to foo in B bind to the definition in B, but
> references to foo in C are still bound to the definition in A. So if foo is a
> variable, B and C are looking at different copies, leading to chaos.
>
> Marking foo as STB_GNU_UNIQUE fixes this by making references in B resolve to
> the definition in A.
>
> I had suggested (in
> https://www.sourceware.org/ml/libc-alpha/2002-05/msg00222.html) that references
> in A and B should bind to the definition in C instead, but Ulrich rejected that
> idea.
>
You could try to resend it, it may be accepted now.
--
You are receiving this mail because:
You are on the CC list for the bug.