Skip to main content

Module elf

Module elf 

Source
Expand description

ELF files as their symbol table: what uses flash and RAM.

An ELF file (a firmware image, an executable, a library, an object file) opens as one row per symbol: its name (Rust names demangled), address, size, kind, binding, section, and the region its section sits in: flash for what is loaded and not written (code, constants), ram for what is written (.data, .bss). Sorted by size and grouped by section, it says what fills each. Its sections are a second table, --table sections.

Only the headers and the symbol and string tables are read, through a map of the file, by the object crate; the table is small beside the file.

Structs§

Elf
What an ELF file’s tables hold.

Constants§

MAGIC
The first four bytes of every ELF file.
SECTIONS
SYMBOLS
The table an ELF file opens on, and the other one.

Functions§

demangle
A Rust symbol’s name demangled, without its hash; any other name as it is. C++ names stay mangled: no C++ demangler is in the tree.
looks_like
Whether head, the first bytes of a file, begins an ELF file.
open
Open the ELF file at path as the table wanted names: its symbols unless --table sections says otherwise.
read
Read the symbol and section tables of the ELF file in data.
tables
The tables of an ELF file, for the home screen and --table.