S12 Z linker optimization setting to keep the unused section

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

S12 Z linker optimization setting to keep the unused section

956 Views
pratibhasurabhi
Contributor V

S12Z Linker optimization setting

 

We are trying to implement unit testing for our code .For the unit testing tool to run it create stub functions of all the functions .These stub functions are not referenced in the code .It just needs to be linked in the object file created .

For previous version of codewarrior shown in the screenshot below there was option to keep or remove the unused sections.

 

pastedImage_1.png

 

Can you please tell how to do in present s12z linker setting  .As the linker is removing the unused objects in the object file created .

The present linker optimisation setting is this

pastedImage_2.png

 

Thanks in advance

Labels (1)
0 Kudos
Reply
1 Reply

714 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

There is no option can avoid all the optimization of compiler.

 If a variable or function is never used by program, it may be optimized by compiler. To prevent global variable  or function that being optimized, we need take use of “ENTRIES”.

in prm file, there is a section called “ENTRIES”, insert the global variables or functions into this section can avoid they optimized by compiler. For example,

ENTRIES

  var1 var2 func1 func2

END

 

Thus variable var1, var2 and function func1,func2 will not be optimized by compiler.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply