8 # <- libb_dependency.so
12 # Expected: Undefined symbol in libe.so resolves to symbol in
13 # libd.so, not to symbol in libb_dependency.so.
19 # create libb_dependency.so
20 cat > libb_dependency.c
<< EOI
25 compile_lib
-o libb_dependency.so libb_dependency.c
34 compile_lib
-o libb.so libb.c .
/libb_dependency.so
43 compile_lib
-o libd.so libd.c
52 compile_lib
-o liba.so liba.c .
/libb.so .
/libd.so
58 int a() { return c(); }
62 compile_lib
-o libe.so libe.c
66 cat > program.c
<< EOI
77 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
79 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
83 libe = dlopen("./libe.so", RTLD_NOW | RTLD_GLOBAL);
85 fprintf(stderr, "Error opening libe.so: %s\n", dlerror());
89 a = (int (*)())dlsym(libe, "a");
91 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
100 compile_program_dl
-o program program.c
103 test_run_ok .
/program
2