Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb@sourceware.org, libc-alpha@sourceware.org, ak@suse.de
Subject: Re: Notes on a frame_unwind_address_in_block problem
Date: Tue, 18 Jul 2006 09:48:00 -0000	[thread overview]
Message-ID: <hoirlvgytk.fsf@reger.suse.de> (raw)
In-Reply-To: <20060717131527.GA9392@nevyn.them.org> (Daniel Jacobowitz's 	message of "Mon, 17 Jul 2006 09:15:27 -0400")

[-- Attachment #1: Type: text/plain, Size: 2083 bytes --]

Daniel Jacobowitz <drow@false.org> writes:

> On Mon, Jul 17, 2006 at 09:29:46AM +0200, Mark Kettenis wrote:
>> Something like what's done in the kernel (arch/x86_64/kernel/vsyscall.S).
>> Hmm, I wonder why Daniel's box uses the trampoline from libc instead of
>> the trampoline in the vsyscall page.
>
> Ah, now, this is a very interesting question.  I'm glad you asked :-)
>
> __libc_sigaction (int sig, const struct sigaction *act, struct
> sigaction *oact)
> {
>   int result;
>   struct kernel_sigaction kact, koact;
>
>   if (act)
>     {
>       kact.k_sa_handler = act->sa_handler;
>       memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
>       kact.sa_flags = act->sa_flags | SA_RESTORER;
>
>       kact.sa_restorer = &restore_rt;
>     }
>
> That's how we end up at the trampoline: through use of SA_RESTORER.
> I didn't respond to this earlier because I wanted to find some time to
> check whether that was necessary.
>
> Andreas, looking at the i386 version, I guess that using SA_RESTORER
> this way is not necessary.  Simply a performance optimization because
> the old trampolines (written to the stack) were so slow, or maybe
> because they required an executable stack.  i386 has
> "if (GLRO(dl_sysinfo_dso) == NULL)" around it.  Can x86_64 do the same
> thing?

i386 is the only platform doing it.  I don't know the history of the
change and whether this is the right thing to do.  Is somebody willing
to test this?

> The existing unwind information would still be wrong, but on systems
> with a vDSO it wouldn't matter any more.
>
>> Anyway, if with the current libc, the trampoline provided by the kernel is
>> supposed to be used, then it's probably not worth bothering to add CFI
>> to libc, and I'd just remove the CFI_STARTPROC and CFI_ENDPROC statements.
>
> Either way seems reasonable.

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj/
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

  reply	other threads:[~2006-07-18  7:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 22:22 Daniel Jacobowitz
2006-07-13 20:20 ` Mark Kettenis
2006-07-17  7:30   ` Andreas Jaeger
2006-07-17 13:15     ` Mark Kettenis
2006-07-17 13:20       ` Daniel Jacobowitz
2006-07-18  9:48         ` Andreas Jaeger [this message]
2006-07-18 18:39           ` Daniel Jacobowitz
2006-08-03  2:04             ` Daniel Jacobowitz
2006-08-03  2:38               ` Andi Kleen
2006-08-03  2:48                 ` Daniel Jacobowitz
2006-08-03  3:12                   ` Andi Kleen
2006-08-03  3:21                     ` Daniel Jacobowitz
2006-08-03  3:29                       ` Andi Kleen
2006-08-03 13:27                         ` Daniel Jacobowitz
2006-08-18 15:08                       ` Andreas Jaeger
2006-08-18 15:15                         ` Daniel Jacobowitz
2006-08-21  8:50                           ` Andreas Jaeger
2006-08-21 14:19                             ` Ulrich Drepper
2006-08-21 14:52                               ` Daniel Jacobowitz
2006-07-18 18:50   ` Daniel Jacobowitz

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=hoirlvgytk.fsf@reger.suse.de \
    --to=aj@suse.de \
    --cc=ak@suse.de \
    --cc=gdb@sourceware.org \
    --cc=libc-alpha@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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