From e110eeb74e39496ca32a52d478319f0d840adc2c Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Sun, 4 Feb 2007 04:45:36 +0000 Subject: * 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. --- gas/ChangeLog | 7 +++++++ gas/config/tc-m32c.c | 31 +++++++++++++++++++++++++++++++ gas/config/tc-m32c.h | 4 ++++ 3 files changed, 42 insertions(+) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 0f595b9..6db4d2f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2007-02-03 DJ Delorie + + * 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. + 2007-02-02 Bob Wilson * config/tc-xtensa.c (xg_build_to_insn): Use tinsn_init. diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c index 9303422..e9ebf34 100644 --- a/gas/config/tc-m32c.c +++ b/gas/config/tc-m32c.c @@ -1019,6 +1019,37 @@ md_cgen_lookup_reloc (const CGEN_INSN * insn ATTRIBUTE_UNUSED, } 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) { if (f->fx_r_type == BFD_RELOC_M32C_RL_JUMP diff --git a/gas/config/tc-m32c.h b/gas/config/tc-m32c.h index 3cdd1a14..697e130 100644 --- a/gas/config/tc-m32c.h +++ b/gas/config/tc-m32c.h @@ -57,6 +57,10 @@ extern bfd_boolean m32c_fix_adjustable PARAMS ((struct fix *)); #define TC_FORCE_RELOCATION(fix) m32c_force_relocation (fix) 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 -- cgit v1.1