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

Author: alex oliver (Company: none) (pointdexter)
Posted on:

Rate this post
0 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 :
    } >flash
    . = 0x000001F0;
     .text :
        _end_text = .;
    } >flash

then somewhere in the code I do something like

_attribute_ ((section(".vectors")))
void NMI_Handler(void)
  int a=0;
_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.


Author: MacLyon (Guest)
Posted on:

Rate this post
0 useful
not useful
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...


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.