GCC tool for size analysis?

arm, c, gcc

Solution

You can use `arm-none-eabi-objdump -t Application.elf`. It will show you the size of all functions and global variables (as hex number).

address    type section size     name
------------------------------------------------
0000d600 l     F .text  00000198 uip_arp_update

Global variables are in `.bss` section, functions are in `.text` section and constant data is in `.data` section.

You can also use `arm-none-eabi-size *.o` in appropriate directory to see sizes of all intermediate files.

It is also possible to use `nm` tool

`arm-none-eabi-nm -t d -S --size-sort Application.elf`

It is also usefull to use `-ffunction-sections -fdata-sections` as compile parameter and `-Wl,--gc-sections` as linker parameter so it will delete all unused functions and data from your binary.

Problem

I develop for embedded platforms by using GCC (arm-none-eabi-gcc). For size analysis, I use: arm-none-eabi-size and the .map file. Because I'm having problems about size of my code, my question is: Is there any tool for size analysis more powerful? Any with statisticts or size by files? Or with the possibility to order functions by size? Any suggestion will be welcome.

Original source