I’m using current Yagarto distribution under WinXP.
Target processor is STR912.
We were previously building our project using IAR, but now we need to add a second engineer (myself) to the project, so I’m trying to convert the code to GnuArm and get away from the dongle.
I mostly have the project building, but I’ve been having a variety of problems getting linking to work successfully. At this point, I think I’m giving clear, specific instructions in the .ld file for laying out .text and .data sections, but link is failing with:
“c:/yagarto/bin/arm-elf-ld” odu-gnuarm.ld -Map=odu.map --cref --no-warn-mismatch -static -o odu.elf
c:\yagarto\bin\arm-elf-ld.exe: section .data [00000610 → 0000111f] overlaps section .text [00000000 → 00029fbb]
make: *** [odu.elf] Error 1
Does anyone have any ideas on what I’m misunderstanding here?
The relevant portion of the .ld file is:
/* Memory Definitions */
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512k
DATA (rw) : ORIGIN = 0x04000000, LENGTH = 96k
IntDataEth (!rx) : ORIGIN = 0x7C000000, LENGTH = 0x42F
/* AHB nonbuffered Ethernet RAM */
}
/* INPUT() statement omitted for space considerations */
SECTIONS
{
/* first section is .text which is used for code */
.start : { *(.startup)} >FLASH = 0
.text :
{
/* ./startup/91x_initga.o (.text) /* Startup code */
(.text) / remaining code */
*(.rodata)
*(.glue_7t) *(.glue_7)
. = ALIGN(4);
end_of_text = .;
} >FLASH = 0
_etext = . ;
PROVIDE (etext = .);
/* .data section which is used for initialized data */
_sidata = _etext;
.data : AT (_sidata)
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_sdata = . ;
*(.data)
(.data.)
. = ALIGN(4);
/* This is used by the startup in order to initialize the .data secion */
_edata = . ;
} >DATA
//**********************************************
This seems like it should be simple; .data is at _etext, which is right after .text section. But obviously, something is not right…
Thank you for any ideas anyone may have.