Fix powerpc abilist sort order
[glibc.git] / elf / ltglobmod2.c
blob33f14cc980ae86c79fba086c10cbd5dd000013e2
1 #include <dlfcn.h>
2 #include <stdio.h>
3 #include <stdlib.h>
5 extern int bar (void);
6 extern int foo (void);
8 int
9 foo (void)
11 void *h;
12 int res;
14 /* Load ltglobalmod1 in the global namespace. */
15 h = dlopen ("ltglobmod1.so", RTLD_GLOBAL | RTLD_LAZY);
16 if (h == NULL)
18 printf ("%s: cannot open %s: %s",
19 __FUNCTION__, "ltglobmod1.so", dlerror ());
20 exit (EXIT_FAILURE);
23 /* Call bar. This is undefined in the DSO. */
24 puts ("about to call `bar'");
25 fflush (stdout);
26 res = bar ();
28 printf ("bar returned %d\n", res);
30 dlclose (h);
32 return res != 42;