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.

Interpreting MAP file for .string

 

Hi

My intention was to place some const data structure in a MAP file. But after compilation when I see the .map file I see in the const section as below along with intended const data structures,

TelIntConstCore3
*          0    82802340    00004b8e     RUN ADDR = 12841340
                  82802340    00002c5a     SC_Tel.lib : Spv_TelParam.obj (.const:.string)

I am not able to interpret the (.const:.string) which is placed in Const section and its wuite huge. Please let me know how to understand this.

 

Thanks

Gangadhar

 

 

  • The .const:.string section will contain the string literals for initialized const variables. You can find general information about the sections generated by the compiler in the Compiler Users guide: http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals

     

  • Hi Aarti,

    Thanks for your answer.

    In the above example I mentioned. The c code doesn't have any const variables except for the function arguments which are recieved as const. I thought function arguments will reside under stack memory.

    The intention of grouping const was to place it in L2 memory for faster access. I think placing string literals in L2 is not good idea as I dont think it would improve or degrade CPU performance whether it is in L2 or DDR memory. Please clarify.

    If my understanding is correct. Is it possible just to keep the const string literals in one section and const data structures in another section.

    Thanks

    Gangadhar

  • The "other section" is .const:.string.  Just make sure you allocate that subsection in the linker command file before you allocate ".const"

  • So-called "L2" internal SRAM is normally faster than external SDRAM, so accessing the content of string literals would be faster if they are stored in the internal SRAM.  If external SDRAM is accessed repeatedly in a short stretch of code (which is not likely for string literals) *and* you have enabled the L2 cache (which is when the appellation "L2" is legitimate), that will speed up the access since most of it will be from L2 RAM.

    In typical C programming, string literals are almost exclusively used in connection with human-oriented I/O, so that access speed is not a significant concern, in which case you might as well leave string literals in external SDRAM or even in ROM.  (Writing a string literal is not guaranteed to work, according to the C standard, although when you have it in RAM the compiler will usually let you write to it.  That is not a good practice, quite apart from ROM issues, since some C implementations may use the tail of one string literal as another string literal when it exactly matches.)