Expand description
Reading the section table of an ELF object, to tell instrumented ones from the rest.
StructsΒ§
- Section
Table π - Where an ELF64 little-endian object keeps its section headers.
ConstantsΒ§
- COVMAP_
SECTION π - The section every instrumented object carries.
- ELF_
HEADER_ πLEN - ELF_
IDENT π - ELF magic, 64-bit class, little-endian data: the only objects CI builds.
- E_
SHENTSIZE π - E_SHNUM π
- E_SHOFF π
- E_
SHSTRNDX π - MAX_
TABLE_ πLEN - Real section and name tables are kilobytes; anything past this is corrupt.
- SHN_
XINDEX π - The name-table index an object with extended numbering stores in section 0.
- SH_LINK π
- SH_NAME π
- SH_
OFFSET π - SH_SIZE π
FunctionsΒ§
- elf_
has_ πsection - Looks the name up in the ELF section table. Matching it anywhere in the file also accepts binaries that merely contain the string β xtask itself among them β and llvm-cov refuses to export those.
- fill π
falsewhen the file ends first: a truncated file is not an object.- le_
bytes π - read_
region π - Reads
lenbytes atoffset;Nonewhen the region is implausibly large or runs past the end of the file. - resolve_
extended π - With 0xff00 or more sections the headerβs count is 0 and its name index is
SHN_XINDEX; the real values live in section 0βs
sh_sizeandsh_link. - section_
name π