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.

executable file format and section



Hello everyone,

I am new to DSP, and I have two questions.

1, I read the user manual, it says the executable file is COFF, but I saw somewhere else ,the executable file is .dxe, which is said to be a ELF file.also the article says the .exe is a COFF format. Is this because that different companies using different executable format?

I am confused with this, can anyone give me an answer?

 

2, when I read the .asm file, I found that the ".text" is written in a very strange way like the following:

------------

    .sect    ".text"
    .global    _AvgFirCoeff
    .sym    _AvgFirCoeff,_AvgFirCoeff, 51, 2, 256,, 16
    .bss    _OutputDataMem,2,2
    .sym    _OutputDataMem,_OutputDataMem, 3, 3, 16

    .sect    ".cinit:c"
    .align    4
    .field      _OutputDataMem,32        ; _OutputDataPtr @ 0

    .sect    ".text"
    .global    _OutputDataPtr
_OutputDataPtr:    .usect    ".bss:c",4,4
    .sym    _OutputDataPtr,_OutputDataPtr, 19, 2, 32

    .sect    ".cinit:c"
    .align    4
    .field      4,32            ; _GUARD_BITS @ 0


    .sect    ".text"
    .global    _GUARD_BITS
_GUARD_BITS:    .usect    ".bss:c",4,4

---------

I am wondering why the .text section can not be written once, instead a new section ".cinit:c" is inserted and we have lots of segments of .text section and .cinit:c section.

Is this the tradition to write DSP assembly? if so can anyone explain why?

Thank you very much.

