1 Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
3 Initial Package Version: 2.5
4 Upstream Status: Rejected - http://sources.redhat.com/bugzilla/show_bug.cgi?id=3333
5 Origin: Fedora's glibc-fedora.patch (via glibc-2.5.90-21)
6 Description: Avoid segmentation faults, or kills, on PaX and Exe-Shield kernels,
7 and some non-x86 architectures.
9 * Sun Jun 01 2003 Jakub Jelinek <jakub@redhat.com> 2.3.2-46
10 - avoid using trampolines in localedef
12 This patch is also known as:
13 local-localedef-fix-trampoline.diff (Debian)
14 1040_all_2.3.3-localedef-fix-trampoline.patch (Gentoo)
17 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=231438
19 diff -Naur glibc-2.5.orig/locale/programs/3level.h glibc-2.5/locale/programs/3level.h
20 --- glibc-2.5.orig/locale/programs/3level.h 2005-12-07 05:47:27.000000000 +0000
21 +++ glibc-2.5/locale/programs/3level.h 2006-10-11 08:05:00.000000000 +0000
27 +/* GCC ATM seems to do a poor job with pointers to nested functions passed
28 + to inlined functions. Help it a little bit with this hack. */
29 +#define wchead_table_iterate(tp, fn) \
32 + struct wchead_table *t = (tp); \
34 + for (index1 = 0; index1 < t->level1_size; index1++) \
36 + uint32_t lookup1 = t->level1[index1]; \
37 + if (lookup1 != ((uint32_t) ~0)) \
39 + uint32_t lookup1_shifted = lookup1 << t->q; \
41 + for (index2 = 0; index2 < (1 << t->q); index2++) \
43 + uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
44 + if (lookup2 != ((uint32_t) ~0)) \
46 + uint32_t lookup2_shifted = lookup2 << t->p; \
48 + for (index3 = 0; index3 < (1 << t->p); index3++) \
50 + struct element_t *lookup3 \
51 + = t->level3[index3 + lookup2_shifted]; \
52 + if (lookup3 != NULL) \
53 + fn ((((index1 << t->q) + index2) << t->p) + index3, \