我想到的作法如下:
1.crt0.o和ILM function集中放到 .ilm section
2.ilm section放在load address 0
3.因為ILM大小是64KB,所以text, RO從load address 0x10000開始放
4.開機後將ilm section複製到ILM,並將interrupt vector table指向ILM
但這樣有個問題,crt0.o會同時放到text section,造成multiple definition of '_start':
Code:
ILM 0x00000000 0x00010000
{
LOADADDR __ilm_lmastart
ADDR __ilm_start
crt0.o (.text, +RO)
* (.ilm) ; functions to be put in ILM
LOADADDR __ilm_lmaend
ADDR __ilm_end
}
FLASH 0x00010000 0x00100000
{
* (.vector) ; program
* (+RO) ; const global variables
}
另外請教一下,".vector" 和 ".text" 是一樣的嗎?