From a888e6726f231364241c339d81cb06fddd6bbae0 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Fri, 4 Mar 2016 10:55:12 +0000 Subject: [PATCH] [ELF][MIPS] Replace S and A arguments of the writeMipsHi16 function by the single argument V. NFC llvm-svn: 262704 --- lld/ELF/Target.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index f104854..5b19383 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1641,9 +1641,9 @@ static void applyMipsPcReloc(uint8_t *Loc, uint32_t Type, uint64_t P, } template -static void writeMipsHi16(uint8_t *Loc, uint64_t S, int64_t A) { +static void writeMipsHi16(uint8_t *Loc, uint64_t V) { uint32_t Instr = read32(Loc); - write32(Loc, (Instr & 0xffff0000) | mipsHigh(S + A)); + write32(Loc, (Instr & 0xffff0000) | mipsHigh(V)); } template @@ -1659,7 +1659,7 @@ void MipsTargetInfo::writePltZero(uint8_t *Buf) const { write32(Buf + 28, 0x2718fffe); // subu $24, $24, 2 uint64_t Got = Out::GotPlt->getVA(); uint64_t Plt = Out::Plt->getVA(); - writeMipsHi16(Buf, Got, 0); + writeMipsHi16(Buf, Got); relocateOne(Buf + 4, Buf + 8, R_MIPS_LO16, Plt + 4, Got); relocateOne(Buf + 8, Buf + 12, R_MIPS_LO16, Plt + 8, Got); } @@ -1673,7 +1673,7 @@ void MipsTargetInfo::writePlt(uint8_t *Buf, uint64_t GotEntryAddr, write32(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15) write32(Buf + 8, 0x03200008); // jr $25 write32(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry) - writeMipsHi16(Buf, GotEntryAddr, 0); + writeMipsHi16(Buf, GotEntryAddr); relocateOne(Buf + 4, Buf + 8, R_MIPS_LO16, PltEntryAddr + 4, GotEntryAddr); relocateOne(Buf + 12, Buf + 16, R_MIPS_LO16, PltEntryAddr + 8, GotEntryAddr); } @@ -1739,10 +1739,10 @@ void MipsTargetInfo::relocateOne(uint8_t *Loc, uint8_t *BufEnd, if (PairedLoc) { uint64_t AHL = ((Instr & 0xffff) << 16) + SignExtend64<16>(read32(PairedLoc) & 0xffff); - writeMipsHi16(Loc, S, AHL); + writeMipsHi16(Loc, S + AHL); } else { warning("Can't find matching R_MIPS_LO16 relocation for R_MIPS_HI16"); - writeMipsHi16(Loc, S, 0); + writeMipsHi16(Loc, S); } break; } -- 2.7.4