This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -fvisibility=hidden vs. extern "C"


> In the eh_personality.ii you posted with -fvisibility the prototype
> of __gxx_personality_v0 is marked with default visibility (as it is
> surrounded by #pragma GCC visibility {push(default), pop} pair),
> but the actual definition is not marked in any way.  As it is a definition,
> -fvisibility=hidden causes its visibility to be specified to hidden,
> and as hidden is stronger visibility than default, hidden wins.
> If you put a #pragma GCC visibility {push(default), pop} also
> around the body of eh_personality.cc rather than just headers, the
> function will have default visibility even with -fvisibility=hidden.

Whoops. Yes, got it, thanks.

> But, you'd need to mark the vast majority of libstdc++ code that way.

Well, yes. However, much of that was done earlier.

Turns out, __gxx_personality_v0 was the last one necessary for the testsuite to run correctly.

I was just curious: I thought this should be possible to build this
way. (It is.)

> For libstdc++, it is far better to see what symbols you do not want
> to export and force hidden visibility on those (or anon namespace).

Right... preference being anonymous namespaces. I'm still working on
the anon namespace conversion patch.

Patch for 19664 forces hidden viz on __gnu_internal.

Relocation info for various builds:

// pre-visibility patch
%~/scripts/relinfo.pl libstdc++-v3.orig/src/.libs/libstdc++.so.6.0.9
libstdc++-v3.orig/src/.libs/libstdc++.so.6.0.9: 2420 relocations, 502 relative (20%), 540 PLT entries, 434 for local syms (80%), 0 users

// post-visibility patch
%~/scripts/relinfo.pl libstdc++-v3.gnu_internal/src/.libs/libstdc++.so.6.0.9
libstdc++-v3.gnu_internal/src/.libs/libstdc++.so.6.0.9: 2366 relocations, 448 relative (18%), 540 PLT entries, 434 for local syms (80%), 0 users

// post-visibility patch + -fvisibility=hidden + eh_personality.cc markup
%~bkoz/scripts/relinfo.pl libstdc++.so.6.0.9
libstdc++.so.6.0.9: 2457 relocations, 535 relative (21%), 1121 PLT entries, 1015 for local syms (90%), 0 users


-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]