CW56800E & deadstripping

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

CW56800E & deadstripping

3,257件の閲覧回数
admin
Specialist II
I have some constants in my program. They are not used in program but can be read via CAN. During linking this constants deleted. I tried to edit linker file and use KEEP_SECTION {.const.data} but i does not like this way (need to disable generating linker file in PE).

Also i tried to use #pragma opt_dead_code but it does not work - why.
What else can i do?

Message Edited by Alexey on 2006-12-0410:29 AM

ラベル(1)
タグ(1)
0 件の賞賛
返信
3 返答(返信)

495件の閲覧回数
CrasyCat
Specialist III
Hello
 
I am not an expert in DSP tools, but you may want to try the following.
 
According to my understanding, you want to link some symbols even though they are not used within the application, but you do not want to do that in the linker command file. Am I right?
 
In that case you can use the M56800 Linker and enumerate the symbols in the Force Active Symbols edit box.
As far as I can tell there is no pragma to disable dead stripping.
 
CrasyCat
0 件の賞賛
返信

495件の閲覧回数
admin
Specialist II
Thanks for response.


CrasyCat wrote:

In that case you can use the M56800 Linker and enumerate the symbols in the Force Active Symbols edit box.

CrasyCat




Yes, you are right. But set of these symbols can be changed during program editing/debugging - old/unneeded constants can be deleted and new ones can be added.


CrasyCat wrote:

As far as I can tell there is no pragma to disable dead stripping.


CrasyCat





From CW help:


56800E BTR/10 Pragmas/Optimization pragmas

opt_dead_code

Controls the use of dead code optimization.

Syntax

#pragma opt_dead_code on | off | reset

Remarks

If you enable this pragma, the compiler removes a statement that other statements never execute or call.





Does this pragma workes?

Message Edited by Alexey on 2006-12-0510:58 AM

0 件の賞賛
返信

495件の閲覧回数
CrasyCat
Specialist III
Hello
No, this pragma is for dead code only.
 
For instance if you have something like
while (1) {
  i++;
}
 
foo(i);
 
Compiler will not generate code for the invocation foo(i) as it comes after a never ending loop.
That is what I would call dead code. This will not help you to link unused variables to the application.
 
CrasyCat
0 件の賞賛
返信