* ld-scripts/crossref.exp: New test.

* ld-scripts/cross1.c, ld-scripts/cross2.c: New files.
	* ld-scripts/crossref.t: New file.
This commit is contained in:
Ian Lance Taylor 1996-08-01 18:12:22 +00:00
parent 582dd77f65
commit bc4c9b927b
6 changed files with 69 additions and 0 deletions

View file

@ -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

View file

@ -23,6 +23,10 @@ Do-first:
Things-to-keep:
cross1.c
cross2.c
crossref.exp
crossref.t
defined.exp
defined.s
defined.t

View file

@ -0,0 +1,6 @@
extern int foo ();
int
func ()
{
return foo ();
}

View file

@ -0,0 +1,5 @@
int
foo ()
{
return 1;
}

View file

@ -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
}
}

View file

@ -0,0 +1,6 @@
NOCROSSREFS ( .text .data )
SECTIONS
{
.text : { tmpdir/cross1.o }
.data : { tmpdir/cross2.o }
}