LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::object::ObjectFile Class Referenceabstract

#include <ObjectFile.h>

Inheritance diagram for llvm::object::ObjectFile:
Inheritance graph
[legend]
Collaboration diagram for llvm::object::ObjectFile:
Collaboration graph
[legend]

Public Member Functions

virtual symbol_iterator begin_symbols () const =0
 
virtual symbol_iterator end_symbols () const =0
 
virtual symbol_iterator begin_dynamic_symbols () const =0
 
virtual symbol_iterator end_dynamic_symbols () const =0
 
virtual section_iterator begin_sections () const =0
 
virtual section_iterator end_sections () const =0
 
virtual library_iterator begin_libraries_needed () const =0
 
virtual library_iterator end_libraries_needed () const =0
 
virtual uint8_t getBytesInAddress () const =0
 The number of bytes used to represent an address in this object file format. More...
 
virtual StringRef getFileFormatName () const =0
 
virtual unsigned getArch () const =0
 
virtual StringRef getLoadName () const =0
 
- Public Member Functions inherited from llvm::object::Binary
virtual ~Binary ()
 
StringRef getData () const
 
StringRef getFileName () const
 
unsigned int getType () const
 
bool isObject () const
 
bool isArchive () const
 
bool isMachOUniversalBinary () const
 
bool isELF () const
 
bool isMachO () const
 
bool isCOFF () const
 
bool isLittleEndian () const
 

Static Public Member Functions

static ObjectFilecreateObjectFile (StringRef ObjectPath)
 Create ObjectFile from path. More...
 
static ObjectFilecreateObjectFile (MemoryBuffer *Object)
 
static bool classof (const Binary *v)
 
static ObjectFilecreateCOFFObjectFile (MemoryBuffer *Object)
 
static ObjectFilecreateELFObjectFile (MemoryBuffer *Object)
 
static ObjectFilecreateMachOObjectFile (MemoryBuffer *Object)
 

Protected Member Functions

 ObjectFile (unsigned int Type, MemoryBuffer *source)
 
const uint8_t * base () const
 
virtual error_code getSymbolNext (DataRefImpl Symb, SymbolRef &Res) const =0
 
virtual error_code getSymbolName (DataRefImpl Symb, StringRef &Res) const =0
 
virtual error_code getSymbolAddress (DataRefImpl Symb, uint64_t &Res) const =0
 
virtual error_code getSymbolFileOffset (DataRefImpl Symb, uint64_t &Res) const =0
 
virtual error_code getSymbolAlignment (DataRefImpl Symb, uint32_t &Res) const
 
virtual error_code getSymbolSize (DataRefImpl Symb, uint64_t &Res) const =0
 
virtual error_code getSymbolType (DataRefImpl Symb, SymbolRef::Type &Res) const =0
 
virtual error_code getSymbolFlags (DataRefImpl Symb, uint32_t &Res) const =0
 
virtual error_code getSymbolSection (DataRefImpl Symb, section_iterator &Res) const =0
 
virtual error_code getSymbolValue (DataRefImpl Symb, uint64_t &Val) const =0
 
virtual error_code getSectionNext (DataRefImpl Sec, SectionRef &Res) const =0
 
virtual error_code getSectionName (DataRefImpl Sec, StringRef &Res) const =0
 
virtual error_code getSectionAddress (DataRefImpl Sec, uint64_t &Res) const =0
 
virtual error_code getSectionSize (DataRefImpl Sec, uint64_t &Res) const =0
 
virtual error_code getSectionContents (DataRefImpl Sec, StringRef &Res) const =0
 
virtual error_code getSectionAlignment (DataRefImpl Sec, uint64_t &Res) const =0
 
