public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Edelsohn <dje.gcc@gmail.com>
To: gcc-patches@gcc.gnu.org, Alan Modra <amodra@gmail.com>
Subject: Re: [RS6000] PR55341 linux unwind fixes
Date: Fri, 15 Feb 2013 01:07:00 -0000	[thread overview]
Message-ID: <CAGWvnynGPHZV6A05qdjWfCWiHGJVyHjrKiv5HMfPSzBr25OcGA@mail.gmail.com> (raw)
In-Reply-To: <20130214223357.GA9150@bubble.grove.modra.org>

On Thu, Feb 14, 2013 at 5:33 PM, Alan Modra <amodra@gmail.com> wrote:
> PR55341 has two complaints, that powerpc gcc references a non-ABI
> symbol exported by glibc, and that the scheme used to find the aux
> vector can be broken by someone writing *environ = 0.  Both true, but
> since this code is only exercised when running Linux kernels prior to
> 2.6.15 (7 years old!), I was inclined to "fix" the first problem by
> making __libc_stack_end weak and ignore the second problem entirely.
>
> However, since I first looked at this bug, I've been delving into
> unwinding code due to thinking we had a problem in the kernel vdso
> with VSX registers.  We didn't, but the exercise taught me that my
> concern about blindly setting up locations for altivec registers is
> unfounded.  If the kernel doesn't support altivec and those locations
> point well past the kernel sigcontext, perhaps even to unmapped
> memory, we still don't have a problem since the normal course of
> unwinding won't reference those locations.  The unwinder only looks at
> few regs like cfa and ra during unwinding, and the rest of the regs
> when copying into _Unwind_* callee save locations using
> uw_install_context.  That means you'll only reference the altivec save
> locations if you're using a libgcc with altivec support.  Running such
> a libgcc on a kernel without altivec support is crazy, and will cause
> all sorts of problems before you even consider exception handling,
> eg. sigill if the hardware doesn't support altivec, no process context
> swapping of altivec regs etc.
>
> So we can do without the AT_HWCAP tests.  There is also no need to
> set up locations for call used regs.
>
> Bootstrapped and regression tested powerpc64-linux using a ld.so hack
> to prevent registration of the kernel vdso.  OK to apply?
>
>         PR target/55431
>         * config/rs6000/linux-unwind.h (ppc_linux_aux_vector): Delete.
>         (ppc_fallback_frame_state): Always set up save locations for fp
>         and altivec.  Don't bother with non-callee-saved regs, r0-r13
>         except for r2 on ppc64, fr0-fr13, v0-v19, vscr.

Okay.

Thanks, David

      reply	other threads:[~2013-02-15  1:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 22:34 Alan Modra
2013-02-15  1:07 ` David Edelsohn [this message]

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=CAGWvnynGPHZV6A05qdjWfCWiHGJVyHjrKiv5HMfPSzBr25OcGA@mail.gmail.com \
    --to=dje.gcc@gmail.com \
    --cc=amodra@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).