diff options
| author | Sam Clegg <sbc@chromium.org> | 2017-10-03 11:20:28 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2017-10-03 11:20:28 +0000 |
| commit | b2b019f727728464c810fcd1eeee515cea5fc611 (patch) | |
| tree | 2d4b8d8c9208ba625e8b3bca7d99b4dba24c58aa /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
| parent | d932b2d7631aea7a4788e49c8066759d7ac678e6 (diff) | |
[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.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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); } |
