From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30617 invoked by alias); 2 Apr 2014 18:30:38 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30562 invoked by uid 48); 2 Apr 2014 18:30:35 -0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60731] [4.7/4.8/4.9 Regression] dynamic library not getting reinitialized on multiple calls to dlopen() Date: Wed, 02 Apr 2014 18:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg00165.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60731 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org --- Comment #3 from Jason Merrill --- Right, it was a deliberate choice in ld.so to suppress dlclose of DSOs that use STB_GNU_UNIQUE, which causes problems with some code that relies on reinitialization with dlclose/dlopen. As Ian says in http://gcc.gnu.org/ml/gcc-help/2011-05/msg00450.html this seems excessive; you only need to avoid unloading files that are satisfying symbol references in another DSO. But I guess checking for that was deemed too slow. If you're using the gold linker, you can link with --no-gnu-unique to avoid the use of STB_GNU_UNIQUE. I suppose I should add a compiler flag to turn it off, too...