ELF file format generated by S32 Design Studio

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ELF file format generated by S32 Design Studio

Jump to solution
2,246 Views
ZhouYiChuan
Contributor III

Hello NXP experts:

I've implemented a ELF file parser for MPC5642 ELF file generated by S32 DS. 

the TIS (Tool Interface Standard) ELF spec V1.2 is my reference. 

But my issue is:

For a struct type global variable or an array, only the start address can be parsed out from the ELF symbol section .  The address of its member is not found in symbol section. 

for example below is a struct:

typedef struct Ccp_Type
{
uint8_t Cro[8];/*command request object*/
uint8_t Crm[8]; /* CRM Command Return Message buffer */

boolean HasNewCro;
boolean IsInitialized;

uint8_t Ccp_Session_SM;

uint8_t SendStatus;

uint32_t MTA[CCP_MAX_MTA]; /* Memory Transfer Address */

}Ccp_Type;

the global variable is defined as:Ccp_Type ccp;

I can't get the address of its member e.g. ccp.Session_SM

Only address of the struct type global variable can be parsed out. 

Could you please provide a document to explain ELF format generated by S32 Design Studio?

Or some hint about how to find the member's address?

Vector tool ASAP2 editor can parse out the struct type variable member address like below:

Asap_snapshot.PNG

PS: 

the map file , elf file and ELF spec are attached.

thanks and BR

YiChuan

0 Kudos
1 Solution
2,238 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

by quick check with GNU readelf/objdump it looks, that the Ccp_Type structure is not used in your code. 

 

S32DS Uses GNU GCC - powerpc-eabivle-4_9 - the .elf output is standard elf gcc output for PowerPC. 

 

 

View solution in original post

0 Kudos
3 Replies
2,146 Views
Fiona_2022
Contributor I

Hello YiChuan,

 l have  a quetion that l can‘t update A2L file through ELF file,I hope you can give me some advices.

1.The Current toolchain is Standard S32DS toolchain for E200 

2. MCU is MPC5746.

3.I through S32DS software generates ELF file, Artifact type : E200 executable.

4. I should choice whice format of  MAP type?

Fiona_2022_0-1644464440593.png

5. I choose "ELF/ DWAFT 32 Bit " , that is invalid.

Fiona_2022_1-1644464549451.png

Looking forward to your reply!!

0 Kudos
2,116 Views
ZhouYiChuan
Contributor III

hello, 

maybe you should select *.elf file, not *.map file in ASAP2 editor. 

the *.map file is a text type file, it can be read by human, but not acceptable for ASAP2 editor.

Meanwhile *.elf is BIN type file. 

hopefully the suggestion can help you. 

thanks and BR

Yichuan

0 Kudos
2,239 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

by quick check with GNU readelf/objdump it looks, that the Ccp_Type structure is not used in your code. 

 

S32DS Uses GNU GCC - powerpc-eabivle-4_9 - the .elf output is standard elf gcc output for PowerPC. 

 

 

0 Kudos