LLVM  mainline
Classes | Typedefs | Enumerations | Functions
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
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_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
class  COFFImportFile
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  ELFType
struct  ELFDataTypeTypedefHelperCommon
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, false > >
 ELF 32bit types. More...
struct  ELFDataTypeTypedefHelper< ELFType< TargetEndianness, true > >
 ELF 64bit types. More...
struct  Elf_Shdr_Base< ELFType< TargetEndianness, false > >
struct  Elf_Shdr_Base< ELFType< TargetEndianness, true > >
struct  Elf_Shdr_Impl
struct  Elf_Sym_Base< ELFType< TargetEndianness, false > >
struct  Elf_Sym_Base< ELFType< TargetEndianness, true > >
struct  Elf_Sym_Impl
struct  Elf_Versym_Impl
 Elf_Versym: This is the structure of entries in the SHT_GNU_versym section (.gnu.version). More...
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_Dyn_Base< ELFType< TargetEndianness, false > >
struct  Elf_Dyn_Base< ELFType< TargetEndianness, true > >
struct  Elf_Dyn_Impl
 Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters. More...
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_Ehdr_Impl
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, false > >
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, true > >
struct  Elf_Hash_Impl
struct  Elf_GnuHash_Impl
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, false > >
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, true > >
struct  Elf_Mips_Options
struct  Elf_Mips_ABIFlags
class  FunctionIndexObjectFile
 This class is used to read just the function 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  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  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

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, 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 {
  arch_not_found = 1, invalid_file_type, parse_failed, unexpected_eof,
  string_table_non_null_end, invalid_section_index, bitcode_section_not_found, elf_invalid_dynamic_table_size,
  macho_small_load_command, macho_load_segment_too_many_sections, macho_load_segment_too_small
}

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)
template<class ELFT >
static bool compareAddr (uint64_t VAddr, const Elf_Phdr_Impl< ELFT > *Phdr)
static unsigned elf_hash (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.
const std::error_categoryobject_category ()
std::error_code make_error_code (object_error e)
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)
std::vector< std::pair
< SymbolRef, uint64_t > > 
computeSymbolSizes (const ObjectFile &O)

Typedef Documentation

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

Definition at line 124 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 30 of file ELFTypes.h.

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

Definition at line 348 of file ELFObjectFile.h.

Definition at line 29 of file ELFTypes.h.

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

Definition at line 346 of file ELFObjectFile.h.

Definition at line 32 of file ELFTypes.h.

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

Definition at line 349 of file ELFObjectFile.h.

Definition at line 31 of file ELFTypes.h.

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

Definition at line 347 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 65 of file ObjectFile.h.

Definition at line 35 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 
elf_invalid_dynamic_table_size 
macho_small_load_command 
macho_load_segment_too_many_sections 
macho_load_segment_too_small 

Definition at line 24 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 389 of file Object/ELF.h.

std::vector< std::pair< SymbolRef, uint64_t > > llvm::object::computeSymbolSizes ( const ObjectFile O)
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_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, and llvm::sys::fs::file_magic::windows_resource.

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

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

References llvm::StringRef::size().

std::pair<unsigned char, unsigned char> llvm::object::getElfArchType ( StringRef  Object) [inline]
StringRef llvm::object::getELFRelocationTypeName ( uint32_t  Machine,
uint32_t  Type 
)
std::error_code llvm::object::make_error_code ( object_error  e) [inline]

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

References object_category().

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

References operator==().

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

Definition at line 49 of file SymbolicFile.h.

References fuzzer::memcmp.

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 39 of file SymbolicFile.h.

References fuzzer::memcmp.

Referenced by operator!=().