aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-10-03 11:20:28 +0000
committerSam Clegg <sbc@chromium.org>2017-10-03 11:20:28 +0000
commitb2b019f727728464c810fcd1eeee515cea5fc611 (patch)
tree2d4b8d8c9208ba625e8b3bca7d99b4dba24c58aa /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentd932b2d7631aea7a4788e49c8066759d7ac678e6 (diff)
downloadllvm-b2b019f727728464c810fcd1eeee515cea5fc611.zip
llvm-b2b019f727728464c810fcd1eeee515cea5fc611.tar.gz
llvm-b2b019f727728464c810fcd1eeee515cea5fc611.tar.bz2
[WebAssembly] MC: Support for init_array and fini_array
Differential Revision: https://reviews.llvm.org/D37757 llvm-svn: 314783
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0149c82..f1fbc7f 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1328,7 +1328,9 @@ const MCExpr *TargetLoweringObjectFileWasm::lowerRelativeReference(
MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext());
}
-void
-TargetLoweringObjectFileWasm::InitializeWasm() {
- // TODO: Initialize StaticCtorSection and StaticDtorSection.
+void TargetLoweringObjectFileWasm::InitializeWasm() {
+ StaticCtorSection =
+ getContext().getWasmSection(".init_array", wasm::WASM_SEC_DATA);
+ StaticDtorSection =
+ getContext().getWasmSection(".fini_array", wasm::WASM_SEC_DATA);
}