Search code examples
binaryshared-librarieslinkageundefined-symbol

How can I detect undefined symbols in a binary/library?


Is there a tool that takes a binary (executable) or a library and, looking also into any shared library dependencies, finds and lists any undefined symbols (even if they are not used)? Any practical way of finding this?


Solution

  • If using *nix, and symbols have not been stripped, using 'nm' will help.

    # nm lib-or-binary-name
    U strcmp@@GLIBC_2.2.5
    

    The 'U' means undefined, and if it is satisfied somewhere, that will be noted after the @.