5

How to list the functions / symbols contained inside a dynamic library in mac os ?

I need to see the list of function exported by a dynamic library.

fabrizioM
  • 46,639
  • 15
  • 102
  • 119

2 Answers2

17

See nm(1), something like nm -gU <your lib>.

Nikolai Fetissov
  • 82,306
  • 11
  • 110
  • 171
2

Consider How to export symbols from a shared library and How do i find out what all symbols are exported from a shared object?

Also checkout nm http://sourceware.org/binutils/docs-2.16/binutils/nm.html

Community
  • 1
  • 1
btiernay
  • 7,873
  • 5
  • 42
  • 48
  • 3
    this isn't an answer, just links to other articles. – stevebot Mar 11 '15 at 17:12
  • 2
    and what if those links disappear in the future? At least put a basic example of how to use nm. – stevebot Mar 11 '15 at 19:09
  • Stack overflow links should be stable. Referencing existing question is completely valid. I'm not going to reproduce the man pages for nm. Sorry. – btiernay Mar 11 '15 at 19:37
  • The OP was asking specifically about dynamic libraries in macOS. The answers in the two SO links do not cover macOS dynamic libraries. The link to the nm man page is the GNU version, which differs from the macOS version. – pauln Jun 30 '20 at 16:07