/* Linker command language support.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
void *data;
{
/* Don't process sections from files which were excluded. */
- if (ptr->exclude_filename != NULL)
+ if (ptr->exclude_filename_list != NULL)
{
- boolean match;
+ struct name_list *list_tmp;
+ for (list_tmp = ptr->exclude_filename_list; list_tmp; list_tmp = list_tmp->next)
+ {
+ boolean match;
- if (wildcardp (ptr->exclude_filename))
- match = fnmatch (ptr->exclude_filename, file->filename, 0) == 0 ? true : false;
- else
- match = strcmp (ptr->exclude_filename, file->filename) == 0 ? true : false;
+ if (wildcardp (list_tmp->name))
+ match = fnmatch (list_tmp->name, file->filename, 0) == 0 ? true : false;
+ else
+ match = strcmp (list_tmp->name, file->filename) == 0 ? true : false;
- if (match)
- return;
+ if (match)
+ return;
+ }
}
if (file->just_syms_flag == false)
if (w->filenames_sorted)
minfo ("SORT(");
- if (w->exclude_filename != NULL)
- minfo ("EXCLUDE_FILE ( %s )", w->exclude_filename);
- if (w->filename != NULL)
+ if (w->exclude_filename_list != NULL)
+ {
+ name_list *tmp;
+ minfo ("EXCLUDE_FILE ( %s", w->exclude_filename_list->name);
+ for (tmp=w->exclude_filename_list->next; tmp; tmp = tmp->next)
+ minfo (", %s", tmp->name);
+ minfo (")");
+ }
+ if (w->filename != NULL)
minfo ("%s", w->filename);
else
minfo ("*");
/* Update dot in the region ?
We only do this if the section is going to be allocated,
since unallocated sections do not contribute to the region's
- overall size in memory. */
+ overall size in memory.
+
+ If the SEC_NEVER_LOAD bit is not set, it will affect the
+ addresses of sections after it. We have to update
+ dot. */
if (os->region != (lang_memory_region_type *) NULL
- && (bfd_get_section_flags (output_bfd, os->bfd_section)
- & (SEC_ALLOC | SEC_LOAD)))
+ && ((bfd_get_section_flags (output_bfd, os->bfd_section)
+ & SEC_NEVER_LOAD) == 0
+ || (bfd_get_section_flags (output_bfd, os->bfd_section)
+ & (SEC_ALLOC | SEC_LOAD))))
{
os->region->current = dot;
void
lang_add_wild (section_name, sections_sorted, filename, filenames_sorted,
- keep_sections, exclude_filename)
+ keep_sections, exclude_filename_list)
const char *const section_name;
boolean sections_sorted;
const char *const filename;
boolean filenames_sorted;
boolean keep_sections;
- const char *exclude_filename;
+ struct name_list *exclude_filename_list;
{
lang_wild_statement_type *new = new_stat (lang_wild_statement,
stat_ptr);
new->filename = filename;
new->filenames_sorted = filenames_sorted;
new->keep_sections = keep_sections;
- new->exclude_filename = exclude_filename;
+ new->exclude_filename_list = exclude_filename_list;
lang_list_init (&new->children);
}