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?
gcc -s : Remove all symbol table and relocation information from the executable. strip : Discard symbols from object files.
The strip command reduces the size of XCOFF object files. The strip command optionally removes the line number information, relocation information, the debug section, the typchk section, the comment section, file headers, and all or part of the symbol table from the XCOFF object files.
clang supports the -std option, which changes what language mode clang uses. The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases for those modes. If no -std option is specified, clang defaults to gnu99 mode.
The Clang tool is a front end compiler that is used to compile programming languages such as C++, C, Objective C++ and Objective C into machine code. Clang is also used as a compiler for frameworks like OpenMP, OpenCL, RenderScript, CUDA and HIP.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With