* ldlang.c (wild_section): Don't get an assertion failure if the
authorIan Lance Taylor <ian@airs.com>
Fri, 3 Jul 1998 22:10:22 +0000 (22:10 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 3 Jul 1998 22:10:22 +0000 (22:10 +0000)
section is discarded.

ld/ChangeLog
ld/ldlang.c

index 66eaa2fe169ab76388fa6db4b4bc84230b8a7ff4..d3243298cd420d07005cfa1ee15183f3a1e3e04e 100644 (file)
@@ -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.
index 41946145554dbb58c9ff873774ef2b9ab14ccaf5..71e16ccf7f0ef52e0611ecd2b1d1f6b912ee8413 100644 (file)
@@ -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;
+                   }
                }
            }
        }