summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-01-23 18:30:04 +0000
committerSam Clegg <sbc@chromium.org>2018-01-23 18:30:04 +0000
commit68b425f0bf81240138206bcc1114cab9c968ce45 (patch)
treed16eb74b92c8e4d2b0aa8c884235292f816bf29c /llvm/lib/MC/WasmObjectWriter.cpp
parentae3e934bd688f572f70493c3c432bad655b3f6ab (diff)
downloadbcm5719-llvm-68b425f0bf81240138206bcc1114cab9c968ce45.tar.gz
bcm5719-llvm-68b425f0bf81240138206bcc1114cab9c968ce45.zip
[WebAssembly] Remove "name" section of object wasm object files
LLD is unaffected, no changes needed there. LLD continues to write out a name section, using the symbol names. Fixes: https://github.com/WebAssembly/tool-conventions/issues/37 Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42425 llvm-svn: 323234
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index f70d57f5d26..f5d67d2bec0 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -291,8 +291,6 @@ private:
void writeCodeSection(const MCAssembler &Asm, const MCAsmLayout &Layout,
ArrayRef<WasmFunction> Functions);
void writeDataSection(ArrayRef<WasmDataSegment> Segments);
- void writeNameSection(ArrayRef<WasmFunction> Functions,
- ArrayRef<WasmImport> Imports);
void writeCodeRelocSection();
void writeDataRelocSection();
void writeLinkingMetaDataSection(
@@ -851,36 +849,6 @@ void WasmObjectWriter::writeDataSection(ArrayRef<WasmDataSegment> Segments) {
endSection(Section);
}
-void WasmObjectWriter::writeNameSection(ArrayRef<WasmFunction> Functions,
- ArrayRef<WasmImport> Imports) {
- uint32_t TotalFunctions = NumFunctionImports + Functions.size();
- if (TotalFunctions == 0)
- return;
-
- SectionBookkeeping Section;
- startSection(Section, wasm::WASM_SEC_CUSTOM, "name");
- SectionBookkeeping SubSection;
- startSection(SubSection, wasm::WASM_NAMES_FUNCTION);
-
- encodeULEB128(TotalFunctions, getStream());
- uint32_t Index = 0;
- for (const WasmImport &Import : Imports) {
- if (Import.Kind == wasm::WASM_EXTERNAL_FUNCTION) {
- encodeULEB128(Index, getStream());
- writeString(Import.FieldName);
- ++Index;
- }
- }
- for (const WasmFunction &Func : Functions) {
- encodeULEB128(Index, getStream());
- writeString(Func.Sym->getName());
- ++Index;
- }
-
- endSection(SubSection);
- endSection(Section);
-}
-
void WasmObjectWriter::writeCodeRelocSection() {
// See: https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md
// for descriptions of the reloc sections.
@@ -1405,7 +1373,6 @@ void WasmObjectWriter::writeObject(MCAssembler &Asm,
writeElemSection(TableElems);
writeCodeSection(Asm, Layout, Functions);
writeDataSection(DataSegments);
- writeNameSection(Functions, Imports);
writeCodeRelocSection();
writeDataRelocSection();
writeLinkingMetaDataSection(DataSegments, DataSize, SymbolFlags,
OpenPOWER on IntegriCloud