]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
windres: don't exit so much on errors in read_coff_rsrc
authorAlan Modra <amodra@gmail.com>
Mon, 14 Apr 2025 09:41:53 +0000 (19:11 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 14 Apr 2025 21:29:15 +0000 (06:59 +0930)
commit9e68cae4fdfbc6c5200605764f263b01352fdfc2
treed33f2ac2a59d95e952a539514608add7c20d2f43
parent4846e543de9543bff001f58d6a47097e0edd588d
windres: don't exit so much on errors in read_coff_rsrc

windres code has the habit of exiting on any error.  That's not so
bad, but it does make oss-fuzz ineffective when testing windres.  Fix
many places that print errors and exit to instead print the error and
pass status up the call chain.  In the process of doing this, I
noticed write_res_file was calling bfd_close without checking return
status.  Fixing that resulted in lots of testsuite failures.  The
problem was a lack of bfd_set_format in windres_open_as_binary, which
leaves the output file as bfd_unknown format.  As it happens this
doesn't make any difference in writing the output binary file, except
for the bfd_close return status.
binutils/resbin.c
binutils/rescoff.c
binutils/resrc.c
binutils/resres.c
binutils/windres.c
binutils/windres.h