[Top][All Lists]

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

Re: [avr-gcc-list] ATmega48/88/168 linker script problem

From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] ATmega48/88/168 linker script problem
Date: Sun, 13 Mar 2005 22:35:32 +0100
User-agent: Mutt/1.5.6+20040907i

On Sun, Mar 13, 2005 at 03:37:44PM -0500, Kevin Day wrote:

> The ORIGIN for the data page needs to be increased to 0x800100 for these
> new chips.  This is because the mega48/88/168 have extended registers up 
> to 0xFF.  As you can imagine, all sorts of weird things happen when parts 
> of your data are overlaid over these new registers...

avr-gcc with -mmcu=atmega168 should pass -Tdata 0x800100 to avr-ld,
so there should be no need to change linker scripts.  This assumes
that you link your program using "avr-gcc -mmcu=atmega168" (not avr-ld
directly, or avr-gcc without -mmcu=...).

See LINK_SPEC in gcc/config/avr/avr.h - stock 3.4.3 doesn't support
atmega168 yet, and if patched, the patch should include the LINK_SPEC
change too.  You can see all avr-ld options used by adding -v to the
avr-gcc command line.

> I would submit a patch, but it looks like some infrastructure work is
> required in order to generate the linker scripts during the build
> process, and autoconf and I don't get along (sorry!).

Fortunately, if -Tdata is passed to the linker, this is not necessary.
There is also -Ttext so you don't need to write special linker scripts
for boot loaders.

Hope this helps,

reply via email to

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