[arm-gnu] a function at a fixed offset
Carlos O'Donell
carlos_odonell at mentor.com
Mon Jun 11 13:15:38 UTC 2012
On 6/9/2012 5:38 AM, Martin Velek wrote:
> e.g. without optimisation
> 0x0 - 0x1A0 ... init code
> 0x200 - IAP
> ...... other functions
>
> e.g. with -Os
> 0x0 - 0x100 ... init code
> 0x100 - 1A0 .. any possible small function that will fit here
> 0x200 - IAP
> ...... other functions
You can definitely do the following:
* At -Os __OPTIMIZE_SIZE__ is defined.
* Define a section in your linker script and place it in the gap.
* When the -Os macro is not defined leave the functions as they are.
* When the -Os macro is defined add the section attribute to the functions
which places them in the section that resides in teh gap.
You might be able to do the following:
* At -Os define some symbol.
* Define a section in your linker script and fill it with
some functions you know fit in the gap.
* if DEFINED(symbol) then place the section in the gap.
* if !DEFINED(symbol) then leave the section somewhere else.
These are just suggestions and I've not tried them.
The easy solution is to have two linker scripts.
Cheers,
Carlos.
--
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026
More information about the arm-gnu
mailing list