add_child = &os->children;
lang_add_section (add_child, s, os);
- lang_leave_output_section_statement (0, "*default*", NULL, NULL);
+ if (after && (s->flags & (SEC_LOAD | SEC_ALLOC)) != 0)
+ {
+ const char *region = (after->region
+ ? after->region->name_list.name
+ : DEFAULT_MEMORY_REGION);
+ const char *lma_region = (after->lma_region
+ ? after->lma_region->name_list.name
+ : NULL);
+ lang_leave_output_section_statement (NULL, region, after->phdrs,
+ lma_region);
+ }
+ else
+ lang_leave_output_section_statement (NULL, DEFAULT_MEMORY_REGION, NULL,
+ NULL);
if (ps != NULL && *ps == '\0')
{
lang_input_statement_type *file,
asection *section)
{
- const char *section_name;
lang_statement_union_type *l;
if (!wild->filenames_sorted
&& (sec == NULL || sec->spec.sorted == none))
return NULL;
- section_name = bfd_get_section_name (file->the_bfd, section);
for (l = wild->children.head; l != NULL; l = l->header.next)
{
lang_input_section_type *ls;
static bfd_vma
lang_size_sections_1
- (lang_statement_union_type *s,
+ (lang_statement_union_type **prev,
lang_output_section_statement_type *output_section_statement,
- lang_statement_union_type **prev,
fill_type *fill,
bfd_vma dot,
bfd_boolean *relax,
bfd_boolean check_regions)
{
+ lang_statement_union_type *s;
+
/* Size up the sections from their constituent parts. */
- for (; s != NULL; s = s->header.next)
+ for (s = *prev; s != NULL; s = s->header.next)
{
switch (s->header.type)
{
os->bfd_section->output_offset = 0;
}
- lang_size_sections_1 (os->children.head, os, &os->children.head,
+ lang_size_sections_1 (&os->children.head, os,
os->fill, newdot, relax, check_regions);
os->processed_vma = TRUE;
break;
case lang_constructors_statement_enum:
- dot = lang_size_sections_1 (constructor_list.head,
+ dot = lang_size_sections_1 (&constructor_list.head,
output_section_statement,
- &s->wild_statement.children.head,
fill, dot, relax, check_regions);
break;
break;
case lang_wild_statement_enum:
- dot = lang_size_sections_1 (s->wild_statement.children.head,
+ dot = lang_size_sections_1 (&s->wild_statement.children.head,
output_section_statement,
- &s->wild_statement.children.head,
fill, dot, relax, check_regions);
break;
{
asection *i;
- i = (*prev)->input_section.section;
+ i = s->input_section.section;
if (relax)
{
bfd_boolean again;
break;
case lang_group_statement_enum:
- dot = lang_size_sections_1 (s->group_statement.children.head,
+ dot = lang_size_sections_1 (&s->group_statement.children.head,
output_section_statement,
- &s->group_statement.children.head,
fill, dot, relax, check_regions);
break;
one_lang_size_sections_pass (bfd_boolean *relax, bfd_boolean check_regions)
{
lang_statement_iteration++;
- lang_size_sections_1 (statement_list.head, abs_output_section,
- &statement_list.head, 0, 0, relax, check_regions);
+ lang_size_sections_1 (&statement_list.head, abs_output_section,
+ 0, 0, relax, check_regions);
}
void