diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index df846dd34b0..8d276ec2d65 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -630,8 +630,10 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) { if (!Config->Pic || Target->isRelRelative(Type) || Expr == R_PC || Expr == R_SIZE || isAbsolute<ELFT>(Body)) { if (Config->EMachine == EM_MIPS && Body.isLocal() && - (Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32)) - Expr = R_MIPS_GP0; + (Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32)) { + Expr = R_ABS; + Addend += File.getMipsGp0(); + } C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); continue; } |