source: patches/glibc-2.7-alpha_PTR_MANGLE_fix-1.patch@ c70f11b

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since c70f11b was bd88a5f, checked in by Joe Ciccone <jciccone@…>, 17 years ago
  • Property mode set to 100644
File size: 3.5 KB
  • sysdeps/unix/alpha/sysdep.h

    Submitted By: Joe Ciccone <jciccone@gmail.com>
    Date: 2007-12-21
    Initial Package Version: 2.7
    Upstream Status: Reported
    Origin: http://sources.redhat.com/bugzilla/show_bug.cgi?id=5216
    Description: Moves and fixes the PTR_MANGLE definitions.
    
    old new  
    397397        _sc_ret = _sc_0, _sc_err = _sc_19;                      \
    398398}
    399399
    400 /* Pointer mangling support.  Note that tls access is slow enough that
    401    we don't deoptimize things by placing the pointer check value there.  */
    402 
    403 #include <stdint.h>
    404 
    405 #if defined NOT_IN_libc && defined IS_IN_rtld
    406 # ifdef __ASSEMBLER__
    407 #  define PTR_MANGLE(dst, src, tmp)                             \
    408         ldah    tmp, __pointer_chk_guard_local($29) !gprelhigh; \
    409         ldq     tmp, __pointer_chk_guard_local(tmp) !gprellow;  \
    410         xor     src, tmp, dst
    411 #  define PTR_MANGLE2(dst, src, tmp)                            \
    412         xor     src, tmp, dst
    413 #  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    414 #  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    415 # else
    416 extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
    417 #  define PTR_MANGLE(var)       \
    418   (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
    419 #  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    420 # endif
    421 #elif defined PIC
    422 # ifdef __ASSEMBLER__
    423 #  define PTR_MANGLE(dst, src, tmp)             \
    424         ldq     tmp, __pointer_chk_guard;       \
    425         xor     src, tmp, dst
    426 #  define PTR_MANGLE2(dst, src, tmp)            \
    427         xor     src, tmp, dst
    428 #  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
    429 #  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
    430 # else
    431 extern uintptr_t __pointer_chk_guard attribute_relro;
    432 #  define PTR_MANGLE(var)       \
    433         (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
    434 #  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
    435 # endif
    436 #endif
    437 
    438400#endif /* ASSEMBLER */
  • sysdeps/unix/sysv/linux/alpha/sysdep.h

    old new  
    9898        INTERNAL_SYSCALL1(name, err_out, nr, args);                     \
    9999})
    100100
     101/* Pointer mangling support.  Note that tls access is slow enough that
     102   we don't deoptimize things by placing the pointer check value there.  */
     103
     104#if defined NOT_IN_libc && defined IS_IN_rtld
     105# ifdef __ASSEMBLER__
     106#  define PTR_MANGLE(dst, src, tmp)                             \
     107        ldah    tmp, __pointer_chk_guard_local($29) !gprelhigh; \
     108        ldq     tmp, __pointer_chk_guard_local(tmp) !gprellow;  \
     109        xor     src, tmp, dst
     110#  define PTR_MANGLE2(dst, src, tmp)                            \
     111        xor     src, tmp, dst
     112#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
     113#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
     114# else
     115extern uintptr_t __pointer_chk_guard_local attribute_relro attribute_hidden;
     116#  define PTR_MANGLE(var)       \
     117  (var) = (__typeof (var)) ((uintptr_t) (var) ^ __pointer_chk_guard_local)
     118#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
     119# endif
     120#elif defined PIC
     121# ifdef __ASSEMBLER__
     122#  define PTR_MANGLE(dst, src, tmp)             \
     123        ldq     tmp, __pointer_chk_guard;       \
     124        xor     src, tmp, dst
     125#  define PTR_MANGLE2(dst, src, tmp)            \
     126        xor     src, tmp, dst
     127#  define PTR_DEMANGLE(dst, tmp)   PTR_MANGLE(dst, dst, tmp)
     128#  define PTR_DEMANGLE2(dst, tmp)  PTR_MANGLE2(dst, dst, tmp)
     129# else
     130extern uintptr_t __pointer_chk_guard attribute_relro;
     131#  define PTR_MANGLE(var)       \
     132        (var) = (void *) ((uintptr_t) (var) ^ __pointer_chk_guard)
     133#  define PTR_DEMANGLE(var)  PTR_MANGLE(var)
     134# endif
     135#else
     136/* Pointer mangling is not yet supported for static libc on alpha.  */
     137# ifndef __ASSEMBLER__
     138#  define PTR_MANGLE(var)   (void) (var)
     139#  define PTR_DEMANGLE(var) (void) (var)
     140# endif
     141#endif
     142
    101143#endif /* _LINUX_ALPHA_SYSDEP_H */
Note: See TracBrowser for help on using the repository browser.