16#ifndef LIEF_ELF_DYNAMIC_ENTRY_H
17#define LIEF_ELF_DYNAMIC_ENTRY_H
42 static constexpr uint64_t
PPC_DISC = 0x400000000;
48 enum class TAG : uint64_t {
49 UNKNOWN = uint64_t(-1),
89 GNU_HASH = 0x6FFFFEF5,
90 TLSDESC_PLT = 0x6FFFFEF6,
92 TLSDESC_GOT = 0x6FFFFEF7,
94 RELACOUNT = 0x6FFFFFF9,
95 RELCOUNT = 0x6FFFFFFA,
99 VERDEFNUM = 0x6FFFFFFD,
100 VERNEED = 0x6FFFFFFE,
101 VERNEEDNUM = 0x6FFFFFFF,
103 AUXILIARY = 0x7ffffffd,
107 ANDROID_REL_OFFSET = 0x6000000D,
109 ANDROID_REL_SIZE = 0x6000000E,
111 ANDROID_REL = 0x6000000F,
113 ANDROID_RELSZ = 0x60000010,
115 ANDROID_RELA = 0x60000011,
117 ANDROID_RELASZ = 0x60000012,
119 ANDROID_RELR = 0x6FFFE000,
121 ANDROID_RELRSZ = 0x6FFFE001,
123 ANDROID_RELRENT = 0x6FFFE003,
125 ANDROID_RELRCOUNT = 0x6FFFE005,
165 MIPS_DELTA_CLASS_NO =
167 MIPS_DELTA_INSTANCE =
169 MIPS_DELTA_INSTANCE_NO =
173 MIPS_DELTA_RELOC_NO =
180 MIPS_DELTA_CLASSSYM =
182 MIPS_DELTA_CLASSSYM_NO =
190 MIPS_LOCALPAGE_GOTIDX =
199 MIPS_PROTECTED_GOTIDX =
204 MIPS_DYNSTR_ALIGN =
MIPS_DISC + 0x7000002B,
205 MIPS_INTERFACE_SIZE =
207 MIPS_RLD_TEXT_RESOLVE_ADDR =
303 virtual std::unique_ptr<DynamicEntry>
clone()
const {
304 return std::unique_ptr<DynamicEntry>(
new DynamicEntry(*
this));
331 virtual std::ostream&
print(std::ostream& os)
const;
337 return entry.
print(os);
342 static_assert(std::is_base_of<DynamicEntry, T>::value,
343 "Require DynamicEntry inheritance");
344 if (T::classof(
this)) {
345 return static_cast<const T*
>(
this);
352 return const_cast<T*
>(
static_cast<const DynamicEntry*
>(
this)->cast<T>());
356 TAG tag_ = TAG::DT_NULL_;
static constexpr uint64_t IA_64_DISC
Definition DynamicEntry.hpp:46
static constexpr uint64_t MIPS_DISC
Definition DynamicEntry.hpp:39
static constexpr uint64_t PPC_DISC
Definition DynamicEntry.hpp:42
DynamicEntry(const details::Elf32_Dyn &header, ARCH arch)
DynamicEntry(const details::Elf64_Dyn &header, ARCH arch)
static constexpr uint64_t AARCH64_DISC
Definition DynamicEntry.hpp:40
TAG
Definition DynamicEntry.hpp:48
const T * cast() const
Definition DynamicEntry.hpp:341
virtual std::ostream & print(std::ostream &os) const
void tag(TAG tag)
Definition DynamicEntry.hpp:321
static constexpr uint64_t HEXAGON_DISC
Definition DynamicEntry.hpp:41
virtual std::unique_ptr< DynamicEntry > clone() const
Definition DynamicEntry.hpp:303
~DynamicEntry() override=default
DynamicEntry & operator=(const DynamicEntry &)=default
void accept(Visitor &visitor) const override
static std::unique_ptr< DynamicEntry > create(TAG tag, uint64_t value)
static uint64_t to_value(TAG tag)
static constexpr uint64_t RISCV_DISC
Definition DynamicEntry.hpp:44
std::string to_string() const
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition DynamicEntry.hpp:309
void value(uint64_t value)
Definition DynamicEntry.hpp:325
T * cast()
Definition DynamicEntry.hpp:351
uint64_t value() const
Return the entry's value.
Definition DynamicEntry.hpp:317
static constexpr uint64_t PPC64_DISC
Definition DynamicEntry.hpp:43
friend std::ostream & operator<<(std::ostream &os, const DynamicEntry &entry)
Definition DynamicEntry.hpp:335
static std::unique_ptr< DynamicEntry > create(TAG tag)
Definition DynamicEntry.hpp:299
static TAG from_value(uint64_t value, ARCH arch)
DynamicEntry(const DynamicEntry &)=default
static constexpr uint64_t X86_64_DISC
Definition DynamicEntry.hpp:45
DynamicEntry(TAG tag, uint64_t value)
Definition DynamicEntry.hpp:289
Definition Visitor.hpp:212
Definition DynamicEntry.hpp:29
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
const char * to_string(DynamicEntry::TAG e)
ARCH
Definition ELF/enums.hpp:30
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43