gas/testsuite/:
[deliverable/binutils-gdb.git] / gas / read.c
index 0485d72dec6726986e4315c853a1859c2fda6e98..5d7a0d2d2254098f47791c8c3c47c1a46675db3d 100644 (file)
@@ -1,6 +1,6 @@
 /* read.c - read a source file -
    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
@@ -38,7 +38,6 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
 #include "sb.h"
 #include "macro.h"
 #include "obstack.h"
-#include "listing.h"
 #include "ecoff.h"
 #include "dw2gencfi.h"
 
@@ -1008,10 +1007,14 @@ read_a_source_file (char *name)
              unsigned int new_length;
              char *tmp_buf = 0;
 
-             bump_line_counters ();
              s = input_line_pointer;
              if (strncmp (s, "APP\n", 4))
-               continue;       /* We ignore it */
+               {
+                 /* We ignore it.  */
+                 ignore_rest_of_line ();
+                 continue;
+               }
+             bump_line_counters ();
              s += 4;
 
              sb_new (&sbuf);
@@ -1110,7 +1113,7 @@ read_a_source_file (char *name)
            continue;
 #endif
          input_line_pointer--;
-         /* Report unknown char as ignored.  */
+         /* Report unknown char as error.  */
          demand_empty_rest_of_line ();
        }
 
@@ -1279,7 +1282,7 @@ s_align (int arg, int bytes_p)
   unsigned int align_limit = ALIGN_LIMIT;
   unsigned int align;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
   offsetT fill = 0;
   int max;
   int fill_p;
@@ -1423,7 +1426,7 @@ s_comm_internal (int param,
   offsetT temp, size;
   symbolS *symbolP = NULL;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
   expressionS exp;
 
   if (flag_mri)
@@ -1478,10 +1481,7 @@ s_comm_internal (int param,
          ignore_rest_of_line ();
          goto out;
        }
-      /* This could be avoided when the symbol wasn't used so far, but
-        the comment in struc-symbol.h says this flag isn't reliable.  */
-      if (1 || !symbol_used_p (symbolP))
-       symbolP = symbol_clone (symbolP, 1);
+      symbolP = symbol_clone (symbolP, 1);
       S_SET_SEGMENT (symbolP, undefined_section);
       S_SET_VALUE (symbolP, 0);
       symbol_set_frag (symbolP, &zero_address_frag);
@@ -1538,7 +1538,7 @@ s_mri_common (int small ATTRIBUTE_UNUSED)
   symbolS *sym;
   offsetT align;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   if (!flag_mri)
     {
@@ -1807,7 +1807,7 @@ s_fail (int ignore ATTRIBUTE_UNUSED)
 {
   offsetT temp;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   if (flag_mri)
     stop = mri_comment_field (&stopc);
@@ -1929,7 +1929,7 @@ s_globl (int ignore ATTRIBUTE_UNUSED)
   int c;
   symbolS *symbolP;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   if (flag_mri)
     stop = mri_comment_field (&stopc);
@@ -2812,10 +2812,7 @@ assign_symbol (char *name, int mode)
       /* If the symbol is volatile, copy the symbol and replace the
         original with the copy, so that previous uses of the symbol will
         retain the value of the symbol at the point of use.  */
-      else if (S_IS_VOLATILE (symbolP)
-         /* This could be avoided when the symbol wasn't used so far, but
-            the comment in struc-symbol.h says this flag isn't reliable.  */
-         && (1 || symbol_used_p (symbolP)))
+      else if (S_IS_VOLATILE (symbolP))
        symbolP = symbol_clone (symbolP, 1);
     }
 
@@ -2881,7 +2878,7 @@ s_space (int mult)
   expressionS val;
   char *p = 0;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
   int bytes;
 
 #ifdef md_flush_pending_output
@@ -3057,7 +3054,7 @@ s_float_space (int float_type)
   int flen;
   char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT];
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   if (flag_mri)
     stop = mri_comment_field (&stopc);
@@ -3134,11 +3131,17 @@ void
 s_struct (int ignore ATTRIBUTE_UNUSED)
 {
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   if (flag_mri)
     stop = mri_comment_field (&stopc);
   abs_section_offset = get_absolute_expression ();
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
+  /* The ELF backend needs to know that we are changing sections, so
+     that .previous works correctly. */
+  if (IS_ELF)
+    obj_elf_section_change_hook ();
+#endif
   subseg_set (absolute_section, 0);
   demand_empty_rest_of_line ();
   if (flag_mri)
@@ -3186,17 +3189,14 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
 
   if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
     {
-      if(!S_IS_VOLATILE (symbolP))
+      if (!S_IS_VOLATILE (symbolP))
        {
          as_bad (_("symbol `%s' is already defined"), name);
          *end_name = delim;
          ignore_rest_of_line ();
          return;
        }
-      /* This could be avoided when the symbol wasn't used so far, but
-        the comment in struc-symbol.h says this flag isn't reliable.  */
-      if (1 || !symbol_used_p (symbolP))
-       symbolP = symbol_clone (symbolP, 1);
+      symbolP = symbol_clone (symbolP, 1);
       S_CLEAR_VOLATILE (symbolP);
     }
 
@@ -3514,7 +3514,7 @@ cons_worker (register int nbytes, /* 1=.byte, 2=.word, 4=.long.  */
   int c;
   expressionS exp;
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
 #ifdef md_flush_pending_output
   md_flush_pending_output ();
@@ -5010,7 +5010,7 @@ void
 equals (char *sym_name, int reassign)
 {
   char *stop = NULL;
-  char stopc;
+  char stopc = 0;
 
   input_line_pointer++;
   if (*input_line_pointer == '=')
This page took 0.027347 seconds and 4 git commands to generate.