Back to index

cell-binutils  2.17cvs20070401
Functions | Variables
main.c File Reference
#include <stdio.h>

Go to the source code of this file.

Functions

int shlib_mainvar ()
int shlib_overriddenvar ()
int shlib_shlibvar1 ()
int shlib_shlibvar2 ()
int shlib_shlibcall ()
int shlib_maincall ()
int shlib_checkfunptr1 ()
int shlib_checkfunptr2 ()
int shlib_check ()
int shlib_shlibcall2 ()
int visibility_check ()
int visibility_checkfunptr ()
void * visibility_funptr ()
int visibility_checkvar ()
int visibility_checkvarptr ()
int visibility_varval ()
void * visibility_varptr ()
int shlib_visibility_checkcom ()
int shlib_visibility_checkweak ()
int shlib_visibility_func_weak ()
int visibility ()
static int main_visibility_check (void)
static int main_visibility_checkvar (void)
int main_called (void)
int shlib_overriddencall2 (void)
int main_visibility_checkcom (void)
int main_visibility_checkweak (void)
int main (void)

Variables

int mainvar = 1
int overriddenvar = 2
int shlibvar1
int(*)() shlib_getfunptr1 ()
int(*)() shlib_getfunptr2 ()
int shlib_visibility_com = 1
int shlib_visibility_var_weak = 1
int visibility_var

Function Documentation

int main ( void  )

Definition at line 231 of file main.c.

{
  int (*p) ();
  int ret = 0;

  printf ("mainvar == %d\n", mainvar);
  printf ("overriddenvar == %d\n", overriddenvar);
  printf ("shlibvar1 == %d\n", shlibvar1);
#ifndef XCOFF_TEST
  printf ("shlib_mainvar () == %d\n", shlib_mainvar ());
  printf ("shlib_overriddenvar () == %d\n", shlib_overriddenvar ());
#endif
  printf ("shlib_shlibvar1 () == %d\n", shlib_shlibvar1 ());
  printf ("shlib_shlibvar2 () == %d\n", shlib_shlibvar2 ());
  printf ("shlib_shlibcall () == %d\n", shlib_shlibcall ());
#ifndef XCOFF_TEST
  printf ("shlib_shlibcall2 () == %d\n", shlib_shlibcall2 ());
  printf ("shlib_maincall () == %d\n", shlib_maincall ());
#endif
  printf ("main_called () == %d\n", main_called ());
  printf ("shlib_checkfunptr1 (shlib_shlibvar1) == %d\n",
         shlib_checkfunptr1 (shlib_shlibvar1));
#ifndef XCOFF_TEST
  printf ("shlib_checkfunptr2 (main_called) == %d\n",
         shlib_checkfunptr2 (main_called));
#endif
  p = shlib_getfunptr1 ();
  printf ("shlib_getfunptr1 () ");
  if (p == shlib_shlibvar1)
    printf ("==");
  else
    printf ("!=");
  printf (" shlib_shlibvar1\n");
#ifndef XCOFF_TEST
  p = shlib_getfunptr2 ();
  printf ("shlib_getfunptr2 () ");
  if (p == main_called)
    printf ("==");
  else
    printf ("!=");
  printf (" main_called\n");
#endif
  printf ("shlib_check () == %d\n", shlib_check ());
  printf ("visibility_check () == %d\n", visibility_check ());
  printf ("visibility_checkfunptr () == %d\n",
         visibility_checkfunptr ());
  printf ("main_visibility_check () == %d\n", main_visibility_check ());
  printf ("visibility_checkvar () == %d\n", visibility_checkvar ());
  printf ("visibility_checkvarptr () == %d\n",
         visibility_checkvarptr ());
  printf ("main_visibility_checkvar () == %d\n",
         main_visibility_checkvar ());
  printf ("main_visibility_checkcom () == %d\n",
         main_visibility_checkcom ());
  printf ("shlib_visibility_checkcom () == %d\n",
         shlib_visibility_checkcom ());
  printf ("main_visibility_checkweak () == %d\n",
         main_visibility_checkweak ());
  printf ("shlib_visibility_checkweak () == %d\n",
         shlib_visibility_checkweak ());

#if !defined (PROTECTED_UNDEF_TEST) && defined (PROTECTED_TEST)
  if (&shared_data != shared_data_p ())
    ret = 1;
  p = shared_func_p ();
  if (shared_func != p)
    ret = 1;
  if (shared_data != *shared_data_p ())
    ret = 1;
  if (shared_func () != (*p) () )
    ret = 1;
#endif

  return ret;
}

Here is the call graph for this function:

int main_called ( void  )

Definition at line 140 of file main.c.

{
  return 6;
}

Here is the caller graph for this function:

static int main_visibility_check ( void  ) [static]

