30 #include <system_error> 42 void ObjectFile::anchor() {}
54 return *
this == **SymSec;
79 return *NameOrErr ==
".llvmbc";
116 const auto COFFObj = cast<COFFObjectFile>(
this);
178 if (std::error_code EC = FileOrErr.
getError())
180 std::unique_ptr<MemoryBuffer> Buffer = std::move(FileOrErr.
get());
184 if (
Error Err = ObjOrErr.takeError())
185 return std::move(Err);
186 std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
raw_ostream & operator<<(raw_ostream &OS, const SectionedAddress &Addr)
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Represents either an error or a value T.
virtual bool isBerkeleyData(DataRefImpl Sec) const
This class represents lattice values for constants.
Microsoft cl.exe's intermediate code file.
ELF dynamically linked shared lib.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
virtual Expected< section_iterator > getRelocatedSection(DataRefImpl Sec) const
Triple makeTriple() const
Create a triple from the data in this object file.
Windows compiled resource file (.res)
static const uint64_t UndefSection
Error takeError()
Take ownership of the stored error.
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile(MemoryBufferRef Object, unsigned FileType)
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const
virtual Expected< StringRef > getSymbolName(DataRefImpl Symb) const =0
virtual bool isSectionStripped(DataRefImpl Sec) const
Mach-O Preloaded Executable.
StringRef getBuffer() const
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
The Mach-O dynamic linker.
Tagged union holding either a T or a Error.
ELF Relocatable object file.
content_iterator< SectionRef > section_iterator
virtual bool isSectionBitcode(DataRefImpl Sec) const
Expected< section_iterator > getSection() const
Get section this symbol is defined in reference to.
Mach-O dSYM companion file.
virtual uint32_t getSymbolFlags(DataRefImpl Symb) const =0
void setObjectFormat(ObjectFormatType Kind)
setObjectFormat - Set the object file format
The instances of the Type class are immutable: once they are created, they are never changed...
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
void setTriple(const Twine &Str)
setTriple - Set all components to the new triple Str.
static Expected< std::unique_ptr< ObjectFile > > createELFObjectFile(MemoryBufferRef Object)
std::error_code getError() const
bool containsSymbol(SymbolRef S) const
virtual Expected< StringRef > getSectionName(DataRefImpl Sec) const =0
void consumeError(Error Err)
Consume a Error without doing anything.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile(MemoryBufferRef Object)
static ErrorSuccess success()
Create a success value.
Mach-O dynlinked shared lib.
static Expected< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile(MemoryBufferRef Object)
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile(MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
virtual void setARMSubArch(Triple &TheTriple) const
virtual Triple::ArchType getArch() const =0
uint64_t getSymbolValue(DataRefImpl Symb) const
virtual bool isSectionText(DataRefImpl Sec) const =0
This is a value type class that represents a single symbol in the list of symbols in the object file...
virtual bool isBerkeleyText(DataRefImpl Sec) const
virtual bool isSectionData(DataRefImpl Sec) const =0
uint64_t getCommonSymbolSize(DataRefImpl Symb) const
virtual uint64_t getSymbolValueImpl(DataRefImpl Symb) const =0
Provides ErrorOr<T> smart pointer.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatile=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Windows PDB debug info file.
Text-based Dynamic Library Stub file.
void setArch(ArchType Kind)
setArch - Set the architecture (first) component of the triple to a known type.
Error printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...