summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-04-23 20:34:35 +0000
committerRui Ueyama <ruiu@google.com>2018-04-23 20:34:35 +0000
commitd134d2e50976dccc7684050fef1675c6576aef3e (patch)
tree9bb15004b04a90303cc21280578d1668959a0ecd /lld
parent88b7be0d13759536945d1270fbed114f530890ae (diff)
downloadbcm5719-llvm-d134d2e50976dccc7684050fef1675c6576aef3e.tar.gz
bcm5719-llvm-d134d2e50976dccc7684050fef1675c6576aef3e.zip
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. llvm-svn: 330644
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/InputSection.cpp12
-rw-r--r--lld/test/ELF/ppc64-error-toc-restore.s2
-rw-r--r--lld/test/ELF/ppc64-error-toc-tail-call.s2
3 files changed, 8 insertions, 8 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;
diff --git a/lld/test/ELF/ppc64-error-toc-restore.s b/lld/test/ELF/ppc64-error-toc-restore.s
index d9adbd8ded1..8122409c737 100644
--- a/lld/test/ELF/ppc64-error-toc-restore.s
+++ b/lld/test/ELF/ppc64-error-toc-restore.s
@@ -5,7 +5,7 @@
// REQUIRES: ppc
# Calling external function bar needs a nop
-// CHECK: error: call lacks nop, can't restore toc
+// CHECK: call lacks nop, can't restore toc
.text
.abiversion 2
diff --git a/lld/test/ELF/ppc64-error-toc-tail-call.s b/lld/test/ELF/ppc64-error-toc-tail-call.s
index 3c096d367f1..5f86f60aaff 100644
--- a/lld/test/ELF/ppc64-error-toc-tail-call.s
+++ b/lld/test/ELF/ppc64-error-toc-tail-call.s
@@ -5,7 +5,7 @@
// REQUIRES: ppc
# A tail call to an external function without a nop should issue an error.
-// CHECK: error: call lacks nop, can't restore toc
+// CHECK: call lacks nop, can't restore toc
.text
.abiversion 2
OpenPOWER on IntegriCloud