[lld] [LLD][COFF] Fix handling of weak aliases referencing lazy symbols (PR #112243)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 05:23:49 PDT 2024
================
@@ -112,20 +112,20 @@ DefinedImportThunk::DefinedImportThunk(COFFLinkerContext &ctx, StringRef name,
ImportThunkChunk *chunk)
: Defined(DefinedImportThunkKind, name), wrappedSym(s), data(chunk) {}
-Defined *Undefined::getWeakAlias() {
+Symbol *Undefined::getWeakAlias() {
// A weak alias may be a weak alias to another symbol, so check recursively.
DenseSet<Symbol *> weakChain;
for (Symbol *a = weakAlias; a; a = cast<Undefined>(a)->weakAlias) {
----------------
cjacek wrote:
Yes.
The assumption that a symbol is either `Undefined` or `Defined` is true for some callers, but not all. See the other comment for details.
https://github.com/llvm/llvm-project/pull/112243
More information about the llvm-commits
mailing list