2000-09-15 17:35:04 +00:00
|
|
|
#include <dlfcn.h>
|
|
|
|
|
2000-10-03 07:37:02 +00:00
|
|
|
int nextmod1_dummy_var;
|
|
|
|
|
2000-09-15 17:35:04 +00:00
|
|
|
int
|
|
|
|
successful_rtld_next_test (void)
|
|
|
|
{
|
|
|
|
int (*fp) (void);
|
|
|
|
|
|
|
|
/* Get the next function... */
|
|
|
|
fp = (int (*) (void)) dlsym (RTLD_NEXT, __FUNCTION__);
|
|
|
|
|
|
|
|
/* ...and simply call it. */
|
|
|
|
return fp ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void *
|
|
|
|
failing_rtld_next_use (void)
|
|
|
|
{
|
2000-10-03 07:37:02 +00:00
|
|
|
void *ret = dlsym (RTLD_NEXT, __FUNCTION__);
|
|
|
|
|
|
|
|
/* Ensure we are not tail call optimized, because then RTLD_NEXT
|
|
|
|
might return this function. */
|
|
|
|
++nextmod1_dummy_var;
|
|
|
|
return ret;
|
2000-09-15 17:35:04 +00:00
|
|
|
}
|