struct Symbol {
uint8_t Binding;
- SectionBase *DefinedIn;
+ SectionBase *DefinedIn = nullptr;
SymbolShndxType ShndxType;
uint32_t Index;
llvm::StringRef Name;
class SymbolTableSection : public SectionBase {
protected:
std::vector<std::unique_ptr<Symbol>> Symbols;
- StringTableSection *SymbolNames;
+ StringTableSection *SymbolNames = nullptr;
public:
void setStrTab(StringTableSection *StrTab) { SymbolNames = StrTab; }
};
struct Relocation {
- const Symbol *RelocSymbol;
+ const Symbol *RelocSymbol = nullptr;
uint64_t Offset;
uint64_t Addend;
uint32_t Type;
template <class SymTabType> class RelocationSectionBase : public SectionBase {
private:
- SymTabType *Symbols;
- SectionBase *SecToApplyRel;
+ SymTabType *Symbols = nullptr;
+ SectionBase *SecToApplyRel = nullptr;
public:
void setSymTab(SymTabType *StrTab) { Symbols = StrTab; }
class SectionWithStrTab : public Section {
private:
- StringTableSection *StrTab;
+ StringTableSection *StrTab = nullptr;
public:
SectionWithStrTab(llvm::ArrayRef<uint8_t> Data) : Section(Data) {}
SectionTableRef readSectionHeaders(const llvm::object::ELFFile<ELFT> &ElfFile);
protected:
- StringTableSection *SectionNames;
- SymbolTableSection *SymbolTable;
+ StringTableSection *SectionNames = nullptr;
+ SymbolTableSection *SymbolTable = nullptr;
std::vector<SecPtr> Sections;
std::vector<SegPtr> Segments;