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




Loading

Linker error in GCC

Posted by Nobody/Anonymous on October 17, 2006
Hi,
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:

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

__stack_end__ = 0xc0000000 + 4M - 4;

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

prog :
{
*(.text)
*(.rodata)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
} >ram

__end_of_text__ = .;

.data :
{
__data_beg__ = .;
__data_beg_src__ = __end_of_text__;
*(.data)
__data_end__ = .;
} >ram

.bss :
{
__bss_beg__ = .;
*(.bss)
} >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:

[snip]
.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)
[snip]

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.

james

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:

MEMORY
{
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 ]    [ 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