* m10300-opc.c, m10300-dis.c: Add am33 support.
[deliverable/binutils-gdb.git] / gas / read.c
index 003dd6c9df6aaea251caefaf6c1e5450ea6c3740..b64203b5959a037fa919640e15799ba61ad07ead 100644 (file)
@@ -1,5 +1,5 @@
 /* read.c - read a source file -
-   Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+   Copyright (C) 1986, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -89,6 +89,10 @@ die horribly;
 #define LEX_QM 0
 #endif
 
+#ifndef LEX_HASH
+#define LEX_HASH 0
+#endif
+
 #ifndef LEX_DOLLAR
 /* The a29k assembler does not permits labels to start with $.  */
 #define LEX_DOLLAR 3
@@ -104,19 +108,20 @@ char lex_type[256] =
 {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* @ABCDEFGHIJKLMNO */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,      /* PQRSTUVWXYZ[\]^_ */
-  0, 0, 0, 0, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
+  0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, LEX_QM, /* 0123456789:;<=>? */
   LEX_AT, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* @ABCDEFGHIJKLMNO */
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, 0, 3, /* PQRSTUVWXYZ[\]^_ */
   0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,      /* `abcdefghijklmno */
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, LEX_BR, 0, LEX_BR, LEX_TILDE, 0, /* pqrstuvwxyz{|}~. */
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
 };
 
 
@@ -207,10 +212,18 @@ static int dwarf_file_string;
 #endif
 
 static void cons_worker PARAMS ((int, int));
-static int scrub_from_string PARAMS ((char **));
+static int scrub_from_string PARAMS ((char *, int));
 static void do_align PARAMS ((int, char *, int, int));
 static void s_align PARAMS ((int, int));
+static void s_lcomm_internal PARAMS ((int, int));
 static int hex_float PARAMS ((int, char *));
+static inline int sizeof_sleb128 PARAMS ((offsetT));
+static inline int sizeof_uleb128 PARAMS ((valueT));
+static inline int output_sleb128 PARAMS ((char *, offsetT));
+static inline int output_uleb128 PARAMS ((char *, valueT));
+static inline int output_big_sleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static inline int output_big_uleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static int output_big_leb128 PARAMS ((char *, LITTLENUM_TYPE *, int, int));
 static void do_org PARAMS ((segT, expressionS *, int));
 char *demand_copy_string PARAMS ((int *lenP));
 static segT get_segmented_expression PARAMS ((expressionS *expP));
@@ -218,7 +231,6 @@ static segT get_known_segmented_expression PARAMS ((expressionS * expP));
 static void pobegin PARAMS ((void));
 static int get_line_sb PARAMS ((sb *));
 static void generate_file_debug PARAMS ((void));
-static void generate_lineno_debug PARAMS ((void));
 \f
 
 void
@@ -407,7 +419,7 @@ static const pseudo_typeS potable[] =
   {"xstabs", s_xstab, 's'},
   {"word", cons, 2},
   {"zero", s_space, 0},
-  {NULL                      /* end sentinel */
+  {NULL, NULL, 0}                      /* end sentinel */
 };
 
 static int pop_override_ok = 0;
@@ -472,15 +484,18 @@ static char *scrub_string;
 static char *scrub_string_end;
 
 static int
-scrub_from_string (from)
-     char **from;
+scrub_from_string (buf, buflen)
+     char *buf;
+     int buflen;
 {
-  int size;
-
-  *from = scrub_string;
-  size = scrub_string_end - scrub_string;
-  scrub_string = scrub_string_end;
-  return size;
+  int copy;
+
+  copy = scrub_string_end - scrub_string;
+  if (copy > buflen)
+    copy = buflen;
+  memcpy (buf, scrub_string, copy);
+  scrub_string += copy;
+  return copy;
 }
 
 /*     read_a_source_file()
@@ -780,7 +795,7 @@ read_a_source_file (name)
                          mri_pending_align = 0;
                          if (line_label != NULL)
                            {
-                             line_label->sy_frag = frag_now;
+                             symbol_set_frag (line_label, frag_now);
                              S_SET_VALUE (line_label, frag_now_fix ());
                            }
                        }
@@ -815,6 +830,9 @@ read_a_source_file (name)
                  else
                    {
                      int inquote = 0;
+#ifdef QUOTES_IN_INSN
+                     int inescape = 0;
+#endif
 
                      /* WARNING: c has char, which may be end-of-line. */
                      /* Also: input_line_pointer->`\0` where c was. */
