AnsweredAssumed Answered

The segment information from objdump is not consistent with the information specified in the Linker file.

Question asked by kongdetao@saicmotor.com on Dec 28, 2018
Latest reply on Jan 1, 2019 by kongdetao@saicmotor.com

Development environment:  S32K148+ S32 Develop Studio for arm 

 

Now compile a S32K148 program, and then use the objdump tool to print out the segment information of the file, and found a problem: the result of objdump shows that the LMA address of the code segment is inconsistent with the address specified by Linker?

 

The results of objdump are as follows:

 

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
CONTENTS

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

Outcomes