On May 21, 2005, at 12:08 PM, Chris Espinosa wrote:
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:
Turning the option off makes my strip phase work again - thanks.
If there is a better way to get the end result that I'm after, I'm all ears too. What I've been doing is building release builds with debug symbols, then stripping with -S so that user crash logs have a backtrace. As an additional step I strip with strip -R to remove "sensitive" symbol names like serial number validation, etc. If there is a better way to do this with the current toolchain, I'll do it that way. Hints?