@@ -828,6 +846,14 @@ read_a_source_file (name)
                        {
                          if (flag_m68k_mri && *input_line_pointer == '\'')
                            inquote = ! inquote;
+#ifdef QUOTES_IN_INSN
+                         if (inescape)
+                           inescape = 0;
+                         else if (*input_line_pointer == '"')
+                           inquote = ! inquote;
+                         else if (*input_line_pointer == '\\')
+                           inescape = 1;
+#endif
                          input_line_pointer++;
                        }
 
@@ -861,7 +887,7 @@ read_a_source_file (name)
                          mri_pending_align = 0;
                          if (line_label != NULL)
                            {
-                             line_label->sy_frag = frag_now;
+                             symbol_set_frag (line_label, frag_now);
                              S_SET_VALUE (line_label, frag_now_fix ());
                            }
                        }
@@ -1121,7 +1147,7 @@ mri_comment_end (stop, stopc)
 
 void 
 s_abort (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   as_fatal (_(".abort detected.  Abandoning ship."));
 }
@@ -1147,21 +1173,7 @@ do_align (n, fill, len, max)
 
   if (fill == NULL)
     {
-      int maybe_text;
-
-#ifdef BFD_ASSEMBLER
-      if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
-       maybe_text = 1;
-      else
-       maybe_text = 0;
-#else
-      if (now_seg != data_section && now_seg != bss_section)
-       maybe_text = 1;
-      else
-       maybe_text = 0;
-#endif
-
-      if (maybe_text)
+      if (subseg_text_p (now_seg))
        default_fill = NOP_OPCODE;
       else
        default_fill = 0;
@@ -1297,10 +1309,10 @@ s_align (arg, bytes_p)
        }
     }
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 /* Handle the .align pseudo-op on machines where ".align 4" means
@@ -1325,7 +1337,7 @@ s_align_ptwo (arg)
 
 void 
 s_comm (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register char *name;
   register char c;
@@ -1347,18 +1359,18 @@ s_comm (ignore)
   if (*input_line_pointer != ',')
     {
       as_bad (_("Expected comma after symbol-name: rest of line ignored."));
+      ignore_rest_of_line ();
       if (flag_mri)
        mri_comment_end (stop, stopc);
-      ignore_rest_of_line ();
       return;
     }
   input_line_pointer++;                /* skip ',' */
   if ((temp = get_absolute_expression ()) < 0)
     {
       as_warn (_(".COMMon length (%ld.) <0! Ignored."), (long) temp);
+      ignore_rest_of_line ();
       if (flag_mri)
        mri_comment_end (stop, stopc);
-      ignore_rest_of_line ();
       return;
     }
   *p = 0;
@@ -1368,9 +1380,9 @@ s_comm (ignore)
     {
       as_bad (_("Ignoring attempt to re-define symbol `%s'."),
              S_GET_NAME (symbolP));
+      ignore_rest_of_line ();
       if (flag_mri)
        mri_comment_end (stop, stopc);
-      ignore_rest_of_line ();
       return;
     }
   if (S_GET_VALUE (symbolP))
