From d400dcac5e66047f86291d1a4b90fffb6327dc43 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 20 Aug 2013 15:01:59 -0500 Subject: PowerPC: fix backtrace to handle signal trampolines This patch fixes backtrace for PPC32 and PPC64 to correctly handle signal trampolines. The 'debug/tst-backtrace6.c' also check for SA_SIGINFO handling, where is triggers another vDSO symbols for PPC32. --- sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h | 7 +++++++ sysdeps/unix/sysv/linux/powerpc/init-first.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h index 8b195db..ba54de4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h @@ -34,6 +34,13 @@ extern void *__vdso_getcpu; extern void *__vdso_time; +#if defined(__PPC64__) || defined(__powerpc64__) +extern void *__vdso_sigtramp_rt64; +#else +extern void *__vdso_sigtramp32; +extern void *__vdso_sigtramp_rt32; +#endif + /* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO symbol. This works because _dl_vdso_vsym always return the function address, and no vDSO symbols use the TOC or chain pointers from the OPD diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c index f6f05f0..061715f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/init-first.c +++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c @@ -29,6 +29,12 @@ void *__vdso_clock_getres; void *__vdso_get_tbfreq; void *__vdso_getcpu; void *__vdso_time; +#if defined(__PPC64__) || defined(__powerpc64__) +void *__vdso_sigtramp_rt64; +#else +void *__vdso_sigtramp32; +void *__vdso_sigtramp_rt32; +#endif static inline void _libc_vdso_platform_setup (void) @@ -46,6 +52,16 @@ _libc_vdso_platform_setup (void) __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); __vdso_time = _dl_vdso_vsym ("__kernel_time", &linux2615); + + /* PPC64 uses only one signal trampoline symbol, while PPC32 will use + two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not + (__kernel_sigtramp32). */ +#if defined(__PPC64__) || defined(__powerpc64__) + __vdso_sigtramp_rt64 = _dl_vdso_vsym ("__kernel_sigtramp_rt64", &linux2615); +#else + __vdso_sigtramp32 = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615); + __vdso_sigtramp_rt32 = _dl_vdso_vsym ("__kernel_sigtramp_rt32", &linux2615); +#endif } # define VDSO_SETUP _libc_vdso_platform_setup -- cgit v1.1