*** empty log message ***
[deliverable/binutils-gdb.git] / gas / symbols.c
index 4b02b99925ab8601748e88e2444f13dae9e330f7..7362afbbaf4c347faa7cded247a940d91322b77a 100644 (file)
@@ -1,6 +1,6 @@
 /* symbols.c -symbol table-
    Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002
+   1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -182,8 +182,6 @@ symbol_create (name, segment, valu, frag)
 /* Local symbol support.  If we can get away with it, we keep only a
    small amount of information for local symbols.  */
 
-static struct local_symbol *local_symbol_make PARAMS ((const char *, segT,
-                                                      valueT, fragS *));
 static symbolS *local_symbol_convert PARAMS ((struct local_symbol *));
 
 /* Used for statistics.  */
@@ -205,7 +203,7 @@ static unsigned long local_symbol_conversion_count;
 
 /* Create a local symbol and insert it into the local hash table.  */
 
-static struct local_symbol *
+struct local_symbol *
 local_symbol_make (name, section, value, frag)
      const char *name;
      segT section;
@@ -320,7 +318,7 @@ colon (sym_name)            /* Just seen "x:" - rattle symbols & frags.  */
          as_bad (_("cannot define symbol `%s' in absolute section"), sym_name);
          return NULL;
        }
-      
+
       possible_bytes = (md_short_jump_size
                        + new_broken_words * md_long_jump_size);
 
@@ -491,7 +489,7 @@ colon (sym_name)            /* Just seen "x:" - rattle symbols & frags.  */
   if (mri_common_symbol != NULL)
     {
       /* This symbol is actually being defined within an MRI common
-         section.  This requires special handling.  */
+        section.  This requires special handling.  */
       if (LOCAL_SYMBOL_CHECK (symbolP))
        symbolP = local_symbol_convert ((struct local_symbol *) symbolP);
       symbolP->sy_value.X_op = O_symbol;
@@ -590,6 +588,27 @@ symbol_make (name)
   return (symbolP);
 }
 
+symbolS *
+symbol_temp_new (seg, ofs, frag)
+     segT seg;
+     valueT ofs;
+     fragS *frag;
+{
+  return symbol_new (FAKE_LABEL_NAME, seg, ofs, frag);
+}
+
+symbolS *
+symbol_temp_new_now ()
+{
+  return symbol_temp_new (now_seg, frag_now_fix (), frag_now);
+}
+
+symbolS *
+symbol_temp_make ()
+{
+  return symbol_make (FAKE_LABEL_NAME);
+}
+
 /* Implement symbol table lookup.
    In: A symbol's name as a string: '\0' can't be part of a symbol name.
    Out:        NULL if the name was not in the symbol table, else the address
@@ -847,7 +866,7 @@ report_op_error (symp, left, right)
   unsigned int line;
   segT seg_left = S_GET_SEGMENT (left);
   segT seg_right = right ? S_GET_SEGMENT (right) : 0;
-  
+
   if (expr_symbol_where (symp, &file, &line))
     {
       if (seg_left == undefined_section)
@@ -870,7 +889,7 @@ report_op_error (symp, left, right)
                          _("invalid section for operation on `%s'"),
                          S_GET_NAME (left));
        }
-      
+
     }
   else
     {
@@ -1067,10 +1086,10 @@ resolve_symbol_value (symp)
          if (op != O_logical_not && seg_left != absolute_section
              && finalize_syms)
            report_op_error (symp, add_symbol, NULL);
-           
+
          if (final_seg == expr_section || final_seg == undefined_section)
            final_seg = absolute_section;
-         
+
          if (op == O_uminus)
            left = -left;
          else if (op == O_logical_not)
@@ -1154,7 +1173,7 @@ resolve_symbol_value (symp)
                   && (seg_left != undefined_section
                       || add_symbol == op_symbol)))
            report_op_error (symp, add_symbol, op_symbol);
-         
+
          if (final_seg == expr_section || final_seg == undefined_section)
            final_seg = absolute_section;
 
@@ -1681,8 +1700,8 @@ S_GET_VALUE (s)
       static symbolS *recur;
 
       /* FIXME: In non BFD assemblers, S_IS_DEFINED and S_IS_COMMON
-         may call S_GET_VALUE.  We use a static symbol to avoid the
-         immediate recursion.  */
+        may call S_GET_VALUE.  We use a static symbol to avoid the
+        immediate recursion.  */
       if (recur == s)
        return (valueT) s->sy_value.X_add_number;
       recur = s;
@@ -2063,6 +2082,17 @@ symbol_set_value_expression (s, exp)
   s->sy_value = *exp;
 }
 
+/* Set the value of SYM to the current position in the current segment.  */
+
+void
+symbol_set_value_now (sym)
+     symbolS *sym;
+{
+  S_SET_SEGMENT (sym, now_seg);
+  S_SET_VALUE (sym, frag_now_fix ());
+  symbol_set_frag (sym, frag_now);
+}
+
 /* Set the frag of a symbol.  */
 
 void
This page took 0.025381 seconds and 4 git commands to generate.