object size confusion ...

Brad Petrus brad.petrus@rtc.bosch.com
Thu Feb 9 17:35:00 GMT 2006


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!!!



More information about the Gcc-help mailing list