LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ObjectFileELF Class Reference

#include <ObjectFileELF.h>

Inheritance diagram for ObjectFileELF:
Inheritance graph
[legend]
Collaboration diagram for ObjectFileELF:
Collaboration graph
[legend]

Classes

struct  ELFSectionHeaderInfo
 

Public Member Functions

llvm::StringRef GetPluginName () override
 
bool isA (const void *ClassID) const override
 
bool ParseHeader () override
 Attempts to parse the object header. More...
 
bool SetLoadAddress (lldb_private::Target &target, lldb::addr_t value, bool value_is_offset) override
 Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the implementation. More...
 
lldb::ByteOrder GetByteOrder () const override
 Gets whether endian swapping should occur when extracting data from this object file. More...
 
bool IsExecutable () const override
 Tells whether this object file is capable of being the main executable for a process. More...
 
uint32_t GetAddressByteSize () const override
 Gets the address size in bytes for the current object file. More...
 
lldb_private::AddressClass GetAddressClass (lldb::addr_t file_addr) override
 Get the address type given a file address in an object file. More...
 
lldb_private::SymtabGetSymtab () override
 Gets the symbol table for the currently selected architecture (and object for archives). More...
 
bool IsStripped () override
 Detect if this object file has been stripped of local symbols. More...
 
void CreateSections (lldb_private::SectionList &unified_section_list) override
 
void Dump (lldb_private::Stream *s) override
 Dump a description of this object to a Stream. More...
 
lldb_private::ArchSpec GetArchitecture () override
 Get the ArchSpec for this object file. More...
 
lldb_private::UUID GetUUID () override
 Gets the UUID for this object file. More...
 
llvm::Optional< lldb_private::FileSpecGetDebugLink ()
 Return the contents of the .gnu_debuglink section, if the object file contains it. More...
 
uint32_t GetDependentModules (lldb_private::FileSpecList &files) override
 
lldb_private::Address GetImageInfoAddress (lldb_private::Target *target) override
 Similar to Process::GetImageInfoAddress(). More...
 
lldb_private::Address GetEntryPointAddress () override
 Returns the address of the Entry Point in this object file - if the object file doesn't have an entry point (because it is not an executable file) then an invalid address is returned. More...
 
lldb_private::Address GetBaseAddress () override
 Returns base address of this object file. More...
 
ObjectFile::Type CalculateType () override
 The object file should be able to calculate its type by looking at its file header and possibly the sections or other data in the object file. More...
 
ObjectFile::Strata CalculateStrata () override
 The object file should be able to calculate the strata of the object file. More...
 
size_t ReadSectionData (lldb_private::Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len) override
 
size_t ReadSectionData (lldb_private::Section *section, lldb_private::DataExtractor &section_data) override
 
llvm::ArrayRef< elf::ELFProgramHeaderProgramHeaders ()
 
lldb_private::DataExtractor GetSegmentData (const elf::ELFProgramHeader &H)
 
llvm::StringRef StripLinkerSymbolAnnotations (llvm::StringRef symbol_name) const override
 
void RelocateSection (lldb_private::Section *section) override
 Perform relocations on the section if necessary. More...
 
- Public Member Functions inherited from lldb_private::ObjectFile
 ObjectFile (const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, const lldb::DataBufferSP &data_sp, lldb::offset_t data_offset)
 Construct with a parent module, offset, and header data. More...
 
 ObjectFile (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP &data_sp)
 
 ~ObjectFile () override
 Destructor. More...
 
virtual uint32_t GetDependentModules (FileSpecList &file_list)=0
 Extract the dependent modules from an object file. More...
 
virtual lldb::addr_t GetFileOffset () const
 Returns the offset into a file at which this object resides. More...
 
virtual lldb::addr_t GetByteSize () const
 
virtual FileSpecGetFileSpec ()
 Get accessor to the object file specification. More...
 
virtual const FileSpecGetFileSpec () const
 Get const accessor to the object file specification. More...
 
virtual SectionListGetSectionList (bool update_module_section_list=true)
 Gets the section list for the currently selected architecture (and object for archives). More...
 
virtual void SectionFileAddressesChanged ()
 Notify the ObjectFile that the file addresses in the Sections for this module have been changed. More...
 
virtual SymbolResolveSymbolForAddress (const Address &so_addr, bool verify_unique)
 Appends a Symbol for the specified so_addr to the symbol table. More...
 
virtual void ClearSymtab ()
 Frees the symbol table. More...
 
virtual lldb_private::FileSpecList GetReExportedLibraries ()
 Gets the file spec list of libraries re-exported by this object file. More...
 
virtual bool AllowAssemblyEmulationUnwindPlans ()
 Returns if the function bounds for symbols in this symbol file are likely accurate. More...
 
virtual uint32_t GetNumThreadContexts ()
 
virtual std::string GetIdentifierString ()
 Some object files may have an identifier string embedded in them, e.g. More...
 
virtual lldb::addr_t GetAddressMask ()
 Some object files may have the number of bits used for addressing embedded in them, e.g. More...
 
virtual bool GetCorefileMainBinaryInfo (lldb::addr_t &address, UUID &uuid, ObjectFile::BinaryType &type)
 When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file. More...
 
virtual lldb::RegisterContextSP GetThreadContextAtIndex (uint32_t idx, lldb_private::Thread &thread)
 
virtual void SetType (Type type)
 In cases where the type can't be calculated (elf files), this routine allows someone to explicitly set it. More...
 
virtual llvm::VersionTuple GetVersion ()
 Get the object file version numbers. More...
 
virtual llvm::VersionTuple GetMinimumOSVersion ()
 Get the minimum OS version this object file can run on. More...
 
virtual llvm::VersionTuple GetSDKVersion ()
 Get the SDK OS version this object file was built with. More...
 
virtual bool GetIsDynamicLinkEditor ()
 Return true if this file is a dynamic link editor (dyld) More...
 
Type GetType ()
 
Strata GetStrata ()
 
size_t GetData (lldb::offset_t offset, size_t length, DataExtractor &data) const
 
size_t CopyData (lldb::offset_t offset, size_t length, void *dst) const
 
bool IsInMemory () const
 
virtual std::unique_ptr< CallFrameInfoCreateCallFrameInfo ()
 Creates a plugin-specific call frame info. More...
 
virtual bool LoadCoreFileImages (lldb_private::Process &process)
 Load binaries listed in a corefile. More...
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module. More...
 
 ~ModuleChild ()
 Destructor. More...
 
const ModuleChildoperator= (const ModuleChild &rhs)
 Assignment operator. More...
 
lldb::ModuleSP GetModule () const
 Get const accessor for the module pointer. More...
 
void SetModule (const lldb::ModuleSP &module_sp)
 Set accessor for the module pointer. More...
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static lldb_private::ConstString GetPluginNameStatic ()
 
