S/390: Fix symbolic displacement in lay
authorAndreas Krebbel <krebbel@linux.ibm.com>
Tue, 25 Sep 2018 15:13:28 +0000 (17:13 +0200)
committerAndreas Krebbel <krebbel@linux.ibm.com>
Tue, 25 Sep 2018 15:13:28 +0000 (17:13 +0200)
Increase the fixup length to 4 for the 20 bit displacement.

gas/ChangeLog:

2018-09-25  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/tc-s390.c (md_apply_fix): Set fx_size to 4 for 20 bit
displacements.
* testsuite/gas/s390/s390.exp: Run new test.
* testsuite/gas/s390/zarch-z990-symbol-lay.s: New test.

gas/config/tc-s390.c
gas/testsuite/gas/s390/s390.exp
gas/testsuite/gas/s390/zarch-z990-symbol-lay.l [new file with mode: 0644]
gas/testsuite/gas/s390/zarch-z990-symbol-lay.s [new file with mode: 0644]

index 60de23fbbdc8c7a4c6aa25ccba3f28ba6c198f5d..b53e33af3db7b1098f0baf2c184002cd90876207 100644 (file)
@@ -2294,7 +2294,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
        }
       else if (operand->bits == 20 && operand->shift == 20)
        {
-         fixP->fx_size = 2;
+         fixP->fx_size = 4;
          fixP->fx_where += 2;
          fixP->fx_r_type = BFD_RELOC_390_20;
        }
index e6d0754f44da3f3a8fb649542d21affe5894353b..f0258ef03c68bc424f615982fa53765074cbf371 100644 (file)
@@ -21,6 +21,7 @@ if [expr [istarget "s390-*-*"] ||  [istarget "s390x-*-*"]]  then {
 
     run_dump_test "zarch-z900" "{as -m64}"
     run_dump_test "zarch-z990" "{as -m64} {as -march=z990}"
+    run_list_test "zarch-z990-symbol-lay" "-m64 -march=z990"
     run_dump_test "zarch-z9-109" "{as -m64} {as -march=z9-109}"
     run_list_test "zarch-z9-109-err" "-march=z9-109"
     run_dump_test "zarch-z9-ec" "{as -m64} {as -march=z9-ec}"
diff --git a/gas/testsuite/gas/s390/zarch-z990-symbol-lay.l b/gas/testsuite/gas/s390/zarch-z990-symbol-lay.l
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/gas/testsuite/gas/s390/zarch-z990-symbol-lay.s b/gas/testsuite/gas/s390/zarch-z990-symbol-lay.s
new file mode 100644 (file)
index 0000000..97aa8ec
--- /dev/null
@@ -0,0 +1,6 @@
+.text
+foo:
+       lay     %r1,bar
+       .org 0x10000
+bar:
+       .long 42