summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libdl/test/test.c
blob: d467134ba27a2ea59033773927ef7f5566d1bea6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <dlfcn.h>

int main(int argc, char **argv)
{
  void *Hlib;

//  if (Hlib=dlopen("libtest.so", RTLD_LAZY)) {
  if (Hlib=dlopen("libtest.so", RTLD_NOW)) {
    void (*t)(void) = dlsym(Hlib,"test");
    if (t) {
      printf("test @ %08lx\n",(long)t);
      t();
    }
    dlclose(Hlib);
  }
  else {
    printf("%s\n",dlerror());
  }
  return 0;
}