diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-05-24 20:24:43 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-05-24 20:24:43 +0000 |
| commit | 0fcdc730adac4bd873051fb88f5396918766a725 (patch) | |
| tree | 31bcf72111024af10e6c3c356ba8a8b4cba7f44f /lld/ELF/InputSection.h | |
| parent | 96e44e7c8af4f0b016d7c59cf30db57cb342bb09 (diff) | |
| download | bcm5719-llvm-0fcdc730adac4bd873051fb88f5396918766a725.tar.gz bcm5719-llvm-0fcdc730adac4bd873051fb88f5396918766a725.zip | |
Create Relocations.cpp and move scanRelocs there.
scanReloc and the functions on which scanReloc depends is in total
more than 600 lines of code. Since scanReloc does not depend on Writer,
it is better to move it into a separate file.
Differential Revision: http://reviews.llvm.org/D20554
llvm-svn: 270606
Diffstat (limited to 'lld/ELF/InputSection.h')
| -rw-r--r-- | lld/ELF/InputSection.h | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index f7d7b52954f..028c3be8ae9 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -11,6 +11,7 @@ #define LLD_ELF_INPUT_SECTION_H #include "Config.h" +#include "Relocations.h" #include "lld/Core/LLVM.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/TinyPtrVector.h" @@ -27,54 +28,6 @@ template <class ELFT> class ObjectFile; template <class ELFT> class OutputSection; template <class ELFT> class OutputSectionBase; -enum RelExpr { - R_ABS, - R_GOT, - R_GOTONLY_PC, - R_GOTREL, - R_GOT_FROM_END, - R_GOT_OFF, - R_GOT_PAGE_PC, - R_GOT_PC, - R_HINT, - R_MIPS_GOT_LOCAL, - R_MIPS_GOT_LOCAL_PAGE, - R_NEG_TLS, - R_PAGE_PC, - R_PC, - R_PLT, - R_PLT_PC, - R_PPC_OPD, - R_PPC_PLT_OPD, - R_PPC_TOC, - R_RELAX_TLS_GD_TO_IE, - R_RELAX_TLS_GD_TO_LE, - R_RELAX_TLS_IE_TO_LE, - R_RELAX_TLS_LD_TO_LE, - R_SIZE, - R_THUNK, - R_TLS, - R_TLSGD, - R_TLSGD_PC, - R_TLSLD, - R_TLSLD_PC -}; - -inline bool refersToGotEntry(RelExpr Expr) { - return Expr == R_GOT || Expr == R_GOT_OFF || Expr == R_MIPS_GOT_LOCAL || - Expr == R_MIPS_GOT_LOCAL_PAGE || Expr == R_GOT_PAGE_PC || - Expr == R_GOT_PC || Expr == R_GOT_FROM_END || Expr == R_TLSGD || - Expr == R_TLSGD_PC; -} - -struct Relocation { - RelExpr Expr; - uint32_t Type; - uint64_t Offset; - uint64_t Addend; - SymbolBody *Sym; -}; - // This corresponds to a section of an input file. template <class ELFT> class InputSectionBase { protected: |

