Test FatELF .o files.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 02 Oct 2009 16:24:36 -0400
changeset 63 6c52cfd450e4
parent 62 881832ce78a7
child 64 35b4bce8223d
Test FatELF .o files.
test/test.sh
--- a/test/test.sh	Fri Oct 02 15:50:53 2009 -0400
+++ b/test/test.sh	Fri Oct 02 16:24:36 2009 -0400
@@ -20,22 +20,26 @@
 # Build some test programs (hello world, hello world with shared library,
 #  hello world that uses dlopen() on shared library).
 gcc -O0 -ggdb3 -o hello.so ../hello-lib.c -shared -fPIC -m32
-gcc -O0 -ggdb3 -o hello-x86 ../hello.c hello.so -m32 -Wl,-rpath,.
+gcc -O0 -ggdb3 -c -o hello-x86.o ../hello.c hello.so -m32 -Wl,-rpath,.
+gcc -O0 -ggdb3 -o hello-x86 hello-x86.o hello.so -m32 -Wl,-rpath,.
 gcc -O0 -ggdb3 -o hello-dlopen-x86 ../hello-dlopen.c -ldl -m32
 mv hello.so hello-x86.so
 
 gcc -O0 -ggdb3 -o hello.so ../hello-lib.c -shared -fPIC -m64
-gcc -O0 -ggdb3 -o hello-amd64 ../hello.c hello.so -m64 -Wl,-rpath,.
+gcc -O0 -ggdb3 -c -o hello-amd64.o ../hello.c hello.so -m64 -Wl,-rpath,.
+gcc -O0 -ggdb3 -o hello-amd64 hello-amd64.o hello.so -m64 -Wl,-rpath,.
 gcc -O0 -ggdb3 -o hello-dlopen-amd64 ../hello-dlopen.c -ldl -m64
 mv hello.so hello-amd64.so
 
 # Glue them into FatELF binaries.
 ./fatelf-glue hello hello-x86 hello-amd64
+./fatelf-glue hello.o hello-x86.o hello-amd64.o
 ./fatelf-glue hello.so hello-amd64.so hello-x86.so
 ./fatelf-glue hello-dlopen hello-dlopen-x86 hello-dlopen-amd64
 
 # fatelf-info tests.
 ./fatelf-info ./hello
+./fatelf-info ./hello.o
 ./fatelf-info ./hello.so
 ./fatelf-info ./hello-dlopen
 
@@ -47,6 +51,7 @@
 
 # file(1) tests.
 file ./hello
+file ./hello.o
 file ./hello.so
 file ./hello-dlopen
 
@@ -57,18 +62,25 @@
 
 # binutils tests.
 size ./hello
+size ./hello.o
 size ./hello.so
 size ./hello-dlopen
 nm ./hello
+nm ./hello.o
 nm ./hello.so
 nm ./hello-dlopen
 objdump -x ./hello
+objdump -x ./hello.o
 objdump -x ./hello.so
 objdump -x ./hello-dlopen
 
 # Test gdb.
 gdb -x ../test.gdb ./hello
 
+# Link directly against a FatELF object file (binutils test).
+gcc -m64 -O0 -ggdb3 -o hello-fatlink-obj-amd64 hello.o hello.so -Wl,-rpath,.
+gcc -m32 -O0 -ggdb3 -o hello-fatlink-obj-x86 hello.o hello.so -Wl,-rpath,.
+
 # Link directly against a FatELF shared library (binutils test).
 gcc -m64 -O0 -ggdb3 -o hello-fatlink-amd64 ../hello.c hello.so -Wl,-rpath,.
 gcc -m32 -O0 -ggdb3 -o hello-fatlink-x86 ../hello.c hello.so -Wl,-rpath,.
@@ -77,7 +89,9 @@
 ./hello
 ./hello-dlopen
 [ "x$AMD64" = "1" ] && ./hello-fatlink-amd64
+[ "x$AMD64" = "1" ] && ./hello-fatlink-obj-amd64
 ./hello-fatlink-x86
+./hello-fatlink-obj-x86
 
 # end of test.sh ...