LLVM  4.0.0
Classes | Typedefs | Enumerations | Functions
llvm::object Namespace Reference

Classes

class  OwningBinary
 
class  ArchiveMemberHeader
 
class  Archive
 
class  Binary
 
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  debug_directory
 
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
 
struct  coff_symbol_generic
 
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_import_header
 
struct  coff_import_directory_table_entry
 
struct  coff_tls_directory
 
struct  coff_load_configuration32
 
struct  coff_load_configuration64
 
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
 
struct  FpoData
 
class  COFFImportFile
 
class  Decompressor
 Decompressor helps to handle decompression of compressed sections. More...
 
class  ELFFile
 
class  ELFObjectFileBase
 
class  ELFSectionRef
 
class  elf_section_iterator
 
class  ELFSymbolRef
 
class  elf_symbol_iterator
 
class  ELFRelocationRef
 
class  elf_relocation_iterator
 
class  ELFObjectFile
 
struct  Elf_Ehdr_Impl
 
struct  Elf_Shdr_Impl
 
struct  Elf_Sym_Impl
 
struct  Elf_Dyn_Impl
 Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters. More...
 
struct  Elf_Phdr_Impl
 
struct  Elf_Rel_Impl
 
struct  Elf_Verdef_Impl
 Elf_Verdef: This is the structure of entries in the SHT_GNU_verdef section (.gnu.version_d). More...
 
struct  Elf_Verdaux_Impl
 Elf_Verdaux: This is the structure of auxiliary data in the SHT_GNU_verdef section (.gnu.version_d). More...
 
struct  Elf_Verneed_Impl
 Elf_Verneed: This is the structure of entries in the SHT_GNU_verneed section (.gnu.version_r). More...
 
struct  Elf_Vernaux_Impl
 Elf_Vernaux: This is the structure of auxiliary data in SHT_GNU_verneed section (.gnu.version_r). More...
 
struct  Elf_Versym_Impl
 Elf_Versym: This is the structure of entries in the SHT_GNU_versym section (.gnu.version). More...
 
struct  Elf_Hash_Impl
 
struct  Elf_GnuHash_Impl
 
struct  Elf_Chdr_Impl
 
struct  ELFType
 
struct  ELFDataTypeTypedefHelperCommon
 
struct  ELFDataTypeTypedefHelper
 
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, false > >
 ELF 32bit types. More...
 
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, true > >
 ELF 64bit types. More...
 
struct  Elf_Shdr_Base
 
struct  Elf_Shdr_Base< ELFType< TargetEndianness, false > >
 
struct  Elf_Shdr_Base< ELFType< TargetEndianness, true > >
 
struct  Elf_Sym_Base
 
struct  Elf_Sym_Base< ELFType< TargetEndianness, false > >
 
struct  Elf_Sym_Base< ELFType< TargetEndianness, true > >
 
struct  Elf_Dyn_Base
 Elf_Dyn_Base: This structure matches the form of entries in the dynamic table section (.dynamic) look like. More...
 
struct  Elf_Dyn_Base< ELFType< TargetEndianness, false > >
 
struct  Elf_Dyn_Base< ELFType< TargetEndianness, true > >
 
struct  Elf_Rel_Impl< ELFType< TargetEndianness, false >, false >
 
struct  Elf_Rel_Impl< ELFType< TargetEndianness, false >, true >
 
struct  Elf_Rel_Impl< ELFType< TargetEndianness, true >, false >
 
struct  Elf_Rel_Impl< ELFType< TargetEndianness, true >, true >
 
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, false > >
 
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, true > >
 
struct  Elf_Chdr_Impl< ELFType< TargetEndianness, false > >
 
struct  Elf_Chdr_Impl< ELFType< TargetEndianness, true > >
 
struct  Elf_Mips_RegInfo
 
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, false > >
 
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, true > >
 
struct  Elf_Mips_Options
 
struct  Elf_Mips_ABIFlags
 
class  BinaryError
 Base class for all errors indicating malformed binary files. More...
 
class  GenericBinaryError
 Generic binary error. More...
 
class  IRObjectFile
 
class  DiceRef
 DiceRef - This is a value type class that represents a single data in code entry in the table in a Mach-O object file. More...
 
class  ExportEntry
 ExportEntry encapsulates the current-state-of-the-walk used when doing a non-recursive walk of the trie data structure. More...
 
