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 e4c4a6c..6cb84b8 100644 (file)
@@ -1,5 +1,10 @@
 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,
        INTERNAL_SYSCALL_ERRNO): "Use" the "other" variable in each macro.
 
index 8accde0..d9009c1 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 */