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.

CCS/TMS570LS3137: Static variables not allocated in .bss

Expert 1995 points
Part Number: TMS570LS3137

Tool/software: Code Composer Studio

Hello,

When I define a variable as static the linker map file does not display it in the .bss section, while when the same variable is not static I can find it in the linker map. It should be actually the opposite, shouldn't it?

PS: I have all my optimization options turned off (by default) and the compiler is ARM Optimizing C/C++ Compiler v18.12.0.LTS. I have searched for some explanation inside the manual but unsuccessfully.

Thanks ahead for a reply.

Regards.

  • By default, static variables do not appear in the map file. To see them, add the option --mapfile_contents=sym_defs to the link command.

    Thanks and regards,

    -George

  • George Mock said:
    By default, static variables do not appear in the map file

    I did not find description about your command in the manual of the compiler (only an indication); can you tell me more about that? maybe additional options not described in the manual?

    I applied the command you suggested me, but I do not get the result: basically, the .bss section now is gone together with the non static variables and instead of them there are lists of functions and static variables for each .obj file. Does it mean the non static variables are not allocated any more? I am asking because before applying that command they where indicated with the reference segment of memory.

  • Please search the TI ARM assembly tools manual for the sub-chapter titled Managing Map File Contents.

    Thanks and regards,

    -George