template <ElfClass Class = ElfClass::kNative>

class Self

Defined at line 94 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h

Public Methods

const typename Elf::Ehdr & Ehdr ()

Access the calling ELF module's own ELF file header. Using this in a

program with a nonstandard layout without visible ELF headers will cause

a link-time failure.

Defined at line 101 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h

bool Match ()

Dynamically check if the calling ELF module's file header matches this

instantiation's ElfClass. See Ehdr() above about link-time constraints.

Defined at line 107 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h

bool Valid ()

Dynamically check if the calling ELF module's file header passes basic

format checks for this instantiation's ElfClass and native byte order.

See Ehdr() above about link-time constraints.

Defined at line 112 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h

std::span<const typename Elf::Phdr> Phdrs ()

Examine the calling ELF module's file header to find its own program

headers. See Ehdr() above about link-time constraints.

Defined at line 116 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h

std::span<const typename Elf::Dyn> Dynamic ()

Get the calling ELF module's own dynamic section. This works in any

program linked to have a dynamic section, even if the ELF headers are not

preserved at runtime. Note that the returned span's size is only an

extreme upper bound on the actual dynamic section that can be accessed.

It must always be examined linearly from the front and not examined past

the elfldltl::ElfDynTag::kNull terminator entry.

Defined at line 143 of file ../../src/lib/elfldltl/include/lib/elfldltl/self.h