8 # <- libb_dependency.so
12 # Expected: Undefined symbol in libe.so resolves to symbol in
13 # libb_dependency.so, not to symbol in libd.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
53 compile_lib
-o liba.so liba.c .
/libb.so
59 int a() { return c(); }
63 compile_lib
-o libe.so libe.c
67 cat > program.c
<< EOI
79 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
81 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
85 libd = dlopen("./libd.so", RTLD_NOW | RTLD_GLOBAL);
87 fprintf(stderr, "Error opening libd.so: %s\n", dlerror());
91 libe = dlopen("./libe.so", RTLD_NOW | RTLD_GLOBAL);
93 fprintf(stderr, "Error opening libe.so: %s\n", dlerror());
97 a = (int (*)())dlsym(libe, "a");
99 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
108 compile_program_dl
-o program program.c
111 test_run_ok .
/program
1