aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-07-03 22:10:22 +0000
committerIan Lance Taylor <ian@airs.com>1998-07-03 22:10:22 +0000
commitb58e666f2e2cb621ea4f7c08346a2424979eb1fa (patch)
treede79aa48f388544e850449a22345d62bf1ba04bb /ld/ldlang.c
parent7617a8228339cc990338d23ea2d35fdc57c1fca1 (diff)
downloadgdb-b58e666f2e2cb621ea4f7c08346a2424979eb1fa.zip
gdb-b58e666f2e2cb621ea4f7c08346a2424979eb1fa.tar.gz
gdb-b58e666f2e2cb621ea4f7c08346a2424979eb1fa.tar.bz2
* ldlang.c (wild_section): Don't get an assertion failure if the
section is discarded.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c20
1 files changed, 13 insertions, 7 deletions
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;
+ }
}
}
}