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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

726件の閲覧回数
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 返答(返信)

561件の閲覧回数
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

561件の閲覧回数
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 件の賞賛