llvm.org GIT mirror llvm / 96488ce
[WebAssembly] Rename relocations from R_WEBASSEMBLY_ to R_WASM_ See https://github.com/WebAssembly/tool-conventions/pull/95. This is less typing and IMHO more readable, and it also fits with our naming around the binary format which tends to use the short name. e.g. include/llvm/BinaryFormat/Wasm.h tools/llvm-objdump/WasmDump.cpp etc.. Differential Revision: https://reviews.llvm.org/D57611 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353062 91177308-0d34-0410-b5e6-96231b3b80d8 Sam Clegg 6 months ago
27 changed file(s) with 172 addition(s) and 172 deletion(s). Raw diff Collapse all Expand all
11 #error "WASM_RELOC must be defined"
22 #endif
33
4 WASM_RELOC(R_WEBASSEMBLY_FUNCTION_INDEX_LEB, 0)
5 WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_SLEB, 1)
6 WASM_RELOC(R_WEBASSEMBLY_TABLE_INDEX_I32, 2)
7 WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_LEB, 3)
8 WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_SLEB, 4)
9 WASM_RELOC(R_WEBASSEMBLY_MEMORY_ADDR_I32, 5)
10 WASM_RELOC(R_WEBASSEMBLY_TYPE_INDEX_LEB, 6)
11 WASM_RELOC(R_WEBASSEMBLY_GLOBAL_INDEX_LEB, 7)
12 WASM_RELOC(R_WEBASSEMBLY_FUNCTION_OFFSET_I32, 8)
13 WASM_RELOC(R_WEBASSEMBLY_SECTION_OFFSET_I32, 9)
14 WASM_RELOC(R_WEBASSEMBLY_EVENT_INDEX_LEB, 10)
4 WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0)
5 WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1)
6 WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2)
7 WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3)
8 WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4)
9 WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5)
10 WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6)
11 WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7)
12 WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8)
13 WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9)
14 WASM_RELOC(R_WASM_EVENT_INDEX_LEB, 10)
335335 uint64_t visitWasm(uint32_t Rel, RelocationRef R, uint64_t Value) {
336336 if (ObjToVisit.getArch() == Triple::wasm32) {
337337 switch (Rel) {
338 case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB:
339 case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB:
340 case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32:
341 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
342 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
343 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
344 case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB:
345 case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB:
346 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
347 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
348 case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB:
338 case wasm::R_WASM_FUNCTION_INDEX_LEB:
339 case wasm::R_WASM_TABLE_INDEX_SLEB:
340 case wasm::R_WASM_TABLE_INDEX_I32:
341 case wasm::R_WASM_MEMORY_ADDR_LEB:
342 case wasm::R_WASM_MEMORY_ADDR_SLEB:
343 case wasm::R_WASM_MEMORY_ADDR_I32:
344 case wasm::R_WASM_TYPE_INDEX_LEB:
345 case wasm::R_WASM_GLOBAL_INDEX_LEB:
346 case wasm::R_WASM_FUNCTION_OFFSET_I32:
347 case wasm::R_WASM_SECTION_OFFSET_I32:
348 case wasm::R_WASM_EVENT_INDEX_LEB:
349349 // For wasm section, its offset at 0 -- ignoring Value
350350 return 0;
351351 }
149149
150150 bool hasAddend() const {
151151 switch (Type) {
152 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
153 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
154 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
155 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
156 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
152 case wasm::R_WASM_MEMORY_ADDR_LEB:
153 case wasm::R_WASM_MEMORY_ADDR_SLEB:
154 case wasm::R_WASM_MEMORY_ADDR_I32:
155 case wasm::R_WASM_FUNCTION_OFFSET_I32:
156 case wasm::R_WASM_SECTION_OFFSET_I32:
157157 return true;
158158 default:
159159 return false;
518518 // Absolute offset within a section or a function.
519519 // Currently only supported for for metadata sections.
520520 // See: test/MC/WebAssembly/blockaddress.ll
521 if (Type == wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32 ||
522 Type == wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32) {
521 if (Type == wasm::R_WASM_FUNCTION_OFFSET_I32 ||
522 Type == wasm::R_WASM_SECTION_OFFSET_I32) {
523523 if (!FixupSection.getKind().isMetadata())
524524 report_fatal_error("relocations for function or section offsets are "
525525 "only supported in metadata sections");
537537 SymA = cast(SectionSymbol);
538538 }
539539
540 // Relocation other than R_WEBASSEMBLY_TYPE_INDEX_LEB are required to be
540 // Relocation other than R_WASM_TYPE_INDEX_LEB are required to be
541541 // against a named symbol.
542 if (Type != wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB) {
542 if (Type != wasm::R_WASM_TYPE_INDEX_LEB) {
543543 if (SymA->getName().empty())
544544 report_fatal_error("relocations against un-named temporaries are not yet "
545545 "supported by wasm");
577577 uint32_t
578578 WasmObjectWriter::getProvisionalValue(const WasmRelocationEntry &RelEntry) {
579579 switch (RelEntry.Type) {
580 case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB:
581 case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32: {
580 case wasm::R_WASM_TABLE_INDEX_SLEB:
581 case wasm::R_WASM_TABLE_INDEX_I32: {
582582 // Provisional value is table address of the resolved symbol itself
583583 const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
584584 assert(Sym->isFunction());
585585 return TableIndices[Sym];
586586 }
587 case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB:
587 case wasm::R_WASM_TYPE_INDEX_LEB:
588588 // Provisional value is same as the index
589589 return getRelocationIndexValue(RelEntry);
590 case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB:
591 case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB:
592 case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB:
590 case wasm::R_WASM_FUNCTION_INDEX_LEB:
591 case wasm::R_WASM_GLOBAL_INDEX_LEB:
592 case wasm::R_WASM_EVENT_INDEX_LEB:
593593 // Provisional value is function/global/event Wasm index
594594 if (!WasmIndices.count(RelEntry.Symbol))
595595 report_fatal_error("symbol not found in wasm index space: " +
596596 RelEntry.Symbol->getName());
597597 return WasmIndices[RelEntry.Symbol];
598 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
599 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32: {
598 case wasm::R_WASM_FUNCTION_OFFSET_I32:
599 case wasm::R_WASM_SECTION_OFFSET_I32: {
600600 const auto &Section =
601601 static_cast(RelEntry.Symbol->getSection());
602602 return Section.getSectionOffset() + RelEntry.Addend;
603603 }
604 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
605 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
606 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB: {
604 case wasm::R_WASM_MEMORY_ADDR_LEB:
605 case wasm::R_WASM_MEMORY_ADDR_I32:
606 case wasm::R_WASM_MEMORY_ADDR_SLEB: {
607607 // Provisional value is address of the global
608608 const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
609609 // For undefined symbols, use zero
659659
660660 uint32_t
661661 WasmObjectWriter::getRelocationIndexValue(const WasmRelocationEntry &RelEntry) {
662 if (RelEntry.Type == wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB) {
662 if (RelEntry.Type == wasm::R_WASM_TYPE_INDEX_LEB) {
663663 if (!TypeIndices.count(RelEntry.Symbol))
664664 report_fatal_error("symbol not found in type index space: " +
665665 RelEntry.Symbol->getName());
683683 uint32_t Value = getProvisionalValue(RelEntry);
684684
685685 switch (RelEntry.Type) {
686 case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB:
687 case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB:
688 case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB:
689 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
690 case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB:
686 case wasm::R_WASM_FUNCTION_INDEX_LEB:
687 case wasm::R_WASM_TYPE_INDEX_LEB:
688 case wasm::R_WASM_GLOBAL_INDEX_LEB:
689 case wasm::R_WASM_MEMORY_ADDR_LEB:
690 case wasm::R_WASM_EVENT_INDEX_LEB:
691691 WritePatchableLEB(Stream, Value, Offset);
692692 break;
693 case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32:
694 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
695 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
696 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
693 case wasm::R_WASM_TABLE_INDEX_I32:
694 case wasm::R_WASM_MEMORY_ADDR_I32:
695 case wasm::R_WASM_FUNCTION_OFFSET_I32:
696 case wasm::R_WASM_SECTION_OFFSET_I32:
697697 WriteI32(Stream, Value, Offset);
698698 break;
699 case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB:
700 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
699 case wasm::R_WASM_TABLE_INDEX_SLEB:
700 case wasm::R_WASM_MEMORY_ADDR_SLEB:
701701 WritePatchableSLEB(Stream, Value, Offset);
702702 break;
703703 default:
14801480 // Functions referenced by a relocation need to put in the table. This is
14811481 // purely to make the object file's provisional values readable, and is
14821482 // ignored by the linker, which re-calculates the relocations itself.
1483 if (Rel.Type != wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 &&
1484 Rel.Type != wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB)
1483 if (Rel.Type != wasm::R_WASM_TABLE_INDEX_I32 &&
1484 Rel.Type != wasm::R_WASM_TABLE_INDEX_SLEB)
14851485 return;
14861486 assert(Rel.Symbol->isFunction());
14871487 const MCSymbolWasm &WS = *ResolveSymbol(*Rel.Symbol);
718718 PreviousOffset = Reloc.Offset;
719719 Reloc.Index = readVaruint32(Ctx);
720720 switch (Reloc.Type) {
721 case wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB:
722 case wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB:
723 case wasm::R_WEBASSEMBLY_TABLE_INDEX_I32:
721 case wasm::R_WASM_FUNCTION_INDEX_LEB:
722 case wasm::R_WASM_TABLE_INDEX_SLEB:
723 case wasm::R_WASM_TABLE_INDEX_I32:
724724 if (!isValidFunctionSymbol(Reloc.Index))
725725 return make_error("Bad relocation function index",
726726 object_error::parse_failed);
727727 break;
728 case wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB:
728 case wasm::R_WASM_TYPE_INDEX_LEB:
729729 if (Reloc.Index >= Signatures.size())
730730 return make_error("Bad relocation type index",
731731 object_error::parse_failed);
732732 break;
733 case wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB:
733 case wasm::R_WASM_GLOBAL_INDEX_LEB:
734734 if (!isValidGlobalSymbol(Reloc.Index))
735735 return make_error("Bad relocation global index",
736736 object_error::parse_failed);
737737 break;
738 case wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB:
738 case wasm::R_WASM_EVENT_INDEX_LEB:
739739 if (!isValidEventSymbol(Reloc.Index))
740740 return make_error("Bad relocation event index",
741741 object_error::parse_failed);
742742 break;
743 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
744 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
745 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
743 case wasm::R_WASM_MEMORY_ADDR_LEB:
744 case wasm::R_WASM_MEMORY_ADDR_SLEB:
745 case wasm::R_WASM_MEMORY_ADDR_I32:
746746 if (!isValidDataSymbol(Reloc.Index))
747747 return make_error("Bad relocation data index",
748748 object_error::parse_failed);
749749 Reloc.Addend = readVarint32(Ctx);
750750 break;
751 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
751 case wasm::R_WASM_FUNCTION_OFFSET_I32:
752752 if (!isValidFunctionSymbol(Reloc.Index))
753753 return make_error("Bad relocation function index",
754754 object_error::parse_failed);
755755 Reloc.Addend = readVarint32(Ctx);
756756 break;
757 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
757 case wasm::R_WASM_SECTION_OFFSET_I32:
758758 if (!isValidSectionSymbol(Reloc.Index))
759759 return make_error("Bad relocation section index",
760760 object_error::parse_failed);
770770 // also shouldn't overlap a function/element boundary, but we don't bother
771771 // to check that.
772772 uint64_t Size = 5;
773 if (Reloc.Type == wasm::R_WEBASSEMBLY_TABLE_INDEX_I32 ||
774 Reloc.Type == wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32 ||
775 Reloc.Type == wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32 ||
776 Reloc.Type == wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32)
773 if (Reloc.Type == wasm::R_WASM_TABLE_INDEX_I32 ||
774 Reloc.Type == wasm::R_WASM_MEMORY_ADDR_I32 ||
775 Reloc.Type == wasm::R_WASM_SECTION_OFFSET_I32 ||
776 Reloc.Type == wasm::R_WASM_FUNCTION_OFFSET_I32)
777777 Size = 4;
778778 if (Reloc.Offset + Size > EndOffset)
779779 return make_error("Bad relocation offset",
14181418
14191419 symbol_iterator WasmObjectFile::getRelocationSymbol(DataRefImpl Ref) const {
14201420 const wasm::WasmRelocation &Rel = getWasmRelocation(Ref);
1421 if (Rel.Type == wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB)
1421 if (Rel.Type == wasm::R_WASM_TYPE_INDEX_LEB)
14221422 return symbol_end();
14231423 DataRefImpl Sym;
14241424 Sym.d.a = 1;
9898 switch (unsigned(Fixup.getKind())) {
9999 case WebAssembly::fixup_code_sleb128_i32:
100100 if (IsFunction)
101 return wasm::R_WEBASSEMBLY_TABLE_INDEX_SLEB;
102 return wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB;
101 return wasm::R_WASM_TABLE_INDEX_SLEB;
102 return wasm::R_WASM_MEMORY_ADDR_SLEB;
103103 case WebAssembly::fixup_code_sleb128_i64:
104104 llvm_unreachable("fixup_sleb128_i64 not implemented yet");
105105 case WebAssembly::fixup_code_uleb128_i32:
106106 if (IsGlobalType(Target))
107 return wasm::R_WEBASSEMBLY_GLOBAL_INDEX_LEB;
107 return wasm::R_WASM_GLOBAL_INDEX_LEB;
108108 if (IsFunctionType(Target))
109 return wasm::R_WEBASSEMBLY_TYPE_INDEX_LEB;
109 return wasm::R_WASM_TYPE_INDEX_LEB;
110110 if (IsFunction)
111 return wasm::R_WEBASSEMBLY_FUNCTION_INDEX_LEB;
111 return wasm::R_WASM_FUNCTION_INDEX_LEB;
112112 if (IsEventType(Target))
113 return wasm::R_WEBASSEMBLY_EVENT_INDEX_LEB;
114 return wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB;
113 return wasm::R_WASM_EVENT_INDEX_LEB;
114 return wasm::R_WASM_MEMORY_ADDR_LEB;
115115 case FK_Data_4:
116116 if (IsFunction)
117 return wasm::R_WEBASSEMBLY_TABLE_INDEX_I32;
117 return wasm::R_WASM_TABLE_INDEX_I32;
118118 if (auto Section = static_cast(
119119 GetFixupSection(Fixup.getValue()))) {
120120 if (Section->getKind().isText())
121 return wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32;
121 return wasm::R_WASM_FUNCTION_OFFSET_I32;
122122 else if (!Section->isWasmData())
123 return wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32;
123 return wasm::R_WASM_SECTION_OFFSET_I32;
124124 }
125 return wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32;
125 return wasm::R_WASM_MEMORY_ADDR_I32;
126126 case FK_Data_8:
127127 llvm_unreachable("FK_Data_8 not implemented yet");
128128 default:
6767 ; CHECK-NEXT: FunctionTypes: [ 0 ]
6868 ; CHECK-NEXT: - Type: CODE
6969 ; CHECK-NEXT: Relocations:
70 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
70 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
7171 ; CHECK-NEXT: Index: 1
7272 ; CHECK-NEXT: Offset: 0x00000004
7373 ; CHECK-NEXT: Functions:
5151 ; CHECK-NEXT: FunctionTypes: [ 0, 0, 0 ]
5252 ; CHECK-NEXT: - Type: CODE
5353 ; CHECK-NEXT: Relocations:
54 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
54 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
5555 ; CHECK-NEXT: Index: 1
5656 ; CHECK-NEXT: Offset: 0x00000004
5757 ; CHECK-NEXT: Functions:
132132 ; CHECK-NEXT:]
133133 ; CHECK-NEXT:Relocations [
134134 ; CHECK-NEXT: Section (6) DATA {
135 ; CHECK-NEXT: 0x6 R_WEBASSEMBLY_MEMORY_ADDR_I32 myextern 0
136 ; CHECK-NEXT: 0xF R_WEBASSEMBLY_TABLE_INDEX_I32 f2
135 ; CHECK-NEXT: 0x6 R_WASM_MEMORY_ADDR_I32 myextern 0
136 ; CHECK-NEXT: 0xF R_WASM_TABLE_INDEX_I32 f2
137137 ; CHECK-NEXT: }
138138 ; CHECK-NEXT: Section (9) .debug_info {
139 ; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_abbrev 0
140 ; CHECK-NEXT: 0xC R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 0
141 ; CHECK-NEXT: 0x12 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 55
142 ; CHECK-NEXT: 0x16 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_line 0
143 ; CHECK-NEXT: 0x1A R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 62
144 ; CHECK-NEXT: 0x1E R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0
145 ; CHECK-NEXT: 0x27 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 105
146 ; CHECK-NEXT: 0x33 R_WEBASSEMBLY_MEMORY_ADDR_I32 foo 0
147 ; CHECK-NEXT: 0x3D R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 109
148 ; CHECK-NEXT: 0x44 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 113
149 ; CHECK-NEXT: 0x50 R_WEBASSEMBLY_MEMORY_ADDR_I32 ptr2 0
150 ; CHECK-NEXT: 0x5B R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0
151 ; CHECK-NEXT: 0x63 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_str 118
139 ; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_abbrev 0
140 ; CHECK-NEXT: 0xC R_WASM_SECTION_OFFSET_I32 .debug_str 0
141 ; CHECK-NEXT: 0x12 R_WASM_SECTION_OFFSET_I32 .debug_str 55
142 ; CHECK-NEXT: 0x16 R_WASM_SECTION_OFFSET_I32 .debug_line 0
143 ; CHECK-NEXT: 0x1A R_WASM_SECTION_OFFSET_I32 .debug_str 62
144 ; CHECK-NEXT: 0x1E R_WASM_FUNCTION_OFFSET_I32 f2 0
145 ; CHECK-NEXT: 0x27 R_WASM_SECTION_OFFSET_I32 .debug_str 105
146 ; CHECK-NEXT: 0x33 R_WASM_MEMORY_ADDR_I32 foo 0
147 ; CHECK-NEXT: 0x3D R_WASM_SECTION_OFFSET_I32 .debug_str 109
148 ; CHECK-NEXT: 0x44 R_WASM_SECTION_OFFSET_I32 .debug_str 113
149 ; CHECK-NEXT: 0x50 R_WASM_MEMORY_ADDR_I32 ptr2 0
150 ; CHECK-NEXT: 0x5B R_WASM_FUNCTION_OFFSET_I32 f2 0
151 ; CHECK-NEXT: 0x63 R_WASM_SECTION_OFFSET_I32 .debug_str 118
152152 ; CHECK-NEXT: }
153153 ; CHECK-NEXT: Section (11) .debug_pubnames {
154 ; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_info 0
154 ; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_info 0
155155 ; CHECK-NEXT: }
156156 ; CHECK-NEXT: Section (12) .debug_pubtypes {
157 ; CHECK-NEXT: 0x6 R_WEBASSEMBLY_SECTION_OFFSET_I32 .debug_info 0
157 ; CHECK-NEXT: 0x6 R_WASM_SECTION_OFFSET_I32 .debug_info 0
158158 ; CHECK-NEXT: }
159159 ; CHECK-NEXT: Section (13) .debug_line {
160 ; CHECK-NEXT: 0x2B R_WEBASSEMBLY_FUNCTION_OFFSET_I32 f2 0
160 ; CHECK-NEXT: 0x2B R_WASM_FUNCTION_OFFSET_I32 f2 0
161161 ; CHECK-NEXT: }
162162 ; CHECK-NEXT:]
163163 ; CHECK-NEXT:Symbols [
3434
3535 ; CHECK-NEXT: - Type: CODE
3636 ; CHECK-NEXT: Relocations:
37 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB
37 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
3838 ; CHECK-NEXT: Index: 1
3939 ; CHECK-NEXT: Offset: 0x00000006
40 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB
40 ; CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
4141 ; CHECK-NEXT: Index: 1
4242 ; CHECK-NEXT: Offset: 0x00000011
4343
1111
1212 ; CHECK: - Type: DATA
1313 ; CHECK-NEXT: Relocations:
14 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
14 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
1515 ; CHECK-NEXT: Index: 2
1616 ; CHECK-NEXT: Offset: 0x00000013
1717 ; CHECK-NEXT: Segments:
5959 ; CHECK-NEXT: Functions: [ 1, 2 ]
6060 ; CHECK: - Type: DATA
6161 ; CHECK-NEXT: Relocations:
62 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32
62 ; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
6363 ; CHECK-NEXT: Index: 3
6464 ; CHECK-NEXT: Offset: 0x00000006
2929 ; CHECK: Relocations [
3030 ; CHECK-NEXT: Section (5) CODE {
3131 ; CHECK-NEXT: Relocation {
32 ; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
32 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
3333 ; CHECK-NEXT: Offset: 0x4
3434 ; CHECK-NEXT: Symbol: import1
3535 ; CHECK-NEXT: }
3636 ; CHECK-NEXT: Relocation {
37 ; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
37 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
3838 ; CHECK-NEXT: Offset: 0xB
3939 ; CHECK-NEXT: Symbol: import2
4040 ; CHECK-NEXT: }
4141 ; CHECK-NEXT: Relocation {
42 ; CHECK-NEXT: Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB (7)
42 ; CHECK-NEXT: Type: R_WASM_GLOBAL_INDEX_LEB (7)
4343 ; CHECK-NEXT: Offset: 0x15
4444 ; CHECK-NEXT: Symbol: __stack_pointer
4545 ; CHECK-NEXT: }
4646 ; CHECK-NEXT: Relocation {
47 ; CHECK-NEXT: Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB (1)
47 ; CHECK-NEXT: Type: R_WASM_TABLE_INDEX_SLEB (1)
4848 ; CHECK-NEXT: Offset: 0x1E
4949 ; CHECK-NEXT: Symbol: import3
5050 ; CHECK-NEXT: }
6262 ; CHECK-NEXT: Functions: [ 5, 7 ]
6363 ; CHECK-NEXT: - Type: CODE
6464 ; CHECK-NEXT: Relocations:
65 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
65 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
6666 ; CHECK-NEXT: Index: 1
6767 ; CHECK-NEXT: Offset: 0x00000004
68 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
68 ; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_SLEB
6969 ; CHECK-NEXT: Index: 0
7070 ; CHECK-NEXT: Offset: 0x0000000F
71 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB
71 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB
7272 ; CHECK-NEXT: Index: 3
7373 ; CHECK-NEXT: Offset: 0x00000017
74 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
74 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
7575 ; CHECK-NEXT: Index: 4
7676 ; CHECK-NEXT: Offset: 0x0000001D
77 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
77 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
7878 ; CHECK-NEXT: Index: 6
7979 ; CHECK-NEXT: Offset: 0x0000002C
80 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
80 ; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_SLEB
8181 ; CHECK-NEXT: Index: 5
8282 ; CHECK-NEXT: Offset: 0x00000037
83 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB
83 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_SLEB
8484 ; CHECK-NEXT: Index: 3
8585 ; CHECK-NEXT: Offset: 0x0000003F
86 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
86 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
8787 ; CHECK-NEXT: Index: 4
8888 ; CHECK-NEXT: Offset: 0x00000045
8989 ; CHECK-NEXT: Functions:
2525 ; CHECK: Relocations [
2626 ; CHECK-NEXT: Section (4) CODE {
2727 ; CHECK-NEXT: Relocation {
28 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB (3)
28 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3)
2929 ; CHECK-NEXT: Offset: 0x9
3030 ; CHECK-NEXT: Symbol: b
3131 ; CHECK-NEXT: Addend: 0
3232 ; CHECK-NEXT: }
3333 ; CHECK-NEXT: Relocation {
34 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB (3)
34 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_LEB (3)
3535 ; CHECK-NEXT: Offset: 0x14
3636 ; CHECK-NEXT: Symbol: a
3737 ; CHECK-NEXT: Addend: 0
3838 ; CHECK-NEXT: }
3939 ; CHECK-NEXT: Relocation {
40 ; CHECK-NEXT: Type: R_WEBASSEMBLY_TYPE_INDEX_LEB (6)
40 ; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6)
4141 ; CHECK-NEXT: Offset: 0x1A
4242 ; CHECK-NEXT: Index: 0x1
4343 ; CHECK-NEXT: }
4444 ; CHECK-NEXT: Relocation {
45 ; CHECK-NEXT: Type: R_WEBASSEMBLY_TYPE_INDEX_LEB (6)
45 ; CHECK-NEXT: Type: R_WASM_TYPE_INDEX_LEB (6)
4646 ; CHECK-NEXT: Offset: 0x24
4747 ; CHECK-NEXT: Index: 0x0
4848 ; CHECK-NEXT: }
4949 ; CHECK-NEXT: Relocation {
50 ; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
50 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
5151 ; CHECK-NEXT: Offset: 0x2D
5252 ; CHECK-NEXT: Symbol: c
5353 ; CHECK-NEXT: }
5454 ; CHECK-NEXT: Relocation {
55 ; CHECK-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
55 ; CHECK-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
5656 ; CHECK-NEXT: Offset: 0x34
5757 ; CHECK-NEXT: Symbol: d
5858 ; CHECK-NEXT: }
1414 ; CHECK: Relocations [
1515 ; CHECK-NEXT: Section (2) DATA {
1616 ; CHECK-NEXT: Relocation {
17 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5)
17 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5)
1818 ; CHECK-NEXT: Offset: 0x13
1919 ; CHECK-NEXT: Symbol: foo
2020 ; CHECK-NEXT: Addend: 8
2121 ; CHECK-NEXT: }
2222 ; CHECK-NEXT: Relocation {
23 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5)
23 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5)
2424 ; CHECK-NEXT: Offset: 0x1C
2525 ; CHECK-NEXT: Symbol: bar
2626 ; CHECK-NEXT: Addend: -16
2727 ; CHECK-NEXT: }
2828 ; CHECK-NEXT: Relocation {
29 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5)
29 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5)
3030 ; CHECK-NEXT: Offset: 0x25
3131 ; CHECK-NEXT: Symbol: foo
3232 ; CHECK-NEXT: Addend: 0
3333 ; CHECK-NEXT: }
3434 ; CHECK-NEXT: Relocation {
35 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5)
35 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5)
3636 ; CHECK-NEXT: Offset: 0x29
3737 ; CHECK-NEXT: Symbol: foo
3838 ; CHECK-NEXT: Addend: 0
3939 ; CHECK-NEXT: }
4040 ; CHECK-NEXT: Relocation {
41 ; CHECK-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_I32 (5)
41 ; CHECK-NEXT: Type: R_WASM_MEMORY_ADDR_I32 (5)
4242 ; CHECK-NEXT: Offset: 0x2D
4343 ; CHECK-NEXT: Symbol: foo
4444 ; CHECK-NEXT: Addend: 0
1818 ; CHECK: GlobalMutable: true
1919 ; CHECK: - Type: CODE
2020 ; CHECK: Relocations:
21 ; CHECK: - Type: R_WEBASSEMBLY_GLOBAL_INDEX_LEB
21 ; CHECK: - Type: R_WASM_GLOBAL_INDEX_LEB
2222 ; CHECK: Index: 0
1010
1111 ; CHECK: - Type: DATA
1212 ; CHECK-NEXT: Relocations:
13 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
13 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
1414 ; CHECK-NEXT: Index: 0
1515 ; CHECK-NEXT: Offset: 0x0000001C
16 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
16 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
1717 ; CHECK-NEXT: Index: 1
1818 ; CHECK-NEXT: Offset: 0x00000025
1919 ; CHECK-NEXT: Segments:
7474 ; CHECK-NEXT: Functions: [ 0 ]
7575 ; CHECK-NEXT: - Type: CODE
7676 ; CHECK-NEXT: Relocations:
77 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
77 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
7878 ; CHECK-NEXT: Index: 0
7979 ; CHECK-NEXT: Offset: 0x00000009
80 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
80 ; CHECK-NEXT: - Type: R_WASM_FUNCTION_INDEX_LEB
8181 ; CHECK-NEXT: Index: 3
8282 ; CHECK-NEXT: Offset: 0x00000012
83 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB
83 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB
8484 ; CHECK-NEXT: Index: 5
8585 ; CHECK-NEXT: Offset: 0x0000001E
86 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TYPE_INDEX_LEB
86 ; CHECK-NEXT: - Type: R_WASM_TYPE_INDEX_LEB
8787 ; CHECK-NEXT: Index: 0
8888 ; CHECK-NEXT: Offset: 0x00000024
89 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_LEB
89 ; CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_LEB
9090 ; CHECK-NEXT: Index: 7
9191 ; CHECK-NEXT: Offset: 0x00000031
92 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TYPE_INDEX_LEB
92 ; CHECK-NEXT: - Type: R_WASM_TYPE_INDEX_LEB
9393 ; CHECK-NEXT: Index: 0
9494 ; CHECK-NEXT: Offset: 0x00000037
9595 ; CHECK-NEXT: Functions:
110110 ; CHECK-NEXT: Body: 410028029080808000118080808000000B
111111 ; CHECK-NEXT: - Type: DATA
112112 ; CHECK-NEXT: Relocations:
113 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32
113 ; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
114114 ; CHECK-NEXT: Index: 0
115115 ; CHECK-NEXT: Offset: 0x0000000F
116 ; CHECK-NEXT: - Type: R_WEBASSEMBLY_TABLE_INDEX_I32
116 ; CHECK-NEXT: - Type: R_WASM_TABLE_INDEX_I32
117117 ; CHECK-NEXT: Index: 3
118118 ; CHECK-NEXT: Offset: 0x00000018
119119 ; CHECK-NEXT: Segments:
5959 ELF-MIPSEL: R_MIPS_CALL16 SomeOtherFunction
6060
6161 WASM: CODE
62 WASM-NEXT: R_WEBASSEMBLY_MEMORY_ADDR_SLEB .L.str
63 WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB puts
64 WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB .LSomeOtherFunction_bitcast
65 WASM-NEXT: R_WEBASSEMBLY_FUNCTION_INDEX_LEB SomeOtherFunction
62 WASM-NEXT: R_WASM_MEMORY_ADDR_SLEB .L.str
63 WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB puts
64 WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB .LSomeOtherFunction_bitcast
65 WASM-NEXT: R_WASM_FUNCTION_INDEX_LEB SomeOtherFunction
6666
6767 ELF-complex-x86-64: .text
6868 ELF-complex-x86-64-NEXT: R_X86_64_8 .data-4
1919 - 1
2020 - Type: CODE
2121 Relocations:
22 - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
22 - Type: R_WASM_TABLE_INDEX_SLEB
2323 Index: 0
2424 Offset: 0x00000006
25 - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
25 - Type: R_WASM_FUNCTION_INDEX_LEB
2626 Index: 1
2727 Offset: 0x00000025
2828 Functions:
6868 # CHECK: - I64
6969 # CHECK: - Type: CODE
7070 # CHECK: Relocations:
71 # CHECK: - Type: R_WEBASSEMBLY_TABLE_INDEX_SLEB
71 # CHECK: - Type: R_WASM_TABLE_INDEX_SLEB
7272 # CHECK: Index: 0
7373 # CHECK: Offset: 0x00000006
74 # CHECK: - Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB
74 # CHECK: - Type: R_WASM_FUNCTION_INDEX_LEB
7575 # CHECK: Index: 1
7676 # CHECK: Offset: 0x00000025
7777 # CHECK: Functions:
1313 Value: 4
1414 Content: '10001000'
1515 Relocations:
16 - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
16 - Type: R_WASM_MEMORY_ADDR_I32
1717 Index: 0
1818 Offset: 0x00000006
1919 Addend: 8
20 - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
20 - Type: R_WASM_MEMORY_ADDR_I32
2121 Index: 0
2222 Offset: 0x00000006
2323 Addend: -6
3939 # CHECK: Sections:
4040 # CHECK: - Type: DATA
4141 # CHECK-NEXT: Relocations:
42 # CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
42 # CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
4343 # CHECK-NEXT: Index: 0
4444 # CHECK-NEXT: Offset: 0x00000006
4545 # CHECK-NEXT: Addend: 8
46 # CHECK-NEXT: - Type: R_WEBASSEMBLY_MEMORY_ADDR_I32
46 # CHECK-NEXT: - Type: R_WASM_MEMORY_ADDR_I32
4747 # CHECK-NEXT: Index: 0
4848 # CHECK-NEXT: Offset: 0x00000006
4949 # CHECK-NEXT: Addend: -6
2222 SigIndex: 1
2323 - Type: CODE
2424 Relocations:
25 - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB
25 - Type: R_WASM_EVENT_INDEX_LEB
2626 Index: 1
2727 Offset: 0x00000006
2828 Functions:
6868 # CHECK-NEXT: SigIndex: 1
6969 # CHECK-NEXT: - Type: CODE
7070 # CHECK-NEXT: Relocations:
71 # CHECK-NEXT: - Type: R_WEBASSEMBLY_EVENT_INDEX_LEB
71 # CHECK-NEXT: - Type: R_WASM_EVENT_INDEX_LEB
7272 # CHECK-NEXT: Index: 1
7373 # CHECK-NEXT: Offset: 0x00000006
7474 # CHECK-NEXT: Functions:
99 }
1010
1111 ; CHECK: RELOCATION RECORDS FOR [CODE]:
12 ; CHECK-NEXT: 00000006 R_WEBASSEMBLY_TYPE_INDEX_LEB 1+0
12 ; CHECK-NEXT: 00000006 R_WASM_TYPE_INDEX_LEB 1+0
1313
1414 ; CHECK: RELOCATION RECORDS FOR [DATA]:
15 ; CHECK-NEXT: 00000006 R_WEBASSEMBLY_MEMORY_ADDR_I32 foo+0
15 ; CHECK-NEXT: 00000006 R_WASM_MEMORY_ADDR_I32 foo+0
288288 WASM: Relocations [
289289 WASM-NEXT: Section (4) CODE {
290290 WASM-NEXT: Relocation {
291 WASM-NEXT: Type: R_WEBASSEMBLY_MEMORY_ADDR_SLEB (4)
291 WASM-NEXT: Type: R_WASM_MEMORY_ADDR_SLEB (4)
292292 WASM-NEXT: Offset: 0x4
293293 WASM-NEXT: Symbol: .L.str
294294 WASM-NEXT: Addend: 0
295295 WASM-NEXT: }
296296 WASM-NEXT: Relocation {
297 WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
297 WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
298298 WASM-NEXT: Offset: 0xA
299299 WASM-NEXT: Symbol: puts
300300 WASM-NEXT: }
301301 WASM-NEXT: Relocation {
302 WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
302 WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
303303 WASM-NEXT: Offset: 0x11
304304 WASM-NEXT: Symbol: .LSomeOtherFunction_bitcast
305305 WASM-NEXT: }
306306 WASM-NEXT: Relocation {
307 WASM-NEXT: Type: R_WEBASSEMBLY_FUNCTION_INDEX_LEB (0)
307 WASM-NEXT: Type: R_WASM_FUNCTION_INDEX_LEB (0)
308308 WASM-NEXT: Offset: 0x1E
309309 WASM-NEXT: Symbol: SomeOtherFunction
310310 WASM-NEXT: }
3535 raw_string_ostream Fmt(FmtBuf);
3636 if (SI == Obj->symbol_end()) {
3737 // Not all wasm relocations have symbols associated with them.
38 // In particular R_WEBASSEMBLY_TYPE_INDEX_LEB.
38 // In particular R_WASM_TYPE_INDEX_LEB.
3939 Fmt << Rel.Index;
4040 } else {
4141 Expected SymNameOrErr = SI->getName();
7979
8080 bool HasAddend = false;
8181 switch (RelocType) {
82 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
83 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
84 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
85 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
86 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
82 case wasm::R_WASM_MEMORY_ADDR_LEB:
83 case wasm::R_WASM_MEMORY_ADDR_SLEB:
84 case wasm::R_WASM_MEMORY_ADDR_I32:
85 case wasm::R_WASM_FUNCTION_OFFSET_I32:
86 case wasm::R_WASM_SECTION_OFFSET_I32:
8787 HasAddend = true;
8888 break;
8989 default:
525525 encodeULEB128(Reloc.Offset, OS);
526526 encodeULEB128(Reloc.Index, OS);
527527 switch (Reloc.Type) {
528 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_LEB:
529 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
530 case wasm::R_WEBASSEMBLY_MEMORY_ADDR_I32:
531 case wasm::R_WEBASSEMBLY_FUNCTION_OFFSET_I32:
532 case wasm::R_WEBASSEMBLY_SECTION_OFFSET_I32:
528 case wasm::R_WASM_MEMORY_ADDR_LEB:
529 case wasm::R_WASM_MEMORY_ADDR_SLEB:
530 case wasm::R_WASM_MEMORY_ADDR_I32:
531 case wasm::R_WASM_FUNCTION_OFFSET_I32:
532 case wasm::R_WASM_SECTION_OFFSET_I32:
533533 encodeULEB128(Reloc.Addend, OS);
534534 }
535535 }