diff options
Diffstat (limited to 'ELF/InputSection.cpp')
-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; + } } } |