How to remove STRTAB and SYMTAB sections from ELF using Codewarrior options.

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

How to remove STRTAB and SYMTAB sections from ELF using Codewarrior options.

1,756 Views
Luke_K
Contributor II

Hi,

I would like to remove Debug Section (including STRTAB and SYMTAB) in ELF using Codewarrior compile options.

I set to Off for "Generate DWARF Information".

But, ELF still has STRTAB and SYMTAB sections.

Please let me know how to remove STRTAB and SYNTAB from ELF.

Can I use strip ccmd? If possible, let me know how to use it.

 

Codewarrior Version : Version 11.0

 

Thanks.

Tags (2)
0 Kudos
Reply
6 Replies

1,670 Views
Luke_K
Contributor II

Hello, Celeste_Liu.

Thanks for your kind reply.

I am using the CodeWarrior for MCU version 11.0.

My IDE is slightly different with images in your comments.

 

There are no "Generate ELF Symbol Table" and "Generate binary flash image" menus, but there is a "Generate ROM Image" menu.

The "Generate ROM Image" menu is always checked.

If we unchecked the menu, we can't make an elf image file.

 

Thanks.

0 Kudos
Reply

1,654 Views
Celeste_Liu
NXP Employee
NXP Employee

I'm sorry that I wasn't help you. I'm using CodeWarrior version 11.1. I suggest that you ask questions in the following forum to see if they have any new ideas.

MPC5xxx - NXP Community

BRs,

Celeste

0 Kudos
Reply

1,699 Views
Luke_K
Contributor II

Hello Celeste_Liu,

 

Thanks for your reply.

But, I don't know how to use your comments.

I am using MPC5674F.

Could you explain it in more detail, please?

I can't find any file releated to the "strip" at "Freescale" folder.

And, When I added your advice to the Post-build steps in CodeWarrior, I got an error saying that the 'strip' command could not be found.

 

Thnaks.

0 Kudos
Reply

1,728 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @Luke_K ,

Thanks for your post. I think you can use strip command to remove STRTAB and SYNTAB from ELF. Could you please try "strip --remove-section=.symtab file" and "strip --remove-section=.strtab file"?

And could you please tell me which chip you are using? 

Hope it can help you.

BRs,

Celeste

1,692 Views
Luke_K
Contributor II

Hello Celeste_Liu,

 

Thanks for your reply.

But, I don't know how to use your comments.

I am using MPC5674F.

Could you explain it in more detail, please?

I can't find any file releated to the "strip" at "Freescale" folder.

And, When I added your advice to the Post-build steps in CodeWarrior, I got an error saying that the 'strip' command could not be found.

 

Thnaks.

0 Kudos
Reply

1,675 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @Luke_K ,

I haven't used MPC series chips before. I choose an ELF file of MC56F84789 for testing. The strip command can be used in the Ubuntu system. Unfortunately, the ELF format of MC56F84789 couldn't be recognized by it.

Celeste_Liu_0-1736233472683.png

You can try this command "strip -R.strtab -R.symtab xxx.elf" with your file. I have another idea for your reference. You can directly generate the binary file format. It won't contain the contents of symtab and strtab, and the file size is much smaller compared to that of an elf.  file.

Settings for generating BIN files in CodeWarrior:

1. Select your project, and then click project - properties.

Celeste_Liu_1-1736234128209.png

 

2. Find "generate binary flash image" according to the picture below.

Celeste_Liu_2-1736234293058.png

 

Hope it can help you.

BRs,

Celeste

0 Kudos
Reply