LLVM API Documentation

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

Classes

struct  ArchiveMemberHeader
class  Archive
class  Binary
class  OwningBinary
struct  dos_header
 The DOS compatible header at the front of all PE/COFF executables. More...
struct  coff_file_header
struct  coff_bigobj_file_header
struct  pe32_header
 The 32-bit PE header that follows the COFF header. More...
struct  pe32plus_header
 The 64-bit PE header that follows the COFF header. More...
struct  data_directory
struct  import_directory_table_entry
struct  import_lookup_table_entry
struct  delay_import_directory_table_entry
struct  export_directory_table_entry
union  export_address_table_entry
struct  StringTableOffset
struct  coff_symbol
class  COFFSymbolRef
struct  coff_section
struct  coff_relocation
struct  coff_aux_function_definition
struct  coff_aux_bf_and_ef_symbol
struct  coff_aux_weak_external
struct  coff_aux_section_definition
struct  coff_aux_clr_token
struct  coff_load_configuration32
struct  coff_runtime_function_x64
struct  coff_base_reloc_block_header
struct  coff_base_reloc_block_entry
class  COFFObjectFile
class  ImportDirectoryEntryRef
class  DelayImportDirectoryEntryRef
class  ExportDirectoryEntryRef
class  ImportedSymbolRef
class  BaseRelocRef
class  ELFFile
class  ELFObjectFileBase
class  ELFObjectFile
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  IRObjectFile
class  DiceRef
class  ExportEntry
class  MachORebaseEntry
class  MachOBindEntry
class  MachOObjectFile
class  MachOUniversalBinary
class  RelocationRef
class  SectionRef
class  SymbolRef
class  symbol_iterator
class  ObjectFile
struct  RelocToApply
class  RelocVisitor
 Base class for object file relocation visitors. More...
union  DataRefImpl
class  content_iterator
class  BasicSymbolRef
class  SymbolicFile

Typedefs

typedef content_iterator
< ImportDirectoryEntryRef
import_directory_iterator
typedef content_iterator
< DelayImportDirectoryEntryRef
delay_import_directory_iterator
typedef content_iterator
< ExportDirectoryEntryRef
export_directory_iterator
typedef content_iterator
< ImportedSymbolRef
imported_symbol_iterator
typedef content_iterator
< BaseRelocRef
base_reloc_iterator
typedef
import_lookup_table_entry
< support::little32_t
import_lookup_table_entry32
typedef
import_lookup_table_entry
< support::little64_t
import_lookup_table_entry64
typedef support::ulittle32_t export_name_pointer_table_entry
typedef support::ulittle16_t export_ordinal_table_entry
typedef coff_symbol
< support::ulittle16_t
coff_symbol16
typedef coff_symbol
< support::ulittle32_t
coff_symbol32
typedef ELFFile< ELFType
< support::little, 2, false > > 
ELF32LEFile
typedef ELFFile< ELFType
< support::little, 2, true > > 
ELF64LEFile
typedef ELFFile< ELFType
< support::big, 2, false > > 
ELF32BEFile
typedef ELFFile< ELFType
< support::big, 2, true > > 
ELF64BEFile
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< DiceRefdice_iterator
typedef content_iterator
< ExportEntry
export_iterator
typedef content_iterator
< MachORebaseEntry
rebase_iterator
typedef content_iterator
< MachOBindEntry
bind_iterator
typedef content_iterator
< RelocationRef
relocation_iterator
typedef content_iterator
< SectionRef
section_iterator
typedef content_iterator
< BasicSymbolRef
basic_symbol_iterator

Enumerations

enum  object_error {
  success = 0, arch_not_found, invalid_file_type, parse_failed,
  unexpected_eof, bitcode_section_not_found
}

Functions

ErrorOr< std::unique_ptr
< Binary > > 
createBinary (MemoryBufferRef Source, LLVMContext *Context=nullptr)
 Create a Binary from Source, autodetecting the file type.
ErrorOr< OwningBinary< Binary > > createBinary (StringRef Path)
StringRef getELFRelocationTypeName (uint32_t Machine, uint32_t Type)
std::pair< unsigned char,
unsigned char > 
getElfArchType (StringRef Object)
static unsigned elf_hash (StringRef &symbolName)
std::error_code getELFRelocationAddend (const RelocationRef R, int64_t &Addend)
std::pair< symbol_iterator,
symbol_iterator
getELFDynamicSymbolIterators (const SymbolicFile *Obj)
std::error_code GetELFSymbolVersion (const ObjectFile *Obj, const SymbolRef &Sym, StringRef &Version, bool &IsDefault)
const std::error_categoryobject_category ()
std::error_code make_error_code (object_error e)
bool operator== (const DataRefImpl &a, const DataRefImpl &b)
bool operator!= (const DataRefImpl &a, const DataRefImpl &b)
bool operator< (const DataRefImpl &a, const DataRefImpl &b)

