| ... | @@ -261,7 +261,6 @@ pub const Section = struct { | ... | @@ -261,7 +261,6 @@ pub const Section = struct { |
| 261 | index: u32, | 261 | index: u32, |
| 262 | first: Unit.Index.Optional, | 262 | first: Unit.Index.Optional, |
| 263 | last: Unit.Index.Optional, | 263 | last: Unit.Index.Optional, |
| 264 | off: u64, | | |
| 265 | len: u64, | 264 | len: u64, |
| 266 | units: std.ArrayListUnmanaged(Unit), | 265 | units: std.ArrayListUnmanaged(Unit), |
| 267 | | 266 | |
| ... | @@ -284,9 +283,8 @@ pub const Section = struct { | ... | @@ -284,9 +283,8 @@ pub const Section = struct { |
| 284 | .index = std.math.maxInt(u32), | 283 | .index = std.math.maxInt(u32), |
| 285 | .first = .none, | 284 | .first = .none, |
| 286 | .last = .none, | 285 | .last = .none, |
| 287 | .off = 0, | | |
| 288 | .len = 0, | | |
| 289 | .units = .{}, | 286 | .units = .{}, |
| | 287 | .len = 0, |
| 290 | }; | 288 | }; |
| 291 | | 289 | |
| 292 | fn deinit(sec: *Section, gpa: std.mem.Allocator) void { | 290 | fn deinit(sec: *Section, gpa: std.mem.Allocator) void { |
| ... | @@ -295,6 +293,20 @@ pub const Section = struct { | ... | @@ -295,6 +293,20 @@ pub const Section = struct { |
| 295 | sec.* = undefined; | 293 | sec.* = undefined; |
| 296 | } | 294 | } |
| 297 | | 295 | |
| | 296 | fn off(sec: Section, dwarf: *Dwarf) u64 { |
| | 297 | if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| | 298 | const zo = elf_file.zigObjectPtr().?; |
| | 299 | const atom = zo.symbol(sec.index).atom(elf_file).?; |
| | 300 | return atom.offset(elf_file); |
| | 301 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { |
| | 302 | const header = if (macho_file.d_sym) |d_sym| |
| | 303 | d_sym.sections.items[sec.index] |
| | 304 | else |
| | 305 | macho_file.sections.items(.header)[sec.index]; |
| | 306 | return header.offset; |
| | 307 | } else unreachable; |
| | 308 | } |
| | 309 | |
| 298 | fn addUnit(sec: *Section, header_len: u32, trailer_len: u32, dwarf: *Dwarf) UpdateError!Unit.Index { | 310 | fn addUnit(sec: *Section, header_len: u32, trailer_len: u32, dwarf: *Dwarf) UpdateError!Unit.Index { |
| 299 | const unit: Unit.Index = @enumFromInt(sec.units.items.len); | 311 | const unit: Unit.Index = @enumFromInt(sec.units.items.len); |
| 300 | const unit_ptr = try sec.units.addOne(dwarf.gpa); | 312 | const unit_ptr = try sec.units.addOne(dwarf.gpa); |
| ... | @@ -306,9 +318,9 @@ pub const Section = struct { | ... | @@ -306,9 +318,9 @@ pub const Section = struct { |
| 306 | .next = .none, | 318 | .next = .none, |
| 307 | .first = .none, | 319 | .first = .none, |
| 308 | .last = .none, | 320 | .last = .none, |
| 309 | .off = 0, | | |
| 310 | .header_len = aligned_header_len, | 321 | .header_len = aligned_header_len, |
| 311 | .trailer_len = aligned_trailer_len, | 322 | .trailer_len = aligned_trailer_len, |
| | 323 | .off = 0, |
| 312 | .len = aligned_header_len + aligned_trailer_len, | 324 | .len = aligned_header_len + aligned_trailer_len, |
| 313 | .entries = .{}, | 325 | .entries = .{}, |
| 314 | .cross_unit_relocs = .{}, | 326 | .cross_unit_relocs = .{}, |
| ... | @@ -385,7 +397,6 @@ pub const Section = struct { | ... | @@ -385,7 +397,6 @@ pub const Section = struct { |
| 385 | const shdr = elf_file.sections.items(.shdr)[shndx]; | 397 | const shdr = elf_file.sections.items(.shdr)[shndx]; |
| 386 | atom.size = shdr.sh_size; | 398 | atom.size = shdr.sh_size; |
| 387 | atom.alignment = InternPool.Alignment.fromNonzeroByteUnits(shdr.sh_addralign); | 399 | atom.alignment = InternPool.Alignment.fromNonzeroByteUnits(shdr.sh_addralign); |
| 388 | sec.off = shdr.sh_offset + @as(u64, @intCast(atom.value)); | | |
| 389 | sec.len = shdr.sh_size; | 400 | sec.len = shdr.sh_size; |
| 390 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { | 401 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { |
| 391 | const header = if (macho_file.d_sym) |*d_sym| header: { | 402 | const header = if (macho_file.d_sym) |*d_sym| header: { |
| ... | @@ -395,7 +406,6 @@ pub const Section = struct { | ... | @@ -395,7 +406,6 @@ pub const Section = struct { |
| 395 | try macho_file.growSection(@intCast(sec.index), len); | 406 | try macho_file.growSection(@intCast(sec.index), len); |
| 396 | break :header &macho_file.sections.items(.header)[sec.index]; | 407 | break :header &macho_file.sections.items(.header)[sec.index]; |
| 397 | }; | 408 | }; |
| 398 | sec.off = header.offset; | | |
| 399 | sec.len = header.size; | 409 | sec.len = header.size; |
| 400 | } | 410 | } |
| 401 | } | 411 | } |
| ... | @@ -404,7 +414,6 @@ pub const Section = struct { | ... | @@ -404,7 +414,6 @@ pub const Section = struct { |
| 404 | const len = sec.getUnit(sec.first.unwrap() orelse return).off; | 414 | const len = sec.getUnit(sec.first.unwrap() orelse return).off; |
| 405 | if (len == 0) return; | 415 | if (len == 0) return; |
| 406 | for (sec.units.items) |*unit| unit.off -= len; | 416 | for (sec.units.items) |*unit| unit.off -= len; |
| 407 | sec.off += len; | | |
| 408 | sec.len -= len; | 417 | sec.len -= len; |
| 409 | if (dwarf.bin_file.cast(.elf)) |elf_file| { | 418 | if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| 410 | const zo = elf_file.zigObjectPtr().?; | 419 | const zo = elf_file.zigObjectPtr().?; |
| ... | @@ -412,14 +421,14 @@ pub const Section = struct { | ... | @@ -412,14 +421,14 @@ pub const Section = struct { |
| 412 | const shndx = atom.output_section_index; | 421 | const shndx = atom.output_section_index; |
| 413 | const shdr = &elf_file.sections.items(.shdr)[shndx]; | 422 | const shdr = &elf_file.sections.items(.shdr)[shndx]; |
| 414 | atom.size = sec.len; | 423 | atom.size = sec.len; |
| 415 | shdr.sh_offset = sec.off; | 424 | shdr.sh_offset += len; |
| 416 | shdr.sh_size = sec.len; | 425 | shdr.sh_size = sec.len; |
| 417 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { | 426 | } else if (dwarf.bin_file.cast(.macho)) |macho_file| { |
| 418 | const header = if (macho_file.d_sym) |*d_sym| | 427 | const header = if (macho_file.d_sym) |*d_sym| |
| 419 | &d_sym.sections.items[sec.index] | 428 | &d_sym.sections.items[sec.index] |
| 420 | else | 429 | else |
| 421 | &macho_file.sections.items(.header)[sec.index]; | 430 | &macho_file.sections.items(.header)[sec.index]; |
| 422 | header.offset = @intCast(sec.off); | 431 | header.offset += @intCast(len); |
| 423 | header.size = sec.len; | 432 | header.size = sec.len; |
| 424 | } | 433 | } |
| 425 | } | 434 | } |
| ... | @@ -548,9 +557,9 @@ const Unit = struct { | ... | @@ -548,9 +557,9 @@ const Unit = struct { |
| 548 | fn move(unit: *Unit, sec: *Section, dwarf: *Dwarf, new_off: u32) UpdateError!void { | 557 | fn move(unit: *Unit, sec: *Section, dwarf: *Dwarf, new_off: u32) UpdateError!void { |
| 549 | if (unit.off == new_off) return; | 558 | if (unit.off == new_off) return; |
| 550 | if (try dwarf.getFile().?.copyRangeAll( | 559 | if (try dwarf.getFile().?.copyRangeAll( |
| 551 | sec.off + unit.off, | 560 | sec.off(dwarf) + unit.off, |
| 552 | dwarf.getFile().?, | 561 | dwarf.getFile().?, |
| 553 | sec.off + new_off, | 562 | sec.off(dwarf) + new_off, |
| 554 | unit.len, | 563 | unit.len, |
| 555 | ) != unit.len) return error.InputOutput; | 564 | ) != unit.len) return error.InputOutput; |
| 556 | unit.off = new_off; | 565 | unit.off = new_off; |
| ... | @@ -582,7 +591,7 @@ const Unit = struct { | ... | @@ -582,7 +591,7 @@ const Unit = struct { |
| 582 | | 591 | |
| 583 | fn replaceHeader(unit: *Unit, sec: *Section, dwarf: *Dwarf, contents: []const u8) UpdateError!void { | 592 | fn replaceHeader(unit: *Unit, sec: *Section, dwarf: *Dwarf, contents: []const u8) UpdateError!void { |
| 584 | assert(contents.len == unit.header_len); | 593 | assert(contents.len == unit.header_len); |
| 585 | try dwarf.getFile().?.pwriteAll(contents, sec.off + unit.off); | 594 | try dwarf.getFile().?.pwriteAll(contents, sec.off(dwarf) + unit.off); |
| 586 | } | 595 | } |
| 587 | | 596 | |
| 588 | fn writeTrailer(unit: *Unit, sec: *Section, dwarf: *Dwarf) UpdateError!void { | 597 | fn writeTrailer(unit: *Unit, sec: *Section, dwarf: *Dwarf) UpdateError!void { |
| ... | @@ -614,7 +623,7 @@ const Unit = struct { | ... | @@ -614,7 +623,7 @@ const Unit = struct { |
| 614 | assert(fbs.pos == extended_op_bytes + op_len_bytes); | 623 | assert(fbs.pos == extended_op_bytes + op_len_bytes); |
| 615 | writer.writeByte(DW.LNE.padding) catch unreachable; | 624 | writer.writeByte(DW.LNE.padding) catch unreachable; |
| 616 | assert(fbs.pos >= unit.trailer_len and fbs.pos <= len); | 625 | assert(fbs.pos >= unit.trailer_len and fbs.pos <= len); |
| 617 | return dwarf.getFile().?.pwriteAll(fbs.getWritten(), sec.off + start); | 626 | return dwarf.getFile().?.pwriteAll(fbs.getWritten(), sec.off(dwarf) + start); |
| 618 | } | 627 | } |
| 619 | var trailer = try std.ArrayList(u8).initCapacity(dwarf.gpa, len); | 628 | var trailer = try std.ArrayList(u8).initCapacity(dwarf.gpa, len); |
| 620 | defer trailer.deinit(); | 629 | defer trailer.deinit(); |
| ... | @@ -673,11 +682,11 @@ const Unit = struct { | ... | @@ -673,11 +682,11 @@ const Unit = struct { |
| 673 | assert(trailer.items.len == unit.trailer_len); | 682 | assert(trailer.items.len == unit.trailer_len); |
| 674 | trailer.appendNTimesAssumeCapacity(fill_byte, len - unit.trailer_len); | 683 | trailer.appendNTimesAssumeCapacity(fill_byte, len - unit.trailer_len); |
| 675 | assert(trailer.items.len == len); | 684 | assert(trailer.items.len == len); |
| 676 | try dwarf.getFile().?.pwriteAll(trailer.items, sec.off + start); | 685 | try dwarf.getFile().?.pwriteAll(trailer.items, sec.off(dwarf) + start); |
| 677 | } | 686 | } |
| 678 | | 687 | |
| 679 | fn resolveRelocs(unit: *Unit, sec: *Section, dwarf: *Dwarf) RelocError!void { | 688 | fn resolveRelocs(unit: *Unit, sec: *Section, dwarf: *Dwarf) RelocError!void { |
| 680 | const unit_off = sec.off + unit.off; | 689 | const unit_off = sec.off(dwarf) + unit.off; |
| 681 | for (unit.cross_unit_relocs.items) |reloc| { | 690 | for (unit.cross_unit_relocs.items) |reloc| { |
| 682 | const target_unit = sec.getUnit(reloc.target_unit); | 691 | const target_unit = sec.getUnit(reloc.target_unit); |
| 683 | try dwarf.resolveReloc( | 692 | try dwarf.resolveReloc( |
| ... | @@ -764,12 +773,12 @@ const Entry = struct { | ... | @@ -764,12 +773,12 @@ const Entry = struct { |
| 764 | dwarf.writeInt(unit_len[0..dwarf.sectionOffsetBytes()], len - dwarf.unitLengthBytes()); | 773 | dwarf.writeInt(unit_len[0..dwarf.sectionOffsetBytes()], len - dwarf.unitLengthBytes()); |
| 765 | try dwarf.getFile().?.pwriteAll( | 774 | try dwarf.getFile().?.pwriteAll( |
| 766 | unit_len[0..dwarf.sectionOffsetBytes()], | 775 | unit_len[0..dwarf.sectionOffsetBytes()], |
| 767 | sec.off + unit.off + unit.header_len + entry.off, | 776 | sec.off(dwarf) + unit.off + unit.header_len + entry.off, |
| 768 | ); | 777 | ); |
| 769 | const buf = try dwarf.gpa.alloc(u8, len - entry.len); | 778 | const buf = try dwarf.gpa.alloc(u8, len - entry.len); |
| 770 | defer dwarf.gpa.free(buf); | 779 | defer dwarf.gpa.free(buf); |
| 771 | @memset(buf, DW.CFA.nop); | 780 | @memset(buf, DW.CFA.nop); |
| 772 | try dwarf.getFile().?.pwriteAll(buf, sec.off + unit.off + unit.header_len + start); | 781 | try dwarf.getFile().?.pwriteAll(buf, sec.off(dwarf) + unit.off + unit.header_len + start); |
| 773 | return; | 782 | return; |
| 774 | } | 783 | } |
| 775 | const len = unit.getEntry(entry.next.unwrap() orelse return).off - start; | 784 | const len = unit.getEntry(entry.next.unwrap() orelse return).off - start; |
| ... | @@ -825,7 +834,7 @@ const Entry = struct { | ... | @@ -825,7 +834,7 @@ const Entry = struct { |
| 825 | }, | 834 | }, |
| 826 | } else assert(!sec.pad_to_ideal and len == 0); | 835 | } else assert(!sec.pad_to_ideal and len == 0); |
| 827 | assert(fbs.pos <= len); | 836 | assert(fbs.pos <= len); |
| 828 | try dwarf.getFile().?.pwriteAll(fbs.getWritten(), sec.off + unit.off + unit.header_len + start); | 837 | try dwarf.getFile().?.pwriteAll(fbs.getWritten(), sec.off(dwarf) + unit.off + unit.header_len + start); |
| 829 | } | 838 | } |
| 830 | | 839 | |
| 831 | fn resize(entry_ptr: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf, len: u32) UpdateError!void { | 840 | fn resize(entry_ptr: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf, len: u32) UpdateError!void { |
| ... | @@ -860,15 +869,15 @@ const Entry = struct { | ... | @@ -860,15 +869,15 @@ const Entry = struct { |
| 860 | | 869 | |
| 861 | fn replace(entry_ptr: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf, contents: []const u8) UpdateError!void { | 870 | fn replace(entry_ptr: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf, contents: []const u8) UpdateError!void { |
| 862 | assert(contents.len == entry_ptr.len); | 871 | assert(contents.len == entry_ptr.len); |
| 863 | try dwarf.getFile().?.pwriteAll(contents, sec.off + unit.off + unit.header_len + entry_ptr.off); | 872 | try dwarf.getFile().?.pwriteAll(contents, sec.off(dwarf) + unit.off + unit.header_len + entry_ptr.off); |
| 864 | if (false) { | 873 | if (false) { |
| 865 | const buf = try dwarf.gpa.alloc(u8, sec.len); | 874 | const buf = try dwarf.gpa.alloc(u8, sec.len); |
| 866 | defer dwarf.gpa.free(buf); | 875 | defer dwarf.gpa.free(buf); |
| 867 | _ = try dwarf.getFile().?.preadAll(buf, sec.off); | 876 | _ = try dwarf.getFile().?.preadAll(buf, sec.off(dwarf)); |
| 868 | log.info("Section{{ .first = {}, .last = {}, .off = 0x{x}, .len = 0x{x} }}", .{ | 877 | log.info("Section{{ .first = {}, .last = {}, .off = 0x{x}, .len = 0x{x} }}", .{ |
| 869 | @intFromEnum(sec.first), | 878 | @intFromEnum(sec.first), |
| 870 | @intFromEnum(sec.last), | 879 | @intFromEnum(sec.last), |
| 871 | sec.off, | 880 | sec.off(dwarf), |
| 872 | sec.len, | 881 | sec.len, |
| 873 | }); | 882 | }); |
| 874 | for (sec.units.items) |*unit_ptr| { | 883 | for (sec.units.items) |*unit_ptr| { |
| ... | @@ -935,7 +944,7 @@ const Entry = struct { | ... | @@ -935,7 +944,7 @@ const Entry = struct { |
| 935 | } | 944 | } |
| 936 | | 945 | |
| 937 | fn resolveRelocs(entry: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf) RelocError!void { | 946 | fn resolveRelocs(entry: *Entry, unit: *Unit, sec: *Section, dwarf: *Dwarf) RelocError!void { |
| 938 | const entry_off = sec.off + unit.off + unit.header_len + entry.off; | 947 | const entry_off = sec.off(dwarf) + unit.off + unit.header_len + entry.off; |
| 939 | for (entry.cross_entry_relocs.items) |reloc| { | 948 | for (entry.cross_entry_relocs.items) |reloc| { |
| 940 | try dwarf.resolveReloc( | 949 | try dwarf.resolveReloc( |
| 941 | entry_off + reloc.source_off, | 950 | entry_off + reloc.source_off, |
| ... | @@ -973,7 +982,7 @@ const Entry = struct { | ... | @@ -973,7 +982,7 @@ const Entry = struct { |
| 973 | .eh_frame => return if (dwarf.bin_file.cast(.elf)) |elf_file| { | 982 | .eh_frame => return if (dwarf.bin_file.cast(.elf)) |elf_file| { |
| 974 | const zo = elf_file.zigObjectPtr().?; | 983 | const zo = elf_file.zigObjectPtr().?; |
| 975 | const shndx = zo.symbol(sec.index).atom(elf_file).?.output_section_index; | 984 | 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); | 985 | const entry_addr: i64 = @intCast(entry_off - sec.off(dwarf) + elf_file.shdrs.items[shndx].sh_addr); |
| 977 | for (entry.external_relocs.items) |reloc| { | 986 | for (entry.external_relocs.items) |reloc| { |
| 978 | const symbol = zo.symbol(reloc.target_sym); | 987 | const symbol = zo.symbol(reloc.target_sym); |
| 979 | try dwarf.resolveReloc( | 988 | try dwarf.resolveReloc( |
| ... | @@ -1912,7 +1921,6 @@ pub fn reloadSectionMetadata(dwarf: *Dwarf) void { | ... | @@ -1912,7 +1921,6 @@ pub fn reloadSectionMetadata(dwarf: *Dwarf) void { |
| 1912 | }) |sec, sect_index| { | 1921 | }) |sec, sect_index| { |
| 1913 | const header = &d_sym.sections.items[sect_index]; | 1922 | const header = &d_sym.sections.items[sect_index]; |
| 1914 | sec.index = sect_index; | 1923 | sec.index = sect_index; |
| 1915 | sec.off = header.offset; | | |
| 1916 | sec.len = header.size; | 1924 | sec.len = header.size; |
| 1917 | } | 1925 | } |
| 1918 | } else { | 1926 | } else { |
| ... | @@ -1937,7 +1945,6 @@ pub fn reloadSectionMetadata(dwarf: *Dwarf) void { | ... | @@ -1937,7 +1945,6 @@ pub fn reloadSectionMetadata(dwarf: *Dwarf) void { |
| 1937 | }) |sec, sect_index| { | 1945 | }) |sec, sect_index| { |
| 1938 | const header = &macho_file.sections.items(.header)[sect_index]; | 1946 | const header = &macho_file.sections.items(.header)[sect_index]; |
| 1939 | sec.index = sect_index; | 1947 | sec.index = sect_index; |
| 1940 | sec.off = header.offset; | | |
| 1941 | sec.len = header.size; | 1948 | sec.len = header.size; |
| 1942 | } | 1949 | } |
| 1943 | } | 1950 | } |
| ... | @@ -2534,7 +2541,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool | ... | @@ -2534,7 +2541,7 @@ pub fn updateComptimeNav(dwarf: *Dwarf, pt: Zcu.PerThread, nav_index: InternPool |
| 2534 | var abbrev_code_buf: [AbbrevCode.decl_bytes]u8 = undefined; | 2541 | var abbrev_code_buf: [AbbrevCode.decl_bytes]u8 = undefined; |
| 2535 | if (try dwarf.getFile().?.preadAll( | 2542 | if (try dwarf.getFile().?.preadAll( |
| 2536 | &abbrev_code_buf, | 2543 | &abbrev_code_buf, |
| 2537 | dwarf.debug_info.section.off + unit_ptr.off + unit_ptr.header_len + entry_ptr.off, | 2544 | dwarf.debug_info.section.off(dwarf) + unit_ptr.off + unit_ptr.header_len + entry_ptr.off, |
| 2538 | ) != abbrev_code_buf.len) return error.InputOutput; | 2545 | ) != abbrev_code_buf.len) return error.InputOutput; |
| 2539 | var abbrev_code_fbs = std.io.fixedBufferStream(&abbrev_code_buf); | 2546 | var abbrev_code_fbs = std.io.fixedBufferStream(&abbrev_code_buf); |
| 2540 | const abbrev_code: AbbrevCode = @enumFromInt( | 2547 | const abbrev_code: AbbrevCode = @enumFromInt( |
| ... | @@ -3945,7 +3952,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void { | ... | @@ -3945,7 +3952,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void { |
| 3945 | if (dwarf.debug_str.section.dirty) { | 3952 | if (dwarf.debug_str.section.dirty) { |
| 3946 | const contents = dwarf.debug_str.contents.items; | 3953 | const contents = dwarf.debug_str.contents.items; |
| 3947 | try dwarf.debug_str.section.resize(dwarf, contents.len); | 3954 | try dwarf.debug_str.section.resize(dwarf, contents.len); |
| 3948 | try dwarf.getFile().?.pwriteAll(contents, dwarf.debug_str.section.off); | 3955 | try dwarf.getFile().?.pwriteAll(contents, dwarf.debug_str.section.off(dwarf)); |
| 3949 | dwarf.debug_str.section.dirty = false; | 3956 | dwarf.debug_str.section.dirty = false; |
| 3950 | } | 3957 | } |
| 3951 | if (dwarf.debug_line.section.dirty) { | 3958 | if (dwarf.debug_line.section.dirty) { |
| ... | @@ -4051,7 +4058,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void { | ... | @@ -4051,7 +4058,7 @@ pub fn flushModule(dwarf: *Dwarf, pt: Zcu.PerThread) FlushError!void { |
| 4051 | if (dwarf.debug_line_str.section.dirty) { | 4058 | if (dwarf.debug_line_str.section.dirty) { |
| 4052 | const contents = dwarf.debug_line_str.contents.items; | 4059 | const contents = dwarf.debug_line_str.contents.items; |
| 4053 | try dwarf.debug_line_str.section.resize(dwarf, contents.len); | 4060 | try dwarf.debug_line_str.section.resize(dwarf, contents.len); |
| 4054 | try dwarf.getFile().?.pwriteAll(contents, dwarf.debug_line_str.section.off); | 4061 | try dwarf.getFile().?.pwriteAll(contents, dwarf.debug_line_str.section.off(dwarf)); |
| 4055 | dwarf.debug_line_str.section.dirty = false; | 4062 | dwarf.debug_line_str.section.dirty = false; |
| 4056 | } | 4063 | } |
| 4057 | if (dwarf.debug_loclists.section.dirty) { | 4064 | if (dwarf.debug_loclists.section.dirty) { |