From 9a2310125bcdec881dd1b21004ec0ea6558cfd4f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 20 Nov 2013 12:35:10 -0800 Subject: [PATCH] Add mpx1static, mpx2 and mpx2static tests * ld-x86-64/mpx.exp (build_tests): Add libmpx2a.a, libmpx2b.a and libmpx2c.a. (run_tests): Add mpx1static, mpx2 and mpx2static. * ld-x86-64/mpx2.out: Likewise. * ld-x86-64/mpx2a.c: Likewise. * ld-x86-64/mpx2a.rd: Likewise. * ld-x86-64/mpx2b.c: Likewise. * ld-x86-64/mpx2c.c: Likewise. * ld-x86-64/mpx2c.rd: Likewise. --- ld/testsuite/ChangeLog | 12 ++++++++++++ ld/testsuite/ld-x86-64/mpx.exp | 18 ++++++++++++++++++ ld/testsuite/ld-x86-64/mpx2.out | 2 ++ ld/testsuite/ld-x86-64/mpx2a.c | 7 +++++++ ld/testsuite/ld-x86-64/mpx2a.rd | 3 +++ ld/testsuite/ld-x86-64/mpx2b.c | 7 +++++++ ld/testsuite/ld-x86-64/mpx2c.c | 10 ++++++++++ ld/testsuite/ld-x86-64/mpx2c.rd | 3 +++ 8 files changed, 62 insertions(+) create mode 100644 ld/testsuite/ld-x86-64/mpx2.out create mode 100644 ld/testsuite/ld-x86-64/mpx2a.c create mode 100644 ld/testsuite/ld-x86-64/mpx2a.rd create mode 100644 ld/testsuite/ld-x86-64/mpx2b.c create mode 100644 ld/testsuite/ld-x86-64/mpx2c.c create mode 100644 ld/testsuite/ld-x86-64/mpx2c.rd diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index a00cddfe57e..0190030da09 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2013-11-20 H.J. Lu + + * ld-x86-64/mpx.exp (build_tests): Add libmpx2a.a, libmpx2b.a + and libmpx2c.a. + (run_tests): Add mpx1static, mpx2 and mpx2static. + * ld-x86-64/mpx2.out: Likewise. + * ld-x86-64/mpx2a.c: Likewise. + * ld-x86-64/mpx2a.rd: Likewise. + * ld-x86-64/mpx2b.c: Likewise. + * ld-x86-64/mpx2c.c: Likewise. + * ld-x86-64/mpx2c.rd: Likewise. + 2013-11-19 Roland McGrath * ld-elf/ehdr_start-userdef.t: New file. diff --git a/ld/testsuite/ld-x86-64/mpx.exp b/ld/testsuite/ld-x86-64/mpx.exp index a2f5996ffa9..192c774c78d 100644 --- a/ld/testsuite/ld-x86-64/mpx.exp +++ b/ld/testsuite/ld-x86-64/mpx.exp @@ -47,6 +47,15 @@ set build_tests { {"Build libmpx1c.a" "" "-Wa,-madd-bnd-prefix" {mpx1c.c} {{readelf {-r --wide} mpx1c.rd}} "libmpx1c.a"} + {"Build libmpx2a.a" + "" "-Wa,-madd-bnd-prefix -fPIE" + {mpx2a.c} {{readelf {-r --wide} mpx2a.rd}} "libmpx2a.a"} + {"Build libmpx2b.a" + "" "-fPIE" + {mpx2b.c} {} "libmpx2b.a"} + {"Build libmpx2c.a" + "" "-Wa,-madd-bnd-prefix -fPIE" + {mpx2c.c} {{readelf {-r --wide} mpx2c.rd}} "libmpx2c.a"} } run_cc_link_tests $build_tests @@ -55,6 +64,15 @@ set run_tests { {"Run mpx1" "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o" "" {dummy.s} "mpx1" "mpx1.out"} + {"Run mpx1 with -static" + "tmpdir/mpx1a.o tmpdir/mpx1b.o tmpdir/mpx1c.o -static" "" + {dummy.s} "mpx1static" "mpx1.out"} + {"Run mpx2" + "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -pie" "" + {dummy.s} "mpx2" "mpx2.out"} + {"Run mpx2 with -static" + "tmpdir/mpx2a.o tmpdir/mpx2b.o tmpdir/mpx2c.o -static" "" + {dummy.s} "mpx2static" "mpx2.out"} } run_ld_link_exec_tests [] $run_tests diff --git a/ld/testsuite/ld-x86-64/mpx2.out b/ld/testsuite/ld-x86-64/mpx2.out new file mode 100644 index 00000000000..463021151d2 --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2.out @@ -0,0 +1,2 @@ +foo1 +foo2 diff --git a/ld/testsuite/ld-x86-64/mpx2a.c b/ld/testsuite/ld-x86-64/mpx2a.c new file mode 100644 index 00000000000..e1185b5fe6f --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2a.c @@ -0,0 +1,7 @@ +#include + +void +foo1 (void) +{ + printf ("foo1\n"); +} diff --git a/ld/testsuite/ld-x86-64/mpx2a.rd b/ld/testsuite/ld-x86-64/mpx2a.rd new file mode 100644 index 00000000000..9bebc8294fa --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2a.rd @@ -0,0 +1,3 @@ +#... +[0-9a-f ]+R_X86_64_PLT32_BND +0+ +.* +#... diff --git a/ld/testsuite/ld-x86-64/mpx2b.c b/ld/testsuite/ld-x86-64/mpx2b.c new file mode 100644 index 00000000000..389ac101344 --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2b.c @@ -0,0 +1,7 @@ +#include + +void +foo2 (void) +{ + printf ("foo2\n"); +} diff --git a/ld/testsuite/ld-x86-64/mpx2c.c b/ld/testsuite/ld-x86-64/mpx2c.c new file mode 100644 index 00000000000..12c7806ff0c --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2c.c @@ -0,0 +1,10 @@ +extern void foo1 (void); +extern void foo2 (void); + +int +main (void) +{ + foo1 (); + foo2 (); + return 0; +} diff --git a/ld/testsuite/ld-x86-64/mpx2c.rd b/ld/testsuite/ld-x86-64/mpx2c.rd new file mode 100644 index 00000000000..9bebc8294fa --- /dev/null +++ b/ld/testsuite/ld-x86-64/mpx2c.rd @@ -0,0 +1,3 @@ +#... +[0-9a-f ]+R_X86_64_PLT32_BND +0+ +.* +#... -- 2.30.2