This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix text relocation on ppc32
- From: Andreas Schwab <aschwab at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 25 Jun 2009 11:09:36 +0200
- Subject: Fix text relocation on ppc32
Let's get this one sorted out first, since it is orthogonal to the
backtracing stuff.
Fix the non-pic load of the string in the ppc32 ____longjmp_chk
function.
Andreas.
2009-06-25 Andreas Schwab <aschwab@redhat.com>
* sysdeps/powerpc/powerpc32/____longjmp_chk.S (LOAD_ARG): Define.
(CHECK_SP): Use it.
diff --git a/sysdeps/powerpc/powerpc32/____longjmp_chk.S b/sysdeps/powerpc/powerpc32/____longjmp_chk.S
index 5c1f648..510ce52 100644
--- a/sysdeps/powerpc/powerpc32/____longjmp_chk.S
+++ b/sysdeps/powerpc/powerpc32/____longjmp_chk.S
@@ -26,11 +26,30 @@
#define __longjmp ____longjmp_chk
+#ifdef PIC
+# ifdef HAVE_ASM_PPC_REL16
+# define LOAD_ARG \
+ bcl 20,31,1f; \
+1: mflr r3; \
+ addis r3,r3,_GLOBAL_OFFSET_TABLE_-1b@ha; \
+ addi r3,r3,_GLOBAL_OFFSET_TABLE_-1b@l; \
+ lwz r3,.LC0@got(r3)
+# else
+# define LOAD_ARG \
+ bl _GLOBAL_OFFSET_TABLE_-4@local; \
+ mflr r3; \
+ lwz r3,.LC0@got(r3)
+# endif
+#else
+# define LOAD_ARG \
+ lis r3,.LC0@ha; \
+ la r3,.LC0@l(r3)
+#endif
+
#define CHECK_SP(reg) \
cmplw reg, r1; \
bge+ .Lok; \
- lis r3,.LC0@ha; \
- la r3,.LC0@l(r3); \
+ LOAD_ARG; \
bl HIDDEN_JUMPTARGET (__fortify_fail); \
.Lok:
--
Andreas Schwab, aschwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."