Commit Graph

48 Commits

Author SHA1 Message Date
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
H.J. Lu 3aade68889 Remove trailing spaces in binutils 2015-08-12 04:42:37 -07:00
Nick Clifton e3ee40059d Fixes a resource exhaustion problem when running windres on a corrupt binary.
PR binutils/17512
	* resrc.c (write_rc_messagetable): Tighten check for invalid
	message lengths.
2015-02-26 12:23:18 +00:00
Nick Clifton 0897ec1581 Fixes for invalid memory accesses triggered by running windres on corrupt 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-27 17:32:23 +00:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
H.J. Lu 5bb3703f01 Remove trailing redundant `;'
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-11-09 08:29:34 +00:00
Kai Tietz 7afcdbb2bf PR binutils/13297
* resrc.c (write_rc_dialog_control): Omit text dump for
	EDITTEXT, COMBOBOX, LISTBOX, and SCROLLBAR.
2012-02-11 15:15:34 +00:00
Alan Modra dbb7c4414b * sysdep.h: Include sys/stat.h here.
* 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.
2012-02-09 04:51:44 +00:00
Kai Tietz 81472056d7 2011-10-25 Kai Tietz <ktietz@redhat.com>
* 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-25 08:03:18 +00:00
Nick Clifton bfb6c1ab1e PR binutils/13051
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.
2011-10-11 15:56:29 +00:00
Alan Modra cc5914eb31 * ar.c (print_contents): Don't internationalize strings without words.
* 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".
2010-11-17 03:35:50 +00:00
Nick Clifton 91d6fa6a03 Add -Wshadow to the gcc command line options used when compiling the binutils.
Fix up all warnings generated by the addition of this switch.
2009-12-11 13:42:17 +00:00
Alan Modra 0af1713e7c Silence gcc printf warnings 2008-07-30 04:34:58 +00:00
Carlos O'Donell c7f0a8e098 2007-10-08 Carlos O'Donell <carlos@codesourcery.com>
* 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-10-08 13:50:18 +00:00
Nick Clifton a103980969 PR binutils/4987
* resrc.c: (read_rc_file): Move 'filename' default initialization to start of function.
2007-09-17 09:58:27 +00:00
Nick Clifton 32866df75e Change sources over to using GPLv3 2007-07-05 16:54:46 +00:00
Nick Clifton c6998d15d5 * resrc.c: (read_rc_file): Add include path of user passed rc input file.
* windres.c: (windres_add_include_dir): New.
  (main): Use of windres_add_include_dir.
* windres.h: (windres_add_include_dir): Add prototype.
2007-07-05 09:51:30 +00:00
Nick Clifton 4b2c5b4af6 PR binutils/4356 binutils/591
* 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-06-06 08:02:47 +00:00
Nick Clifton 4a594fce16 Updated windres tool 2007-05-23 08:48:29 +00:00
Alan Modra 3db64b0092 bfd/
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.
2007-04-26 14:47:00 +00:00
Nick Clifton b43b5d5f76 Update FSF address 2005-05-08 14:17:41 +00:00
Nick Clifton b09a777222 PR binutils/647
* 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".
2005-01-17 16:24:12 +00:00
Kazu Hirata 50c2245bd8 * ChangeLog: Fix typos.
* 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-27 13:20:32 +00:00
Christopher Faylor b95f6b0c7e * resrc.c (define_icon): Fix storage of color attributes 'planes' and 'bit
count' in icon groups.
2003-10-02 14:13:10 +00:00
Andreas Jaeger 2da42df615 * addr2line.c: Convert to ISO C90 prototypes, change PTR, remove
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-09-14 12:20:17 +00:00
Danny Smith b9ae04920a * rcparse.y (res_text_field): New res_id variable.
(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-06-28 02:37:43 +00:00
Nick Clifton 7adbf450a7 Allow resource IDs to be strings or numbers.
Add a test for this.
2003-03-31 10:15:58 +00:00
Kazu Hirata 53c7db4bbb * rdcoff.c: Fix formatting.
* rddbg.c: Likewise.
	* readelf.c: Likewise.
	* rename.c: Likewise.
	* resbin.c: Likewise.
	* resrc.c: Likewise.
	* resres.c: Likewise.
2002-05-23 04:11:57 +00:00
Alan Modra 405c98a4e3 * rcparse.y: Remove newcmd rule. Move rcparse_discard_strings
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-05-05 23:19:32 +00:00
Nick Clifton 45b9982791 Allow two to five parameter in FONT statement of DIALOGEX resources. 2002-04-15 14:12:41 +00:00
Nick Clifton b24eb5ac22 Fix overlooked sublang shift bug.
Add testcase.
2002-04-09 17:06:14 +00:00
Nick Clifton 91eafb409b Don't add default dialog style when explicit style specified.
Print style even if it is 0.
Add testcase.
2002-04-09 15:59:13 +00:00
Nick Clifton df3baf66cb Apply patch from Bernd Herd to fix quoted class definitions inside dialogs. 2002-04-09 15:21:01 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
DJ Delorie 95fd336c5c * rcparse.y (styles): use SUBLANG_SHIFT instead of 8 (or the more
correct 10).
* resrc.c (write_rc_resource): Likewise.
* windres.h (SUBLANG_SHIFT): Define - as 10.
2001-07-17 01:19:19 +00:00
Nick Clifton 8c2bc6877d Fix typos in ChangeLogs and update copyright notices 2001-03-13 06:43:59 +00:00
DJ Delorie 6a84a0f95e * resrc.c (close_input_stream): delete extraneous logic 2000-08-30 23:06:03 +00:00
DJ Delorie 2efaf10b6d * resrc.c: use "gcc -xc" instead of -xc-header 2000-08-02 00:20:30 +00:00
DJ Delorie 2104a50e3e * rcparse.y (control): ICON controls take an id as the first
parameter, not an optional string.  Also, call new convenience
function that takes res_id's.
* resrc.c (define_control): missing text means zero-length string,
not zero ID.
(define_icon_control): New.
* windres.h: declare define_icon_control.
2000-06-13 21:21:43 +00:00
DJ Delorie 3b35ec75cb * resrc.c (close_input_stream): zero out cpp_pipe after closing it. 2000-05-26 18:46:47 +00:00
Frank Ch. Eigler 278d4456c4 * build fix
2000-02-18  Frank Ch. Eigler  <fche@redhat.com>

	* resrc.c: Remove unmatched #if for cygwin.
2000-02-19 03:59:10 +00:00
Nick Clifton 5a298d2d9c Apply Mumit Khan's patch to allow temporary file for process interconnection 2000-01-07 22:33:48 +00:00
Ian Lance Taylor 34ca6cf879 * resrc.c (write_rc_rcdata): Fix local variable shadowing
problem.  If RCDATA_BUFFER data can be read as strings, modify
	code to print the strings as comments.
	* resres.c: Add casts to avoid warnings.
	(write_res_data, read_res_data): Don't put the program name in the
	error message; fatal already puts it there.
1999-09-19 23:59:35 +00:00
Ian Lance Taylor 2481e6a24f 1999-06-23 Mumit Khan <khan@xraylith.wisc.edu>
* configure.in (HAVE_EXECUTABLE_SUFFIX): Define.
	* dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX.
	* dllwrap.c (look_for_prog): Likewise.
	* resrc.c (look_for_default): Likewise.
	* configure, config.in: Rebuild.
1999-06-22 22:50:22 +00:00
Ian Lance Taylor bb0cb4db08 Based on patches from Mumit Khan <khan@xraylith.wisc.EDU>:
* configure.in: Define EXECUTABLE_SUFFIX.
	* dlltool.c: Include "dyn-string.h".  Include <stdarg.h> based on
	ANSI_PROTOTYPES, not __STDC__.
	(outfile): Remove.
	(gen_exp_file): Change uses of outfile to use alloca.
	(make_one_lib_file, make_head, make_tail): Likewise.
	(gen_lib_file): Likewise.
	(look_for_prog): New static function.
	(deduce_name): Rewrite to use look_for_prog.
	(mcore_elf_gen_out_file): Use dyn_string_t rather than outfile.
	* dllwrap.c: Don't include <stdio.h>, <errno.h>, <string.h>,
	<stdlib.h>, or <unistd.h>.  Include <sys/stat.h> and either
	<stdarg.h> or <varargs.h>.
	(driver_name): Initialize to NULL, not "gcc".
	(dlltool_name): Initialize to NULL, not "dlltool".
	(display, inform, look_for_prog, deduce_name): New static
	functions.
	(usage): Mention -mno-cygwin.
	(OPTION_MNO_CYGWIN): Define.
	(main): Handle -mno-cygwin.  Deduce driver_name and dlltool_name.
	* resrc.c (look_for_default): Make static.  Remove unused local
	path.  Check using EXECUTABLE_SUFFIX.
	(read_rc_file): Allocate enough space to hold EXECUTABLE_SUFFIX.
	* Makefile.am: Rebuild dependencies.
	(dllwrap_LDADD): Add $(INTLLIBS).
	* configure, Makefile.in, config.in: Rebuild.
1999-06-22 20:39:46 +00:00
DJ Delorie 751d21b5b9 * windres.c: add verbose option
(main): process verbose option
* resrc.c (look_for_default): new.  Look for the default
preprocessor in a given location.
(read_rc_file): for foo/bar-windres, look for foo/bar-gcc,
foo/gcc (in case of foo/windres), and then gcc (the old default).
1999-05-25 12:10:27 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00