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.

Compiler: .init_array and modifying auto_init_elf, while keeping RTS library in tact



Tool/software: TI C/C++ Compiler

1.  Is it possible to include boot.c and autoinit.c in a project and build, but also include the TI version of RTS lib?

I'd like to modify this code to exclude regions; e.g., I want to control the constructor of images that are loaded as "tertiary" boot images.  I have, say, 4 images;  A bootloader, a core image which both load at the same time.  Based upon some input, I load another image's data into memory.  The core and this "other image" are part of the same out file, but are split into different binaries by modifying the linker command file to have special groups that go into fixed memory locations

/*------------------------------------------------------------------------auto_init_elf */
if (__TI_INITARRAY_Base != __TI_INITARRAY_Limit)
{
   int i = 0;
   while (&(__TI_INITARRAY_Base[i]) != __TI_INITARRAY_Limit)

      //pseudo code

     if (__TI_INITARRAY_Base[i] >=0xEB00_0000 )
      __TI_INITARRAY_Base[i++]();

      else don't call  a constructor that isn't loaded yet
}

2.  If answer to 1 is yes, then I am having trouble getting rid of three linker errors;  _c_int00, _stack, and one other. 

Reference to rts*.lib is in the linker file paths

Changed linker order to boot.obj, autoinit.obj and then rts*.lib as last lib. 

Any help is appreciated,

Thanks,

Will

Code Composer 5.x,

CGT 7.3.23

64x+ processor

Exceptions enabled,

Big Endian

  • ixworks said:
    1.  Is it possible to include boot.c and autoinit.c in a project and build, but also include the TI version of RTS lib?

    Yes.

    ixworks said:
    2.  If answer to 1 is yes, then I am having trouble getting rid of three linker errors;  _c_int00, _stack, and one other. 

    Please show exactly how the linker is invoked, along with all the resulting diagnostics.  I might be able to help you based on that alone.  But please don't be surprised if I ask you for the full CCS project.

    Thanks and regards,

    -George

  • Hi George,

    The bolded line below puzzles me---why are we using an RTS lib boot.ae64pe from the XDC tools?

    'Invoking: C6000 Linker'
    "C:/CCS_51/ccsv5/tools/compiler/c6000/bin/cl6x" -mv64+ --symdebug:none -O2 -ms0 --relaxed_ansi --rtti --gcc --define=_C6457L_ --define=PHY_MODE_100MBPS --define=BIGENDIAN --define=_64P_ --define=_TMS320C6400_PLUS --define=_INCLUDE_NIMU_CODE --define=C6457 --define=c6457 --define=EMAC_DEBUG --define=CPU_IP_DSP --display_error_number --diag_warning=225 --big_endian --abi=eabi --opt_for_speed=5 -z -m"MyProject.map" --warn_sections -i"C:/CCS_51/ccsv5/tools/compiler/c6000/lib" -i"C:/CCS_51/ccsv5/tools/compiler/c6000/include" --reread_libs --rom_model --zero_init=on -o "MyProject.out" -l"./configPkg/linker.cmd"  "./autoinit.obj" -l".\platform_libs\rts64pluse_elf_eh.lib" "./dspMainStub.lib" "./platform_libs/CSL_6457_BE_ELF.lib" "./platform_libs/EMAC_DRV_C6457_BE_ELF.lib" "./platform_libs/NDK_CORE_BE_ELF.lib" "./platform_libs/NIMU_ETH_BE_ELF.lib" "../finallnk.cmd"
    <Linking>
    error #10056: symbol "_auto_init_elf" redefined: first defined in
       "./autoinit.obj"; redefined in
       "C:\CCS_51\xdctools_3_23_02_47\packages\ti\targets\rts6000\lib\boot.ae64Pe<a
       utoinit.oe64Pe>"
    error #10010: errors encountered during linking; "MyProject.out" not
       built


    Would you like the diagnostics turned on or is this enough information?

    Thanks

    W

  • George,

    I think I have the answer now:

    1. Yes you have to include three "libraries" for the linker order.
    a. The auto_init.c file.
    b. The RTS lib
    c. Generated linker command files.

    Then, it works.

    Thank you!!