This is the mail archive of the binutils@sourceware.org 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]

tidy os->processed


Nothing differentiates between unprocessed and currently processing
output section statements, so "processed" may as well be a boolean.

	* ldlang.h (struct lang_output_section_statement): Change type of
	"processed" to bfd_boolean.
	* ldexp.c (fold_name): Update references to os->processed.
	* ldlang.c (lang_output_section_statement_lookup_1): Likewise.
	(lang_size_sections_1): Likewise.
	(lang_reset_memory_regions): Likewise.

Index: ld/ldlang.h
===================================================================
RCS file: /cvs/src/src/ld/ldlang.h,v
retrieving revision 1.51
diff -u -p -r1.51 ldlang.h
--- ld/ldlang.h	9 Jun 2005 02:05:46 -0000	1.51
+++ ld/ldlang.h	19 Sep 2005 23:33:59 -0000
@@ -134,7 +134,7 @@ typedef struct lang_output_section_state
   struct lang_output_section_statement_struct *next;
   const char *name;
 
-  int processed;
+  bfd_boolean processed;
 
   asection *bfd_section;
   flagword flags;		/* Or together of all input sections.  */
Index: ld/ldexp.c
===================================================================
RCS file: /cvs/src/src/ld/ldexp.c,v
retrieving revision 1.55
diff -u -p -r1.55 ldexp.c
--- ld/ldexp.c	7 Sep 2005 06:27:36 -0000	1.55
+++ ld/ldexp.c	19 Sep 2005 23:33:47 -0000
@@ -562,7 +562,7 @@ fold_name (etree_type *tree)
 	  lang_output_section_statement_type *os;
 
 	  os = lang_output_section_find (tree->name.name);
-	  if (os != NULL && os->processed > 0)
+	  if (os != NULL && os->processed)
 	    new_rel (0, NULL, os->bfd_section);
 	}
       break;
@@ -573,7 +573,7 @@ fold_name (etree_type *tree)
 	  lang_output_section_statement_type *os;
 
 	  os = lang_output_section_find (tree->name.name);
-	  if (os != NULL && os->processed > 0)
+	  if (os != NULL && os->processed)
 	    {
 	      if (os->load_base == NULL)
 		new_rel (0, NULL, os->bfd_section);
@@ -592,7 +592,7 @@ fold_name (etree_type *tree)
 	  os = lang_output_section_find (tree->name.name);
 	  if (os == NULL)
 	    new_abs (0);
-	  else if (os->processed > 0)
+	  else if (os->processed)
 	    new_abs (os->bfd_section->size / opb);
 	}
       break;
Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.196
diff -u -p -r1.196 ldlang.c
--- ld/ldlang.c	19 Sep 2005 23:17:47 -0000	1.196
+++ ld/ldlang.c	19 Sep 2005 23:33:51 -0000
@@ -1024,7 +1024,7 @@ lang_output_section_statement_lookup_1 (
 
       lookup->next = NULL;
       lookup->bfd_section = NULL;
-      lookup->processed = 0;
+      lookup->processed = FALSE;
       lookup->constraint = constraint;
       lookup->ignored = FALSE;
       lookup->sectype = normal_section;
@@ -3976,9 +3976,8 @@ lang_size_sections_1
 	    os = &s->output_section_statement;
 	    if (os->addr_tree != NULL)
 	      {
-		os->processed = -1;
+		os->processed = FALSE;
 		exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot);
-		os->processed = 0;
 
 		if (!expld.result.valid_p
 		    && expld.phase != lang_mark_phase_enum)
@@ -4105,7 +4104,7 @@ lang_size_sections_1
 	    lang_size_sections_1 (os->children.head, os, &os->children.head,
 				  os->fill, newdot, relax, check_regions);
 
-	    os->processed = 1;
+	    os->processed = TRUE;
 
 	    if (bfd_is_abs_section (os->bfd_section) || os->ignored)
 	      {
@@ -5163,7 +5162,7 @@ lang_reset_memory_regions (void)
   for (os = &lang_output_section_statement.head->output_section_statement;
        os != NULL;
        os = os->next)
-    os->processed = 0;
+    os->processed = FALSE;
 
   for (o = output_bfd->sections; o != NULL; o = o->next)
     {

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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