Index: test/wasm/Inputs/globals.yaml =================================================================== --- test/wasm/Inputs/globals.yaml +++ test/wasm/Inputs/globals.yaml @@ -34,6 +34,7 @@ Offset: 0x00000004 - Type: CUSTOM Name: linking + Version: 1 SymbolTable: - Index: 0 Kind: GLOBAL Index: test/wasm/Inputs/undefined-globals.yaml =================================================================== --- test/wasm/Inputs/undefined-globals.yaml +++ test/wasm/Inputs/undefined-globals.yaml @@ -32,6 +32,7 @@ Offset: 0x00000004 - Type: CUSTOM Name: linking + Version: 1 SymbolTable: - Index: 0 Kind: GLOBAL Index: test/wasm/data-layout.ll =================================================================== --- test/wasm/data-layout.ll +++ test/wasm/data-layout.ll @@ -119,9 +119,7 @@ ; RELOC-NEXT: Value: 40 ; RELOC-NEXT: Content: 68656C6C6F0A00 -; RELOC: - Type: CUSTOM -; RELOC-NEXT: Name: linking -; RELOC-NEXT: SymbolTable: +; RELOC: SymbolTable: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Kind: DATA ; RELOC-NEXT: Name: foo Index: test/wasm/init-fini.ll =================================================================== --- test/wasm/init-fini.ll +++ test/wasm/init-fini.ll @@ -131,8 +131,7 @@ ; RUN: wasm-ld --check-signatures -r %t.o %t.global-ctor-dtor.o -o %t.reloc.wasm ; RUN: obj2yaml %t.reloc.wasm | FileCheck -check-prefix=RELOC %s -; RELOC: Name: linking -; RELOC-NEXT: SymbolTable: +; RELOC: SymbolTable: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Kind: FUNCTION ; RELOC-NEXT: Name: func1 Index: test/wasm/locals-duplicate.test =================================================================== --- test/wasm/locals-duplicate.test +++ test/wasm/locals-duplicate.test @@ -382,6 +382,7 @@ ; RELOC-NEXT: Content: '0000000000000000' ; RELOC-NEXT: - Type: CUSTOM ; RELOC-NEXT: Name: linking +; RELOC-NEXT: Version: 1 ; RELOC-NEXT: SymbolTable: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Kind: FUNCTION Index: test/wasm/many-functions.ll =================================================================== --- test/wasm/many-functions.ll +++ test/wasm/many-functions.ll @@ -815,6 +815,7 @@ ; CHECK-NEXT: Content: '01000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking +; CHECK-NEXT: Version: 1 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/wasm/relocatable.ll =================================================================== --- test/wasm/relocatable.ll +++ test/wasm/relocatable.ll @@ -157,6 +157,7 @@ ; CHECK-NEXT: Content: '616263' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking +; CHECK-NEXT: Version: 1 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/wasm/stack-pointer.ll =================================================================== --- test/wasm/stack-pointer.ll +++ test/wasm/stack-pointer.ll @@ -50,6 +50,7 @@ ; CHECK-NEXT: Body: 23808080800041106B1A41000B ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking +; CHECK-NEXT: Version: 1 ; CHECK-NEXT: SymbolTable: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Kind: FUNCTION Index: test/wasm/weak-alias.ll =================================================================== --- test/wasm/weak-alias.ll +++ test/wasm/weak-alias.ll @@ -250,6 +250,7 @@ ; RELOC-NEXT: Body: 23808080800041106B220024808080800020004181808080003602081081808080002101200041106A24808080800020010B ; RELOC-NEXT: - Type: CUSTOM ; RELOC-NEXT: Name: linking +; RELOC-NEXT: Version: 1 ; RELOC-NEXT: SymbolTable: ; RELOC-NEXT: - Index: 0 ; RELOC-NEXT: Kind: FUNCTION Index: wasm/Writer.cpp =================================================================== --- wasm/Writer.cpp +++ wasm/Writer.cpp @@ -430,8 +430,7 @@ createSyntheticSection(WASM_SEC_CUSTOM, "linking"); raw_ostream &OS = Section->getStream(); - if (!Config->Relocatable) - return; + writeUleb128(OS, WasmMetadataVersion, "Version"); if (!SymtabEntries.empty()) { SubSection Sub(WASM_SYMBOL_TABLE);