From b2b019f727728464c810fcd1eeee515cea5fc611 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 3 Oct 2017 11:20:28 +0000 Subject: [WebAssembly] MC: Support for init_array and fini_array Differential Revision: https://reviews.llvm.org/D37757 llvm-svn: 314783 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 0149c82a00e8..f1fbc7f97000 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); } -- cgit v1.2.3