【发布时间】:2015-07-31 15:23:00
【问题描述】:
我想从 GCC 迁移到新的 ARM COMPILER 6。 但是我不能很好地将 Gnu liker 脚本 (ld) 转换为 ARM Scatter 文件的等价物。
原代码如下:
arm-none-eabi-ld -T link.ld test.o shared/bootcode.o shared/vertors.o -o test.elf
link.ld 脚本如下
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
但我没有成功创建有效的分散文件。我尝试使用 armlink 选项(--first、--last、--ro_base、--rw_base),但没有按预期进行(编译成功,但测试不起作用)。
请问有什么想法吗?
【问题讨论】:
-
您能分享一下您要切换到 armlink 的原因吗?