Commit Graph

68 Commits

Author SHA1 Message Date
Ken Raeburn
9bae56c52d put version number into doc from makefile 1995-08-10 21:42:57 +00:00
Ian Lance Taylor
67ace729ef * strings.c (print_strings): For compatibility with existing
strings programs, print strings which are not terminated with a
	null byte or a newline.
	* binutils.texi, strings.1: Update documentation accordingly.
1995-07-31 17:24:17 +00:00
Ian Lance Taylor
5f0570473a * strings.c (DATA_FLAGS): Remove SEC_DATA.
(main): If no file names are given, scan standard input.
	* binutils.texi, strings.1: strings now scans non-data sections by
	default.
1995-07-25 15:26:54 +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
Ian Lance Taylor
9135e5f83b * objcopy.c (enum strip_action): Define strip_unneeded.
(OPTION_STRIP_UNNEEDED): Define.
	(strip_options): Add "strip-unneeded".
	(copy_options): Likewise.
	(copy_usage): Mention --strip-unneeded.
	(strip_usage): Likewise.
	(is_strip_section): Strip debugging sections if strip_unneeded.
	(filter_symbols): If strip_unneeded, only keep BSF_KEEP symbols.
	(copy_object): If strip_all, discard symbols without checking
	discard_locals.
	(copy_object): Call filter_symbols if strip_unneeded.
	(setup_section): Strip debugging sections if strip_unneeded.
	(copy_section): Likewise.
	(strip_main): Handle OPTION_STRIP_UNNEEDED.
	(copy_main): Likewise.
	* binutils.texi, objcopy.1, strip.1: Document --strip-unneeded.
PR 6684.
1995-07-04 18:52:27 +00:00
Michael Meissner
4b6d0f7873 PR 7046: use unsigned compares in looking up items in the sorted symbol list, not signed; Also add --wide to print on wide columns 1995-06-09 21:42:47 +00:00
Ian Lance Taylor
dff604a75f * objcopy.c (strip_options): Add --keep-symbol.
(copy_options): Likewise.
	(copy_usage): Mention --keep-symbol and -K.
	(strip_usage): Likewise.
	(keep_symbols): New static variable.
	(is_strip_symbol): Adjust the return value according to
	keep_symbols.
	(strip_main): Handle -K.  For -N, check that -K was not given.
	(copy_main): Likewise.
	* binutils.texi, objcopy.1, strip.1: Document -K.
1995-03-10 18:13:31 +00:00
Ian Lance Taylor
5ab41086ca * objcopy.c (struct section_list): Add fields remove, set_flags,
and flags.  Change adjust from boolean to enum.
	(remove_sections): Remove static variable.
	(sections_removed): New static variable.
	(copy_options): Add --set-section-flags.
	(copy_usage): Mention --set-section-flags.
	(parse_flags): New static function.
	(find_section_list): New static function.
	(is_strip_symbol): Change return type from int to boolean.
	(is_strip_section): New static function.
	(filter_symbols): Call is_strip_section.
	(copy_object): When adding sections, check for specified flags or
	VMA.  Call filter_symbols if any sections are being removed.
	(setup_section): Use find_section_list function rather than
	looking through remove_sections and adjust_sections.  Handle
	--set-section-flags.
	(copy_section): Use find_section_list rather than looking through
	remove_sections.
	(strip_main): Use find_section_list instead of adding items to
	sections_removed.
	(copy_main): Use find_section_list instead of adding items to
	sections_removed and adjust_sections.  Handle --set-section-flags.
	* binutils.texi, objcopy.1: Document --set-section-flags.
1995-02-17 19:21:24 +00:00
Ian Lance Taylor
a8e27cc684 * objdump.c (with_source_code): New global variable.
(usage): Mention -S/--source.
	(long_options): Add --source.
	(prev_functionname, prev_line): New static variables.
	(struct print_file_list): Define.
	(print_files): New static variable.
	(skip_to_line, show_line): New static functions.
	(disassemble_data): Call show_line to handle -l and -S.
	(main): Handle -S.
	* binutils.texi, objdump.1: Document -S/--source.
