blob: ee91d5a235e1a12e26ba2ecb6183121f2155f1c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#include <dlfcn.h>
typedef int (*ft)(int);
int main()
{
void* handle = dlopen("./libhelper.so", RTLD_LAZY);
void* sym = dlsym(handle, "helper");
ft f = (ft)sym;
f(10);
f(15);
return 0;
}
|