New test to expose erroneous negative sign on logb(1) (bug 887).
[glibc.git] / elf / stackguard-macros.h
bloba9889cf7b274a3e689e9ae045454938ef94bdd5a
1 #include <stdint.h>
3 #ifdef __i386__
4 # define STACK_CHK_GUARD \
5 ({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
6 #elif defined __x86_64__
7 # define STACK_CHK_GUARD \
8 ({ uintptr_t x; asm ("movq %%fs:0x28, %0" : "=r" (x)); x; })
9 #elif defined __powerpc64__
10 # define STACK_CHK_GUARD \
11 ({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })
12 #elif defined __powerpc__
13 # define STACK_CHK_GUARD \
14 ({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
15 #elif defined __sparc__ && defined __arch64__
16 # define STACK_CHK_GUARD \
17 ({ uintptr_t x; asm ("ldx [%%g7+0x28], %0" : "=r" (x)); x; })
18 #elif defined __sparc__
19 # define STACK_CHK_GUARD \
20 ({ uintptr_t x; asm ("ld [%%g7+0x14], %0" : "=r" (x)); x; })
21 #elif defined __s390x__
22 # define STACK_CHK_GUARD \
23 ({ uintptr_t x; asm ("ear %0,%%a0; sllg %0,%0,32; ear %0,%%a1; lg %0,0x28(%0)" : "=a" (x)); x; })
24 #elif defined __s390__
25 # define STACK_CHK_GUARD \
26 ({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; })
27 #elif !defined STACK_CHK_GUARD
28 extern uintptr_t __stack_chk_guard;
29 # define STACK_CHK_GUARD __stack_chk_guard
30 #endif