LLDB  mainline
Macros | Functions
ObjectFileELF.cpp File Reference
#include "ObjectFileELF.h"
#include <algorithm>
#include <cassert>
#include <unordered_map>
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/LZMA.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h"
#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Object/Decompressor.h"
#include "llvm/Support/ARMBuildAttributes.h"
#include "llvm/Support/CRC.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/MipsABIFlags.h"
Include dependency graph for ObjectFileELF.cpp:

Go to the source code of this file.

Macros

#define CASE_AND_STREAM(s, def, width)
 
#define _MAKE_OSABI_CASE(x)
 
#define STO_MIPS_ISA   (3 << 6)
 
#define STO_MICROMIPS   (2 << 6)
 
#define IS_MICROMIPS(ST_OTHER)   (((ST_OTHER)&STO_MIPS_ISA) == STO_MICROMIPS)
 

Functions

static user_id_t SegmentID (size_t PHdrIndex)
 
static uint32_t mipsVariantFromElfFlags (const elf::ELFHeader &header)
 
static uint32_t subTypeFromElfHeader (const elf::ELFHeader &header)
 
static uint32_t calc_crc32 (uint32_t init, const DataExtractor &data)
 
static const char * OSABIAsCString (unsigned char osabi_byte)
 
static bool GetOsFromOSABI (unsigned char osabi_byte, llvm::Triple::OSType &ostype)
 
static SectionType GetSectionTypeFromName (llvm::StringRef Name)
 
static uint32_t GetTargetByteSize (SectionType Type, const ArchSpec &arch)
 
static Permissions GetPermissions (const ELFSectionHeader &H)
 
static Permissions GetPermissions (const ELFProgramHeader &H)
 
static char FindArmAarch64MappingSymbol (const char *symbol_name)
 
static std::pair< uint64_t, uint64_t > GetPltEntrySizeAndOffset (const ELFSectionHeader *rel_hdr, const ELFSectionHeader *plt_hdr)
 
static unsigned ParsePLTRelocations (Symtab *symbol_table, user_id_t start_id, unsigned rel_type, const ELFHeader *hdr, const ELFSectionHeader *rel_hdr, const ELFSectionHeader *plt_hdr, const ELFSectionHeader *sym_hdr, const lldb::SectionSP &plt_section_sp, DataExtractor &rel_data, DataExtractor &symtab_data, DataExtractor &strtab_data)
 

Macro Definition Documentation

◆ _MAKE_OSABI_CASE

#define _MAKE_OSABI_CASE (   x)
Value:
case x: \
return #x

Referenced by OSABIAsCString().

◆ CASE_AND_STREAM

#define CASE_AND_STREAM (   s,
  def,
  width 
)
Value:
case def: \
s->Printf("%-*s", width, #def); \
break;

Definition at line 44 of file ObjectFileELF.cpp.

Referenced by ObjectFileELF::DumpELFProgramHeader_p_type(), and ObjectFileELF::DumpELFSectionHeader_sh_type().

◆ IS_MICROMIPS

#define IS_MICROMIPS (   ST_OTHER)    (((ST_OTHER)&STO_MIPS_ISA) == STO_MICROMIPS)

Definition at line 1938 of file ObjectFileELF.cpp.

Referenced by ObjectFileELF::ParseSymbols().

◆ STO_MICROMIPS

#define STO_MICROMIPS   (2 << 6)

Definition at line 1937 of file ObjectFileELF.cpp.

◆ STO_MIPS_ISA

#define STO_MIPS_ISA   (3 << 6)

Definition at line 1936 of file ObjectFileELF.cpp.

Function Documentation

◆ calc_crc32()

static uint32_t calc_crc32 ( uint32_t  init,
const DataExtractor data 
)
static

◆ FindArmAarch64MappingSymbol()

static char FindArmAarch64MappingSymbol ( const char *  symbol_name)
static

Definition at line 1923 of file ObjectFileELF.cpp.

Referenced by ObjectFileELF::ParseSymbols().

◆ GetOsFromOSABI()

static bool GetOsFromOSABI ( unsigned char  osabi_byte,
llvm::Triple::OSType &  ostype 
)
static

◆ GetPermissions() [1/2]

static Permissions GetPermissions ( const ELFSectionHeader H)
static

◆ GetPermissions() [2/2]

static Permissions GetPermissions ( const ELFProgramHeader H)
static

◆ GetPltEntrySizeAndOffset()

static std::pair<uint64_t, uint64_t> GetPltEntrySizeAndOffset ( const ELFSectionHeader rel_hdr,
const ELFSectionHeader plt_hdr 
)
static

◆ GetSectionTypeFromName()

static SectionType GetSectionTypeFromName ( llvm::StringRef  Name)
static

◆ GetTargetByteSize()

static uint32_t GetTargetByteSize ( SectionType  Type,
const ArchSpec arch 
)
static

◆ mipsVariantFromElfFlags()

static uint32_t mipsVariantFromElfFlags ( const elf::ELFHeader header)
static

◆ OSABIAsCString()

static const char* OSABIAsCString ( unsigned char  osabi_byte)
static

Definition at line 433 of file ObjectFileELF.cpp.

References _MAKE_OSABI_CASE.

Referenced by ObjectFileELF::GetModuleSpecifications().

◆ ParsePLTRelocations()

static unsigned ParsePLTRelocations ( Symtab symbol_table,
user_id_t  start_id,
unsigned  rel_type,
const ELFHeader hdr,
const ELFSectionHeader rel_hdr,
const ELFSectionHeader plt_hdr,
const ELFSectionHeader sym_hdr,
const lldb::SectionSP &  plt_section_sp,
DataExtractor rel_data,
DataExtractor symtab_data,
DataExtractor strtab_data 
)
static

◆ SegmentID()

static user_id_t SegmentID ( size_t  PHdrIndex)
static

◆ subTypeFromElfHeader()

static uint32_t subTypeFromElfHeader ( const elf::ELFHeader header)
static