tags:

views:

42

answers:

2

I have gcc creating a dylib on osx for me. I'm interested in what exactly takes up how much space in that file, and am looking for a tool/method that would let me see that information.

+1  A: 

Use nm -n on the binary. That will dump a listing of symbols in the library, sorted by memory address. By looking at the difference between a symbol's address and the next one in the list, you can tell the size of the function's text or of the variable's data.

jonas echterhoff
+1  A: 

You could also take a look at it using otool. Otool can be used to extract various information about mach-o object files.

http://www.manpagez.com/man/1/otool/

Keli Hlodversson