This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RS6000] PR55341 linux unwind fixes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]