This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

object size confusion ...


I am trying to determine the contributions of individual classes (and packages) in a C++ application to the amount of ROM / Flash required for storing the (embedded) application image.

When using the size utility on an object file I get a much larger size (~4X) reported than when I use the nm utility on the same object file. For example,

size rt_osthread.o:
text 1652
data 0
bss 0 dec 1652


nm --format=bsd --size-sort --print-file-name --demangle rt_osthread.o:
 456 (after summing all reported sizes)

Additionally, the results using nm on the executable are similar to those produced when running nm on the object file (with the exception of the unused methods ...).

Which of these utilities more accurately reflects the contribution of the class/object to the application image size?

Thanks!!!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]