Gcc .vectors被gnu链接器中的.text覆盖
我在gnu arm embedded 4.9 2014q4的链接器脚本中定义了以下部分:Gcc .vectors被gnu链接器中的.text覆盖,gcc,linker,ld,Gcc,Linker,Ld,我在gnu arm embedded 4.9 2014q4的链接器脚本中定义了以下部分: MEMORY { SRAM_L (rwx) : ORIGIN = 0x00000000, LENGTH = 32K SRAM_U (rwx) : ORIGIN = 0x20000000, LENGTH = 32K } SECTIONS { . = ORIGIN(SRAM_L); .isr_vector : { KEEP(*(.isr_vector)
MEMORY
{
SRAM_L (rwx) : ORIGIN = 0x00000000, LENGTH = 32K
SRAM_U (rwx) : ORIGIN = 0x20000000, LENGTH = 32K
}
SECTIONS
{
. = ORIGIN(SRAM_L);
.isr_vector :
{
KEEP(*(.isr_vector))
} >SRAM_L
.text :
{
. = ALIGN (4);
*(.text);
} >SRAM_L
vectors.S包含以下代码:
/* vectors.s */
.section .isr_vector
.thumb
.word _start_of_stack /* stack top address */
.word _reset /* 1 Reset */
.word hang /* 2 NMI */
.word hang /* 3 HardFault */
...
.thumb_func
.global _reset
_reset:
mov r0, #0
ldr r1, [r0]
mov sp, r1
bl low_level_init
b hang
.thumb_func
hang: b .
当程序链接时,.text和.vector部分重叠出现在映射文件中:
.isr_vector 0x00000000 0x146
*(.isr_vector)
.isr_vector 0x00000000 0x146 ./src/vectors.o
0x00000138 _reset
.text 0x00000000 0x6cc
0x00000000 . = ALIGN (0x4)
*(.text)
.text 0x00000000 0x134
关于.text的位置是否有我遗漏的规则?我在上找到了一些信息 看起来我的向量中缺少以下内容。我相信这表明链接器的类型(.data)和大小是否正确?(如果我错了,请纠正我)
/* vectors.s */
.syntax unified
.cpu cortex-m4
.fpu softvfp
.thumb
.global g_pfnVectors
.global _reset
.global hang
/*******************************************************************************
*
* The minimal vector table for a Cortex M4. Note that the proper constructs
* must be placed on this to ensure that it ends up at physical address
* 0x0000.0000.
*******************************************************************************/
.section .isr_vector,"a",%progbits
.type g_pfnVectors, %object
.size g_pfnVectors, .-g_pfnVectors
g_pfnVectors:
.word _start_of_stack /* stack top address */