EmbDev.net

Forum: ARM programming with GCC/GNU tools linker sections not considered


von alex o. (Company: none) (pointdexter)


Rate this post
useful
not useful
Hy forum,

I tried for several days to see how GNU arm behaves. I'm stuck into a 
loop here. I could use some help.

I have a linker script that contains:
    . = ORIGIN(flash);
     vectors :
    {
        *(.vectors)
    } >flash
    . = 0x000001F0;
     .text :
    {
        *(.text)
        *(.rodata)
        *(.rodata*)
        _end_text = .;
    } >flash

then somewhere in the code I do something like

_attribute_ ((section(".vectors")))
void NMI_Handler(void)
{
  int a=0;
  a++;
}
_attribute_ ((section(".text")))
void Reset_Handler(void)
{
    unsigned int *src, *dst;

the meaning of this code is not important as it is not correct

However I would expect function Reset_Handler to start from 1F0, yet in 
the lst file I see it starting from 2c    :|  ??

Second question

I would like to do something like

asm(".section .vectors");
asm("B Reset_Handler");

however when I see into the lst file...same problem... a function main 
that is supposed to go into .text beginning with 1F0 or higher, appears 
at 0x0 :|

What am I missing here?

I would appreciate some input.

Thanks

von MacLyon (Guest)


Rate this post
useful
not useful
Hi,
Check this link: http://www.emb4fun.de/arm/examples/index.html it 
provides some good examples and contain also a linker file - suppose you 
are using a Cortex micro...
MacLyon

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.