]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-mips-elf/mips-elf.exp
* ld-mips-elf/reloc-1[ab].s: New source files.
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-mips-elf / mips-elf.exp
1 # Expect script for MIPS ELF linker tests
2 # Copyright 2002, 2003 Free Software Foundation, Inc.
3 #
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 2 of the License, or
7 # (at your option) any later version.
8 #
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.
13 #
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18
19 if {![istarget mips*-*-*] || ![is_elf_format]} {
20 return
21 }
22
23 set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]]
24 set linux_gnu [expr [istarget mips*-*-linux*]]
25 set embedded_elf [expr [istarget mips*-*-elf]]
26
27
28 # Check MIPS16 markings being passed through link.
29 run_dump_test "mips16-1"
30
31 # MIPS branch offset final link checking.
32 run_dump_test "branch-misc-1"
33
34 # Test multi-got link.
35 run_dump_test "multi-got-1"
36
37 if $has_newabi {
38 run_dump_test "elf-rel-got-n32"
39 run_dump_test "elf-rel-xgot-n32"
40 if { $linux_gnu } {
41 run_dump_test "elf-rel-got-n64-linux"
42 run_dump_test "elf-rel-xgot-n64-linux"
43 } else {
44 run_dump_test "elf-rel-got-n64"
45 run_dump_test "elf-rel-xgot-n64"
46 }
47
48 run_dump_test "relax-jalr-n32"
49 run_dump_test "relax-jalr-n32-shared"
50 run_dump_test "relax-jalr-n64"
51 run_dump_test "relax-jalr-n64-shared"
52 }
53
54 if { $linux_gnu } {
55 run_dump_test "rel32-o32"
56 run_dump_test "rel32-n32"
57 run_dump_test "rel64"
58 }
59
60 if { $embedded_elf } {
61 # Check basic Embedded-PIC PC-relative HI/LO relocs.
62 run_dump_test "empic1-ln"
63 run_dump_test "empic1-lp"
64 run_dump_test "empic1-mn"
65 run_dump_test "empic1-mp"
66 run_dump_test "empic1-sn"
67 run_dump_test "empic1-sp"
68
69 # Embedded-PIC PC-relative HI/LO reloc edge-case regression tests.
70 # As of 2001-12-26, the linker botches the fwd-0 and rev-1 tests.
71 run_dump_test "empic2-fwd-0"
72 run_dump_test "empic2-fwd-1"
73 run_dump_test "empic2-rev-0"
74 run_dump_test "empic2-rev-1"
75
76 # Check generation of embedded relocs section.
77 run_dump_test "emrelocs-eb"
78 run_dump_test "emrelocs-el"
79
80 run_dump_test "region1"
81 }
82
83 if $embedded_elf {
84 # This could work on other targets too, but would need the appropriate
85 # ld -m switch.
86 run_dump_test "reloc-1-rel"
87 }
88 if $has_newabi {
89 run_dump_test "reloc-1-n32"
90 if $linux_gnu {
91 # Uses a linux-specific ld -m switch
92 run_dump_test "reloc-1-n64"
93 }
94 }
95 run_dump_test "reloc-2"
96 if $embedded_elf {
97 run_dump_test "reloc-3-r"
98 run_dump_test "reloc-3-srec"
99 }