codesniffer
codesniffer

Reputation: 1170

Dynamic Symbol Table in Mac dynamic libraries?

I'm porting a C/C++ application library (composed of shared libraries) from Linux to Mac OS and when trying to view the dynamic symbol table in the resulting dylib in the Mac build I get this:

$ nm -g -D -C --defined-only libMyLib.dylib
/Library/Developer/CommandLineTools/usr/bin/nm: error: libMyLib.dylib: File format has no dynamic symbol table.

I get the same result on some of the system libraries. So is it normal that Mac dylibs don't have a dynamic symbol table? Or did I maybe do something wrong during linking?

Upvotes: 6

Views: 2321

Answers (1)

lemon
lemon

Reputation: 69

If you just want to check symbol, try to remove option -D. For example:

$ nm -g -C --defined-only libMyLib.dylib
00000000000e2240 T _test_fun1
00000000000e2f00 T _test_fun2

Upvotes: 2

Related Questions