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 main_called ()
int shlib_overriddencall2 ()
int main ()

Variables

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

Function Documentation

int main ( void  )

Definition at line 39 of file main.c.

{
  int (*p) ();

  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 ());
#ifndef SYMBOLIC_TEST
  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
#endif
  printf ("shlib_check () == %d\n", shlib_check ());
  return 0;
}

Here is the call graph for this function:

int main_called ( void  )

Definition at line 25 of file main.c.

{
  return 6;
}

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 call graph for this function:

Definition at line 102 of file sh1.c.

{
  return main_called ();
}

Here is the call graph for this function:

Definition at line 38 of file sh1.c.

{
  return mainvar;
}

Definition at line 33 of file main.c.

{
  return 8;
}

Definition at line 46 of file sh1.c.

{
  return overriddenvar;
}

Definition at line 70 of file sh1.c.

{
  return shlib_shlibcalled ();
}

Here is the call graph for this function:

Definition at line 82 of file sh1.c.

{
  return shlib_overriddencall2 ();
}

Here is the call graph for this function:

Definition at line 53 of file sh1.c.

{
  return shlibvar1;
}

Definition at line 59 of file sh1.c.

{
  return shlibvar2;
}

Variable Documentation

int mainvar = 1

Definition at line 5 of file main.c.

Definition at line 6 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 28 of file sh1.c.