gcc vs. clang: symbol stripping

Reinderien picture Reinderien · May 22, 2011 · Viewed 13.6k times · Source

gcc and AMD Open64 opencc both have a -s option to "strip symbol table and relocation information". So far I haven't been able to find the same option in Clang/LLVM. Does it exist?

Answer

osgx picture osgx · May 22, 2011

You can use a strip utility from binutils.

Actually, a llvm-ld has this options http://llvm.org/cmds/llvm-ld.html

-strip-all, -s Strip all debug and symbol information from the executable to make it smaller.

-strip-debug, -S Strip all debug information from the executable to make it smaller.

opt have something too:

-strip-debug This option causes opt to strip debug information from the module before applying other optimizations. It is essentially the same as -strip but it ensures that stripping of debug information is done first.