mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-26 18:03:33 +08:00
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.
This commit is contained in:
parent
451fa05e5d
commit
be19bd519b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user