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.
However, if I run the strings
linux tool on my shared library, I can see some of those symbols exposed. 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? 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.
Taken from man strings
:
DESCRIPTION
For each file given, GNU
strings
prints the printable character sequences that are at least 4 characters long.
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).
How can I hide my symbols even from the strings
utility: this could be of help.
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