]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-x86-64/mpx.exp
Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-x86-64 / mpx.exp
1 # Expect script for ELF MPX tests.
2 # Copyright 2013
3 # Free Software Foundation, Inc.
4 #
5 # This file is part of the GNU Binutils.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20 # MA 02110-1301, USA.
21 #
22
23 # The following tests require running the executable generated by ld,
24 # or enough of a build environment to create a fully linked executable.
25 # This is not commonly available when testing a cross-built linker.
26 if ![isnative] {
27 return
28 }
29
30 # Only on Linux for now.
31 if ![istarget "x86_64-*-linux*"] {
32 return
33 }
34
35 # Check to see if the C compiler works
36 if { [which $CC] == 0 } {
37 return
38 }
39
40 set build_tests {
41 {"Build libmpx1a.a"
42 "" "-Wa,-madd-bnd-prefix -fPIC"
43 {mpx1a.c} {{readelf {-r --wide} mpx1a.rd}} "libmpx1a.a"}
44 {"Build libmpx1b.a"
45 "" ""
46 {mpx1b.c} {} "libmpx1b.a"}
47 {"Build libmpx1c.a"
48 "" "-Wa,-madd-bnd-prefix"
49 {mpx1c.c} {{readelf {-r --wide} mpx1c.rd}} "libmpx1c.a"}
50 }
51
52 run_cc_link_tests $build_tests
53
54 set run_tests {
55 {"Run mpx1"
56 "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o" ""
57 {dummy.s} "mpx1" "mpx1.out"}
58 }
59
60 run_ld_link_exec_tests [] $run_tests