summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/stat.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/stat.S')
-rw-r--r--sysdeps/unix/sysv/linux/i386/stat.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/stat.S b/sysdeps/unix/sysv/linux/i386/stat.S
index 73204bf254..5902c21eb2 100644
--- a/sysdeps/unix/sysv/linux/i386/stat.S
+++ b/sysdeps/unix/sysv/linux/i386/stat.S
@@ -28,11 +28,20 @@ Cambridge, MA 02139, USA. */
ENTRY (__stat)
movl 8(%esp), %eax
movl 4(%esp), %ecx
+#ifdef PIC
+ pushl %ebx
+ call 0f
+0: popl %ebx
+ addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx
+#endif
pushl %eax
pushl %ecx
pushl $_STAT_VER /* Push extra first arg to syscall. */
call JUMPTARGET(__xstat)/* Jump to xstat implementation. */
addl $12, %esp
+#ifdef PIC
+ popl %ebx
+#endif
ret
weak_alias (__stat, stat)