linker sections not considered

OP (Company: none) #3102891
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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.