在使用 Clang 和 LLVM ELF ld.LLD 链接器时,如何从可执行文件中删除符号?



我正在使用Clang 9.0.0构建并使用ld.lld链接器链接

clang++.exe -Wall -fexceptions -m64 -O3 -Xclang -flto-visibility-public-std -std=c++2a -flto=thin  -c
I:Cpphello_boosthello_codeblocks_worldhello_codeblocks_world.cpp -o objreleasehello_codeblocks_world.o
clang++.exe  -o binreleasehello_codeblocks_world.exe objreleasehello_codeblocks_world.o  -m64 -fuse-ld=lld --strip-all  

但是,与使用通常的 GCC 链接器 LD 不同,此选项(--strip-all 或 -s(无法识别

clang++: error: unsupported option '--strip-all' (or similarly with -s)

谁能建议我应该怎么做来剥离符号?

(我的发布模式hello_world.exe大小为 GC 的 15 kb,但 Clang 的 230 kB :-(这可能会产生一些没有益处的不利影响(。

这不是ld.lld的一个选项吗?

谢谢

您可能希望使用: -熟料 --全部剥离You can use this to supply system-specific linker options that GCC does not recognize(海湾合作委员会手册( https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

相关内容

最新更新