diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-08-01 18:12:22 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-08-01 18:12:22 +0000 |
commit | bc4c9b927b51cb5ea6902b1545a70aaf242d6665 (patch) | |
tree | 575dca3ff7b2a00caeebadee91a2928098e648c8 /ld/testsuite | |
parent | 582dd77f6571a3b9ca89d715d1522b68b2507feb (diff) | |
download | gdb-bc4c9b927b51cb5ea6902b1545a70aaf242d6665.zip gdb-bc4c9b927b51cb5ea6902b1545a70aaf242d6665.tar.gz gdb-bc4c9b927b51cb5ea6902b1545a70aaf242d6665.tar.bz2 |
* ld-scripts/crossref.exp: New test.
* ld-scripts/cross1.c, ld-scripts/cross2.c: New files.
* ld-scripts/crossref.t: New file.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/.Sanitize | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/cross1.c | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/cross2.c | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/crossref.exp | 33 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/crossref.t | 6 |
6 files changed, 69 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 2e6f914..ed29e30 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,18 @@ +Thu Aug 1 14:10:27 1996 Ian Lance Taylor <ian@cygnus.com> + + * ld-scripts/crossref.exp: New test. + * ld-scripts/cross1.c, ld-scripts/cross2.c: New files. + * ld-scripts/crossref.t: New file. + +Sat Jun 29 13:40:11 1996 Ian Lance Taylor <ian@cygnus.com> + + * ld-sh/sh.exp: Fix debugging messages. + * ld-sh/sh1.s: Use .align 4. + +Wed May 1 16:45:13 1996 Ian Lance Taylor <ian@cygnus.com> + + * ld-sh/sh.exp: Use -O when compiling with -mrelax. + Mon Apr 29 10:33:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * ld-shared/shared.exp: Run the shared library tests on diff --git a/ld/testsuite/ld-scripts/.Sanitize b/ld/testsuite/ld-scripts/.Sanitize index 9752482..176af22 100644 --- a/ld/testsuite/ld-scripts/.Sanitize +++ b/ld/testsuite/ld-scripts/.Sanitize @@ -23,6 +23,10 @@ Do-first: Things-to-keep: +cross1.c +cross2.c +crossref.exp +crossref.t defined.exp defined.s defined.t diff --git a/ld/testsuite/ld-scripts/cross1.c b/ld/testsuite/ld-scripts/cross1.c new file mode 100644 index 0000000..5678945 --- /dev/null +++ b/ld/testsuite/ld-scripts/cross1.c @@ -0,0 +1,6 @@ +extern int foo (); +int +func () +{ + return foo (); +} diff --git a/ld/testsuite/ld-scripts/cross2.c b/ld/testsuite/ld-scripts/cross2.c new file mode 100644 index 0000000..4143177 --- /dev/null +++ b/ld/testsuite/ld-scripts/cross2.c @@ -0,0 +1,5 @@ +int +foo () +{ + return 1; +} diff --git a/ld/testsuite/ld-scripts/crossref.exp b/ld/testsuite/ld-scripts/crossref.exp new file mode 100644 index 0000000..4c53d5d --- /dev/null +++ b/ld/testsuite/ld-scripts/crossref.exp @@ -0,0 +1,33 @@ +# Test NOCROSSREFS in a linker script. +# By Ian Lance Taylor, Cygnus Support. + +set testname "NOCROSSREFS" + +if { [which $CC] == 0 } { + untested $testname + return +} + +if { ![ld_compile $CC "$srcdir/$subdir/cross1.c" tmpdir/cross1.o] \ + || ![ld_compile $CC "$srcdir/$subdir/cross2.c" tmpdir/cross2.o] } { + unresolved $testname + return +} + +verbose -log "$ld -o tmpdir/crossref -T $srcdir/$subdir/crossref.t tmpdir/cross1.o tmpdir/cross2.o" + +catch "exec $ld -o tmpdir/crossref -T $srcdir/$subdir/crossref.t tmpdir/cross1.o tmpdir/cross2.o" exec_output +set exec_output [prune_system_crud $host_triplet $exec_output] + +regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + +if [string match "" $exec_output] then { + fail $testname +} else { + verbose -log "$exec_output" + if [regexp "prohibited cross reference from .* to `foo' in" $exec_output] { + pass $testname + } else { + fail $testname + } +} diff --git a/ld/testsuite/ld-scripts/crossref.t b/ld/testsuite/ld-scripts/crossref.t new file mode 100644 index 0000000..e1948c9 --- /dev/null +++ b/ld/testsuite/ld-scripts/crossref.t @@ -0,0 +1,6 @@ +NOCROSSREFS ( .text .data ) +SECTIONS +{ + .text : { tmpdir/cross1.o } + .data : { tmpdir/cross2.o } +} |