From: Andrew Cagney <ac131313@redhat.com>
To: Michael Elizabeth Chastain <mec@shout.net>
Cc: gdb@sources.redhat.com
Subject: Re: [Fwd: Unwinding through `no return'?]
Date: Wed, 13 Aug 2003 18:45:00 -0000 [thread overview]
Message-ID: <3F3A873A.9080100@redhat.com> (raw)
In-Reply-To: <200308131743.h7DHhRIL009378@duracef.shout.net>
> Three comments, kinda superficial:
>
> Sometimes the caller will be in code with no debug info,
> such as library code. RA-1 would be good there.
>
> Look at the case where the operating system delivers a signal and sets
> up a sigreturn frame. In that case, a return address on a stack
> really does point to the first instruction of a function (__restore
> on my red hat linux 8 box). RA-1 would be bad there.
FYI, I've already sent a follow up expanding on this.
> Someone, maybe rth?, mentioned that on some architectures,
> the ABI requires a nop instruction after a noreturn call.
> If we ask gcc to do something like that in all cases it might
> make our job easier.
That matches one of the responses:
> Andrew:
>
> We also encountered this problem, where the call's return address actually
> pointed to the first instruction of a subsequent routine, because the call
> was known never to return. We were leery of changing the unwinder always to
> back up because of the issue you raised, where a normal function call might
> need different CFI before and after the call. I don't know of a real world
> situation where that happens, but that doesn't mean there isn't one, and I'd
> hate to break it. Our tail-wagging-dog solution was to emit an extra
> instruction after the call that never returns. On Pentium, for instance,
> ud2. Then that extra instruction's address was the return address and it had
> CFI appropriate for the calling routine.
>
> -- Todd Allen Concurrent Computer Corporation
But it won't fly when the compiler is trying to optimize for space.
Andrew
next prev parent reply other threads:[~2003-08-13 18:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-13 17:43 Michael Elizabeth Chastain
2003-08-13 18:45 ` Andrew Cagney [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-08-13 17:31 Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F3A873A.9080100@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=mec@shout.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox