aboutsummaryrefslogtreecommitdiff
path: root/elf/testobj3.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/testobj3.c')
-rw-r--r--elf/testobj3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/elf/testobj3.c b/elf/testobj3.c
index 8e3d8865f7..f89b904cd4 100644
--- a/elf/testobj3.c
+++ b/elf/testobj3.c
@@ -1,3 +1,5 @@
+#include <dlfcn.h>
+
int
obj3func1 (int a __attribute__ ((unused)))
{
@@ -9,3 +11,12 @@ obj3func2 (int a)
{
return foo (a) + 42;
}
+
+int
+preload (int a)
+{
+ int (*fp) (int) = dlsym (RTLD_NEXT, "preload");
+ if (fp != NULL)
+ return fp (a) + 10;
+ return 10;
+}