1 /* This is part of the shared library ld test. This file becomes part
2 of a shared library. */
4 /* This variable is supplied by the main program. */
7 /* This variable is defined in the shared library, and overridden by
9 int overriddenvar
= -1;
11 /* This variable is defined in the shared library. */
14 /* This variable is defined by another object in the shared library. */
17 /* These functions return the values of the above variables as seen in
18 the shared library. */
27 shlib_overriddenvar ()
44 /* This function calls a function defined by another object in the
47 extern int shlib_shlibcalled ();
52 return shlib_shlibcalled ();
55 /* This function calls a function defined by the main program. */
57 extern int main_called ();
62 return main_called ();
65 /* This function is passed a function pointer to shlib_mainvar. It
66 confirms that the pointer compares equally. */
69 shlib_checkfunptr1 (p
)
72 return p
== shlib_mainvar
;
75 /* This function is passed a function pointer to main_called. It
76 confirms that the pointer compares equally. */
79 shlib_checkfunptr2 (p
)
82 return p
== main_called
;
85 /* This function returns a pointer to shlib_mainvar. */
88 (*shlib_getfunptr1 ()) ()
93 /* This function returns a pointer to main_called. */
96 (*shlib_getfunptr2 ()) ()
101 /* This function makes sure that constant data and local functions
109 static const char *str
= "Hello, world\n";
119 /* To isolate the test, don't rely on any external functions, such
121 s1
= "Hello, world\n";
129 if (shlib_shlibvar1 () != 3)
This page took 0.046046 seconds and 5 git commands to generate.