ld.exe: section .task loaded at [000021a4,000021b9] overlaps section .data loaded at

  • Niclas

    Niclas - 2013-04-30

    I'm trying to build freertos for atmega2560. When I try to build unoBlink application I get the following error while linking:
    Building target: UnoBlink.elf
    Invoking: AVR C Linker
    avr-gcc -Wl,-Map,UnoBlink.map -Wl,--gc-sections -mmcu=atmega2560 -o "UnoBlink.elf" ./main.o C:/Users/Niclas/Downloads/freertos/freeRTOS730/Debug/libfreeRTOS730.a -lm
    c:/avr-gcc-4.7.2-mingw32/bin/../lib/gcc/avr/4.7.2/../../../../avr/bin/ld.exe: section .task loaded at [000021a4,000021b9] overlaps section .data loaded at [000021a4,000021c3]
    collect2.exe: error: ld returned 1 exit status
    make: *** [UnoBlink.elf] Error 1

    How can I fix this?


  • Phillip Stevens

    Phillip Stevens - 2013-05-01

    Hi Niclas,

    the issue is that your linker doesn't know about the .task attribute used to keep freeRTOS tasks in low memory of the AVR. The provided linker file avr6.x needs to be substituted for the standard avr6.x file provided with the avr-libc libraries. The .task attribute is described in my post on using freeRTOS with the Mega platform (large memory only applies to the ATmega2560 platform) at http://feilipu.me/2012/01/15/ethermega-arduino-mega-2560-and-freertos/

    Good luck.

  • Niclas

    Niclas - 2013-05-01

    I used the linker's -T -L flags to point to the provided avr6.x file. Now the linking works.


  • Phillip Stevens

    Phillip Stevens - 2014-01-25

    Note that with the release of avrlibc 1.8 and and freeRTOS800, I've changed the linker to use attribute ((section (".lowtext")))

    This attribute is now included in the linker automatically, so there is now no need to have a special version of avr6.x.

    Last edit: Phillip Stevens 2014-04-25

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks