Add code to retry certain open()s.
[deliverable/binutils-gdb.git] / gas / symbols.c
index a338df079a2d7e9e2314329600c62620faa5f404..98623eb7005c9ca8af60e817250be232a81069e2 100644 (file)
@@ -1,5 +1,6 @@
 /* symbols.c -symbol table-
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -254,6 +255,10 @@ local_symbol_convert (locsym)
   /* Local symbols are always either defined or used.  */
   ret->sy_used = 1;
 
+#ifdef TC_LOCAL_SYMFIELD_CONVERT
+  TC_LOCAL_SYMFIELD_CONVERT (locsym, ret);
+#endif
+
   symbol_table_insert (ret);
 
   local_symbol_mark_converted (locsym);
@@ -439,7 +444,7 @@ colon (sym_name)            /* Just seen "x:" - rattle symbols & frags.  */
                            S_GET_OTHER (symbolP),
                            S_GET_DESC (symbolP));
 #endif
-                 as_fatal (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."),
+                 as_bad (_("Symbol \"%s\" is already defined as \"%s\"/%s%ld."),
                            sym_name,
                            segment_name (S_GET_SEGMENT (symbolP)),
                            od_buf,
@@ -453,8 +458,8 @@ colon (sym_name)            /* Just seen "x:" - rattle symbols & frags.  */
          if (!(frag_now == symbolP->sy_frag
                && S_GET_VALUE (symbolP) == frag_now_fix ()
                && S_GET_SEGMENT (symbolP) == now_seg))
-           as_fatal (_("Symbol %s already defined."), sym_name);
-       }                       /* if this symbol is not yet defined  */
+           as_bad (_("Symbol %s already defined."), sym_name);
+       }
 
     }
 #ifdef BFD_ASSEMBLER
@@ -474,7 +479,7 @@ colon (sym_name)            /* Just seen "x:" - rattle symbols & frags.  */
 #endif /* OBJ_VMS */
 
       symbol_table_insert (symbolP);
-    }                          /* if we have seen this symbol before  */
+    }
 
   if (mri_common_symbol != NULL)
     {
@@ -865,6 +870,10 @@ resolve_symbol_value (symp, finalize)
 
   resolved = 0;
   final_seg = S_GET_SEGMENT (symp);
+  /* Expressions aren't really symbols, so don't finalize their values
+     until relaxation is complete.  */
+  if (final_seg == expr_section && finalize != 2)
+    finalize = 0;
 
   if (symp->sy_resolving)
     {
@@ -1181,7 +1190,7 @@ resolve_local_symbol (key, value)
      PTR value;
 {
   if (value != NULL)
-    resolve_symbol_value (value, 1);
+    resolve_symbol_value (value, finalize_syms);
 }
 
 #endif
@@ -1530,14 +1539,14 @@ decode_local_label_name (s)
   int label_number;
   int instance_number;
   char *type;
-  const char *message_format = _("\"%d\" (instance number %d of a %s label)");
+  const char *message_format;
   int index = 0;
-  
+
 #ifdef LOCAL_LABEL_PREFIX
   if (s[index] == LOCAL_LABEL_PREFIX)
     ++index;
 #endif
-  
+
   if (s[index] != 'L')
     return s;
 
@@ -1554,6 +1563,7 @@ decode_local_label_name (s)
   for (instance_number = 0, p++; isdigit ((unsigned char) *p); ++p)
     instance_number = (10 * instance_number) + *p - '0';
 
+  message_format = _("\"%d\" (instance number %d of a %s label)");
   symbol_decode = obstack_alloc (&notes, strlen (message_format) + 30);
   sprintf (symbol_decode, message_format, label_number, instance_number, type);
 
@@ -1572,7 +1582,11 @@ S_GET_VALUE (s)
 #endif
 
   if (!s->sy_resolved && s->sy_value.X_op != O_constant)
-    resolve_symbol_value (s, 1);
+    {
+      valueT val = resolve_symbol_value (s, finalize_syms);
+      if (finalize_syms != 2 && S_GET_SEGMENT (s) == expr_section)
+       return val;
+    }
   if (s->sy_value.X_op != O_constant)
     {
       static symbolS *recur;
This page took 0.026048 seconds and 4 git commands to generate.