aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm/types.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-02-18 21:47:57 +0100
committerLuuk de Gram <luuk@degram.dev>2022-02-23 16:07:36 +0100
commit2b0431a8d3933a46fecba2bf064bf45df54a111d (patch)
tree1ec5e1afa83d482e751e603488e8bf19cc7fa8bc /src/link/Wasm/types.zig
parentdaf741318e51c9eea38cad80c996536093f0fcef (diff)
downloadzig-2b0431a8d3933a46fecba2bf064bf45df54a111d.tar.gz
zig-2b0431a8d3933a46fecba2bf064bf45df54a111d.zip
wasm-linker: Do not merge data segments for obj
When creating a relocatable object file, we do no longer perform the following actions: - Merge data segments - Calculate stack size - Relocations We now also make the stack pointer symbol `undefined` for this use case as well as add the symbol as an import.
Diffstat (limited to 'src/link/Wasm/types.zig')
-rw-r--r--src/link/Wasm/types.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/link/Wasm/types.zig b/src/link/Wasm/types.zig
index 2a01e278d7..c8fec25bd5 100644
--- a/src/link/Wasm/types.zig
+++ b/src/link/Wasm/types.zig
@@ -93,7 +93,8 @@ pub const Segment = struct {
/// Bitfield containing flags for a segment
flags: u32,
- pub fn outputName(self: Segment) []const u8 {
+ pub fn outputName(self: Segment, merge_segments: bool) []const u8 {
+ if (!merge_segments) return self.name;
if (std.mem.startsWith(u8, self.name, ".rodata.")) {
return ".rodata";
} else if (std.mem.startsWith(u8, self.name, ".text.")) {