aboutsummaryrefslogtreecommitdiff
path: root/src/link/Dwarf.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-10-19 00:24:36 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-10-19 21:56:47 +0200
commiteb76ef58f80dffcba426b4668e9d658f10c00cb7 (patch)
tree5f7b099a18ff09e3594eaa3f30188059f0b45585 /src/link/Dwarf.zig
parent400faec10beed6c146bc562efab146be258471d7 (diff)
downloadzig-eb76ef58f80dffcba426b4668e9d658f10c00cb7.tar.gz
zig-eb76ef58f80dffcba426b4668e9d658f10c00cb7.zip
dwarf: revert adding spurious and incorrect +1 to getDebugInfoEnd()
Diffstat (limited to 'src/link/Dwarf.zig')
-rw-r--r--src/link/Dwarf.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig
index fca8dd64a4..76662f5bd7 100644
--- a/src/link/Dwarf.zig
+++ b/src/link/Dwarf.zig
@@ -1823,7 +1823,7 @@ pub fn writeDbgInfoHeader(self: *Dwarf, module: *Module, low_pc: u64, high_pc: u
// We have to come back and write it later after we know the size.
const after_init_len = di_buf.items.len + init_len_size;
const dbg_info_end = self.getDebugInfoEnd().?;
- const init_len = dbg_info_end - after_init_len;
+ const init_len = dbg_info_end - after_init_len + 1;
if (self.format == .dwarf64) di_buf.appendNTimesAssumeCapacity(0xff, 4);
self.writeOffsetAssumeCapacity(&di_buf, init_len);
@@ -2417,7 +2417,7 @@ fn getDebugInfoOff(self: Dwarf) ?u32 {
fn getDebugInfoEnd(self: Dwarf) ?u32 {
const last_index = self.di_atom_last_index orelse return null;
const last = self.getAtom(.di_atom, last_index);
- return last.off + last.len + 1;
+ return last.off + last.len;
}
fn getDebugLineProgramOff(self: Dwarf) ?u32 {