Commit Graph

50 Commits

Author SHA1 Message Date
Nick Clifton 86eafac0aa Fix memory access violations triggered by running strip on fuzzed binaries.
PR binutils/17512
	* coffcode.h (coff_set_arch_mach_hook): Check return value from
	bfd_malloc.
	(coff_slurp_line_table): Return FALSE if the line number
	information was corrupt.
	(coff_slurp_symbol_table): Return FALSE if the symbol information
	was corrupt.
	* mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
	initialise the fields of the dyld_info structure.
	(bfd_mach_o_build_exec_seg_command): Replace assertion with an
	error message and a return value.
	(bfd_mach_o_layout_commands): Change the function to boolean.
	Return FALSE if the function fails.
	(bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
	fails.
	(bfd_mach_o_read_command): Fail if an unrecognised command is
	encountered.
	* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
	read fails.
	(slurp_symtab): Check the return from bfd_malloc.
	(_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
	encountered an error.
	(_bfd_XXi_final_link_postscript): Fail if a section could not be
	copied.
	* peicode.h (pe_bfd_object_p): Fail if the header could not be
	swapped in.
	* tekhex.c (first_phase): Fail if the section is too big.
	* versados.c (struct esdid): Add content_size field.
	(process_otr): Use and check the new field.
	(versados_get_section_contents): Check that the section exists and
	that the requested data is available.

	PR binutils/17512
	* addr2line.c (main): Call bfd_set_error_program_name.
	* ar.c (main): Likewise.
	* coffdump.c (main): Likewise.
	* cxxfilt.c (main): Likewise.
	* dlltool.c (main): Likewise.
	* nlmconv.c (main): Likewise.
	* nm.c (main): Likewise.
	* objdump.c (main): Likewise.
	* size.c (main): Likewise.
	* srconv.c (main): Likewise.
	* strings.c (main): Likewise.
	* sysdump.c (main): Likewise.
	* windmc.c (main): Likewise.
	* windres.c (main): Likewise.
	* objcopy.c (main): Likewise.
	(copy_relocations_in_section): Check for relocs without associated
	symbol pointers.
2015-01-21 17:37:23 +00:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Chen Gang 137d1369ac Fix windres memory leak
* windres.c (open_file_search): Free path buffer on failure.
2014-12-09 17:31:55 +10:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Cory Fields 0cb112f740 * windres.c (define_resource): Use zero for timestamp, making
output deterministic. time.h include is no longer needed.
	* resres.c (res_append_resource): Likewise.

	* pe-dll.c (fill_edata): Only use a real timestamp if
	--insert-timestamp was used.
	* emultempl/pe.em: Add the --insert-timestamp option.
	* emultempl/pep.em: Likewise for 64bit.
	* ld.texinfo: Document the --insert-timestamp option.

	* libcoff-in.h: Add insert_timestamp flag to the pe_data struct.
	* libcoff.h: Regenerate.
	* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real
	timestamp if --insert-timestamp was used.
2013-11-22 14:55:56 +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
Nick Clifton cc643b88f1 Fix spelling mistakes. 2011-06-02 13:43:24 +00:00
Nick Clifton ec25acb399 * windres.c (usage): Add new --preprocessor-arg option.
(option_values): Add new OPTION_PREPROCESSOR_ARG enumerator.
	(option long_options): Add preprocessor-arg option.
	(main): Handle it.
	* doc/binutils.texi: Add documentation for --preprocessor-arg
	option.
	* NEWS: Add line about new --preprocessor-arg option for windres.

	* binutils-all/windres/windres.exp: Add '// cpparg <option>' command
	to rc file interpretation to specify addition pre-processor commands
	as script option.
	* binutils-all/windres/strtab3.rc: New.
	* binutils-all/windres/strtab3.rsd: New.
	* binutils-all/windres/README: Add note about cpparg script option.
	argument
2011-04-13 07:50:15 +00:00
Nick Clifton 83bcb37903 PR binutils/11711
* windres.c (enum option_values): New enum.
        (long_options): Use separate option number for --include-dir
        option.
        (main): Separate backwards compatibility check from code to
        implement --include-dir.  Check to see if directory exists and do
        not complain if it does.
2010-06-17 13:55:35 +00:00
Kai Tietz c4d1af07ab 2009-11-16 Kai Tietz <kai.tietz@onevision.com>
* windmc.c (set_endianess): Use bfd_get_target_info.
        * windres.c (set_endianess): Likewise.
        (find_arch_match): Removed.
2009-11-16 11:12:37 +00:00
Nick Clifton 8b31b6c4c8 * obcopy.c (copy_object): New parameter `input_arch', architecture
of input file, if not specified in input file itself; all callers
       updated; `binary_architecture' hack removed.
       (copy_archive, copy_file): New parameter `input_arch', for
       `copy_object' usage.
       (copy_main): Accept `-B' (`--binary-architecture') option also
       for any arch-less input ifile format, not only `binary'; remove
       bfd_external_binary_architecture hack; instead, add `input_arch'
       to calls to `copy_file'.
       * windres.c, windmc.c : Obsolete and useless external references
       to `bfd_external_binary_architecture' or `bfd_external_machine'
       removed.

       * binary.c (binary_object_p): Remove bfd_external_binary_architecture
       hack.  objcopy `-B' (`--binary-architecture') option is now handled
       in a generic way.
2009-09-11 11:16:19 +00:00
Alan Modra aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Kai Tietz 48b2f7b2de 2009-02-09 Kai Tietz <kai.tietz@onevision.com>
* windres.c (set_endianess): Copy name without leading '-'.
2009-02-09 15:40:24 +00:00
Kai Tietz 1069ad51f4 2009-01-06 Kai Tietz <kai.tietz@onevision.com>
* windres.c (set_endianess): Get architecture name
        for internal target names like "pe-arm-wince-little".
        (find_arch_match): New helper.
        * ChangeLog: Reset it.
        * ChangeLog-2008: Moved old ChangeLog.
2009-01-06 15:36:05 +00:00
Alan Modra 78aff5a527 Remove unnecessary casts on obstack_alloc invocations. 2008-10-21 00:26:17 +00:00
Nick Clifton d25576aadb PR binutils/55326
* bucomm.c (list_supported_architectures): Free architecture list after use.
   * windres.c (set_endianess): Likewise.
   * windmc.c (set_endianess): Likewise.
2008-01-09 10:40:32 +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 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 d856f2ddfa * rclex.c: (cpp_line): Add code_page pragma support.
* windres.c: (usage, long_options, main): Add new option --codepage or -c.
* winduni.c: (wind_default_codepage, wind_current_codepage): New.
  (unicode_from_ascii, ascii_from_unicode): Use wind_current_codepage as codepage parameter.
  (unicode_print): Print 4 characters for hexadecimal values in unicode strings.
* winduni.h:  (wind_default_codepage, wind_current_codepage): Export.
* doc/binutils.texi: Document new option.
* NEWS: Mention new feature.
2007-06-18 15:30:33 +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
Joseph Myers 92f01d6100 top level:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting.
	* configure: Regenerate.

bfd:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-pkgversion): New option.
	* configure: Regenerate.
	* Makefile.am (bfdver.h): Substitute for @bfd_version_package@.
	* Makefile.in: Regenerate.
	* version.h (BFD_VERSION_STRING): Define using
	@bfd_version_package@.

bfd/doc:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* Makefile.in: Regenerate.

binutils:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* bucomm.h: Remove include of bin-bugs.h.
	* addr2line.c (usage): Don't print empty REPORT_BUGS_TO.
	* ar.c (usage): Pass s to list_supported_targets.  Don't print
	empty REPORT_BUGS_TO.
	* coffdump.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* cxxfilt.c (usage): Print bug url when giving help.
	* dlltool.c (usage): Likewise.
	* dllwrap.c (usage): Likewise.
	* nlmconv.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* nm.c (usage): Likewise.
	* objcopy.c (copy_usage, strip_usage): Likewise.
	* objdump.c (usage): Likewise.
	* readelf.c ((usage): Likewise. Add STREAM argument.  Adjust
	callers.
	* size.c (usage): Don't print empty REPORT_BUGS_TO.
	* srconv.c (show_usage): Likewise.
	* strings.c (usage): Likewise.
	* sysdymp.c (show_usage): Likewise.
	* windres.c (usage): Likewise.

gas:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* dep-in.sed: Remove bin-bugs.h.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	(DEP_INCLUDES): Likewise.
	($(OBJS)): No longer depend on bin-bugs.h.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* as.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* as.h: Remove include of bin-bugs.h.

gprof:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-pkgversion, --with-bugurl): New options.
	* configure: Regenerate.
	* Makefile.am (PKGVERSION, REPORT_BUGS_TO): Define.
	(INCLUDES): Define PKGVERSION and REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* gprof.c (usage): Don't print empty REPORT_BUGS_TO.
	(main): Include PKGVERSION in version output.
	* gprof.h: Remove include of bin-bugs.h.

include:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* bin-bugs.h: Remove.

ld:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* ld.h: Remove include of bin-bugs.h.
	* lexsup.c (help): Don't print empty REPORT_BUGS_TO.
2007-02-17 13:33:57 +00:00
Mark Mitchell 07012eeef2 * addr2line.c (usage): Document @file.
* ar.c (usage): Likewise.
	* coffdump (usage): Likewise.
	* cxxfilt.c (usage): Likewise.
	* dlltool.c (usage): Likewise.
	* dllwrap.c (usage): Likewise.
	* nlmconv.c (usage): Likewise.
	* nm.c (usage): Likewise.
	* objcopy.c (usage): Likewise.
	* objdump.c (usage): Likewise.
	* readelf.c (usage): Likewise.
	* size.c (usage): Likeise.
	* srconv.c (usage): Likewise.
	* strings.c (usage): Likewise.
	* windres.c (usage): Likewise.
	* doc/binutils.texi: Add section on common options.
2005-10-03 19:37:44 +00:00
Mark Mitchell c843b1bbc1 * dlltool.c (main): Fix typo.
* windres.c (main): Likewise.
2005-09-30 20:04:21 +00:00
Mark Mitchell 869b9d07bb * addr2line.c (main): Likewise.
* ar.c (main): Likewise.
	* coffdump.c (main): Likewise.
	* cxxfilt.c (main): Likewise.
	* dlltool.c (main): Likewise.
	* dllwrap.c (main): Likewise.
	* nlmconv.c (main): Likewise.
	* nm.c (main): Likewise.
	* objcopy.c (main): Likewise.
	* objdump.c (main): Likewise.
	* readelf.c (main): Likewise.
	* size.c (main): Likeiwse.
	* srcconv.c (main): Likewise.
	* strings.c (main): Likewise.
	* sysdump.c (main): Likewise.
	* sysinfo.c (main): Likewise.
	* windres.c (main): Likewise.

	* ldmain.c (main): Use expandargv.

	* gprof.c (main): Use expandargv.

	* as.c (main): Use expandargv.
2005-09-30 16:37:32 +00:00
Nick Clifton b43b5d5f76 Update FSF address 2005-05-08 14:17:41 +00:00
Alan Modra aef6203bd6 update copyright dates 2005-03-03 11:52:12 +00:00
Alan Modra 0af6db78f3 * deflex.l (YY_NO_UNPUT): Define.
* rclex.l (YY_NO_UNPUT): Define.
	* rcparse.y (null_unichar): New static var.
	(res_null_text): Use it rather than attempting to init from wchar_t.
	* windres.c: Include assert.h and time.h before getopt.h.
	Include config.h and unistd.h too.
2005-02-17 12:59:59 +00:00
Nick Clifton d412a550d4 strings.c (usage): Place radix values for -t option into the correct order.
objcopy.c (add_redefine_syms_file): Change error messages to use
  <filename>:<linenumber>: format for easier parsing by automatic tools.

srconv.c (show_usage): Fix spelling typo.

windres.c (format_from_filename): Suggest the use of -J instead	of -I if the
  file type cannot be determined.
2004-10-18 14:04:40 +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
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
Nick Clifton 32df89660f Accept -fo as an alias for -o 2003-04-23 09:00:22 +00:00
Nick Clifton 85eb51104b Rename -I to -J. Deprecate old use of -I, but leave it enabled for now. 2003-04-22 17:31:08 +00:00
Nick Clifton 3077f5d8b2 Add -l for compatibility with wrc, and rc. Use the short option as a key for
long options that have a synonymous short option.
2003-04-05 08:21:47 +00:00
Nick Clifton 29b058f1b4 Add -U for compatibility with wrc, rc, and cpp. Just pass the -U option down
to the preprocessor.
2003-04-03 13:40:51 +00:00
Christopher Faylor 3126d709ed * windres.c (usage): Report -r option.
(main): Ignore the -r option.
* doc/binutils.texi: Add -r to the list of options.
2003-04-01 23:09:29 +00:00
Alan Modra e80ff7de61 * dlltool.c (process_def_file): Add missing prototype.
(new_directive, assemble_file, main): Likewise.
	(process_def_file, new_directive): Make static.
	(inform): Rewrite using VA_FIXEDARG.
	* dllwrap.c (mybasename): Add missing prototype.
	(strhash, main): Likewise.
	(inform): Rewrite using VA_FIXEDARG.
	(warn): Likewise.
	(cleanup_and_exit): Use old style function definition.
	(strhash): Likewise.
	* windres.c (define_resource): Use one memset to clear all of
	struct res_resource.
2002-05-05 23:25:27 +00:00
Nick Clifton f7d63484de Set default LANGUAGE to english/us. 2002-04-09 16:55:48 +00:00
Nick Clifton 8b53311e10 Tidy up formatting of --help output. 2002-01-23 16:12:56 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Nick Clifton 8c2bc6877d Fix typos in ChangeLogs and update copyright notices 2001-03-13 06:43:59 +00:00
Alan Modra 37cc8ec1be A mostly cosmetic tidy up of warnings and error message reporting. 2000-04-07 04:34:50 +00:00
Alan Modra 8ad3436c79 Move translated part of bug report string back into .c files so
xgettext can find it.  Regnerate .pot files.
2000-04-04 14:32:35 +00:00
Alan Modra c20f4f8c21 Move bug report string to one place. 2000-04-03 14:10:05 +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
Andreas Schwab 32a5c94a56 * windres.c (usage): Fix typo. 1999-06-07 03:16:55 +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
DJ Delorie 09cda596de 1999-05-10 DJ Delorie <dj@cygnus.com>
* windres.c (quot): Quote shell metacharacters in a string
	(main): quote parameters to cpp that might have metacharacters in
	them.  Allow -D as an alias for --define to allow for sharing make
	macros with gcc.
	* objdump.c (dump_reloc_set): don't core if howto->name is NULL
	* Makefile.am: Give rescoff.c a cpu-specific -D so it can set
	the correct BFD.
	* Makefile.in: ditto
	* rescoff.c (write_coff_file): Set the correct BFD
1999-05-11 21:06:16 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00