我想从GCC迁移到新的ARM编译器6。
但是我无法将Gnu链接器脚本(ld)很好地转换为ARM Scatter文件的等效文件。
以下是原始代码:
arm-none-eabi-ld -T link.ld test.o shared/bootcode.o shared/vertors.o -o test.elf
脚本如下:
ENTRY(bootcode)
SECTIONS
{
. = 0x00000000;
/* Code starts with vectors, then bootcode, then other code */
.text :
{
*vectors.o(vectors)
*bootcode.o(boot)
*(.text) /* remainder of code */
} =0
.data : { *(.data) }
.bss : { *(.bss) }
/* Notes section
* This is not used so we discard it. Although not used it needs to be
* explicitly mentioned in the linker script as some toolchains will place
* the notes section at adderss 0 if it is not explicitly mentioned*/
/DISCARD/ : { *(.note*) }
}
我想使用 armlink 作为链接器:
armlink --cpu=8-A.32 --entry=bootcode test.o shared/bootcode.o shared/vertors.o -o test.elf --scatter=ld.scat
但我没有成功创建有效的scatter文件。我尝试使用armlink选项(--first,--last,--ro_base,--rw_base)进行操作,但是什么都不如预期(编译成功但测试无法运行)。
有什么想法吗?