aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf/elf.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elf/elf.exp')
-rw-r--r--ld/testsuite/ld-elf/elf.exp23
1 files changed, 21 insertions, 2 deletions
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index f975d42289e3..43c42822bc08 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -1,5 +1,5 @@
# Expect script for various ELF tests.
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# Exclude non-ELF targets.
@@ -28,3 +28,22 @@ foreach t $test_list {
verbose [file rootname $t]
run_dump_test [file rootname $t]
}
+
+# The following tests require running the executable generated by ld.
+if ![isnative] {
+ return
+}
+
+set array_tests {
+ {"preinit array" "" "" {preinit.c} "preinit" "preinit.out"}
+ {"static preinit array" "-static" "" {preinit.c} "preinit" "preinit.out"}
+ {"init array" "" "" {init.c} "init" "init.out"}
+ {"static init array" "-static" "" {init.c} "init" "init.out"}
+ {"fini array" "" "" {fini.c} "fini" "fini.out"}
+ {"static fini array" "-static" "" {fini.c} "fini" "fini.out"}
+}
+
+# NetBSD ELF systems do not currently support the .*_array sections.
+run_ld_link_exec_tests [list "*-*-netbsdelf*"] $array_tests
+
+catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini" status