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; }