This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: temporary symbol helper functions


Like so.


r~


        * expr.c (make_expr_symbol): Fold FAKE_LABEL_NAME use into the
        symbol_create call.
        (current_location): Use symbol_temp_new_now.
        * stabs.c (s_stab_generic): Use symbol_temp_new.
        * symbols.c (temp_label_name): Remove.
        (symbol_temp_new, symbol_temp_make): Use FAKE_LABEL_NAME.

Index: expr.c
===================================================================
RCS file: /cvs/src/src/gas/expr.c,v
retrieving revision 1.46
diff -c -p -d -u -r1.46 expr.c
--- expr.c	18 Oct 2002 01:56:39 -0000	1.46
+++ expr.c	27 May 2003 19:14:00 -0000
@@ -67,7 +67,6 @@ make_expr_symbol (expressionP)
      expressionS *expressionP;
 {
   expressionS zero;
-  const char *fake;
   symbolS *symbolP;
   struct expr_symbol_line *n;
 
@@ -91,13 +90,11 @@ make_expr_symbol (expressionP)
       expressionP = &zero;
     }
 
-  fake = FAKE_LABEL_NAME;
-
   /* Putting constant symbols in absolute_section rather than
      expr_section is convenient for the old a.out code, for which
      S_GET_SEGMENT does not always retrieve the value put in by
      S_SET_SEGMENT.  */
-  symbolP = symbol_create (fake,
+  symbolP = symbol_create (FAKE_LABEL_NAME,
 			   (expressionP->X_op == O_constant
 			    ? absolute_section
 			    : expr_section),
@@ -745,13 +742,8 @@ current_location (expressionp)
     }
   else
     {
-      symbolS *symbolp;
-
-      symbolp = symbol_new (FAKE_LABEL_NAME, now_seg,
-			    (valueT) frag_now_fix (),
-			    frag_now);
       expressionp->X_op = O_symbol;
-      expressionp->X_add_symbol = symbolp;
+      expressionp->X_add_symbol = symbol_temp_new_now ();
       expressionp->X_add_number = 0;
     }
 }
Index: stabs.c
===================================================================
RCS file: /cvs/src/src/gas/stabs.c,v
retrieving revision 1.19
diff -c -p -d -u -r1.19 stabs.c
--- stabs.c	18 May 2002 12:53:30 -0000	1.19
+++ stabs.c	27 May 2003 19:14:00 -0000
@@ -371,13 +371,11 @@ s_stab_generic (what, stab_secname, stab
 	}
       else
 	{
-	  const char *fake;
 	  symbolS *symbol;
 	  expressionS exp;
 
 	  /* Arrange for a value representing the current location.  */
-	  fake = FAKE_LABEL_NAME;
-	  symbol = symbol_new (fake, saved_seg, dot, saved_frag);
+	  symbol = symbol_temp_new (saved_seg, dot, saved_frag);
 
 	  exp.X_op = O_symbol;
 	  exp.X_add_symbol = symbol;
Index: symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.45
diff -c -p -d -u -r1.45 symbols.c
--- symbols.c	27 May 2003 16:00:04 -0000	1.45
+++ symbols.c	27 May 2003 19:14:01 -0000
@@ -588,15 +588,13 @@ symbol_make (name)
   return (symbolP);
 }
 
-static const char temp_label_name[] = ".L0\001";
-
 symbolS *
 symbol_temp_new (seg, ofs, frag)
      segT seg;
      valueT ofs;
      fragS *frag;
 {
-  return symbol_new (temp_label_name, seg, ofs, frag);
+  return symbol_new (FAKE_LABEL_NAME, seg, ofs, frag);
 }
 
 symbolS *
@@ -608,7 +606,7 @@ symbol_temp_new_now ()
 symbolS *
 symbol_temp_make ()
 {
-  return symbol_make (temp_label_name);
+  return symbol_make (FAKE_LABEL_NAME);
 }
 
 /* Implement symbol table lookup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]