[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: Stu Bell
Subject: RE: [avr-gcc-list] Howto put constants on fixed address
Date: Thu, 20 Dec 2007 08:43:07 -0700

> Thanks for the links, but that is not exactly what I am looking for. 
> Using this document I was able to create output like this:
> 0x0000-0x008F .vectors
> 0x0090-0x03FF gap
> 0x0400-0x041F my section
> 0x0420-       rest of the .text section

> The gap is empty - it's waste of the flash space. I have not found if
> is possible to put my section to any address and let linker to "flow 
> the .text section round it", it seems to me that it is not possible,
> I don't know why - the linker should be able to do this, it's not a
> task...

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.

My feeling is that you are asking quite a bit too much from the linker
to expect it to "flow" code around an obstacle in the middle of it's
memory map.  If you want to set up two sections, before and after "my
section" and assign code to each, you could succeed.  But as it is, I
don't think the linker comprehends a single section that comes in two

I'm not sure why you insist that it *must* be in the middle of your
code, but that's for you to know and decide.

The other option would be to put your code at the end of memory, maybe
butted up against the bootloader section in high memory.  Again, this
would be at a known fixed location, but might need to change for
different processors (another requirement that I do not understand).

Best regards, 

Stu Bell 
DataPlay (DPHI, Inc.) 

reply via email to

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