authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 19:43:31-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-01-15 19:43:31-08:00
log605311211b457d9c9a08d354c8fbe40257c4d649
treefb0e9b136cb0283a472579bc20aa560090d997cb
parent744bb5d16a1acdabb7c078f7a1a30eefeac733cc

wasm linker: omit data count section when value is zero


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

src/link/Wasm/Flush.zig+1-1
...@@ -820,7 +820,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {...@@ -820,7 +820,7 @@ pub fn finish(f: *Flush, wasm: *Wasm) !void {
820 }820 }
821821
822 // When the shared-memory option is enabled, we *must* emit the 'data count' section.822 // When the shared-memory option is enabled, we *must* emit the 'data count' section.
823 {823 if (f.data_segment_groups.items.len > 0) {
824 const header_offset = try reserveVecSectionHeader(gpa, binary_bytes);824 const header_offset = try reserveVecSectionHeader(gpa, binary_bytes);
825 replaceVecSectionHeader(binary_bytes, header_offset, .data_count, @intCast(f.data_segment_groups.items.len));825 replaceVecSectionHeader(binary_bytes, header_offset, .data_count, @intCast(f.data_segment_groups.items.len));
826 }826 }