https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98482

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jakub Jelinek from comment #10)
> If we are emitting for nested functions
>       pushq   %r10
> 1:    call    __fentry__
>       popq    %r10
> (is it ok to misalign the stack for __fentry__? but then even plain call
> __fentry__ actually misaligns it), then perhaps we can do similarly for the
> PIC case.  But I wonder how does __fentry__ then find the caller if it can't
> rely on the return address being right above the return address to the
> function that called __fentry__ (appart from unwind info of course, but we
> don't really emit .cfi_* directives here either, do we?).

Generic part of the compiler pushes static chain register for nested functions,
so there is little we can do in the target part. If there is a problem with
misaligned stack, then I think __mcount_internal will have to be realigned,
because calls to both, mcount and __fentry__ can be misaligned.

I don't know what to do with __fentry__ argument. Luckily, mcount finds its
argument via frame pointer, so it works there.

Reply via email to