diff options
author | Roland McGrath <roland@gnu.org> | 2005-02-16 11:20:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2005-02-16 11:20:22 +0000 |
commit | 57776c98f200fb43e38232df3251d9ab8fb0dd38 (patch) | |
tree | 0b2e606fc612e8b4ca62a534f6ea33cc13a8382c /sysdeps | |
parent | ac895ce8401bdc67a1a7c29ca3792518af9f21ec (diff) | |
download | glibc-57776c98f200fb43e38232df3251d9ab8fb0dd38.tar glibc-57776c98f200fb43e38232df3251d9ab8fb0dd38.tar.gz glibc-57776c98f200fb43e38232df3251d9ab8fb0dd38.tar.bz2 glibc-57776c98f200fb43e38232df3251d9ab8fb0dd38.zip |
2005-02-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Define.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index a15109f800..b91af4007c 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -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 */ |