How can I disable "dead code stripping" in CodeWarrior?

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I disable "dead code stripping" in CodeWarrior?

390 Views
lukekim
Contributor II

Hello

I want to know how I can disable "dead code stripping" in CodeWarrior or ".lcf" file.

(I want all unused symbols, functions and variables, to be included in the elf image file.)

I found "KEEP" directive that I can use in .lcf file.

But, the indicative does not work correctly.

- .text() : { KEEP(*(.text)) }

My development environment:

- Window 7

- CodeWarrior for MCU Version 11.0

- MPC5674F

Thanks.

2 Replies

225 Views
stanish
NXP Employee
NXP Employee

Hi Luke,

Please try to use

 FORCEACTIVE { symbol1, symbol2,...}

 which works on symbol level

or 

 KEEP_SECTION { section1, section2...}
section level.

Hope it helps.

Stan

225 Views
lukekim
Contributor II

Hi Stan,

 

Thanks for your reply.

 

I have tried the following, but there's an error.

MPC5674F_FLASH.lcf

==> added : KEEP_SECTION {.text } // I added this code at line 130.

==> error message : '=' expected in command file at line '130'

 

Please let me know how to use it correctly.

Build ID of CodeWarrior for MCU is 170926.

FORCEFILES{} does not operate correctly also.

Thanks.

0 Kudos