@@ -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))
@@ -2701,25 +2701,27 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
27012701 writeDefFile (ctx, arg->getValue (), mainSymtab.exports );
27022702
27032703 // Set extra alignment for .comm symbols
2704- for (auto pair : config->alignComm ) {
2705- StringRef name = pair.first ;
2706- uint32_t alignment = pair.second ;
2704+ ctx.forEachSymtab ([&](SymbolTable &symtab) {
2705+ for (auto pair : symtab.alignComm ) {
2706+ StringRef name = pair.first ;
2707+ uint32_t alignment = pair.second ;
27072708
2708- Symbol *sym = ctx. symtab .find (name);
2709- if (!sym) {
2710- Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2711- continue ;
2712- }
2709+ Symbol *sym = symtab.find (name);
2710+ if (!sym) {
2711+ Warn (ctx) << " /aligncomm symbol " << name << " not found" ;
2712+ continue ;
2713+ }
27132714
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 ;
2715+ // If the symbol isn't common, it must have been replaced with a regular
2716+ // symbol, which will carry its own alignment.
2717+ auto *dc = dyn_cast<DefinedCommon>(sym);
2718+ if (!dc)
2719+ continue ;
27192720
2720- CommonChunk *c = dc->getChunk ();
2721- c->setAlignment (std::max (c->getAlignment (), alignment));
2722- }
2721+ CommonChunk *c = dc->getChunk ();
2722+ c->setAlignment (std::max (c->getAlignment (), alignment));
2723+ }
2724+ });
27232725
27242726 // Windows specific -- Create an embedded or side-by-side manifest.
27252727 // /manifestdependency: enables /manifest unless an explicit /manifest:no is
0 commit comments