https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113403

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
This seems somewhat similar to the C++ issue that led to introducing
STB_GNU_UNIQUE; a DSO keeping its own copy of something that we want to be
shared.  In the C++ case we were dealing with vague linkage variables that we
have no control over, and decided that the first copy that gets loaded is used
by all later DSOs, and so it can never be unloaded.

Here, we have more control over the definition, and could say that everyone
should get it from libgcc_s, as Jakub proposes.  Or we could force it to be
defined in the executable, so all DSOs will use the copy there.

That latter might be another way to handle the STB_GNU_UNIQUE situation: if an
executable links against a shared library that defines something
STB_GNU_UNIQUE, copy the definition from the library into the executable?  That
would avoid the dlclose problem.

Reply via email to