2005-09-27 Paul Brook <paul@codesourcery.com>
[deliverable/binutils-gdb.git] / ld / ldlang.c
index 038af17b3b492a727e4cb4bb43d57a4df8cbf35e..dc5f4eec4a3a8e384b9e3a1ab9ba25348ae6eeb3 100644 (file)
@@ -1024,7 +1024,7 @@ lang_output_section_statement_lookup_1 (const char *const name, int constraint)
 
       lookup->next = NULL;
       lookup->bfd_section = NULL;
-      lookup->processed = 0;
+      lookup->processed = FALSE;
       lookup->constraint = constraint;
       lookup->ignored = FALSE;
       lookup->sectype = normal_section;
@@ -3056,9 +3056,7 @@ strip_excluded_output_sections (void)
 {
   lang_output_section_statement_type *os;
 
-  /* Run lang_size_sections (if not already done) to ensure that all
-     symbols defined in the linker script are put in the bfd hash
-     table.  */
+  /* Run lang_size_sections (if not already done).  */
   if (expld.phase != lang_mark_phase_enum)
     {
       expld.phase = lang_mark_phase_enum;
@@ -3976,6 +3974,20 @@ lang_size_sections_1
            lang_output_section_statement_type *os;
 
            os = &s->output_section_statement;
+           if (os->addr_tree != NULL)
+             {
+               os->processed = FALSE;
+               exp_fold_tree (os->addr_tree, bfd_abs_section_ptr, &dot);
+
+               if (!expld.result.valid_p
+                   && expld.phase != lang_mark_phase_enum)
+                 einfo (_("%F%S: non constant or forward reference"
+                          " address expression for section %s\n"),
+                        os->name);
+
+               dot = expld.result.value + expld.result.section->vma;
+             }
+
            if (os->bfd_section == NULL)
              /* This section was removed or never actually created.  */
              break;
@@ -4005,6 +4017,7 @@ lang_size_sections_1
                break;
              }
 
+           newdot = dot;
            if (bfd_is_abs_section (os->bfd_section))
              {
                /* No matter what happens, an abs section starts at zero.  */
@@ -4076,22 +4089,6 @@ lang_size_sections_1
                                 os->name, (unsigned long) (newdot - savedot));
                      }
                  }
-               else
-                 {
-                   newdot = dot;
-                   os->processed = -1;
-                   exp_fold_tree (os->addr_tree, bfd_abs_section_ptr,
-                                  &newdot);
-                   os->processed = 0;
-
-                   if (!expld.result.valid_p
-                       && expld.phase != lang_mark_phase_enum)
-                     einfo (_("%F%S: non constant or forward reference"
-                              " address expression for section %s\n"),
-                            os->name);
-
-                   newdot = expld.result.value + expld.result.section->vma;
-                 }
 
                /* The section starts here.
                   First, align to what the section needs.  */
@@ -4107,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)
              {
@@ -4591,7 +4588,6 @@ lang_do_assignments (void)
 {
   lang_statement_iteration++;
   lang_do_assignments_1 (statement_list.head, abs_output_section, NULL, 0);
-  ldemul_do_assignments ();
 }
 
 /* Fix any .startof. or .sizeof. symbols.  When the assemblers see the
@@ -5166,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)
     {
This page took 0.025988 seconds and 4 git commands to generate.