Stripping D symbols?

Denis Koroskin 2korden at gmail.com
Sat Oct 16 12:37:02 PDT 2010


On Sat, 16 Oct 2010 23:14:44 +0400, Heywood Floyd <soul8o8 at gmail.com>  
wrote:

>
>
> ..got it solved at last.. \o/
> Just writing it down here for future reference (since I found nothing  
> when googling etc..)
>
>
>
>
> Strip can not manage this by itself. The linker, ld (el-dee) needs to be  
> run with the "-exported_symbols_list"-option and given an empty file.  
> Then the symbols created by dmd are treated as local, or whatever it is,  
> and then strip can successfully strip them out. If CLI is used then a  
> stripped binary can be created like this: (#-lines are treated as  
> comments in the exported symbols file.)
>
>    # echo "#empty symbols list for d-code stripping" > symlist
>    # dmd -L-exported_symbols_list -Lsymlist myprog
>    # strip myprog
>
> If XCode is used (with the D for Xcode plugin) an empty file can be put  
> in the project root and then the "Exported Symbols File"-build property  
> (for Release) can be set to the name of this file. Then, lastly a new  
> Build Phase: Run Script can be added with the code
>
>    strip build/Release/MyApp.app/Contents/MacOS/MyApp
>
> If the target is an OSX-app named MyApp.
> Hope it helps someone at some point... :)
>
>
> Toodiloo!
> BR
> /HF
>
>

Good to know and glad you solved that one. Many people are looking for a  
way to strip symbols from the executable and reduce file size in general,  
they should find your information useful.


More information about the Digitalmars-d-learn mailing list