Variables

const uint64_t UnknownAddressOrSize = ~0ULL

Typedef Documentation

Definition at line 37 of file Object/COFF.h.

Definition at line 112 of file SymbolicFile.h.

Definition at line 185 of file Object/MachO.h.

Definition at line 249 of file Object/COFF.h.

Definition at line 250 of file Object/COFF.h.

Definition at line 34 of file Object/COFF.h.

Definition at line 50 of file Object/MachO.h.

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

Definition at line 232 of file ELFObjectFile.h.

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

Definition at line 230 of file ELFObjectFile.h.

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

Definition at line 233 of file ELFObjectFile.h.

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

Definition at line 231 of file ELFObjectFile.h.

Definition at line 35 of file Object/COFF.h.

Definition at line 101 of file Object/MachO.h.

Definition at line 225 of file Object/COFF.h.

Definition at line 226 of file Object/COFF.h.

Definition at line 31 of file Object/COFF.h.

Definition at line 190 of file Object/COFF.h.

Definition at line 192 of file Object/COFF.h.

Definition at line 36 of file Object/COFF.h.

Definition at line 137 of file Object/MachO.h.

Definition at line 75 of file ObjectFile.h.

Definition at line 79 of file ObjectFile.h.


Enumeration Type Documentation

Enumerator:
success 
arch_not_found 
invalid_file_type 
parse_failed 
unexpected_eof 
bitcode_section_not_found 

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


Function Documentation

ErrorOr< std::unique_ptr< Binary > > llvm::object::createBinary ( MemoryBufferRef  Source,
LLVMContext Context = nullptr 
)

Create a Binary from Source, autodetecting the file type.

Parameters:
SourceThe data to create the Binary from.

Definition at line 39 of file Binary.cpp.

References llvm::sys::fs::file_magic::archive, llvm::sys::fs::file_magic::bitcode, llvm::sys::fs::file_magic::coff_import_library, llvm::sys::fs::file_magic::coff_object, llvm::object::MachOUniversalBinary::create(), llvm::object::Archive::create(), llvm::object::SymbolicFile::createSymbolicFile(), llvm::sys::fs::file_magic::elf, llvm::sys::fs::file_magic::elf_core, llvm::sys::fs::file_magic::elf_executable, llvm::sys::fs::file_magic::elf_relocatable, llvm::sys::fs::file_magic::elf_shared_object, llvm::MemoryBufferRef::getBuffer(), llvm::sys::fs::identify_magic(), invalid_file_type, llvm_unreachable, llvm::sys::fs::file_magic::macho_bundle, llvm::sys::fs::file_magic::macho_core, llvm::sys::fs::file_magic::macho_dsym_companion, llvm::sys::fs::file_magic::macho_dynamic_linker, llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib, llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub, llvm::sys::fs::file_magic::macho_executable, llvm::sys::fs::file_magic::macho_fixed_virtual_memory_shared_lib, llvm::sys::fs::file_magic::macho_object, llvm::sys::fs::file_magic::macho_preload_executable, llvm::sys::fs::file_magic::macho_universal_binary, llvm::sys::fs::file_magic::pecoff_executable, llvm::sys::fs::file_magic::unknown, and llvm::sys::fs::file_magic::windows_resource.

Referenced by createBinary(), and llvm::object::Archive::Child::getAsBinary().

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 1001 of file Object/ELF.h.

References llvm::StringRef::size().

std::pair<unsigned char, unsigned char> llvm::object::getElfArchType ( StringRef  Object) [inline]

Definition at line 939 of file ELFObjectFile.h.

std::error_code llvm::object::getELFRelocationAddend ( const RelocationRef  R,
int64_t &  Addend 
) [inline]
StringRef llvm::object::getELFRelocationTypeName ( uint32_t  Machine,
uint32_t  Type 
)
std::error_code llvm::object::GetELFSymbolVersion ( const ObjectFile *  Obj,
const SymbolRef &  Sym,
StringRef &  Version,
bool IsDefault 
) [inline]

Definition at line 943 of file ELFObjectFile.h.

std::error_code llvm::object::make_error_code ( object_error  e) [inline]

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

References object_category().

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

References error_category.

Referenced by make_error_code().

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

Definition at line 38 of file SymbolicFile.h.

References operator==().

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

Definition at line 42 of file SymbolicFile.h.

References llvm::LibFunc::memcmp.

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

Definition at line 32 of file SymbolicFile.h.

References llvm::LibFunc::memcmp.

Referenced by operator!=().


Variable Documentation