int i; static int * g(void) { return &i; } struct S { static int * f(void) { static int *p = g(); return p; } };
int * wrap2_f (void) { return S::f(); } g++ -O2 -fpic -shared -o lib.so lib.cc -Wl,-Bsymbolic (assuming gcc has been configured to use STB_GNU_UNIQUE). There are no relocations against _ZZN1S1fEvE1p (STB_GNU_UNIQUE) symbol defined in this library. While for non-STB_GNU_UNIQUE symbols that's desirable, the symbol will always resolve to the containing library, for STB_GNU_UNIQUE it causes the symbol to be no longer unique in the whole program. -- Summary: ld resolves relocations against STB_GNU_UNIQUE in DT_SYMBOLIC libraries Product: binutils Version: 2.21 (HEAD) Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: jakub at redhat dot com CC: bug-binutils at gnu dot org,hjl dot tools at gmail dot com http://sourceware.org/bugzilla/show_bug.cgi?id=11434 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils