@@ -487,7 +487,7 @@ void LinkerDriver::parseDirectives(InputFile *file) {
487487 for (auto *arg : directives.args ) {
488488 switch (arg->getOption ().getID ()) {
489489 case OPT_aligncomm:
490- parseAligncomm (arg->getValue ());
490+ file-> symtab . parseAligncomm (arg->getValue ());
491491 break ;
492492 case OPT_alternatename:
493493 file->symtab .parseAlternateName (arg->getValue ());
@@ -2050,7 +2050,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
20502050
20512051 // Handle /aligncomm
20522052 for (auto *arg : args.filtered (OPT_aligncomm))
2053- parseAligncomm (arg->getValue ());
2053+ mainSymtab. parseAligncomm (arg->getValue ());
20542054
20552055 // Handle /manifestdependency.
20562056 for (auto *arg : args.filtered (OPT_manifestdependency))
@@ -2700,25 +2700,27 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
27002700 writeDefFile (ctx, arg->getValue (), mainSymtab.exports );
27012701
27022702 // Set extra alignment for .comm symbols
2703- for (auto pair : config->alignComm ) {
2704- StringRef name = pair.first ;
2705- uint32_t alignment = pair.second ;
2703+ ctx.forEachSymtab ([&](SymbolTable &symtab) {
2704+ for (auto pair : symtab.alignComm ) {
2705+ StringRef name = pair.first ;
2706+ uint32_t alignment = pair.second ;
27062707
2707- Symbol *sym = ctx. symtab .find (name);
2708- if (!sym) {
2709- Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2710- continue ;
2711- }
2708+ Symbol *sym = symtab.find (name);
2709+ if (!sym) {
2710+ Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2711+ continue ;
2712+ }
27122713
2713- // If the symbol isn't common, it must have been replaced with a regular
2714- // symbol, which will carry its own alignment.
2715- auto *dc = dyn_cast<DefinedCommon>(sym);
2716- if (!dc)
2717- continue ;
2714+ // If the symbol isn't common, it must have been replaced with a regular
2715+ // symbol, which will carry its own alignment.
2716+ auto *dc = dyn_cast<DefinedCommon>(sym);
2717+ if (!dc)
2718+ continue ;
27182719
2719- CommonChunk *c = dc->getChunk ();
2720- c->setAlignment (std::max (c->getAlignment (), alignment));
2721- }
2720+ CommonChunk *c = dc->getChunk ();
2721+ c->setAlignment (std::max (c->getAlignment (), alignment));
2722+ }
2723+ });
27222724
27232725 // Windows specific -- Create an embedded or side-by-side manifest.
27242726 // /manifestdependency: enables /manifest unless an explicit /manifest:no is
0 commit comments