This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix ____longjmp_chk for ppc(64)
On Wed, Jun 24, 2009 at 11:56:41PM +0200, Andreas Schwab wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
>
> > On Wed, Jun 24, 2009 at 10:28:39AM -0700, Richard Henderson wrote:
> >> On 06/24/2009 10:15 AM, Jakub Jelinek wrote:
> >>> bl HIDDEN_JUMPTARGET (__fortify_fail); \
> >>> .Lok: \
> >>> mr r1, reg; \
> >>> + cfi_adjust_cfa_offset (-112); \
> >>> + cfi_same_value (lr)
> >>>
> >>> and remove the mr r1, r14 resp. mr r1, r22 from __longjmp-common.S?
> >>> Then you don't need to add any extra insn.
> >>
> >> The cfa is incorrect for the duration of the mr r1 insn.
> >
> > Ah, but in that case can't be the cfi directives be right after bl?
>
> I tried that, but then gdb cannot backtrace through ____longjmp_chk any
> more (it says "Backtrace stopped: frame did not save the PC").
For noreturn calls which can't be tail-called GCC also emits .cfi_*
directives right after the call (whether it is .cfi_endproc or e.g.
.cfi_restore_state), so I'd say if gdb doesn't handle it, we should fix gdb.
Also, cfi_remember_state/cfi_restore_state pair would be more compact
than cfi_adjust_cfa_offset (-112); cfi_same_value (lr).
Jakub