Conclusion


The "C Internals" has described the details of code generation of the gcc compiler. It has described how a C code is translated into assembly language. Understanding the internals of compiler and code generation can help in many ways. It will often help you in troubleshooting, debugging, reverse engineering etc.

What Next?

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

  • Use -S option with gcc compiler. The gcc compiler will generate assembly code of your C source file.
  • Use objdump command for disassembling any binary file.
Useful tools: ld, objdump, readelf, objcopy, nm, strip, ldd.

Feedback

You can give feedback to me (author) via email. I can be contacted on Gmail id rajeevku02.



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

© 2012 avabodh.com — All rights reserved.