remove some duplicate #include's.
[deliverable/binutils-gdb.git] / gas / config / tc-m32r.c
index 83f0853e4aeaa45dea52836abbbccf73a7267c3a..bec2a8ced1acd94a68f3a77f514fc4bb1d029ff0 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-m32r.c -- Assembler for the Renesas M32R.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -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"
@@ -120,7 +119,7 @@ static int warn_explicit_parallel_conflicts = 1;
 static int ignore_parallel_conflicts = 0;
 
 /* Non-zero if insns can be made parallel.  */
-static int use_parallel = 1;
+static int use_parallel = 0;
 
 /* Non-zero if optimizations should be performed.  */
 static int optimize;
@@ -479,7 +478,7 @@ m32r_check_fixup (expressionS *main_exp, bfd_reloc_code_real_type *r_type_p)
         return 0;
     }
 
-  if (exp->X_op == O_PIC_reloc || exp->X_md != BFD_RELOC_UNUSED)
+  if (exp->X_op == O_PIC_reloc)
     {
       *r_type_p = exp->X_md;
       if (exp == main_exp)
@@ -2258,6 +2257,17 @@ tc_gen_reloc (asection * section, fixS * fixP)
   reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
   *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
   reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+
+  if (fixP->fx_pcrel)
+    {
+      if (fixP->fx_r_type == BFD_RELOC_32)
+        fixP->fx_r_type = BFD_RELOC_32_PCREL;
+      else if (fixP->fx_r_type == BFD_RELOC_16)
+       {
+          fixP->fx_r_type = BFD_RELOC_16_PCREL;
+          bfd_set_error (bfd_error_bad_value);
+       }
+    }
  
   code = fixP->fx_r_type;
   if (pic_code)
@@ -2327,7 +2337,8 @@ printf(" => %s\n",reloc->howto->name);
  
   /* Use fx_offset for these cases.  */
   if (   fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
+      || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+      || fixP->fx_r_type == BFD_RELOC_32_PCREL)
     reloc->addend  = fixP->fx_offset;
   else if ((!pic_code
             && code != BFD_RELOC_M32R_26_PLTREL)
@@ -2358,7 +2369,10 @@ m32r_end_of_match (char *cont, char *what)
 }
 
 int
-m32r_parse_name (char const *name, expressionS *exprP, char *nextcharP)
+m32r_parse_name (char const *name,
+                expressionS *exprP,
+                enum expr_mode mode,
+                char *nextcharP)
 {
   char *next = input_line_pointer;
   char *next_end;
@@ -2379,13 +2393,13 @@ m32r_parse_name (char const *name, expressionS *exprP, char *nextcharP)
       /* If we have an absolute symbol or a
         reg, then we know its value now.  */
       segment = S_GET_SEGMENT (exprP->X_add_symbol);
-      if (segment == absolute_section)
+      if (mode != expr_defer && segment == absolute_section)
        {
          exprP->X_op = O_constant;
          exprP->X_add_number = S_GET_VALUE (exprP->X_add_symbol);
          exprP->X_add_symbol = NULL;
        }
-      else if (segment == reg_section)
+      else if (mode != expr_defer && segment == reg_section)
        {
          exprP->X_op = O_register;
          exprP->X_add_number = S_GET_VALUE (exprP->X_add_symbol);
This page took 0.027812 seconds and 4 git commands to generate.