Changeset View
Changeset View
Standalone View
Standalone View
ELF/SyntheticSections.h
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | private: | ||||
uint64_t Size = 0; | uint64_t Size = 0; | ||||
llvm::DenseMap<StringRef, unsigned> StringMap; | llvm::DenseMap<StringRef, unsigned> StringMap; | ||||
std::vector<StringRef> Strings; | std::vector<StringRef> Strings; | ||||
}; | }; | ||||
class DynamicReloc { | class DynamicReloc { | ||||
public: | public: | ||||
DynamicReloc(uint32_t Type, const InputSectionBase *InputSec, | DynamicReloc(uint32_t Type, InputSectionBase *InputSec, uint64_t OffsetInSec, | ||||
uint64_t OffsetInSec, bool UseSymVA, Symbol *Sym, int64_t Addend) | bool UseSymVA, Symbol *Sym, int64_t Addend) | ||||
: Type(Type), Sym(Sym), InputSec(InputSec), OffsetInSec(OffsetInSec), | : Type(Type), Sym(Sym), InputSec(InputSec), OffsetInSec(OffsetInSec), | ||||
UseSymVA(UseSymVA), Addend(Addend) {} | UseSymVA(UseSymVA), Addend(Addend) {} | ||||
uint64_t getOffset() const; | uint64_t getOffset() const; | ||||
int64_t getAddend() const; | int64_t getAddend() const; | ||||
uint32_t getSymIndex() const; | uint32_t getSymIndex() const; | ||||
const InputSectionBase *getInputSec() const { return InputSec; } | InputSectionBase *getInputSec() const { return InputSec; } | ||||
uint32_t Type; | uint32_t Type; | ||||
private: | |||||
Symbol *Sym; | Symbol *Sym; | ||||
const InputSectionBase *InputSec = nullptr; | InputSectionBase *InputSec = nullptr; | ||||
uint64_t OffsetInSec; | uint64_t OffsetInSec; | ||||
bool UseSymVA; | bool UseSymVA; | ||||
int64_t Addend; | int64_t Addend; | ||||
}; | }; | ||||
template <class ELFT> class DynamicSection final : public SyntheticSection { | template <class ELFT> class DynamicSection final : public SyntheticSection { | ||||
typedef typename ELFT::Dyn Elf_Dyn; | typedef typename ELFT::Dyn Elf_Dyn; | ||||
typedef typename ELFT::Rel Elf_Rel; | typedef typename ELFT::Rel Elf_Rel; | ||||
Show All 20 Lines | private: | ||||
uint64_t Size = 0; | uint64_t Size = 0; | ||||
}; | }; | ||||
class RelocationBaseSection : public SyntheticSection { | class RelocationBaseSection : public SyntheticSection { | ||||
public: | public: | ||||
RelocationBaseSection(StringRef Name, uint32_t Type, int32_t DynamicTag, | RelocationBaseSection(StringRef Name, uint32_t Type, int32_t DynamicTag, | ||||
int32_t SizeDynamicTag); | int32_t SizeDynamicTag); | ||||
void addReloc(const DynamicReloc &Reloc, RelExpr Expr, RelType Type); | |||||
void addReloc(const DynamicReloc &Reloc); | void addReloc(const DynamicReloc &Reloc); | ||||
bool empty() const override { return Relocs.empty(); } | bool empty() const override { return Relocs.empty(); } | ||||
size_t getSize() const override { return Relocs.size() * this->Entsize; } | size_t getSize() const override { return Relocs.size() * this->Entsize; } | ||||
size_t getRelativeRelocCount() const { return NumRelativeRelocs; } | size_t getRelativeRelocCount() const { return NumRelativeRelocs; } | ||||
void finalizeContents() override; | void finalizeContents() override; | ||||
int32_t DynamicTag, SizeDynamicTag; | int32_t DynamicTag, SizeDynamicTag; | ||||
protected: | protected: | ||||
▲ Show 20 Lines • Show All 493 Lines • Show Last 20 Lines |