* config/tc-ppc.h (struct _ppc_fix_extra): New.
[deliverable/binutils-gdb.git] / gas / config / tc-mn10200.c
index d348a2c45d81b5f7b2f20c815ab929211e27c92d..fa78d53da3015318c88721ae607b70621c4098ba 100644 (file)
@@ -1,12 +1,12 @@
 /* tc-mn10200.c -- Assembler code for the Matsushita 10200
    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005  Free Software Foundation, Inc.
+   2005, 2006, 2007  Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -19,7 +19,6 @@
    the Free Software Foundation, 51 Franklin Street - Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-#include <stdio.h>
 #include "as.h"
 #include "safe-ctype.h"
 #include "subsegs.h"
@@ -322,39 +321,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 char *
 md_atof (int type, char *litp, int *sizep)
 {
-  int prec;
-  LITTLENUM_TYPE words[4];
-  char *t;
-  int i;
-
-  switch (type)
-    {
-    case 'f':
-      prec = 2;
-      break;
-
-    case 'd':
-      prec = 4;
-      break;
-
-    default:
-      *sizep = 0;
-      return _("bad call to md_atof");
-    }
-
-  t = atof_ieee (input_line_pointer, type, words);
-  if (t)
-    input_line_pointer = t;
-
-  *sizep = prec * 2;
-
-  for (i = prec - 1; i >= 0; i--)
-    {
-      md_number_to_chars (litp, (valueT) words[i], 2);
-      litp += 2;
-    }
-
-  return NULL;
+  return ieee_md_atof (type, litp, sizep, FALSE);
 }
 
 void
@@ -738,7 +705,7 @@ md_begin (void)
       op++;
     }
 
-  /* This is both a simplification (we don't have to write md_apply_fix3)
+  /* This is both a simplification (we don't have to write md_apply_fix)
      and support for future optimizations (branch shortening and similar
      stuff in the linker.  */
   linkrelax = 1;
@@ -847,7 +814,7 @@ md_pcrel_from (fixS *fixp)
 }
 
 void
-md_apply_fix3 (fixS * fixP, valueT * valP ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED)
+md_apply_fix (fixS * fixP, valueT * valP ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED)
 {
   /* We shouldn't ever get here because linkrelax is nonzero.  */
   abort ();
@@ -1191,6 +1158,18 @@ keep_going:
   /* Write out the instruction.  */
   if (relaxable && fc > 0)
     {
+      /* On a 64-bit host the size of an 'int' is not the same
+        as the size of a pointer, so we need a union to convert
+        the opindex field of the fr_cgen structure into a char *
+        so that it can be stored in the frag.  We do not have
+        to worry about loosing accuracy as we are not going to
+        be even close to the 32bit limit of the int.  */
+      union
+      {
+       int opindex;
+       char * ptr;
+      }
+      opindex_converter;
       int type;
 
       /* bCC  */
@@ -1218,10 +1197,11 @@ keep_going:
       else
        type = 3;
 
+      opindex_converter.opindex = fixups[0].opindex;
       f = frag_var (rs_machine_dependent, 8, 8 - size, type,
                    fixups[0].exp.X_add_symbol,
                    fixups[0].exp.X_add_number,
-                   (char *)fixups[0].opindex);
+                   opindex_converter.ptr);
       number_to_chars_bigendian (f, insn, size);
       if (8 - size > 4)
        {
This page took 0.02476 seconds and 4 git commands to generate.