avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Linker Scripts


From: Andreas Mahr
Subject: [avr-gcc-list] Linker Scripts
Date: Sat, 15 Jun 2002 16:08:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020313

Hi Group!

Since I have my Toolchain for Mega128 working. I found another Problem with the Linker Scripts.

When I compile a Project for the 2313 the Linker says:

avr-gcc -mmcu=at90s2313 -Wall -Wstrict-prototypes -Wa,-ahlms=LM75.lst -Os -DLCD -DPRINTDEC -I./inc -I. -c LM75.c avr-gcc main.o millisecond.o lcd.o print.o i2c.o LM75.o -Wl,-Map=I2Ctest.map,--cref -mmcu=at90s2313 -o I2Ctest.elf /opt/avr/lib/gcc-lib/avr/3.1.1/../../../../avr/bin/ld: section .vectors [00000784 -> 00000799] overlaps section .data [00000784 -> 00000797]
make: *** [elf] Error 1


The versions are:

avr-ld --version
GNU ld version 020614 20020614
Copyright 2002 Free Software Foundation, Inc.

avr-gcc --version
avr-gcc (GCC) 3.1.1 20020610 (prerelease)

avr-libc 20020612 version

To get it working, you have to change the Linker script:

from
/* Internal text space or external memory */
  .text :
  {
    *(.init)
    *(.progmem.gcc*)
    *(.progmem*)
    . = ALIGN(2);
    *(.text)
    . = ALIGN(2);
    *(.text.*)
    . = ALIGN(2);
    *(.fini)
     _etext = . ;
  }  > text

to
  /* Internal text space or external memory */
  .text :
  {
     *(.vectors)
     __ctors_start = . ;
     *(.ctors)
     __ctors_end = . ;
     __dtors_start = . ;
     *(.dtors)
     __dtors_end = . ;
    *(.progmem.gcc*)
    *(.progmem*)
    . = ALIGN(2);
    *(.init0)  /* Start here after reset.  */
    *(.init1)
    *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
    *(.init3)
    *(.init4)  /* Initialize data and BSS.  */
    *(.init5)
    *(.init6)  /* C++ constructors.  */
    *(.init7)
    *(.init8)
    *(.init9)  /* Call main().  */
    *(.text)
    . = ALIGN(2);
    *(.text.*)
    . = ALIGN(2);
    *(.fini9)  /* _exit() starts here.  */
    *(.fini8)
    *(.fini7)
    *(.fini6)  /* C++ destructors.  */
    *(.fini5)
    *(.fini4)
    *(.fini3)
    *(.fini2)
    *(.fini1)
    *(.fini0)  /* Infinite loop after program termination.  */
     _etext = . ;
  }  > text

This works for 2313. For all other devices it must be verified.

It would be nice to be fixed in the future. Sorry but I can not
provide a patch, because I don't know where and what I have to change in the source tree of binutils. This was only a quick and dirty hack in the
script.



Have a nice Day

A. Mahr


avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]