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.

Startadress of a subsection

Hello,

I like to organize some function-pointers in a subsection.

This looks like this:

#1:

static void foo(void);
const void* pfoo = foo;
#pragma DATA_SECTION(pfoo, ".text:_foosection")

#2:

static void foo2(void);
const void* pfoo2 = foo2;
#pragma DATA_SECTION(pfoo2, ".text:_foosection")

and so on.

Is there a possibility to get the start and end adress of the subsection ".text:_foosection" during linktime?

thanks

Rene

  • Yes, please see the Assembly Language Tools Users Guide for the processor family you are working with. http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals 

    Check the linker operators START, END etc in the section "Assigning Symbols at Link Time".

  • Hi AartiG

    thanks for your answer.

    I found a way. I put this to my linker file

       fooFunction   : > RAML0L1,   PAGE = 0,
       {
         *.obj(.fooFunction)
       } RUN_START(start_of_toofunc), RUN_END(end_of_foofunc)

    and I get this in my map file

    00008522   _foo1
    00008520   _foo2
    00008524   _foo3
    0000839a   _fooA
    0000839f   _fooB
    000082b3   _fooC
    00008526   end_of_foofunc
    00008520   etext
    00008520   start_of_toofunc

    Is there a possibility to do this without modify the linker comand file?

    To make this (start-, end-adress) for every section for examble with a linker option?

    Thank you very much

    René

  • There are some symbols automatically defined by the linker, for example, for the start and end address of .text, .bss and .data sections. The same chapter in the Users Guide documents this as well. For other custom sections you create you would need to add them to the linker command file using the START, END operators.