@@ -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 ());
@@ -2056,7 +2056,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
20562056
20572057 // Handle /aligncomm
20582058 for (auto *arg : args.filtered (OPT_aligncomm))
2059- parseAligncomm (arg->getValue ());
2059+ mainSymtab. parseAligncomm (arg->getValue ());
20602060
20612061 // Handle /manifestdependency.
20622062 for (auto *arg : args.filtered (OPT_manifestdependency))
@@ -2705,25 +2705,27 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
27052705 writeDefFile (ctx, arg->getValue (), mainSymtab.exports );
27062706
27072707 // Set extra alignment for .comm symbols
2708- for (auto pair : config->alignComm ) {
2709- StringRef name = pair.first ;
2710- uint32_t alignment = pair.second ;
2708+ ctx.forEachSymtab ([&](SymbolTable &symtab) {
2709+ for (auto pair : symtab.alignComm ) {
2710+ StringRef name = pair.first ;
2711+ uint32_t alignment = pair.second ;
27112712
2712- Symbol *sym = ctx. symtab .find (name);
2713- if (!sym) {
2714- Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2715- continue ;
2716- }
2713+ Symbol *sym = symtab.find (name);
2714+ if (!sym) {
2715+ Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2716+ continue ;
2717+ }
27172718
2718- // If the symbol isn't common, it must have been replaced with a regular
2719- // symbol, which will carry its own alignment.
2720- auto *dc = dyn_cast<DefinedCommon>(sym);
2721- if (!dc)
2722- continue ;
2719+ // If the symbol isn't common, it must have been replaced with a regular
2720+ // symbol, which will carry its own alignment.
2721+ auto *dc = dyn_cast<DefinedCommon>(sym);
2722+ if (!dc)
2723+ continue ;
27232724
2724- CommonChunk *c = dc->getChunk ();
2725- c->setAlignment (std::max (c->getAlignment (), alignment));
2726- }
2725+ CommonChunk *c = dc->getChunk ();
2726+ c->setAlignment (std::max (c->getAlignment (), alignment));
2727+ }
2728+ });
27272729
27282730 // Windows specific -- Create an embedded or side-by-side manifest.
27292731 // /manifestdependency: enables /manifest unless an explicit /manifest:no is
0 commit comments