This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Minimal FDE
On Wed, Sep 01, 2004 at 10:59:05AM +0300, Yaakov Yaari wrote:
> Alan Modra <amodra@bigpond.net.au> wrote on 01/09/2004 10:26:48:
> > 0000000000046238 <.__gcc_personality_v0>:
> > 46238: 7c 08 02 a6 mflr r0
> > 4623c: fb 81 ff e0 std r28,-32(r1)
> >
> > have corresponding eh_frame info:
> >
> > 00000040 00000034 00000044 FDE cie=00000000 pc=00046238..000462f0
> > DW_CFA_advance_loc: 8 to 00046240
> > DW_CFA_offset: r28 at cfa-32
> >
> > So the FDE is valid for pc's in the range 46238..462f0, but told to
> > unwind starting from a pc of 46238 or 4623c, the unwinder will know
> > that r28 should not be read from the stack frame..
>
> My assumption is that when readelf -wf interprets the FDE and prints, "
> DW_CFA_advance_loc: 8 to 00046240", it does so because initially the PC is
> at 46238, and it encounters an "advance 8" instruction. The location 46240
Yes.
> is not in the DWARF instruction. Thus, a replicated FDE, for some disjoint
> chunk (00050000..0005008) of this function, would have the header part of
> the FDE indicate that range, encoded as 0x50000, 0x8, and the rest of the
> FDE replicated as is. Given that, the readelf will interpret that FDE
> something like..
> 00000040 00000034 00000044 FDE cie=00000000 pc=00050000..50008
> DW_CFA_advance_loc: 8 to 0005008
> DW_CFA_offset: r28 at cfa-32
Yes, that's what you would get if you replicated the FDE, and only
changed the range. But as I said before, copying the advance_loc is
wrong. Complete nonsense for this example of a two insn chunk. :)
The advance_loc says nothing happens in the chunk until you reach
address 5008, but that's outside the chunk!
Given a chunk pulled out of the body of the function somewhere, you want
to say that all register saving and stack growth have already happened
at the start of the chunk, _not_ that various things happen as we
execute the chunk.
--
Alan Modra
IBM OzLabs - Linux Technology Centre