diff options
author | Alexey Neyman <stilor@att.net> | 2017-08-24 23:24:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 23:24:09 (GMT) |
commit | 1b3ed29eb9add1b9bc9773fe2565cc5af09810a8 (patch) | |
tree | 1a2693774071358985340fbbc70c3fb4fc5ba928 /packages/glibc/2.15/170-localedef-fix-trampoline.patch | |
parent | 8e8417226d5cdd90896df2c585ad03a995e5e9a1 (diff) | |
parent | 961ea1938204e4fc9199c2ff5933caaa1e3d0710 (diff) |
Merge pull request #810 from stilor/fix-patching-ports
Fix patching ports
Diffstat (limited to 'packages/glibc/2.15/170-localedef-fix-trampoline.patch')
-rw-r--r-- | packages/glibc/2.15/170-localedef-fix-trampoline.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/packages/glibc/2.15/170-localedef-fix-trampoline.patch b/packages/glibc/2.15/170-localedef-fix-trampoline.patch new file mode 100644 index 0000000..3cc6559 --- /dev/null +++ b/packages/glibc/2.15/170-localedef-fix-trampoline.patch @@ -0,0 +1,53 @@ +# DP: Description: Fix localedef segfault when run under exec-shield, +# PaX or similar. (#231438, #198099) +# DP: Dpatch Author: James Troup <james@nocrew.org> +# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com> +# DP: Upstream status: Unknown +# DP: Status Details: Unknown +# DP: Date: 2004-03-16 +diff -durN glibc-2.13.orig/locale/programs/3level.h glibc-2.13/locale/programs/3level.h +--- glibc-2.13.orig/locale/programs/3level.h 2007-07-16 02:54:59.000000000 +0200 ++++ glibc-2.13/locale/programs/3level.h 2009-11-13 00:49:56.000000000 +0100 +@@ -203,6 +203,42 @@ + } + } + } ++ ++/* GCC ATM seems to do a poor job with pointers to nested functions passed ++ to inlined functions. Help it a little bit with this hack. */ ++#define wchead_table_iterate(tp, fn) \ ++do \ ++ { \ ++ struct wchead_table *t = (tp); \ ++ uint32_t index1; \ ++ for (index1 = 0; index1 < t->level1_size; index1++) \ ++ { \ ++ uint32_t lookup1 = t->level1[index1]; \ ++ if (lookup1 != ((uint32_t) ~0)) \ ++ { \ ++ uint32_t lookup1_shifted = lookup1 << t->q; \ ++ uint32_t index2; \ ++ for (index2 = 0; index2 < (1 << t->q); index2++) \ ++ { \ ++ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \ ++ if (lookup2 != ((uint32_t) ~0)) \ ++ { \ ++ uint32_t lookup2_shifted = lookup2 << t->p; \ ++ uint32_t index3; \ ++ for (index3 = 0; index3 < (1 << t->p); index3++) \ ++ { \ ++ struct element_t *lookup3 \ ++ = t->level3[index3 + lookup2_shifted]; \ ++ if (lookup3 != NULL) \ ++ fn ((((index1 << t->q) + index2) << t->p) + index3, \ ++ lookup3); \ ++ } \ ++ } \ ++ } \ ++ } \ ++ } \ ++ } while (0) ++ + #endif + + #ifndef NO_FINALIZE |