Go to file
Richard W.M. Jones 3f8f9745c7 PR 31283 windmc: Parse input correctly on big endian hosts
On big endian hosts (eg. s390x) the windmc tool fails to parse even
trivial files:

  $ cat test.mc
  ;
  $ ./binutils/windmc ./test.mc
  In test.mc at line 1: parser: syntax error.
  In test.mc at line 1: fatal: syntax error.

The tool starts by reading the input as Windows CP1252 and then
converting it internally into an array of UTF-16LE, which it then
processes as an array of unsigned short (typedef unichar).

There are lots of ways this is wrong, but in the specific case of big
endian machines the little endian pairs of bytes are byte-swapped.

For example, the ';' character in the input above is first converted
to UTF16-LE byte sequence { 0x3b, 0x00 }, which is then cast to
unsigned short.  On a big endian machine the first unichar appears to
be 0x3b00.  The lexer is unable to recognize this as the comment
character ((unichar)';') and so parsing fails.

The simple fix is to convert the input to UTF-16BE on big endian
machines (and do the reverse conversion when writing the output).

Fixes: https://sourceware.org/bugzilla/show_bug.cgi?id=31283
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2024-02-08 12:14:40 +10:30
bfd Automatic date update in version.in 2024-02-08 00:00:55 +00:00
binutils PR 31283 windmc: Parse input correctly on big endian hosts 2024-02-08 12:14:40 +10:30
config
contrib
cpu sim: frv: fix -Wincompatible-function-pointer-types warnings [PR sim/29752] 2024-01-22 20:12:08 -05:00
elfcpp
etc
gas gas: x86: ginsn: handle sub-QWORD ALU with imm and MOV ops correctly 2024-02-06 16:20:53 -08:00
gdb Raise exception if ambiguous name is used in gdb.parameter 2024-02-07 19:59:32 +01:00
gdbserver gdb: LoongArch: Add LBT extension support 2024-02-06 18:40:19 +08:00
gdbsupport
gnulib
gold Updated French translations for GOLD and LD 2024-01-29 11:32:15 +00:00
gprof
gprofng gprofng: Remove unused macros 2024-02-01 13:22:52 -08:00
include bpf: there is no ldinddw nor ldabsdw instructions 2024-01-29 19:22:41 +01:00
ld Link x86-64 mark-plt-1.so with --no-as-needed 2024-02-06 17:32:31 +10:30
libbacktrace
libctf
libdecnumber
libiberty
libsframe libsframe: Fix calloc argument order in dump_sframe_header 2024-01-22 18:19:03 +01:00
opcodes bpf: there is no ldinddw nor ldabsdw instructions 2024-01-29 19:22:41 +01:00
readline
sim sim: bpf: remove support for ldinddw and ldabsdw instructions 2024-01-29 22:25:19 +01:00
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Fix disabling of year 2038 support on 32-bit hosts by default 2024-02-05 15:28:05 -03:00
configure.ac Fix disabling of year 2038 support on 32-bit hosts by default 2024-02-05 15:28:05 -03:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
SECURITY.txt
setup.com
src-release.sh
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.