[PATCH] D116474: [lld] [coff] Fix the characteristics of some sections like ".voltbl".
gmh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 1 05:03:42 PST 2022
gmh5225 created this revision.
gmh5225 added reviewers: aganea, mstorsjo, rnk, lld.
gmh5225 added a project: lld.
gmh5225 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Fix the characteristics of some sections like ".voltbl". Or the program will be crash sometimes.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116474
Files:
lld/COFF/Writer.cpp
Index: lld/COFF/Writer.cpp
===================================================================
--- lld/COFF/Writer.cpp
+++ lld/COFF/Writer.cpp
@@ -1500,6 +1500,12 @@
// Write section table
for (OutputSection *sec : ctx.outputSections) {
+ // Fix the characteristics of some sections like ".voltbl".
+ // Or the program will be crash sometimes.
+ if (sec->header.Characteristics == 0) {
+ sec->header.Characteristics |= IMAGE_SCN_CNT_INITIALIZED_DATA |
+ IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE;
+ }
sec->writeHeaderTo(buf);
buf += sizeof(coff_section);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116474.396854.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220101/6d2d720d/attachment.bin>
More information about the llvm-commits
mailing list