Blame SOURCES/glibc-rh1505492-powerpc-sotruss.patch

00db10
commit 2393fc0119fa291ff01b7b912dda2069257c8600
00db10
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
00db10
Date:   Wed Jan 15 11:05:00 2014 -0600
00db10
00db10
    PowerPC: sotruss-lib implementation
00db10
    
00db10
    This patch add the missing sotruss-lib interfaces for PowerPC.
00db10
00db10
diff --git a/sysdeps/powerpc/sotruss-lib.c b/sysdeps/powerpc/sotruss-lib.c
00db10
new file mode 100644
00db10
index 0000000000000000..2e52053ed1a9fa4a
00db10
--- /dev/null
00db10
+++ b/sysdeps/powerpc/sotruss-lib.c
00db10
@@ -0,0 +1,69 @@
00db10
+/* PowerPC specific sotruss-lib functions.
00db10
+   Copyright (C) 2013 Free Software Foundation, Inc.
00db10
+
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library.  If not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+#define HAVE_ARCH_PLTENTER
00db10
+#define HAVE_ARCH_PLTEXIT
00db10
+
00db10
+#include <elf/sotruss-lib.c>
00db10
+
00db10
+#ifdef __powerpc64__
00db10
+# if _CALL_ELF != 2
00db10
+#  define LA_PPC_REGS          La_ppc64_regs
00db10
+#  define LA_PPC_RETVAL        La_ppc64_retval
00db10
+#  define LA_PPC_GNU_PLTENTER  la_ppc64_gnu_pltenter
00db10
+#  define LA_PPC_GNU_PLTEXIT   la_ppc64_gnu_pltexit
00db10
+# else
00db10
+#  define LA_PPC_REGS          La_ppc64v2_regs
00db10
+#  define LA_PPC_RETVAL        La_ppc64v2_retval
00db10
+#  define LA_PPC_GNU_PLTENTER  la_ppc64v2_gnu_pltenter
00db10
+#  define LA_PPC_GNU_PLTEXIT   la_ppc64v2_gnu_pltexit
00db10
+# endif
00db10
+# else
00db10
+# define LA_PPC_REGS           La_ppc32_regs
00db10
+# define LA_PPC_RETVAL         La_ppc32_retval
00db10
+# define LA_PPC_GNU_PLTENTER   la_ppc32_gnu_pltenter
00db10
+# define LA_PPC_GNU_PLTEXIT    la_ppc32_gnu_pltexit
00db10
+#endif
00db10
+
00db10
+ElfW(Addr)
00db10
+LA_PPC_GNU_PLTENTER (ElfW(Sym) *sym __attribute__ ((unused)),
00db10
+		     unsigned int ndx __attribute__ ((unused)),
00db10
+		     uintptr_t *refcook, uintptr_t *defcook,
00db10
+		     LA_PPC_REGS *regs, unsigned int *flags,
00db10
+		     const char *symname, long int *framesizep)
00db10
+{
00db10
+  print_enter (refcook, defcook, symname,
00db10
+	       regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2], *flags);
00db10
+
00db10
+  /* No need to copy anything, we will not need the parameters in any case.  */
00db10
+  *framesizep = 0;
00db10
+
00db10
+  return sym->st_value;
00db10
+}
00db10
+
00db10
+unsigned int
00db10
+LA_PPC_GNU_PLTEXIT (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
00db10
+		    uintptr_t *defcook,
00db10
+		    const struct LA_PPC_REGS *inregs,
00db10
+		    struct LA_PPC_RETVAL *outregs, const char *symname)
00db10
+{
00db10
+  print_exit (refcook, defcook, symname, outregs->lrv_r3);
00db10
+
00db10
+  return 0;
00db10
+}