aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386/i386.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-i386/i386.exp')
-rw-r--r--ld/testsuite/ld-i386/i386.exp36
1 files changed, 33 insertions, 3 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index ff9db98..d1031c5 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -1,5 +1,5 @@
# Expect script for ld-i386 tests
-# Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010
+# Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2012
# Free Software Foundation
#
# This file is part of the GNU Binutils.
@@ -98,11 +98,13 @@ if [istarget "*-*-go32*"] {
}
}
-if { !([istarget "i?86-*-elf*"]
+if { !([istarget "i?86-*-elf*"]
|| (([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"])
&& ![istarget "*-*-*aout*"]
&& ![istarget "*-*-*oldld*"])
+ || [istarget "i?86-*-nacl*"]
+ || [istarget "x86_64-*-nacl*"]
|| [istarget "x86_64-*-linux*"]
|| [istarget "amd64-*-linux*"]) } {
return
@@ -118,6 +120,14 @@ if { !([istarget "i?86-*-elf*"]
# readelf: Apply readelf options on result. Compare with regex (last arg).
set i386tests {
+ {"Helper shared library (basic PLT test)"
+ "-shared -melf_i386" "--32" {pltlib.s} {} "libpltlib.so"}
+ {"basic PLT generation (non-PIC)"
+ "-melf_i386 tmpdir/libpltlib.so" "--32" {plt.s}
+ {{objdump -drj.plt plt.pd}} "plt"}
+ {"basic PLT generation (PIC)"
+ "-shared -melf_i386 tmpdir/libpltlib.so" "--32" {plt-pic.s}
+ {{objdump -drj.plt plt-pic.pd}} "libplt-pic.so"}
{"TLS -fpic -shared transitions"
"-shared -melf_i386 --no-ld-generated-unwind-info"
"--32" {tlspic1.s tlspic2.s}
@@ -161,7 +171,7 @@ set i386tests {
{"Reloc section order" "-shared -melf_i386 -z nocombreloc" "--32"
{reloc.s} {{objdump -hw reloc.d}} "reloc.so"}
{"Basic --emit-relocs support" "-shared -melf_i386 --emit-relocs" "--32"
- {emit-relocs.s} {{readelf --relocs emit-relocs.d}} "emit-relocs.so"}
+ {emit-relocs.s} {{readelf --relocs emit-relocs.rd}} "emit-relocs.so"}
{"-z combreloc relocation sections" "-shared -melf_i386 -z combreloc"
"--32" {combreloc.s} {{readelf -r combreloc.d}} "combreloc.so"}
{"TLS GD->LE transition" "-melf_i386"
@@ -175,6 +185,24 @@ set i386tests {
{{objdump -dwr tlsie1.dd}} "tlsie1"}
}
+# So as to avoid rewriting every last test case here in a nacl variant,
+# we use black magic to massage the generic cases into nacl-variant cases.
+if [istarget "*-*-nacl*"] {
+ # Change all the -melf_i386 to -melf_i386_nacl so linking can succeed.
+ regsub -all elf_i386 $i386tests elf_i386_nacl i386tests
+
+ # Same, applied to all the run_dump_test cases.
+ set options_regsub(ld) {-melf_i386 -melf_i386_nacl}
+
+ # The section/segment layout differs too much for the vanilla
+ # readelf output files to match. So massage the cases so that
+ # they refer to a foo-nacl.rd file instead of a foo.rd file.
+ regsub -all {([a-z0-9]+)\.rd} $i386tests {\1-nacl.rd} i386tests
+
+ # Likewise for PLTs.
+ regsub -all -- {([a-z0-9]+)\.pd} $i386tests {\1-nacl.pd} i386tests
+}
+
run_ld_link_tests $i386tests
run_dump_test "abs"
@@ -206,6 +234,8 @@ run_dump_test "pr12921"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
+ || [istarget "i?86-*-nacl*"]
+ || [istarget "x86_64-*-nacl*"]
|| [istarget "x86_64-*-linux*"]) } {
return
}