[PATCH] D146640: [BOLT] Emit binary section output contents if Set

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 09:21:11 PDT 2023

yota9 created this revision.
yota9 added reviewers: maksfb, rafauler, Amir.
Herald added subscribers: treapster, ayermolo.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In golang pass we're creating 2 new sections setting output contents for
them. Emit output contents if it was set during bolt work.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

  rG LLVM Github Monorepo



Index: bolt/lib/Core/BinarySection.cpp
--- bolt/lib/Core/BinarySection.cpp
+++ bolt/lib/Core/BinarySection.cpp
@@ -69,7 +69,8 @@
 void BinarySection::emitAsData(MCStreamer &Streamer,
                                const Twine &SectionName) const {
-  StringRef SectionContents = getContents();
+  StringRef SectionContents =
+      OutputContents.data() ? getOutputContents() : getContents();
   MCSectionELF *ELFSection =
       BC.Ctx->getELFSection(SectionName, getELFType(), getELFFlags());

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146640.507390.patch
Type: text/x-patch
Size: 568 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230322/545b843a/attachment.bin>

More information about the llvm-commits mailing list