[Bug ld/31179] RISC-V: The SET/ADD/SUB fix breaks ABI compatibility with 2.41 objects

2023-12-18 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31179

Richard Jones  changed:

   What|Removed |Added

 CC||rjones at redhat dot com

-- 
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

2024-01-23 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

Bug ID: 31283
   Summary: windmc (s390x) fails with: parser: syntax error
   Product: binutils
   Version: 2.43 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: rjones at redhat dot com
  Target Milestone: ---

On s390x only (does not happen on i686, x86-64, aarch64, ppc64le).

"test.mc" is a file which contains only the character ";" which
is a comment character for this Windows language.

$ ./configure --target=x86_64-w64-mingw32
$ make
$ 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.
$ git rev-parse HEAD
9c51c340028473dcfa6c72d9f58fe6dea177a535

The stack trace at the error message is:

Breakpoint 1, yyparse () at mcparse.y:80
80  | error { mc_fatal ("syntax error"); }
(gdb) bt
#0  yyparse () at mcparse.y:80
#1  0x01004322 in main (argc=, argv=)
at windmc.c:1141

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error

2024-01-23 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

Richard Jones  changed:

   What|Removed |Added

 CC||berrange at redhat dot com,
   ||dan at danny dot cz

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error

2024-01-23 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

--- Comment #1 from Richard Jones  ---
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:   0x3b0x000x0a0x000x000x00
';' '\n'

and on s390x:

0x11f75d8:  0x3b0x000x0a0x000x000x00
';' '\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  0x010089c0 in mc_set_content (src=0x11f75d0) at ./mclex.c:52
52input_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] windmc (s390x) fails with: parser: syntax error

2024-01-24 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

Richard Jones  changed:

   What|Removed |Added

 CC||rjones at redhat dot com

--- Comment #2 from Richard Jones  ---
Created attachment 15329
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15329&action=edit
0001-binutils-windmc-Parse-input-correctly-on-big-endian-.patch

Potential fix

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error

2024-01-24 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

--- Comment #4 from Richard Jones  ---
v2:

https://sourceware.org/pipermail/binutils/2024-January/132096.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/31283] windmc (s390x) fails with: parser: syntax error

2024-01-30 Thread rjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=31283

--- Comment #6 from Richard Jones  ---
v2 was accepted upstream but unfortunately not pushed yet so it
missed binutils 2.42.

-- 
You are receiving this mail because:
You are on the CC list for the bug.