[PATCH] D64947: [WebAssembly] fix bug in finding .tdata segment
Guanzhong Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 18 14:20:59 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366500: [WebAssembly] fix bug in finding .tdata segment (authored by quantum, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D64947?vs=210669&id=210678#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64947/new/
https://reviews.llvm.org/D64947
Files:
lld/trunk/test/wasm/tls.ll
lld/trunk/wasm/Writer.cpp
Index: lld/trunk/test/wasm/tls.ll
===================================================================
--- lld/trunk/test/wasm/tls.ll
+++ lld/trunk/test/wasm/tls.ll
@@ -2,8 +2,8 @@
target triple = "wasm32-unknown-unknown"
- at tls1 = thread_local(localexec) global i32 1, align 4
@no_tls = global i32 0, align 4
+ at tls1 = thread_local(localexec) global i32 1, align 4
@tls2 = thread_local(localexec) global i32 1, align 4
define i32* @tls1_addr() {
@@ -49,7 +49,7 @@
; CHECK-NEXT: Body: 0B
; CHECK-NEXT: - Index: 1
; CHECK-NEXT: Locals: []
-; CHECK-NEXT: Body: 20002401200041004108FC0800000B
+; CHECK-NEXT: Body: 20002401200041004108FC0801000B
; Expected body of __wasm_init_tls:
; local.get 0
@@ -57,7 +57,7 @@
; local.get 0
; i32.const 0
; i32.const 8
-; memory.init 0, 0
+; memory.init 1, 0
; end
; CHECK-NEXT: - Index: 2
Index: lld/trunk/wasm/Writer.cpp
===================================================================
--- lld/trunk/wasm/Writer.cpp
+++ lld/trunk/wasm/Writer.cpp
@@ -771,9 +771,10 @@
OutputSegment *tlsSeg = nullptr;
for (auto *seg : segments) {
- if (seg->name == ".tdata")
+ if (seg->name == ".tdata") {
tlsSeg = seg;
- break;
+ break;
+ }
}
writeUleb128(os, 0, "num locals");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64947.210678.patch
Type: text/x-patch
Size: 1389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190718/58978e98/attachment-0001.bin>
More information about the llvm-commits
mailing list