Bug 31543 - windres announces non-PE targets as supported
Summary: windres announces non-PE targets as supported
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.39
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-24 16:05 UTC by Pali Rohár
Modified: 2024-03-27 01:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pali Rohár 2024-03-24 16:05:55 UTC
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