Search code examples
cbinutils

Using binutils size on object file gives a size smaller then the actual size of the object file


I am working with optimizing a single C object file with regards on the footprint. I'm using the compiler arm-elf-gcc, as the target platform is for a ARM-926EJ processor.

I want to document the current size and then compare after the optimization and I'm wondering, why does arm-elf-size return a size that is smaller then the actual size of the object file?

This is what I get with arm-elf-size

text data bss dec hex filename
15656 29188 0 44844 af2c hyper.o

And the actual size of the hyper.o file is 54 168 bytes.

Which one should i look at?


Solution

  • The object file has headers which aren't part of the segments sizes reported by elf-size.