ld-cris/expdyn1.d, ld-cris/expdyn1.s, ld-cris/dso-1.s: New tests.
* ld-cris/cris.exp: Split run_dump_tests in two parts, executing
tests named *dso-*.d first and copying their tmpdir/dump to files
named as the .d-file.
+2002-01-31 Hans-Peter Nilsson <hp@axis.com>
+
+ * ld-cris/weakref1.d, ld-cris/libdso-1.d, ld-cris/gotrel2.s,
+ ld-cris/expdyn1.d, ld-cris/expdyn1.s, ld-cris/dso-1.s: New tests.
+ * ld-cris/cris.exp: Split run_dump_tests in two parts, executing
+ tests named *dso-*.d first and copying their tmpdir/dump to files
+ named as the .d-file.
+
2002-01-31 Alan Modra <amodra@bigpond.net.au>
* ld-scripts/crossref.exp: Allow foo to have a leading dot.
}
set rd_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+
+# First, execute those tests that are named to indicate that they create a
+# DSO. Copy the file from the run_dump_test "tmpdir/dump" to a unique
+# expected name.
+# FIXME: Add option "output: filename" to run_dump_test.
+# FIXME: Add option "ldtail: option" to run_dump_test, so we can link
+# libraries in the right order.
+foreach atest $rd_test_list {
+ # We need to check against runtest_file_p too, or we'd mindlessly copy
+ # the last tmpdir/dump in selective test-runs.
+ if { [string match $srcdir/$subdir/*dso-*.d $atest] \
+ && [runtest_file_p $runtests [file tail $atest]] } {
+ verbose [file rootname $atest]
+ run_dump_test [file rootname $atest]
+ set cmd "cp tmpdir/dump tmpdir/[file rootname [file tail $atest]].so"
+ send_log "$cmd\n"
+ set cmdret [catch "exec $cmd" comp_output]
+ send_log "$comp_output\n"
+ # FIXME: What if it fails? Need we do something?
+ }
+}
+
+# Then run the ordinary tests. This round, exclude the dso-* tests.
foreach atest $rd_test_list {
# We need to strip the ".d", but can leave the dirname.
- verbose [file rootname $atest]
- run_dump_test [file rootname $atest]
+ if { ! [string match $srcdir/$subdir/*dso-*.d $atest] } {
+ verbose [file rootname $atest]
+ run_dump_test [file rootname $atest]
+ }
}
--- /dev/null
+ .text
+ .global dsofn
+ .type dsofn,@function
+dsofn:
+ nop
+.Lfe:
+ .size dsofn,.Lfe1-dsofn
--- /dev/null
+#source: expdyn1.s
+#as: --no-underscore
+#ld: -m crislinux -export-dynamic tmpdir/libdso-1.so
+#objdump: -T
+
+.*: file format elf32-cris
+
+# Exporting dynamic symbols means objects as well as functions.
+
+DYNAMIC SYMBOL TABLE:
+#...
+00080206 g DF .text 00000002 expfn
+00082208 g DO .data 00000000 expobj
+#pass
--- /dev/null
+ .data
+ .global expobj
+ .type expobj,@object
+expobj:
+ .dword 0
+
+ .text
+ .global _start
+_start:
+ nop
+ .global expfn
+expfn:
+ .type expfn,@function
+ nop
+.Lfe1:
+ .size expfn,.Lfe1-expfn
+
--- /dev/null
+ .text
+ .weak undefweak
+ .global _start
+_start:
+ move.d [$r0+undefweak:GOT],$r3
--- /dev/null
+#source: dso-1.s
+#as: --pic --no-underscore
+#ld: --shared -m crislinux
+#objdump: -T
+
+# Just check that we actually got a DSO with the dsofn symbol.
+
+.*: file format elf32-cris
+
+DYNAMIC SYMBOL TABLE:
+#...
+00000214 g DF .text 00000000 dsofn
+#pass
--- /dev/null
+#source: gotrel2.s
+#as: --pic --no-underscore
+#ld: -m crislinux tmpdir/libdso-1.so
+#objdump: -R
+
+# A dynamic reloc for an undefined weak reference in a program got a
+# confused symbol reference count mismatch with a bfd assertion. Linking
+# with a DSO was needed as a catalyst to get to the faulty code; nothing
+# in the DSO was needed. We just check that we don't get the bfd
+# assertion. Note that no actual dynamic reloc is created for the
+# unresolved weak. Perhaps it should; the symbol could be defined in a
+# preloaded object or a new version of the DSO. FIXME: Revisit and adjust
+# test-result.
+
+.*: file format elf32-cris
+
+DYNAMIC RELOCATION RECORDS \(none\)