* elf32-arm.c (elf32_arm_modify_segment_map): New function.
[deliverable/binutils-gdb.git] / gas / config / tc-w65.c
index 24247ae9ad0193be9dec8f7edfa30a228d71db86..f290354cd3a39144338728bdc90ddad47d1b3fd5 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-w65.c -- Assemble code for the W65816
-   Copyright 1995, 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1995, 1998, 2000, 2001, 2002, 2005
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
 #include "subsegs.h"
 #define DEFINE_TABLE
 #include "../opcodes/w65-opc.h"
-#include <ctype.h>
 
 const char comment_chars[] = "!";
-CONST char line_separator_chars[] = ";";
+const char line_separator_chars[] = ";";
 const char line_comment_chars[] = "!#";
 
 /* This table describes all the machine specific pseudo-ops the assembler
@@ -50,7 +50,12 @@ const char line_comment_chars[] = "!#";
 #define OP_BVC 0x50
 #define OP_BVS 0x70
 
-void s_longa ();
+static void s_longa PARAMS ((int));
+static char *parse_exp PARAMS ((char *));
+static char *get_operands PARAMS ((const struct opinfo *, char *));
+static const struct opinfo *get_specific PARAMS ((const struct opinfo *));
+static void build_Mytes PARAMS ((const struct opinfo *));
+
 
 const pseudo_typeS md_pseudo_table[] = {
   {"int", cons, 2},
@@ -60,15 +65,6 @@ const pseudo_typeS md_pseudo_table[] = {
   {0, 0, 0}
 };
 
-void cons ();
-void s_align_bytes ();
-
-#if 0
-int md_reloc_size;
-#endif
-
-static int relax;              /* set if -relax seen */
-
 const char EXP_CHARS[] = "eE";
 
 /* Chars that mean this number is a floating point constant.  */
