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.
Hi,
CCS 5.1.0.201104171800, CGT 4.7.1.
A very simple question and I'm embarrased that I haven't been able to find the answer myself. My .MAP file output does not contain information related to static variables, neither module nor function level. Global module variables are present in the .MAP file.
What option do I have to select to get statics to appear in my .MAP file?
Regards, Tony.
Tony,
The link map file, by default, does not contain static variables, but this page should help you get what you are looking for:
http://processors.wiki.ti.com/index.php?title=Find_Static_Functions_and_Variables
Hi Aarti,
I've tried the suggestions in the paper with no success. I have enabled assembler -as option even though I already had -g option enabled. I have changed --mapfile_contents from 'all' to 'sym_defs'.
My compiler and linker flags are as follows:
'Flags: --cmd_file="C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\Compiler.opt" -mv7R4 -g -O3 --opt_for_speed=5 --define=BANANABOARD --define=FIQ_SCHEDULE_CHECK --define=MOTOR_CONTROL --define=DET_ENABLED --include_path=<lots> --diag_warning=225 --diag_remark=97 --enum_type=packed --elf --abi=eabi --code_state=32 --float_support=VFPv3D16 --plain_char=unsigned --gen_opt_info=2 -k --c_src_interlist --asm_listing --output_all_syms --preproc_with_compile --preproc_dependency="Ancillary/Std_TypesPd.pp" --obj_directory="Ancillary"'
'Flags: --cmd_file="C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\Compiler.opt" -mv7R4 -g -O3 --opt_for_speed=5 --define=BANANABOARD --define=FIQ_SCHEDULE_CHECK --define=MOTOR_CONTROL --define=DET_ENABLED --diag_warning=225 --diag_remark=97 --enum_type=packed --elf --abi=eabi --code_state=32 --float_support=VFPv3D16 --plain_char=unsigned --gen_opt_info=2 -k --c_src_interlist --asm_listing --output_all_syms -z -m"MvMotorControlTMS570.map" --warn_sections -i"C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\ToolChain\lib" --reread_libs --mapfile_contents=sym_defs --generate_dead_funcs_list=dead_funcs.txt --rom_model --be32 --unused_section_elimination=on'
Tony,
I see you have -o3 and --opt_for_speed optimization options turned on. Is it possible that the statics you are looking for were optimized away? Could you try rebuilding with no optimization or lower optimization and see if they appear in the map file?
Hi Aarti,
I have rebuilt as you suggest, without optimisation, and indeed, all symbols are now present in the .MAP file. Setting are as follows.
'Flags: --cmd_file="C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\Compiler.opt" -mv7R4 -g --define=BANANABOARD --define=FIQ_SCHEDULE_CHECK --define=MOTOR_CONTROL --define=DET_ENABLED --include_path=<lots> --diag_warning=225 --diag_remark=97 --enum_type=packed --elf --abi=eabi --code_state=32 --float_support=VFPv3D16 -k --c_src_interlist --asm_listing --output_all_syms --preproc_with_compile --preproc_dependency="DriverSoftware/CommunicationDrivers/Spi.pp" --obj_directory="DriverSoftware/CommunicationDrivers"'
'Flags: --cmd_file="C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\Compiler.opt" -mv7R4 -g --define=BANANABOARD --define=FIQ_SCHEDULE_CHECK --define=MOTOR_CONTROL --define=DET_ENABLED --diag_warning=225 --diag_remark=97 --enum_type=packed --elf --abi=eabi --code_state=32 --float_support=VFPv3D16 -k --c_src_interlist --asm_listing --output_all_syms -z -m"MvMotorControlTMS570.map" --warn_sections -i"C:\Documents and Settings\tony.morrell\My Documents\work\PD_MV\MvMotorControlTMS570\ToolChain\lib" --reread_libs --mapfile_contents=sym_defs --generate_dead_funcs_list=dead_funcs.txt --rom_model --be32'
Tony Morrell said:Surely, the module and function statics cannot be optimised out as they are necessarily fixed RAM located, and indeed, these symbols appear in the .ELF file for my optimised build.
Can you clarify what you mean when you say they appear in the ELF file for the optimized build? If you run the object file display utility (ofd470) on the optimized .out file, do you see those symbols in the output?
Hi Aarti,
I don't generate a .OUT file from my build process, our build output is a .ELF file. The .ELF file contains a list of all symbols within the build, and I can see module and function statics in here, with their addresses, that are not in my .MAP file.
I just use a hex editor to inspect the binary .ELF file.
Regards, Tony.
Tony,
I am not able to reproduce this. In examples I've tried (both COFF and ELF), the link map file and ofd output from the executable match up in terms of symbols listed for statics. Could you run ofd470 on your elf output executable and see if it shows different (more) symbols than the link map file? If so, it would really help if you could provide a test case to duplicate this. A simplified cut down test case would be great, if possible.
Hi Aarti,
I've run ofd470 on my elf, and, same as the map file, it does not pick up all statics from the elf.
I have a build I can send you but I don't want to post it on the forum. I can't see how to start a conversation with you, maybe I need to be your friend, but you should be able to start one with me. You should have my email address as well so if you contact me I can bounce back my zipped project.
Regards, Tony.
Hi Aarti,
I've received your email, and have tried replying to it, but it implies that it is an invalid email address to email to! It's noreply@e2e.ti.com.
Do you have a direct address I can reach you on. If so, please email me with it.
Regards, Tony.
FYI Aarti has forwarded my sample project to the compiler team for further analysis.
This was worked via direct email with Tony.
The reason for some statics not showing up in the map file was that the optimizer was turning the statics into grouped globals. With the –os (--optimizer_interlist) switch enabled, it could be seen from the assembly that the optimizer had grouped together a set of variables to share a common base address. Hence those statics
were converted into a member of the optimizer global, which is why they didn’t appear in the statics list.
Hi Aarti,
For me, it is not a real problem that these statics do not appear in the .MAP file but I would obviously prefer them in for completeness. My real requirement is that the statics are visible in the .ELF file, which they are.
Another forum member, Pashan None, is interested in the outcome though and might have a more definite need.
I think an enhancement to the CGT would be welcomed by most parties.
We can continue any discussion within this post if necessary, for other's interest.
Regards, Tony.