LLVM API Documentation

Namespaces | Classes | Typedefs | Functions | Variables
llvm::object Namespace Reference

Namespaces

namespace  mach
 

General Mach platform information.


namespace  macho
 

Format information for Mach object files.


Classes

struct  ArchiveMemberHeader
class  Archive
class  Binary
struct  coff_file_header
struct  coff_symbol
struct  coff_section
struct  coff_relocation
struct  coff_aux_section_definition
class  COFFObjectFile
struct  ELFType
struct  MaximumAlignment
struct  ELFDataTypeTypedefHelperCommon
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, MaxAlign, false > >
 ELF 32bit types. More...
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, MaxAlign, true > >
 ELF 64bit types. More...
struct  Elf_Shdr_Base< ELFType< TargetEndianness, MaxAlign, false > >
struct  Elf_Shdr_Base< ELFType< TargetEndianness, MaxAlign, true > >
struct  Elf_Shdr_Impl
struct  Elf_Sym_Base< ELFType< TargetEndianness, MaxAlign, false > >
struct  Elf_Sym_Base< ELFType< TargetEndianness, MaxAlign, true > >
struct  Elf_Sym_Impl
struct  Elf_Versym_Impl
struct  Elf_Verdef_Impl
struct  Elf_Verdaux_Impl
struct  Elf_Verneed_Impl
struct  Elf_Vernaux_Impl
struct  Elf_Dyn_Base< ELFType< TargetEndianness, MaxAlign, false > >
struct  Elf_Dyn_Base< ELFType< TargetEndianness, MaxAlign, true > >
struct  Elf_Dyn_Impl
 Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters and setters. More...
struct  Elf_Rel_Base< ELFType< TargetEndianness, MaxAlign, false >, false >
struct  Elf_Rel_Base< ELFType< TargetEndianness, MaxAlign, true >, false >
struct  Elf_Rel_Base< ELFType< TargetEndianness, MaxAlign, false >, true >
struct  Elf_Rel_Base< ELFType< TargetEndianness, MaxAlign, true >, true >
struct  Elf_Rel_Impl< ELFType< TargetEndianness, MaxAlign, true >, isRela >
struct  Elf_Rel_Impl< ELFType< TargetEndianness, MaxAlign, false >, isRela >
struct  Elf_Ehdr_Impl
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, MaxAlign, false > >
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, MaxAlign, true > >
class  ELFObjectFile
struct  object_error
class  MachOObjectFile
union  DataRefImpl
class  content_iterator
class  RelocationRef
class  SectionRef
class  SymbolRef
class  LibraryRef
class  ObjectFile
struct  RelocToApply
class  RelocVisitor
 Base class for object file relocation visitors. More...
struct  SymbolTableEntryBase
struct  SectionBase

Typedefs

typedef ELFObjectFile< ELFType
< support::little, 2, false > > 
ELF32LEObjectFile
typedef ELFObjectFile< ELFType
< support::little, 2, true > > 
ELF64LEObjectFile
typedef ELFObjectFile< ELFType
< support::big, 2, false > > 
ELF32BEObjectFile
typedef ELFObjectFile< ELFType
< support::big, 2, true > > 
ELF64BEObjectFile
typedef content_iterator
< RelocationRef
relocation_iterator
typedef content_iterator
< SectionRef
section_iterator
typedef content_iterator
< SymbolRef
symbol_iterator
typedef content_iterator
< LibraryRef
library_iterator

Functions

static const ArchiveMemberHeaderToHeader (const char *base)
error_code createBinary (MemoryBuffer *Source, OwningPtr< Binary > &Result)
 Create a Binary from Source, autodetecting the file type.
