Update.
[platform/upstream/glibc.git] / elf / nextmod1.c
1 #include <dlfcn.h>
2
3 int nextmod1_dummy_var;
4
5 int
6 successful_rtld_next_test (void)
7 {
8   int (*fp) (void);
9
10   /* Get the next function... */
11   fp = (int (*) (void)) dlsym (RTLD_NEXT, __FUNCTION__);
12
13   /* ...and simply call it.  */
14   return fp ();
15 }
16
17
18 void *
19 failing_rtld_next_use (void)
20 {
21   void *ret = dlsym (RTLD_NEXT, __FUNCTION__);
22
23   /* Ensure we are not tail call optimized, because then RTLD_NEXT
24      might return this function.  */
25   ++nextmod1_dummy_var;
26   return ret;
27 }