Back to index

glibc  2.9
Defines | Functions
ldsodefs.h File Reference
#include <kernel-features.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.




void _dl_aux_init (ElfW(auxv_t)*av) internal_function
void _dl_non_dynamic_init (void) internal_function

Define Documentation


Definition at line 30 of file ldsodefs.h.

Function Documentation

void _dl_aux_init ( ElfW(auxv_t)*  av)

Here is the caller graph for this function:

void _dl_non_dynamic_init ( void  )

Definition at line 34 of file init-first.c.

  char **argv = &arg0;
  char **envp = &argv[argc + 1];
  struct hurd_startup_data *d;

  __libc_argc = argc;
  __libc_argv = argv;
  __environ = envp;
  while (*envp)
  d = (void *) ++envp;

  /* If we are the bootstrap task started by the kernel,
     then after the environment pointers there is no Hurd
     data block; the argument strings start there.  */
  if ((void *) d != argv[0])
      _hurd_init_dtable = d->dtable;
      _hurd_init_dtablesize = d->dtablesize;

       /* Check if the stack we are now on is different from
          the one described by _hurd_stack_{base,size}.  */

       char dummy;
       const vm_address_t newsp = (vm_address_t) &dummy;

       if (d->stack_size != 0 && (newsp < d->stack_base ||
                               newsp - d->stack_base > d->stack_size))
         /* The new stack pointer does not intersect with the
            stack the exec server set up for us, so free that stack.  */
         __vm_deallocate (__mach_task_self (), d->stack_base, d->stack_size);

  if (__hurd_threadvar_stack_mask == 0)
      /* We are not using cthreads, so we will have just a single allocated
        area for the per-thread variables of the main user thread.  */
      unsigned long int i;
       = (unsigned long int) malloc (__hurd_threadvar_max *
                                  sizeof (unsigned long int));
      if (__hurd_threadvar_stack_offset == 0)
       __libc_fatal ("Can't allocate single-threaded per-thread variables.");
      for (i = 0; i < __hurd_threadvar_max; ++i)
       ((unsigned long int *) __hurd_threadvar_stack_offset)[i] = 0;

  if ((void *) d != argv[0] && (d->portarray || d->intarray))
    /* Initialize library data structures, start signal processing, etc.  */
    _hurd_init (d->flags, argv,
              d->portarray, d->portarraysize,
              d->intarray, d->intarraysize);

#ifndef SHARED
  _dl_non_dynamic_init ();
  __init_misc (argc, argv, __environ);

  /* This is a hack to make the special getopt in GNU libc working.  */
  __getopt_clean_environment (envp);

#ifdef SHARED
  __libc_global_ctors ();

  (void) &init1;