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.

Section ".far" in the image.

Other Parts Discussed in Thread: TMS320DM6437

Hello, all.

There's a section ".far" in the map files from TMS320DM6437. According to the MAP file this section should have non-initialized data.  

But my "static & initialized" variable is also placed to this section. So, my questions are:

    1) What is the difference of section ".far" from ".bss" or ".cinit" or ".pinit" or other?

    2) What kind of data (initialized, non initialized) have to be placed to this section?

Test-case is: I've created a simple project from a template. Adding a new one very simple "C" file (with static & initialized variable). Compile the project.

MAP file holds the following lines:

Line 197: .far       0    10809f88    0000090c     UNINITIALIZED

Line 212:                 1080a840    00000014     static_and_initalized.obj (.far)

So, i see the section is non-initialized but initialized data are placed there. Who's wrong?

5618.C6000_tester.zip

2538.C6000_tester.map.txt

P.S. The question is quite important for us.

  • Sergej,

    Does your program work and you do not understand why, or does your program have a problem with these variables?

    It sounds like you would find some answers in the C Compiler User's Guide where it talks about the various sections, and perhaps from some of the more detailed C language books.

    If you make compiler settings or source code declarations that use the .far section or the 'far' keyword, those variables will be placed in the .far or .fardata sections. If the variables need to be initialized, the compiler will see to it that the variables are properly initialized. So I am not sure if your are questioning whether the compiler works correctly or want to know why it works the way it does, but the compiler works very well and my guess is that no one is wrong.

    Please let us know if you are having problems with the functionality of the compiler, and we will have a Moderator move this thread to the Compiler Forum where that can be addressed best.

    Regards,
    RandyP

  • Hi,

    You will find answers in the compiler documents. Check whether the below link helps.

    http://www.ti.com/lit/ug/spru187u/spru187u.pdf

     

    Moved this thread to  TI C/C++ Compiler - Forum

    Regards,

    Shankari.

     

    --------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

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

     

  • General background is the section titled Specifying Where to Allocate Sections in Memory in the C6000 compiler manual.

    Sergej Sergeyuk said:
    2) What kind of data (initialized, non initialized) have to be placed to this section?

    The .far section contains uninitialized global and static variables.

    Sergej Sergeyuk said:
    Line 197: .far       0    10809f88    0000090c     UNINITIALIZED

    This says there is an output section named .far.  Its base address is 0x10809f88, and the length is 0x90c bytes.  It is an uninitialized section.

    Sergej Sergeyuk said:
    Line 212:                 1080a840    00000014     static_and_initalized.obj (.far)

    This says that one of the contributors to the .far output section is the .far input section from the file static_and_initialized.obj.  Despite the file name, the .far section in that file contains uninitialized variables.

    Thanks and regards,

    -George

  • Hi, all.

    Thank you for your time. We found the source of problem. It was a bug in legacy C6000 compiler version 6.0.xx.

    All is ok after upgrade of compiler. My problem was that some static data weren't initialized correctly.

    P.S. I found the static & initialized variable has not been initialized by CRT during loading of my program.

    Variable(s) has been placed to the section ".far" but their value weren't in the ".cinit" section.

    So we can close the thread. My problem was in completely different direction than i expected before.