Fri Jul 3 14:19:06 1998 Ian Lance Taylor <ian@cygnus.com>
+ * ldlang.c (wild_section): Don't get an assertion failure if the
+ section is discarded.
+
* scripttempl/pe.sc: Use SORT to sort sections appropriately.
* emultempl/pe.em (sort_by_file_name): Remove.
(sort_by_section_name): Remove.
lang_list_init (&list);
wild_doit (&list, s, output, file);
- ASSERT (list.head != NULL && list.head->next == NULL);
- for (pp = &ptr->children.head;
- *pp != before;
- pp = &(*pp)->next)
- ASSERT (*pp != NULL);
+ /* If we are discarding the section, LIST.HEAD will
+ be NULL. */
+ if (list.head != NULL)
+ {
+ ASSERT (list.head->next == NULL);
+
+ for (pp = &ptr->children.head;
+ *pp != before;
+ pp = &(*pp)->next)
+ ASSERT (*pp != NULL);
- list.head->next = *pp;
- *pp = list.head;
+ list.head->next = *pp;
+ *pp = list.head;
+ }
}
}
}