Index: include/llvm/BinaryFormat/Wasm.h =================================================================== --- include/llvm/BinaryFormat/Wasm.h +++ include/llvm/BinaryFormat/Wasm.h @@ -158,7 +158,6 @@ }; struct WasmLinkingData { - uint32_t DataSize; std::vector InitFunctions; std::vector SymbolTable; }; @@ -227,7 +226,6 @@ // Kind codes used in the custom "linking" section enum : unsigned { - WASM_DATA_SIZE = 0x3, WASM_SEGMENT_INFO = 0x5, WASM_INIT_FUNCS = 0x6, WASM_COMDAT_INFO = 0x7, Index: include/llvm/ObjectYAML/WasmYAML.h =================================================================== --- include/llvm/ObjectYAML/WasmYAML.h +++ include/llvm/ObjectYAML/WasmYAML.h @@ -195,7 +195,6 @@ return C && C->Name == "linking"; } - uint32_t DataSize; std::vector SymbolTable; std::vector SegmentInfos; std::vector InitFunctions; Index: lib/MC/WasmObjectWriter.cpp =================================================================== --- lib/MC/WasmObjectWriter.cpp +++ lib/MC/WasmObjectWriter.cpp @@ -274,7 +274,7 @@ void writeCodeRelocSection(); void writeDataRelocSection(); void writeLinkingMetaDataSection( - uint32_t DataSize, ArrayRef SymbolInfos, + ArrayRef SymbolInfos, ArrayRef> InitFuncs, const std::map> &Comdats); @@ -862,7 +862,7 @@ } void WasmObjectWriter::writeLinkingMetaDataSection( - uint32_t DataSize, ArrayRef SymbolInfos, + ArrayRef SymbolInfos, ArrayRef> InitFuncs, const std::map> &Comdats) { SectionBookkeeping Section; @@ -897,12 +897,6 @@ endSection(SubSection); } - if (DataSize > 0) { - startSection(SubSection, wasm::WASM_DATA_SIZE); - encodeULEB128(DataSize, getStream()); - endSection(SubSection); - } - if (DataSegments.size()) { startSection(SubSection, wasm::WASM_SEGMENT_INFO); encodeULEB128(DataSegments.size(), getStream()); @@ -1319,7 +1313,7 @@ writeDataSection(); writeCodeRelocSection(); writeDataRelocSection(); - writeLinkingMetaDataSection(DataSize, SymbolInfos, InitFuncs, Comdats); + writeLinkingMetaDataSection(SymbolInfos, InitFuncs, Comdats); // TODO: Translate the .comment section to the output. // TODO: Translate debug sections to the output. Index: lib/Object/WasmObjectFile.cpp =================================================================== --- lib/Object/WasmObjectFile.cpp +++ lib/Object/WasmObjectFile.cpp @@ -197,8 +197,6 @@ WasmObjectFile::WasmObjectFile(MemoryBufferRef Buffer, Error &Err) : ObjectFile(Binary::ID_Wasm, Buffer) { - LinkingData.DataSize = 0; - ErrorAsOutParameter ErrAsOutParam(&Err); Header.Magic = getData().substr(0, 4); if (Header.Magic != StringRef("\0asm", 4)) { @@ -334,9 +332,6 @@ if (Error Err = parseLinkingSectionSymtab(Ptr, SubSectionEnd)) return Err; break; - case wasm::WASM_DATA_SIZE: - LinkingData.DataSize = readVaruint32(Ptr); - break; case wasm::WASM_SEGMENT_INFO: { uint32_t Count = readVaruint32(Ptr); if (Count > DataSegments.size()) Index: lib/ObjectYAML/WasmYAML.cpp =================================================================== --- lib/ObjectYAML/WasmYAML.cpp +++ lib/ObjectYAML/WasmYAML.cpp @@ -57,7 +57,6 @@ static void sectionMapping(IO &IO, WasmYAML::LinkingSection &Section) { commonSectionMapping(IO, Section); IO.mapRequired("Name", Section.Name); - IO.mapRequired("DataSize", Section.DataSize); IO.mapOptional("SymbolTable", Section.SymbolTable); IO.mapOptional("SegmentInfo", Section.SegmentInfos); IO.mapOptional("InitFunctions", Section.InitFunctions); Index: test/MC/WebAssembly/array-fill.ll =================================================================== --- test/MC/WebAssembly/array-fill.ll +++ test/MC/WebAssembly/array-fill.ll @@ -14,7 +14,6 @@ ; CHECK: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 2 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: DATA Index: test/MC/WebAssembly/bss.ll =================================================================== --- test/MC/WebAssembly/bss.ll +++ test/MC/WebAssembly/bss.ll @@ -37,7 +37,6 @@ ; CHECK-NEXT: Content: '' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 8 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: DATA Index: test/MC/WebAssembly/comdat.ll =================================================================== --- test/MC/WebAssembly/comdat.ll +++ test/MC/WebAssembly/comdat.ll @@ -75,7 +75,6 @@ ; CHECK-NEXT: Content: '616263' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 3 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/MC/WebAssembly/explicit-sections.ll =================================================================== --- test/MC/WebAssembly/explicit-sections.ll +++ test/MC/WebAssembly/explicit-sections.ll @@ -32,7 +32,6 @@ ; CHECK-NEXT: Content: '08000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 28 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: DATA Index: test/MC/WebAssembly/global-ctor-dtor.ll =================================================================== --- test/MC/WebAssembly/global-ctor-dtor.ll +++ test/MC/WebAssembly/global-ctor-dtor.ll @@ -110,7 +110,6 @@ ; CHECK-NEXT: Content: '01040000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 4 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/MC/WebAssembly/unnamed-data.ll =================================================================== --- test/MC/WebAssembly/unnamed-data.ll +++ test/MC/WebAssembly/unnamed-data.ll @@ -44,7 +44,6 @@ ; CHECK-NEXT: Content: '06000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 28 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: DATA Index: test/MC/WebAssembly/visibility.ll =================================================================== --- test/MC/WebAssembly/visibility.ll +++ test/MC/WebAssembly/visibility.ll @@ -16,7 +16,6 @@ ; CHECK: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 0 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/MC/WebAssembly/weak-alias.ll =================================================================== --- test/MC/WebAssembly/weak-alias.ll +++ test/MC/WebAssembly/weak-alias.ll @@ -138,7 +138,6 @@ ; CHECK-NEXT: Content: '01000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 20 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/MC/WebAssembly/weak.ll =================================================================== --- test/MC/WebAssembly/weak.ll +++ test/MC/WebAssembly/weak.ll @@ -22,7 +22,6 @@ ; CHECK: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 0 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: DATA Index: test/Object/obj2yaml.test =================================================================== --- test/Object/obj2yaml.test +++ test/Object/obj2yaml.test @@ -651,7 +651,6 @@ WASM-NEXT: Version: 0x00000001 WASM: - Type: CUSTOM WASM-NEXT: Name: linking -WASM-NEXT: DataSize: 20 WASM-NEXT: SymbolTable: WASM-NEXT: - Index: 0 WASM-NEXT: Kind: FUNCTION Index: test/ObjectYAML/wasm/linking_section.yaml =================================================================== --- test/ObjectYAML/wasm/linking_section.yaml +++ test/ObjectYAML/wasm/linking_section.yaml @@ -29,7 +29,6 @@ Content: '11110000' - Type: CUSTOM Name: linking - DataSize: 999 SymbolTable: - Index: 0 Kind: FUNCTION @@ -51,7 +50,6 @@ ... # CHECK: - Type: CUSTOM # CHECK-NEXT: Name: linking -# CHECK-NEXT: DataSize: 999 # CHECK-NEXT: SymbolTable: # CHECK-NEXT: - Index: 0 # CHECK-NEXT: Kind: FUNCTION Index: test/ObjectYAML/wasm/weak_symbols.yaml =================================================================== --- test/ObjectYAML/wasm/weak_symbols.yaml +++ test/ObjectYAML/wasm/weak_symbols.yaml @@ -36,7 +36,6 @@ Body: 00 - Type: CUSTOM Name: linking - DataSize: 10 SymbolTable: - Index: 0 Kind: FUNCTION @@ -63,7 +62,6 @@ # CHECK: Index: 0 # CHECK: - Type: CUSTOM # CHECK: Name: linking -# CHECK: DataSize: 10 # CHECK: SymbolTable: # CHECK: - Index: 0 # CHECK: Kind: FUNCTION Index: test/tools/llvm-nm/wasm/exports.yaml =================================================================== --- test/tools/llvm-nm/wasm/exports.yaml +++ test/tools/llvm-nm/wasm/exports.yaml @@ -37,7 +37,6 @@ Content: '616263' - Type: CUSTOM Name: linking - DataSize: 3 SymbolTable: - Index: 0 Kind: FUNCTION Index: test/tools/llvm-nm/wasm/imports.yaml =================================================================== --- test/tools/llvm-nm/wasm/imports.yaml +++ test/tools/llvm-nm/wasm/imports.yaml @@ -25,7 +25,6 @@ GlobalMutable: false - Type: CUSTOM Name: linking - DataSize: 3 SymbolTable: - Index: 0 Kind: FUNCTION Index: test/tools/llvm-nm/wasm/weak-symbols.yaml =================================================================== --- test/tools/llvm-nm/wasm/weak-symbols.yaml +++ test/tools/llvm-nm/wasm/weak-symbols.yaml @@ -48,7 +48,6 @@ Content: '616263' - Type: CUSTOM Name: linking - DataSize: 3 SymbolTable: - Index: 0 Kind: DATA Index: test/tools/llvm-readobj/sections.test =================================================================== --- test/tools/llvm-readobj/sections.test +++ test/tools/llvm-readobj/sections.test @@ -537,6 +537,5 @@ WASM-NEXT: Size: 72 WASM-NEXT: Offset: 220 WASM-NEXT: Name: linking -WASM-NEXT: DataSize: 13 WASM-NEXT: } WASM-NEXT: ] Index: tools/llvm-readobj/WasmDumper.cpp =================================================================== --- tools/llvm-readobj/WasmDumper.cpp +++ tools/llvm-readobj/WasmDumper.cpp @@ -153,7 +153,6 @@ W.printString("Name", WasmSec.Name); if (WasmSec.Name == "linking") { const wasm::WasmLinkingData &LinkingData = Obj->linkingData(); - W.printNumber("DataSize", LinkingData.DataSize); if (!LinkingData.InitFunctions.empty()) { ListScope Group(W, "InitFunctions"); for (const wasm::WasmInitFunc &F: LinkingData.InitFunctions) Index: tools/obj2yaml/wasm2yaml.cpp =================================================================== --- tools/obj2yaml/wasm2yaml.cpp +++ tools/obj2yaml/wasm2yaml.cpp @@ -109,7 +109,6 @@ } LinkingSec->SymbolTable.emplace_back(Info); } - LinkingSec->DataSize = Obj.linkingData().DataSize; for (const wasm::WasmInitFunc &Func : Obj.linkingData().InitFunctions) { WasmYAML::InitFunction F{Func.Priority, Func.Symbol}; LinkingSec->InitFunctions.emplace_back(F); Index: tools/yaml2obj/yaml2wasm.cpp =================================================================== --- tools/yaml2obj/yaml2wasm.cpp +++ tools/yaml2obj/yaml2wasm.cpp @@ -136,11 +136,6 @@ SubSectionWriter SubSection(OS); - // DATA_SIZE subsection - encodeULEB128(wasm::WASM_DATA_SIZE, OS); - encodeULEB128(Section.DataSize, SubSection.GetStream()); - SubSection.Done(); - // SYMBOL_TABLE subsection if (Section.SymbolTable.size()) { encodeULEB128(wasm::WASM_SYMBOL_TABLE, OS);