9a9b91c940
It's finally done.. Signed-off-by: kaguya <vpshinomiya@protonmail.com>
24 lines
381 B
C
24 lines
381 B
C
#include <assert.h>
|
|
#include <dlfcn.h>
|
|
|
|
int foo(void);
|
|
|
|
#ifdef USE_HOST_LIBC
|
|
#define LIB "libnative-ifunc-test-dlopen.so"
|
|
#else
|
|
#define LIB "libifunc-test-dlopen.so"
|
|
#endif
|
|
|
|
int main(void) {
|
|
void *handle = dlopen(LIB, RTLD_NOW | RTLD_LOCAL);
|
|
assert(handle);
|
|
|
|
int (*func)() = (int (*)()) dlsym(handle, "foo");
|
|
assert(func);
|
|
|
|
int ret = func();
|
|
assert(ret == 69);
|
|
|
|
return 0;
|
|
}
|