https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109054
Bug ID: 109054
Summary: _Unwind_GetLanguageSpecificData should have protected
visibility
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcc
Assignee: unassigned at gcc dot gnu.org
Reporter: woodard at redhat dot com
Target Milestone: ---
When you look at libgcc_s.so's implementation of
_Unwind_GetLanguageSpecificData
$ eu-readelf -s /lib64/libgcc_s.so.1 | grep _Unwind_GetLanguageSpecificData
67: 0000000000014d20 12 FUNC GLOBAL DEFAULT 14
_Unwind_GetLanguageSpecificData@@GCC_3.0
It has default visibility. Yes I know that a library should not export
functions that are _[A-Z] because those are reserved for system libraries. ref:
http://eel.is/c++draft/lex.name#3.1
However, libunwind does and this led to a very hard to track down problem when
they had linked an application a particular way. What happened was libgcc_s.so
picked up libunwind's implementation of _Unwind_GetLanguageSpecificData this
ultimately caused libgcc_s.so to not be able to find the LSDA of an object
throwing an exception. This made it so that there was no way to catch the
exception and therefore the application aborted. The application was not even
aware of the fact that they were using libunwind becasue it came in as a
dependency of libzmq.
I can't think of a good reason why libgcc_s.so should allow another library to
replace its version of _Unwind_GetLanguageSpecificData and so it seems to me
that the symbol's visibility should be made protected rather than having the
default visibility.
Other related bugs are: https://bugzilla.redhat.com/show_bug.cgi?id=2175966