summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Relocations.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 5df6b18e40b..60f08b8faae 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -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)
OpenPOWER on IntegriCloud