20#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_ELF_ELFHEADER_H
21#define LLDB_SOURCE_PLUGINS_OBJECTFILE_ELF_ELFHEADER_H
23#include "llvm/BinaryFormat/ELF.h"
57 unsigned char e_ident[llvm::ELF::EI_NIDENT];
86 return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS32;
94 return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS64;
242 st_info = (binding << 4) + (type & 0x0F);
332 return rel.
r_info & 0xffffffff;
371 return rela.
r_info & 0x0ff;
376 return rela.
r_info & 0xffffffff;
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.
ByteOrder
Byte ordering definitions.
Represents an entry in an ELF dynamic table.
elf_addr d_ptr
Pointer value of the table entry.
elf_xword d_val
Integer value of the table entry.
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
Parse an ELFDynamic entry from the given DataExtractor starting at position offset.
elf_sxword d_tag
Type of dynamic table entry.
Represents a relocation entry with an implicit addend.
static unsigned RelocSymbol64(const ELFRel &rel)
Returns the symbol index when the given entry represents a 64-bit relocation.
elf_addr r_offset
Address of reference.
static unsigned RelocType64(const ELFRel &rel)
Returns the type when the given entry represents a 64-bit relocation.
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
Parse an ELFRel entry from the given DataExtractor starting at position offset.
elf_xword r_info
symbol index and type of relocation.
static unsigned RelocType32(const ELFRel &rel)
Returns the type when the given entry represents a 32-bit relocation.
static unsigned RelocSymbol32(const ELFRel &rel)
Returns the symbol index when the given entry represents a 32-bit relocation.
Represents a relocation entry with an explicit addend.
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
Parse an ELFRela entry from the given DataExtractor starting at position offset.
static unsigned RelocSymbol64(const ELFRela &rela)
Returns the symbol index when the given entry represents a 64-bit relocation.
static unsigned RelocType64(const ELFRela &rela)
Returns the type when the given entry represents a 64-bit relocation.
static unsigned RelocType32(const ELFRela &rela)
Returns the type when the given entry represents a 32-bit relocation.
elf_xword r_info
Symbol index and type of relocation.
elf_sxword r_addend
Constant part of expression.
static unsigned RelocSymbol32(const ELFRela &rela)
Returns the symbol index when the given entry represents a 32-bit relocation.
elf_addr r_offset
Address of reference.
Represents a symbol within an ELF symbol table.
static const char * typeToCString(unsigned char type)
unsigned char getType() const
Returns the type attribute of the st_info member.
static const char * bindingToCString(unsigned char binding)
elf_half st_shndx
Section to which this symbol applies.
unsigned char st_info
Symbol type and binding attributes.
unsigned char getBinding() const
Returns the binding attribute of the st_info member.
bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
Parse an ELFSymbol entry from the given DataExtractor starting at position offset.
elf_addr st_value
Absolute or relocatable address.
static const char * sectionIndexToCString(elf_half shndx, const lldb_private::SectionList *section_list)
elf_word st_name
Symbol name string index.
void setBindingAndType(unsigned char binding, unsigned char type)
Sets the binding and type of the st_info member.
elf_xword st_size
Size of the symbol or zero.
void Dump(lldb_private::Stream *s, uint32_t idx, const lldb_private::DataExtractor *strtab_data, const lldb_private::SectionList *section_list)
unsigned char st_other
Reserved for future use.