template <class ElfLayout>
class RelocationInfo
Defined at line 37 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
This represents the ELF metadata in an ELF file that directs what dynamic
relocation it requires. It holds spans of the various raw relocation record
types and provides a uniform visitor pattern for iterating over them.
Both REL and RELA formats are tracked here. Within each format, "relative"
(simple fixup) relocation and "symbolic" (general) relocations are provided
as separate subspans. The RELR format is held as a raw span of words. PLT
(JMPREL) relocations use either REL or RELA format (but can't have both in
parallel as general relocations do) and so are represented using a
std::variant type across the REL and RELA container formats.
The VisitRelative and VisitSymbolic methods can be used like std::visit to
call a callback function (a generic lambda or other polymorphic callable)
with each record, stopping early if the callback returns false.
VisitSymbolic passes either an Elf::Rela or an Elf::Rel that uses an
in-place addend. VisitRelative passes either an Elf::Rela with separate
address and addend, or an Elf::size_type address using an in-place addend.
Public Methods
RelTable rel_relative ()
Fetch the various relocation tables. The REL and RELA tables have
relative and symbolic subsets. The RELR table needs further decoding.
Enumeration should use the VisitRelative and VisitSymbolic methods, below.
Defined at line 57 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelTable rel_symbolic ()
Defined at line 59 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelaTable rela_relative ()
Defined at line 61 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelaTable rela_symbolic ()
Defined at line 63 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelrTable relr ()
Defined at line 65 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
JmprelTable jmprel ()
Defined at line 67 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rel (RelTable relocs, size_type relcount)
Install data for the various relocation tables. These return *this so
they can be called in fluent style, e.g. in a constexpr initializer.
Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rel (RelTable relocs, size_type relcount)
Install data for the various relocation tables. These return *this so
they can be called in fluent style, e.g. in a constexpr initializer.
Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rel (RelTable relocs, size_type relcount)
Install data for the various relocation tables. These return *this so
they can be called in fluent style, e.g. in a constexpr initializer.
Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rel (RelTable relocs, size_type relcount)
Install data for the various relocation tables. These return *this so
they can be called in fluent style, e.g. in a constexpr initializer.
Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rel (RelTable relocs, size_type relcount)
Install data for the various relocation tables. These return *this so
they can be called in fluent style, e.g. in a constexpr initializer.
Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rela (RelaTable relocs, size_type relacount)
Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rela (RelaTable relocs, size_type relacount)
Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rela (RelaTable relocs, size_type relacount)
Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rela (RelaTable relocs, size_type relacount)
Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_rela (RelaTable relocs, size_type relacount)
Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_relr (RelrTable table)
Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_relr (RelrTable table)
Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_relr (RelrTable table)
Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_relr (RelrTable table)
Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_relr (RelrTable table)
Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_jmprel (JmprelTable table)
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_jmprel (JmprelTable table)
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_jmprel (JmprelTable table)
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_jmprel (JmprelTable table)
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
RelocationInfo<ElfLayout> & set_jmprel (JmprelTable table)
Defined at line 89 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <ElfMachine Machine, class Reloc>
size_t ValidateRelative (std::span<const Reloc> relocs)
Defined at line 99 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <ElfMachine Machine, class Reloc>
size_t ValidateRelative (std::span<const Reloc> relocs)
Defined at line 99 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <ElfMachine Machine, class Reloc>
size_t ValidateRelative (std::span<const Reloc> relocs)
Defined at line 99 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <ElfMachine Machine, class Reloc>
size_t ValidateRelative (std::span<const Reloc> relocs)
Defined at line 99 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <ElfMachine Machine, class Reloc>
size_t ValidateRelative (std::span<const Reloc> relocs)
Defined at line 99 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
size_t ValidateRelative (std::span<const Addr> relocs)
Defined at line 108 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
size_t ValidateRelative (std::span<const Addr> relocs)
Defined at line 108 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
size_t ValidateRelative (std::span<const Addr> relocs)
Defined at line 108 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
size_t ValidateRelative (std::span<const Addr> relocs)
Defined at line 108 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
size_t ValidateRelative (std::span<const Addr> relocs)
Defined at line 108 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <typename Visitor>
bool VisitRelative (Visitor && visit)
Call visit(Elf::Rela reloc) -> bool or visit(Elf::size_type addr) on every
location needing simple fixup. The Elf::size_type signature indicates the
addend is to be read from the relocated address itself. Returns false the
first time visit returns false, otherwise true.
Defined at line 119 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h
template <typename Visitor>
bool VisitSymbolic (Visitor && visit)
Call visit(Elf::Rel) -> bool or visit(Elf::Rela) -> bool on every symbolic
relocation record. Returns false the first time visit returns false,
otherwise true.
Defined at line 173 of file ../../src/lib/elfldltl/include/lib/elfldltl/relocation.h