Conclusion


Understanding the internals of any compiler always helps in writing good code. It also helps in troubleshooting, debugging etc. Sometimes while debugging, you might have to deal with disassembled code. If you understand the internals, then you can easily understand the disassembled code and your productivity will increase.

What Next?

To gain deeper understanding, you should start developing the habit of reading the code which is generated by C++ compiler. Here are two ways you can read the disassembled code:

  • Use -S option with g++ compiler. The g++ compiler will generate assembly code of your C++ source file.
  • Use objdump command for disassembling the any binary file.

Useful tools: ld, objdump, readelf, objcopy, nm, strip, ldd.


Feedback

Please let me know your feedback about the whole article. I can be contacted on my Gmail id rajeevku02.



Do you collaborate using whiteboard? Please try Lekh App - An Intelligent Collaborative Whiteboard App

© 2012 avabodh.com — All rights reserved.