Jump to content
  • Advertisement
Sign in to follow this  
tasen

Question on .rdata in executables

This topic is 3937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just for fun, I decided to run my program through a disassembler to pull it apart and see what was going on. One thing that struck me as kind of odd were some of the strings stored in the .rdata section. To my understanding the .rdata section contains read-only data such as constants, but I also discovered that stored in the same section were paths to some of my source and header files (i.e. "src\game\main.c"). After digging through a few other programs with the disassembler I noticed the same thing. Can anyone explain why the compiler would choose to store this information in the executable and what relevance it has? I thought it might be a gcc (4.2.0) quirk but it seems msvc++ does the same thing. It's not really a big deal but I'd like to know what's going on under the hood. =)

Share this post


Link to post
Share on other sites
Advertisement
I don't know about yours, but my default release-build configuration creates a minimal debug-symbol database in the binary. Have a look in the PE header's data directory. If 'Debug' is non-null then a debug PE descriptor exists and it stands to reason that your source file paths are lying around.

Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!