aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog3
-rw-r--r--ld/ldlang.c20
2 files changed, 16 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 66eaa2f..d324329 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,8 @@
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.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 4194614..71e16cc 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1133,15 +1133,21 @@ wild_section (ptr, section, file, output)
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;
+ }
}
}
}