source: scripts/patches/glibc-20051024-localedef_segfault-1.patch @ c0cf39e

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since c0cf39e was 11fbfa9, checked in by Jim Gifford <clfs@…>, 18 years ago

r1045@server (orig r1043): ryan | 2006-01-12 00:56:45 -0800

r1079@rei: lfs | 2006-01-12 19:13:09 +1100
Update for glibc-2.3.6
Also add option to skip libgcc_s.so.1 creation (to match cross-lfs book)


  • Property mode set to 100644
File size: 1.9 KB
  • glibc-20050926/locale/programs/3level.h

    Submitted By: Jim Gifford (patches at jg555 dot com)
    Date: 2005-09-29
    Initial Package Version: 2.3.2
    Origin: Debian
    Upstream Status: Unknown
    Description: Fixes Segfault when using localdef.
                 This problem is only noticed when using PaX
                 and some architectures besides x86.
    	     See debian bug # 231438
    
     
    old new  
    204204        }
    205205    }
    206206}
     207
     208/* GCC ATM seems to do a poor job with pointers to nested functions passed
     209   to inlined functions.  Help it a little bit with this hack.  */
     210#define wchead_table_iterate(tp, fn) \
     211do                                                                            \
     212  {                                                                           \
     213    struct wchead_table *t = (tp);                                            \
     214    uint32_t index1;                                                          \
     215    for (index1 = 0; index1 < t->level1_size; index1++)                       \
     216      {                                                                       \
     217        uint32_t lookup1 = t->level1[index1];                                 \
     218        if (lookup1 != ((uint32_t) ~0))                                       \
     219          {                                                                   \
     220            uint32_t lookup1_shifted = lookup1 << t->q;                       \
     221            uint32_t index2;                                                  \
     222            for (index2 = 0; index2 < (1 << t->q); index2++)                  \
     223              {                                                               \
     224                uint32_t lookup2 = t->level2[index2 + lookup1_shifted];       \
     225                if (lookup2 != ((uint32_t) ~0))                               \
     226                  {                                                           \
     227                    uint32_t lookup2_shifted = lookup2 << t->p;               \
     228                    uint32_t index3;                                          \
     229                    for (index3 = 0; index3 < (1 << t->p); index3++)          \
     230                      {                                                       \
     231                        struct element_t *lookup3                             \
     232                          = t->level3[index3 + lookup2_shifted];              \
     233                        if (lookup3 != NULL)                                  \
     234                          fn ((((index1 << t->q) + index2) << t->p) + index3, \
     235                              lookup3);                                       \
     236                      }                                                       \
     237                  }                                                           \
     238              }                                                               \
     239          }                                                                   \
     240      }                                                                       \
     241  } while (0)
     242
    207243#endif
    208244
    209245#ifndef NO_FINALIZE
Note: See TracBrowser for help on using the repository browser.