EmbeddedRelated.com
Books
The 2026 Embedded Online Conference

Advanced C and C++ Compiling

Stevanovic, Milan 2014

Learning how to write C/C++ code is only the first step. To be a serious programmer, you need to understand the structure and purpose of the binary files produced by the compiler: object files, static libraries, shared libraries, and, of course, executables.

Advanced C and C++ Compiling explains the build process in detail and shows how to integrate code from other developers in the form of deployed libraries as well as how to resolve issues and potential mismatches between your own and external code trees.

With the proliferation of open source, understanding these issues is increasingly the responsibility of the individual programmer. Advanced C and C++ Compiling brings all of the information needed to move from intermediate to expert programmer together in one place -- an engineering guide on the topic of C/C++ binaries to help you get the most accurate and pertinent information in the quickest possible time.
What you'll learn

  • The details of the build process, including compiling and linking
  • The inner workings of static libraries, shared libraries, and executables
  • Ways to properly architect code for smooth integration of future changes
  • Tips for troubleshooting problems with compiling and linking as well as run-time problems
  • How to use operating system-specific (Linux and Windows) tools for analysis of binary files
Who this book is for C/C++ software designers aspiring to senior levels, software architects, build engineers, and Linux system administrators.
Table of Contents
  1. Multitasking OS Basics  
  2. Simple Program Lifetime Stages
  3. Program Execution Stages
  4. The Impact of Reusing Concept
  5. Working with Static Libraries 
  6. Designing Dynamic Libraries: Basics
  7. Locating the Libraries
  8. Designing Dynamic Libraries: Advanced Topics
  9. Handling Duplicate Symbols When Linking In Dynamic Libraries
  10. Dynamic Libraries Versioning 
  11. Dynamic Libraries Miscellaneous Topics
  12. The Linux Toolbox
  13. Linux HowTo's
  14. Windows Toolbox


Why Read This Book

You will learn how compilers, assemblers, linkers, and loaders transform your C and C++ source into real binaries so you can diagnose, fix, and optimize build-time and runtime problems. The book gives practical, tool-centric explanations (objdump, readelf, ld scripts, cross-toolchains) that help you confidently integrate third-party libraries and build reliable firmware and embedded Linux images.

Who Will Benefit

Intermediate-to-advanced C/C++ developers, firmware engineers, and system integrators working on embedded systems or Linux who need to understand object formats, linking, ABI issues, and cross-compilation to ship reliable binaries.

Level: Advanced — Prerequisites: Solid C and/or C++ programming experience, familiarity with the command line and basic compilation (gcc/clang, compiling and linking), and exposure to Make or another build system.

Get This Book

Key Takeaways

  • Analyze object file formats (ELF, COFF) and interpret symbol tables, relocations, and sections to troubleshoot binary issues
  • Create, manage, and deploy static and shared libraries and control symbol visibility and versioning
  • Diagnose and resolve linking and ABI mismatches between different compilers, runtimes, or third‑party libraries
  • Cross‑compile and configure toolchains and linker scripts for embedded targets (ARM, MIPS, etc.) and reduce runtime surprises
  • Apply build-system and compiler/linker options to optimize binary size, startup time, and performance
  • Use binary inspection and debugging tools (objdump, readelf, nm, ldd, gdb) to validate and harden delivered binaries

Topics Covered

  1. Introduction: Why binaries matter
  2. Compilation pipeline: Preprocessing, compiling, assembling, linking
  3. Object file anatomy: Sections, symbols, relocations
  4. Static libraries and archives (ar), symbol resolution
  5. Shared libraries, dynamic linking, and runtime loaders
  6. Name mangling and C++ linking model
  7. ABI and calling conventions across architectures
  8. Linker scripts, symbol versioning, and visibility control
  9. Cross-compilation and embedded toolchain integration
  10. Compiler and linker options for size and performance
  11. Debugging and inspection tools: objdump, readelf, nm, strip, ldd, gdb
  12. Build systems and reproducible builds (Make, Autotools, CMake)
  13. Common integration problems and real-world case studies
  14. Appendices: Binary formats, reference commands, and further reading

Languages, Platforms & Tools

CC++x86/x86_64ARM (embedded and Linux)MIPSGeneric cross-compilation targetsGCCGNU binutils (ld, objdump, readelf, nm, ar, strip)Gold and BFD linkersGDBMakeAutotoolsCMakeCross-compilers/toolchainsglibc/uClibc/other runtimesClang/LLVM (as comparison)

How It Compares

Covers much the same practical ground as John R. Levine's Linkers and Loaders but is more focused on modern C/C++ toolchains, cross‑compilation, and hands‑on tooling for embedded and Linux developers.

Related Books

Bryant, Randal, O'Hallaron,...
The 2026 Embedded Online Conference