[lld] r240917 - COFF: Undefined weak aliases are not fatal if /force is given.

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jun 29 12:59:23 PDT 2015


> On 2015-Jun-28, at 13:34, Rui Ueyama <ruiu at google.com> wrote:
> 
> Author: ruiu
> Date: Sun Jun 28 15:34:09 2015
> New Revision: 240917
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=240917&view=rev
> Log:
> COFF: Undefined weak aliases are not fatal if /force is given.
> 
> Modified:
>    lld/trunk/COFF/SymbolTable.cpp
> 
> Modified: lld/trunk/COFF/SymbolTable.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=240917&r1=240916&r2=240917&view=diff
> ==============================================================================
> --- lld/trunk/COFF/SymbolTable.cpp (original)
> +++ lld/trunk/COFF/SymbolTable.cpp Sun Jun 28 15:34:09 2015
> @@ -71,15 +71,12 @@ bool SymbolTable::reportRemainingUndefin
>     if (!Undef)
>       continue;
>     StringRef Name = Undef->getName();
> +    // The weak alias may have been resovled, so check for that.

s/resovled/resolved/

>     if (SymbolBody *Alias = Undef->getWeakAlias()) {
> -      Sym->Body = Alias->getReplacement();
> -      if (!isa<Defined>(Sym->Body)) {
> -        // Aliases are yet another symbols pointed by other symbols
> -        // that could also remain undefined.
> -        llvm::errs() << "undefined symbol: " << Name << "\n";
> -        Ret = true;
> +      if (auto *D = dyn_cast<Defined>(Alias->getReplacement())) {
> +        Sym->Body = D;
> +        continue;
>       }
> -      continue;
>     }
>     // If we can resolve a symbol by removing __imp_ prefix, do that.
>     // This odd rule is for compatibility with MSVC linker.
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list