Revert r298815: Do not use assert to report broken input files.
authorRui Ueyama <ruiu@google.com>
Wed, 29 Mar 2017 19:35:44 +0000 (19:35 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 29 Mar 2017 19:35:44 +0000 (19:35 +0000)
This reverts commit because this really shouldn't happen unless
there's a bug in LLD.

llvm-svn: 299021

lld/ELF/Relocations.cpp

index 5df6b18..60f08b8 100644 (file)
@@ -686,10 +686,8 @@ public:
     if (I == Size)
       return Off;
 
-    if (Off < P[I].InputOff) {
-      error("relocation not in any piece");
-      return -1;
-    }
+    // P must be contiguous, so there must be no holes in between.
+    assert(P[I].InputOff <= Off && "Relocation not in any piece");
 
     // Offset -1 means that the piece is dead (i.e. garbage collected).
     if (P[I].OutputOff == -1)