Skip to content

Commit

Permalink
(check_consistency): Define.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Feb 8, 2005
1 parent bc82059 commit dbfc1e0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions sysdeps/unix/sysv/linux/i386/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit dbfc1e0

Please sign in to comment.