]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
alpha: Define PTR_MANGLE for !PIC too.
authorRichard Henderson <rth@twiddle.net>
Fri, 26 Mar 2010 17:30:25 +0000 (10:30 -0700)
committerRichard Henderson <rth@twiddle.net>
Fri, 26 Mar 2010 20:17:52 +0000 (13:17 -0700)
Signed-off-by: Richard Henderson <rth@twiddle.net>
ChangeLog.alpha
sysdeps/unix/alpha/sysdep.h

index e4c4a6c473b37b493ed050a0727c0c7b8893656c..6cb84b87f9b05fdb5908f635d02fd61bd1f09ab3 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-26  Richard Henderson  <rth@redhat.com>
+
+       * sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): Define for !PIC too.
+       (PTR_DEMANGLE): Likewise.
+
 2010-03-26  Richard Henderson  <rth@redhat.com>
 
        * sysdeps/unix/alpha/sysdep.h (INTERNAL_SYSCALL_ERROR_P,
index 8accde0dc2941886066ca71f1b386fd4ccf62d5f..d9009c15714543f842a897f20c34985044d5a770 100644 (file)
@@ -430,11 +430,21 @@ extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
 #  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
 #  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
 # else
-extern uintptr_t __pointer_chk_guard attribute_relro;
+extern const uintptr_t __pointer_chk_guard attribute_relro;
 #  define PTR_MANGLE(var)      \
-       (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
+       (var) = (__typeof(var)) ((uintptr_t) (var) ^ __pointer_chk_guard)
 #  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
 # endif
+#else
+/* There exists generic C code that assumes that PTR_MANGLE is always
+   defined.  When generating code for the static libc, we don't have
+   __pointer_chk_guard defined.  Nor is there any place that would
+   initialize it if it were defined, so there's little point in doing
+   anything more than nothing.  */
+# ifndef __ASSEMBLER__
+#  define PTR_MANGLE(var)
+#  define PTR_DEMANGLE(var)
+# endif
 #endif
 
 #endif /* ASSEMBLER */