Index: libc/locale/programs/ld-collate.c =================================================================== --- libc.orig/locale/programs/ld-collate.c +++ libc/locale/programs/ld-collate.c @@ -2558,14 +2558,15 @@ runp = collate->start; while (runp != NULL) { - if (runp->mbs != NULL && runp->weights != NULL) + if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character) /* Yep, the element really counts. */ ++elem_size; runp = runp->next; } +rehash: /* Add 40% and find the next prime number. */ - elem_size = MIN (next_prime (elem_size * 1.4), 257); + elem_size = next_prime (elem_size * 1.4); /* Allocate the table. Each entry consists of two words: the hash value and an index in a secondary table which provides the index @@ -2597,6 +2598,10 @@ idx += iter; if (idx >= elem_size) idx -= elem_size; + if (idx == (hash % elem_size)) { + obstack_free (&extrapool, elem_table); + goto rehash; + } } while (elem_table[idx * 2] != 0); }