mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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
This commit is contained in:
parent
cf898e242a
commit
24bdb42a23
1 changed files with 10 additions and 6 deletions
|
|
@ -70,23 +70,27 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
|
|||
check_exe.checkExact("type function");
|
||||
if (optimize_mode == .Debug) {
|
||||
check_exe.checkExact("name __wasm_init_memory");
|
||||
check_exe.checkExact("name __wasm_init_tls");
|
||||
}
|
||||
check_exe.checkExact("name __wasm_init_tls");
|
||||
check_exe.checkExact("type global");
|
||||
|
||||
// In debug mode the symbol __tls_base is resolved to an undefined symbol
|
||||
// from the object file, hence its placement differs than in release modes
|
||||
// where the entire tls segment is optimized away, and tls_base will have
|
||||
// its original position.
|
||||
check_exe.checkExact("name __tls_base");
|
||||
check_exe.checkExact("name __tls_size");
|
||||
check_exe.checkExact("name __tls_align");
|
||||
|
||||
check_exe.checkExact("type data_segment");
|
||||
if (optimize_mode == .Debug) {
|
||||
check_exe.checkExact("name __tls_base");
|
||||
check_exe.checkExact("name __tls_size");
|
||||
check_exe.checkExact("name __tls_align");
|
||||
|
||||
check_exe.checkExact("type data_segment");
|
||||
check_exe.checkExact("names 1");
|
||||
check_exe.checkExact("index 0");
|
||||
check_exe.checkExact("name .tdata");
|
||||
} else {
|
||||
check_exe.checkNotPresent("name __tls_base");
|
||||
check_exe.checkNotPresent("name __tls_size");
|
||||
check_exe.checkNotPresent("name __tls_align");
|
||||
}
|
||||
|
||||
test_step.dependOn(&check_exe.step);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue