[67300de] | 1 | Submitted By: Joe Ciccone <jciccone@gmail.com>
|
---|
| 2 | Date: 2007-12-21
|
---|
| 3 | Initial Package Version: 2.7
|
---|
| 4 | Upstream Status: Reported
|
---|
| 5 | Origin: http://sources.redhat.com/bugzilla/show_bug.cgi?id=5216
|
---|
| 6 | Description: Moves and fixes the PTR_MANGLE definitions.
|
---|
| 7 |
|
---|
| 8 | --- glibc-2.7.orig/sysdeps/unix/alpha/sysdep.h
|
---|
| 9 | +++ glibc-2.7/sysdeps/unix/alpha/sysdep.h
|
---|
| 10 | @@ -397,42 +397,4 @@
|
---|
| 11 | _sc_ret = _sc_0, _sc_err = _sc_19; \
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | -/* Pointer mangling support. Note that tls access is slow enough that
|
---|
| 15 | - we don't deoptimize things by placing the pointer check value there. */
|
---|
| 16 | -
|
---|
| 17 | -#include <stdint.h>
|
---|
| 18 | -
|
---|
| 19 | -#if defined NOT_IN_libc && defined IS_IN_rtld
|
---|
| 20 | -# ifdef __ASSEMBLER__
|
---|
| 21 | -# define PTR_MANGLE(dst, src, tmp) \
|
---|
| 22 | - ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
|
---|
| 23 | - ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
|
---|
| 24 | - xor src, tmp, dst
|
---|
| 25 | -# define PTR_MANGLE2(dst, src, tmp) \
|
---|
| 26 | - xor src, tmp, dst
|
---|
| 27 | -# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
|
---|
| 28 | -# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
|
---|
| 29 | -# else
|
---|
| 30 | -extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
|
---|
| 31 | -# define PTR_MANGLE(var) \
|
---|
| 32 | - (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
|
---|
| 33 | -# define PTR_DEMANGLE(var) PTR_MANGLE(var)
|
---|
| 34 | -# endif
|
---|
| 35 | -#elif defined PIC
|
---|
| 36 | -# ifdef __ASSEMBLER__
|
---|
| 37 | -# define PTR_MANGLE(dst, src, tmp) \
|
---|
| 38 | - ldq tmp, __pointer_chk_guard; \
|
---|
| 39 | - xor src, tmp, dst
|
---|
| 40 | -# define PTR_MANGLE2(dst, src, tmp) \
|
---|
| 41 | - xor src, tmp, dst
|
---|
| 42 | -# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
|
---|
| 43 | -# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
|
---|
| 44 | -# else
|
---|
| 45 | -extern uintptr_t __pointer_chk_guard attribute_relro;
|
---|
| 46 | -# define PTR_MANGLE(var) \
|
---|
| 47 | - (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
|
---|
| 48 | -# define PTR_DEMANGLE(var) PTR_MANGLE(var)
|
---|
| 49 | -# endif
|
---|
| 50 | -#endif
|
---|
| 51 | -
|
---|
| 52 | #endif /* ASSEMBLER */
|
---|
| 53 | --- glibc-2.7.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h
|
---|
| 54 | +++ glibc-2.7/sysdeps/unix/sysv/linux/alpha/sysdep.h
|
---|
| 55 | @@ -98,4 +98,46 @@
|
---|
| 56 | INTERNAL_SYSCALL1(name, err_out, nr, args); \
|
---|
| 57 | })
|
---|
| 58 |
|
---|
| 59 | +/* Pointer mangling support. Note that tls access is slow enough that
|
---|
| 60 | + we don't deoptimize things by placing the pointer check value there. */
|
---|
| 61 | +
|
---|
| 62 | +#if defined NOT_IN_libc && defined IS_IN_rtld
|
---|
| 63 | +# ifdef __ASSEMBLER__
|
---|
| 64 | +# define PTR_MANGLE(dst, src, tmp) \
|
---|
| 65 | + ldah tmp, __pointer_chk_guard_local($29) !gprelhigh; \
|
---|
| 66 | + ldq tmp, __pointer_chk_guard_local(tmp) !gprellow; \
|
---|
| 67 | + xor src, tmp, dst
|
---|
| 68 | +# define PTR_MANGLE2(dst, src, tmp) \
|
---|
| 69 | + xor src, tmp, dst
|
---|
| 70 | +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
|
---|
| 71 | +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
|
---|
| 72 | +# else
|
---|
| 73 | +extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
|
---|
| 74 | +# define PTR_MANGLE(var) \
|
---|
| 75 | + (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
|
---|
| 76 | +# define PTR_DEMANGLE(var) PTR_MANGLE(var)
|
---|
| 77 | +# endif
|
---|
| 78 | +#elif defined PIC
|
---|
| 79 | +# ifdef __ASSEMBLER__
|
---|
| 80 | +# define PTR_MANGLE(dst, src, tmp) \
|
---|
| 81 | + ldq tmp, __pointer_chk_guard; \
|
---|
| 82 | + xor src, tmp, dst
|
---|
| 83 | +# define PTR_MANGLE2(dst, src, tmp) \
|
---|
| 84 | + xor src, tmp, dst
|
---|
| 85 | +# define PTR_DEMANGLE(dst, tmp) PTR_MANGLE(dst, dst, tmp)
|
---|
| 86 | +# define PTR_DEMANGLE2(dst, tmp) PTR_MANGLE2(dst, dst, tmp)
|
---|
| 87 | +# else
|
---|
| 88 | +extern uintptr_t __pointer_chk_guard attribute_relro;
|
---|
| 89 | +# define PTR_MANGLE(var) \
|
---|
| 90 | + (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
|
---|
| 91 | +# define PTR_DEMANGLE(var) PTR_MANGLE(var)
|
---|
| 92 | +# endif
|
---|
| 93 | +#else
|
---|
| 94 | +/* Pointer mangling is not yet supported for static libc on alpha. */
|
---|
| 95 | +# ifndef __ASSEMBLER__
|
---|
| 96 | +# define PTR_MANGLE(var) (void) (var)
|
---|
| 97 | +# define PTR_DEMANGLE(var) (void) (var)
|
---|
| 98 | +# endif
|
---|
| 99 | +#endif
|
---|
| 100 | +
|
---|
| 101 | #endif /* _LINUX_ALPHA_SYSDEP_H */
|
---|