PATCH COMMITTED: Fix protected symbols in shared libraries
Ian Lance Taylor
iant@google.com
Tue May 6 22:26:00 GMT 2008
"Andreas Hartmetz" <ahartmetz@gmail.com> writes:
> -when "copying" a symbol from a dynamic library to the output file
> gold will not change the visibility. This is broken for symbols with
> protected visibility in the source. As hidden symbols will be ignored
> anyway it's safe to always give those symbols default (=="public")
> visibility. This mattered when linking the xine multimedia libraries
> which contain protected and exported symbols.
Thanks for the clear description of the problem, and the sample patch.
I committed this patch to fix it, along with a test case.
Ian
2008-05-06 Ian Lance Taylor <iant@google.com>
* symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
symbol, change it to have default visibility.
* testsuite/protected_1.cc: New file.
* testsuite/protected_2.cc: New file.
* testsuite/protected_3.cc: New file.
* testsuite/protected_main_1.cc: New file.
* testsuite/protected_main_2.cc: New file.
* testsuite/protected_main_3.cc: New file.
* testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
(protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
(protected_1_LDFLAGS, protected_1_LDADD): Define.
(protected_1.so): New target.
(protected_1_pic.o, protected_2_pic.o): New targets.
(protected_3_pic.o): New target.
(check_PROGRAMS): Add protected_2.
(protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
(protected_2_LDFLAGS, protected_2_LDADD): Define.
* testsuite/Makefile.in: Rebuild.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 12779 bytes
Desc: Fix protected symbols in shared libraries
URL: <https://sourceware.org/pipermail/binutils/attachments/20080506/02ca5b8f/attachment.bin>
More information about the Binutils
mailing list