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.

etext section output

Other Parts Discussed in Thread: SYSBIOS

Hello,
I can't find the etext symbol in map file with ELF compiler option. But I can find it with COFF. Is there a method to output the etext symbol when I compile with ELF? I refer to the chapter 7.5.8.4 in SPRU186W (Assembly Language Tools UG).
Regards

-mv6600 --abi=eabi -g --include_path="C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.4.2/include" --display_error_number --diag_warning=225 --diag_wrap=off

  • The symbol etext is not automatically created when building for EABI. You can create it yourself in the linker command file.  In the SECTIONS directive, have a line similar to:

    .text RUN_END(etext) > RAM

    That creates an output section named .text.  It's input sections are also named .text.  The RUN_END operator creates the symbol etext, and assigns it the first address after the end of this section.  The "> RAM" allocates .text to the memory range named RAM.

    Thanks and regards,

    -George

  • Hello,

    May I ask you a question? How can I do when I use the SYS/BIOS?

    I don't modify a linker file generated by SYS/BIOS. (/Debug/configPkg/linker.cmd)
    So I create following new linker file and add it to project.
    Then etext symbol is generated, but it doesn't indicate the end of .text section.

    Regards


    SECTIONS
    {
     .text RUN_END(etext) > L2SRAM
    }


    MEMORY CONFIGURATION
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      L2SRAM                00800000   00100000  000127ba  000ed846  RW X
      MSMCSRAM              0c000000   00200000  00000000  00200000  RW X
      DDR2                  80000000   10000000  00000000  10000000  RWIX

    SEGMENT ALLOCATION MAP
    run origin  load origin   length   init length attrs members
    ----------  ----------- ---------- ----------- ----- -------
    00800000    00800000    0000b840   0000b840    r-x
      00800000    00800000    0000b840   0000b840    r-x .text

    GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
    address    name
    --------   ----
    00800000   etext

  • Can you check the link command line?  I believe if your .cmd file is found first on the command line, then this .text specification will take precedence over the one from the generated linker.cmd file.


    Thanks,
    -Karl-

  • Hello,

    When I build with CCS, the console output following link message. Does it mean linker.cmd(generated cmd file) is 1st and C6678.cmd(my cmd file) is 2nd?
    Also I confirmed that there are two .text section in the map file. I think that .text section which is zero length is generated by my linker(C6678.cmd).

    Could you give me some advices?
    Regards

    ' '
    'Building target: memory_map_test_sysbios.out'
    'Invoking: C6000 Linker'
    "C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.4.2/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 --diag_wrap=off -z -m"memory_map_test_sysbios.map" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.4.2/lib" -i"C:/Program Files/Texas Instruments/C6000 Code Generation Tools 7.4.2/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model -o "memory_map_test_sysbios.out" -l"./configPkg/linker.cmd"  "./hello.obj" -l"libc.a" "../C6678.cmd"
    <Linking>
    'Finished building target: memory_map_test_sysbios.out'
    ' '

    SECTION ALLOCATION MAP

     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .text      0    00800000    00000000     UNINITIALIZED

    .text      0    00800000    0000b840    
                      00800000    000009a0     ti.targets.rts6000.ae66 : System.oe66 (.text:xdc_runtime_System_doPrint__I)
                      008009a0    00000780     sysbios.lib : BIOS.obj (.text:ti_sysbios_family_c64p_Exception_handler__I)

  • The first section specification wins, so the generated .cmd file is winning.  I don't know how to get your linker.cmd file to be linked first.  I thought that there was a way to control the .cmd file order, but I can't figure it out.

    I found another solution.  It is possible to exclude sections from the generated .cmd file with something like this.   I tried it and it worked.  See attached .zip file and docs below.

    4276.exclude.zip

    Program.sectionsExclude = "^\.text$";

  • Hello,

    Thank you for your advice. I was confirmed it.

    Regards

  • Hi,

    You can rearrange the link-order through the project's Properties > Build > Link Order tab:

    - Baltasar