virtual error_code isSectionText (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionData (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionBSS (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionRequiredForExecution (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionVirtual (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionZeroInit (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code isSectionReadOnlyData (DataRefImpl Sec, bool &Res) const =0
 
virtual error_code sectionContainsSymbol (DataRefImpl Sec, DataRefImpl Symb, bool &Result) const =0
 
virtual relocation_iterator section_rel_begin (DataRefImpl Sec) const =0
 
virtual relocation_iterator section_rel_end (DataRefImpl Sec) const =0
 
virtual section_iterator getRelocatedSection (DataRefImpl Sec) const
 
virtual error_code getRelocationNext (DataRefImpl Rel, RelocationRef &Res) const =0
 
virtual error_code getRelocationAddress (DataRefImpl Rel, uint64_t &Res) const =0
 
virtual error_code getRelocationOffset (DataRefImpl Rel, uint64_t &Res) const =0
 
virtual symbol_iterator getRelocationSymbol (DataRefImpl Rel) const =0
 
virtual error_code getRelocationType (DataRefImpl Rel, uint64_t &Res) const =0
 
virtual error_code getRelocationTypeName (DataRefImpl Rel, SmallVectorImpl< char > &Result) const =0
 
virtual error_code getRelocationValueString (DataRefImpl Rel, SmallVectorImpl< char > &Result) const =0
 
virtual error_code getRelocationHidden (DataRefImpl Rel, bool &Result) const
 
virtual error_code getLibraryNext (DataRefImpl Lib, LibraryRef &Res) const =0
 
virtual error_code getLibraryPath (DataRefImpl Lib, StringRef &Res) const =0
 
- Protected Member Functions inherited from llvm::object::Binary
 Binary (unsigned int Type, MemoryBuffer *Source)
 

Friends

class SymbolRef
 
class SectionRef
 
class RelocationRef
 
class LibraryRef
 

Additional Inherited Members

- Protected Types inherited from llvm::object::Binary
enum  {
  ID_Archive, ID_MachOUniversalBinary, ID_StartObjects, ID_COFF,
  ID_ELF32L, ID_ELF32B, ID_ELF64L, ID_ELF64B,
  ID_MachO32L, ID_MachO32B, ID_MachO64L, ID_MachO64B,
  ID_EndObjects
}
 
- Static Protected Member Functions inherited from llvm::object::Binary
static unsigned int getELFType (bool isLE, bool is64Bits)
 
static unsigned int getMachOType (bool isLE, bool is64Bits)
 
- Protected Attributes inherited from llvm::object::Binary
MemoryBufferData
 

Detailed Description

ObjectFile - This class is the base class for all object file types. Concrete instances of this object are created by createObjectFile, which figures out which type to create.

Definition at line 266 of file ObjectFile.h.

Constructor & Destructor Documentation

ObjectFile::ObjectFile ( unsigned int  Type,
MemoryBuffer source 
)
protected

Definition at line 26 of file ObjectFile.cpp.

Member Function Documentation

const uint8_t* llvm::object::ObjectFile::base ( ) const
inlineprotected
virtual symbol_iterator llvm::object::ObjectFile::begin_dynamic_symbols ( ) const
pure virtual
virtual library_iterator llvm::object::ObjectFile::begin_libraries_needed ( ) const
pure virtual
virtual section_iterator llvm::object::ObjectFile::begin_sections ( ) const
pure virtual
virtual symbol_iterator llvm::object::ObjectFile::begin_symbols ( ) const
pure virtual
static bool llvm::object::ObjectFile::classof ( const Binary v)
inlinestatic

Definition at line 382 of file ObjectFile.h.

References llvm::object::Binary::isObject().

ObjectFile * llvm::ObjectFile::createCOFFObjectFile ( MemoryBuffer Object)
static

Definition at line 933 of file COFFObjectFile.cpp.

Referenced by llvm::object::createBinary(), and createObjectFile().

ObjectFile * llvm::ObjectFile::createELFObjectFile ( MemoryBuffer Object)
static
ObjectFile * llvm::object::ObjectFile::createMachOObjectFile ( MemoryBuffer Object)
static
ObjectFile * ObjectFile::createObjectFile ( StringRef  ObjectPath)
static

Create ObjectFile from path.

Returns
Pointer to ObjectFile subclass to handle this type of object.
Parameters
ObjectPathThe path to the object file. ObjectPath.isObject must return true.

Definition at line 79 of file ObjectFile.cpp.

References llvm::ARMBuildAttrs::File, llvm::MemoryBuffer::getFile(), and llvm::OwningPtr< T >::take().

Referenced by LLVMCreateObjectFile(), and llvm::ObjectImageCommon::ObjectImageCommon().

ObjectFile * ObjectFile::createObjectFile ( MemoryBuffer Object)
static
virtual symbol_iterator llvm::object::ObjectFile::end_dynamic_symbols ( ) const
pure virtual
virtual library_iterator llvm::object::ObjectFile::end_libraries_needed ( ) const
pure virtual
virtual section_iterator llvm::object::ObjectFile::end_sections ( ) const
pure virtual
virtual symbol_iterator llvm::object::ObjectFile::end_symbols ( ) const
pure virtual
virtual unsigned llvm::object::ObjectFile::getArch ( ) const
pure virtual
virtual uint8_t llvm::object::ObjectFile::getBytesInAddress ( ) const
pure virtual

The number of bytes used to represent an address in this object file format.

Implemented in llvm::object::COFFObjectFile, llvm::object::ELFObjectFile< ELFT >, and llvm::object::MachOObjectFile.

virtual StringRef llvm::object::ObjectFile::getFileFormatName ( ) const
pure virtual
virtual error_code llvm::object::ObjectFile::getLibraryNext ( DataRefImpl  Lib,
LibraryRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getLibraryPath ( DataRefImpl  Lib,
StringRef Res 
) const
protectedpure virtual
virtual StringRef llvm::object::ObjectFile::getLoadName ( ) const
pure virtual

For shared objects, returns the name which this object should be loaded from at runtime. This corresponds to DT_SONAME on ELF and LC_ID_DYLIB (install name) on MachO.

Implemented in llvm::object::COFFObjectFile, llvm::object::ELFObjectFile< ELFT >, and llvm::object::MachOObjectFile.

section_iterator ObjectFile::getRelocatedSection ( DataRefImpl  Sec) const
protectedvirtual

Reimplemented in llvm::object::ELFObjectFile< ELFT >.

Definition at line 36 of file ObjectFile.cpp.

References SectionRef.

Referenced by llvm::object::SectionRef::getRelocatedSection().

virtual error_code llvm::object::ObjectFile::getRelocationAddress ( DataRefImpl  Rel,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getRelocationHidden ( DataRefImpl  Rel,
bool Result 
) const
inlineprotectedvirtual
virtual error_code llvm::object::ObjectFile::getRelocationNext ( DataRefImpl  Rel,
RelocationRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getRelocationOffset ( DataRefImpl  Rel,
uint64_t &  Res 
) const
protectedpure virtual
virtual symbol_iterator llvm::object::ObjectFile::getRelocationSymbol ( DataRefImpl  Rel) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getRelocationType ( DataRefImpl  Rel,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getRelocationTypeName ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getRelocationValueString ( DataRefImpl  Rel,
SmallVectorImpl< char > &  Result 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionAddress ( DataRefImpl  Sec,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionAlignment ( DataRefImpl  Sec,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionContents ( DataRefImpl  Sec,
StringRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionName ( DataRefImpl  Sec,
StringRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionNext ( DataRefImpl  Sec,
SectionRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSectionSize ( DataRefImpl  Sec,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolAddress ( DataRefImpl  Symb,
uint64_t &  Res 
) const
protectedpure virtual
error_code ObjectFile::getSymbolAlignment ( DataRefImpl  Symb,
uint32_t &  Res 
) const
protectedvirtual
virtual error_code llvm::object::ObjectFile::getSymbolFileOffset ( DataRefImpl  Symb,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolFlags ( DataRefImpl  Symb,
uint32_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolName ( DataRefImpl  Symb,
StringRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolNext ( DataRefImpl  Symb,
SymbolRef Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolSection ( DataRefImpl  Symb,
section_iterator Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolSize ( DataRefImpl  Symb,
uint64_t &  Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolType ( DataRefImpl  Symb,
SymbolRef::Type Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::getSymbolValue ( DataRefImpl  Symb,
uint64_t &  Val 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionBSS ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionData ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionReadOnlyData ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionRequiredForExecution ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionText ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionVirtual ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::isSectionZeroInit ( DataRefImpl  Sec,
bool Res 
) const
protectedpure virtual
virtual relocation_iterator llvm::object::ObjectFile::section_rel_begin ( DataRefImpl  Sec) const
protectedpure virtual
virtual relocation_iterator llvm::object::ObjectFile::section_rel_end ( DataRefImpl  Sec) const
protectedpure virtual
virtual error_code llvm::object::ObjectFile::sectionContainsSymbol ( DataRefImpl  Sec,
DataRefImpl  Symb,
bool Result 
) const
protectedpure virtual

Friends And Related Function Documentation

friend class LibraryRef
friend

Definition at line 345 of file ObjectFile.h.

friend class RelocationRef
friend
friend class SectionRef
friend
friend class SymbolRef
friend

The documentation for this class was generated from the following files: