aboutsummaryrefslogtreecommitdiff
path: root/binutils/resrc.c
AgeCommit message (Collapse)AuthorFilesLines
2024-01-04Update year range in copyright notice of binutils filesAlan Modra1-1/+1
Adds two new external authors to etc/update-copyright.py to cover bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then updates copyright messages as follows: 1) Update cgen/utils.scm emitted copyrights. 2) Run "etc/update-copyright.py --this-year" with an extra external author I haven't committed, 'Kalray SA.', to cover gas testsuite files (which should have their copyright message removed). 3) Build with --enable-maintainer-mode --enable-cgen-maint=yes. 4) Check out */po/*.pot which we don't update frequently.
2023-08-03binutils sprintf optimisationAlan Modra1-7/+7
Avoid the use of sprintf with a "%s" format string, replacing with strcpy or stpcpy. Use sprintf return value rather than a later strlen. Don't use strcat where we can keep track of the end of a string output buffer. * dlltool.c (look_for_prog): memcpy prefix and strcpy prog_name. * dllwrap.c (look_for_prog): Likewise. * resrc.c (look_for_default): Likewise. Add quotes with memmove rather than allocating another buffer. * size.c (size_number): Use sprintf return value. * stabs.c (parse_stab_argtypes): Likewise. * windmc.c (write_bin): Likewes, and use stpcpy. * wrstabs.c: Similarly throughout.
2023-08-03resrc: sprintf sanitizer null destination pointerAlan Modra1-15/+9
* resrc.c (read_rc_file): Use stpcpy rather than sprintf followed by strlen. Tidy.
2023-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The newer update-copyright.py fixes file encoding too, removing cr/lf on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2022-09-01dllwrap, windres and dlltools use mktemp, which should be avoidedNick Clifton1-2/+2
PR 29534 * dllwrap.c: Replace uses of choose_temp_base() with make_temp_file(). * dlltool.c: Likewise. * resrc.c: Likewise.
2022-06-28windres: add quotes around preprocessor cmd if neededClément Chigot1-12/+14
This patch ensures that the gcc binary called by windres is quoted if needed. Otherwise, errors can occur if the gcc is under a folder having a name containing a space (eg "Program Files"). binutils/ * resrc.c (DEFAULT_PREPROCESSOR): Split into... (DEFAULT_PREPROCESSOR_CMD): that... (DEFAULT_PREPROCESSOR_ARGS): and that. (look_for_default): Add quotes around the command if needed. (read_rc_file): Adapt to new defines.
2022-05-19Fix potentially uninitialised variables in the Windows toolsNick Clifton1-1/+1
2022-01-02Update year range in copyright notice of binutils filesAlan Modra1-1/+1
The result of running etc/update-copyright.py --this-year, fixing all the files whose mode is changed by the script, plus a build with --enable-maintainer-mode --enable-cgen-maint=yes, then checking out */po/*.pot which we don't update frequently. The copy of cgen was with commit d1dd5fcc38ead reverted as that commit breaks building of bfp opcodes files.
2021-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2020-07-09Update the Windows Resource compiler (windres) to support the OWNERDRAW and ↵Nick Clifton1-0/+4
BITMAP menuitem flags. binutils* rclex.c: Add OWNERDRAW keyword. * rcparse.y: Add OWNERDRAW token. (menuitem_flag) Add BITMAP and OWNERDRAW entries. * resrc.c (write_rc_menuitems): Add support for OWNERDRAW and BITMAP flags. * windres.c (extended_menuitems): Likewise. * testsuite/binutils-all/windres/menuitem_flags.rc: New test.
2020-06-29C++ commentsAlan Modra1-1/+1
binutils isn't c99 (yet). This replaces or removes some C++ style comments. bfd/ * arc-got.h: Use C style comments. * coff-z80.c: Likewise. * elf32-csky.c: Likewise. * peXXigen.c: Likewise. * elf32-m32c.c (m32c_elf_relax_delete_bytes): Remove commented out code. binutils/ * dwarf.c: Use C style comments. * resrc.c: Likewise. gas/ * config/tc-s12z.c: Use C style comments. * config/tc-z80.c: Likewise. * config/tc-xtensa.c (emit_ld_r_n): Remove commented out code. include/ * coff/internal.h: Use C style comments. * coff/pe.h: Likewise. * elf/ppc64.h: Likewise. opcodes/ * arm-dis.c: Use C style comments. * cr16-opc.c: Likewise. * ft32-dis.c: Likewise. * moxie-opc.c: Likewise. * tic54x-dis.c: Likewise. * s12z-opc.c: Remove useless comment. * xgate-dis.c: Likewise.
2020-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2019-01-01Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2018-01-03Update year range in copyright notice of binutils filesAlan Modra1-1/+1
2017-01-02Update year range in copyright notice of all files.Alan Modra1-1/+1
2016-03-21Remove use of alloca.Nick Clifton1-1/+2
bfd * warning.m4 (GCC_WARN_CFLAGS): Add -Wstack-usage=262144 * configure: Regenerate. * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Replace use of alloca with call to xmalloc. * elf32-nds32.c: Likewise. * elf64-hppa.c: Likewise. * elfxx-mips.c: Likewise. * pef.c: Likewise. * pei-x86_64.c: Likewise. * som.c: Likewise. * xsym.c: Likewise. binutils * dlltool.c: Replace use of alloca with call to xmalloc. * dllwrap.c: Likewise. * nlmconv.c: Likewise. * objdump.c: Likewise. * resrc.c: Likewise. * winduni.c: Likewise. * configure: Regenerate. gas * atof-generic.c: Replace use of alloca with call to xmalloc. * cgen.c: Likewise. * dwarf2dbg.c: Likewise. * macro.c: Likewise. * remap.c: Likewise. * stabs.c: Likewise. * symbols.c: Likewise. * config/obj-elf.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-arc.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-avr.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-mips.c: Likewise. * config/tc-msp430.c: Likewise. * config/tc-nds32.c: Likewise. * config/tc-ppc.c: Likewise. * config/tc-sh.c: Likewise. * config/tc-tic30.c: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-xstormy16.c: Likewise. * config/te-vms.c: Likewise. * configure: Regenerate. ld * emultempl/msp430.em: Replace use of alloca with call to xmalloc. * plugin.c: Likewise. * pe-dll.c: Likewise.
2016-01-01Copyright update for binutilsAlan Modra1-1/+1
2015-08-12Remove trailing spaces in binutilsH.J. Lu1-7/+7
2015-02-26Fixes a resource exhaustion problem when running windres on a corrupt binary.Nick Clifton1-6/+12
PR binutils/17512 * resrc.c (write_rc_messagetable): Tighten check for invalid message lengths.
2015-01-27Fixes for invalid memory accesses triggered by running windres on corrupt ↵Nick Clifton1-46/+56
binaries. PR binutils/17512 * rcparse.y: Add checks to avoid integer divide by zero. * rescoff.c (read_coff_rsrc): Add check on the size of the resource section. (read_coff_res_dir): Add check on the nesting level. Check for resource names overrunning the buffer. * resrc.c (write_rc_messagetable): Update formatting. Add check of 'elen' being zero.
2015-01-02ChangeLog rotatation and copyright year updateAlan Modra1-1/+1
2014-03-05Update copyright yearsAlan Modra1-2/+1
2012-11-09Remove trailing redundant `;'H.J. Lu1-1/+1
bfd/ * aout-tic30.c (MY_final_link_callback): Remove trailing redundant `;'. * coff-h8500.c (extra_case): Likewise. (bfd_coff_reloc16_get_value): Likewise. * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Likewise. * elf.c (_bfd_elf_slurp_version_tables): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-v850.c (v850_elf_perform_relocation): Likewise. * opncls.c (bfd_calc_gnu_debuglink_crc32): Likewise. * plugin.c (add_symbols): Likewise. * reloc.c (bfd_check_overflow): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p): Likewise. binutils/ * coffgrok.c (coff_grok): Remove trailing redundant `;'. * resrc.c (open_input_stream): Likewise. gas/ * config/atof-ieee.c (gen_to_words): Remove trailing redundant `;'. * config/atof-vax.c (flonum_gen2vax): Likewise. * config/tc-d10v.c (write_2_short): Likewise. * config/tc-i386-intel.c (i386_intel_simplify): Likewise. * config/tc-s390.c (tc_s390_force_relocation): Likewise. * config/tc-v850.c (md_parse_option): Likewise. * config/tc-xtensa.c (find_address_of_next_align_frag): Likewise. * dwarf2dbg.c (out_header): Likewise. * symbols.c (dollar_label_name): Likewise. (fb_label_name): Likewise. ld/ * testplug.c (record_add_file): Remove trailing redundant `;'. opcodes/ * aarch64-opc.h (gen_mask): Remove trailing redundant `;'. * ia64-gen.c (fetch_insn_class): Likewise.
2012-02-11 PR binutils/13297Kai Tietz1-1/+7
* resrc.c (write_rc_dialog_control): Omit text dump for EDITTEXT, COMBOBOX, LISTBOX, and SCROLLBAR.
2012-02-09 * sysdep.h: Include sys/stat.h here.Alan Modra1-5/+0
* ar.c: Don't include headers already included by sysdep.h. * bucomm.c: Likewise. * budbg.h: Likewise. * dlltool.h: Likewise. * elfedit.c: Likewise. * nlmconv.c: Likewise. * objcopy.c: Likewise. * objdump.c: Likewise. * objdump.h: Likewise. * readelf.c: Likewise. * rename.c: Likewise. * resrc.c: Likewise. * strings.c: Likewise. * windres.c: Likewise. * od-macho.c: Ensure #include sysdep.h is first. * od-xcoff.c: Likewise. * dllwrap.c: Remove alloca pragma handled by sysdep.h, and remove duplicate headers. * dlltool.c: Likewise and ensure #include sysdep.h is first.
2011-10-252011-10-25 Kai Tietz <ktietz@redhat.com>Kai Tietz1-4/+8
* winduni.h (unicode_from_ascii_len): New prototype. * winduni.c (unicode_from_ascii_len): New function. * windres.h (define_stringtable): Add additional length argument. * windres.c (define_stringtable): Add length argument for string. * rcparse.y (res_unicode_sizedstring): New rule. (res_unicode_sizedstring_concat): Likewise. (string_data): Adjust rule. 2011-10-25 Kai Tietz <ktietz@redhat.com> * binutils-all/windres/strtab4.rc: New test. * binutils-all/windres/strtab4.rsd: Likewise.
2011-10-11 PR binutils/13051Nick Clifton1-16/+40
Fix a syntax error bug when compiling rc files with the VERSIONINFO resource containing more than one language block inside a single StringFileInfo block. * windint.h (rc_ver_stringtable): New structure definition. (rc_ver_info): Use it. * rcparse.y (verstringtable): New variable. (verstringtables): New type. (verstringtables:): New rule declaration. (verblocks:): Use it. * resrc.c (append_ver_stringtable): New function. (append_ver_stringfileinfo): Update to use stringtables. * windres.h (append_ver_stringfileinfo): Update declaration. (append_ver_stringtable): New declaration. * resrc.c (write_rc_versioninfo): Update to support multiple blocks. * resbin.c (bin_to_res_version): Likewise. (res_to_bin_versioninfo): Likewise. * binutils-all\windres\version.rsd: Regenerate. * binutils-all\windres\version_cat.rsd: Regenerate. * binutils-all\windres\version_mlang.rc: Add new test. * binutils-all\windres\version_mlang.rsd: Likewise.
2010-11-17 * ar.c (print_contents): Don't internationalize strings without words.Alan Modra1-2/+2
* dwarf.c (process_extended_line_op): Likewise. (process_debug_info): Likwise. (display_debug_lines_raw): Likewise. (display_debug_lines_decoded): Likewise. (display_debug_abbrev): Likewise. * readelf.c (process_file_header): Likewise. (GET_OP): Likewise. (decode_arm_unwind): Likewise. (process_mips_specific): Likewise. * resrc.c (run_cmd): Likewise. (rcparse_warning): Likewise. * objdump.c (dump_headers): Don't print "Pg".
2009-12-11Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton1-2/+2
Fix up all warnings generated by the addition of this switch.
2008-07-30Silence gcc printf warningsAlan Modra1-5/+6
2007-10-082007-10-08 Carlos O'Donell <carlos@codesourcery.com>Carlos O'Donell1-14/+33
* resrc.c (read_rc_file): Rename e to edit, and c to dir. Pass dir to windres_add_include_dir. Add comments. (close_input_stream): Check pclose error, and call fatal if the preprocessor failed. * windres.c (windres_add_include_dir): Assert that p is non-NULL, and not an empty string.
2007-09-17PR binutils/4987Nick Clifton1-3/+3
* resrc.c: (read_rc_file): Move 'filename' default initialization to start of function.
2007-07-05Change sources over to using GPLv3Nick Clifton1-1/+1
2007-07-05* resrc.c: (read_rc_file): Add include path of user passed rc input file.Nick Clifton1-0/+29
* windres.c: (windres_add_include_dir): New. (main): Use of windres_add_include_dir. * windres.h: (windres_add_include_dir): Add prototype.
2007-06-06PR binutils/4356 binutils/591Nick Clifton1-4/+35
* resrc.c (filename_need_quotes): New function. (look_for_default): If filename_need_quotes is true then quote the filename in the command line being created. (read_rc_file): Likewise.
2007-05-23Updated windres toolNick Clifton1-476/+1148
2007-04-26bfd/Alan Modra1-6/+3
Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.
2005-05-08Update FSF addressNick Clifton1-2/+2
2005-01-17PR binutils/647Nick Clifton1-5/+39
* rcparse.y (RCDATA): Allow a filename to be supplied as the parameter. Parse it with define_rcdata_file(). * resrc.c (define_rcdata_file): New function. * windres.h: Provide a prototype for the new function. * resrc.c (define_user_file): Fix typo by replacing "font file" with "file".
2003-10-27 * ChangeLog: Fix typos.Kazu Hirata1-1/+1
* ChangeLog-9197: Likewise. * ChangeLog-9899: Likewise. * NEWS: Likewise. * ar.c: Fix comment typos. * arsup.c: Likewise. * coffgrok.c: Likewise. * debug.c: Likewise. * debug.h: Likewise. * dlltool.c: Likewise. * ieee.c: Likewise. * nm.c: Likewise. * objdump.c: Likewise. * prdbg.c: Likewise. * readelf.c: Likewise. * resrc.c: Likewise. * sysinfo.y: Likewise. * windres.c: Likewise.
2003-10-02* resrc.c (define_icon): Fix storage of color attributes 'planes' and 'bitChristopher Faylor1-4/+14
count' in icon groups.
2003-09-14 * addr2line.c: Convert to ISO C90 prototypes, change PTR, removeAndreas Jaeger1-247/+119
unneeded (void *) casts. * ar.c: Likewise. * arlex.l: Likewise. * arparse.y: Likewise. * arsup.c: Likewise. * binemul.c: Likewise. * binemul.h: Likewise. * bucomm.c: Likewise. * bucomm.h: Likewise. * budbg.h: Likewise. * budemang.c: Likewise. * budemang.h: Likewise. * coffdump.c: Likewise. * coffgrok.c: Likewise. * cxxfilt.c: Likewise. * debug.c: Likewise. * debug.h: Likewise. * deflex.l: Likewise. * dlltool.c: Likewise. * dlltool.h: Likewise. * dllwrap.c: Likewise. * emul_aix.c: Likewise. * filemode.c: Likewise. * ieee.c: Likewise. * nlmconv.c: Likewise. * nlmconv.h: Likewise. * nlmheader.y: Likewise. * nm.c: Likewise. * prdbg.c: Likewise. * rclex.l: Likewise. * rcparse.y: Likewise. * rdcoff.c: Likewise. * rddbg.c: Likewise. * rename.c: Likewise. * resbin.c: Likewise. * rescoff.c: Likewise. * resrc.c: Likewise. * size.c: Likewise. * srconv.c: Likewise. * stabs.c: Likewise. * strings.c: Likewise. * sysdump.c: Likewise. * sysinfo.y: Likewise. * syslex.l: Likewise. * unwind-ia64.c: Likewise. * unwind-ia64.h: Likewise. * version.c: Likewise. * windres.c: Likewise. * windres.h: Likewise. * winduni.c: Likewise. * wrstabs.c: Likewise.
2003-06-28 * rcparse.y (res_text_field): New res_id variable.Danny Smith1-1/+1
(res_null_text): New static const struct res_id object, with empty unicode name field. (control): Pop parsing of optresidc up one level. Set res_text_field to $2 except for controls which do not accept a text field. Set res_text_field to res_null_text for the special cases (viz. COMBOBOX, EDITTEXT, LISTBOX, SCROLLBAR). (control_params): Adjust to use res_text_field rather than optresidc. (COMBOBOX): Add comment about discrepency between documented vs. observed default style. * resrc.c (define_control): Make first param const. * windres.h (define_control): Adjust prototype. testsuite: * binutils-all/windres/checkbox.rc: New file. * binutils-all/windres/checkbox.rsd: New file. * binutils-all/windres/combobox.rc: New file. * binutils-all/windres/combobox.rsd: New file. * binutils-all/windres/edittext.rc: New file. * binutils-all/windres/edittext.rsd: New file. * binutils-all/windres/listbox.rc: New file. * binutils-all/windres/listbox.rsd: New file. * binutils-all/windres/scrollbar.rc: New file. * binutils-all/windres/scrollbar.rsd: New file.
2003-03-31Allow resource IDs to be strings or numbers.Nick Clifton1-7/+8
Add a test for this.
2002-05-23 * rdcoff.c: Fix formatting.Kazu Hirata1-26/+26
* rddbg.c: Likewise. * readelf.c: Likewise. * rename.c: Likewise. * resbin.c: Likewise. * resrc.c: Likewise. * resres.c: Likewise.
2002-05-05 * rcparse.y: Remove newcmd rule. Move rcparse_discard_stringsAlan Modra1-0/+1
call to rules that need no lookahead. Check for no lookahead. * rclex.l (get_string): Correct "strings" list handling. * resrc.c (read_rc_file): Discard strings.
2002-04-15Allow two to five parameter in FONT statement of DIALOGEX resources.Nick Clifton1-2/+5
2002-04-09Fix overlooked sublang shift bug.Nick Clifton1-1/+2
Add testcase.
2002-04-09Don't add default dialog style when explicit style specified.Nick Clifton1-3/+7
Print style even if it is 0. Add testcase.
2002-04-09Apply patch from Bernd Herd to fix quoted class definitions inside dialogs.Nick Clifton1-5/+5