aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pie
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-03-20 17:39:04 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-03-20 17:39:04 +0000
commit4bf27aa9bace1519a934017fe12cdc5a60da43ad (patch)
tree3cea6d3f2c940308e8ac7e9da773b05ef9a76c08 /ld/testsuite/ld-pie
parent8c21ca2102f56852e43af8cb94a53f060a761e96 (diff)
downloadgdb-4bf27aa9bace1519a934017fe12cdc5a60da43ad.zip
gdb-4bf27aa9bace1519a934017fe12cdc5a60da43ad.tar.gz
gdb-4bf27aa9bace1519a934017fe12cdc5a60da43ad.tar.bz2
ld/
2009-03-20 H.J. Lu <hongjiu.lu@intel.com> PR ld/9970 * ldlang.c (lang_end): Warn missing entry symbol for -pie. ld/testsuite/ 2009-03-20 H.J. Lu <hongjiu.lu@intel.com> PR ld/9970 * ld-pie/pie.exp: Use -fpie to compile. Run *.d tests. * ld-pie/start.d: New. * ld-pie/start.s: Likewise.
Diffstat (limited to 'ld/testsuite/ld-pie')
-rw-r--r--ld/testsuite/ld-pie/pie.exp11
-rw-r--r--ld/testsuite/ld-pie/start.d8
-rw-r--r--ld/testsuite/ld-pie/start.s4
3 files changed, 21 insertions, 2 deletions
diff --git a/ld/testsuite/ld-pie/pie.exp b/ld/testsuite/ld-pie/pie.exp
index 064d9cd..1f4effc 100644
--- a/ld/testsuite/ld-pie/pie.exp
+++ b/ld/testsuite/ld-pie/pie.exp
@@ -28,8 +28,8 @@ if { ![istarget *-*-linux*] } {
}
# 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 "$CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie"
+catch "exec $CC -fpie -pie $srcdir/$subdir/pie.c -o tmpdir/pie" exec_output
send_log "$exec_output\n"
if { ![string match "" $exec_output] } {
return
@@ -41,3 +41,10 @@ set array_tests {
}
run_ld_link_exec_tests [] $array_tests
+
+set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach t $test_list {
+ # We need to strip the ".d", but can leave the dirname.
+ verbose [file rootname $t]
+ run_dump_test [file rootname $t]
+}
diff --git a/ld/testsuite/ld-pie/start.d b/ld/testsuite/ld-pie/start.d
new file mode 100644
index 0000000..1ee22e0
--- /dev/null
+++ b/ld/testsuite/ld-pie/start.d
@@ -0,0 +1,8 @@
+#name: missing entry symbol
+#ld: -pie
+#warning: .*: warning: cannot find entry symbol .*
+#nm: -n
+
+#...
+[0-9a-f]+ T +foo
+#...
diff --git a/ld/testsuite/ld-pie/start.s b/ld/testsuite/ld-pie/start.s
new file mode 100644
index 0000000..4a70181
--- /dev/null
+++ b/ld/testsuite/ld-pie/start.s
@@ -0,0 +1,4 @@
+ .text
+ .globl foo
+foo:
+ .byte 0