2000-09-15 19:35:04 +02:00
|
|
|
#include <dlfcn.h>
|
|
|
|
|
2000-12-17 18:50:56 +01:00
|
|
|
extern int successful_rtld_next_test (void);
|
|
|
|
extern void *failing_rtld_next_use (void);
|
|
|
|
|
2000-10-03 09:37:02 +02:00
|
|
|
int nextmod1_dummy_var;
|
|
|
|
|
2000-09-15 19:35:04 +02: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 09:37:02 +02: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 19:35:04 +02:00
|
|
|
}
|