struct wildcard_list *sec;
sec = ptr->section_list;
- do
+ if (sec == NULL)
+ (*callback) (ptr, sec, s, file, data);
+
+ while (sec != NULL)
{
boolean skip = false;
+ struct name_list *list_tmp;
- if (sec != NULL)
+ /* Don't process sections from files which were
+ excluded. */
+ for (list_tmp = sec->spec.exclude_name_list;
+ list_tmp;
+ list_tmp = list_tmp->next)
{
- struct name_list *list_tmp;
-
- /* Don't process sections from files which were
- excluded. */
- for (list_tmp = sec->spec.exclude_name_list;
- list_tmp;
- list_tmp = list_tmp->next)
- {
- if (wildcardp (list_tmp->name))
- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
- else
- skip = strcmp (list_tmp->name, file->filename) == 0;
+ if (wildcardp (list_tmp->name))
+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
+ else
+ skip = strcmp (list_tmp->name, file->filename) == 0;
- if (skip)
- break;
- }
+ if (skip)
+ break;
+ }
- if (!skip && sec->spec.name != NULL)
- {
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ if (!skip && sec->spec.name != NULL)
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
- if (wildcardp (sec->spec.name))
- skip = fnmatch (sec->spec.name, sname, 0) != 0;
- else
- skip = strcmp (sec->spec.name, sname) != 0;
- }
+ if (wildcardp (sec->spec.name))
+ skip = fnmatch (sec->spec.name, sname, 0) != 0;
+ else
+ skip = strcmp (sec->spec.name, sname) != 0;
}
if (!skip)
(*callback) (ptr, sec, s, file, data);
- if (sec != NULL)
- sec = sec->next;
+ sec = sec->next;
}
- while (sec != NULL);
}
}
{
case lang_wild_statement_enum:
wild (&s->wild_statement, target, output_section_statement);
+ break;
case lang_constructors_statement_enum:
map_input_to_output_sections (constructor_list.head,
target,
padding to shrink. If padding is needed on this pass, it
will be added back in. */
s->padding_statement.size = 0;
+
+ /* Make sure output_offset is valid. If relaxation shrinks
+ the section and this pad isn't needed, it's possible to
+ have output_offset larger than the final size of the
+ section. bfd_set_section_contents will complain even for
+ a pad size of zero. */
+ s->padding_statement.output_offset
+ = dot - output_section_statement->bfd_section->vma;
break;
case lang_group_statement_enum:
{
case lang_wild_statement_enum:
lang_gc_wild (&s->wild_statement);
+ break;
case lang_constructors_statement_enum:
lang_gc_sections_1 (constructor_list.head);
break;