summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp9
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp6
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index ce9c3529f4f..e2890172881 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -870,10 +870,13 @@ void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) {
DwarfLineStrSection =
Ctx->getWasmSection(".debug_line_str", SectionKind::getMetadata());
DwarfStrSection = Ctx->getWasmSection(".debug_str", SectionKind::getMetadata(), ".debug_str");
- DwarfLocSection = Ctx->getWasmSection(".debug_loc", SectionKind::getMetadata());
- DwarfAbbrevSection = Ctx->getWasmSection(".debug_abbrev", SectionKind::getMetadata(), ".section_abbrev");
+ DwarfLocSection = Ctx->getWasmSection(
+ ".debug_loc", SectionKind::getMetadata(), ".debug_loc");
+ DwarfAbbrevSection = Ctx->getWasmSection(
+ ".debug_abbrev", SectionKind::getMetadata(), ".debug_abbrev");
DwarfARangesSection = Ctx->getWasmSection(".debug_aranges", SectionKind::getMetadata());
- DwarfRangesSection = Ctx->getWasmSection(".debug_ranges", SectionKind::getMetadata(), ".debug_range");
+ DwarfRangesSection = Ctx->getWasmSection(
+ ".debug_ranges", SectionKind::getMetadata(), ".debug_ranges");
DwarfMacinfoSection = Ctx->getWasmSection(".debug_macinfo", SectionKind::getMetadata(), ".debug_macinfo");
DwarfAddrSection = Ctx->getWasmSection(".debug_addr", SectionKind::getMetadata());
DwarfCUIndexSection = Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata());
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 407907c0f68..5ac5f6c2278 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -1207,8 +1207,12 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
Name = Name.substr(strlen(".custom_section."));
MCSymbol* Begin = Sec.getBeginSymbol();
- if (Begin)
+ if (Begin) {
WasmIndices[cast<MCSymbolWasm>(Begin)] = CustomSections.size();
+ if (Name != Begin->getName())
+ report_fatal_error("section name and begin symbol should match: " +
+ Twine(Name));
+ }
CustomSections.emplace_back(Name, &Section);
}
}
OpenPOWER on IntegriCloud