aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2022-10-19 09:03:17 +0200
committerAndreas Krebbel <krebbel@linux.ibm.com>2022-10-19 09:03:17 +0200
commit906f69cf65daa8fee1c1c94a5c2fb221ba02b40d (patch)
treeb4b68625589003e42dff226699c2387520fa8b7a /ld/testsuite
parent9454c9ce88b25646d279feed329c9cdba69b4905 (diff)
downloadbinutils-906f69cf65daa8fee1c1c94a5c2fb221ba02b40d.zip
binutils-906f69cf65daa8fee1c1c94a5c2fb221ba02b40d.tar.gz
binutils-906f69cf65daa8fee1c1c94a5c2fb221ba02b40d.tar.bz2
IBM zSystems: Issue error for *DBL relocs on misaligned symbols
Relocs like PC32DBL require a right shift of the symbol value. There is no situation where dropping symbol value bits with the right shift is a good thing. Hence we now issue an error to detect such problems.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-s390/reloccheck-1.d3
-rw-r--r--ld/testsuite/ld-s390/reloccheck-1.s14
2 files changed, 17 insertions, 0 deletions
diff --git a/ld/testsuite/ld-s390/reloccheck-1.d b/ld/testsuite/ld-s390/reloccheck-1.d
new file mode 100644
index 0000000..4696dcb
--- /dev/null
+++ b/ld/testsuite/ld-s390/reloccheck-1.d
@@ -0,0 +1,3 @@
+#as: -m64 -mzarch -march=z900
+#ld: -m elf64_s390 -e start -static
+#error: .*misaligned symbol.*
diff --git a/ld/testsuite/ld-s390/reloccheck-1.s b/ld/testsuite/ld-s390/reloccheck-1.s
new file mode 100644
index 0000000..6c932bd
--- /dev/null
+++ b/ld/testsuite/ld-s390/reloccheck-1.s
@@ -0,0 +1,14 @@
+ .machinemode zarch
+ .machine "z900"
+.text
+ .align 8
+.globl start
+ .type start, @function
+start:
+ larl %r1, test
+.globl test
+.data
+ .align 4
+ .byte 23
+test:
+ .zero 4