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/TMS320F28379D: DSECT Appears In the Output File

Part Number: TMS320F28379D

Tool/software: TI C/C++ Compiler

Greetings,

We have a project which, in the cmd file, declares a section with TYPE = DSECT. According to the documentation, a section marked as such should not be present in the output file. But when our post-build step looks at the .out file, that section is present. Is there something we don’t understand about the DSECT TYPE?

Thank you,

Ed

  • A DSECT section will be present in the .out file.  But it is not loaded to the target.  

    For example, here is a linker command file fragment that applies DSECT to the output section .reset ...

       .reset              : > RESET,     PAGE = 0, TYPE = DSECT

    Here is how it looks in the map file ...

    .reset     0    003fffc0    00000000     DSECT
    

    Use the object file display utility ofd2000 to see it another way.  Run a command similar to ...

    % ofd2000 -v -o ofd.txt final_executable_file.out

    Inspect the text file ofd.txt and search for the name of the output section that is DSECT.  It will look similar to ...

        <10> ".reset"
           Load Address:        0x003fffc0  Run Address:        0x003fffc0
           Size:                0x2         Alignment:          2         
           Loaded Onto Device:  No          Address Unit Size:  16 bits   
           File Offset:         0x0         # Relocs:           0         
           Reloc File Offset:   0x00000000  # Lines:            0         
           Line File Offset:    0x00000000  TI-COFF s_flags:    0x00000041
           TI-COFF s_flag:      STYP_DSECT  TI-COFF s_flag:     STYP_DATA

    The important detail to notice is that the Loaded Onto Device field is marked no.

    Thanks and regards,

    -George

  • Hi George,

    This confirms what I'm seeing.  Thank you for pointing out the utility.  I also see the flags field in the header.  It has a value of 0x161.  My document, SPRAAO8–April 2009, in Table7 Section Header Flags, does not mention the 0x100 part of the value.  Is there a more recent version of that document?

    Thank you,

    Ed

  • Those 4 bits of the section header flags are for alignment.  This paragraph is from the Common Object File Format application note ...

    Bits 8-11 of the section header flags are used for defining the alignment. The alignment is defined to be 2^(value of bits 8-11). For example if bits 8-11 are 0101b (decimal integer 5), then the alignment is 32 (2^5).

    Thanks and regards,

    -George

  • OK.  I see it now.  Thanks for your help George.

    Ed