diff options
author | Sam Clegg <sbc@chromium.org> | 2017-09-15 20:54:59 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2017-09-15 20:54:59 +0000 |
commit | 759631c77bb8f7a8b76e1c1a7cd78532a5d809d2 (patch) | |
tree | 3fde45dce4c989ba99c9976a82bb5d420daa1c8e /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | dee018c51f377f46b8b2fb8507f19c51e3747fcc (diff) | |
download | bcm5719-llvm-759631c77bb8f7a8b76e1c1a7cd78532a5d809d2.tar.gz bcm5719-llvm-759631c77bb8f7a8b76e1c1a7cd78532a5d809d2.zip |
[WebAssembly] MC: Create wasm data segments based on MCSections
This means that we can honor -fdata-sections rather than
always creating a segment for each symbol.
It also allows for a followup change to add .init_array and friends.
Differential Revision: https://reviews.llvm.org/D37876
llvm-svn: 313395
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index ba376227767..c6c5cb31690 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -820,24 +820,24 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) { void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) { // TODO: Set the section types and flags. - TextSection = Ctx->getWasmSection(".text", 0); - DataSection = Ctx->getWasmSection(".data", 0); + TextSection = Ctx->getWasmSection(".text", wasm::WASM_SEC_CODE); + DataSection = Ctx->getWasmSection(".data", wasm::WASM_SEC_DATA); // TODO: Set the section types and flags. - DwarfLineSection = Ctx->getWasmSection(".debug_line", 0); - DwarfStrSection = Ctx->getWasmSection(".debug_str", 0); - DwarfLocSection = Ctx->getWasmSection(".debug_loc", 0); - DwarfAbbrevSection = Ctx->getWasmSection(".debug_abbrev", 0, "section_abbrev"); - DwarfARangesSection = Ctx->getWasmSection(".debug_aranges", 0); - DwarfRangesSection = Ctx->getWasmSection(".debug_ranges", 0, "debug_range"); - DwarfMacinfoSection = Ctx->getWasmSection(".debug_macinfo", 0, "debug_macinfo"); - DwarfAddrSection = Ctx->getWasmSection(".debug_addr", 0); - DwarfCUIndexSection = Ctx->getWasmSection(".debug_cu_index", 0); - DwarfTUIndexSection = Ctx->getWasmSection(".debug_tu_index", 0); - DwarfInfoSection = Ctx->getWasmSection(".debug_info", 0, "section_info"); - DwarfFrameSection = Ctx->getWasmSection(".debug_frame", 0); - DwarfPubNamesSection = Ctx->getWasmSection(".debug_pubnames", 0); - DwarfPubTypesSection = Ctx->getWasmSection(".debug_pubtypes", 0); + DwarfLineSection = Ctx->getWasmSection(".debug_line", wasm::WASM_SEC_DATA); + DwarfStrSection = Ctx->getWasmSection(".debug_str", wasm::WASM_SEC_DATA); + DwarfLocSection = Ctx->getWasmSection(".debug_loc", wasm::WASM_SEC_DATA); + DwarfAbbrevSection = Ctx->getWasmSection(".debug_abbrev", wasm::WASM_SEC_DATA, "section_abbrev"); + DwarfARangesSection = Ctx->getWasmSection(".debug_aranges", wasm::WASM_SEC_DATA); + DwarfRangesSection = Ctx->getWasmSection(".debug_ranges", wasm::WASM_SEC_DATA, "debug_range"); + DwarfMacinfoSection = Ctx->getWasmSection(".debug_macinfo", wasm::WASM_SEC_DATA, "debug_macinfo"); + DwarfAddrSection = Ctx->getWasmSection(".debug_addr", wasm::WASM_SEC_DATA); + DwarfCUIndexSection = Ctx->getWasmSection(".debug_cu_index", wasm::WASM_SEC_DATA); + DwarfTUIndexSection = Ctx->getWasmSection(".debug_tu_index", wasm::WASM_SEC_DATA); + DwarfInfoSection = Ctx->getWasmSection(".debug_info", wasm::WASM_SEC_DATA, "section_info"); + DwarfFrameSection = Ctx->getWasmSection(".debug_frame", wasm::WASM_SEC_DATA); + DwarfPubNamesSection = Ctx->getWasmSection(".debug_pubnames", wasm::WASM_SEC_DATA); + DwarfPubTypesSection = Ctx->getWasmSection(".debug_pubtypes", wasm::WASM_SEC_DATA); // TODO: Define more sections. } |