-da

  • Hi da,

    I will answer your first question:

    da cheng said:
    1, I read the user manual, it says the executable file is COFF, but I saw somewhere else ,the executable file is .dxe, which is said to be a ELF file.also the article says the .exe is a COFF format. Is this because that different companies using different executable format?

    The DSP executable is a .out file. For details please see text from the: TMS320C6000 Optimizing Compiler v 7.0 User's Guide :

    These features pertain to output files created by the compiler:

     -- Common object file format (COFF) allows you to define your system's memory map at link time. This

    maximizes performance by enabling you to link C/C++ code and data objects into specific memory

    areas. COFF also supports source-level debugging.

     -- Executable and linking format (ELF) enables supporting modern language features like early template

    instantiation and export inline functions support.

     Please also see: http://processors.wiki.ti.com/index.php/C6000_EABI:C6000_EABI_Migration

  • da cheng said:

    1, I read the user manual, it says the executable file is COFF, but I saw somewhere else ,the executable file is .dxe, which is said to be a ELF file.also the article says the .exe is a COFF format. Is this because that different companies using different executable format?

    I am confused with this, can anyone give me an answer?

    Please see http://processors.wiki.ti.com/index.php/A_Brief_History_of_TI_Object_File_Formats .  

    da cheng said:

    I am wondering why the .text section can not be written once, instead a new section ".cinit:c" is inserted and we have lots of segments of .text section and .cinit:c section.

    Is this the tradition to write DSP assembly? if so can anyone explain why?

    No, that is not how hand-coded assembly usually appears.  The example you give is C compiler output.  The compiler implementation places more weight on ease of implementation than readability of the output.  Even so, once you get used to it, this output is not that hard to read.  I mostly ignore the directives associated with changing sections.

    Thanks and regards,

    -George

     

  • Thank you George.

    -da

  • Thank you Mariana

    Da

  • Hello again,

    I need to read the disassembly code from C compiler, like the following, is there any manual that I can reference?

    I have the assembly language reference, which is one of the TI user manuals, but it does not explain those.

    00000248          DW$L$_fft$2$B, L1:
    00000248 023DC2E6            LDW.D2T2      *+SP[0xE],B4
    0000024C 00006000            NOP           4
    00000250 0210205A            ADD.L2        1,B4,B4
    00000254 023DC2F6            STW.D2T2      B4,*+SP[0xE]
    00000258 00002000            NOP           2
    0000025C 023D02E6            LDW.D2T2      *+SP[0x8],B4
    00000260 00006000            NOP           4
    00000264 0210807A            ADD.L2        B4,B4,B4
    00000268 023D02F6            STW.D2T2      B4,*+SP[0x8]
    0000026C 00002000            NOP           2
    00000270 023C42E6            LDW.D2T2      *+SP[0x2],B4
    00000274 02BD02E6            LDW.D2T2      *+SP[0x8],B5
    00000278 00006000            NOP           4
    0000027C 0010AA7A            CMPEQ.L2      B5,B4,B0
    00000280 3FFFF910     [!B0]  B.S1          L1
    00000284 00008000            NOP           5
    00000288          DW$L$_fft$2$E:
    00000288 0293E9A2            SHRU.S2       B4,0x1f,B5
    0000028C 0210A07A            ADD.L2        B5,B4,B4
    00000290 02102DA2            SHR.S2        B4,0x1,B4
    00000294 023DA2F6            STW.D2T2      B4,*+SP[0xD]
    00000298 00002000            NOP           2
    0000029C 0200012A            MVK.S2        0x0002,B4
    000002A0 023E02F6            STW.D2T2      B4,*+SP[0x10]
    000002A4 00002000            NOP           2
    000002A8 020000FA            ZERO.L2       B4
    000002AC 023D02F6            STW.D2T2      B4,*+SP[0x8]
    000002B0 00002000            NOP           2
    000002B4 023DC2E6            LDW.D2T2      *+SP[0xE],B4
    000002B8 02BD02E6            LDW.D2T2      *+SP[0x8],B5
    000002BC 00006000            NOP           4
    000002C0 0010AAFA            CMPLT.L2      B5,B4,B0
    000002C4 30005D10     [!B0]  B.S1          DW$L$_fft$9$E
    000002C8 00008000            NOP           5
    000002CC          DW$L$_fft$4$B, L2:

    -da

  • Hello again,

    I need to read the disassembly code from C compiler, like the following, is there any manual that I can reference?

    I have the assembly language reference, which is one of the TI user manuals, but it does not explain those.

    00000248          DW$L$_fft$2$B, L1:
    00000248 023DC2E6            LDW.D2T2      *+SP[0xE],B4
    0000024C 00006000            NOP           4
    00000250 0210205A            ADD.L2        1,B4,B4
    00000254 023DC2F6            STW.D2T2      B4,*+SP[0xE]
    00000258 00002000            NOP           2
    0000025C 023D02E6            LDW.D2T2      *+SP[0x8],B4
    00000260 00006000            NOP           4
    00000264 0210807A            ADD.L2        B4,B4,B4
    00000268 023D02F6            STW.D2T2      B4,*+SP[0x8]
    0000026C 00002000            NOP           2
    00000270 023C42E6            LDW.D2T2      *+SP[0x2],B4
    00000274 02BD02E6            LDW.D2T2      *+SP[0x8],B5
    00000278 00006000            NOP           4
    0000027C 0010AA7A            CMPEQ.L2      B5,B4,B0
    00000280 3FFFF910     [!B0]  B.S1          L1
    00000284 00008000            NOP           5
    00000288          DW$L$_fft$2$E:
    00000288 0293E9A2            SHRU.S2       B4,0x1f,B5
    0000028C 0210A07A            ADD.L2        B5,B4,B4
    00000290 02102DA2            SHR.S2        B4,0x1,B4
    00000294 023DA2F6            STW.D2T2      B4,*+SP[0xD]
    00000298 00002000            NOP           2
    0000029C 0200012A            MVK.S2        0x0002,B4
    000002A0 023E02F6            STW.D2T2      B4,*+SP[0x10]
    000002A4 00002000            NOP           2
    000002A8 020000FA            ZERO.L2       B4
    000002AC 023D02F6            STW.D2T2      B4,*+SP[0x8]
    000002B0 00002000            NOP           2
    000002B4 023DC2E6            LDW.D2T2      *+SP[0xE],B4
    000002B8 02BD02E6            LDW.D2T2      *+SP[0x8],B5
    000002BC 00006000            NOP           4
    000002C0 0010AAFA            CMPLT.L2      B5,B4,B0
    000002C4 30005D10     [!B0]  B.S1          DW$L$_fft$9$E
    000002C8 00008000            NOP           5
    000002CC          DW$L$_fft$4$B, L2:

    -da

  • I presume you are building for C6400 or C6400+.  In that case, the instructions are described in this manual http://www.ti.com/lit/pdf/spru732 .

    Thanks and regards,

    -George