about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/init-first.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-30 17:10:48 +0000
committerRoland McGrath <roland@gnu.org>1995-09-30 17:10:48 +0000
commit41cfadd63c6d28400f263460e3f2b15e74893b63 (patch)
treea630064faeaec664341df5534b8defe2f5d1443a /sysdeps/unix/sysv/linux/i386/init-first.c
parent24906b43b9bd9108aef17d18dfbb8764212085f7 (diff)
downloadglibc-41cfadd63c6d28400f263460e3f2b15e74893b63.tar.gz
glibc-41cfadd63c6d28400f263460e3f2b15e74893b63.tar.xz
glibc-41cfadd63c6d28400f263460e3f2b15e74893b63.zip
Sat Sep 30 11:47:05 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* posix/tstgetopt.c, posix/tstgetopt.args: Test long options too.

	* sysdeps/unix/sysv/linux/i386/init-first.c (init): Save, set, and
	restore %ebx by hand for personality syscall.
	GCC cannot deal with spilling the dedicated GOT register.

	* misc/Makefile (routines): Add mntent, which was somehow omitted.

Fri Sep 29 15:07:10 1995  Ulrich Drepper  <drepper@ipd.info.uni-karlsruhe.de>

 	* sysdeps/unix/sysv/linux/adjtime.c (__adjtime):
 	Change name of field `mode' in `struct timex' to `modes'.
	Linux-1.3.28 updates this name according to RFC 1489.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/init-first.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/init-first.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/init-first.c b/sysdeps/unix/sysv/linux/i386/init-first.c
index 0177daae24..84b5ff9f2c 100644
--- a/sysdeps/unix/sysv/linux/i386/init-first.c
+++ b/sysdeps/unix/sysv/linux/i386/init-first.c
@@ -18,6 +18,7 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <unistd.h>
+#include <sysdep.h>
 #include "fpu_control.h"
 
 extern void __libc_init (int, char **, char **);
@@ -31,9 +32,16 @@ init (int *data)
   char **argv = (void *) (data + 1);
   char **envp = &argv[argc + 1];
 
-  /* Make sure we are not using iBSC2 personality.  */
-  asm ("int $0x80 # syscall no %0, arg %1"
-       : : "a" (SYS_ify (personality)), "b" (0));
+  /* Make sure we are not using the iBSC2 personality.  The `personality'
+     syscall takes one argument; zero means the Linux personality.  The
+     argument arrives in %ebx; we have to save and restore %ebx by hand
+     here, because GCC (as of 2.7.0) cannot handle saving and restoring it
+     for us when it is the dedicated GOT register for PIC.  */
+  asm ("pushl %%ebx\n"
+       "xorl %%ebx, %%ebx\n"
+       "int $0x80 # syscall no %0\n"
+       "popl %%ebx"
+       : : "a" (SYS_ify (personality)));
 
   /* Set the FPU control word to the proper default value.  */
   __setfpucw (___fpu_control);