zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit a9f1b994bd143b24aad69b79b10fca43388b05ed (tree)
parent d37cb6062163e45bee8d95890a2f94fb477c8547
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Wed, 13 Sep 2023 21:39:54 +0200

elf: allocate locals and globals in objects

Diffstat:
Msrc/link/Elf.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/link/Elf.zig b/src/link/Elf.zig @@ -1666,7 +1666,7 @@ fn allocateObjects(self: *Elf) !void { const local = self.symbol(local_index); const atom_ptr = local.atom(self) orelse continue; if (!atom_ptr.alive) continue; - local.value = atom_ptr.value; + local.value += atom_ptr.value; } for (object.globals()) |global_index| { @@ -1674,7 +1674,7 @@ fn allocateObjects(self: *Elf) !void { const atom_ptr = global.atom(self) orelse continue; if (!atom_ptr.alive) continue; if (global.file_index == index) { - global.value = atom_ptr.value; + global.value += atom_ptr.value; } } }