Files
MINGW-packages/mingw-w64-binutils/3001-try-fix-compare_section-abort.patch
2023-02-07 17:49:29 +01:00

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);