[lld] r322861 - [ELF][MIPS] Rename function. NFC

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 07:59:11 PST 2018


Author: atanasyan
Date: Thu Jan 18 07:59:10 2018
New Revision: 322861

URL: http://llvm.org/viewvc/llvm-project?rev=322861&view=rev
Log:
[ELF][MIPS] Rename function. NFC

Modified:
    lld/trunk/ELF/Arch/Mips.cpp

Modified: lld/trunk/ELF/Arch/Mips.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/Mips.cpp?rev=322861&r1=322860&r2=322861&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/Mips.cpp (original)
+++ lld/trunk/ELF/Arch/Mips.cpp Thu Jan 18 07:59:10 2018
@@ -213,8 +213,8 @@ template <endianness E> static uint32_t
 }
 
 template <endianness E>
-static void writeRelocation(uint8_t *Loc, uint64_t V, uint8_t BitsSize,
-                            uint8_t Shift) {
+static void writeValue(uint8_t *Loc, uint64_t V, uint8_t BitsSize,
+                       uint8_t Shift) {
   uint32_t Instr = read32<E>(Loc);
   uint32_t Mask = 0xffffffff >> (32 - BitsSize);
   uint32_t Data = (Instr & ~Mask) | ((V >> Shift) & Mask);
@@ -229,7 +229,7 @@ static void writeMicroRelocation32(uint8
   if (E == support::little)
     std::swap(Words[0], Words[1]);
 
-  writeRelocation<E>(Loc, V, BitsSize, Shift);
+  writeValue<E>(Loc, V, BitsSize, Shift);
 
   if (E == support::little)
     std::swap(Words[0], Words[1]);
@@ -300,9 +300,9 @@ template <class ELFT> void MIPS<ELFT>::w
   write32<E>(Buf + 28, 0x2718fffe); // subu  $24, $24, 2
 
   uint64_t GotPlt = InX::GotPlt->getVA();
-  writeRelocation<E>(Buf, GotPlt + 0x8000, 16, 16);
-  writeRelocation<E>(Buf + 4, GotPlt, 16, 0);
-  writeRelocation<E>(Buf + 8, GotPlt, 16, 0);
+  writeValue<E>(Buf, GotPlt + 0x8000, 16, 16);
+  writeValue<E>(Buf + 4, GotPlt, 16, 0);
+  writeValue<E>(Buf + 8, GotPlt, 16, 0);
 }
 
 template <class ELFT>
@@ -334,9 +334,9 @@ void MIPS<ELFT>::writePlt(uint8_t *Buf,
   write32<E>(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15)
   write32<E>(Buf + 8, isMipsR6() ? 0x03200009 : 0x03200008);  // jr  $25
   write32<E>(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry)
-  writeRelocation<E>(Buf, GotPltEntryAddr + 0x8000, 16, 16);
-  writeRelocation<E>(Buf + 4, GotPltEntryAddr, 16, 0);
-  writeRelocation<E>(Buf + 12, GotPltEntryAddr, 16, 0);
+  writeValue<E>(Buf, GotPltEntryAddr + 0x8000, 16, 16);
+  writeValue<E>(Buf + 4, GotPltEntryAddr, 16, 0);
+  writeValue<E>(Buf + 12, GotPltEntryAddr, 16, 0);
 }
 
 template <class ELFT>
@@ -497,17 +497,17 @@ void MIPS<ELFT>::relocateOne(uint8_t *Lo
     write64<E>(Loc, Val);
     break;
   case R_MIPS_26:
-    writeRelocation<E>(Loc, Val, 26, 2);
+    writeValue<E>(Loc, Val, 26, 2);
     break;
   case R_MIPS_GOT16:
     // The R_MIPS_GOT16 relocation's value in "relocatable" linking mode
     // is updated addend (not a GOT index). In that case write high 16 bits
     // to store a correct addend value.
     if (Config->Relocatable) {
-      writeRelocation<E>(Loc, Val + 0x8000, 16, 16);
+      writeValue<E>(Loc, Val + 0x8000, 16, 16);
     } else {
       checkInt<16>(Loc, Val, Type);
-      writeRelocation<E>(Loc, Val, 16, 0);
+      writeValue<E>(Loc, Val, 16, 0);
     }
     break;
   case R_MICROMIPS_GOT16:
@@ -534,7 +534,7 @@ void MIPS<ELFT>::relocateOne(uint8_t *Lo
   case R_MIPS_PCLO16:
   case R_MIPS_TLS_DTPREL_LO16:
   case R_MIPS_TLS_TPREL_LO16:
-    writeRelocation<E>(Loc, Val, 16, 0);
+    writeValue<E>(Loc, Val, 16, 0);
     break;
   case R_MICROMIPS_GOT_DISP:
   case R_MICROMIPS_GOT_PAGE:
@@ -563,7 +563,7 @@ void MIPS<ELFT>::relocateOne(uint8_t *Lo
   case R_MIPS_PCHI16:
   case R_MIPS_TLS_DTPREL_HI16:
   case R_MIPS_TLS_TPREL_HI16:
-    writeRelocation<E>(Loc, Val + 0x8000, 16, 16);
+    writeValue<E>(Loc, Val + 0x8000, 16, 16);
     break;
   case R_MICROMIPS_CALL_HI16:
   case R_MICROMIPS_GOT_HI16:
@@ -573,10 +573,10 @@ void MIPS<ELFT>::relocateOne(uint8_t *Lo
     writeMicroRelocation32<E>(Loc, Val + 0x8000, 16, 16);
     break;
   case R_MIPS_HIGHER:
-    writeRelocation<E>(Loc, Val + 0x80008000, 16, 32);
+    writeValue<E>(Loc, Val + 0x80008000, 16, 32);
     break;
   case R_MIPS_HIGHEST:
-    writeRelocation<E>(Loc, Val + 0x800080008000, 16, 48);
+    writeValue<E>(Loc, Val + 0x800080008000, 16, 48);
     break;
   case R_MICROMIPS_HIGHER:
     writeMicroRelocation32<E>(Loc, Val + 0x80008000, 16, 32);
@@ -591,25 +591,25 @@ void MIPS<ELFT>::relocateOne(uint8_t *Lo
   case R_MIPS_PC16:
     checkAlignment<4>(Loc, Val, Type);
     checkInt<18>(Loc, Val, Type);
-    writeRelocation<E>(Loc, Val, 16, 2);
+    writeValue<E>(Loc, Val, 16, 2);
     break;
   case R_MIPS_PC19_S2:
     checkAlignment<4>(Loc, Val, Type);
     checkInt<21>(Loc, Val, Type);
-    writeRelocation<E>(Loc, Val, 19, 2);
+    writeValue<E>(Loc, Val, 19, 2);
     break;
   case R_MIPS_PC21_S2:
     checkAlignment<4>(Loc, Val, Type);
     checkInt<23>(Loc, Val, Type);
-    writeRelocation<E>(Loc, Val, 21, 2);
+    writeValue<E>(Loc, Val, 21, 2);
     break;
   case R_MIPS_PC26_S2:
     checkAlignment<4>(Loc, Val, Type);
     checkInt<28>(Loc, Val, Type);
-    writeRelocation<E>(Loc, Val, 26, 2);
+    writeValue<E>(Loc, Val, 26, 2);
     break;
   case R_MIPS_PC32:
-    writeRelocation<E>(Loc, Val, 32, 0);
+    writeValue<E>(Loc, Val, 32, 0);
     break;
   case R_MICROMIPS_26_S1:
   case R_MICROMIPS_PC26_S1:




More information about the llvm-commits mailing list