[Top][All Lists]

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

Re: [avr-gcc-list] Linker Scripts

From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] Linker Scripts
Date: Sun, 16 Jun 2002 12:23:19 +0200 (CEST)


> Ok, this is for the Compiler, but the Compiler doesn't care about the 
> location of the RAM, so the Linker has to do the Job.

It's not that simple.

The compiler (the driver to be precise - "avr-gcc" is a relatively
small program that runs several sub-processes to do the real work)
tells the linker (by using the -m option) which emulation (linker
script) should be used, depending on device type.  With the latest
binutils, there are two sets of linker scripts:

 - old, compatible with GCC 3.0 and 3.1, supporting only the older
   devices (example: avrmega161).  Maximum memory sizes are specified,
   so this doesn't scale well with the growing number of device types
   (would require about 20 emulations to support all current chips).
   Nothing has changed here - old GCC will still work with the latest
   binutils, just with no new features.

 - new, compatible with GCC 3.2.  There are just 5 emulations (named
   avr1 ... avr5), which specify maximum possible memory sizes - that
   way there should be no need to add any new emulations to support
   future devices.  All that is needed is -Tdata 0x800100 for some
   devices where SRAM starts at 0x100 instead of 0x60.  These new
   linker scripts were also a good opportunity to make a few other
   changes, like C++ con/destructors, .initN/.finiN sections for
   inserting user code in different stages of initialization, etc.

The new features come at the cost of backwards compatibility.
Things are still subject to change - for example, I'm looking for
a good way to make interrupt vectors (except reset, of course)
optional.  Consider a boot loader for ATmega161: interrupts must be
disabled there, and 80 bytes from the (fixed size) 1K boot loader
section are wasted anyway...


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

reply via email to

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