mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-19 11:30:06 +00:00
fdacb17d48
1998-06-29 12:27 Ulrich Drepper <drepper@cygnus.com> * argp/argp.h: Use __PMT instead of __P for function pointer. * iconv/gconv.h: Likewise. * io/fts.h: Likewise. * io/ftw.h: Likewise. * libio/libio.h: Likewise. * malloc/mcheck.h: Likewise. * misc/search.h: Likewise. * posix/glob.h: Likewise. * resolv/resolv.h: Likewise. * signal/signal.h: Likewise. * stdlib/stdlib.h: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/bits/siginfo.h: Likewise. 1998-06-26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makeconfig (CPPFLAGS): Use $($(subdir)-CPPFLAGS) only once. 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * posix/wordexp.c (parse_param): Fix memory leak. 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libc.map: Export _IO_ftrylockfile. 1998-06-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/aio_sigqueue.c: Use get[pu]id instead of __get[pu]id. 1998-06-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-misc.c (_dl_debug_message): Don't cache the pid. * elf/dl-runtime.c (_dl_object_relocation_scope): Avoid adding the same search list twice. 1998-06-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> * login/programs/utmpd.c (handle_requests): Set and use maximal fd used to optimize loop/select. 1998-06-24 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/init-first.c: Don't define __libc_pid. * sysdeps/unix/sysv/linux/init-first.c: Likewise. * sysdeps/mach/hurd/i386/init-first.c: Likewise. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/arm/init-first.c: Likewise. * posix/getopt_init.c: Don't use __libc_pid. * sysdeps/unix/sysv/linux/aio_sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/sigqueue.c: Likewise. * libc.map: Remove __libc_uid and __libc_pid.
114 lines
3.2 KiB
C
114 lines
3.2 KiB
C
/* Initialization code run first thing by the ELF startup code. Linux version.
|
|
Copyright (C) 1995, 1996, 1997, 1998 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
|
|
modify it under the terms of the GNU Library General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#include <unistd.h>
|
|
#include <sysdep.h>
|
|
#include <fpu_control.h>
|
|
#include <linux/personality.h>
|
|
#include <init-first.h>
|
|
#include <sys/types.h>
|
|
|
|
extern void __libc_init_secure (void);
|
|
extern void __libc_init (int, char **, char **);
|
|
extern void __libc_global_ctors (void);
|
|
|
|
/* The function is called from assembly stubs the compiler can't see. */
|
|
static void init (int, char **, char **) __attribute__ ((unused));
|
|
|
|
extern int _dl_starting_up;
|
|
weak_extern (_dl_starting_up)
|
|
|
|
/* Set nonzero if we have to be prepared for more then one libc being
|
|
used in the process. Safe assumption if initializer never runs. */
|
|
int __libc_multiple_libcs = 1;
|
|
|
|
/* Remember the command line argument and enviroment contents for
|
|
later calls of initializers for dynamic libraries. */
|
|
int __libc_argc;
|
|
char **__libc_argv;
|
|
|
|
|
|
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. */
|
|
if (!__libc_multiple_libcs)
|
|
{
|
|
/* The `personality' system call takes one argument that chooses
|
|
the "personality", i.e. the set of system calls and such. We
|
|
must make this call first thing to disable emulation of some
|
|
other system that might have been enabled by default based on
|
|
the executable format. */
|
|
__personality (PER_LINUX);
|
|
|
|
/* Set the FPU control word to the proper default value. */
|
|
__setfpucw (__fpu_control);
|
|
}
|
|
|
|
/* Save the command-line arguments. */
|
|
__libc_argc = argc;
|
|
__libc_argv = argv;
|
|
__environ = envp;
|
|
|
|
#ifndef PIC
|
|
__libc_init_secure ();
|
|
#endif
|
|
|
|
__libc_init (argc, argv, envp);
|
|
|
|
/* This is a hack to make the special getopt in GNU libc working. */
|
|
__getopt_clean_environment (envp);
|
|
|
|
#ifdef PIC
|
|
__libc_global_ctors ();
|
|
#endif
|
|
}
|
|
|
|
#ifdef PIC
|
|
|
|
SYSDEP_CALL_INIT(_init, init);
|
|
|
|
void
|
|
__libc_init_first (void)
|
|
{
|
|
}
|
|
|
|
#else
|
|
void
|
|
__libc_init_first (int argc, char **argv, char **envp)
|
|
{
|
|
init (argc, argv, envp);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* This function is defined here so that if this file ever gets into
|
|
ld.so we will get a link error. Having this file silently included
|
|
in ld.so causes disaster, because the _init definition above will
|
|
cause ld.so to gain an init function, which is not a cool thing. */
|
|
|
|
void
|
|
_dl_start (void)
|
|
{
|
|
abort ();
|
|
}
|