[PATCH] D89921: [LLD] [COFF] Align all debug directories
Petr Penzin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 19:16:55 PDT 2020
penzn created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
penzn requested review of this revision.
Match MSVC linker output - align all debug directories on four bytes, while removing debug directory alignment. This would have the same effect on CETCOMPAT support as the change in https://reviews.llvm.org/D89919.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89921
Files:
lld/COFF/Writer.cpp
Index: lld/COFF/Writer.cpp
===================================================================
--- lld/COFF/Writer.cpp
+++ lld/COFF/Writer.cpp
@@ -949,7 +949,6 @@
OutputSection *debugInfoSec = config->mingw ? buildidSec : rdataSec;
if (config->debug || config->repro || config->cetCompat) {
debugDirectory = make<DebugDirectoryChunk>(debugRecords, config->repro);
- debugDirectory->setAlignment(4);
debugInfoSec->addChunk(debugDirectory);
}
@@ -971,8 +970,12 @@
}
if (debugRecords.size() > 0) {
- for (std::pair<COFF::DebugType, Chunk *> r : debugRecords)
+ for (std::pair<COFF::DebugType, Chunk *> r : debugRecords) {
+ // Ensure that every debug directory is aligned on 4 bytes
+ if (r.second->getAlignment() < 4)
+ r.second->setAlignment(4);
debugInfoSec->addChunk(r.second);
+ }
}
// Create SEH table. x86-only.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89921.299841.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201022/1068dbe4/attachment.bin>
More information about the llvm-commits
mailing list