LD memory overlap problem

Sysprogs forums Forums VisualGDB LD memory overlap problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8049
    marknsf
    Participant

    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.
    #8054
    support
    Keymaster

    Hi,

    We are not aware of this problem. Where did you get that linker script? The ones shipped with VisualGDB should not contain any ‘mdata’ sections. Perhaps there is a newer version of the script available?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.