From dbde746f9d95f2dbc8872e2d6283c2db64ac7519 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 13 Sep 2023 19:05:22 +0200 Subject: elf: parse archives --- src/link/Elf/Object.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/link/Elf/Object.zig') diff --git a/src/link/Elf/Object.zig b/src/link/Elf/Object.zig index b0a6ef2a1c..32c96b8d95 100644 --- a/src/link/Elf/Object.zig +++ b/src/link/Elf/Object.zig @@ -485,9 +485,9 @@ pub fn claimUnresolved(self: *Object, elf_file: *Elf) void { pub fn resetGlobals(self: *Object, elf_file: *Elf) void { for (self.globals()) |index| { const global = elf_file.symbol(index); - const name = global.name; + const off = global.name_offset; global.* = .{}; - global.name = name; + global.name_offset = off; } } @@ -499,7 +499,7 @@ pub fn markLive(self: *Object, elf_file: *Elf) void { if (sym.st_bind() == elf.STB_WEAK) continue; const global = elf_file.symbol(index); - const file = global.getFile(elf_file) orelse continue; + const file = global.file(elf_file) orelse continue; const should_keep = sym.st_shndx == elf.SHN_UNDEF or (sym.st_shndx == elf.SHN_COMMON and global.elfSym(elf_file).st_shndx != elf.SHN_COMMON); if (should_keep and !file.isAlive()) { -- cgit v1.2.3