aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/pr17935-1.d3
-rw-r--r--ld/testsuite/ld-x86-64/pr17935-1.s7
-rw-r--r--ld/testsuite/ld-x86-64/pr17935-2.d3
-rw-r--r--ld/testsuite/ld-x86-64/pr17935-2.s6
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp2
5 files changed, 21 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/pr17935-1.d b/ld/testsuite/ld-x86-64/pr17935-1.d
new file mode 100644
index 0000000..5734eab
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr17935-1.d
@@ -0,0 +1,3 @@
+# as: --64
+# ld: -m elf_x86_64 -shared -z text
+# error: warning: relocation against `foo' in readonly section `.text'
diff --git a/ld/testsuite/ld-x86-64/pr17935-1.s b/ld/testsuite/ld-x86-64/pr17935-1.s
new file mode 100644
index 0000000..38eef2e
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr17935-1.s
@@ -0,0 +1,7 @@
+ .text
+ .globl foo
+foo:
+ .byte 0
+ .globl bar
+bar:
+ .dc.a foo
diff --git a/ld/testsuite/ld-x86-64/pr17935-2.d b/ld/testsuite/ld-x86-64/pr17935-2.d
new file mode 100644
index 0000000..81df652
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr17935-2.d
@@ -0,0 +1,3 @@
+# as: --64
+# ld: -m elf_x86_64 -shared -z text
+# error: warning: relocation in readonly section `.text'
diff --git a/ld/testsuite/ld-x86-64/pr17935-2.s b/ld/testsuite/ld-x86-64/pr17935-2.s
new file mode 100644
index 0000000..3ae5369
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr17935-2.s
@@ -0,0 +1,6 @@
+ .text
+foo:
+ .byte 0
+ .globl bar
+bar:
+ .dc.a foo
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index bfa89c3..9bb08bd 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -311,6 +311,8 @@ run_dump_test "mov1a"
run_dump_test "mov1b"
run_dump_test "mov1c"
run_dump_test "mov1d"
+run_dump_test "pr17935-1"
+run_dump_test "pr17935-2"
# Must be native with the C compiler
if { [isnative] && [which $CC] != 0 } {