• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: strip -R not working on GCC 4 generated binaries?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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'. 
            For more information, see <file:///Developer/ADC Reference Library/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html>. [GCC_SYMBOLS_PRIVATE_EXTERN, -fvisibility=hidden]


 _______________________________________________
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

  • Follow-Ups:
    • Re: strip -R not working on GCC 4 generated binaries?
      • From: Jim Correia <email@hidden>
References: 
 >strip -R not working on GCC 4 generated binaries? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: How does the SDK selection affect my compiler settings?
  • Next by Date: Re: How does the SDK selection affect my compiler settings?
  • Previous by thread: strip -R not working on GCC 4 generated binaries?
  • Next by thread: Re: strip -R not working on GCC 4 generated binaries?
  • Index(es):
    • Date
    • Thread