22 #include <system_error>
25 using namespace object;
27 void ObjectFile::anchor() { }
39 return *
this == **SymSec;
57 return std::error_code();
65 return SectName ==
".llvmbc";
119 if (std::error_code EC = FileOrErr.
getError())
121 std::unique_ptr<MemoryBuffer> Buffer = std::move(FileOrErr.
get());
125 if (
Error Err = ObjOrErr.takeError())
126 return std::move(Err);
127 std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Create ObjectFile from path.
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.
virtual std::error_code getSectionName(DataRefImpl Sec, StringRef &Res) const =0
static ErrorOr< std::unique_ptr< ObjectFile > > createELFObjectFile(MemoryBufferRef Object)
Error takeError()
Take ownership of the stored error.
virtual Expected< StringRef > getSymbolName(DataRefImpl Symb) const =0
struct fuzzer::@269 Flags
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile(MemoryBufferRef Object)
Tagged union holding either a T or a Error.
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...
Microsoft cl.exe's intermediate code file.
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Mach-O Preloaded Executable.
Expected< T > errorOrToExpected(ErrorOr< T > &&EO)
Convert an ErrorOr<T> to an Expected<T>.
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.
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
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile(MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0)
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...
Expected< section_iterator > getSection() const
Get section this symbol is defined in reference to.
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
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 bool isSectionBitcode(DataRefImpl Sec) const
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.
std::error_code errorToErrorCode(Error Err)
Helper for converting an ECError to a std::error_code.
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const