[llvm-branch-commits] [lld] r366707 - Merging r366500:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jul 22 10:48:04 PDT 2019
Author: hans
Date: Mon Jul 22 10:48:03 2019
New Revision: 366707
URL: http://llvm.org/viewvc/llvm-project?rev=366707&view=rev
Log:
Merging r366500:
------------------------------------------------------------------------
r366500 | quantum | 2019-07-18 23:18:24 +0200 (Thu, 18 Jul 2019) | 13 lines
[WebAssembly] fix bug in finding .tdata segment
Summary: Fix bug in `wasm-ld`'s `Writer::createInitTLSFunction` that only finds `.tdata` if it's the first section.
Reviewers: tlively, aheejin, sbc100
Reviewed By: sbc100
Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64947
------------------------------------------------------------------------
Modified:
lld/branches/release_90/ (props changed)
lld/branches/release_90/test/wasm/tls.ll
lld/branches/release_90/wasm/Writer.cpp
Propchange: lld/branches/release_90/
------------------------------------------------------------------------------
svn:mergeinfo = /lld/trunk:366500
Modified: lld/branches/release_90/test/wasm/tls.ll
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/test/wasm/tls.ll?rev=366707&r1=366706&r2=366707&view=diff
==============================================================================
--- lld/branches/release_90/test/wasm/tls.ll (original)
+++ lld/branches/release_90/test/wasm/tls.ll Mon Jul 22 10:48:03 2019
@@ -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 @@ define i32* @tls2_addr() {
; 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 @@ define i32* @tls2_addr() {
; local.get 0
; i32.const 0
; i32.const 8
-; memory.init 0, 0
+; memory.init 1, 0
; end
; CHECK-NEXT: - Index: 2
Modified: lld/branches/release_90/wasm/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/wasm/Writer.cpp?rev=366707&r1=366706&r2=366707&view=diff
==============================================================================
--- lld/branches/release_90/wasm/Writer.cpp (original)
+++ lld/branches/release_90/wasm/Writer.cpp Mon Jul 22 10:48:03 2019
@@ -771,9 +771,10 @@ void Writer::createInitTLSFunction() {
OutputSegment *tlsSeg = nullptr;
for (auto *seg : segments) {
- if (seg->name == ".tdata")
+ if (seg->name == ".tdata") {
tlsSeg = seg;
- break;
+ break;
+ }
}
writeUleb128(os, 0, "num locals");
More information about the llvm-branch-commits
mailing list