现在用S32Develop Studio调试S32K148芯片的时候,遇到一个问题,
链接文件如下所示,通过objdump文件查看data段和code段的属性后,发现data段的VMA和LMA(用黑色标注)是正确的,一个放在RAM空间,一个放在Flash空间;
但是.code段怎么不是呢?其VMA和LMA地址(用黑色标注)都是放在RAM空间呢?
一、objdump的结果:
Sections:
Idx Name Size VMA LMA File off Algn
0 .interrupts 00000400 00000000 00000000 00010000 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .flash_config 00000010 00000400 00000400 00010400 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .text 00002178 00000410 00000410 00010410 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
3 .interrupts_ram 00000400 1ffe0000 1ffe0000 00030000 2**0
ALLOC
4 .data 00000348 1ffe0400 00002588 00020400 2**3
CONTENTS, ALLOC, LOAD, DATA
5 .code 00000000 1ffe0748 1ffe0748 0002f000 2**0
二、linker文件内容:
.data : AT(__DATA_ROM)
{
. = ALIGN(4);
__DATA_RAM = .;
__data_start__ = .; /* Create a global symbol at data start. */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
__data_end__ = .; /* Define a global symbol at data end. */
} > m_data
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
__CODE_ROM = __DATA_END; /* Symbol is used by code initialization. */
.code : AT(__CODE_ROM)
{
. = ALIGN(4);
__CODE_RAM = .;
__code_start__ = .; /* Create a global symbol at code start. */
__code_ram_start__ = .;
*(.code_ram) /* Custom section for storing code in RAM */
. = ALIGN(4);
__code_end__ = .; /* Define a global symbol at code end. */
__code_ram_end__ = .;
} > m_data
|