This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

arm-none-eabi-size prints larger bss size than it is according to *.map file

Hello

I came across interesting problem I couldn't find answer to.

In my project bss size printed by arm-none-eabi-size is larger than the value that can be calculated basing on *.map file. Using arm-gcc 4.9 2015q3 + NRF SDK10 , compiling code for nrf51822,

Short example:

arm-none-eabi-size bootloader.out

  text      data   bss    dec      hex      filename

  38476     276    4734   43486    a9de     bootloader.out

Part of *.map file:

        0x20002d10                . = ALIGN (0x4)
        0x20002d10                __bss_start__ = .
        (...)
        0x20003b50                . = ALIGN (0x4)
        0x20003b50                __bss_end__ = .

Clearly size of (bss_end - bss_start = 3648) is different from the one printed above. What causes that difference?

Bss part of linker script file:

.bss :
{
	. = ALIGN(4);
	__bss_start__ = .;
	*(.bss*)
	*(COMMON)
	. = ALIGN(4);
	__bss_end__ = .;
} > RAM
Related