This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fix .cfi_* directive skip over >= 64KB (PR gas/10255)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 9 Jun 2009 05:46:03 -0700
- Subject: Re: [PATCH] Fix .cfi_* directive skip over >= 64KB (PR gas/10255)
- References: <20090609122834.GD3101@sunsite.ms.mff.cuni.cz>
On Tue, Jun 9, 2009 at 5:28 AM, Jakub Jelinek<jakub@redhat.com> wrote:
> Hi!
>
> When .cfi_* directives need to skip from one fragment to another one and
> that skip in the end turns to be >= 64KB, the generated .eh_frame section
> is incorrect. ?The problem is that we add the needed 1 byte fragment
> before rs_cfa fragment, but don't initialize it, so it often remains
> at DW_CFA_nop (or could be any other opcode). ?Later on when
> eh_frame_convert_frag is called, if the skip is small, the previous
> fragment's byte is changed into DW_CFA_advance_loc | distance,
> DW_CFA_advance_loc1 or DW_CFA_advance_loc2. ?But if it is >= 65536,
> ehopt.c assumes (IMHO correctly) that the byte before it is
> DW_CFA_advance_loc4 and doesn't change it, so we end up with a random opcode
> (usually DW_CFA_nop) followed by the 4 byte skip value (which is
> interpreted as random, often invalid, opcodes).
>
> Ok for trunk?
>
Will this patch:
Index: ehopt.c
===================================================================
--- ehopt.c (revision 6057)
+++ ehopt.c (working copy)
@@ -543,6 +543,7 @@ eh_frame_convert_frag (fragS *frag)
break;
default:
+ loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc4;
md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 4);
break;
}
work better?
--
H.J.