1995-02-14 23:07:21 +00:00
Ian Lance Taylor
d0130cc888 * objcopy.c (copy_usage): Rename parameter to avoid shadowing.
(strip_usage): Likewise.

	* objcopy.c (struct section_add): Define.
	(add_sections): New static variable.
	(copy_options): Accept --add-section.
	(copy_usage): Mention --add-section.
	(copy_object): Add sections from the add_sections list.
	(copy_main): Handle --add-section.
	* binutils.texi, objcopy.1: Document --add-section.
1995-02-09 21:18:01 +00:00
Ian Lance Taylor
29c0d15c01 Thu Nov 17 15:37:19 1994 Mark W. Eichin <eichin@cygnus.com>
* objcopy.c (add_strip_symbol): New function, adds a name to an
	explicit list of symbols to strip.
	(is_strip_symbol): New function, reports whether the name argument
	is in the explicit list.
	(filter_symbols): Check against is_strip_symbol above all.
	(strip_main): Recognize -N option. If used, don't default to
	strip_all.
	(copy_main): Recognize -N option.
	(strip_usage): Document -N and --strip-symbol options.
	(copy_usage): Ditto.
	* objcopy.1, strip.1, binutils.texi: Document -N and
	--strip-symbol options.
1994-11-18 16:00:41 +00:00
Ian Lance Taylor
33e0a06df8 * objcopy.c (gap_fill): Explicitly initialize, for clarity.
(pad_to_set, pad_to): New static variables.
	(copy_options): Accept --pad-to.
	(copy_usage): Mention --pad-to.
	(copy_object): Support --pad-to.
	(compare_section_vma): Sort non loadable sections to the front.
	Sort sections with the same VMA by size.
	(copy_main): Handle --pad-to.
	* binutils.texi, objcopy.1: Document --pad-to.
1994-10-25 20:22:32 +00:00
Ian Lance Taylor
596d99ba32 * objcopy.c (gap_fill_set, gap_fill): New static variables.
(copy_options): Accept --gap-fill.
	(copy_usage): Mention --gap-fill.
	(copy_object): Support --gap-fill.
	(get_sections, compare_section_vma): New static functions.
	(copy_main): Handle --gap-fill.
	* binutils.texi, objcopy.1: Document --gap-fill.
