Mehdi Akiki

Posts tagged "linker"

  • Published on

    Investigation · Part 3 of 20 · From source to a running process

    Where Your Variables Live in a Binary: .text, .rodata, .data and .bss

    I printed the address of every kind of variable in a C program and a Rust program and matched them with nm and readelf. A 16 MiB array of zeros costs nothing in the file, the same array with one byte set to 1 costs 16 MiB, and a Rust const has no address at all.
  • Published on

    Investigation · Part 2 of 20 · From source to a running process

    What Is Inside an Executable File: ELF Headers, Segments and Sections

    I opened my three hello worlds with readelf. A program still runs after I delete all its section headers, one changed byte in a segment stops it, and 90% of the Rust file is debug information of the standard library.