diff options
| -rw-r--r-- | lld/ELF/InputSection.cpp | 4 | ||||
| -rw-r--r-- | lld/ELF/InputSection.h | 6 | ||||
| -rw-r--r-- | lld/ELF/Target.cpp | 6 | ||||
| -rw-r--r-- | lld/ELF/Writer.cpp | 7 | 
4 files changed, 12 insertions, 11 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index e5fa4089cc0..ec46ecd1c25 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -191,12 +191,12 @@ getSymVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P,      return Body.getVA<ELFT>(A);    case R_GOT_OFF:      return Body.getGotOffset<ELFT>() + A; -  case R_MIPS_GOT_LOCAL: +  case R_MIPS_GOT_LOCAL_PAGE:      // If relocation against MIPS local symbol requires GOT entry, this entry      // should be initialized by 'page address'. This address is high 16-bits      // of sum the symbol's value and the addend.      return Out<ELFT>::Got->getMipsLocalPageOffset(Body.getVA<ELFT>(A)); -  case R_MIPS_GOT: +  case R_MIPS_GOT_LOCAL:      // For non-local symbols GOT entries should contain their full      // addresses. But if such symbol cannot be preempted, we do not      // have to put them into the "global" part of GOT and use dynamic diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 17313d204d3..f50ae72157c 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -36,8 +36,8 @@ enum RelExpr {    R_GOT_PAGE_PC,    R_GOT_PC,    R_HINT, -  R_MIPS_GOT,    R_MIPS_GOT_LOCAL, +  R_MIPS_GOT_LOCAL_PAGE,    R_NEG_TLS,    R_PAGE_PC,    R_PC, @@ -61,8 +61,8 @@ enum RelExpr {  };  inline bool refersToGotEntry(RelExpr Expr) { -  return Expr == R_GOT || Expr == R_GOT_OFF || Expr == R_MIPS_GOT || -         Expr == R_MIPS_GOT_LOCAL || Expr == R_GOT_PAGE_PC || +  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;  } diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index e21e3efd747..464d1b09111 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1281,15 +1281,15 @@ RelExpr MipsTargetInfo<ELFT>::getRelExpr(uint32_t Type,      return R_PC;    case R_MIPS_GOT16:      if (S.isLocal()) -      return R_MIPS_GOT_LOCAL; +      return R_MIPS_GOT_LOCAL_PAGE;    // fallthrough    case R_MIPS_CALL16:    case R_MIPS_GOT_DISP:      if (!S.isPreemptible()) -      return R_MIPS_GOT; +      return R_MIPS_GOT_LOCAL;      return R_GOT_OFF;    case R_MIPS_GOT_PAGE: -    return R_MIPS_GOT_LOCAL; +    return R_MIPS_GOT_LOCAL_PAGE;    }  } diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 0d6925becb7..35bc610ad8d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -457,9 +457,10 @@ template <class ELFT>  static bool isStaticLinkTimeConstant(RelExpr E, uint32_t Type,                                       const SymbolBody &Body) {    // These expressions always compute a constant -  if (E == R_SIZE || E == R_GOT_FROM_END || E == R_GOT_OFF || E == R_MIPS_GOT || -      E == R_MIPS_GOT_LOCAL || E == R_GOT_PAGE_PC || E == R_GOT_PC || -      E == R_PLT_PC || E == R_TLSGD_PC || E == R_TLSGD || E == R_PPC_PLT_OPD) +  if (E == R_SIZE || E == R_GOT_FROM_END || E == R_GOT_OFF || +      E == R_MIPS_GOT_LOCAL || E == R_MIPS_GOT_LOCAL_PAGE || +      E == R_GOT_PAGE_PC || E == R_GOT_PC || E == R_PLT_PC || E == R_TLSGD_PC || +      E == R_TLSGD || E == R_PPC_PLT_OPD)      return true;    // These never do, except if the entire file is position dependent or if  | 

