about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/nextmod1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/elf/nextmod1.c b/elf/nextmod1.c
index 3549c75174..19f972b9e0 100644
--- a/elf/nextmod1.c
+++ b/elf/nextmod1.c
@@ -1,5 +1,7 @@
 #include <dlfcn.h>
 
+int nextmod1_dummy_var;
+
 int
 successful_rtld_next_test (void)
 {
@@ -16,5 +18,10 @@ successful_rtld_next_test (void)
 void *
 failing_rtld_next_use (void)
 {
-  return dlsym (RTLD_NEXT, __FUNCTION__);
+  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;
 }