[PATCH] D104529: [LLD] [COFF] Avoid doing repeated fuzzy symbol lookup for each iteration. NFC.
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 22 13:06:45 PDT 2021
mstorsjo added inline comments.
================
Comment at: lld/COFF/Driver.cpp:564
unmangled->weakAlias = symtab->addUndefined(mangled->getName());
return mangled->getName();
}
----------------
rnk wrote:
> mstorsjo wrote:
> > rnk wrote:
> > > I think I see the issue: suppose there are two rounds of symbol resolution. This function will be called twice, and on the second call, it returns a different result to the caller. The result of this function is used to populate Export.symbolName, which is used to produce an import library, and that's what changes.
> > Right, if there are two possible matches for the fuzzy search, one to be more preferred than the other one, but the less preferred one is resolved first, then it would indeed break.
> >
> > I suppose that can be considered intentional behaviour, so yeah, this should indeed be left reverted then. A testcase showing off this mechanism would be nice to have though.
> Yep, I added a test in rG5bcbc7ee526cea839f, it just took a bit of effort to set up an archive to get a second iteration of symbol resolution.
Awesome, thanks! Yeah I can imagine that requires a bit of fiddling.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104529/new/
https://reviews.llvm.org/D104529
More information about the llvm-commits
mailing list