|| file->flags.just_syms)
continue;
- for (s = file->the_bfd->sections; s != NULL; s = s->next)
- if ((s->output_section == NULL
- || s->output_section->owner != link_info.output_bfd)
- && (s->flags & (SEC_LINKER_CREATED | SEC_KEEP)) == 0)
- {
- if (!dis_header_printed)
- {
- fprintf (config.map_file, _("\nDiscarded input sections\n\n"));
- dis_header_printed = TRUE;
- }
+ if (config.print_map_discarded)
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ if ((s->output_section == NULL
+ || s->output_section->owner != link_info.output_bfd)
+ && (s->flags & (SEC_LINKER_CREATED | SEC_KEEP)) == 0)
+ {
+ if (! dis_header_printed)
+ {
+ fprintf (config.map_file, _("\nDiscarded input sections\n\n"));
+ dis_header_printed = TRUE;
+ }
- print_input_section (s, TRUE);
- }
+ print_input_section (s, TRUE);
+ }
}
minfo (_("\nMemory Configuration\n\n"));
obstack_begin (&map_obstack, 1000);
bfd_link_hash_traverse (link_info.hash, sort_def_symbol, 0);
}
+ expld.phase = lang_fixed_phase_enum;
lang_statement_iteration++;
print_statements ();
case lang_wild_statement_enum:
for (sec = s->wild_statement.section_list; sec != NULL;
sec = sec->next)
- {
+ /* Don't sort .init/.fini sections. */
+ if (strcmp (sec->spec.name, ".init") != 0
+ && strcmp (sec->spec.name, ".fini") != 0)
switch (sec->spec.sorted)
{
case none:
default:
break;
}
- }
break;
case lang_constructors_statement_enum:
break;
case lang_output_section_statement_enum:
- /* Don't sort .init/.fini sections. */
- if (strcmp (s->output_section_statement.name, ".init") != 0
- && strcmp (s->output_section_statement.name, ".fini") != 0)
- update_wild_statements
- (s->output_section_statement.children.head);
+ update_wild_statements
+ (s->output_section_statement.children.head);
break;
case lang_group_statement_enum:
const char *dst = assignment->exp->assign.dst;
is_dot = (dst[0] == '.' && dst[1] == 0);
- if (!is_dot)
- expld.assign_name = dst;
- tree = assignment->exp->assign.src;
+ tree = assignment->exp;
}
osec = output_section->bfd_section;
h = bfd_link_hash_lookup (link_info.hash, assignment->exp->assign.dst,
FALSE, FALSE, TRUE);
- if (h)
+ if (h != NULL
+ && (h->type == bfd_link_hash_defined
+ || h->type == bfd_link_hash_defweak))
{
value = h->u.def.value;
value += h->u.def.section->output_section->vma;
break;
case lang_object_symbols_statement_enum:
- link_info.create_object_symbols_section =
- output_section_statement->bfd_section;
+ link_info.create_object_symbols_section
+ = output_section_statement->bfd_section;
+ output_section_statement->bfd_section->flags |= SEC_KEEP;
break;
case lang_output_statement_enum: