19 #ifndef LLVM_BINARYFORMAT_ELF_H 20 #define LLVM_BINARYFORMAT_ELF_H 43 static const char ElfMagic[] = {0x7f,
'E',
'L',
'F',
'\0'};
77 return (
memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
103 return (
memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
361 #define ELF_RELOC(name, value) name = value, 365 #include "ELFRelocs/x86_64.def" 370 #include "ELFRelocs/i386.def" 375 #include "ELFRelocs/PowerPC.def" 394 return ((1 << Val) >> 2) << 2;
398 (Offset >= 4 * 4 ? (Offset >= 8 * 4 ? (Offset >= 16 * 4 ? 6 : 5) : 4)
399 : (Offset >= 2 * 4 ? 3 : (Offset >= 1 * 4 ? 2 : 0)));
405 #include "ELFRelocs/PowerPC64.def" 410 #include "ELFRelocs/AArch64.def" 430 #include "ELFRelocs/ARM.def" 451 #include "ELFRelocs/ARC.def" 478 #include "ELFRelocs/AVR.def" 545 #include "ELFRelocs/Mips.def" 611 #include "ELFRelocs/Hexagon.def" 616 #include "ELFRelocs/Lanai.def" 632 #include "ELFRelocs/RISCV.def" 637 #include "ELFRelocs/SystemZ.def" 642 #include "ELFRelocs/Sparc.def" 730 #include "ELFRelocs/AMDGPU.def" 735 #include "ELFRelocs/BPF.def" 767 #include "ELFRelocs/MSP430.def" 1002 unsigned char getType()
const {
return st_info & 0x0f; }
1004 void setType(
unsigned char t) { setBindingAndType(getBinding(), t); }
1006 st_info = (b << 4) + (t & 0x0f);
1022 unsigned char getType()
const {
return st_info & 0x0f; }
1024 void setType(
unsigned char t) { setBindingAndType(getBinding(), t); }
1026 st_info = (b << 4) + (t & 0x0f);
1093 unsigned char getType()
const {
return (
unsigned char)(r_info & 0x0ff); }
1095 void setType(
unsigned char t) { setSymbolAndType(getSymbol(), t); }
1097 r_info = (s << 8) + t;
1110 unsigned char getType()
const {
return (
unsigned char)(r_info & 0x0ff); }
1112 void setType(
unsigned char t) { setSymbolAndType(getSymbol(), t); }
1114 r_info = (s << 8) + t;
1133 r_info = ((
Elf64_Xword)s << 32) + (t & 0xffffffffL);
1150 r_info = ((
Elf64_Xword)s << 32) + (t & 0xffffffffL);
1252 #define DYNAMIC_TAG(name, value) DT_##name = value, 1253 #include "DynamicTags.def" 1574 #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
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)