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