diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-11-02 22:04:33 +0000 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-11-02 22:04:33 +0000 |
commit | de28b5d17fba2af6453fa04431a68c4f89cc1906 (patch) | |
tree | cb523c26ff963f03a6fc24476b5281d1802f2473 /llvm/lib/MC | |
parent | 53793e4d8e25aefb5c31ce3266afadf220e2d040 (diff) | |
download | bcm5719-llvm-de28b5d17fba2af6453fa04431a68c4f89cc1906.tar.gz bcm5719-llvm-de28b5d17fba2af6453fa04431a68c4f89cc1906.zip |
[WebAssembly] Parsing missing directives to produce valid .o
Summary:
The assembler was able to assemble and then dump back to .s, but
was failing to parse certain directives necessary for valid .o
output:
- .type directives are now recognized to distinguish function symbols
and others.
- .size is now parsed to provide function size.
- .globaltype (introduced in https://reviews.llvm.org/D54012) is now
recognized to ensure symbols like __stack_pointer have a proper type
set for both .s and .o output.
Also added tests for the above.
Reviewers: sbc100, dschuff
Subscribers: jgravelle-google, aheejin, dexonsmith, kristina, llvm-commits, sunfish
Differential Revision: https://reviews.llvm.org/D53842
llvm-svn: 346047
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCWasmStreamer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCWasmStreamer.cpp b/llvm/lib/MC/MCWasmStreamer.cpp index 7321a30dd94..d2a152058b9 100644 --- a/llvm/lib/MC/MCWasmStreamer.cpp +++ b/llvm/lib/MC/MCWasmStreamer.cpp @@ -61,7 +61,7 @@ void MCWasmStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { void MCWasmStreamer::ChangeSection(MCSection *Section, const MCExpr *Subsection) { MCAssembler &Asm = getAssembler(); - auto *SectionWasm = static_cast<const MCSectionWasm *>(Section); + auto *SectionWasm = cast<MCSectionWasm>(Section); const MCSymbol *Grp = SectionWasm->getGroup(); if (Grp) Asm.registerSymbol(*Grp); |