1994-10-20 17:58:23 +00:00
Ian Lance Taylor
a6afc09071 * objcopy.c (copy_object): Revert yesterday's change.
* binutils.texi, objcopy.1: Remove special mention of --set-start
	and `binary' output format.
1994-10-19 18:11:10 +00:00
Ian Lance Taylor
67f67ed998 * objcopy.c (copy_object): If the output file format is `binary',
and the start address was not set using --set-start, default the
	start address to zero.  This hack is because the `binary' output
	file format uses the start address to set the virtual address of
	the first byte in the file.
	* binutils.texi, objcopy.1: Add some notes on generating S-records
	and binary files.
1994-10-18 19:20:58 +00:00
Ian Lance Taylor
6c7ed0842d * objcopy.c (struct section_list): Add fields used, adjust, val.
(adjust_start, set_start_set, set_start): New static variables.
	(adjust_section_vma, adjust_sections): New static variables.
	(copy_options): Add --adjust-start, --adjust-vma,
	--adjust-section-vma, --adjust-warnings, --no-adjust-warnings,
	--set-start.
	(parse_vma): New static function.
	(copy_usage): Mention new options.
	(copy_object): Handle --set-start and --adjust-start.
	(setup_section): Correct type of last argument to PTR.  Set used
	field if section is removed.  Handle --adjust-vma and
	--adjust-section-vma.
	(copy_section): Correct type of last argument to PTR.
	(mark_symbols_used_in_relocations): Likewise.
	(strip_main): Clear used field when handling -R.
	(copy_main): Handle new options.
	* binutils.texi (objcopy): Document new options.
	* objcopy.1: Document new options.
1994-10-18 15:49:53 +00:00
Ian Lance Taylor
d5464baad0 * objdump.c (disassemble_all): New global variable.
(usage): Document --disassemble-all.
	(long_options): Add disassemble-all as a synonym for -D.
	(compare_symbols): Make pointers const.
	(compare_relocs): New static function.
	(disassemble_data): Rename disassemble to disassemble_fn to avoid
	shadowing.  If dump_reloc_info, print relocs along with
	disassembly.  Skip sections which are not SEC_CODE unless
	disassemble_all or only is set.
	(display_bfd): Don't call dump_relocs if disassemble is set.
	(main): Accept and handle -D.
	* binutils.texi: Document -D/--disassemble-all.
	* objdump.1: Likewise.
PR 5059.
1994-09-16 01:59:30 +00:00
Ian Lance Taylor
1896790ef9 * nm.c: Include libiberty.h.
(sort_by_size): New static variable.
	(long_options): Add --size-sort.
	(usage): Mention --size-sort.
	(numeric_forward): Make static.  Change from void * to PTR.
	(numeric_reverse): Likewise.
	(non_numeric_forward, non_numeric_reverse): Likewise.
	(sorters): Change declaration from void * to PTR.
	(size_forward, sort_symbol_by_size): New static functions.
	(display_rel_file): Handle sort_by_size.
	(filter_symbols): If sort_by_size, discard absolute and undefined
	symbols.
	* binutils.texi (nm): Document --size-sort.
	* nm.1: Document --size-sort.
PR 3611.
1994-09-14 16:28:41 +00:00
Ian Lance Taylor
0aca460e7c Add support for removing named sections to objcopy and strip.
* objcopy.c (struct section_list): Define.
	(remove_sections): New static variable.
	(strip_options, copy_options): Add remove-section.
	(copy_usage, strip_usage): Mention -R and --remove-section.
	(setup_section): If section is in remove_sections list, ignore it.
	(copy_section): Likewise.
	(strip_main, copy_main): Handle -R.
	* binutils.texi, objcopy.1, strip.1: Document new options.
1994-08-11 19:00:26 +00:00
Ian Lance Taylor
6f88f03122 * configure.in: Set UNDERSCORE in Makefile based on result of
invoking config.bfd with a second argument of ``_''.
	* Makefile.in (underscore.c): Depend upon Makefile.  Don't try to
	run $(CC) and $(NM), just use $(UNDERSCORE).  Create via temporary
	file.
	(demangle.o): Remove target.
	($(NM_PROG)): Don't depend upon demangle.o, and	don't link against
	demangle.o.  It's in libiberty anyhow.
	(cplus-dem.o): Don't depend upon demangle.o.
	* binutils.texi: Mention -n and --no-strip-underscores arguments
	to c++filt.
1994-06-16 21:59:41 +00:00
Ian Lance Taylor
9eb39bca51 * nm.c (long_options): Add --no-demangle to turn off --demangle,
and --no-cplus for Linux compatibility.
	(usage): Mention --no-demangle.
	* binutils.texi: Document --no-demangle.
1994-06-15 16:13:59 +00:00
Jeffrey Osier
7e5e961977 binutils.texi: (objdump) fix formatting in options summary 1994-06-03 22:50:50 +00:00
Ian Lance Taylor
de3b08ac2e Added -D (--dynamic) option to nm and -T (--dynamic-syms) and -R
(--dynamic-reloc) arguments to objdump.
	* nm.c (dynamic): New static variable.
	(long_options): Added "dynamic".
	(usage): Mention -D and --dynamic.
	(main): Add D to getopt string.  Handle -D by setting dynamic.
	(display_rel_file): If dynamic is non-zero, read dynamic symbols
	rather than normal symbols.
	* nm.1: Updated for -D (--dynamic) option.
	* objdump.c (dump_dynamic_symtab): New global variable.
	(dump_dynamic_reloc_info): New global variable.
	(dynsyms, dynsymcount): New global variables.
	(usage): Mention -R, -T, --dynamic-syms and --dynamic-reloc.
	(long_options): Added "dynamic-reloc" and "dynamic-syms".
	(slurp_symtab): If no symbols, return rather than exit.
	(slurp_dynamic_symtab): New function.
	(display_bfd): Handle dump_dynamic_symtab and
	dump_dynamic_reloc_info.
	(dump_symbols): Take new dynamic argument, indicating whether to
	display dynamic symbols.
	(dump_relocs): Move most printing into dump_reloc_set.
	(dump_dynamic_relocs): New function.
	(dump_reloc_set): New function, extracted from dump_relocs.
	(main): Add R and T to getopt string.  Handle -T by setting
	dump_dynamic_symtab and -R by setting dump_dynamic_reloc_info.
	* objdump.1: Updated for -R (--dynamic-reloc) and -T
	(--dynamic-syms) options.
	* binutils.texi: Updated for new nm and objdump options.
1994-04-07 02:04:34 +00:00
Jeffrey Osier
20465f8bd1 binutils.texi(nlmconv): added -d/--debug and -l/--linker info 1994-03-29 00:53:16 +00:00
Roland Pesch
20f774c12e Minor update to list of programs for dir.info entry. 1994-03-17 22:43:04 +00:00
Jeffrey Osier
8981cac563 binutils.texi: fixed dir-entry, copyright date, last chapter a bit 1994-02-18 00:15:58 +00:00
Jeffrey Osier
10f2a7f6ac binutils.texi: minor formatting updates for next release 1994-02-07 23:19:00 +00:00
David MacKenzie
f7b839f7cd * objcopy.c (filter_bytes): New function.
(copy_section): Call it.
	(copy_options, copy_usage, copy_main): Add --byte option to
	activate it.  Appropriate the -b option (which was an undocumented
	synonym for -F) for it, also.  Add --interleave, -i option for
	additional control.
	(setup_section, copy_section, mangle_section): Renamed with no `s'
	on the end.
	* objcopy.1, binutils.texi: Document the new options.

	* objdump.c (display_target_tables, display_target_list):
	New functions broken out of display_info.
	Eliminate some magic constants.  Use more meaningful variable names.
	(dump_bfd_header): New function broken out of display_bfd.
	(dump_section_header): New function broken out of dump_headers.
	(remove_useless_symbols): Don't shadow global variable name with
	parameter.
	(objdump_print_address): Fix backward test.
