[RFA] pdp11: allow references to abs addresses with pc-relative addressing mode

Paul Koning paul_koning@dell.com
Fri Dec 31 17:25:00 GMT 2010


Currently the pdp11 assembler rejects pc-relative addressing mode if the operand is an absolute address (numeric address or symbol equated to a number).  Those are fine on a pdp11 and the relocation machinery handles them fine.  They pop up occasionally in compiler output, resulting in errors at the assembly stage.

The attached patch fixes this by deleting the code that rejects such operands.

Tested by building pdp11-aout-none and running the gcc testsuite (compile only) that turns up these errors, and checking the resulting a.out.

Ok to commit?

	paul

ChangeLog:

2010-12-31  Paul Koning  <ni1d@arrl.net>

	* config/tc-pdp11.c (parse_op_no_deferred): Allow PC-relative
	references to absolute addresses.

Index: tc-pdp11.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-pdp11.c,v
retrieving revision 1.23
diff -u -r1.23 tc-pdp11.c
--- tc-pdp11.c	29 Aug 2009 22:10:59 -0000	1.23
+++ tc-pdp11.c	31 Dec 2010 17:18:42 -0000
@@ -501,8 +501,6 @@
       /* label, d(rn), -(rn)  */
     default:
       {
-	char *old = str;
-
 	if (strncmp (str, "-(", 2) == 0)	/* -(rn) */
 	  {
 	    str = parse_reg (str + 2, operand);
@@ -527,11 +525,6 @@
 
 	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;



More information about the Binutils mailing list