1 # Test basic linker script functionality
2 # By Ian Lance Taylor
, Cygnus Support
6 if ![ld_assemble $as $srcdir
/$subdir
/script.s tmpdir
/script.o
] {
11 proc check_script
{ } {
16 if ![ld_nm $nm tmpdir
/script
] {
19 if {![info exists nm_output
(text_start
)] \
20 ||
![info exists nm_output
(text_end
)] \
21 ||
![info exists nm_output
(data_start
)] \
22 ||
![info exists nm_output
(data_end
)]} {
23 send_log
"bad output from nm\n"
24 verbose
"bad output from nm"
29 if [istarget
*c54x
*-*-*] then {
33 if {$nm_output
(text_start
) != 0x100} {
34 send_log
"text_start == $nm_output(text_start)\n"
35 verbose
"text_start == $nm_output(text_start)"
37 } else { if {$nm_output
(text_end
) < $text_end \
38 || $nm_output
(text_end
) > 0x110} {
39 send_log
"text_end == $nm_output(text_end)\n"
40 verbose
"text_end == $nm_output(text_end)"
42 } else { if {$nm_output
(data_start
) != 0x1000} {
43 send_log
"data_start == $nm_output(data_start)\n"
44 verbose
"data_start == $nm_output(data_start)"
46 } else { if {$nm_output
(data_end
) < $data_end \
47 || $nm_output
(data_end
) > 0x1010} {
48 send_log
"data_end == $nm_output(data_end)\n"
49 verbose
"data_end == $nm_output(data_end)"
58 # PE targets need to
set the image base to
0 to avoid complications from nm.
60 if {[istarget
"*-*-pe*"] \
61 ||
[istarget
"*-*-cygwin*"] \
62 ||
[istarget
"*-*-mingw32*"] \
63 ||
[istarget
"*-*-winnt*"] \
64 ||
[istarget
"*-*-nt*"] \
65 ||
[istarget
"*-*-interix*"] } then {
66 set flags
"--image-base 0"
69 if ![ld_simple_link $
ld tmpdir
/script
"$flags -T $srcdir/$subdir/script.t tmpdir/script.o"] {
75 set testname
"MRI script"
77 if ![ld_simple_link $
ld tmpdir
/script
"$flags -c $srcdir/$subdir/scriptm.t"] {