[PATCH] D38020: [COFF] Adjust secrel limit check

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 17:23:45 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL313703: [COFF] Adjust secrel limit check (authored by smeenai).

Repository:
  rL LLVM

https://reviews.llvm.org/D38020

Files:
  lld/trunk/COFF/Chunks.cpp


Index: lld/trunk/COFF/Chunks.cpp
===================================================================
--- lld/trunk/COFF/Chunks.cpp
+++ lld/trunk/COFF/Chunks.cpp
@@ -62,7 +62,10 @@
     fatal("SECREL relocation cannot be applied to absolute symbols");
   }
   uint64_t SecRel = S - OS->getRVA();
-  assert(SecRel < INT32_MAX && "overflow in SECREL relocation");
+  if (SecRel > UINT32_MAX) {
+    error("overflow in SECREL relocation in section: " + Sec->getSectionName());
+    return;
+  }
   add32(Off, SecRel);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38020.115935.patch
Type: text/x-patch
Size: 519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170920/170745b0/attachment.bin>


More information about the llvm-commits mailing list