mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Mon Jul 1 12:29:50 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* nss/Makefile (databases): Change host to hosts. * nss/host-lookup.c: Renamed to nss/hosts-lookup.c.
This commit is contained in:
@ -19,23 +19,22 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sysdep.h>
|
||||
#include "fpu_control.h"
|
||||
|
||||
/* This code is mostly the same for all machines. This version works at
|
||||
least for i386 and m68k, and probably any CISCy machine with a normal
|
||||
stack arrangement. */
|
||||
#include <fpu_control.h>
|
||||
#include "init-first.h"
|
||||
|
||||
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 (void *) __attribute__ ((unused));
|
||||
|
||||
static void
|
||||
init (int *data)
|
||||
init (void *data)
|
||||
{
|
||||
extern int __personality (int);
|
||||
|
||||
int argc = *data;
|
||||
char **argv = (void *) (data + 1);
|
||||
int argc = *(long *)data;
|
||||
char **argv = (char **)data + 1;
|
||||
char **envp = &argv[argc + 1];
|
||||
|
||||
/* The `personality' system call takes one argument that chooses the
|
||||
@ -50,33 +49,23 @@ init (int *data)
|
||||
|
||||
__environ = envp;
|
||||
__libc_init (argc, argv, envp);
|
||||
|
||||
#ifdef PIC
|
||||
__libc_global_ctors ();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PIC
|
||||
/* This function is called to initialize the shared C library.
|
||||
It is called just before the user _start code from i386/elf/start.S,
|
||||
with the stack set up as that code gets it. */
|
||||
|
||||
/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT
|
||||
pointer in the dynamic section based solely on that. It is convention
|
||||
for this function to be in the `.init' section, but the symbol name is
|
||||
the only thing that really matters!! */
|
||||
/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/
|
||||
SYSDEP_CALL_INIT(_init, init);
|
||||
|
||||
void
|
||||
_init (int argc, ...)
|
||||
__libc_init_first (void)
|
||||
{
|
||||
init (&argc);
|
||||
|
||||
__libc_global_ctors ();
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
SYSDEP_CALL_INIT(__libc_init_first, init);
|
||||
|
||||
void
|
||||
__libc_init_first (int argc __attribute__ ((unused)), ...)
|
||||
{
|
||||
#ifndef PIC
|
||||
init (&argc);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user