aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pie
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-02-22 17:41:04 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-02-22 17:41:04 +0000
commit44a260c17d4a4e78b6a64c63d05cacfbee407a6a (patch)
tree5ff5874231c6b75c52150dd556ac736d1284028c /ld/testsuite/ld-pie
parentf40d16432570939c792ed5c67ff3687c055f3483 (diff)
downloadgdb-44a260c17d4a4e78b6a64c63d05cacfbee407a6a.zip
gdb-44a260c17d4a4e78b6a64c63d05cacfbee407a6a.tar.gz
gdb-44a260c17d4a4e78b6a64c63d05cacfbee407a6a.tar.bz2
2006-02-22 H.J. Lu <hongjiu.lu@intel.com>
* ld-pie/pie.c: New file. * ld-pie/pie.exp: Check if compiler supports -pie.
Diffstat (limited to 'ld/testsuite/ld-pie')
-rw-r--r--ld/testsuite/ld-pie/pie.c5
-rw-r--r--ld/testsuite/ld-pie/pie.exp8
2 files changed, 13 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pie/pie.c b/ld/testsuite/ld-pie/pie.c
new file mode 100644
index 0000000..a9bce4a
--- /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 513cdfd..7ab4c81 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"}