3

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.

Eugeniu Rosca
  • 5,177
  • 16
  • 45
sasfour
  • 399
  • 1
  • 3
  • 10

1 Answers1

1

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.

Community
  • 1
  • 1
Eugeniu Rosca
  • 5,177
  • 16
  • 45