diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-07-13 16:52:37 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-07-13 16:52:37 +0000 |
commit | be19bd519b5495c6df241920d074e59801fba6ea (patch) | |
tree | 276c10611db5e5bd98ebd53e6292c306b1c11349 | |
parent | 451fa05e5dea8d37ec1f0cb40f304e918c30ee62 (diff) | |
download | gdb-be19bd519b5495c6df241920d074e59801fba6ea.zip gdb-be19bd519b5495c6df241920d074e59801fba6ea.tar.gz gdb-be19bd519b5495c6df241920d074e59801fba6ea.tar.bz2 |
2009-07-13 H.J. Lu <hongjiu.lu@intel.com>
* ld-ifunc/ifunc.exp: Don't use -shared/-static to build object
files. Use ld_simple_link to build static non-ifunc-using
executable. Re-enable static non-ifunc-using executable check.
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-ifunc/ifunc.exp | 35 |
2 files changed, 25 insertions, 16 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 8071ed6..da9854b 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2009-07-13 H.J. Lu <hongjiu.lu@intel.com> + + * ld-ifunc/ifunc.exp: Don't use -shared/-static to build object + files. Use ld_simple_link to build static non-ifunc-using + executable. Re-enable static non-ifunc-using executable check. + 2009-07-10 H.J. Lu <hongjiu.lu@intel.com> * ld-ifunc/ifunc.exp: Don't chck static non-ifunc-using diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp index d7219f8..6824d04 100644 --- a/ld/testsuite/ld-ifunc/ifunc.exp +++ b/ld/testsuite/ld-ifunc/ifunc.exp @@ -157,24 +157,28 @@ proc contains_ifunc_reloc { binary_file } { set fails 0 # Create the object files, libraries and executables. -if ![ld_compile "$CC -c -shared -fPIC" "$srcdir/$subdir/prog.c" "tmpdir/shared_prog.o"] { - fail "Could not create a shared object file" +if ![ld_compile "$CC -c -fPIC" "$srcdir/$subdir/prog.c" "tmpdir/shared_prog.o"] { + fail "Could not create a PIC object file" set fails [expr $fails + 1] } -if ![ld_compile "$CC -c -static" "$srcdir/$subdir/prog.c" "tmpdir/static_prog.o"] { - fail "Could not create a static object file" +if ![ld_compile "$CC -c" "$srcdir/$subdir/prog.c" "tmpdir/static_prog.o"] { + fail "Could not create a non-PIC object file" set fails [expr $fails + 1] } -if ![ld_compile "$CC -c -shared -fPIC -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/shared_ifunc.o"] { - fail "Could not create an object file containing an IFUNC symbol" +if ![ld_compile "$CC -c -fPIC -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/shared_ifunc.o"] { + fail "Could not create a PIC object file containing an IFUNC symbol" set fails [expr $fails + 1] } -if ![ld_compile "$CC -c -static -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_ifunc.o"] { - fail "Could not create a static object file containing an IFUNC symbol" +if ![ld_compile "$CC -c -DWITH_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_ifunc.o"] { + fail "Could not create a non-PIC object file containing an IFUNC symbol" set fails [expr $fails + 1] } -if ![ld_compile "$CC -c -static -DWITHOUT_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_noifunc.o"] { - fail "Could not create an ordinary static object file" +if ![ld_compile "$CC -c -DWITHOUT_IFUNC" "$srcdir/$subdir/lib.c" "tmpdir/static_noifunc.o"] { + fail "Could not create an ordinary non-PIC object file" + set fails [expr $fails + 1] +} +if ![ld_assemble $as "$srcdir/ld-elf/empty.s" "tmpdir/empty.o"] { + fail "Could not create an empty object file" set fails [expr $fails + 1] } @@ -207,7 +211,7 @@ if ![default_ld_link $ld "tmpdir/static_prog" "-static -Ltmpdir tmpdir/static_pr fail "Could not link a static executable" set fails [expr $fails + 1] } -if ![default_ld_link $ld "tmpdir/static_nonifunc_prog" "-static -Ltmpdir tmpdir/static_prog.o tmpdir/static_noifunc.o"] { +if ![ld_simple_link $ld "tmpdir/static_nonifunc_prog" "-static tmpdir/empty.o"] { fail "Could not link a non-ifunc using static executable" set fails [expr $fails + 1] } @@ -241,11 +245,10 @@ if {! [check_osabi tmpdir/dynamic_prog {UNIX - Linux}]} { fail "Dynamic ifunc-using executable does not have an OS/ABI field of LINUX" set fails [expr $fails + 1] } -# FIXME: This test will fail if libc.a has ifunc functons. -#if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} { -# fail "Static non-ifunc-using executable does not have an OS/ABI field of System V" -# set fails [expr $fails + 1] -#} +if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} { + fail "Static non-ifunc-using executable does not have an OS/ABI field of System V" + set fails [expr $fails + 1] +} # The linked ifunc using executables and the shared library containing # ifunc should contain an IFUNC symbol. The non-ifunc using executable |