I have a small static library compiled by (linux) gcc 4.8.2 with -fvisibility=hidden which is linked to a shared library (I have two versions, gcc one with C code and ifort one with Fortran code). The static library consists of some internal functions, all prefixed by "ST_LIB_".
I want to be sure that the functions declared in the static library cannot be used by any executable/library that is linked to the shared library. What is the best command on Linux to check that functions with some prefix cannot be used by any external library?
I have tried:
nm --dynamic shared_lib | grep -i "ST_LIB_" | wc -l
(outputs 0)
readelf -d shared_lib | grep -i "ST_LIB_" | wc -l
(outputs 0)
nm -g shared_lib | grep -i "ST_LIB_" | wc -l
(outputs 26 or 0 depending on share lib)
readelf -s shared_lib | grep -i "ST_LIB_" | wc -l
(outputs 26 or 0 depending on share lib)
readelf -Ws shared_lib | grep -i "ST_LIB_" | grep -i "HIDDEN" | wc -l
(outputs 26 or 0 depending on share lib)