Is there a way to check whether a .so has been compiled with -Bsymbolic-functions flag?

My application loads custom code using dlopen on the fly.
For common symbols, the global symbol table is used by default.

However, I want to provide the functionality where – if the user has linked their so with -Bsymbolic-functions, I pass the RTLD_DEEPBIND flag to the dlopen function.

Is there a way I can programmatically know whether a .so is linked with -Bsymbolic-functions or not using C ?

Asked By: amisax


There is a command named nm

nm – list symbols from object files

You can use the command

nm Absolute_path_of_.so_file_name | grep -i -Bsymbolic-functions
Answered By: SHW

You can use the standard ELF program dump:

dump -Lv | grep SYMBOLIC

Answered By: schily
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.