@@ -125,8 +121,9 @@ relax_typeS md_relax_table[C (END, 0)] = {
    should set up all the tables, etc that the MD part of the assembler
    needs.  */
 
-void
+static void
 s_longa (xmode)
+     int xmode;
 {
   int *p = xmode ? &X : &M;
   while (*input_line_pointer == ' ')
@@ -149,7 +146,7 @@ s_longa (xmode)
 void
 md_begin ()
 {
-  struct opinfo *opcode;
+  const struct opinfo *opcode;
   char *prev_name = "";
 
   opcode_hash_control = hash_new ();
@@ -162,12 +159,6 @@ md_begin ()
          prev_name = opcode->name;
          hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
        }
-      else
-       {
-         /* Make all the opcodes with the same name point to the same
-            string.  */
-         opcode->name = prev_name;
-       }
     }
 
   flag_signed_overflow_ok = 1;
@@ -175,30 +166,13 @@ md_begin ()
 
 static expressionS immediate;  /* absolute expression */
 static expressionS immediate1; /* absolute expression */
-
-static symbolS *
-dot ()
-{
-  const char *fake;
-
-  /* JF: '.' is pseudo symbol with value of current location
-     in current segment.  */
-  fake = FAKE_LABEL_NAME;
-  return symbol_new (fake,
-                    now_seg,
-                    (valueT) frag_now_fix (),
-                    frag_now);
-
-}
-
 int expr_size;
 int expr_shift;
 int tc_cons_reloc;
 
 void
-w65_expression (dest, bytes)
+w65_expression (dest)
      expressionS *dest;
-     unsigned int bytes;
 {
   expr_size = 0;
   expr_shift = 0;
@@ -228,16 +202,15 @@ w65_expression (dest, bytes)
 int amode;
 
 static char *
-parse_exp (s, bytes)
+parse_exp (s)
      char *s;
-     int bytes;
 {
   char *save;
   char *new;
 
   save = input_line_pointer;
   input_line_pointer = s;
-  w65_expression (&immediate, bytes);
+  w65_expression (&immediate);
   if (immediate.X_op == O_absent)
     as_bad (_("missing operand"));
   new = input_line_pointer;
@@ -247,7 +220,7 @@ parse_exp (s, bytes)
 
 static char *
 get_operands (info, ptr)
-     struct opinfo *info;
+     const struct opinfo *info;
      char *ptr;
 {
   register int override_len = 0;
@@ -475,7 +448,7 @@ get_operands (info, ptr)
     }
   else
     {
-      ptr = parse_exp (ptr, 2);
+      ptr = parse_exp (ptr);
       if (ptr[0] == ',')
        {
          if (ptr[1] == 'y')
@@ -592,9 +565,9 @@ get_operands (info, ptr)
    addressing modes, return the opcode which matches the opcodes
    provided.  */
 
-static struct opinfo *
+static const struct opinfo *
 get_specific (opcode)
-     struct opinfo *opcode;
+     const struct opinfo *opcode;
 {
   int ocode = opcode->code;
 
@@ -606,28 +579,11 @@ get_specific (opcode)
   return 0;
 }
 
-int
-check (operand, low, high)
-     expressionS *operand;
-     int low;
-     int high;
-{
-  if (operand->X_op != O_constant
-      || operand->X_add_number < low
-      || operand->X_add_number > high)
-    {
-      as_bad ("operand must be absolute in range %d..%d", low, high);
-    }
-  return operand->X_add_number;
-}
-
-static int log2[] = { 0, 0, 1, 0, 2 };
-
 /* Now we know what sort of opcodes it is, let's build the bytes.  */
 
 static void
 build_Mytes (opcode)
-     struct opinfo *opcode;
+     const struct opinfo *opcode;
 {
   int size;
   int type;
@@ -657,6 +613,8 @@ build_Mytes (opcode)
       switch (opcode->amode)
        {
          GETINFO (size, type, pcrel);
+       default:
+         abort ();
        }
 
       /* If something special was done in the expression modify the
@@ -708,12 +666,8 @@ void
 md_assemble (str)
      char *str;
 {
-  unsigned char *op_start;
-  unsigned char *op_end;
-  struct opinfo *opcode;
+  const struct opinfo *opcode;
   char name[20];
-  int nlen = 0;
-  char *p;
 
   /* Drop leading whitespace */
   while (*str == ' ')
@@ -757,27 +711,13 @@ md_assemble (str)
   build_Mytes (opcode);
 }
 
-void
-tc_crawl_symbol_chain (headers)
-     object_headers *headers;
-{
-  printf (_("call to tc_crawl_symbol_chain \n"));
-}
-
 symbolS *
 md_undefined_symbol (name)
-     char *name;
+     char *name ATTRIBUTE_UNUSED;
 {
   return 0;
 }
 
-void
-tc_headers_hook (headers)
-     object_headers *headers;
-{
-  printf (_("call to tc_headers_hook \n"));
-}
-
 /* Various routines to kill one day.  */
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
@@ -797,7 +737,6 @@ md_atof (type, litP, sizeP)
   LITTLENUM_TYPE words[MAX_LITTLENUMS];
   LITTLENUM_TYPE *wordP;
   char *t;
-  char *atof_ieee ();
 
   switch (type)
     {
@@ -844,17 +783,10 @@ md_atof (type, litP, sizeP)
 
 int
 md_parse_option (c, a)
-     int c;
-     char *a;
-{
-  return 1;
-}
-
-void
-tc_Nout_fix_to_chars ()
+     int c ATTRIBUTE_UNUSED;
+     char *a ATTRIBUTE_UNUSED;
 {
-  printf (_("call to tc_Nout_fix_to_chars \n"));
-  abort ();
+  return 0;
 }
 
 /* Called after relaxing, change the frags so they know how big they
@@ -862,8 +794,8 @@ tc_Nout_fix_to_chars ()
 
 void
 md_convert_frag (headers, seg, fragP)
-     object_headers *headers;
-     segT seg;
+     object_headers *headers ATTRIBUTE_UNUSED;
+     segT seg ATTRIBUTE_UNUSED;
      fragS *fragP;
 {
   int disp_size = 0;
@@ -963,7 +895,7 @@ md_convert_frag (headers, seg, fragP)
                       fragP->fr_offset);
       int disp = targ_addr - next_inst;
 
-      md_number_to_chars (buffer + inst_size, disp, disp_size);
+      md_number_to_chars ((char *) buffer + inst_size, disp, disp_size);
       fragP->fr_fix += disp_size + inst_size;
       fragP->fr_var = 0;
     }
@@ -979,10 +911,12 @@ md_section_align (seg, size)
 }
 
 void
-md_apply_fix (fixP, val)
+md_apply_fix3 (fixP, valP, seg)
      fixS *fixP;
-     long val;
+     valueT * valP;
+     segT seg ATTRIBUTE_UNUSED;
 {
+  long val = * (long *) valP;
   char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
   int addr = fixP->fx_frag->fr_address + fixP->fx_where;
 
@@ -1031,9 +965,12 @@ md_apply_fix (fixP, val)
     default:
       abort ();
     }
+
+  if (fixP->fx_addsy == NULL && fixP->fx_pcrel == 0)
+    fixP->fx_done = 1;
 }
 
-/* Put number into target byte order */
+/* Put number into target byte order */
 
 void
 md_number_to_chars (ptr, use, nbytes)
@@ -1054,7 +991,7 @@ md_pcrel_from (fixP)
 
 void
 tc_coff_symbol_emit_hook (x)
-     symbolS *x;
+     symbolS *x ATTRIBUTE_UNUSED;
 {
 }
 
@@ -1182,7 +1119,7 @@ md_estimate_size_before_relax (fragP, segment_type)
   return fragP->fr_var;
 }
 
-CONST char *md_shortopts = "";
+const char *md_shortopts = "";
 struct option md_longopts[] = {
 #define OPTION_RELAX (OPTION_MD_BASE)
   {NULL, no_argument, NULL, 0}
@@ -1190,7 +1127,7 @@ struct option md_longopts[] = {
 
 void
 md_show_usage (stream)
-     FILE *stream;
+     FILE *stream ATTRIBUTE_UNUSED;
 {
 }
 
This page took 0.043388 seconds and 4 git commands to generate.