How to list exported functions in a shared lib on Ubuntu

Posted on Mar 23, 2023

Question

I have just built a shared lib on Ubuntu, and when I attempt to use the function, the application that loads the library is reporting 'xxx' symbol not found.

I want to check (i.e. list) the functions that are exported by my library so I can investigate this issue further.

Relevant details:

OS: Ubuntu 9.10 compiler: gcc 4.4.1 linker: GNU ld 2.20

Answer

Try the nm utility.

GNU nm lists the symbols from object files objfile.... If no object files are listed as arguments, nm assumes the file a.out. [reference]