This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: personality(0) in sysdeps/unix/sysv/linux/init-first.c


>>>>> H J Lu writes:

HJ> On Thu, Mar 02, 2000 at 05:08:27PM +0100, Andreas Jaeger wrote:
>> >>>>> Ivan Kokshaysky writes:
>> 
>> > Since "-taso" linker option (31-bit addressing) for alpha went into
>> > linux-binutils, people start to complain that it doesn't work - they get
>> > segfaults because pointers to malloc'ed memory aren't fitting in the
>> > 32-bit int. The reason is personality(0) call in init_first.c resetting
>> > 31-bit mode.
>> 
>> > Actually, this call was removed in glibc CVS 6 months ago, but still
>> > present in releases/snapshots...
>> It was removed for glibc 2.2 - but not for glibc 2.1.  They're
>> separate branches.
>> 
>> Ulrich, this is the ChangeLog entry - do you want to add it to glibc
>> 2.1?
>> 
>> 1999-08-20  Ulrich Drepper  <drepper@cygnus.com>
>> 
>> * sysdeps/unix/sysv/linux/init-first.c (init): Remove personality
>> call.  It should not be necessary andis harmful for Alpha.

HJ> While we are on it, shouldn't we remove all traces of personality?
HJ> There are

HJ> #include <linux/personality.h>
HJ> extern int __personality (int);
HJ> /* We must not call `personality' twice.  */

I agree, here's a patch.

Andreas

P.S. H.J., since libc-hacker is a closed list, you should either
redirect such emails to libc-alpha - or don't CC others.  Brad and
Ivan have no chance to answer this email to the list.  I've changed
the CC now.


2000-03-02  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/init-first.c (init): Personality is not
	used anymore, remove references to it.


============================================================
Index: sysdeps/unix/sysv/linux/init-first.c
--- sysdeps/unix/sysv/linux/init-first.c	1999/08/21 04:09:10	1.25
+++ sysdeps/unix/sysv/linux/init-first.c	2000/03/02 16:18:27
@@ -1,5 +1,5 @@
 /* Initialization code run first thing by the ELF startup code.  Linux version.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,6 @@
 #include <unistd.h>
 #include <sysdep.h>
 #include <fpu_control.h>
-#include <linux/personality.h>
 #include <init-first.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -59,10 +58,9 @@
 static void
 init (int argc, char **argv, char **envp)
 {
-  extern int __personality (int);
   extern void __getopt_clean_environment (char **);
 
-  /* We must not call `personality' twice.  */
+  /* Do this only once.  */
   if (!__libc_multiple_libcs)
     {
       /* Test whether the kernel is new enough.  This test is only
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]