This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix .cfi_* directive skip over >= 64KB (PR gas/10255)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]