From: GNU Libc Maintainers Date: Wed, 18 Jun 2025 04:49:31 +0000 (+0200) Subject: check-unknown-symbols X-Git-Tag: archive/raspbian/2.41-9+rpi1^2~79 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dc3854dec1f9c15eac08b83f73b4050d5fd9fc14;p=glibc.git check-unknown-symbols Check for unknown symbols in collation rules. This is useful to detect broken locales since unknown symbols are always wrong. This request has not been submitted upstream yet. # DP: Dpatch author: Denis Barbier # DP: Patch author: Denis Barbier # DP: Upstream status: not submitted # DP: Date: 2006-01-08 Gbp-Pq: Topic locale Gbp-Pq: Name check-unknown-symbols.diff --- diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index 7de3ba064..b978a5731 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -3515,8 +3515,20 @@ error while adding equivalent collating symbol")); } else if (arg != NULL) { + void *ptr = NULL; symstr = arg->val.str.startmb; symlen = arg->val.str.lenmb; + if (state != 5 + && find_entry (&charmap->char_table, symstr, symlen, &ptr) != 0 + && (repertoire == NULL || + find_entry (&repertoire->char_table, symstr, symlen, &ptr) != 0) + && find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0 + && find_entry (&collate->sym_table, symstr, symlen, &ptr) != 0) + { + if (verbose) + lr_error (ldfile, _("%s: symbol `%.*s' not known"), + "LC_COLLATE", (int) symlen, symstr); + } } else {