From: Richard Henderson Date: Wed, 30 Jun 2021 11:11:54 +0000 (+0100) Subject: Fix signedness of def_cfa_sf and def_cfa_offset_sf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=280c57ff58f8cb7c70d47ffbfeb446ca9b562c96;p=binutils-gdb.git Fix signedness of def_cfa_sf and def_cfa_offset_sf * dwarf.c (display_debug_frames): Both DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf have a signed offset. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index c6a05ca6b3e..b5dedef26ee 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2021-06-30 Richard Henderson + + * dwarf.c (display_debug_frames): Both DW_CFA_def_cfa_sf + and DW_CFA_def_cfa_offset_sf have a signed offset. + 2021-06-19 Alan Modra * dwarf.c (display_debug_lines_decoded): Use memcpy rather than diff --git a/binutils/dwarf.c b/binutils/dwarf.c index a57f0dab6b2..a61f099e3f2 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -9432,19 +9432,21 @@ display_debug_frames (struct dwarf_section *section, case DW_CFA_def_cfa_sf: READ_ULEB (fc->cfa_reg, start, block_end); - READ_ULEB (fc->cfa_offset, start, block_end); - fc->cfa_offset = fc->cfa_offset * fc->data_factor; + READ_SLEB (l, start, block_end); + l *= fc->data_factor; + fc->cfa_offset = l; fc->cfa_exp = 0; if (! do_debug_frames_interp) - printf (" DW_CFA_def_cfa_sf: %s ofs %d\n", - regname (fc->cfa_reg, 0), (int) fc->cfa_offset); + printf (" DW_CFA_def_cfa_sf: %s ofs %ld\n", + regname (fc->cfa_reg, 0), (long) l); break; case DW_CFA_def_cfa_offset_sf: - READ_ULEB (fc->cfa_offset, start, block_end); - fc->cfa_offset *= fc->data_factor; + READ_SLEB (l, start, block_end); + l *= fc->data_factor; + fc->cfa_offset = l; if (! do_debug_frames_interp) - printf (" DW_CFA_def_cfa_offset_sf: %d\n", (int) fc->cfa_offset); + printf (" DW_CFA_def_cfa_offset_sf: %ld\n", (long) l); break; case DW_CFA_MIPS_advance_loc8: