]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2005-02-07 Ulrich Drepper <drepper@redhat.com>
authorRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:20:22 +0000 (11:20 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 16 Feb 2005 11:20:22 +0000 (11:20 +0000)
* sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Define.

sysdeps/unix/sysv/linux/i386/sysdep.h

index a15109f80001b56593afa4638a0fd497077165df..b91af4007ce6b12b6efbdf41613429f94ae22bee 100644 (file)
@@ -540,6 +540,29 @@ asm (".L__X'%ebx = 1\n\t"
 # define EXTRAVAR_5
 #endif
 
+/* Consistency check for position-independent code.  */
+#ifdef __PIC__
+# define check_consistency()                                                 \
+  ({ int __res;                                                                      \
+     __asm__ __volatile__                                                    \
+       ("call __i686.get_pc_thunk.cx;"                                       \
+       "addl $_GLOBAL_OFFSET_TABLE_, %%ecx;"                                 \
+       "subl %%ebx, %%ecx;"                                                  \
+       "je 1f;"                                                              \
+       "ud2;"                                                                \
+       "1:\n"                                                                \
+       ".section .gnu.linkonce.t.__i686.get_pc_thunk.cx,\"ax\",@progbits;"   \
+       ".globl __i686.get_pc_thunk.cx;"                                      \
+       ".hidden __i686.get_pc_thunk.cx;"                                     \
+       ".type __i686.get_pc_thunk.cx,@function;"                             \
+       "__i686.get_pc_thunk.cx:"                                             \
+       "movl (%%esp), %%ecx;"                                                \
+       "ret;"                                                                \
+       ".previous"                                                           \
+       : "=c" (__res));                                                      \
+     __res; })
+#endif
+
 #endif /* __ASSEMBLER__ */
 
 #endif /* linux/i386/sysdep.h */