Skip to main content
Visitor II
April 4, 2012
Question

eliminate unused functions out of linked file

  • April 4, 2012
  • 3 replies
  • 793 views
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

    This topic has been closed for replies.

    3 replies

    Visitor II
    April 5, 2012
    Posted on April 05, 2012 at 09:20

    look for the +split compiler option.

    Regards,

    Luca

    Visitor II
    April 10, 2012
    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

    Visitor II
    April 11, 2012
    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.