gcc vs. clang: symbol stripping

2020-07-03 04:04发布

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?

1条回答
三岁会撩人
2楼-- · 2020-07-03 04:41

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.

查看更多
登录 后发表回答