cancel
Showing results for 
Search instead for 
Did you mean: 

eliminate unused functions out of linked file

wolfgang239955_stm1_st
Associate II
Posted on April 04, 2012 at 14:17

Hi,

I'm using COSMIC's CXSTM8 in STVD environment.

My Problem: With my last Compiler/Linker I was sure, that unused procedures automatically were not linked to the resulting file. Now I am rather short of programm memory and have to elaminate all the unused procedures of my funtional modules for each special project.

Can the programm do it for me? perhaps by an optimizing linker option????

Best regards,

WoRo

3 REPLIES 3
luca239955_stm1_st
Senior II
Posted on April 05, 2012 at 09:20

look for the +split compiler option.

Regards,

Luca

wolfgang239955_stm1_st
Associate II
Posted on April 10, 2012 at 10:56

Hello Luca,

thanks again for your prompt reply.

But using the +split option will enhance the code size :o( , and I can't find a way to set the linker option -k within my STVD environment. What is wrong??

Regards,

WoRo

luca239955_stm1_st
Senior II
Posted on April 11, 2012 at 09:50

I'm not sure I understand what you say, but +split, together with -k in the linker file (usually on the segment that contains the interrupt vectors) is what you need in order for the unused functions not to be linked. This will reduce your code size with no drawbacks (since you eliminate functions that are never called anyway)

I'm not expert about STVD, but I think I remember it does allow you to put the -k option on the segment you want. Even if it does not, you can always select the ''manual mode'' and edit the linker file with any standard editor.