8 # <- libb_dependency.so
10 # Expected: Global lookup: symbol in liba.so supersedes symbol in
23 compile_lib
-o liba.so liba.c
26 # create libb_dependency.so
27 cat > libb_dependency.c
<< EOI
32 compile_lib
-o libb_dependency.so libb_dependency.c
41 compile_lib
-o libb.so libb.c .
/libb_dependency.so
45 cat > program.c
<< EOI
57 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
59 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
63 libb = dlopen("./libb.so", RTLD_NOW | RTLD_GLOBAL);
65 fprintf(stderr, "Error opening libb.so: %s\n", dlerror());
69 self = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
71 fprintf(stderr, "Error opening self: %s\n", dlerror());
75 a = (int (*)())dlsym(self, "a");
77 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
86 compile_program_dl
-o program program.c
89 test_run_ok .
/program
1