diff options
Diffstat (limited to 'ELF/Relocations.h')
-rw-r--r-- | ELF/Relocations.h | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/ELF/Relocations.h b/ELF/Relocations.h index a4125111c4fe..d00e68bd36e6 100644 --- a/ELF/Relocations.h +++ b/ELF/Relocations.h @@ -33,16 +33,28 @@ enum RelExpr { R_INVALID, R_ABS, R_ADDEND, + R_AARCH64_GOT_PAGE_PC, + // The expression is used for IFUNC support. Describes PC-relative + // address of the memory page of GOT entry. This entry is used for + // a redirection to IPLT. + R_AARCH64_GOT_PAGE_PC_PLT, + R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC, + R_AARCH64_PAGE_PC, + R_AARCH64_PLT_PAGE_PC, + R_AARCH64_TLSDESC_PAGE, R_ARM_SBREL, R_GOT, + // The expression is used for IFUNC support. Evaluates to GOT entry, + // containing redirection to the IPLT. + R_GOT_PLT, R_GOTONLY_PC, R_GOTONLY_PC_FROM_END, R_GOTREL, R_GOTREL_FROM_END, R_GOT_FROM_END, R_GOT_OFF, - R_GOT_PAGE_PC, R_GOT_PC, + R_HEXAGON_GOT, R_HINT, R_MIPS_GOTREL, R_MIPS_GOT_GP, @@ -54,10 +66,8 @@ enum RelExpr { R_MIPS_TLSLD, R_NEG_TLS, R_NONE, - R_PAGE_PC, R_PC, R_PLT, - R_PLT_PAGE_PC, R_PLT_PC, R_PPC_CALL, R_PPC_CALL_PLT, @@ -68,20 +78,20 @@ enum RelExpr { R_RELAX_TLS_GD_TO_IE_ABS, R_RELAX_TLS_GD_TO_IE_END, R_RELAX_TLS_GD_TO_IE_GOT_OFF, - R_RELAX_TLS_GD_TO_IE_PAGE_PC, R_RELAX_TLS_GD_TO_LE, R_RELAX_TLS_GD_TO_LE_NEG, R_RELAX_TLS_IE_TO_LE, R_RELAX_TLS_LD_TO_LE, R_RELAX_TLS_LD_TO_LE_ABS, + R_RISCV_PC_INDIRECT, R_SIZE, R_TLS, R_TLSDESC, R_TLSDESC_CALL, - R_TLSDESC_PAGE, R_TLSGD_GOT, R_TLSGD_GOT_FROM_END, R_TLSGD_PC, + R_TLSIE_HINT, R_TLSLD_GOT, R_TLSLD_GOT_FROM_END, R_TLSLD_GOT_OFF, @@ -128,6 +138,21 @@ struct Relocation { Symbol *Sym; }; +struct RelocationOffsetComparator { + bool operator()(const Relocation &Lhs, const Relocation &Rhs) { + return Lhs.Offset < Rhs.Offset; + } + + // For std::lower_bound, std::upper_bound, std::equal_range. + bool operator()(const Relocation &Rel, uint64_t Val) { + return Rel.Offset < Val; + } + + bool operator()(uint64_t Val, const Relocation &Rel) { + return Val < Rel.Offset; + } +}; + template <class ELFT> void scanRelocations(InputSectionBase &); class ThunkSection; @@ -155,10 +180,6 @@ private: void createInitialThunkSections(ArrayRef<OutputSection *> OutputSections); - void forEachInputSectionDescription( - ArrayRef<OutputSection *> OutputSections, - llvm::function_ref<void(OutputSection *, InputSectionDescription *)> Fn); - std::pair<Thunk *, bool> getThunk(Symbol &Sym, RelType Type, uint64_t Src); ThunkSection *addThunkSection(OutputSection *OS, InputSectionDescription *, |