[lld] [LLD] Use uint64_t timestamp to overcome potential overflow (PR #81665)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 16:54:53 PST 2024


================
@@ -178,8 +178,9 @@ uint64_t Symbol::getGotPltVA() const {
 
 uint64_t Symbol::getGotPltOffset() const {
   if (isInIplt)
-    return getPltIdx() * target->gotEntrySize;
-  return (getPltIdx() + target->gotPltHeaderEntriesNum) * target->gotEntrySize;
+    return getPltIdx() * (uint64_t)target->gotEntrySize;
----------------
MaskRay wrote:

This seems an unnecessary change. GOT entries are expected to small, much smaller than 2GiB. If this ever overflows, the program is likely already heavily corrupted.

https://github.com/llvm/llvm-project/pull/81665


More information about the llvm-commits mailing list