class  MachORebaseEntry
 MachORebaseEntry encapsulates the current state in the decompression of rebasing opcodes. More...
 
class  MachOBindEntry
 MachOBindEntry encapsulates the current state in the decompression of binding opcodes. More...
 
class  MachOObjectFile
 
class  MachOUniversalBinary
 
class  ModuleSummaryIndexObjectFile
 This class is used to read just the module summary index related sections out of the given object (which may contain a single module's bitcode or be a combined index bitcode file). More...
 
class  RelocationRef
 This is a value type class that represents a single relocation in the list of relocations in the object file. More...
 
class  SectionRef
 This is a value type class that represents a single section in the list of sections in the object file. More...
 
class  SymbolRef
 This is a value type class that represents a single symbol in the list of symbols in the object file. More...
 
class  symbol_iterator
 
class  ObjectFile
 This class is the base class for all object file types. More...
 
struct  RelocToApply
 
class  RelocVisitor
 Base class for object file relocation visitors. More...
 
union  DataRefImpl
 
class  content_iterator
 
class  BasicSymbolRef
 This is a value type class that represents a single symbol in the list of symbols in the object file. More...
 
class  SymbolicFile
 
struct  SymEntry
 
class  WasmObjectFile
 

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 coff_tls_directory
< support::little32_t
coff_tls_directory32
 
typedef coff_tls_directory
< support::little64_t
coff_tls_directory64
 
typedef ELFFile< ELFType
< support::little, false > > 
ELF32LEFile
 
typedef ELFFile< ELFType
< support::little, true > > 
ELF64LEFile
 
typedef ELFFile< ELFType
< support::big, false > > 
ELF32BEFile
 
typedef ELFFile< ELFType
< support::big, true > > 
ELF64BEFile
 
typedef ELFObjectFile< ELFType
< support::little, false > > 
ELF32LEObjectFile
 
typedef ELFObjectFile< ELFType
< support::little, true > > 
ELF64LEObjectFile
 
typedef ELFObjectFile< ELFType
< support::big, false > > 
ELF32BEObjectFile
 
typedef ELFObjectFile< ELFType
< support::big, true > > 
ELF64BEObjectFile
 
typedef ELFType
< support::little, false
ELF32LE
 
typedef ELFType< support::big,
false
ELF32BE
 
typedef ELFType
< support::little, true
ELF64LE
 
typedef ELFType< support::big,
true
ELF64BE
 
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
< SectionRef
section_iterator
 
typedef content_iterator
< RelocationRef
relocation_iterator
 
typedef content_iterator
< BasicSymbolRef
basic_symbol_iterator
 

Enumerations

enum  object_error {
  object_error::arch_not_found = 1, object_error::invalid_file_type, object_error::parse_failed, object_error::unexpected_eof,
  object_error::string_table_non_null_end, object_error::invalid_section_index, object_error::bitcode_section_not_found, object_error::invalid_symbol_index
}
 

Functions

Expected< std::unique_ptr
< Binary > > 
createBinary (MemoryBufferRef Source, LLVMContext *Context=nullptr)
 Create a Binary from Source, autodetecting the file type. More...
 
Expected< OwningBinary< Binary > > createBinary (StringRef Path)
 
StringRef getELFRelocationTypeName (uint32_t Machine, uint32_t Type)
 
std::pair< unsigned char,
unsigned char > 
getElfArchType (StringRef Object)
 
static Error createError (StringRef Err)
 
template<class ELFT >
Expected< const typename
ELFT::Shdr * > 
getSection (typename ELFT::ShdrRange Sections, uint32_t Index)
 
template<class ELFT >
Expected< uint32_tgetExtendedSymbolTableIndex (const typename ELFT::Sym *Sym, const typename ELFT::Sym *FirstSym, ArrayRef< typename ELFT::Word > ShndxTable)
 
template<class ELFT >
Expected< const typename
ELFT::Sym * > 
getSymbol (typename ELFT::SymRange Symbols, uint32_t Index)
 
template<class ELFT >
static bool compareAddr (uint64_t VAddr, const Elf_Phdr_Impl< ELFT > *Phdr)
 
unsigned hashSysV (StringRef SymbolName)
 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. More...
 
const std::error_categoryobject_category ()
 
std::error_code make_error_code (object_error e)
 
Error isNotObjectErrorInvalidFileType (llvm::Error Err)
 isNotObjectErrorInvalidFileType() is used when looping through the children of an archive after calling getAsBinary() on the child and it returns an llvm::Error. More...
 
template<typename OStream >
OStream & operator<< (OStream &OS, const DataRefImpl &D)
 
bool operator== (const DataRefImpl &a, const DataRefImpl &b)
 
bool operator!= (const DataRefImpl &a, const DataRefImpl &b)
 
bool operator< (const DataRefImpl &a, const DataRefImpl &b)
 
int compareAddress (const SymEntry *A, const SymEntry *B)
 
std::vector< std::pair
< SymbolRef, uint64_t > > 
computeSymbolSizes (const ObjectFile &O)
 

Typedef Documentation

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

Definition at line 126 of file SymbolicFile.h.

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

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

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

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

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

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

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

Definition at line 81 of file ELFTypes.h.

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

Definition at line 374 of file ELFObjectFile.h.

Definition at line 80 of file ELFTypes.h.

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

Definition at line 372 of file ELFObjectFile.h.

Definition at line 83 of file ELFTypes.h.

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

Definition at line 375 of file ELFObjectFile.h.

Definition at line 82 of file ELFTypes.h.

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

Definition at line 373 of file ELFObjectFile.h.

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

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

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

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

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

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

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

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

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

Definition at line 66 of file ObjectFile.h.

Definition at line 36 of file ObjectFile.h.

Enumeration Type Documentation

Enumerator
arch_not_found 
invalid_file_type 
parse_failed 
unexpected_eof 
string_table_non_null_end 
invalid_section_index 
bitcode_section_not_found 
invalid_symbol_index 

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

Function Documentation

template<class ELFT >
static bool llvm::object::compareAddr ( uint64_t  VAddr,
const Elf_Phdr_Impl< ELFT > *  Phdr 
)
static

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

int llvm::object::compareAddress ( const SymEntry A,
const SymEntry B 
)
std::vector< std::pair< SymbolRef, uint64_t > > llvm::object::computeSymbolSizes ( const ObjectFile O)
Expected< 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_cl_gl_object, 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::errorCodeToError(), 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_kext_bundle, 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, llvm::sys::fs::file_magic::wasm_object, and llvm::sys::fs::file_magic::windows_resource.

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

Expected< OwningBinary< Binary > > llvm::object::createBinary ( StringRef  Path)
static Error llvm::object::createError ( StringRef  Err)
inlinestatic
std::pair<unsigned char, unsigned char> llvm::object::getElfArchType ( StringRef  Object)
inline
StringRef llvm::object::getELFRelocationTypeName ( uint32_t  Machine,
uint32_t  Type 
)
template<class ELFT >
Expected<uint32_t> llvm::object::getExtendedSymbolTableIndex ( const typename ELFT::Sym *  Sym,
const typename ELFT::Sym *  FirstSym,
ArrayRef< typename ELFT::Word >  ShndxTable 
)
inline
template<class ELFT >
Expected<const typename ELFT::Shdr *> llvm::object::getSection ( typename ELFT::ShdrRange  Sections,
uint32_t  Index 
)
inline
template<class ELFT >
Expected<const typename ELFT::Sym *> llvm::object::getSymbol ( typename ELFT::SymRange  Symbols,
uint32_t  Index 
)
inline
unsigned llvm::object::hashSysV ( StringRef  SymbolName)
inline

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

References C, and L.

llvm::Error llvm::object::isNotObjectErrorInvalidFileType ( llvm::Error  Err)

isNotObjectErrorInvalidFileType() is used when looping through the children of an archive after calling getAsBinary() on the child and it returns an llvm::Error.

In the cases we want to loop through the children and ignore the non-objects in the archive this is used to test the error to see if an error() function needs to called on the llvm::Error.

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

References llvm::lltok::Error, llvm::handleErrors(), invalid_file_type, and llvm::Error::success().

std::error_code llvm::object::make_error_code ( object_error  e)
inline
const std::error_category & llvm::object::object_category ( )

Definition at line 76 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 46 of file SymbolicFile.h.

References operator==().

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

Definition at line 50 of file SymbolicFile.h.

template<typename OStream >
OStream& llvm::object::operator<< ( OStream &  OS,
const DataRefImpl &  D 
)
bool llvm::object::operator== ( const DataRefImpl &  a,
const DataRefImpl &  b 
)
inline

Definition at line 40 of file SymbolicFile.h.

Referenced by operator!=().