[PATCH] D53669: [ELF] Don't check if ToSym if unorderable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 13:47:25 PDT 2018


MaskRay created this revision.
MaskRay added a reviewer: ruiu.
Herald added subscribers: llvm-commits, arichardson, emaste.
Herald added a reviewer: espindola.

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53669

Files:
  ELF/Driver.cpp


Index: ELF/Driver.cpp
===================================================================
--- ELF/Driver.cpp
+++ ELF/Driver.cpp
@@ -696,16 +696,15 @@
       // (FromSec isn't null) and the section is discarded
       // (!FromSec->Repl->Live).
       //
-      // We also don't want to warn when ToSym is undefined or is in a shared
-      // object (as symbols in shared objects are fixed and unorderable).
+      // There are too many cases that ToSym would be considered unorderable:
+      // undefined, in a shared object (as symbols in shared objects are fixed
+      // and unorderable), or in a discarded section. Just don't check ToSym.
       //
       // The check used here is more relaxed (no warning if either FromSym or
       // ToSym is not Defined) for simplicity and there is no compelling reason
       // to warn on more cases.
-      if (!FromSec || FromSec->Repl->Live) {
+      if (!FromSec || FromSec->Repl->Live)
         warnUnorderableSymbol(FromSym);
-        warnUnorderableSymbol(ToSym);
-      }
       if (FromSec && ToSec)
         Config->CallGraphProfile[{FromSec, ToSec}] += CGPE.cgp_weight;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53669.170977.patch
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181024/3992b34e/attachment.bin>


More information about the llvm-commits mailing list