aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-checks
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-checks')
-rw-r--r--ld/testsuite/ld-checks/checks.exp13
-rw-r--r--ld/testsuite/ld-checks/over.d4
-rw-r--r--ld/testsuite/ld-checks/over.s7
-rw-r--r--ld/testsuite/ld-checks/over2.d8
-rw-r--r--ld/testsuite/ld-checks/over2.s4
5 files changed, 36 insertions, 0 deletions
diff --git a/ld/testsuite/ld-checks/checks.exp b/ld/testsuite/ld-checks/checks.exp
index b1c8454..782f50a 100644
--- a/ld/testsuite/ld-checks/checks.exp
+++ b/ld/testsuite/ld-checks/checks.exp
@@ -78,4 +78,17 @@ proc section_check {} {
}
}
+proc overflow_check {} {
+ # Test only on some 32-bit targets that are often tested
+ if { ![istarget i?86-*-*]
+ && ![istarget powerpc-*-*]
+ && ![istarget arm*-*-*] } {
+ return
+ }
+
+ run_dump_test "over"
+ run_dump_test "over2"
+}
+
section_check
+overflow_check
diff --git a/ld/testsuite/ld-checks/over.d b/ld/testsuite/ld-checks/over.d
new file mode 100644
index 0000000..e34bea9
--- /dev/null
+++ b/ld/testsuite/ld-checks/over.d
@@ -0,0 +1,4 @@
+#name: section size overflow
+#source: over.s
+#ld: -Ttext=0xfffffffc
+#error: .* section .text VMA wraps around address space
diff --git a/ld/testsuite/ld-checks/over.s b/ld/testsuite/ld-checks/over.s
new file mode 100644
index 0000000..7f8d4b5
--- /dev/null
+++ b/ld/testsuite/ld-checks/over.s
@@ -0,0 +1,7 @@
+ .text
+ .globl _start
+_start:
+ .long 0
+ .long 0
+ .long 0
+ .long 0
diff --git a/ld/testsuite/ld-checks/over2.d b/ld/testsuite/ld-checks/over2.d
new file mode 100644
index 0000000..511b917
--- /dev/null
+++ b/ld/testsuite/ld-checks/over2.d
@@ -0,0 +1,8 @@
+#name: section size overflow
+#source: over2.s
+#ld: -Ttext=0xfffffffc
+#nm: -n
+
+#...
+fffffffc T _start
+#pass
diff --git a/ld/testsuite/ld-checks/over2.s b/ld/testsuite/ld-checks/over2.s
new file mode 100644
index 0000000..dc6de0e
--- /dev/null
+++ b/ld/testsuite/ld-checks/over2.s
@@ -0,0 +1,4 @@
+ .text
+ .globl _start
+_start:
+ .long 0