File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -245,14 +245,23 @@ void SymbolTable::reportUndefinedSymbol(const UndefinedDiag &undefDiag) {
245245}
246246
247247void SymbolTable::loadMinGWSymbols () {
248+ std::vector<Symbol *> undefs;
248249 for (auto &i : symMap) {
249250 Symbol *sym = i.second ;
250251 auto *undef = dyn_cast<Undefined>(sym);
251252 if (!undef)
252253 continue ;
253254 if (undef->getWeakAlias ())
254255 continue ;
256+ undefs.push_back (sym);
257+ }
255258
259+ for (auto sym : undefs) {
260+ auto *undef = dyn_cast<Undefined>(sym);
261+ if (!undef)
262+ continue ;
263+ if (undef->getWeakAlias ())
264+ continue ;
256265 StringRef name = undef->getName ();
257266
258267 if (machine == I386 && ctx.config .stdcallFixup ) {
Original file line number Diff line number Diff line change 1+ // REQUIRES: x86
2+ // RUN: split-file %s %t.dir && cd %t.dir
3+
4+ // RUN: llvm-mc -filetype=obj -triple=i686-windows test.s -o test.obj
5+ // RUN: llvm-mc -filetype=obj -triple=i686-windows lib.s -o lib.obj
6+ // RUN: lld-link -dll -noentry -out:out.dll test.obj -start-lib lib.obj -end-lib -lldmingw
7+
8+ #--- test.s
9+ .section .test ,"dr"
10+ .rva _func@4
11+
12+ #--- lib.s
13+ .globl _func
14+ _func:
15+ ret
16+
17+ // These symbols don't have lazy entries in the symbol table initially,
18+ // but will be added during resolution from _func@4 to _func. Make sure this
19+ // scenario is handled properly.
20+ .weak_anti_dep _func@5
21+ .set _func@5 ,_func
22+
23+ .weak_anti_dep _func@3
24+ .set _func@3 ,_func
You can’t perform that action at this time.
0 commit comments