authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 19:44:20-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 19:44:20-08:00
log24bdb42a23828d71238370af5d16a2421bf3216f
treea4edfb3e76eee5525a1f9a9386c53144ee7647dc
parentcf898e242a32b589e63a8de6674a5c2d6f5225bc

test/link/wasm/shared-memory: update to better linker behavior

now it's smarter about omitting tls stuff if there end up being no TLS data sections

1 files changed, 10 insertions(+), 6 deletions(-)

test/link/wasm/shared-memory/build.zig+10-6
......@@ -70,23 +70,27 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
7070 check_exe.checkExact("type function");
7171 if (optimize_mode == .Debug) {
7272 check_exe.checkExact("name __wasm_init_memory");
73 check_exe.checkExact("name __wasm_init_tls");
7374 }
74 check_exe.checkExact("name __wasm_init_tls");
7575 check_exe.checkExact("type global");
7676
7777 // In debug mode the symbol __tls_base is resolved to an undefined symbol
7878 // from the object file, hence its placement differs than in release modes
7979 // where the entire tls segment is optimized away, and tls_base will have
8080 // its original position.
81 check_exe.checkExact("name __tls_base");
82 check_exe.checkExact("name __tls_size");
83 check_exe.checkExact("name __tls_align");
84
85 check_exe.checkExact("type data_segment");
8681 if (optimize_mode == .Debug) {
82 check_exe.checkExact("name __tls_base");
83 check_exe.checkExact("name __tls_size");
84 check_exe.checkExact("name __tls_align");
85
86 check_exe.checkExact("type data_segment");
8787 check_exe.checkExact("names 1");
8888 check_exe.checkExact("index 0");
8989 check_exe.checkExact("name .tdata");
90 } else {
91 check_exe.checkNotPresent("name __tls_base");
92 check_exe.checkNotPresent("name __tls_size");
93 check_exe.checkNotPresent("name __tls_align");
9094 }
9195
9296 test_step.dependOn(&check_exe.step);