This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RFA: Display signed/factored offsets in readelf
- From: Daniel Jacobowitz <drow at false dot org>
- To: binutils at sources dot redhat dot com
- Date: Tue, 19 Apr 2005 17:04:59 -0400
- Subject: RFA: Display signed/factored offsets in readelf
While butchering some existing CFI annotations, I discovered that readelf
was missing a couple of multiplications by data_factor. OK?
BTW, the GAS cfi annotations don't work "right" with delay slots. Try this
on a mips assembler:
.cfi_startproc
.set noreorder
jr $31
addiu $29, $29, 8
.cfi_adjust_cfa_offset 8
.set reorder
.cfi_endproc
The CFI directive will come out at the beginning of the delay slot. Doesn't
make much practical difference, so I'm not going to track it down right now.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-04-19 Daniel Jacobowitz <dan@codesourcery.com>
* readelf.c (display_debug_frames): Use data factor for
DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf.
Index: binutils/binutils/readelf.c
===================================================================
--- binutils.orig/binutils/readelf.c 2005-04-12 16:39:11.000000000 -0400
+++ binutils/binutils/readelf.c 2005-04-19 16:50:16.922546591 -0400
@@ -10709,6 +10709,7 @@ display_debug_frames (Elf_Internal_Shdr
case DW_CFA_def_cfa_sf:
fc->cfa_reg = LEB ();
fc->cfa_offset = SLEB ();
+ fc->cfa_offset = fc->cfa_offset * fc->data_factor;
fc->cfa_exp = 0;
if (! do_debug_frames_interp)
printf (" DW_CFA_def_cfa_sf: r%d ofs %d\n",
@@ -10717,6 +10718,7 @@ display_debug_frames (Elf_Internal_Shdr
case DW_CFA_def_cfa_offset_sf:
fc->cfa_offset = SLEB ();
+ fc->cfa_offset = fc->cfa_offset * fc->data_factor;
if (! do_debug_frames_interp)
printf (" DW_CFA_def_cfa_offset_sf: %d\n", fc->cfa_offset);
break;