error_code createBinary (StringRef Path, OwningPtr< Binary > &Result)
std::pair< unsigned char,
unsigned char > 
getElfArchType (MemoryBuffer *Object)
static error_code getELFRelocationAddend (const RelocationRef R, int64_t &Addend)
static error_code GetELFSymbolVersion (const ObjectFile *Obj, const SymbolRef &Sym, StringRef &Version, bool &IsDefault)
static unsigned elf_hash (StringRef &symbolName)
const error_categoryobject_category ()
error_code make_error_code (object_error e)
bool operator== (const DataRefImpl &a, const DataRefImpl &b)
bool operator< (const DataRefImpl &a, const DataRefImpl &b)
template<typename T >
static void SwapValue (T &Value)
template<typename T >
static void SwapStruct (T &Value)
template<>
void SwapStruct (macho::RelocationEntry &H)
template<>
void SwapStruct (macho::LoadCommand &L)
template<>
void SwapStruct (SymbolTableEntryBase &S)
template<>
void SwapStruct (macho::Section &S)
template<>
void SwapStruct (macho::Section64 &S)
template<>
void SwapStruct (macho::SymbolTableEntry &S)
template<>
void SwapStruct (macho::Symbol64TableEntry &S)
template<>
void SwapStruct (macho::Header &H)
template<>
void SwapStruct (macho::Header64Ext &E)
template<>
void SwapStruct (macho::SymtabLoadCommand &C)
template<>
void SwapStruct (macho::DysymtabLoadCommand &C)
template<>
void SwapStruct (macho::LinkeditDataLoadCommand &C)
template<>
void SwapStruct (macho::SegmentLoadCommand &C)
template<>
void SwapStruct (macho::Segment64LoadCommand &C)
template<>
void SwapStruct (macho::IndirectSymbolTableEntry &C)
template<>
void SwapStruct (macho::LinkerOptionsLoadCommand &C)
template<>
void SwapStruct (macho::DataInCodeTableEntry &C)
template<typename T >
T getStruct (const MachOObjectFile *O, const char *P)
static uint32_t getSegmentLoadCommandNumSections (const MachOObjectFile *O, const MachOObjectFile::LoadCommandInfo &L)
static const char * getSectionPtr (const MachOObjectFile *O, MachOObjectFile::LoadCommandInfo L, unsigned Sec)
static const char * getPtr (const MachOObjectFile *O, size_t Offset)
static SymbolTableEntryBase getSymbolTableEntryBase (const MachOObjectFile *O, DataRefImpl DRI)
static StringRef parseSegmentOrSectionName (const char *P)
template<class T >
static error_code advance (T &it, size_t Val)
template<class T >
static void advanceTo (T &it, size_t Val)
static unsigned getCPUType (const MachOObjectFile *O)
static void printRelocationTargetName (const MachOObjectFile *O, const macho::RelocationEntry &RE, raw_string_ostream &fmt)
static uint32_t getPlainRelocationAddress (const macho::RelocationEntry &RE)
static unsigned getScatteredRelocationAddress (const macho::RelocationEntry &RE)
static bool getPlainRelocationPCRel (const MachOObjectFile *O, const macho::RelocationEntry &RE)
static bool getScatteredRelocationPCRel (const MachOObjectFile *O, const macho::RelocationEntry &RE)
static unsigned getPlainRelocationLength (const MachOObjectFile *O, const macho::RelocationEntry &RE)
static unsigned getScatteredRelocationLength (const macho::RelocationEntry &RE)
static unsigned getPlainRelocationType (const MachOObjectFile *O, const macho::RelocationEntry &RE)
static unsigned getScatteredRelocationType (const macho::RelocationEntry &RE)
static uint32_t getSectionFlags (const MachOObjectFile *O, DataRefImpl Sec)

Variables

const uint64_t UnknownAddressOrSize = ~0ULL

Typedef Documentation

Definition at line 846 of file Object/ELF.h.

Definition at line 844 of file Object/ELF.h.

Definition at line 847 of file Object/ELF.h.

Definition at line 845 of file Object/ELF.h.

Definition at line 265 of file ObjectFile.h.

Definition at line 132 of file ObjectFile.h.

Definition at line 175 of file ObjectFile.h.

Definition at line 241 of file ObjectFile.h.


Function Documentation

template<class T >
static error_code llvm::object::advance ( T it,
size_t  Val 
) [static]
template<class T >
static void llvm::object::advanceTo ( T it,
size_t  Val 
) [static]

Definition at line 280 of file MachOObjectFile.cpp.

References advance(), and llvm::report_fatal_error().

Referenced by printRelocationTargetName().

error_code llvm::object::createBinary ( MemoryBuffer Source,
OwningPtr< Binary > &  Result 
)
error_code llvm::object::createBinary ( StringRef  Path,
OwningPtr< Binary > &  Result 
)
static unsigned llvm::object::elf_hash ( StringRef &  symbolName) [inline, static]

This function returns the hash value for a symbol in the .dynsym section Name of the API remains consistent as specified in the libelf REF : http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash

Definition at line 3013 of file Object/ELF.h.

References llvm::StringRef::size().

static unsigned llvm::object::getCPUType ( const MachOObjectFile O) [static]
std::pair<unsigned char, unsigned char> llvm::object::getElfArchType ( MemoryBuffer *  Object) [inline]
static error_code llvm::object::getELFRelocationAddend ( const RelocationRef  R,
int64_t &  Addend 
) [inline, static]

FIXME: Maybe we should have a base ElfObjectFile that is not a template and make these member functions?

Definition at line 2962 of file Object/ELF.h.

References llvm::object::RelocationRef::getObjectFile(), llvm::object::RelocationRef::getRawDataRefImpl(), and llvm_unreachable.

Referenced by llvm::RuntimeDyldELF::processRelocationRef().

static error_code llvm::object::GetELFSymbolVersion ( const ObjectFile *  Obj,
const SymbolRef &  Sym,
StringRef &  Version,
bool IsDefault 
) [inline, static]

This is a generic interface for retrieving GNU symbol version information from an ELFObjectFile.

Definition at line 2987 of file Object/ELF.h.

References llvm_unreachable.

static uint32_t llvm::object::getPlainRelocationAddress ( const macho::RelocationEntry RE) [static]
static unsigned llvm::object::getPlainRelocationLength ( const MachOObjectFile O,
const macho::RelocationEntry RE 
) [static]
static bool llvm::object::getPlainRelocationPCRel ( const MachOObjectFile O,
const macho::RelocationEntry RE 
) [static]
static unsigned llvm::object::getPlainRelocationType ( const MachOObjectFile O,
const macho::RelocationEntry RE 
) [static]
static const char* llvm::object::getPtr ( const MachOObjectFile O,
size_t  Offset 
) [static]
static unsigned llvm::object::getScatteredRelocationAddress ( const macho::RelocationEntry RE) [static]
static unsigned llvm::object::getScatteredRelocationLength ( const macho::RelocationEntry RE) [static]
static bool llvm::object::getScatteredRelocationPCRel ( const MachOObjectFile O,
const macho::RelocationEntry RE 
) [static]
static unsigned llvm::object::getScatteredRelocationType ( const macho::RelocationEntry RE) [static]
static uint32_t llvm::object::getSectionFlags ( const MachOObjectFile O,
DataRefImpl  Sec 
) [static]
static const char* llvm::object::getSectionPtr ( const MachOObjectFile O,
MachOObjectFile::LoadCommandInfo  L,
unsigned  Sec 
) [static]
static uint32_t llvm::object::getSegmentLoadCommandNumSections ( const MachOObjectFile O,
const MachOObjectFile::LoadCommandInfo L 
) [static]
template<typename T >
T llvm::object::getStruct ( const MachOObjectFile O,
const char *  P 
)
static SymbolTableEntryBase llvm::object::getSymbolTableEntryBase ( const MachOObjectFile O,
DataRefImpl  DRI 
) [static]
error_code llvm::object::make_error_code ( object_error  e) [inline]

Definition at line 38 of file Object/Error.h.

References object_category().

Referenced by createBinary().

const error_category & llvm::object::object_category ( )

Definition at line 54 of file Object/Error.cpp.

Referenced by make_error_code().

bool llvm::object::operator< ( const DataRefImpl &  a,
const DataRefImpl &  b 
) [inline]

Definition at line 85 of file ObjectFile.h.

References llvm::LibFunc::memcmp.

bool llvm::object::operator== ( const DataRefImpl &  a,
const DataRefImpl &  b 
) [inline]

Definition at line 79 of file ObjectFile.h.

References llvm::LibFunc::memcmp.

static StringRef llvm::object::parseSegmentOrSectionName ( const char *  P) [static]
static void llvm::object::printRelocationTargetName ( const MachOObjectFile O,
const macho::RelocationEntry RE,
raw_string_ostream fmt 
) [static]
template<typename T >
static void llvm::object::SwapStruct ( T Value) [static]

Referenced by getStruct().

template<>
void llvm::object::SwapStruct ( macho::RelocationEntry H)
template<>
void llvm::object::SwapStruct ( macho::LoadCommand L)
template<>
void llvm::object::SwapStruct ( SymbolTableEntryBase S)
template<>
void llvm::object::SwapStruct ( macho::Section S)
template<>
void llvm::object::SwapStruct ( macho::Section64 S)
template<>
void llvm::object::SwapStruct ( macho::SymbolTableEntry S)
template<>
void llvm::object::SwapStruct ( macho::Symbol64TableEntry S)
template<>
void llvm::object::SwapStruct ( macho::Header H)
template<>
void llvm::object::SwapStruct ( macho::Header64Ext E)

Definition at line 123 of file MachOObjectFile.cpp.

References llvm::object::macho::Header64Ext::Reserved, and SwapValue().

template<>
void llvm::object::SwapStruct ( macho::SymtabLoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::DysymtabLoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::LinkeditDataLoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::SegmentLoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::Segment64LoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::IndirectSymbolTableEntry C)
template<>
void llvm::object::SwapStruct ( macho::LinkerOptionsLoadCommand C)
template<>
void llvm::object::SwapStruct ( macho::DataInCodeTableEntry C)
template<typename T >
static void llvm::object::SwapValue ( T Value) [static]

Definition at line 45 of file MachOObjectFile.cpp.

References llvm::sys::SwapByteOrder().

Referenced by SwapStruct().

static const ArchiveMemberHeader* llvm::object::ToHeader ( const char *  base) [static]

Variable Documentation

const uint64_t llvm::object::UnknownAddressOrSize = ~0ULL