aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-03-30 17:37:01 -0700
committerSam Clegg <sbc@chromium.org>2020-04-14 13:24:18 -0700
commit3ea1c62cbae2fa89cd49a47879bd63bcfdf3fb9b (patch)
treef34a93b135c355bb607070b4d0df8a7d3002ea13 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentec442f09968f7597710b29fac6613843ca7f4961 (diff)
downloadllvm-3ea1c62cbae2fa89cd49a47879bd63bcfdf3fb9b.zip
llvm-3ea1c62cbae2fa89cd49a47879bd63bcfdf3fb9b.tar.gz
llvm-3ea1c62cbae2fa89cd49a47879bd63bcfdf3fb9b.tar.bz2
[WebAssembly] Emit .llvmcmd and .llvmbc as custom sections
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45362 Differential Revision: https://reviews.llvm.org/D77115
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 1794669..e7750cc 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1755,6 +1755,14 @@ MCSection *TargetLoweringObjectFileWasm::getExplicitSectionGlobal(
StringRef Name = GO->getSection();
+ // Certain data sections we treat as named custom sections rather than
+ // segments within the data section.
+ // This could be avoided if all data segements (the wasm sense) were
+ // represented as thier own sections (in the llvm sense).
+ // TODO(sbc): https://github.com/WebAssembly/tool-conventions/issues/138
+ if (Name == ".llvmcmd" || Name == ".llvmbc")
+ Kind = SectionKind::getMetadata();
+
StringRef Group = "";
if (const Comdat *C = getWasmComdat(GO)) {
Group = C->getName();