Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


yagarto+FreeRTOS. BSS elf size vs actual size

Posted by Ella on September 4, 2013
Sorry for possible off-topic but I did not find any better place to ask my question. Unfortunately there is no mail list for yagarto ARM compiler. But I hope my question is simple and can be usefully for other developers.

Below is an output of
arm-none-eabi-size -B -t --common
text data bss dec hex filename
496 0 0 496 1f0 _output/startup_stm32f2xx.o
779 0 16 795 31b _output/main.o

1787 4 208 1999 7cf _output/tasks.o
796 0 56 852 354 _output/timers.o
338 4 0 342 156 _output/port.o
652 0 128 780 30c _output/croutine.o
262 4 16404 16670 411e _output/heap_2.o
132 0 0 132 84 _output/list.o

55073 176 61845 117094 1c966 (TOTALS)

Size of target .elf file:
arm-none-eabi-size -B _output/CM5.elf
text data bss dec hex filename
24800 68 73852 98720 181a0 _output/CM5.elf

My question is why there is a difference between total BSS size of all objects = 61845
and BSS size in elf file = 73852

What is the actual size of used memory? My CPU has 128K And I do not want to waist 73852-61845 bytes.

RE: yagarto+FreeRTOS. BSS elf size vs actual size

Posted by Dave on September 4, 2013
Have a look in the map file. It should tell you the start address of each object in .bss. Perhaps there is a lot of padding for alignment.
Are you compiling as C++ or C?
Is there any debugger code or stubs added? Try a release build without debug info.

RE: yagarto+FreeRTOS. BSS elf size vs actual size

Posted by Ella on September 4, 2013
I'm building with C via own Makefile and ld script.
I have removed debug options -g and -ggdb3 but situation did not change.

Map file looks also much more optimistic then size output:
.bss 0x20000044 0x9f84 load address 0x0800e11c
0x20000044 . = ALIGN (0x4)
0x20000044 _sbss = .
0x20009fc8 . = ALIGN (0x4)
0x20009fc8 _ebss = .
0x20009fc8 PROVIDE (end, _ebss)
0x20009fc8 PROVIDE (_end, _ebss)

._usrstack 0x20009fc8 0x100 load address 0x080180a0
0x20009fc8 . = ALIGN (0x4)
0x20009fc8 _susrstack = .
0x2000a0c8 . = (. + _Minimum_Stack_Size)
*fill* 0x20009fc8 0x100 00
0x2000a0c8 . = ALIGN (0x4)
0x2000a0c8 _eusrstack = .
0x2000a0c8 __exidx_start = .
0x2000a0c8 __exidx_end = .

So according to map file my BSS is 0x9f84 = 40836 dec long.
How can it be?

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists