Index: include/llvm/BinaryFormat/WasmRelocs.def =================================================================== --- include/llvm/BinaryFormat/WasmRelocs.def +++ include/llvm/BinaryFormat/WasmRelocs.def @@ -2,14 +2,14 @@ #error "WASM_RELOC must be defined" #endif -WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0) -WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1) -WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2) -WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_LEB, 3) -WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_SLEB, 4) -WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_I32, 5) -WASM_RELOC(R_WEBASSEMBLY_TYPE_INDEX_LEB, 6) -WASM_RELOC(R_WEBASSEMBLY_GLOBAL_INDEX_LEB, 7) -WASM_RELOC(R_WEBASSEMBLY_FUNCTION_OFFSET_I32, 8) -WASM_RELOC(R_WEBASSEMBLY_SECTION_OFFSET_I32, 9) -WASM_RELOC(R_WEBASSEMBLY_EVENT_INDEX_LEB, 10) +WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0) +WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1) +WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2) +WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3) +WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4) +WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5) +WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6) +WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7) +WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8) +WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9) +WASM_RELOC(R_WASM_EVENT_INDEX_LEB, 10) Index: include/llvm/Object/RelocVisitor.h =================================================================== --- include/llvm/Object/RelocVisitor.h +++ include/llvm/Object/RelocVisitor.h @@ -336,17 +336,17 @@ uint64_t visitWasm(uint32_t Rel, RelocationRef R, uint64_t Value) { if (ObjToVisit.getArch() == Triple::wasm32) { switch (Rel) { - case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB: - case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB: - case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB: - case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB: - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB: + case wasm::R_WASM_FUNCTION_INDEX_LEB: + case wasm::R_WASM_TABLE_INDEX_SLEB: + case wasm::R_WASM_TABLE_INDEX_I32: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_TYPE_INDEX_LEB: + case wasm::R_WASM_GLOBAL_INDEX_LEB: + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: + case wasm::R_WASM_EVENT_INDEX_LEB: // For wasm section, its offset at 0 -- ignoring Value return 0; } Index: lib/MC/WasmObjectWriter.cpp =================================================================== --- lib/MC/WasmObjectWriter.cpp +++ lib/MC/WasmObjectWriter.cpp @@ -150,11 +150,11 @@ bool hasAddend() const { switch (Type) { - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: return true; default: return false; @@ -519,8 +519,8 @@ // Absolute offset within a section or a function. // Currently only supported for for metadata sections. // See: test/MC/WebAssembly/blockaddress.ll - if (Type == wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32 || - Type == wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32) { + if (Type == wasm::R_WASM_FUNCTION_OFFSET_I32 || + Type == wasm::R_WASM_SECTION_OFFSET_I32) { if (!FixupSection.getKind().isMetadata()) report_fatal_error("relocations for function or section offsets are " "only supported in metadata sections"); @@ -538,9 +538,9 @@ SymA = cast(SectionSymbol); } - // Relocation other than R_WEBASSEMBLY_TYPE_INDEX_LEB are required to be + // Relocation other than R_WASM_TYPE_INDEX_LEB are required to be // against a named symbol. - if (Type != wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB) { + if (Type != wasm::R_WASM_TYPE_INDEX_LEB) { if (SymA->getName().empty()) report_fatal_error("relocations against un-named temporaries are not yet " "supported by wasm"); @@ -578,33 +578,33 @@ uint32_t WasmObjectWriter::getProvisionalValue(const WasmRelocationEntry &RelEntry) { switch (RelEntry.Type) { - case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB: - case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32: { + case wasm::R_WASM_TABLE_INDEX_SLEB: + case wasm::R_WASM_TABLE_INDEX_I32: { // Provisional value is table address of the resolved symbol itself const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol); assert(Sym->isFunction()); return TableIndices[Sym]; } - case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB: + case wasm::R_WASM_TYPE_INDEX_LEB: // Provisional value is same as the index return getRelocationIndexValue(RelEntry); - case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB: - case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB: - case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB: + case wasm::R_WASM_FUNCTION_INDEX_LEB: + case wasm::R_WASM_GLOBAL_INDEX_LEB: + case wasm::R_WASM_EVENT_INDEX_LEB: // Provisional value is function/global/event Wasm index if (!WasmIndices.count(RelEntry.Symbol)) report_fatal_error("symbol not found in wasm index space: " + RelEntry.Symbol->getName()); return WasmIndices[RelEntry.Symbol]; - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: { + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: { const auto &Section = static_cast(RelEntry.Symbol->getSection()); return Section.getSectionOffset() + RelEntry.Addend; } - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: { + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_MEMORY_ADDR_SLEB: { // Provisional value is address of the global const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol); // For undefined symbols, use zero @@ -660,7 +660,7 @@ uint32_t WasmObjectWriter::getRelocationIndexValue(const WasmRelocationEntry &RelEntry) { - if (RelEntry.Type == wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB) { + if (RelEntry.Type == wasm::R_WASM_TYPE_INDEX_LEB) { if (!TypeIndices.count(RelEntry.Symbol)) report_fatal_error("symbol not found in type index space: " + RelEntry.Symbol->getName()); @@ -684,21 +684,21 @@ uint32_t Value = getProvisionalValue(RelEntry); switch (RelEntry.Type) { - case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB: - case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB: - case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB: + case wasm::R_WASM_FUNCTION_INDEX_LEB: + case wasm::R_WASM_TYPE_INDEX_LEB: + case wasm::R_WASM_GLOBAL_INDEX_LEB: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_EVENT_INDEX_LEB: WritePatchableLEB(Stream, Value, Offset); break; - case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: + case wasm::R_WASM_TABLE_INDEX_I32: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: WriteI32(Stream, Value, Offset); break; - case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: + case wasm::R_WASM_TABLE_INDEX_SLEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: WritePatchableSLEB(Stream, Value, Offset); break; default: @@ -1481,8 +1481,8 @@ // Functions referenced by a relocation need to put in the table. This is // purely to make the object file's provisional values readable, and is // ignored by the linker, which re-calculates the relocations itself. - if (Rel.Type != wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 && - Rel.Type != wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB) + if (Rel.Type != wasm::R_WASM_TABLE_INDEX_I32 && + Rel.Type != wasm::R_WASM_TABLE_INDEX_SLEB) return; assert(Rel.Symbol->isFunction()); const MCSymbolWasm &WS = *ResolveSymbol(*Rel.Symbol); Index: lib/Object/WasmObjectFile.cpp =================================================================== --- lib/Object/WasmObjectFile.cpp +++ lib/Object/WasmObjectFile.cpp @@ -719,43 +719,43 @@ PreviousOffset = Reloc.Offset; Reloc.Index = readVaruint32(Ctx); switch (Reloc.Type) { - case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB: - case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB: - case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32: + case wasm::R_WASM_FUNCTION_INDEX_LEB: + case wasm::R_WASM_TABLE_INDEX_SLEB: + case wasm::R_WASM_TABLE_INDEX_I32: if (!isValidFunctionSymbol(Reloc.Index)) return make_error("Bad relocation function index", object_error::parse_failed); break; - case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB: + case wasm::R_WASM_TYPE_INDEX_LEB: if (Reloc.Index >= Signatures.size()) return make_error("Bad relocation type index", object_error::parse_failed); break; - case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB: + case wasm::R_WASM_GLOBAL_INDEX_LEB: if (!isValidGlobalSymbol(Reloc.Index)) return make_error("Bad relocation global index", object_error::parse_failed); break; - case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB: + case wasm::R_WASM_EVENT_INDEX_LEB: if (!isValidEventSymbol(Reloc.Index)) return make_error("Bad relocation event index", object_error::parse_failed); break; - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: + case wasm::R_WASM_MEMORY_ADDR_I32: if (!isValidDataSymbol(Reloc.Index)) return make_error("Bad relocation data index", object_error::parse_failed); Reloc.Addend = readVarint32(Ctx); break; - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: + case wasm::R_WASM_FUNCTION_OFFSET_I32: if (!isValidFunctionSymbol(Reloc.Index)) return make_error("Bad relocation function index", object_error::parse_failed); Reloc.Addend = readVarint32(Ctx); break; - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: if (!isValidSectionSymbol(Reloc.Index)) return make_error("Bad relocation section index", object_error::parse_failed); @@ -771,10 +771,10 @@ // also shouldn't overlap a function/element boundary, but we don't bother // to check that. uint64_t Size = 5; - if (Reloc.Type == wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 || - Reloc.Type == wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32 || - Reloc.Type == wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32 || - Reloc.Type == wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32) + if (Reloc.Type == wasm::R_WASM_TABLE_INDEX_I32 || + Reloc.Type == wasm::R_WASM_MEMORY_ADDR_I32 || + Reloc.Type == wasm::R_WASM_SECTION_OFFSET_I32 || + Reloc.Type == wasm::R_WASM_FUNCTION_OFFSET_I32) Size = 4; if (Reloc.Offset + Size > EndOffset) return make_error("Bad relocation offset", @@ -1419,7 +1419,7 @@ symbol_iterator WasmObjectFile::getRelocationSymbol(DataRefImpl Ref) const { const wasm::WasmRelocation &Rel = getWasmRelocation(Ref); - if (Rel.Type == wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB) + if (Rel.Type == wasm::R_WASM_TYPE_INDEX_LEB) return symbol_end(); DataRefImpl Sym; Sym.d.a = 1; Index: lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp =================================================================== --- lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp +++ lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp @@ -99,31 +99,31 @@ switch (unsigned(Fixup.getKind())) { case WebAssembly::fixup_code_sleb128_i32: if (IsFunction) - return wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB; - return wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB; + return wasm::R_WASM_TABLE_INDEX_SLEB; + return wasm::R_WASM_MEMORY_ADDR_SLEB; case WebAssembly::fixup_code_sleb128_i64: llvm_unreachable("fixup_sleb128_i64 not implemented yet"); case WebAssembly::fixup_code_uleb128_i32: if (IsGlobalType(Target)) - return wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB; + return wasm::R_WASM_GLOBAL_INDEX_LEB; if (IsFunctionType(Target)) - return wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB; + return wasm::R_WASM_TYPE_INDEX_LEB; if (IsFunction) - return wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB; + return wasm::R_WASM_FUNCTION_INDEX_LEB; if (IsEventType(Target)) - return wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB; - return wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB; + return wasm::R_WASM_EVENT_INDEX_LEB; + return wasm::R_WASM_MEMORY_ADDR_LEB; case FK_Data_4: if (IsFunction) - return wasm::R_WEBASSEMBLY_TABLE_INDEX_I32; + return wasm::R_WASM_TABLE_INDEX_I32; if (auto Section = static_cast( GetFixupSection(Fixup.getValue()))) { if (Section->getKind().isText()) - return wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32; + return wasm::R_WASM_FUNCTION_OFFSET_I32; else if (!Section->isWasmData()) - return wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32; + return wasm::R_WASM_SECTION_OFFSET_I32; } - return wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32; + return wasm::R_WASM_MEMORY_ADDR_I32; case FK_Data_8: llvm_unreachable("FK_Data_8 not implemented yet"); default: Index: test/MC/WebAssembly/assembler-binary.ll =================================================================== --- test/MC/WebAssembly/assembler-binary.ll +++ test/MC/WebAssembly/assembler-binary.ll @@ -68,7 +68,7 @@ ; CHECK-NEXT: FunctionTypes: [ 0 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000004 ; CHECK-NEXT: Functions: Index: test/MC/WebAssembly/comdat.ll =================================================================== --- test/MC/WebAssembly/comdat.ll +++ test/MC/WebAssembly/comdat.ll @@ -52,7 +52,7 @@ ; CHECK-NEXT: FunctionTypes: [ 0, 0, 0 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000004 ; CHECK-NEXT: Functions: Index: test/MC/WebAssembly/debug-info.ll =================================================================== --- test/MC/WebAssembly/debug-info.ll +++ test/MC/WebAssembly/debug-info.ll @@ -133,32 +133,32 @@ ; CHECK-NEXT:] ; CHECK-NEXT:Relocations [ ; CHECK-NEXT: Section (6) DATA { -; CHECK-NEXT: 0x6 R_WEBASSEMBLY_MEMORY_ADDR_I32 myextern 0 -; CHECK-NEXT: 0xF R_WEBASSEMBLY_TABLE_INDEX_I32 f2 +; CHECK-NEXT: 0x6 R_WASM_MEMORY_ADDR_I32 myextern 0 +; CHECK-NEXT: 0xF R_WASM_TABLE_INDEX_I32 f2 ; CHECK-NEXT: } ; CHECK-NEXT: Section (9) .debug_info { -; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_abbrev 0 -; CHECK-NEXT: 0xC R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 0 -; CHECK-NEXT: 0x12 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 55 -; CHECK-NEXT: 0x16 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_line 0 -; CHECK-NEXT: 0x1A R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 62 -; CHECK-NEXT: 0x1E R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0 -; CHECK-NEXT: 0x27 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 105 -; CHECK-NEXT: 0x33 R_WEBASSEMBLY_MEMORY_ADDR_I32 foo 0 -; CHECK-NEXT: 0x3D R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 109 -; CHECK-NEXT: 0x44 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 113 -; CHECK-NEXT: 0x50 R_WEBASSEMBLY_MEMORY_ADDR_I32 ptr2 0 -; CHECK-NEXT: 0x5B R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0 -; CHECK-NEXT: 0x63 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 118 +; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_abbrev 0 +; CHECK-NEXT: 0xC R_WASM_SECTION_OFFSET_I32 .debug_str 0 +; CHECK-NEXT: 0x12 R_WASM_SECTION_OFFSET_I32 .debug_str 55 +; CHECK-NEXT: 0x16 R_WASM_SECTION_OFFSET_I32 .debug_line 0 +; CHECK-NEXT: 0x1A R_WASM_SECTION_OFFSET_I32 .debug_str 62 +; CHECK-NEXT: 0x1E R_WASM_FUNCTION_OFFSET_I32 f2 0 +; CHECK-NEXT: 0x27 R_WASM_SECTION_OFFSET_I32 .debug_str 105 +; CHECK-NEXT: 0x33 R_WASM_MEMORY_ADDR_I32 foo 0 +; CHECK-NEXT: 0x3D R_WASM_SECTION_OFFSET_I32 .debug_str 109 +; CHECK-NEXT: 0x44 R_WASM_SECTION_OFFSET_I32 .debug_str 113 +; CHECK-NEXT: 0x50 R_WASM_MEMORY_ADDR_I32 ptr2 0 +; CHECK-NEXT: 0x5B R_WASM_FUNCTION_OFFSET_I32 f2 0 +; CHECK-NEXT: 0x63 R_WASM_SECTION_OFFSET_I32 .debug_str 118 ; CHECK-NEXT: } ; CHECK-NEXT: Section (11) .debug_pubnames { -; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_info 0 +; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_info 0 ; CHECK-NEXT: } ; CHECK-NEXT: Section (12) .debug_pubtypes { -; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_info 0 +; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_info 0 ; CHECK-NEXT: } ; CHECK-NEXT: Section (13) .debug_line { -; CHECK-NEXT: 0x2B R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0 +; CHECK-NEXT: 0x2B R_WASM_FUNCTION_OFFSET_I32 f2 0 ; CHECK-NEXT: } ; CHECK-NEXT:] ; CHECK-NEXT:Symbols [ Index: test/MC/WebAssembly/event-section.ll =================================================================== --- test/MC/WebAssembly/event-section.ll +++ test/MC/WebAssembly/event-section.ll @@ -35,10 +35,10 @@ ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000006 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000011 Index: test/MC/WebAssembly/external-data.ll =================================================================== --- test/MC/WebAssembly/external-data.ll +++ test/MC/WebAssembly/external-data.ll @@ -12,7 +12,7 @@ ; CHECK: - Type: DATA ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32 ; CHECK-NEXT: Index: 2 ; CHECK-NEXT: Offset: 0x00000013 ; CHECK-NEXT: Segments: Index: test/MC/WebAssembly/external-func-address.ll =================================================================== --- test/MC/WebAssembly/external-func-address.ll +++ test/MC/WebAssembly/external-func-address.ll @@ -60,6 +60,6 @@ ; CHECK-NEXT: Functions: [ 1, 2 ] ; CHECK: - Type: DATA ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32 +; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32 ; CHECK-NEXT: Index: 3 ; CHECK-NEXT: Offset: 0x00000006 Index: test/MC/WebAssembly/func-address.ll =================================================================== --- test/MC/WebAssembly/func-address.ll +++ test/MC/WebAssembly/func-address.ll @@ -30,22 +30,22 @@ ; CHECK: Relocations [ ; CHECK-NEXT: Section (5) CODE { ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) ; CHECK-NEXT: Offset: 0x4 ; CHECK-NEXT: Symbol: import1 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) ; CHECK-NEXT: Offset: 0xB ; CHECK-NEXT: Symbol: import2 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB (7) +; CHECK-NEXT: Type: R_WASM_GLOBAL_INDEX_LEB (7) ; CHECK-NEXT: Offset: 0x15 ; CHECK-NEXT: Symbol: __stack_pointer ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB (1) +; CHECK-NEXT: Type: R_WASM_TABLE_INDEX_SLEB (1) ; CHECK-NEXT: Offset: 0x1E ; CHECK-NEXT: Symbol: import3 ; CHECK-NEXT: } Index: test/MC/WebAssembly/global-ctor-dtor.ll =================================================================== --- test/MC/WebAssembly/global-ctor-dtor.ll +++ test/MC/WebAssembly/global-ctor-dtor.ll @@ -63,28 +63,28 @@ ; CHECK-NEXT: Functions: [ 5, 7 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000004 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB +; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_SLEB ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x0000000F -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB ; CHECK-NEXT: Index: 3 ; CHECK-NEXT: Offset: 0x00000017 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 4 ; CHECK-NEXT: Offset: 0x0000001D -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 6 ; CHECK-NEXT: Offset: 0x0000002C -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB +; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_SLEB ; CHECK-NEXT: Index: 5 ; CHECK-NEXT: Offset: 0x00000037 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB ; CHECK-NEXT: Index: 3 ; CHECK-NEXT: Offset: 0x0000003F -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 4 ; CHECK-NEXT: Offset: 0x00000045 ; CHECK-NEXT: Functions: Index: test/MC/WebAssembly/reloc-code.ll =================================================================== --- test/MC/WebAssembly/reloc-code.ll +++ test/MC/WebAssembly/reloc-code.ll @@ -26,34 +26,34 @@ ; CHECK: Relocations [ ; CHECK-NEXT: Section (4) CODE { ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB (3) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3) ; CHECK-NEXT: Offset: 0x9 ; CHECK-NEXT: Symbol: b ; CHECK-NEXT: Addend: 0 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB (3) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3) ; CHECK-NEXT: Offset: 0x14 ; CHECK-NEXT: Symbol: a ; CHECK-NEXT: Addend: 0 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_TYPE_INDEX_LEB (6) +; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6) ; CHECK-NEXT: Offset: 0x1A ; CHECK-NEXT: Index: 0x1 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_TYPE_INDEX_LEB (6) +; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6) ; CHECK-NEXT: Offset: 0x24 ; CHECK-NEXT: Index: 0x0 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) ; CHECK-NEXT: Offset: 0x2D ; CHECK-NEXT: Symbol: c ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) ; CHECK-NEXT: Offset: 0x34 ; CHECK-NEXT: Symbol: d ; CHECK-NEXT: } Index: test/MC/WebAssembly/reloc-data.ll =================================================================== --- test/MC/WebAssembly/reloc-data.ll +++ test/MC/WebAssembly/reloc-data.ll @@ -15,31 +15,31 @@ ; CHECK: Relocations [ ; CHECK-NEXT: Section (2) DATA { ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) ; CHECK-NEXT: Offset: 0x13 ; CHECK-NEXT: Symbol: foo ; CHECK-NEXT: Addend: 8 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) ; CHECK-NEXT: Offset: 0x1C ; CHECK-NEXT: Symbol: bar ; CHECK-NEXT: Addend: -16 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) ; CHECK-NEXT: Offset: 0x25 ; CHECK-NEXT: Symbol: foo ; CHECK-NEXT: Addend: 0 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) ; CHECK-NEXT: Offset: 0x29 ; CHECK-NEXT: Symbol: foo ; CHECK-NEXT: Addend: 0 ; CHECK-NEXT: } ; CHECK-NEXT: Relocation { -; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5) +; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5) ; CHECK-NEXT: Offset: 0x2D ; CHECK-NEXT: Symbol: foo ; CHECK-NEXT: Addend: 0 Index: test/MC/WebAssembly/stack-ptr.ll =================================================================== --- test/MC/WebAssembly/stack-ptr.ll +++ test/MC/WebAssembly/stack-ptr.ll @@ -19,5 +19,5 @@ ; CHECK: GlobalMutable: true ; CHECK: - Type: CODE ; CHECK: Relocations: -; CHECK: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB +; CHECK: - Type: R_WASM_GLOBAL_INDEX_LEB ; CHECK: Index: 0 Index: test/MC/WebAssembly/unnamed-data.ll =================================================================== --- test/MC/WebAssembly/unnamed-data.ll +++ test/MC/WebAssembly/unnamed-data.ll @@ -11,10 +11,10 @@ ; CHECK: - Type: DATA ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32 ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x0000001C -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32 ; CHECK-NEXT: Index: 1 ; CHECK-NEXT: Offset: 0x00000025 ; CHECK-NEXT: Segments: Index: test/MC/WebAssembly/weak-alias.ll =================================================================== --- test/MC/WebAssembly/weak-alias.ll +++ test/MC/WebAssembly/weak-alias.ll @@ -75,22 +75,22 @@ ; CHECK-NEXT: Functions: [ 0 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x00000009 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB ; CHECK-NEXT: Index: 3 ; CHECK-NEXT: Offset: 0x00000012 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB ; CHECK-NEXT: Index: 5 ; CHECK-NEXT: Offset: 0x0000001E -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TYPE_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_TYPE_INDEX_LEB ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x00000024 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB +; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB ; CHECK-NEXT: Index: 7 ; CHECK-NEXT: Offset: 0x00000031 -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TYPE_INDEX_LEB +; CHECK-NEXT: - Type: R_WASM_TYPE_INDEX_LEB ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x00000037 ; CHECK-NEXT: Functions: @@ -111,10 +111,10 @@ ; CHECK-NEXT: Body: 410028029080808000118080808000000B ; CHECK-NEXT: - Type: DATA ; CHECK-NEXT: Relocations: -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32 +; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32 ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: Offset: 0x0000000F -; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32 +; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32 ; CHECK-NEXT: Index: 3 ; CHECK-NEXT: Offset: 0x00000018 ; CHECK-NEXT: Segments: Index: test/Object/objdump-relocations.test =================================================================== --- test/Object/objdump-relocations.test +++ test/Object/objdump-relocations.test @@ -60,10 +60,10 @@ ELF-MIPSEL: R_MIPS_CALL16 SomeOtherFunction WASM: CODE -WASM-NEXT: R_WEBASSEMBLY_MEMORY_ADDR_SLEB .L.str -WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB puts -WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB .LSomeOtherFunction_bitcast -WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB SomeOtherFunction +WASM-NEXT: R_WASM_MEMORY_ADDR_SLEB .L.str +WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB puts +WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB .LSomeOtherFunction_bitcast +WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB SomeOtherFunction ELF-complex-x86-64: .text ELF-complex-x86-64-NEXT: R_X86_64_8 .data-4 Index: test/ObjectYAML/wasm/code_section.yaml =================================================================== --- test/ObjectYAML/wasm/code_section.yaml +++ test/ObjectYAML/wasm/code_section.yaml @@ -20,10 +20,10 @@ - 1 - Type: CODE Relocations: - - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB + - Type: R_WASM_TABLE_INDEX_SLEB Index: 0 Offset: 0x00000006 - - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB + - Type: R_WASM_FUNCTION_INDEX_LEB Index: 1 Offset: 0x00000025 Functions: @@ -69,10 +69,10 @@ # CHECK: - I64 # CHECK: - Type: CODE # CHECK: Relocations: -# CHECK: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB +# CHECK: - Type: R_WASM_TABLE_INDEX_SLEB # CHECK: Index: 0 # CHECK: Offset: 0x00000006 -# CHECK: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB +# CHECK: - Type: R_WASM_FUNCTION_INDEX_LEB # CHECK: Index: 1 # CHECK: Offset: 0x00000025 # CHECK: Functions: Index: test/ObjectYAML/wasm/data_section.yaml =================================================================== --- test/ObjectYAML/wasm/data_section.yaml +++ test/ObjectYAML/wasm/data_section.yaml @@ -14,11 +14,11 @@ Value: 4 Content: '10001000' Relocations: - - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 + - Type: R_WASM_MEMORY_ADDR_I32 Index: 0 Offset: 0x00000006 Addend: 8 - - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 + - Type: R_WASM_MEMORY_ADDR_I32 Index: 0 Offset: 0x00000006 Addend: -6 @@ -40,11 +40,11 @@ # CHECK: Sections: # CHECK: - Type: DATA # CHECK-NEXT: Relocations: -# CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 +# CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32 # CHECK-NEXT: Index: 0 # CHECK-NEXT: Offset: 0x00000006 # CHECK-NEXT: Addend: 8 -# CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 +# CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32 # CHECK-NEXT: Index: 0 # CHECK-NEXT: Offset: 0x00000006 # CHECK-NEXT: Addend: -6 Index: test/ObjectYAML/wasm/event_section.yaml =================================================================== --- test/ObjectYAML/wasm/event_section.yaml +++ test/ObjectYAML/wasm/event_section.yaml @@ -23,7 +23,7 @@ SigIndex: 1 - Type: CODE Relocations: - - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB + - Type: R_WASM_EVENT_INDEX_LEB Index: 1 Offset: 0x00000006 Functions: @@ -69,7 +69,7 @@ # CHECK-NEXT: SigIndex: 1 # CHECK-NEXT: - Type: CODE # CHECK-NEXT: Relocations: -# CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB +# CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB # CHECK-NEXT: Index: 1 # CHECK-NEXT: Offset: 0x00000006 # CHECK-NEXT: Functions: Index: test/tools/llvm-objdump/WebAssembly/relocations.test =================================================================== --- test/tools/llvm-objdump/WebAssembly/relocations.test +++ test/tools/llvm-objdump/WebAssembly/relocations.test @@ -10,7 +10,7 @@ } ; CHECK: RELOCATION RECORDS FOR [CODE]: -; CHECK-NEXT: 00000006 R_WEBASSEMBLY_TYPE_INDEX_LEB 1+0 +; CHECK-NEXT: 00000006 R_WASM_TYPE_INDEX_LEB 1+0 ; CHECK: RELOCATION RECORDS FOR [DATA]: -; CHECK-NEXT: 00000006 R_WEBASSEMBLY_MEMORY_ADDR_I32 foo+0 +; CHECK-NEXT: 00000006 R_WASM_MEMORY_ADDR_I32 foo+0 Index: test/tools/llvm-readobj/relocations.test =================================================================== --- test/tools/llvm-readobj/relocations.test +++ test/tools/llvm-readobj/relocations.test @@ -289,23 +289,23 @@ WASM: Relocations [ WASM-NEXT: Section (4) CODE { WASM-NEXT: Relocation { -WASM-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB (4) +WASM-NEXT: Type: R_WASM_MEMORY_ADDR_SLEB (4) WASM-NEXT: Offset: 0x4 WASM-NEXT: Symbol: .L.str WASM-NEXT: Addend: 0 WASM-NEXT: } WASM-NEXT: Relocation { -WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) WASM-NEXT: Offset: 0xA WASM-NEXT: Symbol: puts WASM-NEXT: } WASM-NEXT: Relocation { -WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) WASM-NEXT: Offset: 0x11 WASM-NEXT: Symbol: .LSomeOtherFunction_bitcast WASM-NEXT: } WASM-NEXT: Relocation { -WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0) +WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0) WASM-NEXT: Offset: 0x1E WASM-NEXT: Symbol: SomeOtherFunction WASM-NEXT: } Index: tools/llvm-objdump/WasmDump.cpp =================================================================== --- tools/llvm-objdump/WasmDump.cpp +++ tools/llvm-objdump/WasmDump.cpp @@ -36,7 +36,7 @@ raw_string_ostream Fmt(FmtBuf); if (SI == Obj->symbol_end()) { // Not all wasm relocations have symbols associated with them. - // In particular R_WEBASSEMBLY_TYPE_INDEX_LEB. + // In particular R_WASM_TYPE_INDEX_LEB. Fmt << Rel.Index; } else { Expected SymNameOrErr = SI->getName(); Index: tools/llvm-readobj/WasmDumper.cpp =================================================================== --- tools/llvm-readobj/WasmDumper.cpp +++ tools/llvm-readobj/WasmDumper.cpp @@ -80,11 +80,11 @@ bool HasAddend = false; switch (RelocType) { - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: HasAddend = true; break; default: Index: tools/yaml2obj/yaml2wasm.cpp =================================================================== --- tools/yaml2obj/yaml2wasm.cpp +++ tools/yaml2obj/yaml2wasm.cpp @@ -526,11 +526,11 @@ encodeULEB128(Reloc.Offset, OS); encodeULEB128(Reloc.Index, OS); switch (Reloc.Type) { - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: - case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32: - case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32: - case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: + case wasm::R_WASM_MEMORY_ADDR_LEB: + case wasm::R_WASM_MEMORY_ADDR_SLEB: + case wasm::R_WASM_MEMORY_ADDR_I32: + case wasm::R_WASM_FUNCTION_OFFSET_I32: + case wasm::R_WASM_SECTION_OFFSET_I32: encodeULEB128(Reloc.Addend, OS); } }