uint8_t getBytesInAddress() const override;
StringRef getFileFormatName() const override;
unsigned getArch() const override;
- StringRef getLoadName() const;
std::error_code getPlatformFlags(unsigned &Result) const override {
Result = EF.getHeader()->e_flags;
return section_iterator(SectionRef(toDRI(EF.section_end()), this));
}
-template <class ELFT>
-StringRef ELFObjectFile<ELFT>::getLoadName() const {
- const Elf_Dyn *DI = EF.dynamic_table_begin();
- const Elf_Dyn *DE = EF.dynamic_table_end();
-
- while (DI != DE && DI->getTag() != ELF::DT_SONAME)
- ++DI;
-
- if (DI != DE)
- return EF.getDynamicString(DI->getVal());
- return "";
-}
-
template <class ELFT>
uint8_t ELFObjectFile<ELFT>::getBytesInAddress() const {
return ELFT::Is64Bits ? 8 : 4;
static StringRef getLoadName(const ObjectFile *Obj) {
if (auto *ELF = dyn_cast<ELF32LEObjectFile>(Obj))
- return ELF->getLoadName();
+ return ELF->getELFFile()->getLoadName();
if (auto *ELF = dyn_cast<ELF64LEObjectFile>(Obj))
- return ELF->getLoadName();
+ return ELF->getELFFile()->getLoadName();
if (auto *ELF = dyn_cast<ELF32BEObjectFile>(Obj))
- return ELF->getLoadName();
+ return ELF->getELFFile()->getLoadName();
if (auto *ELF = dyn_cast<ELF64BEObjectFile>(Obj))
- return ELF->getLoadName();
+ return ELF->getELFFile()->getLoadName();
llvm_unreachable("Not ELF");
}