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] Scale DW_CFA_advance_loc[124] output values


On Tue, Nov 18, 2008 at 11:25:15AM -0500, John David Anglin wrote:
> > Yeah, seems ehopt.c is broken in many places too, at least in
> > check_eh_frame, eh_frame_estimate_size_before_relax and
> > eh_frame_convert_frag.  Fortunately gcc was always using code
> > alignment factor 1, so it didn't matter.
> 
> I'm thinking the optimization in check_eh_frame is only valid when
> the code alignment factor is 1.  That's the only time the advance
> can be represented as a difference of symbols.

The optimization is valid for any code alignment factor, just it behaves
incorrectly ATM for factor > 1.
Consider following 2 testcases, which should IMHO result in identical
readelf -wf dump if ignoring the Code alignment factor difference in the
CIE dump.  If the 2 nops are taken out from each of the sources, then
the dump is almost the same, just the second testcase has a missed
optimization - uses DW_CFA_advance_loc1 instead of DW_CFA_advance_loc,
where the latter is more compact.  With the nops ehopt.c actually screws
up the .eh_frame, as instead of DW_CFA_advance_loc 4 uses DW_CFA_advance_loc
1, so all following spots are 12 bytes apart from where they should be.

	Jakub

Attachment: t.s
Description: Text document

Attachment: t2.s
Description: Text document


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