[英]Stripped symbols are not hidden from strings linux tool
I have a shared library with the symbols stripped. 我有一个带有符号剥离的共享库。 Using a known method/tool to get the symbol names (like
nm -D
, objdump
, readelf
, etc) I see that all the symbols are actually hidden. 使用已知的方法/工具来获取符号名称(如
nm -D
, objdump
, readelf
等),我看到所有符号实际上都是隐藏的。
However, if I run the strings
linux tool on my shared library, I can see some of those symbols exposed. 但是,如果我在共享库上运行
strings
linux工具,我可以看到其中一些符号暴露出来。 I made sure I don't print any of those symbols in messages, but it still somehow prints the symbols that I expect to be stripped. 我确保我不在消息中打印任何这些符号,但它仍以某种方式打印出我希望被剥离的符号。
So, my question is, how can I hide my symbols even from the strings
command line tool in linux? 所以,我的问题是,如何从linux中的
strings
命令行工具中隐藏我的符号? Any help would be appreciated. 任何帮助,将不胜感激。
EDIT: I am using strip -strip--all
to hide the static symbols and I also enable the -fvisibility=hidden
compile flag to hide the unneeded dynamic symbols. 编辑:我正在使用
strip -strip--all
来隐藏静态符号,我还启用-fvisibility=hidden
编译标志来隐藏不需要的动态符号。
Taken from man strings
: 取自
man strings
:
DESCRIPTION
描述
For each file given, GNU
strings
prints the printable character sequences that are at least 4 characters long.对于给定的每个文件,GNU
strings
打印至少4个字符长的可打印字符序列。
The difference between strings
and the tools mentioned by you ( readelf
, objdump
, etc) is that those rely mostly on the DWARF information embedded in the ELF object, whereas the strings
utility outputs ANY printable sequence from the binary data (DWARF unrelated). strings
和你提到的工具( readelf
, objdump
等)之间的区别在于那些主要依赖于嵌入在ELF对象中的DWARF信息,而strings
实用程序从二进制数据输出任何可打印的序列(DWARF无关)。
How can I hide my symbols even from the strings
utility: this could be of help. 如何从
strings
实用程序中隐藏我的符号: 这可能会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.