1#include <dlfcn.h>
2#include <stdlib.h>
3#include <stdio.h>
4
5#include "testobj.h"
6
7int
8obj2func1 (int a __attribute__ ((unused)))
9{
10 return 43;
11}
12
13int
14obj2func2 (int a)
15{
16 return obj1func1 (a) + 10;
17}
18
19int
20preload (int a)
21{
22 int (*fp) (int) = dlsym (RTLD_NEXT, name: "preload");
23 if (fp != NULL)
24 return fp (a) + 10;
25 return 10;
26}
27
28void
29p (void)
30{
31 puts (s: "hello world");
32}
33

source code of glibc/elf/testobj2.c