[PATCH] D41840: [WebAssembly] MC: Use zero for provisional value of undefined symbols
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 9 14:45:28 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL322130: [WebAssembly] MC: Use zero for provisional value of undefined symbols (authored by sbc, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D41840?vs=128992&id=129166#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41840
Files:
llvm/trunk/lib/MC/WasmObjectWriter.cpp
llvm/trunk/test/MC/WebAssembly/external-data.ll
llvm/trunk/test/MC/WebAssembly/init-fini-array.ll
Index: llvm/trunk/test/MC/WebAssembly/init-fini-array.ll
===================================================================
--- llvm/trunk/test/MC/WebAssembly/init-fini-array.ll
+++ llvm/trunk/test/MC/WebAssembly/init-fini-array.ll
@@ -116,13 +116,13 @@
; CHECK-NEXT: Body: 1080808080000B
; CHECK-NEXT: - Index: 6
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 0240418080808000410041FFFFFFFF7F1081808080000D000F0B00000B
+; CHECK-NEXT: Body: 024041808080800041004180808080001081808080000D000F0B00000B
; CHECK-NEXT: - Index: 7
; CHECK-NEXT: Locals:
; CHECK-NEXT: Body: 1082808080000B
; CHECK-NEXT: - Index: 8
; CHECK-NEXT: Locals:
-; CHECK-NEXT: Body: 0240418180808000410041FFFFFFFF7F1081808080000D000F0B00000B
+; CHECK-NEXT: Body: 024041818080800041004180808080001081808080000D000F0B00000B
; CHECK-NEXT: - Type: DATA
; CHECK-NEXT: Segments:
; CHECK-NEXT: - SectionOffset: 6
Index: llvm/trunk/test/MC/WebAssembly/external-data.ll
===================================================================
--- llvm/trunk/test/MC/WebAssembly/external-data.ll
+++ llvm/trunk/test/MC/WebAssembly/external-data.ll
@@ -24,4 +24,4 @@
; CHECK-NEXT: Offset:
; CHECK-NEXT: Opcode: I32_CONST
; CHECK-NEXT: Value: 8
-; CHECK-NEXT: Content: FFFFFFFF
+; CHECK-NEXT: Content: '00000000'
Index: llvm/trunk/lib/MC/WasmObjectWriter.cpp
===================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp
@@ -492,9 +492,9 @@
WasmObjectWriter::getProvisionalValue(const WasmRelocationEntry &RelEntry) {
const MCSymbolWasm *Sym = ResolveSymbol(*RelEntry.Symbol);
- // For undefined symbols, use a hopefully invalid value.
+ // For undefined symbols, use zero
if (!Sym->isDefined(/*SetUsed=*/false))
- return UINT32_MAX;
+ return 0;
uint32_t GlobalIndex = SymbolIndices[Sym];
const WasmGlobal& Global = Globals[GlobalIndex - NumGlobalImports];
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41840.129166.patch
Type: text/x-patch
Size: 2273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180109/4064c3e7/attachment.bin>
More information about the llvm-commits
mailing list