Skip to content

Commit a09d00f

Browse files
authored
[LLD][COFF] Handle undefined weak symbols
1 parent 438ba3f commit a09d00f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lld/COFF/InputFiles.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,8 @@ void BitcodeFile::parse() {
10381038
fakeSC = &ctx.ltoDataSectionChunk.chunk;
10391039
if (objSym.isUndefined()) {
10401040
sym = ctx.symtab.addUndefined(symName, this, false);
1041+
if (objSym.isWeak())
1042+
sym->deferUndefined = true;
10411043
} else if (objSym.isCommon()) {
10421044
sym = ctx.symtab.addCommon(this, symName, objSym.getCommonSize());
10431045
} else if (objSym.isWeak() && objSym.isIndirect()) {

0 commit comments

Comments
 (0)