[v2] locale: update _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32 arrays to have types uint16_t and uint32_t respectively

Message ID 20210330172518.184058-1-yuanzi@google.com
State Superseded
Headers
Series [v2] locale: update _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32 arrays to have types uint16_t and uint32_t respectively |

Commit Message

Lirong Yuan March 30, 2021, 5:25 p.m. UTC
  steps to reproduce the problem: compile a program that uses ctype functions such as “isspace” for aarch64 with UBSan flag “-fsanitize=undefined” and run it on x86_64 machines with qemu user mode emulation.

observed behavior: UndefinedBehaviorSanitizer reports misaligned-pointer-use in the program.

solution: change the types of arrays defined in locale/C-ctype.c to correct ones as defined in ctype/ctype.h.

test suite regressions: none.
---
 locale/C-ctype.c | 244 +++++++++++++++++------------------------------
 1 file changed, 88 insertions(+), 156 deletions(-)
  

Comments

Andreas Schwab March 30, 2021, 5:57 p.m. UTC | #1
On Mär 30 2021, Lirong Yuan via Libc-alpha wrote:

> test suite regressions: none.

Did you test it on a big-endian system?

Andreas.
  
Lirong Yuan March 30, 2021, 6:04 p.m. UTC | #2
No, I haven't. Is there a recommended way to test?

Since the `_nl_C_LC_CTYPE_class` array is accessed by unsigned short
pointers, I assumed that endianness does not matter.

Regards,
Lirong


On Tue, Mar 30, 2021 at 10:57 AM Andreas Schwab <schwab@linux-m68k.org>
wrote:

> On Mär 30 2021, Lirong Yuan via Libc-alpha wrote:
>
> > test suite regressions: none.
>
> Did you test it on a big-endian system?
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
  
Andreas Schwab March 30, 2021, 6:33 p.m. UTC | #3
On Mär 30 2021, Lirong Yuan wrote:

> Since the `_nl_C_LC_CTYPE_class` array is accessed by unsigned short
> pointers, I assumed that endianness does not matter.

Of course it does, you changed an endian-independent representation to
an edian-dependent one.

Andreas.
  
Lirong Yuan March 30, 2021, 7:03 p.m. UTC | #4
Right, it changes the representation of the array, and we want to test if
it affects any existing tests in practice.
I am new to glibc development and don't know how to test beyond "make
check".
I wonder how people usually test for these kinds of changes?

Regards,
Lirong


On Tue, Mar 30, 2021 at 11:33 AM Andreas Schwab <schwab@linux-m68k.org>
wrote:

> On Mär 30 2021, Lirong Yuan wrote:
>
> > Since the `_nl_C_LC_CTYPE_class` array is accessed by unsigned short
> > pointers, I assumed that endianness does not matter.
>
> Of course it does, you changed an endian-independent representation to
> an edian-dependent one.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
  
Andreas Schwab April 1, 2021, 8:22 a.m. UTC | #5
On Mär 30 2021, Lirong Yuan via Libc-alpha wrote:

> No, I haven't. Is there a recommended way to test?

The GCC compile farm provides access to various architectures.

https://gcc.gnu.org/wiki/CompileFarm

Andreas.
  
Lirong Yuan April 1, 2021, 5:29 p.m. UTC | #6
Thanks for the information! I have applied for a GCC Compile Farm account.

"Since account moderation is done manually, it may take a few days before
the request is reviewed."

Regards,
Lirong


On Thu, Apr 1, 2021 at 1:22 AM Andreas Schwab <schwab@linux-m68k.org> wrote:

> On Mär 30 2021, Lirong Yuan via Libc-alpha wrote:
>
> > No, I haven't. Is there a recommended way to test?
>
> The GCC compile farm provides access to various architectures.
>
> https://gcc.gnu.org/wiki/CompileFarm
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
  
Adhemerval Zanella April 1, 2021, 6:55 p.m. UTC | #7
On 01/04/2021 14:29, Lirong Yuan via Libc-alpha wrote:
> Thanks for the information! I have applied for a GCC Compile Farm account.
> 
> "Since account moderation is done manually, it may take a few days before
> the request is reviewed."
> 
> Regards,
> Lirong

I have checked this patch on powerpc64-linux-gnu and unfortunately it breaks
locale.  Running localedef:

$ ./testrun.sh /home/azanella/projects/glibc/build/powerpc64-linux-gnu/locale/localedef --quiet -c -f UTF-8 -i en_US         /home/azanella/projects/g
/home/azanella/projects/glibc/build/powerpc64-linux-gnu/locale/localedef: invalid option -- 'c'
Try `localedef --help' or `localedef --usage' for more information.

