authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-09-13 21:39:54+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-09-13 21:51:43+02:00
loga9f1b994bd143b24aad69b79b10fca43388b05ed
tree368cea3bc1318fb81af324683fdc0d62a167dbc1
parentd37cb6062163e45bee8d95890a2f94fb477c8547

elf: allocate locals and globals in objects


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

src/link/Elf.zig+2-2
...@@ -1666,7 +1666,7 @@ fn allocateObjects(self: *Elf) !void {...@@ -1666,7 +1666,7 @@ fn allocateObjects(self: *Elf) !void {
1666 const local = self.symbol(local_index);1666 const local = self.symbol(local_index);
1667 const atom_ptr = local.atom(self) orelse continue;1667 const atom_ptr = local.atom(self) orelse continue;
1668 if (!atom_ptr.alive) continue;1668 if (!atom_ptr.alive) continue;
1669 local.value = atom_ptr.value;1669 local.value += atom_ptr.value;
1670 }1670 }
16711671
1672 for (object.globals()) |global_index| {1672 for (object.globals()) |global_index| {
...@@ -1674,7 +1674,7 @@ fn allocateObjects(self: *Elf) !void {...@@ -1674,7 +1674,7 @@ fn allocateObjects(self: *Elf) !void {
1674 const atom_ptr = global.atom(self) orelse continue;1674 const atom_ptr = global.atom(self) orelse continue;
1675 if (!atom_ptr.alive) continue;1675 if (!atom_ptr.alive) continue;
1676 if (global.file_index == index) {1676 if (global.file_index == index) {
1677 global.value = atom_ptr.value;1677 global.value += atom_ptr.value;
1678 }1678 }
1679 }1679 }
1680 }1680 }