[PATCH] D139764: [COFF] Respect weak externals for mangled symbol searching

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 11 13:52:23 PST 2022


smeenai added inline comments.


================
Comment at: lld/COFF/SymbolTable.cpp:817
+      // the weakAlias member variable. This matches link.exe's behavior.
+      if (Symbol *weakAlias = u->getWeakAlias())
+        return weakAlias;
----------------
mstorsjo wrote:
> What this symbol is non-null but is `Undefined` (with itself possibly might be a weak symbol)? Do we need to make this a loop which inspects that aspect? Or is it not relevant for the usecases of `findMangle` where it is enough to see that we apparently did hit a real symbol and don’t need to check for prefixes?
`getWeakAlias` does that loop: https://github.com/llvm/llvm-project/blob/bbcffb08f0fdc0be8c8cba48410f9cb556ea661d/lld/COFF/Symbols.cpp#L123-L129


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139764/new/

https://reviews.llvm.org/D139764



More information about the llvm-commits mailing list