c++visual-c++portable-executable

Remove IMAGE_DEBUG_DIRECTORY from .rdata section


How can I remove IMAGE_DEBUG_DIRECTORY data from .rdata section of PE?

I am using MS Visual Studio 2015. I did check almost all compile options of project properties. But IMAGE_DEBUG_DIRECTORY data still exists in my output executable file...


Solution

  • you can do this by set undocumented Linker Option /EMITPOGOPHASEINFO. so go to linker command line and insert this string (/EMITPOGOPHASEINFO) in additional options. this option suppress pgo (Profile-Guided Optimizations) section in pe

    read also : Pogo aka PGO aka Profile Guided Optimization and Walkthrough: Using Profile-Guided Optimizations

    and of course you must not Generate Debug Info - use /DEBUG linker option - so sure that no /DEBUG option in linker command line. or alternatively use /DEBUG:NONE /EMITPOGOPHASEINFO combination - in this case must not be IMAGE_DEBUG_DIRECTORY in pe file