aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 84a2914..b5e0d02 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -649,7 +649,8 @@ 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 && 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);