[lld] r330644 - Remove duplicate "error:" from an error message.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 13:34:35 PDT 2018


Author: ruiu
Date: Mon Apr 23 13:34:35 2018
New Revision: 330644

URL: http://llvm.org/viewvc/llvm-project?rev=330644&view=rev
Log:
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.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/test/ELF/ppc64-error-toc-restore.s
    lld/trunk/test/ELF/ppc64-error-toc-tail-call.s

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=330644&r1=330643&r2=330644&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Mon Apr 23 13:34:35 2018
@@ -740,13 +740,13 @@ void InputSectionBase::relocateAlloc(uin
       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;

Modified: lld/trunk/test/ELF/ppc64-error-toc-restore.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ppc64-error-toc-restore.s?rev=330644&r1=330643&r2=330644&view=diff
==============================================================================
--- lld/trunk/test/ELF/ppc64-error-toc-restore.s (original)
+++ lld/trunk/test/ELF/ppc64-error-toc-restore.s Mon Apr 23 13:34:35 2018
@@ -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
 

Modified: lld/trunk/test/ELF/ppc64-error-toc-tail-call.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/ppc64-error-toc-tail-call.s?rev=330644&r1=330643&r2=330644&view=diff
==============================================================================
--- lld/trunk/test/ELF/ppc64-error-toc-tail-call.s (original)
+++ lld/trunk/test/ELF/ppc64-error-toc-tail-call.s Mon Apr 23 13:34:35 2018
@@ -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
 




More information about the llvm-commits mailing list