8 # <- libb_dependency.so
10 # Expected: Undefined symbol in liba.so resolves to symbol in
17 # create libb_dependency.so
18 cat > libb_dependency.c
<< EOI
23 compile_lib
-o libb_dependency.so libb_dependency.c
32 compile_lib
-o libb.so libb.c .
/libb_dependency.so
38 int a() { return c(); }
42 compile_lib
-o liba.so liba.c .
/libb.so
46 cat > program.c
<< EOI
56 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
58 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
62 a = (int (*)())dlsym(liba, "a");
64 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
73 compile_program_dl
-o program program.c
76 test_run_ok .
/program
1