Definition at line 115 of file main.c.

{
#ifdef WEAK_TEST
  return visibility_funptr () == NULL;
#else
  return ((int (*) (void)) visibility_funptr ()) == visibility;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 218 of file main.c.

{
  return 1;
}

Here is the caller graph for this function:

static int main_visibility_checkvar ( void  ) [static]

Definition at line 125 of file main.c.

{
#ifdef WEAK_TEST
  return visibility_varval () == 0
        && visibility_varptr () == NULL;
#else
  return visibility_varval () == visibility_var
        && visibility_varptr () == &visibility_var;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 224 of file main.c.

{
  return 1;
}

Here is the caller graph for this function:

Definition at line 159 of file sh1.c.

{
  const char *s1, *s2;

  if (i != 6)
    return 0;

  /* To isolate the test, don't rely on any external functions, such
     as strcmp.  */
  s1 = "Hello, world\n";
  s2 = str;
  while (*s1 != '\0')
    if (*s1++ != *s2++)
      return 0;
  if (*s2 != '\0')
    return 0;

  if (shlib_shlibvar1 () != 3)
    return 0;

  return 1;
}

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 102 of file sh1.c.

{
  return main_called ();
}

Here is the caller graph for this function:

Definition at line 38 of file sh1.c.

{
  return mainvar;
}

Here is the caller graph for this function:

Definition at line 148 of file main.c.

{
  return 8;
}

Here is the caller graph for this function:

Definition at line 46 of file sh1.c.

{
  return overriddenvar;
}

Here is the caller graph for this function:

Definition at line 70 of file sh1.c.

{
  return shlib_shlibcalled ();
}

Here is the caller graph for this function:

Definition at line 82 of file sh1.c.

{
  return shlib_overriddencall2 ();
}

Here is the caller graph for this function:

Definition at line 53 of file sh1.c.

{
  return shlibvar1;
}

Here is the caller graph for this function:

Definition at line 59 of file sh1.c.

{
  return shlibvar2;
}

Here is the caller graph for this function:

Definition at line 385 of file sh1.c.

{
  return 1;
}

Here is the caller graph for this function:

Definition at line 391 of file sh1.c.

{
  return 1;
}

Here is the caller graph for this function:

Definition at line 53 of file main.c.

{
  return 1;
}

Definition at line 199 of file sh1.c.

{
  return 2;
}

Here is the caller graph for this function:

Definition at line 231 of file sh1.c.

{
#ifdef WEAK_TEST
  if (&visibility)
    return visibility () == 1;
  else
    return 1;
#else
#ifdef HIDDEN_NORMAL_TEST
  return visibility_normal () == 2;
#else
  return visibility () == 2;
#endif
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 216 of file sh1.c.

{
#ifdef WEAK_TEST
  return 1;
#else
#ifdef HIDDEN_NORMAL_TEST
  int (*v) () = visibility_normal;
#else
  int (*v) () = visibility;
#endif
  return (*v) () == 2;
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 292 of file sh1.c.

{
#ifdef WEAK_TEST
  return 1;
#else
#ifdef HIDDEN_NORMAL_TEST
  return visibility_var_normal == 2;
#else
  return visibility_var == 2;
#endif
#endif
}

Here is the caller graph for this function:

Definition at line 274 of file sh1.c.

{
#ifdef WEAK_TEST
  if (&visibility_var)
    return visibility_var == 1;
  else
    return 1;
#else
#ifdef HIDDEN_NORMAL_TEST
  int *v = &visibility_var_normal;
#else
  int *v = &visibility_var;
#endif
  return *v == 2;
#endif
}

Here is the caller graph for this function:

void* visibility_funptr ( )

Definition at line 248 of file sh1.c.

{
#ifdef WEAK_TEST
  if (&visibility == NULL)
    return NULL;
  else
#endif
    return visibility;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void* visibility_varptr ( )

Definition at line 306 of file sh1.c.

{
#ifdef WEAK_TEST
  if (&visibility_var == NULL)
    return NULL;
  else
#endif
    return &visibility_var;
}

Here is the caller graph for this function:

Definition at line 317 of file sh1.c.

{
#ifdef WEAK_TEST
  if (&visibility_var == NULL)
    return 0;
  else
#endif
    return visibility_var;
}

Here is the caller graph for this function:


Variable Documentation

int mainvar = 1

Definition at line 22 of file main.c.

Definition at line 23 of file main.c.

Definition at line 133 of file sh1.c.

{
  return shlib_shlibvar1;
}

Definition at line 142 of file sh1.c.

{
  return main_called;
}

Definition at line 48 of file main.c.

Definition at line 50 of file main.c.

Definition at line 28 of file sh1.c.

Definition at line 264 of file sh1.c.