2006-02-22 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 22 Feb 2006 17:41:04 +0000 (17:41 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 22 Feb 2006 17:41:04 +0000 (17:41 +0000)
* ld-pie/pie.c: New file.

* ld-pie/pie.exp: Check if compiler supports -pie.

ld/testsuite/ChangeLog
ld/testsuite/ld-pie/pie.c [new file with mode: 0644]
ld/testsuite/ld-pie/pie.exp

index 13d8d5f..2d55835 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2006-02-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/2218
diff --git a/ld/testsuite/ld-pie/pie.c b/ld/testsuite/ld-pie/pie.c
new file mode 100644 (file)
index 0000000..a9bce4a
--- /dev/null
@@ -0,0 +1,5 @@
+int
+main ()
+{
+  return 0;
+}
index 513cdfd..7ab4c81 100644 (file)
@@ -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"}