]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* ld-srec/srec.exp: New tests.
authorIan Lance Taylor <ian@airs.com>
Wed, 15 Nov 1995 22:44:56 +0000 (22:44 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 15 Nov 1995 22:44:56 +0000 (22:44 +0000)
* ld-srec/sr1.c, ld-srec/sr2.c, ld-srec/sr3.cc: New files.
* lib/ld.exp (ld_simple_link): Discard warnings about not being
able to find the entry symbol.

ld/testsuite/.Sanitize
ld/testsuite/ld-srec/.Sanitize [new file with mode: 0644]
ld/testsuite/ld-srec/sr2.c [new file with mode: 0644]
ld/testsuite/lib/ld.exp

index 46d518ca52bd94278aa6fa856f717b592b2c4290..945f43772cd493179b4516684b555aee85f1b45b 100644 (file)
@@ -32,6 +32,7 @@ ld-empic
 ld-scripts
 ld-sh
 ld-shared
+ld-srec
 ld-undefined
 ld-versados
 
diff --git a/ld/testsuite/ld-srec/.Sanitize b/ld/testsuite/ld-srec/.Sanitize
new file mode 100644 (file)
index 0000000..19e17bf
--- /dev/null
@@ -0,0 +1,39 @@
+# .Sanitize for ld dejagnu testsuites
+
+# Each directory to survive it's way into a release will need a file
+# like this one called "./.Sanitize".  All keyword lines must exist,
+# and must exist in the order specified by this file.  Each directory
+# in the tree will be processed, top down, in the following order..
+
+# Hash started lines like this one are comments and will be deleted
+# before anything else is done.  Blank lines will also be squashed
+# out.
+
+# The lines between the "Do-first:" line and the "Things-to-keep:"
+# line are executed as a /bin/sh shell script before anything else is
+# done in this directory.
+
+Do-first:
+
+# All files listed between the "Things-to-keep:" line and the
+# "Do-last:" line will be kept.  All other files will be removed.
+# Directories listed in this section will have their own Sanitize
+# called.  Directories not listed will be removed in their entirety
+# with rm -rf.
+
+Things-to-keep:
+
+sr1.c
+sr2.c
+sr3.cc
+srec.exp
+
+Things-to-lose:
+
+# The lines between the "Do-last:" line and the end of the file
+# are executed as a /bin/sh shell script after everything else is
+# done.
+
+Do-last:
+
+#eof
diff --git a/ld/testsuite/ld-srec/sr2.c b/ld/testsuite/ld-srec/sr2.c
new file mode 100644 (file)
index 0000000..5736cfa
--- /dev/null
@@ -0,0 +1,18 @@
+/* This file is compiled and linked into the S-record format.  */
+
+int e1;
+int e2 = 1;
+
+int
+fn1 (s)
+     char *s;
+{
+  return s[e1];
+}
+
+int
+fn2 (s)
+     char *s;
+{
+  return s[e2];
+}
index 55994d0d091da10aceb8cc3ad7292b1dd760b830..a6dfdb03d0b644a3ce13fafb8fed29e3ea82522f 100644 (file)
@@ -96,6 +96,11 @@ proc default_ld_simple_link { ld target objects } {
     
     catch "exec $ld -o $target $objects" exec_output
     set exec_output [prune_system_crud $host_triplet $exec_output]
+
+    # We don't care if we get a warning about a non-existent start
+    # symbol, since the default linker script might use ENTRY.
+    regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
+
     if [string match "" $exec_output] then {
        return 1
     } else {