| author | |
| committer | |
| log | da60159d85f2b23e35b62f0626163d798413916f |
| tree | a539ff934e8bb2a472eb3b04797ac4dfa611363a |
| parent | acb91f4b30e6cbb14bb81406ca6ca71241dc3a98 |
3 files changed, 100 insertions(+), 106 deletions(-)
src/link/Dwarf.zig+48-37| ... | ... | @@ -375,12 +375,17 @@ pub const Section = struct { |
| 375 | 375 | fn resize(sec: *Section, dwarf: *Dwarf, len: u64) UpdateError!void { |
| 376 | 376 | if (len <= sec.len) return; |
| 377 | 377 | if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| 378 | const zo = elf_file.zigObjectPtr().?; | |
| 379 | const atom = zo.symbol(sec.index).atom(elf_file).?; | |
| 380 | const shndx = atom.output_section_index; | |
| 378 | 381 | if (sec == &dwarf.debug_frame.section) |
| 379 | try elf_file.growAllocSection(sec.index, len) | |
| 382 | try elf_file.growAllocSection(shndx, len) | |
| 380 | 383 | else |
| 381 | try elf_file.growNonAllocSection(sec.index, len, @intCast(sec.alignment.toByteUnits().?), true); | |
| 382 | const shdr = &elf_file.sections.items(.shdr)[sec.index]; | |
| 383 | sec.off = shdr.sh_offset; | |
| 384 | try elf_file.growNonAllocSection(shndx, len, @intCast(sec.alignment.toByteUnits().?), true); | |
| 385 | const shdr = elf_file.sections.items(.shdr)[shndx]; | |
| 386 | atom.size = shdr.sh_size; | |
| 387 | atom.alignment = InternPool.Alignment.fromNonzeroByteUnits(shdr.sh_addralign); | |
| 388 | sec.off = shdr.sh_offset + @as(u64, @intCast(atom.value)); | |
| 384 | 389 | sec.len = shdr.sh_size; |
| 385 | 390 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { |
| 386 | 391 | const header = if (macho_file.d_sym) |*d_sym| header: { |
| ... | ... | @@ -402,7 +407,11 @@ pub const Section = struct { |
| 402 | 407 | sec.off += len; |
| 403 | 408 | sec.len -= len; |
| 404 | 409 | if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| 405 | const shdr = &elf_file.sections.items(.shdr)[sec.index]; | |
| 410 | const zo = elf_file.zigObjectPtr().?; | |
| 411 | const atom = zo.symbol(sec.index).atom(elf_file).?; | |
| 412 | const shndx = atom.output_section_index; | |
| 413 | const shdr = &elf_file.sections.items(.shdr)[shndx]; | |
| 414 | atom.size = sec.len; | |
| 406 | 415 | shdr.sh_offset = sec.off; |
| 407 | 416 | shdr.sh_size = sec.len; |
| 408 | 417 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { |
| ... | ... | @@ -891,9 +900,11 @@ const Entry = struct { |
| 891 | 900 | if (std.debug.runtime_safety) { |
| 892 | 901 | log.err("missing {} from {s}", .{ |
| 893 | 902 | @as(Entry.Index, @enumFromInt(entry - unit.entries.items.ptr)), |
| 894 | std.mem.sliceTo(if (dwarf.bin_file.cast(.elf)) |elf_file| | |
| 895 | elf_file.shstrtab.items[elf_file.sections.items(.shdr)[sec.index].sh_name..] | |
| 896 | else if (dwarf.bin_file.cast(.macho)) |macho_file| | |
| 903 | std.mem.sliceTo(if (dwarf.bin_file.cast(.elf)) |elf_file| sh_name: { | |
| 904 | const zo = elf_file.zigObjectPtr().?; | |
| 905 | const shndx = zo.symbol(sec.index).atom(elf_file).?.output_section_index; | |
| 906 | break :sh_name elf_file.shstrtab.items[elf_file.sections.items(.shdr)[shndx].sh_name..]; | |
| 907 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| | |
| 897 | 908 | if (macho_file.d_sym) |*d_sym| |
| 898 | 909 | &d_sym.sections.items[sec.index].segname |
| 899 | 910 | else |
| ... | ... | @@ -961,7 +972,8 @@ const Entry = struct { |
| 961 | 972 | .none, .debug_frame => {}, |
| 962 | 973 | .eh_frame => return if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| 963 | 974 | const zo = elf_file.zigObjectPtr().?; |
| 964 | const entry_addr: i64 = @intCast(entry_off - sec.off + elf_file.shdrs.items[sec.index].sh_addr); | |
| 975 | const shndx = zo.symbol(sec.index).atom(elf_file).?.output_section_index; | |
| 976 | const entry_addr: i64 = @intCast(entry_off - sec.off + elf_file.shdrs.items[shndx].sh_addr); | |
| 965 | 977 | for (entry.external_relocs.items) |reloc| { |
| 966 | 978 | const symbol = zo.symbol(reloc.target_sym); |
| 967 | 979 | try dwarf.resolveReloc( |
| ... | ... | @@ -1877,34 +1889,7 @@ pub fn init(lf: *link.File, format: DW.Format) Dwarf { |
| 1877 | 1889 | } |
| 1878 | 1890 | |
| 1879 | 1891 | pub fn reloadSectionMetadata(dwarf: *Dwarf) void { |
| 1880 | if (dwarf.bin_file.cast(.elf)) |elf_file| { | |
| 1881 | for ([_]*Section{ | |
| 1882 | &dwarf.debug_abbrev.section, | |
| 1883 | &dwarf.debug_aranges.section, | |
| 1884 | &dwarf.debug_frame.section, | |
| 1885 | &dwarf.debug_info.section, | |
| 1886 | &dwarf.debug_line.section, | |
| 1887 | &dwarf.debug_line_str.section, | |
| 1888 | &dwarf.debug_loclists.section, | |
| 1889 | &dwarf.debug_rnglists.section, | |
| 1890 | &dwarf.debug_str.section, | |
| 1891 | }, [_]u32{ | |
| 1892 | elf_file.debug_abbrev_section_index.?, | |
| 1893 | elf_file.debug_aranges_section_index.?, | |
| 1894 | elf_file.eh_frame_section_index.?, | |
| 1895 | elf_file.debug_info_section_index.?, | |
| 1896 | elf_file.debug_line_section_index.?, | |
| 1897 | elf_file.debug_line_str_section_index.?, | |
| 1898 | elf_file.debug_loclists_section_index.?, | |
| 1899 | elf_file.debug_rnglists_section_index.?, | |
| 1900 | elf_file.debug_str_section_index.?, | |
| 1901 | }) |sec, section_index| { | |
| 1902 | const shdr = &elf_file.sections.items(.shdr)[section_index]; | |
| 1903 | sec.index = section_index; | |
| 1904 | sec.off = shdr.sh_offset; | |
| 1905 | sec.len = shdr.sh_size; | |
| 1906 | } | |
| 1907 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { | |
| 1892 | if (dwarf.bin_file.cast(.macho)) |macho_file| { | |
| 1908 | 1893 | if (macho_file.d_sym) |*d_sym| { |
| 1909 | 1894 | for ([_]*Section{ |
| 1910 | 1895 | &dwarf.debug_abbrev.section, |
| ... | ... | @@ -1960,6 +1945,32 @@ pub fn reloadSectionMetadata(dwarf: *Dwarf) void { |
| 1960 | 1945 | } |
| 1961 | 1946 | |
| 1962 | 1947 | pub fn initMetadata(dwarf: *Dwarf) UpdateError!void { |
| 1948 | if (dwarf.bin_file.cast(.elf)) |elf_file| { | |
| 1949 | const zo = elf_file.zigObjectPtr().?; | |
| 1950 | for ([_]*Section{ | |
| 1951 | &dwarf.debug_abbrev.section, | |
| 1952 | &dwarf.debug_aranges.section, | |
| 1953 | &dwarf.debug_frame.section, | |
| 1954 | &dwarf.debug_info.section, | |
| 1955 | &dwarf.debug_line.section, | |
| 1956 | &dwarf.debug_line_str.section, | |
| 1957 | &dwarf.debug_loclists.section, | |
| 1958 | &dwarf.debug_rnglists.section, | |
| 1959 | &dwarf.debug_str.section, | |
| 1960 | }, [_]u32{ | |
| 1961 | zo.debug_abbrev_index.?, | |
| 1962 | zo.debug_aranges_index.?, | |
| 1963 | zo.eh_frame_index.?, | |
| 1964 | zo.debug_info_index.?, | |
| 1965 | zo.debug_line_index.?, | |
| 1966 | zo.debug_line_str_index.?, | |
| 1967 | zo.debug_loclists_index.?, | |
| 1968 | zo.debug_rnglists_index.?, | |
| 1969 | zo.debug_str_index.?, | |
| 1970 | }) |sec, sym_index| { | |
| 1971 | sec.index = sym_index; | |
| 1972 | } | |
| 1973 | } | |
| 1963 | 1974 | dwarf.reloadSectionMetadata(); |
| 1964 | 1975 | |
| 1965 | 1976 | dwarf.debug_abbrev.section.pad_to_ideal = false; |
src/link/Elf.zig+25-36| ... | ... | @@ -114,15 +114,6 @@ rela_plt: std.ArrayListUnmanaged(elf.Elf64_Rela) = .{}, |
| 114 | 114 | /// Applies only to a relocatable. |
| 115 | 115 | comdat_group_sections: std.ArrayListUnmanaged(ComdatGroupSection) = .{}, |
| 116 | 116 | |
| 117 | debug_info_section_index: ?u32 = null, | |
| 118 | debug_abbrev_section_index: ?u32 = null, | |
| 119 | debug_str_section_index: ?u32 = null, | |
| 120 | debug_aranges_section_index: ?u32 = null, | |
| 121 | debug_line_section_index: ?u32 = null, | |
| 122 | debug_line_str_section_index: ?u32 = null, | |
| 123 | debug_loclists_section_index: ?u32 = null, | |
| 124 | debug_rnglists_section_index: ?u32 = null, | |
| 125 | ||
| 126 | 117 | copy_rel_section_index: ?u32 = null, |
| 127 | 118 | dynamic_section_index: ?u32 = null, |
| 128 | 119 | dynstrtab_section_index: ?u32 = null, |
| ... | ... | @@ -636,24 +627,31 @@ pub fn growNonAllocSection( |
| 636 | 627 | } |
| 637 | 628 | |
| 638 | 629 | pub fn markDirty(self: *Elf, shdr_index: u32) void { |
| 639 | const zig_object = self.zigObjectPtr().?; | |
| 640 | if (zig_object.dwarf) |_| { | |
| 641 | if (self.debug_info_section_index.? == shdr_index) { | |
| 642 | zig_object.debug_info_section_dirty = true; | |
| 643 | } else if (self.debug_abbrev_section_index.? == shdr_index) { | |
| 644 | zig_object.debug_abbrev_section_dirty = true; | |
| 645 | } else if (self.debug_str_section_index.? == shdr_index) { | |
| 646 | zig_object.debug_str_section_dirty = true; | |
| 647 | } else if (self.debug_aranges_section_index.? == shdr_index) { | |
| 648 | zig_object.debug_aranges_section_dirty = true; | |
| 649 | } else if (self.debug_line_section_index.? == shdr_index) { | |
| 650 | zig_object.debug_line_section_dirty = true; | |
| 651 | } else if (self.debug_line_str_section_index.? == shdr_index) { | |
| 652 | zig_object.debug_line_str_section_dirty = true; | |
| 653 | } else if (self.debug_loclists_section_index.? == shdr_index) { | |
| 654 | zig_object.debug_loclists_section_dirty = true; | |
| 655 | } else if (self.debug_rnglists_section_index.? == shdr_index) { | |
| 656 | zig_object.debug_rnglists_section_dirty = true; | |
| 630 | if (self.zigObjectPtr()) |zo| { | |
| 631 | for ([_]?Symbol.Index{ | |
| 632 | zo.debug_info_index, | |
| 633 | zo.debug_abbrev_index, | |
| 634 | zo.debug_aranges_index, | |
| 635 | zo.debug_str_index, | |
| 636 | zo.debug_line_index, | |
| 637 | zo.debug_line_str_index, | |
| 638 | zo.debug_loclists_index, | |
| 639 | zo.debug_rnglists_index, | |
| 640 | }, [_]*bool{ | |
| 641 | &zo.debug_info_section_dirty, | |
| 642 | &zo.debug_abbrev_section_dirty, | |
| 643 | &zo.debug_aranges_section_dirty, | |
| 644 | &zo.debug_str_section_dirty, | |
| 645 | &zo.debug_line_section_dirty, | |
| 646 | &zo.debug_line_str_section_dirty, | |
| 647 | &zo.debug_loclists_section_dirty, | |
| 648 | &zo.debug_rnglists_section_dirty, | |
| 649 | }) |maybe_sym_index, dirty| { | |
| 650 | const sym_index = maybe_sym_index orelse continue; | |
| 651 | if (zo.symbol(sym_index).atom(self).?.output_section_index == shdr_index) { | |
| 652 | dirty.* = true; | |
| 653 | break; | |
| 654 | } | |
| 657 | 655 | } |
| 658 | 656 | } |
| 659 | 657 | } |
| ... | ... | @@ -3473,14 +3471,6 @@ fn resetShdrIndexes(self: *Elf, backlinks: []const u32) void { |
| 3473 | 3471 | &self.copy_rel_section_index, |
| 3474 | 3472 | &self.versym_section_index, |
| 3475 | 3473 | &self.verneed_section_index, |
| 3476 | &self.debug_info_section_index, | |
| 3477 | &self.debug_abbrev_section_index, | |
| 3478 | &self.debug_str_section_index, | |
| 3479 | &self.debug_aranges_section_index, | |
| 3480 | &self.debug_line_section_index, | |
| 3481 | &self.debug_line_str_section_index, | |
| 3482 | &self.debug_loclists_section_index, | |
| 3483 | &self.debug_rnglists_section_index, | |
| 3484 | 3474 | }) |maybe_index| { |
| 3485 | 3475 | if (maybe_index.*) |*index| { |
| 3486 | 3476 | index.* = backlinks[index.*]; |
| ... | ... | @@ -3505,7 +3495,6 @@ fn resetShdrIndexes(self: *Elf, backlinks: []const u32) void { |
| 3505 | 3495 | const atom_ptr = zo.atom(atom_index) orelse continue; |
| 3506 | 3496 | atom_ptr.output_section_index = backlinks[atom_ptr.output_section_index]; |
| 3507 | 3497 | } |
| 3508 | if (zo.dwarf) |*dwarf| dwarf.reloadSectionMetadata(); | |
| 3509 | 3498 | } |
| 3510 | 3499 | |
| 3511 | 3500 | for (self.comdat_group_sections.items) |*cg| { |
src/link/Elf/ZigObject.zig+27-33| ... | ... | @@ -99,8 +99,8 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { |
| 99 | 99 | .dwarf => |v| { |
| 100 | 100 | var dwarf = Dwarf.init(&elf_file.base, v); |
| 101 | 101 | |
| 102 | if (elf_file.debug_str_section_index == null) { | |
| 103 | elf_file.debug_str_section_index = try elf_file.addSection(.{ | |
| 102 | if (self.debug_str_index == null) { | |
| 103 | const osec = try elf_file.addSection(.{ | |
| 104 | 104 | .name = try elf_file.insertShString(".debug_str"), |
| 105 | 105 | .flags = elf.SHF_MERGE | elf.SHF_STRINGS, |
| 106 | 106 | .entsize = 1, |
| ... | ... | @@ -108,51 +108,51 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { |
| 108 | 108 | .addralign = 1, |
| 109 | 109 | }); |
| 110 | 110 | self.debug_str_section_dirty = true; |
| 111 | self.debug_str_index = try self.addSectionSymbol(gpa, ".debug_str", .@"1", elf_file.debug_str_section_index.?); | |
| 111 | self.debug_str_index = try self.addSectionSymbol(gpa, ".debug_str", .@"1", osec); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | if (elf_file.debug_info_section_index == null) { | |
| 115 | elf_file.debug_info_section_index = try elf_file.addSection(.{ | |
| 114 | if (self.debug_info_index == null) { | |
| 115 | const osec = try elf_file.addSection(.{ | |
| 116 | 116 | .name = try elf_file.insertShString(".debug_info"), |
| 117 | 117 | .type = elf.SHT_PROGBITS, |
| 118 | 118 | .addralign = 1, |
| 119 | 119 | }); |
| 120 | 120 | self.debug_info_section_dirty = true; |
| 121 | self.debug_info_index = try self.addSectionSymbol(gpa, ".debug_info", .@"1", elf_file.debug_info_section_index.?); | |
| 121 | self.debug_info_index = try self.addSectionSymbol(gpa, ".debug_info", .@"1", osec); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | if (elf_file.debug_abbrev_section_index == null) { | |
| 125 | elf_file.debug_abbrev_section_index = try elf_file.addSection(.{ | |
| 124 | if (self.debug_abbrev_index == null) { | |
| 125 | const osec = try elf_file.addSection(.{ | |
| 126 | 126 | .name = try elf_file.insertShString(".debug_abbrev"), |
| 127 | 127 | .type = elf.SHT_PROGBITS, |
| 128 | 128 | .addralign = 1, |
| 129 | 129 | }); |
| 130 | 130 | self.debug_abbrev_section_dirty = true; |
| 131 | self.debug_abbrev_index = try self.addSectionSymbol(gpa, ".debug_abbrev", .@"1", elf_file.debug_abbrev_section_index.?); | |
| 131 | self.debug_abbrev_index = try self.addSectionSymbol(gpa, ".debug_abbrev", .@"1", osec); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | if (elf_file.debug_aranges_section_index == null) { | |
| 135 | elf_file.debug_aranges_section_index = try elf_file.addSection(.{ | |
| 134 | if (self.debug_aranges_index == null) { | |
| 135 | const osec = try elf_file.addSection(.{ | |
| 136 | 136 | .name = try elf_file.insertShString(".debug_aranges"), |
| 137 | 137 | .type = elf.SHT_PROGBITS, |
| 138 | 138 | .addralign = 16, |
| 139 | 139 | }); |
| 140 | 140 | self.debug_aranges_section_dirty = true; |
| 141 | self.debug_aranges_index = try self.addSectionSymbol(gpa, ".debug_aranges", .@"16", elf_file.debug_aranges_section_index.?); | |
| 141 | self.debug_aranges_index = try self.addSectionSymbol(gpa, ".debug_aranges", .@"16", osec); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | if (elf_file.debug_line_section_index == null) { | |
| 145 | elf_file.debug_line_section_index = try elf_file.addSection(.{ | |
| 144 | if (self.debug_line_index == null) { | |
| 145 | const osec = try elf_file.addSection(.{ | |
| 146 | 146 | .name = try elf_file.insertShString(".debug_line"), |
| 147 | 147 | .type = elf.SHT_PROGBITS, |
| 148 | 148 | .addralign = 1, |
| 149 | 149 | }); |
| 150 | 150 | self.debug_line_section_dirty = true; |
| 151 | self.debug_line_index = try self.addSectionSymbol(gpa, ".debug_line", .@"1", elf_file.debug_line_section_index.?); | |
| 151 | self.debug_line_index = try self.addSectionSymbol(gpa, ".debug_line", .@"1", osec); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | if (elf_file.debug_line_str_section_index == null) { | |
| 155 | elf_file.debug_line_str_section_index = try elf_file.addSection(.{ | |
| 154 | if (self.debug_line_str_index == null) { | |
| 155 | const osec = try elf_file.addSection(.{ | |
| 156 | 156 | .name = try elf_file.insertShString(".debug_line_str"), |
| 157 | 157 | .flags = elf.SHF_MERGE | elf.SHF_STRINGS, |
| 158 | 158 | .entsize = 1, |
| ... | ... | @@ -160,31 +160,31 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { |
| 160 | 160 | .addralign = 1, |
| 161 | 161 | }); |
| 162 | 162 | self.debug_line_str_section_dirty = true; |
| 163 | self.debug_line_str_index = try self.addSectionSymbol(gpa, ".debug_line_str", .@"1", elf_file.debug_line_str_section_index.?); | |
| 163 | self.debug_line_str_index = try self.addSectionSymbol(gpa, ".debug_line_str", .@"1", osec); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | if (elf_file.debug_loclists_section_index == null) { | |
| 167 | elf_file.debug_loclists_section_index = try elf_file.addSection(.{ | |
| 166 | if (self.debug_loclists_index == null) { | |
| 167 | const osec = try elf_file.addSection(.{ | |
| 168 | 168 | .name = try elf_file.insertShString(".debug_loclists"), |
| 169 | 169 | .type = elf.SHT_PROGBITS, |
| 170 | 170 | .addralign = 1, |
| 171 | 171 | }); |
| 172 | 172 | self.debug_loclists_section_dirty = true; |
| 173 | self.debug_loclists_index = try self.addSectionSymbol(gpa, ".debug_loclists", .@"1", elf_file.debug_loclists_section_index.?); | |
| 173 | self.debug_loclists_index = try self.addSectionSymbol(gpa, ".debug_loclists", .@"1", osec); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | if (elf_file.debug_rnglists_section_index == null) { | |
| 177 | elf_file.debug_rnglists_section_index = try elf_file.addSection(.{ | |
| 176 | if (self.debug_rnglists_index == null) { | |
| 177 | const osec = try elf_file.addSection(.{ | |
| 178 | 178 | .name = try elf_file.insertShString(".debug_rnglists"), |
| 179 | 179 | .type = elf.SHT_PROGBITS, |
| 180 | 180 | .addralign = 1, |
| 181 | 181 | }); |
| 182 | 182 | self.debug_rnglists_section_dirty = true; |
| 183 | self.debug_rnglists_index = try self.addSectionSymbol(gpa, ".debug_rnglists", .@"1", elf_file.debug_rnglists_section_index.?); | |
| 183 | self.debug_rnglists_index = try self.addSectionSymbol(gpa, ".debug_rnglists", .@"1", osec); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | if (elf_file.eh_frame_section_index == null) { | |
| 187 | elf_file.eh_frame_section_index = try elf_file.addSection(.{ | |
| 186 | if (self.eh_frame_index == null) { | |
| 187 | const osec = try elf_file.addSection(.{ | |
| 188 | 188 | .name = try elf_file.insertShString(".eh_frame"), |
| 189 | 189 | .type = if (elf_file.getTarget().cpu.arch == .x86_64) |
| 190 | 190 | elf.SHT_X86_64_UNWIND |
| ... | ... | @@ -194,7 +194,7 @@ pub fn init(self: *ZigObject, elf_file: *Elf, options: InitOptions) !void { |
| 194 | 194 | .addralign = ptr_size, |
| 195 | 195 | }); |
| 196 | 196 | self.eh_frame_section_dirty = true; |
| 197 | self.eh_frame_index = try self.addSectionSymbol(gpa, ".eh_frame", Atom.Alignment.fromNonzeroByteUnits(ptr_size), elf_file.eh_frame_section_index.?); | |
| 197 | self.eh_frame_index = try self.addSectionSymbol(gpa, ".eh_frame", Atom.Alignment.fromNonzeroByteUnits(ptr_size), osec); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | try dwarf.initMetadata(); |
| ... | ... | @@ -328,12 +328,6 @@ pub fn flushModule(self: *ZigObject, elf_file: *Elf, tid: Zcu.PerThread.Id) !voi |
| 328 | 328 | const sym = self.symbol(sym_index); |
| 329 | 329 | const atom_ptr = self.atom(sym.ref.index).?; |
| 330 | 330 | if (!atom_ptr.alive) continue; |
| 331 | const shndx = sym.outputShndx(elf_file).?; | |
| 332 | const shdr = elf_file.sections.items(.shdr)[shndx]; | |
| 333 | const esym = &self.symtab.items(.elf_sym)[sym.esym_index]; | |
| 334 | esym.st_size = shdr.sh_size; | |
| 335 | atom_ptr.size = shdr.sh_size; | |
| 336 | atom_ptr.alignment = Atom.Alignment.fromNonzeroByteUnits(shdr.sh_addralign); | |
| 337 | 331 | |
| 338 | 332 | log.debug("parsing relocs in {s}", .{sym.name(elf_file)}); |
| 339 | 333 |