@@ -1156,14 +1156,14 @@ void ObjFile<ELFT>::initializeSymbols(const object::ELFFile<ELFT> &obj) {
11561156 fatal (toString (this ) + " : common symbol '" + sym->getName () +
11571157 " ' has invalid alignment: " + Twine (value));
11581158 hasCommonSyms = true ;
1159- sym->resolve (ctx, CommonSymbol{this , StringRef (), binding, stOther, type ,
1160- value, size});
1159+ sym->resolve (ctx, CommonSymbol{ctx, this , StringRef (), binding, stOther,
1160+ type, value, size});
11611161 continue ;
11621162 }
11631163
11641164 // Handle global defined symbols. Defined::section will be set in postParse.
1165- sym->resolve (ctx, Defined{this , StringRef (), binding, stOther, type, value ,
1166- size, nullptr });
1165+ sym->resolve (ctx, Defined{ctx, this , StringRef (), binding, stOther, type,
1166+ value, size, nullptr });
11671167 }
11681168
11691169 // Undefined symbols (excluding those defined relative to non-prevailing
@@ -1219,7 +1219,7 @@ void ObjFile<ELFT>::initSectionsAndLocalSyms(bool ignoreComdats) {
12191219 new (symbols[i]) Undefined (this , name, STB_LOCAL, eSym.st_other , type,
12201220 /* discardedSecIdx=*/ secIdx);
12211221 else
1222- new (symbols[i]) Defined (this , name, STB_LOCAL, eSym.st_other , type,
1222+ new (symbols[i]) Defined (ctx, this , name, STB_LOCAL, eSym.st_other , type,
12231223 eSym.st_value , eSym.st_size , sec);
12241224 symbols[i]->partition = 1 ;
12251225 symbols[i]->isUsedInRegularObj = true ;
@@ -1765,11 +1765,12 @@ static void createBitcodeSymbol(Ctx &ctx, Symbol *&sym,
17651765 }
17661766
17671767 if (objSym.isCommon ()) {
1768- sym->resolve (ctx, CommonSymbol{&f, StringRef (), binding, visibility,
1768+ sym->resolve (ctx, CommonSymbol{ctx, &f, StringRef (), binding, visibility,
17691769 STT_OBJECT, objSym.getCommonAlignment (),
17701770 objSym.getCommonSize ()});
17711771 } else {
1772- Defined newSym (&f, StringRef (), binding, visibility, type, 0 , 0 , nullptr );
1772+ Defined newSym (ctx, &f, StringRef (), binding, visibility, type, 0 , 0 ,
1773+ nullptr );
17731774 if (objSym.canBeOmittedFromSymbolTable ())
17741775 newSym.exportDynamic = false ;
17751776 sym->resolve (ctx, newSym);
@@ -1849,14 +1850,14 @@ void BinaryFile::parse() {
18491850
18501851 llvm::StringSaver &saver = lld::saver ();
18511852
1852- ctx.symtab ->addAndCheckDuplicate (ctx, Defined{this , saver.save (s + " _start" ),
1853- STB_GLOBAL, STV_DEFAULT,
1854- STT_OBJECT, 0 , 0 , section});
18551853 ctx.symtab ->addAndCheckDuplicate (
1856- ctx, Defined{this , saver.save (s + " _end" ), STB_GLOBAL, STV_DEFAULT,
1854+ ctx, Defined{ctx, this , saver.save (s + " _start" ), STB_GLOBAL, STV_DEFAULT,
1855+ STT_OBJECT, 0 , 0 , section});
1856+ ctx.symtab ->addAndCheckDuplicate (
1857+ ctx, Defined{ctx, this , saver.save (s + " _end" ), STB_GLOBAL, STV_DEFAULT,
18571858 STT_OBJECT, data.size (), 0 , section});
18581859 ctx.symtab ->addAndCheckDuplicate (
1859- ctx, Defined{this , saver.save (s + " _size" ), STB_GLOBAL, STV_DEFAULT,
1860+ ctx, Defined{ctx, this , saver.save (s + " _size" ), STB_GLOBAL, STV_DEFAULT,
18601861 STT_OBJECT, data.size (), 0 , nullptr });
18611862}
18621863
0 commit comments