1 # Expect script for ld-mn10300 tests
2 # Copyright (C) 2007-2017 Free Software Foundation, Inc.
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 if {!([istarget "am3*-*-*"]) && !([istarget "mn10300*-*-*"]) } {
24 # Set up a list as described in ld-lib.exp
29 "-relax -Ttext 0x8000074" ""
31 { "i36434.s" "i36434-2.s" }
32 { {objdump -dz i36434.d} }
36 "difference of two same-section symbols"
40 { {objdump -d i112045-1.d} }
44 "difference of two same-section symbols where the difference is held in another section"
45 "-relax -Ttext 100" ""
48 { {objdump -D i112045-3.d} }
52 "relaxation and alignment directives"
53 "-relax -Ttext 100 -Tbss 300" ""
56 { {objdump -d i127740.d} }
60 "adjustment of symbols due to relaxation"
61 "-Tdata 1f -Ttext 0 -relax" ""
64 { {readelf --syms i135409-1.d} }
68 "adjustment of symbols due to relaxation (with alignment directives)"
69 "-Tdata 1f -Ttext 0 -relax" ""
72 { {readelf --syms i135409-2.d} }
76 "adjustment of symbols due to relaxation (with a symbol in the deleted region)"
77 "-Tdata 1f -Ttext 0 -relax" ""
80 { {objdump -d i135409-3.d} }
84 "adjusting a 16-bit forward branch"
85 "-Ti135409-4.t -relax" ""
88 { {objdump -d i135409-4.d} }
92 "adjusting a 16-bit backward branch"
93 "-Ti135409-5.t -relax" ""
96 { {objdump -d i135409-5.d} }
100 "relaxing offsets into a merged string section"
101 "-Ti143317.t -shared -relax" ""
104 { {objdump -d i143317.d} }
109 run_ld_link_tests $mn10300_tests
111 if {!([istarget "am3*-*-*"])} {
117 "difference of two same-section symbols (in a shared library)"
121 { {objdump -R i112045-2.d} }
126 run_ld_link_tests $am33_tests
128 proc i126256-test { } {
135 set testname "Seg fault whilst linking one shared library into another when relaxation is enabled."
137 if {![is_remote host] && [which $CC] == 0} then {
141 if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-1.c $tmpdir/i126256-1.o] } {
146 if { ![ld_compile "$CC -mrelax -fPIC" $srcdir/$subdir/i126256-2.c $tmpdir/i126256-2.o] } {
151 if { ![ld_link $ld $tmpdir/i126256-1.so "-shared $tmpdir/i126256-1.o -e 0"]} {
156 if { ![ld_link $ld $tmpdir/i126256-2.so "--relax -shared $tmpdir/i126256-2.o $tmpdir/i126256-1.so -e 0"]} {