14 lines
581 B
Diff
14 lines
581 B
Diff
diff --git a/ld/ldlang.c b/ld/ldlang.c
|
|
index b66d8c6bc1d..a909c71e771 100644
|
|
--- a/ld/ldlang.c
|
|
+++ b/ld/ldlang.c
|
|
@@ -649,7 +649,7 @@ wild_sort (lang_wild_statement_type *wild,
|
|
looking at the sections for this file. */
|
|
|
|
/* Find the correct node to append this section. */
|
|
- if (compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
|
|
+ if (sec != NULL && sec->spec.sorted != none && sec->spec.sorted != by_none && compare_section (sec->spec.sorted, section, (*tree)->section) < 0)
|
|
tree = &((*tree)->left);
|
|
else
|
|
tree = &((*tree)->right);
|