@@ -1395,10 +1407,10 @@ s_comm (ignore)
 #endif /* not OBJ_VMS */
   know (symbolP->sy_frag == &zero_address_frag);
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }                              /* s_comm() */
 
 /* The MRI COMMON pseudo-op.  We handle this by creating a common
@@ -1407,7 +1419,7 @@ s_comm (ignore)
 
 void
 s_mri_common (small)
-     int small;
+     int small ATTRIBUTE_UNUSED;
 {
   char *name;
   char c;
@@ -1466,8 +1478,8 @@ s_mri_common (small)
   if (S_IS_DEFINED (sym) && ! S_IS_COMMON (sym))
     {
       as_bad (_("attempt to re-define symbol `%s'"), S_GET_NAME (sym));
-      mri_comment_end (stop, stopc);
       ignore_rest_of_line ();
+      mri_comment_end (stop, stopc);
       return;
     }
 
@@ -1481,10 +1493,12 @@ s_mri_common (small)
 
   if (line_label != NULL)
     {
-      line_label->sy_value.X_op = O_symbol;
-      line_label->sy_value.X_add_symbol = sym;
-      line_label->sy_value.X_add_number = S_GET_VALUE (sym);
-      line_label->sy_frag = &zero_address_frag;
+      expressionS exp;
+      exp.X_op = O_symbol;
+      exp.X_add_symbol = sym;
+      exp.X_add_number = 0;
+      symbol_set_value_expression (line_label, &exp);
+      symbol_set_frag (line_label, &zero_address_frag);
       S_SET_SEGMENT (line_label, expr_section);
     }
 
@@ -1497,14 +1511,14 @@ s_mri_common (small)
   if (*input_line_pointer == ',')
     input_line_pointer += 2;
 
-  mri_comment_end (stop, stopc);
-
   demand_empty_rest_of_line ();
+
+  mri_comment_end (stop, stopc);
 }
 
 void
 s_data (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   segT section;
   register int temp;
@@ -1578,7 +1592,7 @@ s_app_file (appfile)
 
 void
 s_app_line (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int l;
 
@@ -1604,7 +1618,7 @@ s_app_line (ignore)
 
 void
 s_end (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (flag_mri)
     {
@@ -1622,7 +1636,7 @@ s_end (ignore)
 
 void
 s_err (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   as_bad (_(".err encountered"));
   demand_empty_rest_of_line ();
@@ -1632,7 +1646,7 @@ s_err (ignore)
 
 void
 s_fail (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   offsetT temp;
   char *stop = NULL;
@@ -1647,15 +1661,15 @@ s_fail (ignore)
   else
     as_bad (_(".fail %ld encountered"), (long) temp);
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 void 
 s_fill (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   expressionS rep_exp;
   long size = 1;
@@ -1752,7 +1766,7 @@ s_fill (ignore)
 
 void 
 s_globl (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
@@ -1768,9 +1782,11 @@ s_globl (ignore)
       name = input_line_pointer;
       c = get_symbol_end ();
       symbolP = symbol_find_or_make (name);
+      S_SET_EXTERNAL (symbolP);
+
       *input_line_pointer = c;
       SKIP_WHITESPACE ();
-      S_SET_EXTERNAL (symbolP);
+      c = *input_line_pointer;
       if (c == ',')
        {
          input_line_pointer++;
@@ -1781,10 +1797,10 @@ s_globl (ignore)
     }
   while (c == ',');
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 /* Handle the MRI IRP and IRPC pseudo-ops.  */
@@ -1825,7 +1841,7 @@ s_irp (irpc)
 
 void
 s_linkonce (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   enum linkonce_type type;
 
@@ -2056,9 +2072,9 @@ s_lcomm_internal (needs_align, bytes_p)
        frag_align (align, 0, 0);
                                        /* detach from old frag */
       if (S_GET_SEGMENT (symbolP) == bss_seg)
-       symbolP->sy_frag->fr_symbol = NULL;
+       symbol_get_frag (symbolP)->fr_symbol = NULL;
 
-      symbolP->sy_frag = frag_now;
+      symbol_set_frag (symbolP, frag_now);
       pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
                        (offsetT) temp, (char *) 0);
       *pfrag = 0;
