* tc.h (struct relax_type, relax_typeS): Move from here..
[deliverable/binutils-gdb.git] / gas / config / tc-a29k.c
index 3100d2b58ac39cc116e843a39079143ec4424569..9e3fb44a0cb5e6beee643f4508d6eb4c46667873 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-a29k.c -- Assemble for the AMD 29000.
-   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2001
+   Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1998, 2000, 2001,
+   2002, 2005
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -61,6 +62,9 @@ static void machine_ip PARAMS ((char *str));
 static void s_data1 PARAMS ((void));
 static void s_use PARAMS ((int));
 #endif
+static void insert_sreg PARAMS ((char *, int));
+static void define_some_regs PARAMS ((void));
+static char *parse_operand PARAMS ((char *, expressionS *, int));
 
 const pseudo_typeS
 md_pseudo_table[] =
@@ -198,7 +202,7 @@ insert_sreg (regname, regnum)
 /* Install symbol definitions for assorted special registers.
    See ASM29K Ref page 2-9.  */
 
-void
+static void
 define_some_regs ()
 {
 #define SREG   256
@@ -360,7 +364,7 @@ md_assemble (str)
     }
 }
 
-char *
+static char *
 parse_operand (s, operandp, opt)
      char *s;
      expressionS *operandp;
@@ -784,10 +788,10 @@ md_number_to_chars (buf, val, n)
 void
 md_apply_fix3 (fixP, valP, seg)
      fixS *fixP;
-     valueT * valP;
+     valueT *valP;
      segT seg ATTRIBUTE_UNUSED;
 {
-  long val = * (long *) valP;
+  valueT val = *valP;
   char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
 
   fixP->fx_addnumber = val;    /* Remember value for emit_reloc.  */
@@ -813,7 +817,7 @@ md_apply_fix3 (fixP, valP, seg)
       break;
 
     case RELOC_WDISP30:
-      val = (val >>= 2) + 1;
+      val = (val >> 2) + 1;
       buf[0] |= (val >> 24) & 0x3f;
       buf[1] = (val >> 16);
       buf[2] = val >> 8;
@@ -837,7 +841,7 @@ md_apply_fix3 (fixP, valP, seg)
       break;
 
     case RELOC_WDISP22:
-      val = (val >>= 2) + 1;
+      val = (val >> 2) + 1;
       /* FALLTHROUGH */
     case RELOC_BASE22:
       buf[1] |= (val >> 16) & 0x3f;
@@ -861,9 +865,7 @@ md_apply_fix3 (fixP, valP, seg)
        }
       else if (fixP->fx_pcrel)
        {
-         long v = val >> 17;
-
-         if (v != 0 && v != -1)
+         if (val + 0x20000 > 0x3ffff)
            as_bad_where (fixP->fx_file, fixP->fx_line,
                          "call/jmp target out of range");
        }
@@ -925,9 +927,9 @@ tc_coff_fix2rtype (fixP)
 /* should never be called for 29k */
 void
 md_convert_frag (headers, seg, fragP)
-     object_headers *headers;
-     segT seg;
-     register fragS *fragP;
+     object_headers *headers ATTRIBUTE_UNUSED;
+     segT seg ATTRIBUTE_UNUSED;
+     register fragS *fragP ATTRIBUTE_UNUSED;
 {
   as_fatal (_("a29k_convert_frag\n"));
 }
@@ -935,70 +937,13 @@ md_convert_frag (headers, seg, fragP)
 /* should never be called for a29k */
 int
 md_estimate_size_before_relax (fragP, segtype)
-     register fragS *fragP;
-     segT segtype;
+     register fragS *fragP ATTRIBUTE_UNUSED;
+     segT segtype ATTRIBUTE_UNUSED;
 {
   as_fatal (_("a29k_estimate_size_before_relax\n"));
   return 0;
 }
 
-#if 0
-/* for debugging only */
-static void
-print_insn (insn)
-     struct machine_it *insn;
-{
-  char *Reloc[] =
-  {
-    "RELOC_8",
-    "RELOC_16",
-    "RELOC_32",
-    "RELOC_DISP8",
-    "RELOC_DISP16",
-    "RELOC_DISP32",
-    "RELOC_WDISP30",
-    "RELOC_WDISP22",
-    "RELOC_HI22",
-    "RELOC_22",
-    "RELOC_13",
-    "RELOC_LO10",
-    "RELOC_SFA_BASE",
-    "RELOC_SFA_OFF13",
-    "RELOC_BASE10",
-    "RELOC_BASE13",
-    "RELOC_BASE22",
-    "RELOC_PC10",
-    "RELOC_PC22",
-    "RELOC_JMP_TBL",
-    "RELOC_SEGOFF16",
-    "RELOC_GLOB_DAT",
-    "RELOC_JMP_SLOT",
-    "RELOC_RELATIVE",
-    "NO_RELOC"
-  };
-
-  if (insn->error)
-    {
-      fprintf (stderr, "ERROR: %s\n");
-    }
-  fprintf (stderr, "opcode=0x%08x\n", insn->opcode);
-  fprintf (stderr, "reloc = %s\n", Reloc[insn->reloc]);
-  fprintf (stderr, "exp =  {\n");
-  fprintf (stderr, "\t\tX_add_symbol = %s\n",
-          insn->exp.X_add_symbol ?
-          (S_GET_NAME (insn->exp.X_add_symbol) ?
-           S_GET_NAME (insn->exp.X_add_symbol) : "???") : "0");
-  fprintf (stderr, "\t\tX_op_symbol = %s\n",
-          insn->exp.X_op_symbol ?
-          (S_GET_NAME (insn->exp.X_op_symbol) ?
-           S_GET_NAME (insn->exp.X_op_symbol) : "???") : "0");
-  fprintf (stderr, "\t\tX_add_number = %d\n",
-          insn->exp.X_add_number);
-  fprintf (stderr, "}\n");
-}
-
-#endif
-
 /* Translate internal representation of relocation info to target format.
 
    On sparc/29k: first 4 bytes are normal unsigned long address, next three
@@ -1038,7 +983,7 @@ tc_aout_fix_to_chars (where, fixP, segment_address_in_file)
 
 #endif /* OBJ_AOUT */
 \f
-CONST char *md_shortopts = "";
+const char *md_shortopts = "";
 struct option md_longopts[] = {
   {NULL, no_argument, NULL, 0}
 };
@@ -1046,15 +991,15 @@ size_t md_longopts_size = sizeof (md_longopts);
 
 int
 md_parse_option (c, arg)
-     int c;
-     char *arg;
+     int c ATTRIBUTE_UNUSED;
+     char *arg ATTRIBUTE_UNUSED;
 {
   return 0;
 }
 
 void
 md_show_usage (stream)
-     FILE *stream;
+     FILE *stream ATTRIBUTE_UNUSED;
 {
 }
 \f
@@ -1277,7 +1222,7 @@ md_operand (expressionP)
 /* Round up a section size to the appropriate boundary.  */
 valueT
 md_section_align (segment, size)
-     segT segment;
+     segT segment ATTRIBUTE_UNUSED;
      valueT size;
 {
   return size;                 /* Byte alignment is fine */
This page took 0.026106 seconds and 4 git commands to generate.