[Bug binutils/31543] New: windres announces non-PE targets as supported

2024-03-24 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31543

Bug ID: 31543
   Summary: windres announces non-PE targets as supported
   Product: binutils
   Version: 2.39
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: pali at kernel dot org
  Target Milestone: ---

Windres in documentation has described that it supports only COFF and RES
binary formats. Which is correct as the Windows resources are stored and used
only in Windows COFF formats.

But windres --help announces that it supports also lot of other non-PE targets,
including ELF target.

Trying to use use ELF target cause fatal error:

$ x86_64-w64-mingw32-windres --target="elf64-x86-64" -i test.rc -o test.o
x86_64-w64-mingw32-windres: can't get BFD_RELOC_RVA relocation type: cause of
error unknown

I think that this is a bug, windres should not accounce in --help and also
should not accept any non-COFF target. Also it should not announce or accept
PE/COFF target with MZ/PE executable header (EXE/DLL) as it cannot generate
resource-only DLL file. Windres can generate only COFF object file which is
without MZ/PE header.

This issue was described in gcc bugzilla comment:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108866#c7

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


[Bug ld/31544] New: Incorrect default subsystem version for POSIX PE binaries

2024-03-24 Thread pali at kernel dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=31544

Bug ID: 31544
   Summary: Incorrect default subsystem version for POSIX PE
binaries
   Product: binutils
   Version: 2.39
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: pali at kernel dot org
  Target Milestone: ---

GNU LD currently by default for POSIX PE binaries generated by
--subsystem=posix option sets subsystem version to 4.0.

MS LINK.EXE (via /SUBSYSTEM:POSIX) sets POSIX subsystem version to 19.90.

Version 4.0 refers to Windows version, 19.90 refers to POSIX 1990.

GNU LD should follow what MS LINK.EXE sets as POSIX PE binaries are not for
windows 4.0 subsystem.

Subsystem version via GNU LD can be explicitly set via --subsystem=posix:19.90
and this should be the default version when just --subsystem=posix is
specified.

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