diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/MC/MCAsmInfoWasm.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/MC/MCWasmStreamer.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/MC/WasmObjectWriter.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/ObjectYAML/WasmYAML.cpp | 1 |
4 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCAsmInfoWasm.cpp b/llvm/lib/MC/MCAsmInfoWasm.cpp index 65a937b7716..ce6ec7ef211 100644 --- a/llvm/lib/MC/MCAsmInfoWasm.cpp +++ b/llvm/lib/MC/MCAsmInfoWasm.cpp @@ -18,6 +18,7 @@ void MCAsmInfoWasm::anchor() {} MCAsmInfoWasm::MCAsmInfoWasm() { HasIdentDirective = true; + HasNoDeadStrip = true; WeakRefDirective = "\t.weak\t"; PrivateGlobalPrefix = ".L"; PrivateLabelPrefix = ".L"; diff --git a/llvm/lib/MC/MCWasmStreamer.cpp b/llvm/lib/MC/MCWasmStreamer.cpp index 36571fce062..86fa7219785 100644 --- a/llvm/lib/MC/MCWasmStreamer.cpp +++ b/llvm/lib/MC/MCWasmStreamer.cpp @@ -121,6 +121,10 @@ bool MCWasmStreamer::EmitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) { case MCSA_Cold: break; + case MCSA_NoDeadStrip: + Symbol->setExported(); + break; + default: // unrecognized directive llvm_unreachable("unexpected MCSymbolAttr"); diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index b5260bbceae..00d48659890 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -1454,6 +1454,8 @@ uint64_t WasmObjectWriter::writeObject(MCAssembler &Asm, Flags |= wasm::WASM_SYMBOL_BINDING_LOCAL; if (WS.isUndefined()) Flags |= wasm::WASM_SYMBOL_UNDEFINED; + if (WS.isExported()) + Flags |= wasm::WASM_SYMBOL_EXPORTED; wasm::WasmSymbolInfo Info; Info.Name = WS.getName(); diff --git a/llvm/lib/ObjectYAML/WasmYAML.cpp b/llvm/lib/ObjectYAML/WasmYAML.cpp index f2030eb740e..def4d58a101 100644 --- a/llvm/lib/ObjectYAML/WasmYAML.cpp +++ b/llvm/lib/ObjectYAML/WasmYAML.cpp @@ -486,6 +486,7 @@ void ScalarBitSetTraits<WasmYAML::SymbolFlags>::bitset( // BCaseMask(VISIBILITY_MASK, VISIBILITY_DEFAULT); BCaseMask(VISIBILITY_MASK, VISIBILITY_HIDDEN); BCaseMask(UNDEFINED, UNDEFINED); + BCaseMask(EXPORTED, EXPORTED); #undef BCaseMask } |