unexpected hidden symbol in gcc 4.0.0
Paul Koning
pkoning@equallogic.com
Fri May 13 23:54:00 GMT 2005
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Daniel> On Fri, May 13, 2005 at 05:33:21PM -0400, Paul Koning wrote:
>> I ran into link errors complaining about references to hidden
>> symbol _Unwind_GetIP from a DSO.
>>
>> It turns out unwind-dw2.c is compiled with -fvisibility=hidden for
>> the static library case (but not for the shared library case).
>>
>> In my link, I was using the libgcc.a (for that particular platform
>> I don't use libgcc.so). So the linker complained.
>>
>> The documentation for -fvisibility=hidden suggets that this switch
>> is useful for shared libraries, to make things smaller and faster.
>> It doesn't seem to be appropriate for object libraries.
>>
>> I suppose I can override the "hidden" attribute for that one
>> symbol, or change Makefiles so that switch isn't put there, but
>> I'm wondering why this change and why the mismatch between usage
>> and documentation.
Daniel> It sounds like you are building with --enable-shared and then
Daniel> picking/choosing the libraries, but you haven't described how
Daniel> you build, so I'm just guessing.
Daniel> Normally in an --enable-shared build the copy in libgcc_eh.a
Daniel> has hidden visibility, and can be included in built
Daniel> libraries. The copy in libgcc_s.so.1 is globally visible.
Daniel> You are also misinterpreting the problem. The hidden symbol
Daniel> is not the problem; libstdc++ with an undefined reference to
Daniel> _Unwind_GetIP, and no dependency on libgcc_s.so.1, is the
Daniel> problem.
Ok, I can work on that.
The puzzle is that the build procedure is unchanged from gcc 3.3.3,
and with that version the application builds just fine. It just drags
in unwind_dw2.o from libgcc.a and all is well.
paul
More information about the Gcc
mailing list