It fails on the argp_parse routine (I haven't dig into to check where exactly).

The first version that uses _alias does not trigger any regression so I think
it would be a better option.  Another option is to define the arrays with a
macro that define it in the same layout regardless of the endianess, but the
alignas macro is clearly a simpler approach.
  
Lirong Yuan April 1, 2021, 7:42 p.m. UTC | #8
On Thu, Apr 1, 2021 at 11:55 AM Adhemerval Zanella <
adhemerval.zanella@linaro.org> wrote:

>
>
> On 01/04/2021 14:29, Lirong Yuan via Libc-alpha wrote:
> > Thanks for the information! I have applied for a GCC Compile Farm
> account.
> >
> > "Since account moderation is done manually, it may take a few days before
> > the request is reviewed."
> >
> > Regards,
> > Lirong
>
> I have checked this patch on powerpc64-linux-gnu and unfortunately it
> breaks
> locale.  Running localedef:
>
> $ ./testrun.sh
> /home/azanella/projects/glibc/build/powerpc64-linux-gnu/locale/localedef
> --quiet -c -f UTF-8 -i en_US         /home/azanella/projects/g
> /home/azanella/projects/glibc/build/powerpc64-linux-gnu/locale/localedef:
> invalid option -- 'c'
> Try `localedef --help' or `localedef --usage' for more information.
>
> It fails on the argp_parse routine (I haven't dig into to check where
> exactly).
>

Thanks Adhemerval for helping with regression testing!

The first version that uses _alias does not trigger any regression so I
> think
> it would be a better option.  Another option is to define the arrays with a
> macro that define it in the same layout regardless of the endianess, but
> the
> alignas macro is clearly a simpler approach.
>

Good to know that the first version does not trigger any regression.
The approach sounds good to me. Sent a v3 patch :)
http://patchwork.sourceware.org/project/glibc/patch/20210401193723.1224640-1-yuanzi@google.com/

Regards,
Lirong
  

Patch