@@ -2103,7 +2119,7 @@ void s_lcomm_bytes (needs_align)
 
 void 
 s_lsym (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register char *name;
   register char c;
@@ -2225,7 +2241,7 @@ get_line_sb (line)
 
 void
 s_macro (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *file;
   unsigned int line;
@@ -2253,7 +2269,7 @@ s_macro (ignore)
        {
          S_SET_SEGMENT (line_label, undefined_section);
          S_SET_VALUE (line_label, 0);
-         line_label->sy_frag = &zero_address_frag;
+         symbol_set_frag (line_label, &zero_address_frag);
        }
 
       if (((flag_m68k_mri
@@ -2277,7 +2293,7 @@ s_macro (ignore)
 
 void
 s_mexit (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   cond_exit_macro (macro_nest);
   buffer_limit = input_scrub_next_buffer (&input_line_pointer);
@@ -2287,7 +2303,7 @@ s_mexit (ignore)
 
 void
 s_mri (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int on, old_flag;
 
@@ -2355,7 +2371,7 @@ do_org (segment, exp, fill)
 
 void 
 s_org (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register segT segment;
   expressionS exp;
@@ -2411,7 +2427,7 @@ s_org (ignore)
 
 void
 s_mri_sect (type)
-     char *type;
+     char *type ATTRIBUTE_UNUSED;
 {
 #ifdef TC_M68K
 
@@ -2575,7 +2591,7 @@ s_mri_sect (type)
 
 void
 s_print (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *s;
   int len;
@@ -2589,7 +2605,7 @@ s_print (ignore)
 
 void
 s_purgem (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   if (is_it_end_of_statement ())
     {
@@ -2619,7 +2635,7 @@ s_purgem (ignore)
 
 void
 s_rept (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   int count;
   sb one;
@@ -2775,9 +2791,12 @@ s_space (mult)
              S_SET_VALUE (mri_common_symbol, val + 1);
              if (line_label != NULL)
                {
-                 know (line_label->sy_value.X_op == O_symbol);
-                 know (line_label->sy_value.X_add_symbol == mri_common_symbol);
-                 line_label->sy_value.X_add_number += 1;
+                 expressionS *symexp;
+
+                 symexp = symbol_get_value_expression (line_label);
+                 know (symexp->X_op == O_symbol);
+                 know (symexp->X_add_symbol == mri_common_symbol);
+                 symexp->X_add_number += 1;
                }
            }
        }
@@ -2786,7 +2805,7 @@ s_space (mult)
          do_align (1, (char *) NULL, 0, 0);
          if (line_label != NULL)
            {
-             line_label->sy_frag = frag_now;
+             symbol_set_frag (line_label, frag_now);
              S_SET_VALUE (line_label, frag_now_fix ());
            }
        }
@@ -2895,10 +2914,10 @@ s_space (mult)
   if (flag_mri && (bytes & 1) != 0)
     mri_pending_align = 1;
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 /* This is like s_space, but the value is a floating point number with
@@ -2924,9 +2943,9 @@ s_float_space (float_type)
   if (*input_line_pointer != ',')
     {
       as_bad (_("missing value"));
+      ignore_rest_of_line ();
       if (flag_mri)
        mri_comment_end (stop, stopc);
-      ignore_rest_of_line ();
       return;
     }
 
@@ -2947,9 +2966,9 @@ s_float_space (float_type)
       flen = hex_float (float_type, temp);
       if (flen < 0)
        {
+         ignore_rest_of_line ();
          if (flag_mri)
            mri_comment_end (stop, stopc);
-         ignore_rest_of_line ();
          return;
        }
     }
@@ -2963,9 +2982,9 @@ s_float_space (float_type)
       if (err)
        {
          as_bad (_("Bad floating literal: %s"), err);
+         ignore_rest_of_line ();
          if (flag_mri)
            mri_comment_end (stop, stopc);
-         ignore_rest_of_line ();
          return;
        }
     }
@@ -2978,17 +2997,17 @@ s_float_space (float_type)
       memcpy (p, temp, (unsigned int) flen);
     }
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 /* Handle the .struct pseudo-op, as found in MIPS assemblers.  */
 
 void
 s_struct (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *stop = NULL;
   char stopc;
@@ -2997,14 +3016,14 @@ s_struct (ignore)
     stop = mri_comment_field (&stopc);
   abs_section_offset = get_absolute_expression ();
   subseg_set (absolute_section, 0);
+  demand_empty_rest_of_line ();
   if (flag_mri)
     mri_comment_end (stop, stopc);
-  demand_empty_rest_of_line ();
 }
 
 void
 s_text (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   register int temp;
 
@@ -3053,6 +3072,18 @@ ignore_rest_of_line ()           /* For suspect lines: gives warning. */
   know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
 }
 
+void
+discard_rest_of_line ()
+{
+  while (input_line_pointer < buffer_limit
+         && !is_end_of_line[(unsigned char) *input_line_pointer])
+    {
+      input_line_pointer++;
+    }
+  input_line_pointer++;         /* Return pointing just after end-of-line. */
+  know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
+}
+
 /*
  *                     pseudo_set()
  *
@@ -3094,7 +3125,8 @@ pseudo_set (symbolP)
           && (S_GET_SEGMENT (exp.X_add_symbol)
               == S_GET_SEGMENT (exp.X_op_symbol))
           && SEG_NORMAL (S_GET_SEGMENT (exp.X_add_symbol))
-          && exp.X_add_symbol->sy_frag == exp.X_op_symbol->sy_frag)
+          && (symbol_get_frag (exp.X_add_symbol)
+              == symbol_get_frag (exp.X_op_symbol)))
     {
       exp.X_op = O_constant;
       exp.X_add_number = (S_GET_VALUE (exp.X_add_symbol)
@@ -3118,19 +3150,21 @@ pseudo_set (symbolP)
 #endif /* OBJ_AOUT or OBJ_BOUT */
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
       if (exp.X_op != O_constant)
-        symbolP->sy_frag = &zero_address_frag;
+        symbol_set_frag (symbolP, &zero_address_frag);
       break;
 
     case O_register:
       S_SET_SEGMENT (symbolP, reg_section);
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
-      symbolP->sy_frag = &zero_address_frag;
+      symbol_set_frag (symbolP, &zero_address_frag);
       break;
 
     case O_symbol:
       if (S_GET_SEGMENT (exp.X_add_symbol) == undefined_section
          || exp.X_add_number != 0)
-       symbolP->sy_value = exp;
+       symbol_set_value_expression (symbolP, &exp);
+      else if (symbol_section_p (symbolP))
+       as_bad ("invalid attempt to set value of section symbol");
       else
        {
          symbolS *s = exp.X_add_symbol;
@@ -3144,7 +3178,7 @@ pseudo_set (symbolP)
 #endif /* OBJ_AOUT or OBJ_BOUT */
          S_SET_VALUE (symbolP,
                       exp.X_add_number + S_GET_VALUE (s));
-         symbolP->sy_frag = s->sy_frag;
+         symbol_set_frag (symbolP, symbol_get_frag (s));
          copy_symbol_attributes (symbolP, s);
        }
       break;
@@ -3152,7 +3186,7 @@ pseudo_set (symbolP)
     default:
       /* The value is some complex expression.
         FIXME: Should we set the segment to anything?  */
-      symbolP->sy_value = exp;
+      symbol_set_value_expression (symbolP, &exp);
       break;
     }
 }
@@ -3225,9 +3259,9 @@ cons_worker (nbytes, rva)
 
   if (is_it_end_of_statement ())
     {
+      demand_empty_rest_of_line ();
       if (flag_mri)
        mri_comment_end (stop, stopc);
-      demand_empty_rest_of_line ();
       return;
     }
 
@@ -3263,10 +3297,10 @@ cons_worker (nbytes, rva)
 
   input_line_pointer--;                /* Put terminator back into stream. */
 
+  demand_empty_rest_of_line ();
+
   if (flag_mri)
     mri_comment_end (stop, stopc);
-
-  demand_empty_rest_of_line ();
 }
 
 
@@ -3381,13 +3415,13 @@ emit_expr (exp, nbytes)
   /* Handle a negative bignum.  */
   if (op == O_uminus
       && exp->X_add_number == 0
-      && exp->X_add_symbol->sy_value.X_op == O_big
-      && exp->X_add_symbol->sy_value.X_add_number > 0)
+      && symbol_get_value_expression (exp->X_add_symbol)->X_op == O_big
+      && symbol_get_value_expression (exp->X_add_symbol)->X_add_number > 0)
     {
       int i;
       unsigned long carry;
 
-      exp = &exp->X_add_symbol->sy_value;
+      exp = symbol_get_value_expression (exp->X_add_symbol);
 
       /* Negate the bignum: one's complement each digit and add 1.  */
       carry = 1;
@@ -4179,7 +4213,7 @@ output_uleb128 (p, value)
   return p - orig;
 }
 
-inline int
+int
 output_leb128 (p, value, sign)
      char *p;
      valueT value;
@@ -4195,7 +4229,7 @@ output_leb128 (p, value, sign)
    we don't output for NULL values of P.  It isn't really as critical as
    for "normal" values that this be streamlined.  */
 
-static int
+static inline int
 output_big_sleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4241,7 +4275,7 @@ output_big_sleb128 (p, bignum, size)
   return p - orig;
 }
 
-static int
+static inline int
 output_big_uleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4283,7 +4317,7 @@ output_big_uleb128 (p, bignum, size)
   return p - orig;
 }
 
-static inline int
+static int
 output_big_leb128 (p, bignum, size, sign)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4376,7 +4410,7 @@ s_leb128 (sign)
 /*
  *                     stringer()
  *
- * We read 0 or more ',' seperated, double-quoted strings.
+ * We read 0 or more ',' separated, double-quoted strings.
  *
  * Caller should have checked need_pass_2 is FALSE because we don't check it.
  */
@@ -4789,7 +4823,10 @@ equals (sym_name, reassign)
     }
 
   if (flag_mri)
-    mri_comment_end (stop, stopc);
+     {
+       ignore_rest_of_line (); /* check garbage after the expression */
+       mri_comment_end (stop, stopc);
+     }
 }                              /* equals() */
 
 /* .include -- include a file at this point. */
@@ -4797,7 +4834,7 @@ equals (sym_name, reassign)
 /* ARGSUSED */
 void 
 s_include (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   char *newbuf;
   char *filename;
@@ -4891,33 +4928,37 @@ generate_file_debug ()
 
 /* Output line number debugging information for the current source line.  */
 
-static void
+void
 generate_lineno_debug ()
 {
-  if (debug_type == DEBUG_STABS)
-    stabs_generate_asm_lineno ();
-
-#ifdef OBJ_GENERATE_ASM_LINENO
 #ifdef ECOFF_DEBUGGING
-  /* ECOFF assemblers automatically generate
-     debugging information.  FIXME: This should
-     probably be handled elsewhere.  */
-  if (debug_type == DEBUG_NONE)
+  /* ECOFF assemblers automatically generate debugging information. 
+     FIXME: This should probably be handled elsewhere.  */
+  if (debug_type == DEBUG_UNSPECIFIED)
     {
-      if (ecoff_no_current_file ())
-       debug_type = DEBUG_ECOFF;
+      if (ECOFF_DEBUGGING && ecoff_no_current_file ())
+        debug_type = DEBUG_ECOFF;
+      else
+       debug_type = DEBUG_NONE;
     }
+#endif
 
-  if (debug_type == DEBUG_ECOFF)
+  switch (debug_type)
     {
-      unsigned int lineno;
-      char *s;
-
-      as_where (&s, &lineno);
-      OBJ_GENERATE_ASM_LINENO (s, lineno);
+    case DEBUG_UNSPECIFIED:
+    case DEBUG_NONE:
+      break;
+    case DEBUG_STABS:
+      stabs_generate_asm_lineno ();
+      break;
+    case DEBUG_ECOFF:
+      ecoff_generate_asm_lineno ();
+      break;
+    case DEBUG_DWARF:
+    case DEBUG_DWARF2:
+      /* FIXME.  */
+      break;
     }
-#endif
-#endif
 }
 
 /* Output debugging information to mark a function entry point or end point.
@@ -5015,7 +5056,7 @@ do_s_func (end_p, default_prefix)
 \f
 void 
 s_ignore (arg)
-     int arg;
+     int arg ATTRIBUTE_UNUSED;
 {
   while (!is_end_of_line[(unsigned char) *input_line_pointer])
     {
This page took 0.035268 seconds and 4 git commands to generate.