Re: strip -R not working on GCC 4 generated binaries?
Re: strip -R not working on GCC 4 generated binaries?
- Subject: Re: strip -R not working on GCC 4 generated binaries?
- From: Chris Espinosa <email@hidden>
- Date: Sat, 21 May 2005 09:08:39 -0700
On May 21, 2005, at 5:38 AM, Jim Correia wrote: I'm using a shell script phase with strip -R to remove selected symbol names from the output. This has stopped working with GCC 4.
If I build a sample command line tool project which builds the source
<code snipped for length>
and then run strip -R symbols_to_strip.txt StripTest, it reports
strip: symbols names listed in: /Users/correia/Desktop/StripTest/symbols_to_strip.txt not in: /Users/correia/tmp/build/StripTest _Bar _Foo
Changing nothing other than the compiler, back to GCC 3.3 makes things work again. Has something changed in GCC 4 that I need to account for? (I have tried all the different levels of generating debug symbols.)
gcc 4.0 has a build setting for hiding symbols:
that is enabled by default. Do an nm on each of the resulting binary and you'll see that the _Foo symbol is marked "T" (exported) in gcc 3.3 but "t" (non-exported) in gcc 4.0.
You can either skip the strip step when using gcc 4 and let it do the stripping for you (which saves you having to maintain your symbols file), or turn the option off to get equivalent behavior between gcc3 and gcc4.
You can control symbol visibility inline, too:
When enabled, all symbols are declared 'private extern' unless explicitly marked as 'public' in code. If not enabled, all symbols are declared 'public' unless explicitly marked as 'private extern'.
|
_______________________________________________
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