From ee390edfa9018351f794f73207a1dbb324feace0 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 26 Mar 2010 10:30:25 -0700 Subject: [PATCH] alpha: Define PTR_MANGLE for !PIC too. Signed-off-by: Richard Henderson --- ChangeLog.alpha | 5 +++++ sysdeps/unix/alpha/sysdep.h | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog.alpha b/ChangeLog.alpha index e4c4a6c473..6cb84b87f9 100644 --- a/ChangeLog.alpha +++ b/ChangeLog.alpha @@ -1,5 +1,10 @@ 2010-03-26 Richard Henderson + * sysdeps/unix/alpha/sysdep.h (PTR_MANGLE): Define for !PIC too. + (PTR_DEMANGLE): Likewise. + +2010-03-26 Richard Henderson + * sysdeps/unix/alpha/sysdep.h (INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): "Use" the "other" variable in each macro. diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h index 8accde0dc2..d9009c1571 100644 --- a/sysdeps/unix/alpha/sysdep.h +++ b/sysdeps/unix/alpha/sysdep.h @@ -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 */ -- 2.11.4.GIT