Yes. I noticed that without optimization, the linker keep the order the
functions appear in the code but if I turn on optimization (-Os) then the
smaller function comes first.
Actually the small function is
void i2cWaitForComplete(void)
{
while( !(TWCR & _BV(TWINT)) ); /* wait for the i2c interface to
complete operation */
}
I could simply inline it but as I'm really short in place and it 's called
a couple of times in the bootloader, I would prefer to have it as a
standard function.
On Wed, 18 Jan 2006 18:32:14 +0100, Eric Weddington
<[EMAIL PROTECTED]> wrote:
David Bourgeois wrote:
I have a bootloader that I would like to start at 0x0E00 in an
ATMega48 (no special boot loader section in FLASH). It has 2 functions
that should be placed in the following order: bootloader(),
smallFunction().
I created a .bootloader section and I ask the linker to put it at
0x0E00 and associated bootloader() with tis section.
But if I also put smallFunction() in the .bootloader section, then
it's placed first at 0x0E00 and bootloader() comes later which is not
what I want. It seems I need some kind of subsections like the .initX
sections. But then I'm completely lost in the linker manual.
Does anybody knows how to do this?
Does your smallFunction() come before bootloader() in your .c file?
--
David Bourgeois
C2ME - Centre de Conception en Microtechnologies Européen sa
Parc Initialis - Rue René Descartes, 2 - 7000 Mons (Belgium)
Phone : +32 65 37 42 25 - Fax +32 65 37 42 36
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list