This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] rl78 user-relocs in .word


Applied...

	* config/tc-rl78.c (rl78_cons_fix_new): Handle user-specified
	relocs in .word/.etc statements.

Index: gas/config/tc-rl78.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-rl78.c,v
retrieving revision 1.4
diff -p -U5 -r1.4 tc-rl78.c
--- gas/config/tc-rl78.c	3 Oct 2012 20:48:13 -0000	1.4
+++ gas/config/tc-rl78.c	29 Jan 2013 22:16:45 -0000
@@ -552,10 +552,27 @@ rl78_cons_fix_new (fragS *	frag,
     default:
       as_bad (_("unsupported constant size %d\n"), size);
       return;
     }
 
+  switch (exp->X_md)
+    {
+    case BFD_RELOC_RL78_LO16:
+    case BFD_RELOC_RL78_HI16:
+      if (size != 2)
+	as_bad (_("%%hi16/%%lo16 only applies to .short or .hword"));
+      type = exp->X_md;
+      break;
+    case BFD_RELOC_RL78_HI8:
+      if (size != 1)
+	as_bad (_("%%hi8 only applies to .byte"));
+      type = exp->X_md;
+      break;
+    default:
+      break;
+    }
+
   if (exp->X_op == O_subtract && exp->X_op_symbol)
     {
       if (size != 4 && size != 2 && size != 1)
 	as_bad (_("difference of two symbols only supported with .long, .short, or .byte"));
       else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]