From 44a260c17d4a4e78b6a64c63d05cacfbee407a6a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 22 Feb 2006 17:41:04 +0000 Subject: [PATCH] 2006-02-22 H.J. Lu * ld-pie/pie.c: New file. * ld-pie/pie.exp: Check if compiler supports -pie. --- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-pie/pie.c | 5 +++++ ld/testsuite/ld-pie/pie.exp | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 ld/testsuite/ld-pie/pie.c diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 13d8d5f51d..2d55835d46 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-02-22 H.J. Lu + + * ld-pie/pie.c: New file. + + * ld-pie/pie.exp: Check if compiler supports -pie. + 2006-02-20 H.J. Lu PR ld/2218 diff --git a/ld/testsuite/ld-pie/pie.c b/ld/testsuite/ld-pie/pie.c new file mode 100644 index 0000000000..a9bce4a144 --- /dev/null +++ b/ld/testsuite/ld-pie/pie.c @@ -0,0 +1,5 @@ +int +main () +{ + return 0; +} diff --git a/ld/testsuite/ld-pie/pie.exp b/ld/testsuite/ld-pie/pie.exp index 513cdfda0d..7ab4c81505 100644 --- a/ld/testsuite/ld-pie/pie.exp +++ b/ld/testsuite/ld-pie/pie.exp @@ -24,6 +24,14 @@ if { ![istarget *-*-linux*] } { return } +# Check if -pie is supported or not. +send_log "$CC -pie $srcdir/$subdir/pie.c -o tmpdir/pie" +catch "exec $CC -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output +send_log "$exec_output\n" +if { ![string match "" $exec_output] } { + return +} + set array_tests { {"weak undefined" "-pie" "" {weakundef.c} "weakundef" "weakundef.out" "-fPIC"} {"weak undefined data" "-pie" "" {weakundef-data.c} "weakundef-data" "weakundef.out" "-fPIC"} -- 2.34.1