CW56800E & deadstripping

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

CW56800E & deadstripping

3,256 Views
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

Labels (1)
Tags (1)
0 Kudos
Reply
3 Replies

494 Views
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 Kudos
Reply

494 Views
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 Kudos
Reply

494 Views
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 Kudos
Reply