Back to index

glibc  2.9
Classes | Defines | Functions | Variables
libc-start.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <ldsodefs.h>
#include <sysdep.h>
#include <bp-start.h>
#include <bp-sym.h>
#include <csu/libc-start.c>

Go to the source code of this file.


struct  startup_info


#define LIBC_START_MAIN   generic_start_main
#define argv   ubp_av


int BP_SYM() __libc_start_main (int argc, char *__unbounded *__unbounded ubp_av, char *__unbounded *__unbounded ubp_ev, ElfW(auxv_t)*__unbounded auxvec, void(*rtld_fini)(void), struct startup_info *__unbounded stinfo, char *__unbounded *__unbounded stack_on_entry)


int __cache_line_size attribute_hidden

Define Documentation

#define argv   ubp_av

Definition at line 34 of file libc-start.c.

Definition at line 31 of file libc-start.c.

#define LIBC_START_MAIN   generic_start_main

Definition at line 30 of file libc-start.c.

Definition at line 32 of file libc-start.c.


Definition at line 33 of file libc-start.c.

Function Documentation

int BP_SYM() __libc_start_main ( int  argc,
char *__unbounded *__unbounded  ubp_av,
char *__unbounded *__unbounded  ubp_ev,
ElfW(auxv_t)*__unbounded  auxvec,
void(*)(void)  rtld_fini,
struct startup_info *__unbounded  stinfo,
char *__unbounded *__unbounded  stack_on_entry 

Definition at line 48 of file libc-start.c.

  char **argv;
# define argv ubp_av

  /* the PPC SVR4 ABI says that the top thing on the stack will
     be a NULL pointer, so if not we assume that we're being called
     as a statically-linked program by Linux...  */
  if (*stack_on_entry != NULL)
      char *__unbounded * __unbounded temp;
      /* which case, we have argc as the top thing on the
         stack, followed by argv (NULL-terminated), envp (likewise),
         and the auxilary vector.  */
      /* 32/64-bit agnostic load from stack */
      argc = *(long int *__unbounded) stack_on_entry;
      ubp_av = stack_on_entry + 1;
      ubp_ev = ubp_av + argc + 1;
      temp = ubp_ev;
      while (*temp != NULL)
      auxvec = (ElfW (auxv_t) *)++ temp;
      rtld_fini = NULL;

  /* Initialize the __cache_line_size variable from the aux vector.  */
  for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av)
    switch (av->a_type)
      case AT_DCACHEBSIZE:
       __cache_line_size = av->a_un.a_val;

  return generic_start_main (stinfo->main, argc, ubp_av, auxvec,
                          stinfo->init, stinfo->fini, rtld_fini,

Variable Documentation

int __cache_line_size attribute_hidden

Definition at line 28 of file libc-start.c.