This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold patch] Add --no-gnu-unique option to disable STB_GNU_UNIQUE


Cary Coutant <ccoutant@google.com> writes:

> 	* options.h (class General_options): Add --[no-]gnu-unique options.
> 	* symtab.cc (Symbol_table::sized_write_globals): Convert
> 	STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.

This is OK.

Thanks.

It seems that GNU ld should consider picking up this option as well.
The basic problem is that it is ambiguous at dlopen time whether a given
global symbol should be unique or not.  If you want to dlopen a library
to live in its own private world, using RTLD_LOCAL, then symbols should
be unique within that private world, not unique across the whole
program.  Unfortunately there is no way to specify that, and the glibc
dynamic linker currently treats STB_GNU_UNIQUE symbols as unique across
the entire link.  I suspect that the correct fix is going to be to add
another flag to dlopen.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]