diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2018-01-18 15:59:10 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2018-01-18 15:59:10 +0000 |
commit | 712cd41fa0b0f45a7bc589d89af273341be8c529 (patch) | |
tree | 7f0157cda2729b99f55b8c99e54199d908dbf384 | |
parent | ceddcdf01cfeeb78ad2bdafe6dd173e3886efb85 (diff) | |
download | bcm5719-llvm-712cd41fa0b0f45a7bc589d89af273341be8c529.tar.gz bcm5719-llvm-712cd41fa0b0f45a7bc589d89af273341be8c529.zip |
[ELF][MIPS] Rename function. NFC
llvm-svn: 322861
-rw-r--r-- | lld/ELF/Arch/Mips.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lld/ELF/Arch/Mips.cpp b/lld/ELF/Arch/Mips.cpp index 70dca40473b..1aa1d00a96d 100644 --- a/lld/ELF/Arch/Mips.cpp +++ b/lld/ELF/Arch/Mips.cpp @@ -213,8 +213,8 @@ template <endianness E> static uint32_t readShuffle(const uint8_t *Loc) { } 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_t *Loc, uint64_t V, uint8_t BitsSize, 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>::writePltHeader(uint8_t *Buf) const { 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, uint64_t GotPltEntryAddr, 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 *Loc, RelType Type, uint64_t Val) const { 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 *Loc, RelType Type, uint64_t Val) const { 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 *Loc, RelType Type, uint64_t Val) const { 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 *Loc, RelType Type, uint64_t Val) const { 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 *Loc, RelType Type, uint64_t Val) const { 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: |