10 # Expected: Undefined symbol in liba.so resolves to symbol in libb.so,
11 # not to symbol in libd.so, since it's loaded RTLD_LOCAL.
23 compile_lib
-o libb.so libb.c
29 int a() { return b(); }
33 compile_lib
-o liba.so liba.c .
/libb.so
42 compile_lib
-o libd.so libd.c
46 cat > program.c
<< EOI
57 libd = dlopen("./libd.so", RTLD_NOW | RTLD_LOCAL);
59 fprintf(stderr, "Error opening libd.so: %s\n", dlerror());
63 liba = dlopen("./liba.so", RTLD_NOW | RTLD_GLOBAL);
65 fprintf(stderr, "Error opening liba.so: %s\n", dlerror());
69 a = (int (*)())dlsym(liba, "a");
71 fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
80 compile_program_dl
-o program program.c
83 test_run_ok .
/program
1