Re: Symbol Visibility in C++ App
Re: Symbol Visibility in C++ App
- Subject: Re: Symbol Visibility in C++ App
- From: Michael Randell <email@hidden>
- Date: Wed, 21 Jul 2010 11:17:36 +0100
Hi Jean-Daniel
Here is the output from the nm command:
0000000000000e1a s stub helpers
0000000000000d74 t __GLOBAL__I__ZN10SymbolTest10HelloWorldEPKc
0000000000000d40 t __Z41__static_initialization_and_destruction_0ii
0000000000000da2 T __ZN10SymbolTest10HelloWorldEPKc
0000000000000d88 t __ZN14SymbolTestPriv14HelloWorldPrivEPKc
U __ZNSt8ios_base4InitC1Ev
U __ZNSt8ios_base4InitD1Ev
U __ZSt4cout
U __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
0000000000001060 b __ZStL8__ioinit
U __ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
U __ZdlPv
U __Znwm
U ___cxa_atexit
U ___gxx_personality_v0
0000000000000ddf t ___tcf_0
0000000000000000 t __mh_dylib_header
U dyld_stub_binder
Ah, I think I see now. So the pragma is working but the hidden symbols aren't being stripped. I think what I am missing is a setting in Xcode to strip the 'hidden' symbols.
Cheers
Mike.
On 20 Jul 2010, at 18:31, Jean-Daniel Dupas wrote:
>
> Le 20 juil. 2010 à 18:36, Michael Randell a écrit :
>
>> Hi All
>>
>> I'm trying to use pragmas to set symbol visibility in a Carbon C++ application - I'm trying to hide the symbols. I'm using otx to disassemble my Mach-O executable to test that the symbols have been hidden.
>>
>> Unfortunately the pragmas don't seem to work.
>>
>> I'm using XCode 3.2.2, Mac OS X 10.6.4, compiling with GCC 4.2.
>>
>> As a test I've tried using the 'C++ library' XCode template project and am still able to see the symbols for the function 'HelloWorldPriv', even though '#pragma GCC visibility push(hidden)' is used to hide the symbols for the class.
>>
>> Am I missing something?
>
>
> What do you mean by "am still able to see the symbols" ?
> Can you try to run the nm command in the Terminal to get the proper list of symbols with corresponding visibility and post the output here ?
>
> -- Jean-Daniel
>
>
>
>
Michael Randell
Senior Software Development Engineer
PerkinElmer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden