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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

722 次查看
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 回复数

557 次查看
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

557 次查看
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 项奖励