object size confusion ...

Grigory Zagorodnev grigory_zagorodnev@linux.intel.com
Fri Feb 10 06:54:00 GMT 2006


Brad Petrus wrote:
 > 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.

This is because by default size utility accumulates sizes of all 
sections with READONLY and CODE flags into the 'text' value (BFD style). 
That means text value will either reflect size of sections .rodata, 
.eh_frame etc.

However some of these sections may not contain symbols at all. Thus nm 
utility will not enumerate them - that makes the difference.

- Grigory



More information about the Gcc-help mailing list