* config/tc-pdp11.c (parse_op_no_deferred): Allow PC-relative
authorPaul Koning <pkoning@equallogic.com>
Thu, 6 Jan 2011 16:41:35 +0000 (16:41 +0000)
committerPaul Koning <pkoning@equallogic.com>
Thu, 6 Jan 2011 16:41:35 +0000 (16:41 +0000)
references to absolute addresses.

gas/ChangeLog
gas/config/tc-pdp11.c
gas/testsuite/ChangeLog
gas/testsuite/gas/pdp11/absreloc.d [new file with mode: 0644]
gas/testsuite/gas/pdp11/absreloc.s [new file with mode: 0644]

index 257c83089d3775343928bc0b5e181b7b336fb775..3177aa5f301785cb4326b9e75fcb91f0fb662071 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-06  Paul Koning  <ni1d@arrl.net>
+
+       * config/tc-pdp11.c (parse_op_no_deferred): Allow PC-relative
+       references to absolute addresses.
+
 2011-01-05  DJ Delorie  <dj@redhat.com>
 
        * config/tc-rx.c (tc_gen_reloc): Emit an RX_OP_NEG expression
index 41f51bf7af6e99ef2c45ebf49a0bb1b60d7c543e..98e241f67b7e5935038345aedb1c15fd7f7637aa 100644 (file)
@@ -501,8 +501,6 @@ parse_op_no_deferred (char *str, struct pdp11_code *operand)
       /* label, d(rn), -(rn)  */
     default:
       {
-       char *old = str;
-
        if (strncmp (str, "-(", 2) == 0)        /* -(rn) */
          {
            str = parse_reg (str + 2, operand);
@@ -527,11 +525,6 @@ parse_op_no_deferred (char *str, struct pdp11_code *operand)
 
        if (*str != '(')
          {
-           if (operand->reloc.exp.X_op != O_symbol)
-             {
-               operand->error = _("Label expected");
-               return old;
-             }
            operand->code = 067;
            operand->additional = 1;
            operand->word = 0;
index 30545fb1558bc12544f248de8b49c46027a65863..d13c73457aa0c0bf6c20c12fe39f86c1a82a15ee 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-06  Paul Koning  <ni1d@arrl.net>
+
+       * gas/pdp11/absreloc.s: New.
+       * gas/pdp11/absreloc.d: New.
+
 2011-01-06  Paul Koning  <ni1d@arrl.net>
 
        * gas/pdp11/opcode.d: Fix expected output for sec instruction.
diff --git a/gas/testsuite/gas/pdp11/absreloc.d b/gas/testsuite/gas/pdp11/absreloc.d
new file mode 100644 (file)
index 0000000..1a47310
--- /dev/null
@@ -0,0 +1,15 @@
+#name: pdp11 absreloc
+#objdump: -drw
+
+dump.o:     file format .*
+
+
+Disassembly of section .text:
+
+00000000 <start>:
+   0:  0bf7 fffc       tst     \$0 <start>
+   4:  0bdf 0000       tst     \*\$0   6: 16   \*ABS\*
+   8:  0bf7 0008       tst     \$14 <start\+0x14>      a: DISP16       \*ABS\*
+   c:  0bdf 0014       tst     \*\$24
+  10:  0bf7 0000       tst     \$14 <start\+0x14>      12: DISP16      \*ABS\*
+  14:  0bdf 0014       tst     \*\$24
diff --git a/gas/testsuite/gas/pdp11/absreloc.s b/gas/testsuite/gas/pdp11/absreloc.s
new file mode 100644 (file)
index 0000000..e4291f0
--- /dev/null
@@ -0,0 +1,26 @@
+# Test abs operands with relocatable modes for PDP11.
+# Copyright 2011 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
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# 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., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+aref = 20
+       
+start: tst     start
+       tst     @$start
+       tst     aref
+       tst     @$aref
+       tst     20
+       tst     @$20