[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] bootloader and irq vectors
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] bootloader and irq vectors |
Date: |
Fri, 20 May 2005 09:27:11 -0600 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
Marlin Unruh wrote:
I have read the FAQ on 'How do I relocate code to a fixed address?'
I have located sections as stated, but not a specific function. What
am I missing? Something obvious I fear.
My apologies. I thought that it was in the FAQ. I was wrong.
Take a look at the avr-libc user manual, the section on bootloaders:
<http://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html>
Go to the bottom of the page and take a look at the definition of
BOOTLOADER_SECTION. That is a #define to a "function attribute", which
is a GCC extension. This particular function attribute will place that
function in it's own, named section (in this particular case,
.bootloader). You can then relocate the section to a specific address,
as described in the FAQ.
Take a look at the GCC user manual about function attributes and
specifically named sections:
<http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html#Function-Attributes>
There is also a compiler switch that will place *all* functions within
their own, uniquely named sections, |-ffunction-sections|:
<http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Optimize-Options.html#Optimize-Options>
HTH
Eric