[PATCH] D89921: [LLD] [COFF] Align all debug directories

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 11:44:29 PDT 2020


rnk added inline comments.


================
Comment at: lld/COFF/Writer.cpp:951
   if (config->debug || config->repro || config->cetCompat) {
     debugDirectory = make<DebugDirectoryChunk>(debugRecords, config->repro);
     debugInfoSec->addChunk(debugDirectory);
----------------
penzn wrote:
> penzn wrote:
> > rnk wrote:
> > > Can we make the DebugDirectoryChunk set the default alignment to 4 instead? I believe other chunks do that as well.
> > Let me try that.
> On the other hand, do you mean NonSectionChunk? DebugDirectoryChunk and the debug directory sections (CV, ExtendedDllChars) all derive from it. Also, the alignment here was added in D70606.
Sorry, I meant the constructor of DebugDirectoryChunk should set the alignment to 4. IMO that's simpler than setting it in the loop below, and ensures all debug directories are 4 byte aligned.

Other chunks set their default alignment like this:
https://github.com/llvm/llvm-project/blob/master/lld/COFF/Chunks.h#L491


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89921/new/

https://reviews.llvm.org/D89921



More information about the llvm-commits mailing list