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

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

Re: [avr-gcc-list] Put text string after interrupt vectors


From: Erik Christiansen
Subject: Re: [avr-gcc-list] Put text string after interrupt vectors
Date: Tue, 16 Aug 2005 18:09:07 +1000
User-agent: Mutt/1.5.6+20040722i

On Mon, Aug 15, 2005 at 12:32:04PM +0200, Lars Noschinski wrote:
> I'm rewriting an assembler program to C, which had a signature string
> at 0x20 in the flash memory. I tried to reproduce this with
> const char signature[] __attribute__ ((section (".signature"))) = 
> "signature";
> and the linker option --section-start=.signature=0x0020, but this
> doesn't work, because it overlaps with the .text section:
> 
> /usr/lib/gcc/avr/3.4.3/../../../../avr/bin/ld: section .text [00000000
> -> 0000009f] overlaps section .signature [00000020 -> 00000040]

Have you considered what is in the first 0x20 code bytes? If the
signature is placed there, what are you hoping happens to the interrupt
vectors? (IIRC the mega64 vectors go to 0x30, for example. :-)

> Is there a way to tell gcc (or ld) to put the signature at 0x20? If not,
> is there at least a way to guarantee, that the signature is "anywhere
> near the beginning" of the flash memory?

What about putting the .signature section's start just above the
vectors, and providing .text with a section start above that? This is an
ideal time to write a custom linker script, since you'll need to move
"*(.vectors)" out of .text, to do that. :-)

Alternatively, you might get away with just inserting the line:

*(.signature)

immediately after the "*(.vectors)" line in avr-gcc's default linker
script. The reset vector should then reach over, on its way to _start.
Oh, if you omit the --section-start stuff in this case, it'll butt up
after the vectors. (Likely to work, but untested, I'm afraid.)

hth,
Erik



> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list


-- 
 _,-_|\    Erik Christiansen                    Phone: +61 3 9264 3416
/      \   Research & Development Division        Fax: +61 3 9264 3438
\_,-.__/   Voice Products Department
      v    NEC Business Solutions Pty. Ltd.     www.necbs.com.au




reply via email to

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