getting actual function sizes from NM
DJ Delorie
dj@delorie.com
Thu Jul 12 20:52:00 GMT 2001
> Sorry if it's out of the topic but I am trying to
> find the size of functions using NM and when the
> addresses are not contiguous, the --size-sort option
> seems to fail. Am I missing something? If not, any
> suggestions to get the actual sizes?
Try "nm -an" to sort by address, not size, and not skip any symbols.
Then you can determine for yourself what the "end of the function" is
and subtract the addresses. If that doesn't work, try "objdump -d"
and it will show you the address of every single opcode - you should
be able to figure it out from that, even though the output file is
pretty big.
Note that gcc sometimes rearranges functions that are inlined.
More information about the Binutils
mailing list