diff --git a/locale/C-ctype.c b/locale/C-ctype.c
index bffdbedad0..c33356d5cb 100644
--- a/locale/C-ctype.c
+++ b/locale/C-ctype.c
@@ -30,160 +30,92 @@ 
    In the `_nl_C_LC_CTYPE_class' array the value for EOF (== -1)
    is set to always return 0 and the conversion arrays return EOF.  */
 
-const char _nl_C_LC_CTYPE_class[768] attribute_hidden =
-  /* 0x80 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x86 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x8c */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x92 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x98 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x9e */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xa4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xaa */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xb0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xb6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xbc */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xc2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xc8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xce */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xd4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xda */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xe0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xe6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xec */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xf2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xf8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xfe */ "\000\000" "\000\000" "\002\000" "\002\000" "\002\000" "\002\000"
-  /* 0x04 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\003\040"
-  /* 0x0a */ "\002\040" "\002\040" "\002\040" "\002\040" "\002\000" "\002\000"
-  /* 0x10 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
-  /* 0x16 */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
-  /* 0x1c */ "\002\000" "\002\000" "\002\000" "\002\000" "\001\140" "\004\300"
-  /* 0x22 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
-  /* 0x28 */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
-  /* 0x2e */ "\004\300" "\004\300" "\010\330" "\010\330" "\010\330" "\010\330"
-  /* 0x34 */ "\010\330" "\010\330" "\010\330" "\010\330" "\010\330" "\010\330"
-  /* 0x3a */ "\004\300" "\004\300" "\004\300" "\004\300" "\004\300" "\004\300"
-  /* 0x40 */ "\004\300" "\010\325" "\010\325" "\010\325" "\010\325" "\010\325"
-  /* 0x46 */ "\010\325" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
-  /* 0x4c */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
-  /* 0x52 */ "\010\305" "\010\305" "\010\305" "\010\305" "\010\305" "\010\305"
-  /* 0x58 */ "\010\305" "\010\305" "\010\305" "\004\300" "\004\300" "\004\300"
-  /* 0x5e */ "\004\300" "\004\300" "\004\300" "\010\326" "\010\326" "\010\326"
-  /* 0x64 */ "\010\326" "\010\326" "\010\326" "\010\306" "\010\306" "\010\306"
-  /* 0x6a */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306"
-  /* 0x70 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\010\306"
-  /* 0x76 */ "\010\306" "\010\306" "\010\306" "\010\306" "\010\306" "\004\300"
-  /* 0x7c */ "\004\300" "\004\300" "\004\300" "\002\000" "\000\000" "\000\000"
-  /* 0x82 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x88 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x8e */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x94 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0x9a */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xa0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xa6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xac */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xb2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xb8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xbe */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xc4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xca */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xd0 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xd6 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xdc */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xe2 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xe8 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xee */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xf4 */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-  /* 0xfa */ "\000\000" "\000\000" "\000\000" "\000\000" "\000\000" "\000\000"
-;
-const char _nl_C_LC_CTYPE_class32[1024] attribute_hidden =
-  /* 0x00 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x03 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x06 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x09 */ "\000\000\003\040" "\000\000\002\040" "\000\000\002\040"
-  /* 0x0c */ "\000\000\002\040" "\000\000\002\040" "\000\000\002\000"
-  /* 0x0f */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x12 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x15 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x18 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x1b */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
-  /* 0x1e */ "\000\000\002\000" "\000\000\002\000" "\000\000\001\140"
-  /* 0x21 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x24 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x27 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x2a */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x2d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x30 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
-  /* 0x33 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
-  /* 0x36 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
-  /* 0x39 */ "\000\000\010\330" "\000\000\004\300" "\000\000\004\300"
-  /* 0x3c */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x3f */ "\000\000\004\300" "\000\000\004\300" "\000\000\010\325"
-  /* 0x42 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\325"
-  /* 0x45 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\305"
-  /* 0x48 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x4b */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x4e */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x51 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x54 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x57 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
-  /* 0x5a */ "\000\000\010\305" "\000\000\004\300" "\000\000\004\300"
-  /* 0x5d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x60 */ "\000\000\004\300" "\000\000\010\326" "\000\000\010\326"
-  /* 0x63 */ "\000\000\010\326" "\000\000\010\326" "\000\000\010\326"
-  /* 0x66 */ "\000\000\010\326" "\000\000\010\306" "\000\000\010\306"
-  /* 0x69 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x6c */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x6f */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x72 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x75 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x78 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
-  /* 0x7b */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
-  /* 0x7e */ "\000\000\004\300" "\000\000\002\000" "\000\000\000\000"
-  /* 0x81 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x84 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x87 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x8a */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x8d */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x90 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x93 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x96 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x99 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x9c */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0x9f */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xa2 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xa5 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xa8 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xab */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xae */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xb1 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xb4 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xb7 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xba */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xbd */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xc0 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xc3 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xc6 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xc9 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xcc */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xcf */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xd2 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xd5 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xd8 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xdb */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xde */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xe1 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xe4 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xe7 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xea */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xed */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xf0 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xf3 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xf6 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xf9 */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xfc */ "\000\000\000\000" "\000\000\000\000" "\000\000\000\000"
-  /* 0xff */ "\000\000\000\000"
-;
+const uint16_t _nl_C_LC_CTYPE_class[384] attribute_hidden =
+{
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+    0x02, 0x2003, 0x2002, 0x2002, 0x2002, 0x2002, 0x02, 0x02,
+    0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+    0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+    0x6001, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004,
+    0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004,
+    0xd808, 0xd808, 0xd808, 0xd808, 0xd808, 0xd808, 0xd808, 0xd808,
+    0xd808, 0xd808, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004,
+    0xc004, 0xd508, 0xd508, 0xd508, 0xd508, 0xd508, 0xd508, 0xc508,
+    0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508,
+    0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508, 0xc508,
+    0xc508, 0xc508, 0xc508, 0xc004, 0xc004, 0xc004, 0xc004, 0xc004,
+    0xc004, 0xd608, 0xd608, 0xd608, 0xd608, 0xd608, 0xd608, 0xc608,
+    0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608,
+    0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608, 0xc608,
+    0xc608, 0xc608, 0xc608, 0xc004, 0xc004, 0xc004, 0xc004, 0x02,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+const uint32_t _nl_C_LC_CTYPE_class32[256] attribute_hidden =
+{
+    0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000,
+    0x20000, 0x20030000, 0x20020000, 0x20020000, 0x20020000, 0x20020000, 0x20000, 0x20000,
+    0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000,
+    0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000, 0x20000,
+    0x60010000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000,
+    0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000,
+    0xd8080000, 0xd8080000, 0xd8080000, 0xd8080000, 0xd8080000, 0xd8080000, 0xd8080000, 0xd8080000,
+    0xd8080000, 0xd8080000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000,
+    0xc0040000, 0xd5080000, 0xd5080000, 0xd5080000, 0xd5080000, 0xd5080000, 0xd5080000, 0xc5080000,
+    0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000,
+    0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000, 0xc5080000,
+    0xc5080000, 0xc5080000, 0xc5080000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000,
+    0xc0040000, 0xd6080000, 0xd6080000, 0xd6080000, 0xd6080000, 0xd6080000, 0xd6080000, 0xc6080000,
+    0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000,
+    0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000, 0xc6080000,
+    0xc6080000, 0xc6080000, 0xc6080000, 0xc0040000, 0xc0040000, 0xc0040000, 0xc0040000, 0x20000,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+};
 const uint32_t _nl_C_LC_CTYPE_toupper[384] attribute_hidden =
 {
   /* 0x80 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
@@ -548,7 +480,7 @@  const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
   NR_FIXED + NR_CLASSES + NR_MAPS,
   {
     /* _NL_CTYPE_CLASS */
-    { .string = _nl_C_LC_CTYPE_class },
+    { .string = (const char *) _nl_C_LC_CTYPE_class },
     /* _NL_CTYPE_TOUPPER */
     { .string = (const char *) _nl_C_LC_CTYPE_toupper },
     /* _NL_CTYPE_GAP1 */
@@ -558,7 +490,7 @@  const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
     /* _NL_CTYPE_GAP2 */
     { .string = NULL },
     /* _NL_CTYPE_CLASS32 */
-    { .string = _nl_C_LC_CTYPE_class32 },
+    { .string = (const char *) _nl_C_LC_CTYPE_class32 },
     /* _NL_CTYPE_GAP3 */
     { .string = NULL },
     /* _NL_CTYPE_GAP4 */