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 09:51:04AM +0300, Yaakov Yaari wrote:
> If advance instructions can be removed, as you suggest, it means the
> interpreter does not need the actual prolog instructions in order to have a
> proper restore.
As you say, the gcc unwinder does not need to look at the prologue.
> In this case why can't we just leave them and get the same
> effect?
Because they qualify the pc address range. The eh_frame info is really
a little program that says where certain registers get saved, and how
the stack frame changes. The location changing opcodes say that
following actions haven't happened until the specified pc is reached.
Taking a real example from libc, these two instructions:
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..
--
Alan Modra
IBM OzLabs - Linux Technology Centre