+ lang_do_assignments_1 (statement_list.head,
+ abs_output_section, NULL, 0, &found_end);
+}
+
+/* For an assignment statement outside of an output section statement,
+ choose the best of neighbouring output sections to use for values
+ of "dot". */
+
+asection *
+section_for_dot (void)
+{
+ asection *s;
+
+ /* Assignments belong to the previous output section, unless there
+ has been an assignment to "dot", in which case following
+ assignments belong to the next output section. (The assumption
+ is that an assignment to "dot" is setting up the address for the
+ next output section.) Except that past the assignment to "_end"
+ we always associate with the previous section. This exception is
+ for targets like SH that define an alloc .stack or other
+ weirdness after non-alloc sections. */
+ if (current_section == NULL || prefer_next_section)
+ {
+ lang_statement_union_type *stmt;
+ lang_output_section_statement_type *os;
+
+ for (stmt = (lang_statement_union_type *) current_assign;
+ stmt != NULL;
+ stmt = stmt->header.next)
+ if (stmt->header.type == lang_output_section_statement_enum)
+ break;
+
+ os = &stmt->output_section_statement;
+ while (os != NULL
+ && !os->after_end
+ && (os->bfd_section == NULL
+ || (os->bfd_section->flags & SEC_EXCLUDE) != 0
+ || bfd_section_removed_from_list (link_info.output_bfd,
+ os->bfd_section)))
+ os = os->next;
+
+ if (current_section == NULL || os == NULL || !os->after_end)
+ {
+ if (os != NULL)
+ s = os->bfd_section;
+ else
+ s = link_info.output_bfd->section_last;
+ while (s != NULL
+ && ((s->flags & SEC_ALLOC) == 0
+ || (s->flags & SEC_THREAD_LOCAL) != 0))
+ s = s->prev;
+ if (s != NULL)
+ return s;
+
+ return bfd_abs_section_ptr;
+ }
+ }
+
+ s = current_section->bfd_section;
+
+ /* The section may have been stripped. */
+ while (s != NULL
+ && ((s->flags & SEC_EXCLUDE) != 0
+ || (s->flags & SEC_ALLOC) == 0
+ || (s->flags & SEC_THREAD_LOCAL) != 0
+ || bfd_section_removed_from_list (link_info.output_bfd, s)))
+ s = s->prev;
+ if (s == NULL)
+ s = link_info.output_bfd->sections;
+ while (s != NULL
+ && ((s->flags & SEC_ALLOC) == 0
+ || (s->flags & SEC_THREAD_LOCAL) != 0))
+ s = s->next;
+ if (s != NULL)
+ return s;
+
+ return bfd_abs_section_ptr;