diff options
-rw-r--r-- | lld/ELF/OutputSections.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/Target.cpp | 12 | ||||
-rw-r--r-- | lld/ELF/Target.h | 1 |
3 files changed, 1 insertions, 14 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 6faabdfb39a..15ddd9da318 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -1573,7 +1573,7 @@ MipsReginfoOutputSection<ELFT>::MipsReginfoOutputSection() template <class ELFT> void MipsReginfoOutputSection<ELFT>::writeTo(uint8_t *Buf) { auto *R = reinterpret_cast<Elf_Mips_RegInfo *>(Buf); - R->ri_gp_value = getMipsGpAddr<ELFT>(); + R->ri_gp_value = Out<ELFT>::Got->getVA() + MipsGPOffset; R->ri_gprmask = GprMask; } diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 0bf86c2c554..2ee14b871b1 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1595,17 +1595,5 @@ bool MipsTargetInfo<ELFT>::isRelRelative(uint32_t Type) const { return false; } } - -// _gp is a MIPS-specific ABI-defined symbol which points to -// a location that is relative to GOT. This function returns -// the value for the symbol. -template <class ELFT> typename ELFT::uint getMipsGpAddr() { - return Out<ELFT>::Got->getVA() + MipsGPOffset; -} - -template uint32_t getMipsGpAddr<ELF32LE>(); -template uint32_t getMipsGpAddr<ELF32BE>(); -template uint64_t getMipsGpAddr<ELF64LE>(); -template uint64_t getMipsGpAddr<ELF64BE>(); } } diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h index cb743c754b4..1bae3e2bf5d 100644 --- a/lld/ELF/Target.h +++ b/lld/ELF/Target.h @@ -97,7 +97,6 @@ public: uint64_t getPPC64TocBase(); const unsigned MipsGPOffset = 0x7ff0; -template <class ELFT> typename ELFT::uint getMipsGpAddr(); extern TargetInfo *Target; TargetInfo *createTarget(); |