8 # <- libb_dependency.so
11 # Expected: liba.so lookup: Symbol in libd.so supersedes symbol in
18 # create libb_dependency.so
19 cat > libb_dependency.c
<< EOI
24 compile_lib
-o libb_dependency.so libb_dependency.c
33 compile_lib
-o libb.so libb.c .
/libb_dependency.so
42 compile_lib
-o libd.so libd.c
51 compile_lib
-o liba.so liba.c .
/libb.so .
/libd.so
55 cat > program.c
<< EOI
65 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
67 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
71 a = (int (*)())dlsym(liba, "a");
73 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
82 compile_program_dl
-o program program.c
85 test_run_ok .
/program
2