I am trying to use VisualGDB to rebuild some old software written for NXP LPC2140 series. The code compiles without error but LD exits with the following error:
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/5.3.0/../../../../arm-eabi/bin/ld.exe: section .mdata loaded at [00000764,00000767] overlaps section .text.initDisplay loaded at [000005cc,000008e3]
1>collect2.exe : error : ld returned 1 exit status
The source included the LD script shown below. I reviewed it against the LD command language tutorial which shows almost exactly this case and .mdata should have been offset past the .text and .rodata. Has something changed in the LD syntax that would cause this?
Thanks,
Mark
——————————————————————————————————————————-
ENTRY(_Rom_Start)
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* LPC2146 */
ram (!r) : ORIGIN = 0x40000000, LENGTH = 32K /* LPC2146 */
}
SECTIONS
{
.boot : { _boot = . ; *(.bootLPC2148) _eboot = . ; } > rom
.text : { _text = . ; *(.text) *(.gnu*) _etext = . ;} > rom
.rodata : { *(.rodata*) . = ALIGN(4); _endOfRom = . ; } > rom
.mdata 0x40000200: AT(ADDR(.text) + SIZEOF(.text) + SIZEOF(.rodata))
{ _data = . ; *(.data); _edata = . ; } > ram
.bss : { _bstart = . ; *(.bss) *(COMMON); _bend = .;} > ram
.stack : { _stack = . ; *(.Stack); _estack = . ; _heap = . ; } > ram
_Ram_Start = 0x40000000;
/DISCARD/ : { *(.comment) }
/DISCARD/ : { *(.ARM.*) }
}
-
This topic was modified 8 years, 7 months ago by marknsf.