Search code examples
optimizationgccllvmclangstrip

gcc vs. clang: symbol stripping


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?


Solution

  • 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.