diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/aarch64/CodeGen.zig | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/arch/aarch64/CodeGen.zig b/src/arch/aarch64/CodeGen.zig index a117e4a083..e672364dc2 100644 --- a/src/arch/aarch64/CodeGen.zig +++ b/src/arch/aarch64/CodeGen.zig @@ -261,14 +261,23 @@ const DbgInfoReloc = struct { .ptr_stack_offset, .stack_offset, - => |off| { + .stack_argument_offset, + => |offset| { + const adjusted_offset = switch (reloc.mcv) { + .ptr_stack_offset, + .stack_offset, + => -@intCast(i32, offset), + .stack_argument_offset => @intCast(i32, function.saved_regs_stack_space + offset), + else => unreachable, + }; + try dbg_info.ensureUnusedCapacity(7); const fixup = dbg_info.items.len; dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc 1, // we will backpatch it after we encode the displacement in LEB128 Register.x29.dwarfLocOpDeref(), // frame pointer }); - leb128.writeILEB128(dbg_info.writer(), -@intCast(i32, off)) catch unreachable; + leb128.writeILEB128(dbg_info.writer(), adjusted_offset) catch unreachable; dbg_info.items[fixup] += @intCast(u8, dbg_info.items.len - fixup - 2); }, @@ -353,8 +362,6 @@ const DbgInfoReloc = struct { }); }, - .stack_argument_offset => unreachable, - else => { try dbg_info.ensureUnusedCapacity(2); dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc |
