authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-03-25 11:06:12+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-03-25 23:22:20+01:00
log69e9fe4ede8ccc3a8792304ec76039fd57ba070a
tree3d04ac4cfe5d83fdbfa002bcfac702148a229897
parente599ed4a5f012992e037545ae035e39ace71c16b

dwarf: actually write zeroed out unresolved relocs into emitted DWARF in initDeclState


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

src/link/Dwarf.zig+4-4
...@@ -1133,7 +1133,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde...@@ -1133,7 +1133,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde
1133 });1133 });
1134 // This is the "relocatable" vaddr, corresponding to `code_buffer` index `0`.1134 // This is the "relocatable" vaddr, corresponding to `code_buffer` index `0`.
1135 assert(dbg_line_vaddr_reloc_index == dbg_line_buffer.items.len);1135 assert(dbg_line_vaddr_reloc_index == dbg_line_buffer.items.len);
1136 dbg_line_buffer.items.len += ptr_width_bytes;1136 dbg_line_buffer.writer().writeByteNTimes(0, ptr_width_bytes) catch unreachable;
11371137
1138 dbg_line_buffer.appendAssumeCapacity(DW.LNS.advance_line);1138 dbg_line_buffer.appendAssumeCapacity(DW.LNS.advance_line);
1139 // This is the "relocatable" relative line offset from the previous function's end curly1139 // This is the "relocatable" relative line offset from the previous function's end curly
...@@ -1171,12 +1171,12 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde...@@ -1171,12 +1171,12 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: InternPool.DeclInde
1171 // "relocations" and have to be in this fixed place so that functions can be1171 // "relocations" and have to be in this fixed place so that functions can be
1172 // moved in virtual address space.1172 // moved in virtual address space.
1173 assert(dbg_info_low_pc_reloc_index == dbg_info_buffer.items.len);1173 assert(dbg_info_low_pc_reloc_index == dbg_info_buffer.items.len);
1174 dbg_info_buffer.items.len += ptr_width_bytes; // DW.AT.low_pc, DW.FORM.addr1174 dbg_info_buffer.writer().writeByteNTimes(0, ptr_width_bytes) catch unreachable; // DW.AT.low_pc, DW.FORM.addr
1175 assert(self.getRelocDbgInfoSubprogramHighPC() == dbg_info_buffer.items.len);1175 assert(self.getRelocDbgInfoSubprogramHighPC() == dbg_info_buffer.items.len);
1176 dbg_info_buffer.items.len += 4; // DW.AT.high_pc, DW.FORM.data41176 dbg_info_buffer.writer().writeByteNTimes(0, 4) catch unreachable; // DW.AT.high_pc, DW.FORM.data4
1177 if (fn_ret_has_bits) {1177 if (fn_ret_has_bits) {
1178 try decl_state.addTypeRelocGlobal(di_atom_index, fn_ret_type, @intCast(dbg_info_buffer.items.len));1178 try decl_state.addTypeRelocGlobal(di_atom_index, fn_ret_type, @intCast(dbg_info_buffer.items.len));
1179 dbg_info_buffer.items.len += 4; // DW.AT.type, DW.FORM.ref41179 dbg_info_buffer.writer().writeByteNTimes(0, 4) catch unreachable; // DW.AT.type, DW.FORM.ref4
1180 }1180 }
1181 dbg_info_buffer.appendSliceAssumeCapacity(1181 dbg_info_buffer.appendSliceAssumeCapacity(
1182 decl_name_slice[0 .. decl_name_slice.len + 1],1182 decl_name_slice[0 .. decl_name_slice.len + 1],