about summary refs log tree commit diff
path: root/elf/testobj2.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/testobj2.c')
-rw-r--r--elf/testobj2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/elf/testobj2.c b/elf/testobj2.c
index 5c89d33c8c..ba91fe873d 100644
--- a/elf/testobj2.c
+++ b/elf/testobj2.c
@@ -1,3 +1,5 @@
+#include <dlfcn.h>
+
 int
 obj2func1 (int a __attribute__ ((unused)))
 {
@@ -9,3 +11,12 @@ obj2func2 (int a)
 {
   return obj1func1 (a) + 10;
 }
+
+int
+preload (int a)
+{
+  int (*fp) (int) = dlsym (RTLD_NEXT, "preload");
+  if (fp != NULL)
+    return fp (a) + 10;
+  return 10;
+}