Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Linker error in GCC

Posted by Nobody/Anonymous on October 17, 2006
I am using CodeSourcery's GCC 4.1.0 compiler to do a port to an ARM7TDMI-based system. So I took the ARM7_LPC2106_GCC port and am in the process of modifying. I am trying to compile after some mods and I get a linker error:

arm-none-eabi/bin/ld: region ram is full (rtosdemo.elf section .bss)

Not sure why this is happening, especially since my board has 4MB of RAM. I have modified the linker script to reflect the increased RAM but otherwise left it as it was:

flash: ORIGIN = 0, LENGTH = 512K
ram: ORIGIN = 0xc0000000, LENGTH = 4M

__stack_end__ = 0xc0000000 + 4M - 4;

. = 0;
startup : { *(.startup)} >ram

prog :
} >ram

__end_of_text__ = .;

.data :
__data_beg__ = .;
__data_beg_src__ = __end_of_text__;
__data_end__ = .;
} >ram

.bss :
__bss_beg__ = .;
} >ram

/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
_end = .;
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
PROVIDE (end = .);

In the map file, what looks shady to me is:

.bss 0xc0006640 0x100 ../../Source/tasks.o
0xc0006640 pxCurrentTCB
.bss 0xc0006740 0x400018 ../../Source/portable/MemMang/heap_2.o
COMMON 0xc0406758 0x4 ../Common/Minimal/dynamic.o
0xc0406758 xSuspendedTestQueue
0xc040675c . = ALIGN (0x4)
0xc040675c . = ALIGN (0x4)
0xc040675c _end = .
0xc040675c _bss_end__ = .
0xc040675c __bss_end__ = .
0xc040675c __end__ = .
0xc040675c PROVIDE (end, .)
OUTPUT(rtosdemo.elf elf32-littlearm)

What's weird is there is the line .bss 0xc0006740 0x400018 ../../Source/portable/MemMang/heap_2.o

because after this the addresses go beyond the 4MB limit. Not sure though.

Any help is appreciated.


RE: Linker error in GCC

Posted by Nobody/Anonymous on October 17, 2006
Are you running your code from RAM?

I'm not sure about the line:
startup : { *(.startup)} >ram

seems you are placing your code above the RAM whereas the lines:

flash : ORIGIN = 0, LENGTH = 512K
ram : ORIGIN = 0xc0000000, LENGTH = 4M

would seem to put your flash below the RAM?

RE: Linker error in GCC

Posted by Nobody/Anonymous on October 18, 2006
Even if I comment out the flash memory layout info in the MEMORY section of the linker script, I get the same error.

grr this is frustrating..
Any clues anyone?

RE: Linker error in GCC

Posted by Nobody/Anonymous on October 18, 2006
Found the problem! For posterity, the problem was that I set #define configTOTAL_HEAP_SIZE to occupy all 4MB!! Changed it to smaller and it links ok.

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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner