Focusing on the Executable and Linkable Format (ELF) used in Linux and Unix systems, this book explores how code is compiled, linked, and loaded into memory, and how the operating system executes it. You’ll learn to analyse ELF files, debug and optimize programs at the binary level, write custom linker scripts, and understand dynamic linking and symbol resolution.
ELF files are important because low-level programming and binary analysis are critical skills for system programmers, embedded developers, and security researchers. With the rise of performance optimization, cybersecurity, and resource-constrained environments (e.g., IoT), understanding executables is more relevant than ever.
Executable Files for Linux provides a hands-on, modern approach to a topic often overlooked in learning resources today.
What You Will Learn
• Analyse and modify ELF files to optimize software performance
• Debug and optimize programs at the binary level
• Write custom linker scripts for complex projects
• Understand dynamic linking, lazy loading, and symbol resolution
• Explore kernel-level processes for loading and executing binaries
Who This Book Is For
Developers and programmers working on operating systems, embedded systems, or low-level software as well as performance engineers and security professionals
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on tour of Linux executables that turns the ELF format from a black box into a working mental model—ideal for systems programmers, embedded developers, and security engineers who want to inspect, debug, and optimize binaries at the byte level.
【Book Arc】
- **Opening (~0%–10%)**: Starts from a deceptively simple question—why a "Hello World" binary is so large—and uses it to motivate the whole book: size breakdowns, the executable lifecycle, and the four-part ELF structure (header, program header table, sections, section header table).
- **Early (~10%–35%)**: Demystifies the ELF format itself: PHDR/INTERP/LOAD segments, memory permissions and W^X, PIE and ASLR, and the differences between relocatable files, executables, shared objects, and core dumps. Then moves into sections—.text, .rodata, .data, .bss—and how section permissions, layout, and stripping affect loading and performance.
- **Middle (~35%–55%)**: Shifts from static structure to build-time mechanics: how global variables are initialized before main(), the linker's role in combining object files, symbol resolution, and relocation records (R_X86_64_32S, PLT32, PC32) with their performance trade-offs.
- **Late (~55%–80%)**: Covers the linker's "address book"—symbol types, bindings, visibility levels, versioning, interposition, and debugging symbol problems—then introduces custom linker scripts for controlling memory layout, separating critical code, and exporting linker symbols.
- **Ending (~80%–100%)**: Moves toward runtime and security: dynamic linking, lazy loading, symbol resolution at load time, kernel-level binary loading, and hardening features like stack canaries and RELRO. Excerpts do not cover the final chapters in detail.
【Key Takeaways】
- **ELF is one format with four roles** (Early): the same structure serves relocatable object files, executables, shared objects, and core dumps—each with different header tables and resolution states. Understanding this unity prevents confusion when switching between build stages.
- **Sections vs. segments are different views** (Early): sections describe link-time content organization; segments (program headers) tell the kernel how to map memory. Permissions like R E vs. RW enforce W^X and are a first line of defense.
- **PIE and ASLR are defaults, not options** (Early): modern Linux binaries are position-independent (type DYN), enabling address randomization. This changes how you reason about addresses, debugging, and exploitation.
- **Global variable initialization is a hidden program phase** (Middle): constructors, destructors, and circular dependencies between globals create undefined behavior if mishandled—lazy initialization or a single init point are the fixes.
- **Relocations are the linker's patch instructions** (Middle): absolute, PC-relative, and PLT relocations trade off speed, position independence, and lazy binding. Choosing the right model matters for shared libraries and startup cost.
- **Symbols are the linker's address book** (Late): visibility levels, versioning, and interposition control what gets resolved where—and symbol resolution has measurable performance impact.
- **Linker scripts are a memory map blueprint** (Late): they let you separate critical code, control load vs. runtime addresses, and debug layout problems that no compiler flag can fix.
- **Binary size is a design choice** (Early): stripping debug info, understanding .bss (which doesn't occupy file space), and section locality all affect both footprint and runtime performance.
【Reading Tips】
- **Deep-read Chapters 1–3** if you're new to ELF: the "Hello World is big" framing builds intuition that pays off later. Skim if you already know readelf output.
- **Keep a terminal open**: the book is tool-driven (readelf, size, nm, strip, objdump). Running commands on your own binaries is where the learning sticks.
- **Treat linker scripts as the hard chapter**: concepts like load address vs. runtime address and exporting linker symbols are where most readers slow down—budget extra time and experiment with a minimal script.
- **For security readers**, focus on W^X, PIE/ASLR, RELRO, and stack canaries; for embedded/performance readers, focus on sections, relocations, and linker script layout control.
- **Don't skip the practical exercises** at the end of the linker script chapter—they consolidate the most abstract material.
【Coverage Limits】
This guide is based on stratified excerpts covering roughly the first half to two-thirds of the book; later chapters on dynamic linking internals, kernel loading, and advanced security hardening are referenced but not detailed in the source material.
Excerpt 1
ystem Calls 44 ELF in Different Contexts: A Comparison 44 Relocatable Files (o) 45 Executable Files 45 Shared Objects (so) 45 Core Dumps 46 The Evolution of...
tant “Hello, World!” is stored in the .rodata section. The magic number is typically handled by the compiler as an immediate value in the instructions rather...
bject files, which are the compiled but not yet executable versions of your source code. Understanding how the linker works is essential for building robust...
S addreSS book int global_function(int x) { return x * 2; } __attribute__((weak)) int weak_function(int x) { return x * 2; } // Hidden symbol in shared libra...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Executable Files for Linux Under the Hood of ELFs for Flexible and Secure Low-Level Coding (Mohit Mishra) (z-library.sk, 1lib.sk, z-lib.sk)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Executable Files for Linux Under the Hood of ELFs for Flexible and Secure Low-Level Coding (Mohit Mishra) (z-library.sk, 1lib.sk, z-lib.sk)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment