21 #include <system_error>
24 using namespace object;
26 void ObjectFile::anchor() { }
35 return *
this == *SymSec;
50 if (std::error_code EC = Name.
getError())
53 return std::error_code();
105 if (std::error_code EC = FileOrErr.
getError())
107 std::unique_ptr<MemoryBuffer> Buffer = std::move(FileOrErr.
get());
111 if (std::error_code EC = ObjOrErr.getError())
113 std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
static ErrorOr< std::unique_ptr< MachOObjectFile > > createMachOObjectFile(MemoryBufferRef Object)
std::error_code getError() const
Represents either an error or a value T.
Mach-O dynlinked shared lib.
static ErrorOr< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile(MemoryBufferRef Object)
ELF Relocatable object file.
static ErrorOr< std::unique_ptr< ObjectFile > > createELFObjectFile(MemoryBufferRef Object)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ELF dynamically linked shared lib.
bool containsSymbol(SymbolRef S) const
Windows compiled resource file (.rc)
content_iterator< SectionRef > section_iterator
virtual uint32_t getSymbolFlags(DataRefImpl Symb) const =0
The instances of the Type class are immutable: once they are created, they are never changed...
Mach-O Preloaded Executable.
const ObjectFile * getObject() const
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
std::error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override
StringRef getBuffer() const
virtual section_iterator getRelocatedSection(DataRefImpl Sec) const
This is a value type class that represents a single symbol in the list of symbols in the object file...
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
virtual section_iterator section_end() const =0
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFile(const Twine &Filename, int64_t FileSize=-1, bool RequiresNullTerminator=true, bool IsVolatileSize=false)
Open the specified file as a MemoryBuffer, returning a new MemoryBuffer if successful, otherwise returning null.
uint64_t getSymbolValue(DataRefImpl Symb) const
Mach-O dSYM companion file.
The Mach-O dynamic linker.
virtual uint64_t getSymbolValueImpl(DataRefImpl Symb) const =0
uint64_t getCommonSymbolSize(DataRefImpl Symb) const
virtual ErrorOr< StringRef > getSymbolName(DataRefImpl Symb) const =0
This class implements an extremely fast bulk output stream that can only output to a stream...
static ErrorOr< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Create ObjectFile from path.
StringRef - Represent a constant reference to a string, i.e.
std::error_code getSection(section_iterator &Result) const
Get section this symbol is defined in reference to.
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const