static const char * GetPluginDescriptionStatic ()
 
static lldb_private::ObjectFileCreateInstance (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length)
 
static lldb_private::ObjectFileCreateMemoryInstance (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
 
static size_t GetModuleSpecifications (const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs)
 
static bool MagicBytesMatch (lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length)
 
static bool classof (const ObjectFile *obj)
 
- Static Public Member Functions inherited from lldb_private::ObjectFile
static lldb::ObjectFileSP FindPlugin (const lldb::ModuleSP &module_sp, const FileSpec *file_spec, lldb::offset_t file_offset, lldb::offset_t file_size, lldb::DataBufferSP &data_sp, lldb::offset_t &data_offset)
 Find a ObjectFile plug-in that can parse file_spec. More...
 
static lldb::ObjectFileSP FindPlugin (const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, lldb::DataBufferSP &file_data_sp)
 Find a ObjectFile plug-in that can parse a file in memory. More...
 
static size_t GetModuleSpecifications (const FileSpec &file, lldb::offset_t file_offset, lldb::offset_t file_size, ModuleSpecList &specs, lldb::DataBufferSP data_sp=lldb::DataBufferSP())
 
static size_t GetModuleSpecifications (const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t file_size, lldb_private::ModuleSpecList &specs)
 
static bool SplitArchivePathWithObject (llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist)
 Split a path into a file path with object name. More...
 
static lldb::DataBufferSP ReadMemory (const lldb::ProcessSP &process_sp, lldb::addr_t addr, size_t byte_size)
 
static lldb::SymbolType GetSymbolTypeFromName (llvm::StringRef name, lldb::SymbolType symbol_type_hint=lldb::eSymbolTypeUndefined)
 

Static Public Attributes

static char ID
 
- Static Public Attributes inherited from lldb_private::ObjectFile
static char ID
 

Protected Member Functions

std::vector< LoadableDataGetLoadableData (lldb_private::Target &target) override
 Loads this objfile to memory. More...
 
- Protected Member Functions inherited from lldb_private::ObjectFile
bool SetModulesArchitecture (const ArchSpec &new_arch)
 Sets the architecture for a module. More...
 

Private Types

typedef std::vector< elf::ELFProgramHeaderProgramHeaderColl
 
typedef std::vector< ELFSectionHeaderInfoSectionHeaderColl
 
typedef SectionHeaderColl::iterator SectionHeaderCollIter
 
typedef SectionHeaderColl::const_iterator SectionHeaderCollConstIter
 
typedef std::vector< elf::ELFDynamicDynamicSymbolColl
 
typedef DynamicSymbolColl::iterator DynamicSymbolCollIter
 
typedef DynamicSymbolColl::const_iterator DynamicSymbolCollConstIter
 
typedef std::map< lldb::addr_t, lldb_private::AddressClassFileAddressToAddressClassMap
 

Private Member Functions

 ObjectFileELF (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
 
 ObjectFileELF (const lldb::ModuleSP &module_sp, lldb::DataBufferSP &header_data_sp, const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
 
size_t SectionIndex (const SectionHeaderCollIter &I)
 Returns the index of the given section header. More...
 
size_t SectionIndex (const SectionHeaderCollConstIter &I) const
 Returns the index of the given section header. More...
 
bool ParseProgramHeaders ()
 Parses all section headers present in this object file and populates m_program_headers. More...
 
size_t ParseSectionHeaders ()
 Parses all section headers present in this object file and populates m_section_headers. More...
 
lldb::SectionType GetSectionType (const ELFSectionHeaderInfo &H) const
 
size_t ParseDependentModules ()
 Scans the dynamic section and locates all dependent modules (shared libraries) populating m_filespec_up. More...
 
size_t ParseDynamicSymbols ()
 Parses the dynamic symbol table and populates m_dynamic_symbols. More...
 
unsigned ParseSymbolTable (lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, lldb_private::Section *symtab)
 Populates m_symtab_up will all non-dynamic linker symbols. More...
 
unsigned ParseSymbols (lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, lldb_private::SectionList *section_list, const size_t num_symbols, const lldb_private::DataExtractor &symtab_data, const lldb_private::DataExtractor &strtab_data)
 Helper routine for ParseSymbolTable(). More...
 
unsigned ParseTrampolineSymbols (lldb_private::Symtab *symbol_table, lldb::user_id_t start_id, const ELFSectionHeaderInfo *rela_hdr, lldb::user_id_t section_id)
 Scans the relocation entries and adds a set of artificial symbols to the given symbol table for each PLT slot. More...
 
void ParseUnwindSymbols (lldb_private::Symtab *symbol_table, lldb_private::DWARFCallFrameInfo *eh_frame)
 
unsigned RelocateDebugSections (const elf::ELFSectionHeader *rel_hdr, lldb::user_id_t rel_id, lldb_private::Symtab *thetab)
 Relocates debug sections. More...
 
unsigned ApplyRelocations (lldb_private::Symtab *symtab, const elf::ELFHeader *hdr, const elf::ELFSectionHeader *rel_hdr, const elf::ELFSectionHeader *symtab_hdr, const elf::ELFSectionHeader *debug_hdr, lldb_private::DataExtractor &rel_data, lldb_private::DataExtractor &symtab_data, lldb_private::DataExtractor &debug_data, lldb_private::Section *rel_section)
 
size_t GetSectionHeaderStringTable ()
 Loads the section name string table into m_shstr_data. More...
 
lldb::user_id_t GetSectionIndexByName (const char *name)
 Utility method for looking up a section given its name. More...
 
const ELFSectionHeaderInfoGetSectionHeaderByIndex (lldb::user_id_t id)
 Returns the section header with the given id or NULL. More...
 

Static Private Member Functions

static size_t GetProgramHeaderInfo (ProgramHeaderColl &program_headers, lldb_private::DataExtractor &object_data, const elf::ELFHeader &header)
 
static uint32_t CalculateELFNotesSegmentsCRC32 (const ProgramHeaderColl &program_headers, lldb_private::DataExtractor &data)
 
static void ParseARMAttributes (lldb_private::DataExtractor &data, uint64_t length, lldb_private::ArchSpec &arch_spec)
 
static size_t GetSectionHeaderInfo (SectionHeaderColl &section_headers, lldb_private::DataExtractor &object_data, const elf::ELFHeader &header, lldb_private::UUID &uuid, std::string &gnu_debuglink_file, uint32_t &gnu_debuglink_crc, lldb_private::ArchSpec &arch_spec)
 Parses the elf section headers and returns the uuid, debug link name, crc, archspec. More...
 
ELF header dump routines
static void DumpELFHeader (lldb_private::Stream *s, const elf::ELFHeader &header)
 
static void DumpELFHeader_e_ident_EI_DATA (lldb_private::Stream *s, unsigned char ei_data)
 
static void DumpELFHeader_e_type (lldb_private::Stream *s, elf::elf_half e_type)
 

Private Attributes

elf::ELFHeader m_header
 ELF file header. More...
 
lldb_private::UUID m_uuid
 ELF build ID. More...
 
std::string m_gnu_debuglink_file
 ELF .gnu_debuglink file and crc data if available. More...
 
uint32_t m_gnu_debuglink_crc = 0
 
ProgramHeaderColl m_program_headers
 Collection of program headers. More...
 
SectionHeaderColl m_section_headers
 Collection of section headers. More...
 
DynamicSymbolColl m_dynamic_symbols
 Collection of symbols from the dynamic table. More...
 
std::shared_ptr< ObjectFileELFm_gnu_debug_data_object_file
 Object file parsed from .gnu_debugdata section (. More...
 
std::unique_ptr< lldb_private::FileSpecList > m_filespec_up
 List of file specifications corresponding to the modules (shared libraries) on which this object file depends. More...
 
lldb_private::Address m_entry_point_address
 Cached value of the entry point for this module. More...
 
lldb_private::ArchSpec m_arch_spec
 The architecture detected from parsing elf file contents. More...
 
FileAddressToAddressClassMap m_address_class_map
 The address class for each symbol in the elf file. More...
 

Static Private Attributes

static const uint32_t m_plugin_version = 1
 Version of this reader common to all plugins based on this class. More...
 
static const uint32_t g_core_uuid_magic
 

ELF program header dump routines

void DumpELFProgramHeaders (lldb_private::Stream *s)
 
static void DumpELFProgramHeader (lldb_private::Stream *s, const elf::ELFProgramHeader &ph)
 
static void DumpELFProgramHeader_p_type (lldb_private::Stream *s, elf::elf_word p_type)
 
static void DumpELFProgramHeader_p_flags (lldb_private::Stream *s, elf::elf_word p_flags)
 

ELF section header dump routines

void DumpELFSectionHeaders (lldb_private::Stream *s)
 
void DumpDependentModules (lldb_private::Stream *s)
 ELF dependent module dump routine. More...
 
const elf::ELFDynamicFindDynamicSymbol (unsigned tag)
 
unsigned PLTRelocationType ()
 
bool AnySegmentHasPhysicalAddress ()
 
std::shared_ptr< ObjectFileELFGetGnuDebugDataObjectFile ()
 Takes the .gnu_debugdata and returns the decompressed object file that is stored within that section. More...
 
static void DumpELFSectionHeader (lldb_private::Stream *s, const ELFSectionHeaderInfo &sh)
 
static void DumpELFSectionHeader_sh_type (lldb_private::Stream *s, elf::elf_word sh_type)
 
static void DumpELFSectionHeader_sh_flags (lldb_private::Stream *s, elf::elf_xword sh_flags)
 
static lldb_private::Status RefineModuleDetailsFromNote (lldb_private::DataExtractor &data, lldb_private::ArchSpec &arch_spec, lldb_private::UUID &uuid)
 

Additional Inherited Members

- Public Types inherited from lldb_private::ObjectFile
enum  Type {
  eTypeInvalid = 0, eTypeCoreFile, eTypeExecutable, eTypeDebugInfo,
  eTypeDynamicLinker, eTypeObjectFile, eTypeSharedLibrary, eTypeStubLibrary,
  eTypeJIT, eTypeUnknown
}
 
enum  Strata {
  eStrataInvalid = 0, eStrataUnknown, eStrataUser, eStrataKernel,
  eStrataRawImage, eStrataJIT
}
 
enum  BinaryType {
  eBinaryTypeInvalid = 0, eBinaryTypeUnknown, eBinaryTypeKernel, eBinaryTypeUser,
  eBinaryTypeStandalone
}
 If we have a corefile binary hint, this enum specifies the binary type which we can use to select the correct DynamicLoader plugin. More...
 
- Static Protected Member Functions inherited from lldb_private::ObjectFile
static lldb::DataBufferSP MapFileData (const FileSpec &file, uint64_t Size, uint64_t Offset)
 
- Protected Attributes inherited from lldb_private::ObjectFile
FileSpec m_file
 
Type m_type
 
Strata m_strata
 
lldb::addr_t m_file_offset
 The offset in bytes into the file, or the address in memory. More...
 
lldb::addr_t m_length
 The length of this object file if it is known (can be zero if length is unknown or can't be determined). More...
 
DataExtractor m_data
 The data for this object file so things can be parsed lazily. More...
 
lldb::ProcessWP m_process_wp
 
const lldb::addr_t m_memory_addr
 
std::unique_ptr< lldb_private::SectionListm_sections_up
 
std::unique_ptr< lldb_private::Symtabm_symtab_up
 
uint32_t m_synthetic_symbol_idx
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class. More...
 

Detailed Description

Generic ELF object file reader.

This class provides a generic ELF (32/64 bit) reader plugin implementing the ObjectFile protocol.

Definition at line 57 of file ObjectFileELF.h.

Member Typedef Documentation

◆ DynamicSymbolColl

typedef std::vector<elf::ELFDynamic> ObjectFileELF::DynamicSymbolColl
private

Definition at line 181 of file ObjectFileELF.h.

◆ DynamicSymbolCollConstIter

typedef DynamicSymbolColl::const_iterator ObjectFileELF::DynamicSymbolCollConstIter
private

Definition at line 183 of file ObjectFileELF.h.

◆ DynamicSymbolCollIter

typedef DynamicSymbolColl::iterator ObjectFileELF::DynamicSymbolCollIter
private

Definition at line 182 of file ObjectFileELF.h.

◆ FileAddressToAddressClassMap

Definition at line 186 of file ObjectFileELF.h.

◆ ProgramHeaderColl

Definition at line 171 of file ObjectFileELF.h.

◆ SectionHeaderColl

Definition at line 177 of file ObjectFileELF.h.

◆ SectionHeaderCollConstIter

typedef SectionHeaderColl::const_iterator ObjectFileELF::SectionHeaderCollConstIter
private

Definition at line 179 of file ObjectFileELF.h.

◆ SectionHeaderCollIter

typedef SectionHeaderColl::iterator ObjectFileELF::SectionHeaderCollIter
private

Definition at line 178 of file ObjectFileELF.h.

Constructor & Destructor Documentation

◆ ObjectFileELF() [1/2]

ObjectFileELF::ObjectFileELF ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
lldb::offset_t  data_offset,
const lldb_private::FileSpec file,
lldb::offset_t  offset,
lldb::offset_t  length 
)
private

◆ ObjectFileELF() [2/2]

ObjectFileELF::ObjectFileELF ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  header_data_sp,
const lldb::ProcessSP &  process_sp,
lldb::addr_t  header_addr 
)
private

Member Function Documentation

◆ AnySegmentHasPhysicalAddress()

bool ObjectFileELF::AnySegmentHasPhysicalAddress ( )
private

Definition at line 3393 of file ObjectFileELF.cpp.

References ProgramHeaders().

Referenced by GetLoadableData().

◆ ApplyRelocations()

unsigned ObjectFileELF::ApplyRelocations ( lldb_private::Symtab symtab,
const elf::ELFHeader hdr,
const elf::ELFSectionHeader rel_hdr,
const elf::ELFSectionHeader symtab_hdr,
const elf::ELFSectionHeader debug_hdr,
lldb_private::DataExtractor rel_data,
lldb_private::DataExtractor symtab_data,
lldb_private::DataExtractor debug_data,
lldb_private::Section rel_section 
)
private

◆ CalculateELFNotesSegmentsCRC32()

uint32_t ObjectFileELF::CalculateELFNotesSegmentsCRC32 ( const ProgramHeaderColl program_headers,
lldb_private::DataExtractor data 
)
staticprivate

Definition at line 424 of file ObjectFileELF.cpp.

References calc_crc32(), and lldb_private::DataExtractor::SetData().

Referenced by GetUUID().

◆ CalculateStrata()

ObjectFile::Strata ObjectFileELF::CalculateStrata ( )
overridevirtual

The object file should be able to calculate the strata of the object file.

Many object files for platforms might be for either user space debugging or for kernel debugging. If your object file subclass can figure this out, it will help with debugger plug-in selection when it comes time to debug.

Returns
The calculated object file strata for the current object file.

Implements lldb_private::ObjectFile.

Definition at line 3287 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_type, lldb_private::ObjectFile::eStrataUnknown, lldb_private::ObjectFile::eStrataUser, and m_header.

◆ CalculateType()

ObjectFile::Type ObjectFileELF::CalculateType ( )
overridevirtual

The object file should be able to calculate its type by looking at its file header and possibly the sections or other data in the object file.

The file type is used in the debugger to help select the correct plug- ins for the job at hand, so this is important to get right. If any eTypeXXX definitions do not match up with the type of file you are loading, please feel free to add a new enumeration value.

Returns
The calculated file type for the current object file.

Implements lldb_private::ObjectFile.

Definition at line 3259 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_type, lldb_private::ObjectFile::eTypeCoreFile, lldb_private::ObjectFile::eTypeExecutable, lldb_private::ObjectFile::eTypeObjectFile, lldb_private::ObjectFile::eTypeSharedLibrary, lldb_private::ObjectFile::eTypeUnknown, and m_header.

Referenced by GetArchitecture(), GetSymtab(), ParseSymbols(), and RelocateSection().

◆ classof()

static bool ObjectFileELF::classof ( const ObjectFile obj)
inlinestatic

Definition at line 97 of file ObjectFileELF.h.

References ID.

◆ CreateInstance()

ObjectFile * ObjectFileELF::CreateInstance ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
lldb::offset_t  data_offset,
const lldb_private::FileSpec file,
lldb::offset_t  file_offset,
lldb::offset_t  length 
)
static

Definition at line 346 of file ObjectFileELF.cpp.

◆ CreateMemoryInstance()

ObjectFile * ObjectFileELF::CreateMemoryInstance ( const lldb::ModuleSP &  module_sp,
lldb::DataBufferSP &  data_sp,
const lldb::ProcessSP &  process_sp,
lldb::addr_t  header_addr 
)
static

Definition at line 389 of file ObjectFileELF.cpp.

◆ CreateSections()

void ObjectFileELF::CreateSections ( lldb_private::SectionList unified_section_list)
overridevirtual

◆ Dump()

void ObjectFileELF::Dump ( lldb_private::Stream s)
overridevirtual

Dump a description of this object to a Stream.

Dump a description of the current contents of this object to the supplied stream s. The dumping should include the section list if it has been parsed, and the symbol table if it has been parsed.

Parameters
[in]sThe stream to which to dump the object description.

Implements lldb_private::ObjectFile.

Definition at line 2957 of file ObjectFileELF.cpp.

References lldb_private::Stream::AsRawOstream(), lldb_private::Symtab::Dump(), lldb_private::SectionList::Dump(), DumpDependentModules(), DumpELFHeader(), DumpELFProgramHeaders(), DumpELFSectionHeaders(), lldb_private::Stream::EOL(), lldb_private::eSortOrderNone, GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::Stream::GetIndentLevel(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::GetSectionList(), GetSymtab(), lldb_private::Stream::Indent(), lldb_private::ObjectFile::m_file, m_header, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and UINT32_MAX.

◆ DumpDependentModules()

void ObjectFileELF::DumpDependentModules ( lldb_private::Stream s)
private

◆ DumpELFHeader()

void ObjectFileELF::DumpELFHeader ( lldb_private::Stream s,
const elf::ELFHeader header 
)
staticprivate

◆ DumpELFHeader_e_ident_EI_DATA()

void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA ( lldb_private::Stream s,
unsigned char  ei_data 
)
staticprivate

Definition at line 3054 of file ObjectFileELF.cpp.

Referenced by DumpELFHeader().

◆ DumpELFHeader_e_type()

void ObjectFileELF::DumpELFHeader_e_type ( lldb_private::Stream s,
elf::elf_half  e_type 
)
staticprivate

Definition at line 3029 of file ObjectFileELF.cpp.

Referenced by DumpELFHeader().

◆ DumpELFProgramHeader()

void ObjectFileELF::DumpELFProgramHeader ( lldb_private::Stream s,
const elf::ELFProgramHeader ph 
)
staticprivate

◆ DumpELFProgramHeader_p_flags()

void ObjectFileELF::DumpELFProgramHeader_p_flags ( lldb_private::Stream s,
elf::elf_word  p_flags 
)
staticprivate

Definition at line 3111 of file ObjectFileELF.cpp.

Referenced by DumpELFProgramHeader().

◆ DumpELFProgramHeader_p_type()

void ObjectFileELF::DumpELFProgramHeader_p_type ( lldb_private::Stream s,
elf::elf_word  p_type 
)
staticprivate

Definition at line 3090 of file ObjectFileELF.cpp.

References CASE_AND_STREAM, and lldb_private::Stream::Printf().

Referenced by DumpELFProgramHeader().

◆ DumpELFProgramHeaders()

void ObjectFileELF::DumpELFProgramHeaders ( lldb_private::Stream s)
private

◆ DumpELFSectionHeader()

void ObjectFileELF::DumpELFSectionHeader ( lldb_private::Stream s,
const ELFSectionHeaderInfo sh 
)
staticprivate

◆ DumpELFSectionHeader_sh_flags()

void ObjectFileELF::DumpELFSectionHeader_sh_flags ( lldb_private::Stream s,
elf::elf_xword  sh_flags 
)
staticprivate

Definition at line 3186 of file ObjectFileELF.cpp.

Referenced by DumpELFSectionHeader().

◆ DumpELFSectionHeader_sh_type()

void ObjectFileELF::DumpELFSectionHeader_sh_type ( lldb_private::Stream s,
elf::elf_word  sh_type 
)
staticprivate

Definition at line 3158 of file ObjectFileELF.cpp.

References CASE_AND_STREAM, and lldb_private::Stream::Printf().

Referenced by DumpELFSectionHeader().

◆ DumpELFSectionHeaders()

void ObjectFileELF::DumpELFSectionHeaders ( lldb_private::Stream s)
private

◆ FindDynamicSymbol()

const ELFDynamic * ObjectFileELF::FindDynamicSymbol ( unsigned  tag)
private

Definition at line 2356 of file ObjectFileELF.cpp.

References elf::ELFDynamic::d_tag, m_dynamic_symbols, and ParseDynamicSymbols().

Referenced by GetSymtab(), and PLTRelocationType().

◆ GetAddressByteSize()

uint32_t ObjectFileELF::GetAddressByteSize ( ) const
overridevirtual

Gets the address size in bytes for the current object file.

Returns
The size of an address in bytes for the currently selected architecture (and object for archives). Returns zero if no architecture or object has been selected.

Implements lldb_private::ObjectFile.

Definition at line 711 of file ObjectFileELF.cpp.

References lldb_private::DataExtractor::GetAddressByteSize(), and lldb_private::ObjectFile::m_data.

Referenced by GetImageInfoAddress(), ReadSectionData(), and SetLoadAddress().

◆ GetAddressClass()

AddressClass ObjectFileELF::GetAddressClass ( lldb::addr_t  file_addr)
overridevirtual

Get the address type given a file address in an object file.

Many binary file formats know what kinds This is primarily for ARM binaries, though it can be applied to any executable file format that supports different opcode types within the same binary. ARM binaries support having both ARM and Thumb within the same executable container. We need to be able to get

Returns
The size of an address in bytes for the currently selected architecture (and object for archives). Returns zero if no architecture or object has been selected.

Reimplemented from lldb_private::ObjectFile.

Definition at line 715 of file ObjectFileELF.cpp.

References lldb_private::ObjectFile::GetAddressClass(), lldb_private::Symtab::GetObjectFile(), GetSymtab(), and m_address_class_map.

◆ GetArchitecture()

ArchSpec ObjectFileELF::GetArchitecture ( )
overridevirtual

Get the ArchSpec for this object file.

Returns
The ArchSpec of this object file. In case of error, an invalid ArchSpec object is returned.

Implements lldb_private::ObjectFile.

Definition at line 3233 of file ObjectFileELF.cpp.

References CalculateType(), lldb_private::ObjectFile::eTypeCoreFile, m_arch_spec, lldb_private::ObjectFile::m_data, m_section_headers, ParseHeader(), ParseSectionHeaders(), ProgramHeaders(), RefineModuleDetailsFromNote(), lldb_private::DataExtractor::SetData(), and lldb_private::ArchSpec::TripleOSWasSpecified().

Referenced by Dump(), GetSymtab(), and ParseSymbols().

◆ GetBaseAddress()

Address ObjectFileELF::GetBaseAddress ( )
overridevirtual

Returns base address of this object file.

This also sometimes referred to as the "preferred load address" or the "image base address". Addresses within object files are often expressed relative to this base. If this address corresponds to a specific section (usually the first byte of the first section) then the returned address will have this section set. Otherwise, the address will just have the offset member filled in, indicating that this represents a file address.

Reimplemented from lldb_private::ObjectFile.

Definition at line 895 of file ObjectFileELF.cpp.

References lldb_private::ObjectFile::GetSectionList(), LLDB_INVALID_ADDRESS, elf::ELFProgramHeader::p_type, ProgramHeaders(), and SegmentID().

Referenced by SetLoadAddress().

◆ GetByteOrder()

ByteOrder ObjectFileELF::GetByteOrder ( ) const
overridevirtual

Gets whether endian swapping should occur when extracting data from this object file.

Returns
Returns true if endian swapping is needed, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 703 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_ident, lldb::eByteOrderBig, lldb::eByteOrderInvalid, lldb::eByteOrderLittle, and m_header.

Referenced by ReadSectionData().

◆ GetDebugLink()

llvm::Optional< FileSpec > ObjectFileELF::GetDebugLink ( )

Return the contents of the .gnu_debuglink section, if the object file contains it.


Definition at line 794 of file ObjectFileELF.cpp.

References m_gnu_debuglink_file.

Referenced by SymbolVendorELF::CreateInstance().

◆ GetDependentModules()

uint32_t ObjectFileELF::GetDependentModules ( lldb_private::FileSpecList &  files)
override

Definition at line 800 of file ObjectFileELF.cpp.

References m_filespec_up, and ParseDependentModules().

◆ GetEntryPointAddress()

lldb_private::Address ObjectFileELF::GetEntryPointAddress ( )
overridevirtual

Returns the address of the Entry Point in this object file - if the object file doesn't have an entry point (because it is not an executable file) then an invalid address is returned.

Returns
Returns the entry address for this module.

Reimplemented from lldb_private::ObjectFile.

Definition at line 878 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_entry, lldb_private::ObjectFile::GetSectionList(), IsExecutable(), lldb_private::Address::IsValid(), m_entry_point_address, m_header, ParseHeader(), lldb_private::Address::ResolveAddressUsingFileSections(), and lldb_private::Address::SetOffset().

Referenced by GetSymtab().

◆ GetGnuDebugDataObjectFile()

std::shared_ptr< ObjectFileELF > ObjectFileELF::GetGnuDebugDataObjectFile ( )
private

Takes the .gnu_debugdata and returns the decompressed object file that is stored within that section.

Returns
either the decompressed object file stored within the .gnu_debugdata section or nullptr if an error occured or if there's no section with that name.

Definition at line 1879 of file ObjectFileELF.cpp.

References lldb_private::FileSpec::CopyByAppendingPathComponent(), lldb_private::SectionList::FindSectionByName(), lldb_private::DataExtractor::GetData(), lldb_private::ObjectFile::GetFileSpec(), lldb_private::ModuleChild::GetModule(), lldb_private::ObjectFile::GetSectionList(), lldb_private::lzma::isAvailable(), m_gnu_debug_data_object_file, ObjectFileELF(), lldb_private::toString(), and lldb_private::lzma::uncompress().

Referenced by CreateSections().

◆ GetImageInfoAddress()

Address ObjectFileELF::GetImageInfoAddress ( lldb_private::Target target)
overridevirtual

Similar to Process::GetImageInfoAddress().

Some platforms embed auxiliary structures useful to debuggers in the address space of the inferior process. This method returns the address of such a structure if the information can be resolved via entries in the object file. ELF, for example, provides a means to hook into the runtime linker so that a debugger may monitor the loading and unloading of shared libraries.

Returns
The address of any auxiliary tables, or an invalid address if this object file format does not support or contain such information.

Reimplemented from lldb_private::ObjectFile.

Definition at line 812 of file ObjectFileELF.cpp.

References elf::ELFDynamic::d_tag, error(), lldb::eSectionTypeELFDynamicLinkInfo, lldb_private::SectionList::FindSectionByType(), GetAddressByteSize(), GetSectionHeaderByIndex(), lldb_private::ObjectFile::GetSectionList(), LLDB_INVALID_ADDRESS, m_dynamic_symbols, ParseDynamicSymbols(), lldb_private::Target::ReadPointerFromMemory(), lldb_private::Target::ReadUnsignedIntegerFromMemory(), lldb_private::Address::SetOffset(), elf::ELFSectionHeader::sh_entsize, and UINT64_MAX.

◆ GetLoadableData()

std::vector< ObjectFile::LoadableData > ObjectFileELF::GetLoadableData ( lldb_private::Target target)
overrideprotectedvirtual

Loads this objfile to memory.

Loads the bits needed to create an executable image to the memory. It is useful with bare-metal targets where target does not have the ability to start a process itself.

Parameters
[in]targetTarget where to load.

Reimplemented from lldb_private::ObjectFile.

Definition at line 3402 of file ObjectFileELF.cpp.

References AnySegmentHasPhysicalAddress(), lldb_private::ObjectFile::LoadableData::Contents, lldb_private::ObjectFile::LoadableData::Dest, GetSegmentData(), LLDB_INVALID_ADDRESS, and ProgramHeaders().

◆ GetModuleSpecifications()

size_t ObjectFileELF::GetModuleSpecifications ( const lldb_private::FileSpec file,
lldb::DataBufferSP &  data_sp,
lldb::offset_t  data_offset,
lldb::offset_t  file_offset,
lldb::offset_t  length,
lldb_private::ModuleSpecList specs 
)
static

◆ GetPluginDescriptionStatic()

const char * ObjectFileELF::GetPluginDescriptionStatic ( )
static

Definition at line 342 of file ObjectFileELF.cpp.

◆ GetPluginName()

llvm::StringRef ObjectFileELF::GetPluginName ( )
inlineoverridevirtual

◆ GetPluginNameStatic()

lldb_private::ConstString ObjectFileELF::GetPluginNameStatic ( )
static

Definition at line 337 of file ObjectFileELF.cpp.

Referenced by GetPluginName().

◆ GetProgramHeaderInfo()

size_t ObjectFileELF::GetProgramHeaderInfo ( ProgramHeaderColl program_headers,
lldb_private::DataExtractor object_data,
const elf::ELFHeader header 
)
staticprivate

◆ GetSectionHeaderByIndex()

const ObjectFileELF::ELFSectionHeaderInfo * ObjectFileELF::GetSectionHeaderByIndex ( lldb::user_id_t  id)
private

Returns the section header with the given id or NULL.

Definition at line 1553 of file ObjectFileELF.cpp.

References m_section_headers, and ParseSectionHeaders().

Referenced by GetImageInfoAddress(), GetSymtab(), ParseDependentModules(), ParseSymbolTable(), ParseTrampolineSymbols(), and RelocateDebugSections().

◆ GetSectionHeaderInfo()

size_t ObjectFileELF::GetSectionHeaderInfo ( SectionHeaderColl section_headers,
lldb_private::DataExtractor object_data,
const elf::ELFHeader header,
lldb_private::UUID uuid,
std::string gnu_debuglink_file,
uint32_t gnu_debuglink_crc,
lldb_private::ArchSpec arch_spec 
)
staticprivate

Parses the elf section headers and returns the uuid, debug link name, crc, archspec.

Definition at line 1314 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_flags, elf::ELFHeader::e_ident, elf::ELFHeader::e_machine, elf::ELFHeader::e_shentsize, elf::ELFHeader::e_shnum, elf::ELFHeader::e_shoff, elf::ELFHeader::e_shstrndx, lldb_private::eArchTypeELF, lldb_private::ArchSpec::eMIPS_ABI_FP_64, lldb_private::ArchSpec::eMIPS_ABI_FP_64A, lldb_private::ArchSpec::eMIPS_ABI_FP_ANY, lldb_private::ArchSpec::eMIPS_ABI_FP_DOUBLE, lldb_private::ArchSpec::eMIPS_ABI_FP_OLD_64, lldb_private::ArchSpec::eMIPS_ABI_FP_SINGLE, lldb_private::ArchSpec::eMIPS_ABI_FP_SOFT, lldb_private::ArchSpec::eMIPS_ABI_FP_XX, lldb_private::ArchSpec::eMIPSABI_EABI32, lldb_private::ArchSpec::eMIPSABI_EABI64, lldb_private::ArchSpec::eMIPSABI_N32, lldb_private::ArchSpec::eMIPSABI_N64, lldb_private::ArchSpec::eMIPSABI_O32, lldb_private::ArchSpec::eMIPSABI_O64, error(), lldb_private::DataExtractor::GetCStr(), lldb_private::ArchSpec::GetFlags(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::ArchSpec::GetMachine(), GetOsFromOSABI(), lldb_private::ArchSpec::GetTriple(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU8(), lldb_private::ArchSpec::IsMIPS(), LIBLLDB_LOG_MODULES, LLDB_LOGF, ParseARMAttributes(), lldb_private::DataExtractor::PeekCStr(), RefineModuleDetailsFromNote(), lldb_private::ArchSpec::SetArchitecture(), lldb_private::DataExtractor::SetData(), lldb_private::ArchSpec::SetFlags(), elf::ELFSectionHeader::sh_offset, elf::ELFSectionHeader::sh_size, elf::ELFSectionHeader::sh_type, subTypeFromElfHeader(), and UNUSED_IF_ASSERT_DISABLED.

Referenced by ParseSectionHeaders().

◆ GetSectionHeaderStringTable()

size_t ObjectFileELF::GetSectionHeaderStringTable ( )
private

Loads the section name string table into m_shstr_data.

Returns the number of bytes constituting the table.

◆ GetSectionIndexByName()

lldb::user_id_t ObjectFileELF::GetSectionIndexByName ( const char *  name)
private

Utility method for looking up a section given its name.

Returns the index of the corresponding section or zero if no section with the given name can be found (note that section indices are always 1 based, and so section index 0 is never valid).

Definition at line 1563 of file ObjectFileELF.cpp.

References m_section_headers, and ParseSectionHeaders().

Referenced by ParseTrampolineSymbols().

◆ GetSectionType()

SectionType ObjectFileELF::GetSectionType ( const ELFSectionHeaderInfo H) const
private

◆ GetSegmentData()

DataExtractor ObjectFileELF::GetSegmentData ( const elf::ELFProgramHeader H)

◆ GetSymtab()

Symtab * ObjectFileELF::GetSymtab ( )
overridevirtual

◆ GetUUID()

UUID ObjectFileELF::GetUUID ( )
overridevirtual

Gets the UUID for this object file.

If the object file format contains a UUID, the value should be returned. Else ObjectFile instances should return the MD5 checksum of all of the bytes for the object file (or memory for memory based object files).

Returns
The object file's UUID. In case of an error, an empty UUID is returned.

Implements lldb_private::ObjectFile.

Definition at line 756 of file ObjectFileELF.cpp.

References calc_crc32(), CalculateELFNotesSegmentsCRC32(), g_core_uuid_magic, lldb_private::ObjectFile::GetType(), lldb_private::ObjectFile::m_data, m_gnu_debuglink_crc, m_program_headers, m_uuid, ParseProgramHeaders(), and ParseSectionHeaders().

Referenced by SymbolVendorELF::CreateInstance().

◆ Initialize()

void ObjectFileELF::Initialize ( )
static

Definition at line 327 of file ObjectFileELF.cpp.

◆ isA()

bool ObjectFileELF::isA ( const void *  ClassID) const
inlineoverridevirtual

Reimplemented from lldb_private::ObjectFile.

Definition at line 94 of file ObjectFileELF.h.

References ID.

◆ IsExecutable()

bool ObjectFileELF::IsExecutable ( ) const
overridevirtual

Tells whether this object file is capable of being the main executable for a process.

Returns
true if it is, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 653 of file ObjectFileELF.cpp.

References elf::ELFHeader::e_entry, elf::ELFHeader::e_type, and m_header.

Referenced by GetEntryPointAddress().

◆ IsStripped()

bool ObjectFileELF::IsStripped ( )
overridevirtual

Detect if this object file has been stripped of local symbols.

Detect if this object file has been stripped of local symbols.

Returns
Return true if the object file has been stripped of local symbols.

Implements lldb_private::ObjectFile.

Definition at line 2947 of file ObjectFileELF.cpp.

◆ MagicBytesMatch()

bool ObjectFileELF::MagicBytesMatch ( lldb::DataBufferSP &  data_sp,
lldb::addr_t  offset,
lldb::addr_t  length 
)
static

Definition at line 408 of file ObjectFileELF.cpp.

Referenced by GetModuleSpecifications().

◆ ParseARMAttributes()

void ObjectFileELF::ParseARMAttributes ( lldb_private::DataExtractor data,
uint64_t  length,
lldb_private::ArchSpec arch_spec 
)
staticprivate

◆ ParseDependentModules()

size_t ObjectFileELF::ParseDependentModules ( )
private

◆ ParseDynamicSymbols()

size_t ObjectFileELF::ParseDynamicSymbols ( )
private

Parses the dynamic symbol table and populates m_dynamic_symbols.

The vector retains the order as found in the object file. Returns the number of dynamic symbols parsed.

Definition at line 2323 of file ObjectFileELF.cpp.

References lldb::eSectionTypeELFDynamicLinkInfo, lldb_private::SectionList::FindSectionByType(), lldb_private::DataExtractor::GetByteSize(), lldb_private::Section::GetObjectFile(), lldb_private::ObjectFile::GetSectionList(), m_dynamic_symbols, elf::ELFDynamic::Parse(), and ReadSectionData().

Referenced by FindDynamicSymbol(), and GetImageInfoAddress().

◆ ParseHeader()

bool ObjectFileELF::ParseHeader ( )
overridevirtual

Attempts to parse the object header.

This function is used as a test to see if a given plug-in instance can parse the header data already contained in ObjectFile::m_data. If an object file parser does not recognize that magic bytes in a header, false should be returned and the next plug-in can attempt to parse an object file.

Returns
Returns true if the header was parsed successfully, false otherwise.

Implements lldb_private::ObjectFile.

Definition at line 751 of file ObjectFileELF.cpp.

References lldb_private::ObjectFile::m_data, m_header, and elf::ELFHeader::Parse().

Referenced by GetArchitecture(), and GetEntryPointAddress().

◆ ParseProgramHeaders()

bool ObjectFileELF::ParseProgramHeaders ( )
private

Parses all section headers present in this object file and populates m_program_headers.

This method will compute the header list only once. Returns true iff the headers have been successfully parsed.

Definition at line 1002 of file ObjectFileELF.cpp.

References GetProgramHeaderInfo(), lldb_private::ObjectFile::m_data, m_header, and m_program_headers.

Referenced by DumpELFProgramHeaders(), GetUUID(), and ProgramHeaders().

◆ ParseSectionHeaders()

size_t ObjectFileELF::ParseSectionHeaders ( )
private

Parses all section headers present in this object file and populates m_section_headers.

This method will compute the header list only once. Returns the number of headers parsed.

Definition at line 1546 of file ObjectFileELF.cpp.

References GetSectionHeaderInfo(), m_arch_spec, lldb_private::ObjectFile::m_data, m_gnu_debuglink_crc, m_gnu_debuglink_file, m_header, m_section_headers, and m_uuid.

Referenced by CreateSections(), DumpELFSectionHeaders(), GetArchitecture(), GetSectionHeaderByIndex(), GetSectionIndexByName(), GetUUID(), and ParseDependentModules().

◆ ParseSymbols()

unsigned ObjectFileELF::ParseSymbols ( lldb_private::Symtab symbol_table,
lldb::user_id_t  start_id,
lldb_private::SectionList section_list,
const size_t  num_symbols,
const lldb_private::DataExtractor symtab_data,
const lldb_private::DataExtractor strtab_data 
)
private

◆ ParseSymbolTable()

unsigned ObjectFileELF::ParseSymbolTable ( lldb_private::Symtab symbol_table,
lldb::user_id_t  start_id,
lldb_private::Section symtab 
)
private

◆ ParseTrampolineSymbols()

unsigned ObjectFileELF::ParseTrampolineSymbols ( lldb_private::Symtab symbol_table,
lldb::user_id_t  start_id,
const ELFSectionHeaderInfo rela_hdr,
lldb::user_id_t  section_id 
)
private

Scans the relocation entries and adds a set of artificial symbols to the given symbol table for each PLT slot.

Returns the number of symbols added.

Definition at line 2489 of file ObjectFileELF.cpp.

References lldb_private::SectionList::FindSectionByID(), GetSectionHeaderByIndex(), GetSectionIndexByName(), m_header, lldb_private::ObjectFile::m_sections_up, ParsePLTRelocations(), PLTRelocationType(), ReadSectionData(), elf::ELFSectionHeader::sh_link, and elf::ELFSectionHeader::sh_type.

Referenced by GetSymtab().

◆ ParseUnwindSymbols()

void ObjectFileELF::ParseUnwindSymbols ( lldb_private::Symtab symbol_table,
lldb_private::DWARFCallFrameInfo eh_frame 
)
private

◆ PLTRelocationType()

unsigned ObjectFileELF::PLTRelocationType ( )
private

Definition at line 2372 of file ObjectFileELF.cpp.

References elf::ELFDynamic::d_val, and FindDynamicSymbol().

Referenced by ParseTrampolineSymbols().

◆ ProgramHeaders()

llvm::ArrayRef< ELFProgramHeader > ObjectFileELF::ProgramHeaders ( )

◆ ReadSectionData() [1/2]

size_t ObjectFileELF::ReadSectionData ( lldb_private::Section section,
lldb::offset_t  section_offset,
void *  dst,
size_t  dst_len 
)
overridevirtual

◆ ReadSectionData() [2/2]

size_t ObjectFileELF::ReadSectionData ( lldb_private::Section section,
lldb_private::DataExtractor section_data 
)
overridevirtual

◆ RefineModuleDetailsFromNote()

lldb_private::Status ObjectFileELF::RefineModuleDetailsFromNote ( lldb_private::DataExtractor data,
lldb_private::ArchSpec arch_spec,
lldb_private::UUID uuid 
)
staticprivate

◆ RelocateDebugSections()

unsigned ObjectFileELF::RelocateDebugSections ( const elf::ELFSectionHeader rel_hdr,
lldb::user_id_t  rel_id,
lldb_private::Symtab thetab 
)
private

◆ RelocateSection()

void ObjectFileELF::RelocateSection ( lldb_private::Section section)
overridevirtual

◆ SectionIndex() [1/2]

size_t ObjectFileELF::SectionIndex ( const SectionHeaderCollConstIter I) const
private

Returns the index of the given section header.

Definition at line 747 of file ObjectFileELF.cpp.

References m_section_headers.

◆ SectionIndex() [2/2]

size_t ObjectFileELF::SectionIndex ( const SectionHeaderCollIter I)
private

Returns the index of the given section header.

Definition at line 743 of file ObjectFileELF.cpp.

References m_section_headers.

Referenced by CreateSections(), and RelocateSection().

◆ SetLoadAddress()

bool ObjectFileELF::SetLoadAddress ( lldb_private::Target target,
lldb::addr_t  value,
bool  value_is_offset 
)
overridevirtual

◆ StripLinkerSymbolAnnotations()

llvm::StringRef ObjectFileELF::StripLinkerSymbolAnnotations ( llvm::StringRef  symbol_name) const
overridevirtual

Reimplemented from lldb_private::ObjectFile.

Definition at line 1540 of file ObjectFileELF.cpp.

◆ Terminate()

void ObjectFileELF::Terminate ( )
static

Definition at line 333 of file ObjectFileELF.cpp.

Member Data Documentation

◆ g_core_uuid_magic

const uint32_t ObjectFileELF::g_core_uuid_magic
staticprivate

Definition at line 190 of file ObjectFileELF.h.

Referenced by GetUUID().

◆ ID

char ObjectFileELF::ID
static

Definition at line 93 of file ObjectFileELF.h.

Referenced by classof(), and isA().

◆ m_address_class_map

FileAddressToAddressClassMap ObjectFileELF::m_address_class_map
private

The address class for each symbol in the elf file.

Definition at line 226 of file ObjectFileELF.h.

Referenced by GetAddressClass(), GetSymtab(), and ParseSymbols().

◆ m_arch_spec

lldb_private::ArchSpec ObjectFileELF::m_arch_spec
private

The architecture detected from parsing elf file contents.

Definition at line 223 of file ObjectFileELF.h.

Referenced by CreateSections(), GetArchitecture(), and ParseSectionHeaders().

◆ m_dynamic_symbols

DynamicSymbolColl ObjectFileELF::m_dynamic_symbols
private

Collection of symbols from the dynamic table.

Definition at line 209 of file ObjectFileELF.h.

Referenced by FindDynamicSymbol(), GetImageInfoAddress(), and ParseDynamicSymbols().

◆ m_entry_point_address

lldb_private::Address ObjectFileELF::m_entry_point_address
private

Cached value of the entry point for this module.

Definition at line 220 of file ObjectFileELF.h.

Referenced by GetEntryPointAddress().

◆ m_filespec_up

std::unique_ptr<lldb_private::FileSpecList> ObjectFileELF::m_filespec_up
mutableprivate

List of file specifications corresponding to the modules (shared libraries) on which this object file depends.

Definition at line 217 of file ObjectFileELF.h.

Referenced by DumpDependentModules(), GetDependentModules(), and ParseDependentModules().

◆ m_gnu_debug_data_object_file

std::shared_ptr<ObjectFileELF> ObjectFileELF::m_gnu_debug_data_object_file
private

Object file parsed from .gnu_debugdata section (.

See also
GetGnuDebugDataObjectFile())

Definition at line 213 of file ObjectFileELF.h.

Referenced by GetGnuDebugDataObjectFile().

◆ m_gnu_debuglink_crc

uint32_t ObjectFileELF::m_gnu_debuglink_crc = 0
private

Definition at line 200 of file ObjectFileELF.h.

Referenced by GetUUID(), and ParseSectionHeaders().

◆ m_gnu_debuglink_file

std::string ObjectFileELF::m_gnu_debuglink_file
private

ELF .gnu_debuglink file and crc data if available.

Definition at line 199 of file ObjectFileELF.h.

Referenced by GetDebugLink(), and ParseSectionHeaders().

◆ m_header

elf::ELFHeader ObjectFileELF::m_header
private

◆ m_plugin_version

const uint32_t ObjectFileELF::m_plugin_version = 1
staticprivate

Version of this reader common to all plugins based on this class.

Definition at line 189 of file ObjectFileELF.h.

◆ m_program_headers

ProgramHeaderColl ObjectFileELF::m_program_headers
private

Collection of program headers.

Definition at line 203 of file ObjectFileELF.h.

Referenced by DumpELFProgramHeaders(), GetUUID(), ParseProgramHeaders(), and ProgramHeaders().

◆ m_section_headers

SectionHeaderColl ObjectFileELF::m_section_headers
private

◆ m_uuid

lldb_private::UUID ObjectFileELF::m_uuid
private

ELF build ID.

Definition at line 196 of file ObjectFileELF.h.

Referenced by GetUUID(), and ParseSectionHeaders().


The documentation for this class was generated from the following files: