From 12505806d06803312a664d33cd05ab45067a67f1 Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Thu, 6 Jan 2011 16:41:35 +0000 Subject: [PATCH] * config/tc-pdp11.c (parse_op_no_deferred): Allow PC-relative references to absolute addresses. --- gas/ChangeLog | 5 +++++ gas/config/tc-pdp11.c | 7 ------- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/pdp11/absreloc.d | 15 +++++++++++++++ gas/testsuite/gas/pdp11/absreloc.s | 26 ++++++++++++++++++++++++++ 5 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 gas/testsuite/gas/pdp11/absreloc.d create mode 100644 gas/testsuite/gas/pdp11/absreloc.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 257c83089d..3177aa5f30 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2011-01-06 Paul Koning + + * config/tc-pdp11.c (parse_op_no_deferred): Allow PC-relative + references to absolute addresses. + 2011-01-05 DJ Delorie * config/tc-rx.c (tc_gen_reloc): Emit an RX_OP_NEG expression diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c index 41f51bf7af..98e241f67b 100644 --- a/gas/config/tc-pdp11.c +++ b/gas/config/tc-pdp11.c @@ -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; diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 30545fb155..d13c73457a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-01-06 Paul Koning + + * gas/pdp11/absreloc.s: New. + * gas/pdp11/absreloc.d: New. + 2011-01-06 Paul Koning * 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 index 0000000000..1a47310bbf --- /dev/null +++ b/gas/testsuite/gas/pdp11/absreloc.d @@ -0,0 +1,15 @@ +#name: pdp11 absreloc +#objdump: -drw + +dump.o: file format .* + + +Disassembly of section .text: + +00000000 : + 0: 0bf7 fffc tst \$0 + 4: 0bdf 0000 tst \*\$0 6: 16 \*ABS\* + 8: 0bf7 0008 tst \$14 a: DISP16 \*ABS\* + c: 0bdf 0014 tst \*\$24 + 10: 0bf7 0000 tst \$14 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 index 0000000000..e4291f0f79 --- /dev/null +++ b/gas/testsuite/gas/pdp11/absreloc.s @@ -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