[PATCH] D96473: [WebAssembly] Fix assert in lookup of section symbols
Wouter van Oortmerssen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 11:48:41 PST 2021
aardappel updated this revision to Diff 324715.
aardappel marked an inline comment as done.
aardappel added a comment.
Added bug todo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96473/new/
https://reviews.llvm.org/D96473
Files:
llvm/lib/MC/MCContext.cpp
llvm/test/MC/WebAssembly/section-symbol.s
Index: llvm/test/MC/WebAssembly/section-symbol.s
===================================================================
--- /dev/null
+++ llvm/test/MC/WebAssembly/section-symbol.s
@@ -0,0 +1,16 @@
+# RUN: llvm-mc -triple=wasm32 < %s | FileCheck %s
+
+# check that we can refer to section symbols of other sections.
+# getWasmSection currently forces the section symbol to have a suffix.
+
+# TODO: fix the 0-suffix: https://bugs.llvm.org/show_bug.cgi?id=49252
+
+ .section .debug_abbrev,"",@
+ .int8 1
+ .section .debug_info,"",@
+ .int32 .debug_abbrev0
+
+# CHECK: .section .debug_abbrev,"",@
+# CHECK-NEXT: .int8 1
+# CHECK-NEXT: .section .debug_info,"",@
+# CHECK-NEXT: .int32 .debug_abbrev0
Index: llvm/lib/MC/MCContext.cpp
===================================================================
--- llvm/lib/MC/MCContext.cpp
+++ llvm/lib/MC/MCContext.cpp
@@ -652,6 +652,7 @@
StringRef CachedName = Entry.first.SectionName;
MCSymbol *Begin = createSymbol(CachedName, true, false);
+ Symbols[Begin->getName()] = Begin;
cast<MCSymbolWasm>(Begin)->setType(wasm::WASM_SYMBOL_TYPE_SECTION);
MCSectionWasm *Result = new (WasmAllocator.Allocate())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96473.324715.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210218/88c63e96/attachment.bin>
More information about the llvm-commits
mailing list