[Top][All Lists]

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

Re: [avr-gcc-list] Howto put constants on fixed address

From: David Kelly
Subject: Re: [avr-gcc-list] Howto put constants on fixed address
Date: Thu, 20 Dec 2007 12:15:13 -0600
User-agent: Mutt/

On Thu, Dec 20, 2007 at 08:43:07AM -0700, Stu Bell wrote:
> You're going to need to become a real expert in linker scripting to
> even come close to doing this.  Joerg & company might be able to help
> with this.  Also, using either cygwin or linux, do an "info ld" to
> find out more on how to do linker scripts.

Does executable code *have* to go in a section named .text? Once its in
the AVR at the proper address the AVR won't know any difference. What
about the debugger? Seems like most of this is done by address?

Dug out my old Introl linker file and this was the most interesting:

section .text origin TEXTORIGIN 
        maxsize H11VECORG-TEXTORIGIN
        = .text .data .strings .const;

section .text1 origin 0x8000 
        maxsize 0xb000-0x8000
        = .text .data .strings .const;

section .data 
        = .text .data .strings .const;

Notice incoming sections can have same name as outgoing, and there isn't
any limitation on including input sections as permissible for placement
in more than one section. Will only be placed once in the first place it

So why not add a .text1 section to the AVR's link editor file and end
the existing .text at 0x03ff, insert a .foo, then continue with a
.text1 listing the input .text as valid to place in both the output
.text and the output .text1?

Or continue with a .text1 but the first input section be named .foo in
output .text1?

I would be very disappointed if GNU ld is not capable of doing this.
Placing object code around fixed obstacles is a common embedded task.
And not uncommon in non-embedded applications.

David Kelly N4HHE, address@hidden
Whom computers would destroy, they must first drive mad.

reply via email to

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