diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-05-20 21:14:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-05-20 21:14:06 +0000 |
commit | 372bac83c67aa731860d2323c1775592f23a07f2 (patch) | |
tree | c64c7e67364f3af5cfa0ddf6b151b7e0806d58f9 | |
parent | 18fcf48fc34ff60432bcb78296796f68287a6410 (diff) |
Simplify a bit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@270275 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | ELF/InputSection.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ELF/InputSection.cpp b/ELF/InputSection.cpp index 5552b90d3..9393bf5c7 100644 --- a/ELF/InputSection.cpp +++ b/ELF/InputSection.cpp @@ -292,30 +292,30 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd) { uint64_t SymVA = SignExtend64<Bits>( getSymVA<ELFT>(Type, A, AddrLoc, *Rel.Sym, BufLoc, *File, Expr)); - if (Expr == R_RELAX_TLS_IE_TO_LE) { - Target->relaxTlsIeToLe(BufLoc, Type, SymVA); - continue; - } - if (Expr == R_RELAX_TLS_LD_TO_LE) { - Target->relaxTlsLdToLe(BufLoc, Type, SymVA); - continue; - } - if (Expr == R_RELAX_TLS_GD_TO_LE) { - Target->relaxTlsGdToLe(BufLoc, Type, SymVA); - continue; - } - if (Expr == R_RELAX_TLS_GD_TO_IE_PC || Expr == R_RELAX_TLS_GD_TO_IE) { - Target->relaxTlsGdToIe(BufLoc, Type, SymVA); - continue; - } - if (Expr == R_PPC_PLT_OPD) { uint32_t Nop = 0x60000000; if (BufLoc + 8 <= BufEnd && read32be(BufLoc + 4) == Nop) write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1) } - Target->relocateOne(BufLoc, Type, SymVA); + switch (Expr) { + case R_RELAX_TLS_IE_TO_LE: + Target->relaxTlsIeToLe(BufLoc, Type, SymVA); + break; + case R_RELAX_TLS_LD_TO_LE: + Target->relaxTlsLdToLe(BufLoc, Type, SymVA); + break; + case R_RELAX_TLS_GD_TO_LE: + Target->relaxTlsGdToLe(BufLoc, Type, SymVA); + break; + case R_RELAX_TLS_GD_TO_IE_PC: + case R_RELAX_TLS_GD_TO_IE: + Target->relaxTlsGdToIe(BufLoc, Type, SymVA); + break; + default: + Target->relocateOne(BufLoc, Type, SymVA); + break; + } } } |