LLVM  mainline
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_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  ELFFile
class  ELFObjectFileBase
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 and setters. More...
struct  Elf_Rel_Base< ELFType< TargetEndianness, false >, false >
struct  Elf_Rel_Base< ELFType< TargetEndianness, true >, false >
struct  Elf_Rel_Base< ELFType< TargetEndianness, false >, true >
struct  Elf_Rel_Base< ELFType< TargetEndianness, true >, true >
struct  Elf_Rel_Impl< ELFType< TargetEndianness, true >, isRela >
struct  Elf_Rel_Impl< ELFType< TargetEndianness, false >, isRela >
struct  Elf_Ehdr_Impl
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, false > >
struct  Elf_Phdr_Impl< ELFType< TargetEndianness, true > >
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, false > >
struct  Elf_Mips_RegInfo< ELFType< TargetEndianness, true > >
struct  Elf_Mips_Options
struct  Elf_Mips_ABIFlags
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 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,
  bitcode_section_not_found, 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)
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.
std::pair< symbol_iterator,
symbol_iterator
getELFDynamicSymbolIterators (const SymbolicFile *Obj)
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)
ErrorOr< std::vector
< std::pair< SymbolRef,
uint64_t > > > 
computeSymbolSizes (const ObjectFile &O)

Variables

const uint64_t UnknownAddressOrSize = ~0ULL

Typedef Documentation

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

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

Definition at line 243 of file ELFObjectFile.h.

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

Definition at line 241 of file ELFObjectFile.h.

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

Definition at line 244 of file ELFObjectFile.h.

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

Definition at line 242 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 72 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 
bitcode_section_not_found 
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

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

References llvm::StringRef::size().

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

Definition at line 847 of file ELFObjectFile.h.

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 36 of file Object/Error.h.

References object_category().

Definition at line 59 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.

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

Definition at line 32 of file SymbolicFile.h.

Referenced by operator!=().


Variable Documentation