7 # <- libb_dependency.so
10 # Expected: Global lookup: Symbol in libb_dependency.so does not supersede
11 # symbol in liba.so, since libb.so is loaded RTLD_LOCAL.
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 libb = dlopen("./libb.so", RTLD_NOW | RTLD_LOCAL);
59 fprintf(stderr, "Error opening libb.so: %s\n", dlerror());
63 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
65 fprintf(stderr, "Error opening liba.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