why nm give no result for striped libtest.so
There are two symbol tables in the original libtest.so
: a “regular” one (in .symtab
and .strtab
sections) and a dynamic one (in .dynsym
and .dynstr
sections).
If strip
removed both symbol tables, you library would be completely useless: the dynamic loader couldn’t resolve any symbols in it. So strip
does the only thing that makes sense: removes the “regular” symbol table, leaving the dynamic one intact.
You can see symbols in the dynamic symbol table with nm -D
or readelf -s
.
The “regular” symbol table is useful only for debugging (for example, it contains entries for static functions, which are not exported by the library, and do not show up in the dynamic symbol table).
But the dynamic loader never looks at the “regular” symbol table (which is not in a format suitable for fast symbol lookups); only at the dynamic one. So the “regular” symbol table is not needed for correct program operation, but the dynamic one is.