[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error
From: |
rjones at redhat dot com |
Subject: |
[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error |
Date: |
Tue, 23 Jan 2024 22:55:00 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=31283
--- Comment #1 from Richard Jones <rjones at redhat dot com> ---
The .mc parser converts the input from windows 1252 to UTF16-LE (note:
little endian). Dumping out the UTF16-LE bytes on x86-64:
0x52f320: 0x3b 0x00 0x0a 0x00 0x00 0x00
';' '\n'
and on s390x:
0x11f75d8: 0x3b 0x00 0x0a 0x00 0x00 0x00
';' '\n'
they are the same, because they are both little endian.
However the implementation of this inside binutils/windmc.c is as an
array of unichar (unsigned short). On s390x which is big endian,
the first character is read as 0x3b00 (15104):
(gdb) frame 1
#1 0x00000000010089c0 in mc_set_content (src=0x11f75d0) at ./mclex.c:52
52 input_stream = input_stream_pos = unichar_dup (src);
(gdb) print *src
$1 = 15104
I don't see anywhere in windmc.c where the code bothers to think about
endianness ...
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/31283] New: windmc (s390x) fails with: parser: syntax error, rjones at redhat dot com, 2024/01/23
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, rjones at redhat dot com, 2024/01/23
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error,
rjones at redhat dot com <=
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, rjones at redhat dot com, 2024/01/24
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, dan at danny dot cz, 2024/01/24
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, rjones at redhat dot com, 2024/01/24
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, dan at danny dot cz, 2024/01/25
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, rjones at redhat dot com, 2024/01/30
- [Bug binutils/31283] windmc (s390x) fails with: parser: syntax error, dan at danny dot cz, 2024/01/30