From 1b09c02b1788bb88abd2e325f82600018290dbb3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 15 Nov 1995 22:44:56 +0000 Subject: [PATCH] * ld-srec/srec.exp: New tests. * 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 | 1 + ld/testsuite/ld-srec/.Sanitize | 39 ++++++++++++++++++++++++++++++++++ ld/testsuite/ld-srec/sr2.c | 18 ++++++++++++++++ ld/testsuite/lib/ld.exp | 5 +++++ 4 files changed, 63 insertions(+) create mode 100644 ld/testsuite/ld-srec/.Sanitize create mode 100644 ld/testsuite/ld-srec/sr2.c diff --git a/ld/testsuite/.Sanitize b/ld/testsuite/.Sanitize index 46d518ca52b..945f43772cd 100644 --- a/ld/testsuite/.Sanitize +++ b/ld/testsuite/.Sanitize @@ -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 index 00000000000..19e17bf9ef3 --- /dev/null +++ b/ld/testsuite/ld-srec/.Sanitize @@ -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 index 00000000000..5736cfa468d --- /dev/null +++ b/ld/testsuite/ld-srec/sr2.c @@ -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]; +} diff --git a/ld/testsuite/lib/ld.exp b/ld/testsuite/lib/ld.exp index 55994d0d091..a6dfdb03d0b 100644 --- a/ld/testsuite/lib/ld.exp +++ b/ld/testsuite/lib/ld.exp @@ -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 { -- 2.30.2