20 #ifndef LLVM_BINARYFORMAT_ELF_H 21 #define LLVM_BINARYFORMAT_ELF_H 44 static const char ElfMagic[] = {0x7f,
'E',
'L',
'F',
'\0'};
78 return (
memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
104 return (
memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
362 #define ELF_RELOC(name, value) name = value, 366 #include "ELFRelocs/x86_64.def" 371 #include "ELFRelocs/i386.def" 376 #include "ELFRelocs/PowerPC.def" 395 return ((1 << Val) >> 2) << 2;
399 (Offset >= 4 * 4 ? (Offset >= 8 * 4 ? (Offset >= 16 * 4 ? 6 : 5) : 4)
400 : (Offset >= 2 * 4 ? 3 : (Offset >= 1 * 4 ? 2 : 0)));
406 #include "ELFRelocs/PowerPC64.def" 411 #include "ELFRelocs/AArch64.def" 431 #include "ELFRelocs/ARM.def" 452 #include "ELFRelocs/ARC.def" 479 #include "ELFRelocs/AVR.def" 546 #include "ELFRelocs/Mips.def" 612 #include "ELFRelocs/Hexagon.def" 617 #include "ELFRelocs/Lanai.def" 633 #include "ELFRelocs/RISCV.def" 638 #include "ELFRelocs/SystemZ.def" 643 #include "ELFRelocs/Sparc.def" 726 #include "ELFRelocs/AMDGPU.def" 731 #include "ELFRelocs/BPF.def" 763 #include "ELFRelocs/MSP430.def" 994 unsigned char getType()
const {
return st_info & 0x0f; }
996 void setType(
unsigned char t) { setBindingAndType(getBinding(), t); }
998 st_info = (b << 4) + (t & 0x0f);
1014 unsigned char getType()
const {
return st_info & 0x0f; }
1016 void setType(
unsigned char t) { setBindingAndType(getBinding(), t); }
1018 st_info = (b << 4) + (t & 0x0f);
1085 unsigned char getType()
const {
return (
unsigned char)(r_info & 0x0ff); }
1089 r_info = (s << 8) + t;
1102 unsigned char getType()
const {
return (
unsigned char)(r_info & 0x0ff); }
1106 r_info = (s << 8) + t;
1125 r_info = ((
Elf64_Xword)s << 32) + (t & 0xffffffffL);
1142 r_info = ((
Elf64_Xword)s << 32) + (t & 0xffffffffL);
1243 #define DYNAMIC_TAG(name, value) DT_##name = value, 1244 #include "DynamicTags.def" 1439 #endif // LLVM_BINARYFORMAT_ELF_H
void setSymbolAndType(Elf32_Word s, unsigned char t)
void setSymbolAndType(Elf32_Word s, unsigned char t)
This class represents lattice values for constants.
void setType(unsigned char t)
All sections with the "d" flag are grouped together by the linker to form the data section and the dp...
Elf32_Word getSymbol() const
unsigned char getDataEncoding() const
void setSymbolAndType(Elf64_Word s, Elf64_Word t)
All sections with the "c" flag are grouped together by the linker to form the constant pool and the c...
void setType(Elf64_Word t)
Elf32_Word getSymbol() const
static int64_t decodePPC64LocalEntryOffset(unsigned Other)
unsigned char getType() const
unsigned char getDataEncoding() const
static unsigned encodePPC64LocalEntryOffset(int64_t Offset)
unsigned char getType() const
unsigned char getType() const
Expected< const typename ELFT::Sym * > getSymbol(typename ELFT::SymRange Symbols, uint32_t Index)
Elf64_Word getType() const
Elf64_Word getType() const
Elf64_Word getSymbol() const
void setType(unsigned char t)
void setBinding(unsigned char b)
unsigned char getType() const
void setSymbol(Elf64_Word s)
static wasm::ValType getType(const TargetRegisterClass *RC)
void setSymbolAndType(Elf64_Word s, Elf64_Word t)
unsigned char getFileClass() const
static const char ElfMagic[]
void setBindingAndType(unsigned char b, unsigned char t)
void setSymbol(Elf32_Word s)
unsigned char getBinding() const
Elf64_Word getSymbol() const
unsigned char getBinding() const
constexpr const char * ELF_NOTE_GNU
unsigned char e_ident[EI_NIDENT]
void setType(Elf64_Word t)
Merge contiguous icmps into a memcmp
void setType(unsigned char t)
void setType(unsigned char t)
void setSymbol(Elf64_Word s)
unsigned char getFileClass() const
void setBindingAndType(unsigned char b, unsigned char t)
void setSymbol(Elf32_Word s)
void setBinding(unsigned char b)