1994-01-26 22:11:18 +00:00
David MacKenzie
db2e6adb5b * binutils.texi (objdump): Note some limitations of -h section
address printing.
1994-01-24 21:31:01 +00:00
David MacKenzie
eae0423857 * binutils.texi: Add a chapter summarizing the ways to select
aspects of the target for each program.

	* objdump.c (long_options, usage): Add long equivalents for all
	remaining short options that lacked them.
	* binutils.texi objdump.1: Document them.

	* size.c (usage): Tweak usage message.
	* size.1: Add missing `=' in examples.

	* binutils.texi strip.1 objcopy.1 nlmconv.1 objcopy.c nlmconv.c:
	Use "--target=bfdname" as the option to select the BFD target,
	like nm and size already do.
	Reserve "--format=format" for textual output selection options, but
	for now keep old option names as obsolete for backward compatibility.

	* strings.c (main, strings_object_file, usage): Add --target option.
	* binutils.texi strings.1: Document it.
1994-01-06 19:49:06 +00:00
Jeffrey Osier
5b0ba16d41 * binutils.texi: fix bug in nlmconv doc 1993-11-23 22:39:01 +00:00
Jeffrey Osier
4961ce5b9c binutils.texi: minor fix for nlmconv chapter 1993-11-19 21:12:49 +00:00
Jeffrey Osier
94e9ad7723 binutils.texi: added nlmconv chapter 1993-11-05 20:13:42 +00:00
David MacKenzie
eed5eeab82 put objcopy in alphabetical order 1993-10-30 02:24:39 +00:00
Roland Pesch
650a49f055 Makefile.in (binutils.dvi): use TEXIDIR to find texinfo.tex
binutils.texi (ar): improve synopsis lines
              (strings): fix overfull box in synopsis
              (passim) remove some contractions
1993-10-01 00:11:58 +00:00
David MacKenzie
d6a4c37569 * Makefile.in ($(NM_PROG)): Depend on demangle.o.
(demangle.o): New target.
	(cplus-dem.o): Depend on it, to force compilation order when doing
	parallel compiles.

	* nm.c (print_symbol_info_{bsd,sysv,posix}): Take a bfd arg.
	(struct output_fns print_symbol_info): Ditto.
	(long_options, usage, main): Add -C --demangle option.
	(print_symname): New function, demangling if requested.
	(print_symbols, print_symbol_info_{bsd,sysv,posix}): Use it.
1993-08-13 00:02:25 +00:00
David MacKenzie
ed78872a7f fix doc bug 1993-08-04 00:39:19 +00:00
David MacKenzie
68dd529571 add nm -B 1993-08-02 18:41:14 +00:00
David MacKenzie
b26ac61376 * Makefile.in: Note dependencies on bucomm.h.
(cplus-dem.o): Link c++filt with version.o.

	* strings.c: Include bucomm.h and add prototypes to other decls.
	Remove -h option.

	* bucomm.h: Declare xrealloc.

	* nm.c, objcopy.c, objdump.c, size.c, strings.c (main, usage): Add
	--help option.  Put "GNU" in the version message.
	(usage): Take stream and exit status as args.
	(main): Pass new args to usage.
1993-06-28 02:17:13 +00:00
David MacKenzie
ba7c8e2905 * strings.c, strings.1: New files.
* binutils.texi: Document strings.
1993-06-26 06:37:17 +00:00
David D. Zuhn
d6391983cb update INFO-DIR-ENTRY 1993-06-04 23:24:37 +00:00
Jeffrey Osier
38e799d231 binutils.texi: put in zoo's info-dir entry stuff (it's cleaner) 1993-06-03 00:29:32 +00:00
Jeffrey Osier
5eac46ae03 binutils.texi: final tweaks for c++filt chapter 1993-06-02 23:43:10 +00:00
Jeffrey Osier
6c69b6bde1 * biutils.texi: revised c++filt chapter 1993-05-28 00:00:59 +00:00
David D. Zuhn
8a6d5d4f93 INFO-DIR-ENTRY formatting tweaks 1993-05-24 22:33:43 +00:00
David MacKenzie
6cfbdb50e6 Move printing from bfd to nm and add POSIX and SysV compatibility. 1993-05-21 21:09:58 +00:00
Roland Pesch
e32341a77c Minor cleanups to c++filt node, and copyright dates. 1993-05-15 00:35:08 +00:00
Per Bothner
b6216af269 * Makefile.in (underscore.c): Automatically generate
(using nm) a file with the variable prepends_underscore.
	* Makefile.in (c++filt):  Link underscore.o with cplus-dem.o
	so that initial underscores get removed iff appropriate.
	* binutils.texi:  Preliminary documentation for c++filt.
	* Makefile.in, binutils.texi:  Set to version 2.2.
1993-05-15 00:25:03 +00:00
Ian Lance Taylor
df14d9573c * objcopy.c: Renamed from copy.c, updated comments accordingly.
* Makefile.in, binutils.texi: Renamed copy to objcopy.
	* is-strip.c, maybe-strip.c, not-strip.c: Updated comments for
	rename of copy to objcopy.
1993-05-12 19:08:53 +00:00
Per Bothner
1269d44115 * binutils.texi (strip, -v option): Fix typo. 1993-05-11 00:21:13 +00:00