[PATCH] powerpc/vdso: Fix incorrect CFI in gettimeofday.S

Alan Modra amodra at gmail.com
Tue May 3 09:53:29 AEST 2022


On Mon, May 02, 2022 at 09:27:05AM -0500, Segher Boessenkool wrote:
> >   2) If a function changes LR or any non-volatile register, the save
> >      location for those regs must be given. The cfi can be at any
> >      instruction after the saves up to the point that the reg is
> >      changed. (Exception: LR save should be described before a bl.)
> 
> That isn't an exception?  bl changes the current LR after all :-)

The point is that in other cases the cfi can be as late as the
instruction that changes the reg.  For calls it must be at least one
instruction before the call.

Also, I'll note for the wider audience that delaying cfi is slightly
better than playing it safe as Michael has done in his patch in
describing the saves right at the save instruction.  Register save cfi
can usually be grouped together, resulting in fewer CFI_advance codes
in .eh_frame.

> Alan proposed a larger patch that changed to a single stack frame, but it needs changes to
> take into account the red zone.

Yes, now that you mention it, I see the obvious error in the patch I
wrote.  I did say it was untested!


-- 
Alan Modra
Australia Development Lab, IBM


More information about the Linuxppc-dev mailing list