1 # Expect script for ELF MPX tests.
3 # Free Software Foundation, Inc.
5 # This file is part of the GNU Binutils.
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.
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.
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,
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.
30 # Only on Linux for now.
31 if ![istarget "x86_64-*-linux*"] {
35 # Check to see if the C compiler works
36 if { [which $CC] == 0 } {
42 "" "-Wa,-madd-bnd-prefix -fPIC"
43 {mpx1a.c} {{readelf {-r --wide} mpx1a.rd}} "libmpx1a.a"}
46 {mpx1b.c} {} "libmpx1b.a"}
48 "" "-Wa,-madd-bnd-prefix"
49 {mpx1c.c} {{readelf {-r --wide} mpx1c.rd}} "libmpx1c.a"}
51 "" "-Wa,-madd-bnd-prefix -fPIE"
52 {mpx2a.c} {{readelf {-r --wide} mpx2a.rd}} "libmpx2a.a"}
55 {mpx2b.c} {} "libmpx2b.a"}
57 "" "-Wa,-madd-bnd-prefix -fPIE"
58 {mpx2c.c} {{readelf {-r --wide} mpx2c.rd}} "libmpx2c.a"}
61 run_cc_link_tests $build_tests
65 "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o" ""
66 {dummy.s} "mpx1" "mpx1.out"}
67 {"Run mpx1 with -static"
68 "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o -static" ""
69 {dummy.s} "mpx1static" "mpx1.out"}
71 "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -pie" ""
72 {dummy.s} "mpx2" "mpx2.out"}
73 {"Run mpx2 with -static"
74 "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -static" ""
75 {dummy.s} "mpx2static" "mpx2.out"}
78 run_ld_link_exec_tests [] $run_tests
80 run_dump_test "bnd-branch-1"
81 run_dump_test "bnd-ifunc-1"
82 run_dump_test "bnd-plt-1"