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

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

Re: [avr-gcc-list] Device specific linker scripts


From: Erik Christiansen
Subject: Re: [avr-gcc-list] Device specific linker scripts
Date: Thu, 24 Oct 2013 00:54:34 +1100
User-agent: Mutt/1.5.21+145 (2a1c5d3dd72e) (2012-12-30)

On 23.10.13 12:32, Dhakshinamoorthy, Soundararajan wrote:
> I will give a try in implementing the idea of having a separate
> configuration file for each device in lib/defs, that could be used to
> parameterize the linker script. But that implies cascading the mmcu
> parameter to avr-ld ?

Yup - passed on essentially transparently as received on the avr-gcc
command line, with only a constant prefix. Point 2 of the upthread
proposal suggests prepending enough relative pathname to specify the
"separate configuration file" dropped into lib/defs. (That allows
automatic avr-ld behaviour to do the rest.)

When avr-ld encounters e.g. lib/defs/atmega12345 on its command line,
then (from man ld):

»
If the linker cannot recognize the format of an object file, it will
assume that it is a linker script.  A script specified in this way
augments the main linker script used for the link (either the default
linker script or the one specified by using -T).
«

Thus a legal linker script line like:

   __boot_start = 0x12345 ;

in lib/defs/atmega12345 will augment the linker script which is already
being invoked, so that if the main script contains:

   .boot __boot_start : 
   {
     *(.boot_vectors)
     *(.boot)
   } > text

then the desired location should take effect. (And any future similar
customisations can be dropped into the already existing configuration
file.

If there are any hiccups, then please post. (Well, please post anyway.
:-)

Erik


-- 
You can't have everything.  Where would you put it?
                                    - Steven Wright



reply via email to

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