Commit Graph

34 Commits

Author SHA1 Message Date
Ian Lance Taylor 7f924d5516 * version.c (print_version): New function.
* bucomm.h (print_version): Declare.
	* ar.c (program_version): Don't declare.
	(do_show_version): Remove.
	(usage): Add help parameter.  Print bug report address.
	(main): Set is_ranlib at start.  Check for --help and --version.
	Call print_version, not do_show_version.
	* nlmconv.c (program_version): Don't declare.
	(main): Call print_version.
	(show_usage): Print bug report address.
	* nm.c (program_version, print_version): Don't declare.
	(usage): Print bug report address.
	(main): Call print_version.
	* objcopy.c (program_version): Don't declare.
	(copy_usage): Print bug report address.
	(strip_usage): Likewise.
	(strip_main): Call print_version.
	(copy_main): Likewise.
	* objdump.c (program_version): Don't declare.
	(usage): Print bug report address.
	(main): Call print_version.
	* size.c (program_version): Don't declare.
	(usage): Print bug report address.
	(main): Call print_version.
	* strings.c (program_version): Don't declare.
	(main): Call print_version.
	(usage): Print bug report address.
	* Makefile.in: Update dependencies.
1996-10-01 19:10:40 +00:00
Ian Lance Taylor cbd0453da4 Rename truncate to ar_truncate 1995-07-04 20:38:00 +00:00
Ian Lance Taylor 52af6a44ad * ar.c (replace_members): In verbose messages, use 'r' when
replacing a member, and 'a' when adding one.

	* ar.c (truncate): New static variable.
	(normalize): Change return type to const char *.  Add abfd
	argument.  Change all callers.  If truncate, chop the filename to
	abfd->ar_max_namelen.
	(main): For the 'f' modifier, set truncate to true.  Don't change
	quick_append to replace to truncate is true.
	(do_quick_append): If truncate, set BFD_TRADITIONAL_FORMAT.
	(write_archive): Likewise.
	* binutils.texi, ar.1: Document 'f' modifier.
PR 6888.
1995-07-04 20:28:29 +00:00
Fred Fish 8190614e91 * ar.c: (extract_file): Change "#if POSIX_UTIME" to
"#ifdef POSIX_UTIME" to match other tests of POSIX_UTIME
	and avoid lossage when POSIX_UTIME is not defined at all.
1995-07-01 19:28:13 +00:00
Steve Chamberlain 6f2d32120e * ar.c: (print_contents.c, extract_file, do_quick_append):
Malloc buffers rather than allocate on stack (so it works
	on NT).
	* deflex.l: Names can have an @ in them.
	* dlltool.c: Loads of stuff. Can now generate .imp files which
	work with NT .dlls.
1995-06-29 00:59:07 +00:00
Ian Lance Taylor f618f758e9 * ar.c (main): Don't call do_quick_append if any of the archive
names are longer than 14 characters.
PR 5966.
1994-11-17 23:03:30 +00:00
Ian Lance Taylor 02354a0f8d * ar.c: Include libiberty.h.
(inarch): Remove variable.
	(map_over_members): Make static.  Add arch argument, and use it
	instead of inarch.  Change all callers.
	(main): Treat --version as -v.  Accept -t argument.  Accept any
	number of archive arguments.  Catch and use open_inarch return
	value, rather than using inarch.
	(open_inarch): Return newly opened BFD, rather than using inarch.
	(do_quick_append): Make archive_filename const.
	(write_archive): Add iarch argument, and use it instead of inarch.
	Change all callers.
	(delete_members, move_members, replace_members): Likewise.
	(ranlib_only): Don't exit on success.  Catch and use open_inarch
	return value.
	(ranlib_touch): New function.
	* arsup.h (map_over_members): Don't declare.
	(ar_end, ar_extract): Declare.
	(open_inarch): Change return value in declaration to bfd *.
	* arsup.c (map_over_list): Make static. Always pass two arguments
	to function.  Add arch argument, and use it instead of inarch.
	Change all callers.
	(ar_directory_doer): Make static.  Add ignored second argument.
	Change all callers.
	(ar_directory): Use open_inarch return value rather than inarch.
	(ar_addlib_doer): Make static.
	(ar_addlib): Use open_inarch return value rather than inarch.
	(ar_extract): Remove unused local variable abfd.
1994-08-22 21:14:43 +00:00
Steve Chamberlain 9fdf266ccc * ar.c (move_members): Fix it so that the abi positional modifiers
don't delete all archive members following the insert point.
1994-03-09 21:53:54 +00:00
Stan Shebs 6eb243a23d Sat Feb 26 13:35:26 1994 Stan Shebs (shebs@andros.cygnus.com)
* ar.c (do_quick_append): Pad with a genuine character 10,
	rather than whatever '\n' might happen to be.
1994-02-26 21:38:04 +00:00
David MacKenzie 0c5dc23cc9 * nlmconv.c (main): Use bfd_get_flavour instead of struct member.
* ar.c (print_contents, extract_file), size.c
	(print_berkeley_format): Use bfd_get_filename and
	bfd_my_archive instead of dereferencing the structs directly.
