diff options
author | Rui Ueyama <ruiu@google.com> | 2018-04-23 20:34:35 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2018-04-23 20:34:35 +0000 |
commit | e7c7cb35d3ad29f7be3de8113d27d5556899242a (patch) | |
tree | e7c4f713ac5201b608fa9aef436deaf5f21dc1de /lld/ELF/InputSection.cpp | |
parent | e348eaa316bcfad0352069502b669878d3920c44 (diff) |
Remove duplicate "error:" from an error message.
This patch also simplifies the code a bit which wasn't committed in
https://reviews.llvm.org/r330600.
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index dfe8f5003bd..4717914d914 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -740,13 +740,13 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uint8_t *BufEnd) { break; case R_PPC_PLT_OPD: // Patch a nop (0x60000000) to a ld. - if (BufLoc + 8 <= BufEnd && read32(BufLoc + 4) == 0x60000000) { - write32(BufLoc + 4, 0xe8410018); // ld %r2, 24(%r1) - } else { - error(getErrorLocation(BufLoc) + "error: call lacks nop, can't restore toc."); - return; + if (BufLoc + 8 > BufEnd || read32(BufLoc + 4) != 0x60000000) { + error(getErrorLocation(BufLoc) + "call lacks nop, can't restore toc"); + break; } - LLVM_FALLTHROUGH; + write32(BufLoc + 4, 0xe8410018); // ld %r2, 24(%r1) + Target->relocateOne(BufLoc, Type, TargetVA); + break; default: Target->relocateOne(BufLoc, Type, TargetVA); break; |