When turning on the link time optimisations (the -flto compile option), the debug info in the elf file is being removed for all but the .S files. If you look at the .map file you can also see that it is not listed. Is this a consequence of having this level of optimisations on or is it a bug?
Target Info
* MPC5777C
* Using S32DS V1.2 for Power PC
* Also compiling with max optimizations on, the -O3 switch
* debug compile options are -g3 -gdwarf-4
If you have any questions please let me know.
解決済! 解決策の投稿を見る。
Hello,
I found some explanation at Stackoverflow website. It seems it is not possible to combine -flto with -g parameter. Please check the link below:
gcc LTO appears to strip debugging symbols - Stack Overflow
Regards,
Martin
To add some clarification, I mean that when I compile with the -flto option, all .c and .cpp files are missing from the debug info section in the elf file but when I remove the -flto option all those files have debug info.
Hello,
I found some explanation at Stackoverflow website. It seems it is not possible to combine -flto with -g parameter. Please check the link below:
gcc LTO appears to strip debugging symbols - Stack Overflow
Regards,
Martin