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]

[m32c] 3 byte relocs in gas


Applied.

2007-02-03  DJ Delorie  <dj@delorie.com>

	* config/tc-m32c.c (m32c_cons_fix_new): New.  Added to support 3
	byte relocs.
	* config/tc-m32c.h (TC_CONS_FIX_NEW): Define.
	(m32c_cons_fix_new): Prototype.

Index: config/tc-m32c.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m32c.c,v
retrieving revision 1.11
diff -p -U2 -r1.11 tc-m32c.c
--- config/tc-m32c.c	24 Jan 2007 21:53:09 -0000	1.11
+++ config/tc-m32c.c	4 Feb 2007 04:44:37 -0000
@@ -1020,4 +1020,35 @@ md_cgen_lookup_reloc (const CGEN_INSN * 
 
 void
+m32c_cons_fix_new (fragS *	frag,
+		   int		where,
+		   int		size,
+		   expressionS *exp)
+{
+  bfd_reloc_code_real_type type;
+
+  switch (size)
+    {
+    case 1:
+      type = BFD_RELOC_8;
+      break;
+    case 2:
+      type = BFD_RELOC_16;
+      break;
+    case 3:
+      type = BFD_RELOC_24;
+      break;
+    case 4:
+    default:
+      type = BFD_RELOC_32;
+      break;
+    case 8:
+      type = BFD_RELOC_64;
+      break;
+    }
+
+  fix_new_exp (frag, where, (int) size, exp, 0, type);
+}
+
+void
 m32c_apply_fix (struct fix *f, valueT *t, segT s)
 {
Index: config/tc-m32c.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m32c.h,v
retrieving revision 1.3
diff -p -U2 -r1.3 tc-m32c.h
--- config/tc-m32c.h	24 Feb 2006 22:10:35 -0000	1.3
+++ config/tc-m32c.h	4 Feb 2007 04:44:37 -0000
@@ -58,4 +58,8 @@ extern bfd_boolean m32c_fix_adjustable P
 extern int m32c_force_relocation PARAMS ((struct fix *));
 
+#define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \
+  m32c_cons_fix_new (FRAG, WHERE, NBYTES, EXP)
+extern void m32c_cons_fix_new (fragS *, int, int, expressionS *);
+
 extern const struct relax_type md_relax_table[];
 #define TC_GENERIC_RELAX_TABLE md_relax_table


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