top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find size of a function in c?

+3 votes
285 views
How to find size of a function in c?
posted Sep 21, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
 
Best answer

There is a way to determine the size of a function. The command is:

nm -S "object_file_name"

This will return the sizes of each function inside the object file. Consult the manual pages in the GNU using 'man nm' to gather more information on this.

answer Sep 21, 2014 by Aarti Jain
Hi Aarti,
Is there a way to achieve the same using programming?(Not through command line). Maybe with the help of some dummy function logic or subtracting the addresses of 2 functions?
...