Go to the documentation of this file.
13 #ifndef LLVM_OBJECT_ELFOBJECTFILE_H
14 #define LLVM_OBJECT_ELFOBJECTFILE_H
39 #include <system_error>
97 std::vector<std::pair<Optional<DataRefImpl>, uint64_t>>
127 assert(isa<ELFObjectFileBase>(
B->getObject()));
168 if (EE.Value ==
Type) {
229 uint16_t getEMachine()
const override;
231 uint64_t getSymbolSize(
DataRefImpl Sym)
const override;
251 bool ContentValid =
false;
274 const Elf_Shdr *SymTab)
const;
321 auto SectionsOrErr =
EF.sections();
322 if (!SectionsOrErr) {
327 uintptr_t SHT =
reinterpret_cast<uintptr_t
>((*SectionsOrErr).begin());
328 unsigned SymTableIndex =
329 (
reinterpret_cast<uintptr_t
>(SymTable) - SHT) /
sizeof(Elf_Shdr);
331 DRI.
d.
a = SymTableIndex;
337 return reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
342 DRI.
p =
reinterpret_cast<uintptr_t
>(Sec);
348 DRI.
p =
reinterpret_cast<uintptr_t
>(Dyn);
353 unsigned char Binding = ESym->getBinding();
354 unsigned char Visibility = ESym->getVisibility();
366 auto SectionsOrErr =
EF.sections();
368 return SectionsOrErr.takeError();
370 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
373 auto ErrorOrContents =
EF.getSectionContents(Sec);
374 if (!ErrorOrContents)
375 return ErrorOrContents.takeError();
377 auto Contents = ErrorOrContents.get();
381 if (
Error E = Attributes.
parse(Contents, ELFT::TargetEndianness))
397 bool InitContent =
true);
403 return EF.template getEntry<Elf_Sym>(Sym.
d.
a, Sym.
d.
b);
408 auto RelSecOrErr =
EF.getSection(Rel.
d.
a);
415 return reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
454 template <
class ELFT>
460 auto SectionsOrErr = EF.sections();
462 return SectionsOrErr.takeError();
464 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
465 switch (Sec.sh_type) {
477 if (!DotSymtabShndxSec)
478 DotSymtabShndxSec = &Sec;
488 template <
class ELFT>
493 auto SymTabOrErr = EF.getSection(Sym.
d.
a);
495 return SymTabOrErr.takeError();
496 const Elf_Shdr *SymTableSec = *SymTabOrErr;
497 auto StrTabOrErr = EF.getSection(SymTableSec->sh_link);
499 return StrTabOrErr.takeError();
500 const Elf_Shdr *StringTableSec = *StrTabOrErr;
501 auto SymStrTabOrErr = EF.getStringTable(*StringTableSec);
503 return SymStrTabOrErr.takeError();
512 return (*SecOrErr)->getName();
518 template <
class ELFT>
523 template <
class ELFT>
528 template <
class ELFT>
533 template <
class ELFT>
539 uint64_t
Ret = (*SymOrErr)->st_value;
543 const Elf_Ehdr &Header = EF.getHeader();
552 template <
class ELFT>
556 if (!SymbolValueOrErr)
560 uint64_t Result = *SymbolValueOrErr;
565 switch ((*SymOrErr)->st_shndx) {
572 auto SymTabOrErr = EF.getSection(Symb.
d.
a);
574 return SymTabOrErr.takeError();
578 if (DotSymtabShndxSec) {
581 EF.getSHNDXTable(*DotSymtabShndxSec))
582 ShndxTable = *ShndxTableOrErr;
584 return ShndxTableOrErr.takeError();
588 EF.getSection(**SymOrErr, *SymTabOrErr, ShndxTable);
591 const Elf_Shdr *
Section = *SectionOrErr;
599 template <
class ELFT>
605 return (*SymOrErr)->st_value;
609 template <
class ELFT>
611 return EF.getHeader().e_machine;
614 template <
class ELFT>
uint16_t ELFObjectFile<ELFT>::getEType()
const {
615 return EF.getHeader().e_type;
618 template <
class ELFT>
619 uint64_t ELFObjectFile<ELFT>::getSymbolSize(DataRefImpl Sym)
const {
620 Expected<const Elf_Sym *> SymOrErr = getSymbol(Sym);
623 return (*SymOrErr)->st_size;
626 template <
class ELFT>
628 return getSymbolSize(Symb);
631 template <
class ELFT>
636 return (*SymOrErr)->getBinding();
639 template <
class ELFT>
644 return (*SymOrErr)->st_other;
647 template <
class ELFT>
652 return (*SymOrErr)->getType();
655 template <
class ELFT>
662 switch ((*SymOrErr)->getType()) {
680 template <
class ELFT>
686 const Elf_Sym *ESym = *SymOrErr;
702 EF.symbols(DotSymtabSec)) {
704 if (ESym == SymbolsOrErr->begin())
708 return SymbolsOrErr.takeError();
711 EF.symbols(DotDynSymSec)) {
713 if (ESym == SymbolsOrErr->begin())
717 return SymbolsOrErr.takeError();
722 if (
Name.startswith(
"$d") ||
Name.startswith(
"$t") ||
723 Name.startswith(
"$a"))
729 if (ESym->getType() ==
ELF::STT_FUNC && (ESym->st_value & 1) == 1)
739 if (isExportedToOtherDSO(ESym))
748 template <
class ELFT>
751 const Elf_Shdr *SymTab)
const {
753 if (DotSymtabShndxSec) {
756 EF.getSHNDXTable(*DotSymtabShndxSec);
757 if (!ShndxTableOrErr)
759 ShndxTable = *ShndxTableOrErr;
762 auto ESecOrErr = EF.getSection(*ESym, SymTab, ShndxTable);
766 const Elf_Shdr *ESec = *ESecOrErr;
768 return section_end();
771 Sec.
p =
reinterpret_cast<intptr_t>(ESec);
775 template <
class ELFT>
782 auto SymTabOrErr = EF.getSection(Symb.
d.
a);
784 return SymTabOrErr.takeError();
785 return getSymbolSection(*SymOrErr, *SymTabOrErr);
788 template <
class ELFT>
794 template <
class ELFT>
799 template <
class ELFT>
804 template <
class ELFT>
806 auto SectionsOrErr = EF.sections();
809 llvm_unreachable(
"unable to get section index");
811 const Elf_Shdr *
First = SectionsOrErr->begin();
815 template <
class ELFT>
820 template <
class ELFT>
827 checkOffset(getMemoryBufferRef(),
828 (uintptr_t)
base() + EShdr->sh_offset, EShdr->sh_size))
834 template <
class ELFT>
839 template <
class ELFT>
844 template <
class ELFT>
849 template <
class ELFT>
857 template <
class ELFT>
864 template <
class ELFT>
865 std::vector<SectionRef>
867 std::vector<SectionRef> Res;
868 std::vector<uintptr_t>
Offsets;
870 auto SectionsOrErr = EF.sections();
874 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
878 reinterpret_cast<Elf_Dyn *
>((uintptr_t)
base() + Sec.sh_offset);
880 if (
Dynamic->d_tag == ELF::DT_REL ||
Dynamic->d_tag == ELF::DT_RELA ||
881 Dynamic->d_tag == ELF::DT_JMPREL) {
886 for (
const Elf_Shdr &Sec : *SectionsOrErr) {
888 Res.emplace_back(toDRI(&Sec),
this);
893 template <
class ELFT>
898 template <
class ELFT>
905 template <
class ELFT>
912 template <
class ELFT>
918 template <
class ELFT>
922 auto SectionsOrErr = EF.sections();
925 uintptr_t SHT =
reinterpret_cast<uintptr_t
>((*SectionsOrErr).begin());
926 RelData.
d.
a = (Sec.
p - SHT) / EF.getHeader().e_shentsize;
931 template <
class ELFT>
934 const Elf_Shdr *
S =
reinterpret_cast<const Elf_Shdr *
>(Sec.
p);
939 const Elf_Shdr *RelSec = getRelSection(RelData);
942 auto SymSecOrErr = EF.getSection(RelSec->sh_link);
946 RelData.
d.
b +=
S->sh_size /
S->sh_entsize;
950 template <
class ELFT>
954 return section_end();
957 uintX_t
Type = EShdr->sh_type;
959 return section_end();
968 template <
class ELFT>
973 template <
class ELFT>
977 const Elf_Shdr *sec = getRelSection(Rel);
979 symbolIdx = getRel(Rel)->getSymbol(EF.isMips64EL());
981 symbolIdx = getRela(Rel)->getSymbol(EF.isMips64EL());
987 SymbolData.
d.
a = sec->sh_link;
988 SymbolData.
d.
b = symbolIdx;
992 template <
class ELFT>
994 const Elf_Shdr *sec = getRelSection(Rel);
996 return getRel(Rel)->r_offset;
998 return getRela(Rel)->r_offset;
1001 template <
class ELFT>
1003 const Elf_Shdr *sec = getRelSection(Rel);
1005 return getRel(Rel)->getType(EF.isMips64EL());
1007 return getRela(Rel)->getType(EF.isMips64EL());
1010 template <
class ELFT>
1015 template <
class ELFT>
1019 EF.getRelocationTypeName(
type, Result);
1022 template <
class ELFT>
1027 return (int64_t)getRela(Rel)->r_addend;
1030 template <
class ELFT>
1034 auto Ret = EF.template getEntry<Elf_Rel>(Rel.
d.
a, Rel.
d.
b);
1040 template <
class ELFT>
1044 auto Ret = EF.template getEntry<Elf_Rela>(Rela.
d.
a, Rela.
d.
b);
1050 template <
class ELFT>
1054 if (
Error E = EFOrErr.takeError())
1065 template <
class ELFT>
1067 const Elf_Shdr *DotDynSymSec,
1068 const Elf_Shdr *DotSymtabSec,
1069 const Elf_Shdr *DotSymtabShndx)
1071 getELFType(ELFT::TargetEndianness ==
support::
little, ELFT::Is64Bits),
1073 EF(EF), DotDynSymSec(DotDynSymSec), DotSymtabSec(DotSymtabSec),
1074 DotSymtabShndxSec(DotSymtabShndx) {}
1076 template <
class ELFT>
1079 Other.DotSymtabSec,
Other.DotSymtabShndxSec) {}
1081 template <
class ELFT>
1085 DotSymtabSec && DotSymtabSec->sh_size >=
sizeof(Elf_Sym) ? 1 : 0);
1089 template <
class ELFT>
1091 const Elf_Shdr *SymTab = DotSymtabSec;
1093 return symbol_begin();
1094 DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size /
sizeof(Elf_Sym));
1098 template <
class ELFT>
1100 if (!DotDynSymSec || DotDynSymSec->sh_size <
sizeof(Elf_Sym))
1108 template <
class ELFT>
1110 const Elf_Shdr *SymTab = DotDynSymSec;
1112 return dynamic_symbol_begin();
1113 DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size /
sizeof(Elf_Sym));
1117 template <
class ELFT>
1119 auto SectionsOrErr = EF.sections();
1125 template <
class ELFT>
1127 auto SectionsOrErr = EF.sections();
1133 template <
class ELFT>
1135 return ELFT::Is64Bits ? 8 : 4;
1138 template <
class ELFT>
1143 switch (EF.getHeader().e_machine) {
1145 return "elf32-i386";
1147 return "elf32-iamcu";
1149 return "elf32-x86-64";
1151 return (IsLittleEndian ?
"elf32-littlearm" :
"elf32-bigarm");
1155 return "elf32-hexagon";
1157 return "elf32-lanai";
1159 return "elf32-mips";
1161 return "elf32-msp430";
1163 return (IsLittleEndian ?
"elf32-powerpcle" :
"elf32-powerpc");
1165 return "elf32-littleriscv";
1167 return "elf32-csky";
1170 return "elf32-sparc";
1172 return "elf32-amdgpu";
1174 return "elf32-unknown";
1177 switch (EF.getHeader().e_machine) {
1179 return "elf64-i386";
1181 return "elf64-x86-64";
1183 return (IsLittleEndian ?
"elf64-littleaarch64" :
"elf64-bigaarch64");
1185 return (IsLittleEndian ?
"elf64-powerpcle" :
"elf64-powerpc");
1187 return "elf64-littleriscv";
1189 return "elf64-s390";
1191 return "elf64-sparc";
1193 return "elf64-mips";
1195 return "elf64-amdgpu";
1201 return "elf64-unknown";
1211 switch (EF.getHeader().e_machine) {
1261 if (!IsLittleEndian)
1287 template <
class ELFT>
1289 return EF.getHeader().e_entry;
1292 template <
class ELFT>
1295 return make_range(dynamic_symbol_begin(), dynamic_symbol_end());
1305 #endif // LLVM_OBJECT_ELFOBJECTFILE_H
elf_section_iterator(const section_iterator &B)
const ELFObjectFileBase * getObject() const
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
const Elf_Shdr * DotDynSymSec
This class represents lattice values for constants.
Expected< StringRef > getSectionName(DataRefImpl Sec) const override
ELFSymbolRef toSymbolRef(const Elf_Shdr *SymTable, unsigned SymbolNum) const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Expected< int64_t > getRelocationAddend(DataRefImpl Rel) const override
uint8_t getSymbolELFType(DataRefImpl Symb) const override
const Elf_Shdr * getRelSection(DataRefImpl Rel) const
Get the relocation section that contains Rel.
StringRef getELFTypeName() const
basic_symbol_iterator symbol_begin() const override
bool isSectionText(DataRefImpl Sec) const override
std::vector< std::pair< Optional< DataRefImpl >, uint64_t > > getPltAddresses() const
void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const override
@ EF_AMDGPU_MACH_R600_FIRST
const Elf_Shdr * DotSymtabSec
virtual Error getBuildAttributes(ELFAttributeParser &Attributes) const =0
DataRefImpl getRawDataRefImpl() const
struct llvm::object::DataRefImpl::@311 d
static ErrorSuccess success()
Create a success value.
virtual uint16_t getEMachine() const =0
static Error createError(const Twine &Err)
Error getBuildAttributes(ELFAttributeParser &Attributes) const override
Triple - Helper class for working with autoconf configuration names.
static bool classof(const Binary *v)
const ELFSectionRef & operator*() const
content_iterator< RelocationRef > relocation_iterator
Expected< const typename ELFT::Shdr * > getSection(typename ELFT::ShdrRange Sections, uint32_t Index)
The instances of the Type class are immutable: once they are created, they are never changed.
constexpr int NumElfSymbolTypes
const SymbolRef * operator->() const
const Elf_Shdr * DotSymtabShndxSec
static Expected< const T * > getObject(MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
const ELFSymbolRef & operator*() const
friend class ELFSymbolRef
const ELFRelocationRef * operator->() const
Tagged union holding either a T or a Error.
bool isBerkeleyData(DataRefImpl Sec) const override
elf_symbol_iterator dynamic_symbol_begin() const
void consumeError(Error Err)
Consume a Error without doing anything.
elf_symbol_iterator_range getDynamicSymbolIterators() const override
DataRefImpl toDRI(const Elf_Dyn *Dyn) const
const Elf_Rela * getRela(DataRefImpl Rela) const
virtual basic_symbol_iterator symbol_end() const =0
virtual unsigned getPlatformFlags() const =0
Returns platform-specific object flags, if any.
const SymbolRef & operator*() const
Error initContent() override
const ELFObjectFileBase * getObject() const
DataRefImpl getRawDataRefImpl() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual uint64_t getSectionFlags(DataRefImpl Sec) const =0
void moveSymbolNext(DataRefImpl &Symb) const override
uint64_t getSectionAlignment(DataRefImpl Sec) const override
const ELFFile< ELFT > & getELFFile() const
Manages the enabling and disabling of subtarget specific features.
uint64_t getFlags() const
const content_type & operator*() const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
into llvm powi allowing the code generator to produce balanced multiplication trees First
relocation_iterator section_rel_begin(DataRefImpl Sec) const override
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
uint32_t getSymbolAlignment(DataRefImpl Symb) const override
virtual Expected< int64_t > getRelocationAddend(DataRefImpl Rel) const =0
static unsigned int getELFType(bool isLE, bool is64Bits)
@ EF_AMDGPU_MACH_R600_LAST
bool isBerkeleyText(DataRefImpl Sec) const override
static Expected< ELFObjectFile< ELFT > > create(MemoryBufferRef Object, bool InitContent=true)
const ObjectFile * getObject() const
uint64_t getSymbolValueImpl(DataRefImpl Symb) const override
Base class for error info classes.
uint8_t getSymbolBinding(DataRefImpl Symb) const override
virtual elf_symbol_iterator_range getDynamicSymbolIterators() const =0
virtual uint64_t getSectionOffset(DataRefImpl Sec) const =0
DataRefImpl getRawDataRefImpl() const
const SymbolicFile * getObject() const
This is a value type class that represents a single section in the list of sections in the object fil...
Expected< ArrayRef< uint8_t > > getSectionContents(DataRefImpl Sec) const override
uint64_t getOffset() const
const llvm::EnumEntry< unsigned > ElfSymbolTypes[NumElfSymbolTypes]
relocation_iterator section_rel_end(DataRefImpl Sec) const override
StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type)
bar al al movzbl eax ret Missed when stored in a memory object
AMD64 Optimization Manual has some nice information about optimizing integer multiplication by a constant How much of it applies to Intel s X86 implementation There are definite trade offs to xmm0 cvttss2siq rdx jb L3 subss xmm0 rax cvttss2siq rdx xorq rdx rax ret instead of xmm1 cvttss2siq rcx movaps xmm2 subss xmm2 cvttss2siq rax rdx xorq rax ucomiss xmm0 cmovb rax ret Seems like the jb branch has high likelihood of being taken It would have saved a few instructions It s not possible to reference and DH registers in an instruction requiring REX prefix divb and mulb both produce results in AH If isel emits a CopyFromReg which gets turned into a movb and that can be allocated a r8b r15b To get around isel emits a CopyFromReg from AX and then right shift it down by and truncate it It s not pretty but it works We need some register allocation magic to make the hack go which would often require a callee saved register Callees usually need to keep this value live for most of their body so it doesn t add a significant burden on them We currently implement this in however this is suboptimal because it means that it would be quite awkward to implement the optimization for callers A better implementation would be to relax the LLVM IR rules for sret arguments to allow a function with an sret argument to have a non void return type
section_iterator section_begin() const override
unsigned int getType() const
uint64_t getSectionIndex(DataRefImpl Sec) const override
SubtargetFeatures getFeatures() const override
const Elf_Shdr * getSection(DataRefImpl Sec) const
ELFRelocationRef(const RelocationRef &B)
StringRef getFileFormatName() const override
const ELFSymbolRef * operator->() const
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
static bool classof(const Binary *v)
const ELFObjectFileBase * getObject() const
uint64_t getSectionAddress(DataRefImpl Sec) const override
bool isDebugSection(StringRef SectionName) const override
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Expected< uint32_t > getSymbolFlags(DataRefImpl Symb) const override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
iterator_range< elf_symbol_iterator > elf_symbol_iterator_range
therefore end up llgh r3 lr r0 br r14 but truncating the load would lh r3 br r14 Functions ret i64 and ought to be implemented ngr r0 br r14 but two address optimizations reverse the order of the AND and ngr r2 lgr r0 br r14 CodeGen SystemZ and ll has several examples of this Out of range displacements are usually handled by loading the full address into a register In many cases it would be better to create an anchor point instead E g i64 base
uint8_t getBinding() const
const content_type * operator->() const
virtual uint64_t getSymbolSize(DataRefImpl Symb) const =0
elf_symbol_iterator dynamic_symbol_end() const
Expected< section_iterator > getRelocatedSection(DataRefImpl Sec) const override
Expected< section_iterator > getSymbolSection(const Elf_Sym *Symb, const Elf_Shdr *SymTab) const
uint8_t getSymbolOther(DataRefImpl Symb) const override
Error parse(ArrayRef< uint8_t > section, support::endianness endian)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
@ EF_AMDGPU_MACH_AMDGCN_LAST
content_iterator< SectionRef > section_iterator
bool isRelocatableObject() const override
True if this is a relocatable object (.o/.obj).
bool IsContentValid() const
elf_symbol_iterator_range symbols() const
elf_symbol_iterator(const basic_symbol_iterator &B)
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
@ Dynamic
Denotes mode unknown at compile time.
const ObjectFile * getObject() const
virtual uint32_t getSectionType(DataRefImpl Sec) const =0
unsigned getPlatformFlags() const override
Returns platform-specific object flags, if any.
uint8_t getBytesInAddress() const override
The number of bytes used to represent an address in this object file format.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
virtual basic_symbol_iterator symbol_begin() const =0
uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const override
@ EF_AMDGPU_MACH_AMDGCN_FIRST
std::vector< SectionRef > dynamic_relocation_sections() const override
#define LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const override
const Elf_Shdr * toELFShdrIter(DataRefImpl Sec) const
const Elf_Rel * getRel(DataRefImpl Rel) const
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override
bool isExportedToOtherDSO(const Elf_Sym *ESym) const
uint64_t getRelocationType(DataRefImpl Rel) const override
DataRefImpl toDRI(const Elf_Shdr *SymTable, unsigned SymbolNum) const
void setARMSubArch(Triple &TheTriple) const override
basic_symbol_iterator symbol_end() const override
Lightweight error class with error context and mandatory checking.
virtual uint16_t getEType() const =0
bool isSectionCompressed(DataRefImpl Sec) const override
static Expected< ELFFile > create(StringRef Object)
bool isSectionData(DataRefImpl Sec) const override
section_iterator section_end() const override
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
DataRefImpl toDRI(const Elf_Shdr *Sec) const
SectionRef toSectionRef(const Elf_Shdr *Sec) const
Error takeError()
Take ownership of the stored error.
uint64_t getRelocationOffset(DataRefImpl Rel) const override
virtual uint8_t getSymbolBinding(DataRefImpl Symb) const =0
uint64_t getSectionOffset(DataRefImpl Sec) const override
uint32_t getSectionType(DataRefImpl Sec) const override
ELFSymbolRef(const SymbolRef &B)
Reimplement select in terms of SEL *We would really like to support but we need to prove that the add doesn t need to overflow between the two bit chunks *Implement pre post increment support(e.g. PR935) *Implement smarter const ant generation for binops with large immediates. A few ARMv6T2 ops should be pattern matched
Expected< StringRef > getSymbolName(DataRefImpl Symb) const override
uint8_t getELFType() const
static uint64_t getSymbolValue(const MCSymbol &Symbol, const MCAsmLayout &Layout)
A range adaptor for a pair of iterators.
This is a value type class that represents a single symbol in the list of symbols in the object file.
void moveRelocationNext(DataRefImpl &Rel) const override
elf_relocation_iterator(const relocation_iterator &B)
This is a value type class that represents a single relocation in the list of relocations in the obje...
bool isSectionBSS(DataRefImpl Sec) const override
bool isSectionVirtual(DataRefImpl Sec) const override
Expected< int64_t > getAddend() const
virtual uint8_t getSymbolOther(DataRefImpl Symb) const =0
ELFSectionRef(const SectionRef &B)
void moveSectionNext(DataRefImpl &Sec) const override
static StringRef getSymbolName(SymbolKind SymKind)
virtual uint8_t getSymbolELFType(DataRefImpl Symb) const =0
Optional< StringRef > tryGetCPUName() const override
uint64_t getSectionFlags(DataRefImpl Sec) const override
const ObjectFile * getObject() const
Triple::ArchType getArch() const override
Expected< const Elf_Sym * > getSymbol(DataRefImpl Sym) const
Expected< uint64_t > getStartAddress() const override
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
content_iterator< BasicSymbolRef > basic_symbol_iterator
const ELFRelocationRef & operator*() const
const ELFSectionRef * operator->() const
ELFObjectFileBase(unsigned int Type, MemoryBufferRef Source)
Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const override
uint64_t getSectionSize(DataRefImpl Sec) const override
Optional< std::vector< StOtherPiece > > Other