8 # <- libb_dependency.so
11 # Expected: Undefined symbol in liba.so resolves to symbol in
12 # libd.so, not to symbol in libb_dependency.so.
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
48 int a() { return c(); }
52 compile_lib
-o liba.so liba.c .
/libb.so .
/libd.so
56 cat > program.c
<< EOI
66 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
68 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
72 a = (int (*)())dlsym(liba, "a");
74 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
83 compile_lib_dl
-o program program.c
86 test_run_ok .
/program
2