Why are libgcc.a and libgcc_eh.a compiled with -fvisibility=hidden?
Ian Lance Taylor
iant@google.com
Thu Mar 8 07:48:00 GMT 2012
Eric Botcazou <ebotcazou@adacore.com> writes:
>> True, but not, as far as I can see, an explanation for why the symbols
>> are hidden. Hiding the symbols doesn't fix the problem of having
>> multiple libgcc_eh on those platforms.
>
> Yes, it does, as it prevents libgcc_eh from being linked in shared libraries,
> thus forcing you to use libgcc_s.so, at least on those platforms.
I'm sorry, I'm sitll missing something. I don't understand how having
hidden symbols prevents libgcc_eh from being linked into shared
libraries. I mean, what is stopping you (aside from the fact that
libgcc_eh is not compiled with -fPIC). After all, you can link hidden
symbols into a shared library; the library will use those symbols but
will not expose them for use by other libraries.
And it seems to me that if you link libgcc_eh into your main executable,
then things actually would work if the symbols were not hidden--all the
shared libraries would use the version in the main executable.
Ian
More information about the Gcc
mailing list