* Link the test programs with --export-dynamic. This shows that my previous

assumption, that the program image is ignored when relocating symbols of
  dlopen()ed objects, is incorrect.
* Adjusted the tests that were failing due to that.
* The RTLD_NEXT test also fails with openSuse 10.3 -- apparently the semantics
  has changed between the Linux versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29111 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-02-01 18:16:46 +00:00
parent 7ac433fc8c
commit 06828840d7
21 changed files with 27 additions and 37 deletions

View File

@ -93,7 +93,6 @@ main()
void* liba;
void* libe;
void* self;
// int (*a)();
libe = dlopen("./libe.so", RTLD_NOW | RTLD_GLOBAL);
if (libe == NULL) {
@ -107,20 +106,12 @@ main()
exit(117);
}
/*
a = (int (*)())dlsym(libe, "a");
if (a == NULL) {
fprintf(stderr, "Error getting symbol a: %s\n", dlerror());
exit(116);
}
*/
return a();
}
EOI
# build
gcc -o program program.c -D_GNU_SOURCE $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c -D_GNU_SOURCE $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 31

View File

@ -83,7 +83,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -83,7 +83,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -79,7 +79,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -83,7 +83,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -5,8 +5,7 @@
# dlopen():
# liba.so
#
# Expected: Undefined symbol in liba.so might resolve to symbol in program, but
# the program image is ignored, so dlopen() on liba.so fails.
# Expected: Undefined symbol in liba.so resolve to symbol in program.
. test_setup
@ -54,7 +53,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 117
test_run_ok ./program 1

View File

@ -60,7 +60,7 @@ main()
EOI
# build
gcc -o program program.c ./libb.so $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c ./libb.so $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -70,7 +70,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -6,8 +6,8 @@
# libb.so
# liba.so
#
# Expected: Undefined symbol in liba.so resolves to symbol in libb.so, not
# to symbol in program, since program image is ignored.
# Expected: Undefined symbol in liba.so resolves to symbol in program, not
# to symbol in libb.so.
. test_setup
@ -70,8 +70,8 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2
test_run_ok ./program 1

View File

@ -80,7 +80,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -77,7 +77,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -87,7 +87,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -97,7 +97,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 2

View File

@ -105,7 +105,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -77,7 +77,7 @@ main()
EOI
# build
gcc -o program program.c $libdl -Xlinker -rpath -Xlinker .
gcc -o program program.c $libdl -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -73,8 +73,8 @@ main()
EOI
# build
gcc -o program program.c -D_GNU_SOURCE ./liba.so $libdl -Xlinker -rpath \
-Xlinker .
gcc -o program program.c -D_GNU_SOURCE ./liba.so $libdl \
-Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 15

View File

@ -37,7 +37,7 @@ main()
EOI
# build
gcc -o program program.c ./liba.so
gcc -o program program.c ./liba.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -50,7 +50,7 @@ main()
EOI
# build
gcc -o program program.c ./liba.so ./libb.so -Xlinker -rpath -Xlinker .
gcc -o program program.c ./liba.so ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -50,7 +50,7 @@ main()
EOI
# build
gcc -o program program.c ./libb.so ./liba.so -Xlinker -rpath -Xlinker .
gcc -o program program.c ./libb.so ./liba.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -51,7 +51,7 @@ main()
EOI
# build
gcc -o program program.c ./liba.so ./libb.so -Xlinker -rpath -Xlinker .
gcc -o program program.c ./liba.so ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1

View File

@ -45,7 +45,7 @@ main()
EOI
# build
gcc -o program program.c ./libb.so -Xlinker -rpath -Xlinker .
gcc -o program program.c ./libb.so -Wl,-rpath,.,--export-dynamic
# run
test_run_ok ./program 1