Paul Pluzhnikov
2011-10-25 23:26:30 UTC
Greetings,
We've just switched to gcc-4.6 toolchain, and discovered an obscure set
of bugs, which are triggered by STB_GNU_UNIQUE symbols.
Effectively, STB_GNU_UNIQUE symbols always get installed in the global
scope, even when a library is loaded via dlopen(..., RTLD_LOCAL), making
it impossible to load two separate libraries sharing the same STB_GNU_UNIQUE
symbols and have them not interfere with each other.
That behavior appears counter-intuitive and contradicts the description
of RTLD_LOCAL:
This is the converse of RTLD_GLOBAL, and the default if neither flag
is specified. Symbols defined in this library are not made available
to resolve references in subsequently loaded libraries.
Is this really how it is supposed to work, or should RTLD_LOCAL "override"
STB_GNU_UNIQUE and keep them local?
Thanks,
We've just switched to gcc-4.6 toolchain, and discovered an obscure set
of bugs, which are triggered by STB_GNU_UNIQUE symbols.
Effectively, STB_GNU_UNIQUE symbols always get installed in the global
scope, even when a library is loaded via dlopen(..., RTLD_LOCAL), making
it impossible to load two separate libraries sharing the same STB_GNU_UNIQUE
symbols and have them not interfere with each other.
That behavior appears counter-intuitive and contradicts the description
of RTLD_LOCAL:
This is the converse of RTLD_GLOBAL, and the default if neither flag
is specified. Symbols defined in this library are not made available
to resolve references in subsequently loaded libraries.
Is this really how it is supposed to work, or should RTLD_LOCAL "override"
STB_GNU_UNIQUE and keep them local?
Thanks,
--
Paul Pluzhnikov
Paul Pluzhnikov