* MAINTAINERS: Update my email address
[deliverable/binutils-gdb.git] / gas / cgen.c
index e3cb1c83ae6715326e99ba76987d22558387471e..3baee8fe94b7555f408ead218fbed2aeec070904 100644 (file)
@@ -1,5 +1,6 @@
 /* GAS interface for targets using CGEN: Cpu tools GENerator.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
 
@@ -26,6 +27,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "as.h"
 #include "subsegs.h"
 #include "cgen.h"
+#include "dwarf2dbg.h"
 
 /* Opcode table descriptor, must be set by md_begin.  */
 
@@ -396,6 +398,9 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result)
     {
       int max_len;
       fragS *old_frag;
+      expressionS *exp;
+      symbolS *sym;
+      offsetT off;
 
 #ifdef TC_CGEN_MAX_RELAX
       max_len = TC_CGEN_MAX_RELAX (insn, byte_len);
@@ -412,14 +417,24 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result)
       /* Create a relaxable fragment for this instruction.  */
       old_frag = frag_now;
 
+      exp = &fixups[relax_operand].exp;
+      sym = exp->X_add_symbol;
+      off = exp->X_add_number;
+      if (exp->X_op != O_constant && exp->X_op != O_symbol)
+       {
+         /* Handle complex expressions.  */
+         sym = make_expr_symbol (exp);
+         off = 0;
+       }
+
       frag_var (rs_machine_dependent,
                max_len - byte_len /* max chars */,
                0 /* variable part already allocated */,
                /* FIXME: When we machine generate the relax table,
                   machine generate a macro to compute subtype.  */
                1 /* subtype */,
-               fixups[relax_operand].exp.X_add_symbol,
-               fixups[relax_operand].exp.X_add_number,
+               sym,
+               off,
                f);
 
       /* Record the operand number with the fragment so md_convert_frag
@@ -445,6 +460,9 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result)
   memcpy (f, buf, byte_len);
 #endif
 
+  /* Emit DWARF2 debugging information.  */
+  dwarf2_emit_insn (byte_len);
+
   /* Create any fixups.  */
   for (i = 0; i < num_fixups; ++i)
     {
@@ -611,7 +629,9 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg)
        case BFD_RELOC_32:
          md_number_to_chars (where, value, 4);
          break;
-       /* FIXME: later add support for 64 bits.  */
+       case BFD_RELOC_64:
+         md_number_to_chars (where, value, 8);
+         break;
        default:
          as_bad_where (fixP->fx_file, fixP->fx_line,
                        _("internal error: can't install fix for reloc type %d (`%s')"),
This page took 0.023978 seconds and 4 git commands to generate.