1994-02-03 01:39:10 +00:00
David MacKenzie 0c62139f90 * ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit.
Indent.  Remove DEFUNs.
1994-02-03 00:42:37 +00:00
David MacKenzie cef35d4882 * nlmconv.c (main), objcopy.c (copy_file): Print matching formats
if ambiguous match.
	* nm.c (display_file), size.c (display_bfd): Eliminate gotos.
	Print matching formats if there is an ambiguous match.  Use
	bfd_nonfatal instead of hardcoded error message if nothing matches.

	* arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of
	abfd->filename.

	* nm.c (display_archive): New function, from code in display_file.
	(display_rel_file): Renamed from do_one_rel_file.

	* size.c: Indent.
	(display_archive): New function from code in display_file.
	(display_file): Check bfd_close error return.

	* strings.c (strings_object_file): Check bfd_check_format
	error return.

	* strings.c, objdump.c, size.c: Use bfd_nonfatal instead of bfd_perror.

	* bucomm.c: Delete references to exit_handler.  It wasn't set
	anywhere, and now that we're using the libiberty xmalloc, it
	wouldn't always get called before exiting.
	(list_matching_formats): Function moved from objdump.c.
	* bucomm.h: Declare it.

	* objdump.c (disassemble_data): Move some variable decls closer to
	their use.  Add some comments.  Replace a nested block with a
	return.
1994-02-03 00:25:30 +00:00
Stan Shebs 3785367375 Minor MPW compatibility tweaks. 1994-01-23 00:31:14 +00:00
Ian Lance Taylor 6336b309dc gcc -Wall lint:
* ar.c (main): Put parens around assignment used as truth value.
	* objdump.c (display_bfd): Declare return value as void.
	(stab_print): Use "" instead of 0 to initialize array.
	(dump_stabs_1): Print vma using printf_vma.
	(display_info): Put parens around assignment used as truth value.
	* strings.c (print_strings): Cast printf arguments.
1993-12-23 17:29:06 +00:00
David MacKenzie 3602ba8163 Add hyphens in usage messages. 1993-04-29 06:55:21 +00:00
David MacKenzie d244269886 Clean up usage messages and option parsers.
Add program name to some error messages.
1993-04-29 06:45:39 +00:00
John Gilmore e87cc81623 Missed one use of PROTO. 1992-11-05 12:08:17 +00:00
John Gilmore 151a6341c6 Clean up some old BFD ansification macros.
* arsup.h, bucomm.h, objdump.h:  Remove EXFUN from binutils.
It still remains as a local macro in gmalloc.c, which is derived
from some other copy of GNU Malloc somewhere (FIXME).

* ar.c, objdump.c, size.c:  Replace EXFUN with PROTO.  Make static
fns really static.
* arsup.h:  Declare extract_files.
1992-11-05 12:01:44 +00:00
Ian Lance Taylor 42b600fa46 Mon Nov 2 12:36:14 1992 Ian Lance Taylor (ian@cygnus.com)
* config/delta88.mh, config/hp300.mh, config/hppahpux.mh,
	config/i386v.mh: removed -DUSG from HDEFINES.
	hosts/delta88.h, hosts/hp300.h, hosts/hppahpux.h, hosts/i386v.h:
	defined USE_UTIME.
	hosts/i386v.h: don't define POSIX_UTIME.
1992-11-02 20:43:55 +00:00
Per Bothner ce6a2aabc1 Re-do change for revision 1.28 that got trashed by 1.29. 1992-08-20 04:04:50 +00:00
Rob Savoye 8fb94c7a78 Added -V option to print the version number. 1992-08-19 03:24:16 +00:00
Per Bothner a00721fc4a * ar.c (main): Don't *always* set the verbose flag! 1992-08-12 06:46:02 +00:00
Per Bothner 5b07d69372 * Makefile.in: Bump to version 1.97.
* ar.c:  Declare errno for machines that need it.
1992-05-05 19:02:24 +00:00
Steve Chamberlain c0cc691258 Wed Apr 15 14:33:07 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* arsup.c, arsup.h, arparse.y, arlex.l: support for archive
	scripting language.
1992-04-15 21:36:37 +00:00
Steve Chamberlain 4b5ea3622d * ar.c: added "b" to fopens for dos
* configdj.bat, makefile.dos new files from DJ
1991-12-12 00:46:32 +00:00
Steve Chamberlain bb5ae298fc Now runs write_armap, even when listing contents. 1991-11-09 01:07:40 +00:00
Steve Chamberlain 0885eef129 Don't care about an unlink failure 1991-10-29 07:13:23 +00:00
Steve Chamberlain 5f0e876707 * ar.c (write_archive.c): added unlink before rename since some
systems can't rename onto an existant file.
1991-10-28 19:22:12 +00:00
Steve Chamberlain 9872a49c27 *** empty log message *** 1991-04-23 16:02:09 +00:00
David Henkel-Wallace 2ef2fb7e05 fix a smallie but nasttie. 1991-04-19 19:40:55 +00:00
David Henkel-Wallace 931004e457 allow the user to specify a file more than once on the command line --
the duplicate references are ignored.
::wq
1991-04-19 18:04:37 +00:00
David Henkel-Wallace ab01cf22f0 *** empty log message *** 1991-04-19 18:03:10 +00:00
David Henkel-Wallace 8ab76aa732 fix two small bugs: quick-append no longer used to create fresh archives;
ar t on a non-existant file does not claim to create it.
1991-04-17 20:13:42 +00:00
David Henkel-Wallace 2fa0b342a5 Initial revision 1991-03-21 21:29:06 +00:00