This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How To Exclude Object Module (vectors) in rts55x.lib From Build?

Hello,

How do I exclude the vectors.obj module from the rts55x.lib from the build I am working on?

I have a vectors.obj that I do not want superseded by the vectors.obj in rts55x.lib.

I have attached the .map file.

Thanks In Advance,
John W.4137.3554.test.zip

  • Hello,

    This isn't the *only* way to do this - correct:

    F:\ti\ccsv6\tools\compiler\c5500_4.4.1\lib>..\bin\ar55 -r rts55x.lib vectors.obj
    ==> building archive 'rts55x.lib'

    F:\ti\ccsv6\tools\compiler\c5500_4.4.1\lib>

    Thanks,
    John W.
    PS - How to get the C5500_4.4.2 build - isn't that the latest?
  • This would be controlled by the linker command file. Does it refer to rts55x.lib<vectors.obj> by name?
  • Hello Archaeologist,

    You mean does my linker command file look something like:

    vectors > VECS /* Interrupt vectors */
    {
    -l=rts55x.lib <vectors.obj> (*.text)
    }

    Nope. I was hoping I could have my own vectors.asm and not have to touch the rts55x.lib with the proper linker command sequence.
    I suppose I can just delete vectors.obj from the lib also - but I'd rather not do that.

    The linker will 'stack' the vectors.obj from the lib on top of the vectors.obj that I have. Would have been OK if it did that backwards - but you know this already.

    Thanks,
    John
  • I was hoping you'd show me your linker command file. There are several ways you can get the vectors section to be added to the program, I was hoping to see which one is being used in your linker command file so i could recommend a specific fix.

    The linker only pulls in object files from a library if it is explicitly named in the linker command file, or if it defines a symbol that is not otherwise defined. The default vectors.obj from rts55x.lib defines one symbol: _Reset. If you define the symbol _Reset in your own vectors.obj, the linker will no longer require a definition of _Reset, so it should stop pulling vectors.obj in from rts55x.lib

    If that doesn't solve the problem, I'm probably going to need to see the linker command file.
  • Hello Archaeologist,

    Here it is (and attached too).

    5023.test.zip

    ******************************************************************************/

    /* LNKX.CMD - COMMAND FILE FOR LINKING C PROGRAMS IN LARGE/HUGE MEMORY MODEL  */

    /*                                                                            */

    /* Usage:                                                                     */

    /*  cl55 <src files> -z -o<out file> -m<map file> lnkx.cmd -l<RTS library>   */

    /*                                                                            */

    /* Description: This file is a sample command file that can be used for       */

    /*              linking programs built with the C Compiler.  Use it as a      */

    /*              guideline; you  may want to change the allocation scheme      */

    /*              according to the size of your program and the memory layout   */

    /*              of your target system.                                        */

    /*                                                                            */

    /*   Notes: (1) You must specify the directory in which <RTS library> is      */

    /*              located.  Either add a "-i<directory>" line to this file      */

    /*              file, or use the system environment variable C55X_C_DIR to    */

    /*              specify a search path for the libraries.                      */

    /*                                                                            */

    /******************************************************************************/

    -stack    0x2000      /* Primary stack size   */

    -sysstack 0x2000      /* Secondary stack size */

    -heap     0x5000      /* Heap area size       */

    -c                    /* Use C linking conventions: auto-init vars at runtime */

    -u _Reset             /* Force load of reset interrupt handler                */

    /* SPECIFY THE SYSTEM MEMORY MAP */

    MEMORY

    {

    PAGE 0:  /* ---- Unified Program/Data Address Space ---- */

     MMR    (RWIX): origin = 0x000000, length = 0x0000c0  /* MMRs */

     DARAM0 (RWIX): origin = 0x0000c0, length = 0x00ff40  /*  64KB - MMRs */

     SARAM0 (RWIX): origin = 0x010000, length = 0x010000  /*  64KB */

     SARAM1 (RWIX): origin = 0x020000, length = 0x020000  /* 128KB */

    /*  SARAM1 (RWIX): origin = 0x020000, length = 0x005000  */ /* 128KB */

    /*  SARAM2 (RWIX): origin = 0x040000, length = 0x00FE00 Can't go into SARAM31 space - 0x4e000-0x4ffff */ /*  64KB */

     SARAM2 (RWIX): origin = 0x040000, length = 0x00DFFA  /*  64KB */

     VECS   (RWIX): origin = 0x04FE00, length = 0x000200  /*  512B */

     PDROM   (RIX): origin = 0xff8000, length = 0x008000  /*  32KB */

    PAGE 2:  /* -------- 64K-word I/O Address Space -------- */

     IOPORT (RWI) : origin = 0x000000, length = 0x020000

    }

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

    SECTIONS

    {

      .text     >> SARAM1|SARAM2|SARAM0  /* Code                        */

      /* Both stacks must be on same physical memory page               */

      .stack    >  DARAM0                /* Primary system stack        */

      .sysstack >  DARAM0                /* Secondary system stack      */

      .data     >> DARAM0|SARAM0|SARAM1  /* Initialized vars            */

      .bss      >> DARAM0|SARAM0|SARAM1  /* Global & static vars        */

      .const    >> DARAM0|SARAM0|SARAM1  /* Constant data               */

      .sysmem   >  DARAM0|SARAM0|SARAM1  /* Dynamic memory (malloc)     */

      .switch   >  SARAM2                /* Switch statement tables     */

      .cinit    >  SARAM2                /* Auto-initialization tables  */

      .pinit    >  SARAM2                /* Initialization fn tables    */

      .cio      >  SARAM2                /* C I/O buffers               */

      .args     >  SARAM2                /* Arguments to main()         */

       vectors  >  VECS                  /* Interrupt vectors           */

    /*   {

                 vectors.obj

       }

    */

      .ioport   >  IOPORT PAGE 2         /* Global & static ioport vars */

    }

    In my vectors.asm - I had reset as _Rst - I guess that is where the confusion is coming from.

    Here is an excerpt from the .map file - not conflicting anymore:

    vectors      0     0004fe00  [ 00027f00 ] 00000100          *  

                      0004fe00  [ 00027f00 ] 00000100          *   vectors.obj (vectors)

    But I thought there was a way to force an object module in a linker file to be ignored - isn't there a way to do that?

    (other than manually changing the linker file?)

    Thanks For The Help,

    John W.

  • John Westmoreland43 said:
    In my vectors.asm - I had reset as _Rst - I guess that is where the confusion is coming from.

    That explains everything.  The spelling of the symbol name must exactly match.  In this specific case, that symbol is "_Reset".

    Thanks and regards,

    -George

  • John Westmoreland43 said:
    But I thought there was a way to force an object module in a linker file to be ignored

    Not that I'm aware of.  The linker tries to pull in only symbols that it needs.  If a section in a library is not needed to resolve some still-needed symbol, it is not pulled in.  Otherwise, it is pulled in.  If there were an option that said "not this section," if the section were not needed anyway, it wouldn't get pulled in, so the option had no effect.  If the section is actually needed, you get an undefined symbol error, which is undesirable.

  • So, Archaeologist and George,

    I can't do something like this:

    vectors > VECS /* Interrupt vectors */

    {

    vectors.obj (*.text)
    -l=rts55x.lib<vectors.obj> (*.text)


    }

    Or something of that fashion to make sure one has precedence over the other?

    Thanks,
    John W.
  • No, there's no syntax for "try this file, then that file" in the linker command file. Symbols in object files specified on the command line take precedence over those present in libraries. The expected use case is that if you want to override a symbol in the library, you define it in an object file in the project, but you've got to make sure to define the same symbol. In this case, that's _Reset. Alternately, you could modify the linker command file to define _Rst as an entry point with the "-u _Rst" option.
  • Ok Archaeologist,

    Thanks for your answers.

    Best Regards,
    John W.