[lld] r272974 - Merge cases that execute the same code.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 16:28:07 PDT 2016
Author: ruiu
Date: Thu Jun 16 18:28:06 2016
New Revision: 272974
URL: http://llvm.org/viewvc/llvm-project?rev=272974&view=rev
Log:
Merge cases that execute the same code.
Modified:
lld/trunk/ELF/Target.cpp
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=272974&r1=272973&r2=272974&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu Jun 16 18:28:06 2016
@@ -1040,9 +1040,11 @@ void PPC64TargetInfo::relocateOne(uint8_
write16be(Loc, (read16be(Loc) & 3) | (Val & ~3));
break;
case R_PPC64_ADDR16_HA:
+ case R_PPC64_REL16_HA:
write16be(Loc, applyPPCHa(Val));
break;
case R_PPC64_ADDR16_HI:
+ case R_PPC64_REL16_HI:
write16be(Loc, applyPPCHi(Val));
break;
case R_PPC64_ADDR16_HIGHER:
@@ -1061,40 +1063,25 @@ void PPC64TargetInfo::relocateOne(uint8_
write16be(Loc, applyPPCLo(Val));
break;
case R_PPC64_ADDR16_LO_DS:
+ case R_PPC64_REL16_LO:
write16be(Loc, (read16be(Loc) & 3) | (applyPPCLo(Val) & ~3));
break;
case R_PPC64_ADDR32:
+ case R_PPC64_REL32:
checkInt<32>(Val, Type);
write32be(Loc, Val);
break;
case R_PPC64_ADDR64:
+ case R_PPC64_REL64:
+ case R_PPC64_TOC:
write64be(Loc, Val);
break;
- case R_PPC64_REL16_HA:
- write16be(Loc, applyPPCHa(Val));
- break;
- case R_PPC64_REL16_HI:
- write16be(Loc, applyPPCHi(Val));
- break;
- case R_PPC64_REL16_LO:
- write16be(Loc, applyPPCLo(Val));
- break;
case R_PPC64_REL24: {
uint32_t Mask = 0x03FFFFFC;
checkInt<24>(Val, Type);
write32be(Loc, (read32be(Loc) & ~Mask) | (Val & Mask));
break;
}
- case R_PPC64_REL32:
- checkInt<32>(Val, Type);
- write32be(Loc, Val);
- break;
- case R_PPC64_REL64:
- write64be(Loc, Val);
- break;
- case R_PPC64_TOC:
- write64be(Loc, Val);
- break;
default:
fatal("unrecognized reloc " + Twine(Type));
}
More information about the llvm-commits
mailing list