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.

What use of .switch in the linker file?



Hi,

I work on desktop Linux MCSDK and need to learn linker syntax now.


I check the linker file and don't find any description about .switch in the manual. Could you explain it to me with the following example?


Thanks,





//////////////////////////////
MEMORY
{
RAM: origin = 0x00000001, length = 0xFFFFFFFE
}

SECTIONS
{
.text :ALIGN(32) {} > RAM
.const :ALIGN(32) {} > RAM
.data :ALIGN(32) {} > RAM
.bss:ALIGN(32) {} > RAM
.cinit :ALIGN(32) {} > RAM
.pinit :ALIGN(32) {} > RAM
.stack :ALIGN(32) {} > RAM
.far:ALIGN(32) {} > RAM
.sysmem:ALIGN(8) {} > RAM
.switch:ALIGN(4) {} > RAM
.cio:ALIGN(4) {} > RAM
}

  • I'm not sure which compiler you use.  For now, I will guess it is the C6000 compiler.

    Robert William said:
    I work on desktop Linux MCSDK and need to learn linker syntax now.

    A good place to start is this wiki article.

    Robert William said:
    I check the linker file and don't find any description about .switch in the manual.

    The contents of any section are not described in the linker documentation.  See the C6000 compiler manual section titled Specifying Where to Allocate Sections in Memory.  That describes the contents of all the sections created by the compiler, including .switch.

    Thanks and regards,

    -George