Commit Graph

96 Commits

Author SHA1 Message Date
Ian Lance Taylor 217947b23d More tweaks. Add windres documentation. 1997-06-26 19:27:42 +00:00
Ian Lance Taylor 2483354d4b Based on patch from Marty Leisner <leisner@sdsp.mc.xerox.com>:
* objcopy.c: Include <utime.h> or <sys/time.h>.
	(strip_options): Add "preserve-dates".
	(copy_options): Likewise.
	(copy_usage): Mention -p and --preserve-dates.
	(strip_usage): Likewise.
	(make_same_dates): New static function.
	(strip_main): Handle -p.
	(copy_main): Likewise.
	* binutils.texi, strip.1, objcopy.1: Document new option.
1997-03-27 22:02:46 +00:00
Ian Lance Taylor fb38844dcb addr2line.c contributed by Ulrich Lauther
<Ulrich.Lauther@zfe.siemens.de>:
	* addr2line.c: New file.
	* Makefile.in: Rebuild dependencies.
 	(ADDR2LINE_PROG): New variable.
	(MANPAGES): Add addr2line.
	(PROGS): Add $(ADDR2LINE_PROG).
	(CFILES): Add addr2line.c.
	($(ADDR2LINE_PROG)): New target.
	* binutils.texi: Document addr2line.
	* addr2line.1: New file.
1997-03-27 21:35:00 +00:00
Ian Lance Taylor 9793039fc6 Based on patches from Jamie Lokier <jamie@rebellion.co.uk>:
* objdump.c: Include "demangle.h".
	(do_demangle): New static variable.
	(usage): Mention -C/--demangle.
	(long_options): Add "demangle".
	(objdump_print_symname): New static function.
	(objdump_print_addr_with_sym): Use objdump_print_symname.
	(disassemble_bytes): Likewise.
	(dump_reloc_set): Likewise.
	(dump_symbols): Demangle symbol name.
	(main): Handle -C.
	* binutils.texi, objdump.1: Document -C/--demangle.
1997-03-15 21:50:56 +00:00
Ian Lance Taylor 5c59269f50 * objdump.c (usage): Mention --no-show-raw-insn.
(long_options): Add "no-show-raw-insn".
	(disassemble_bytes): Handle --no-show-raw-insn.
	* binutils.texi, objdump.1: Document --no-show-raw-insn.
1997-03-15 20:37:45 +00:00
Ian Lance Taylor ab3a59cf4c * objdump.c (adjust_section_vma): New static variable.
(usage): Mention --adjust-section-vma.
	(OPTION_ADJUST_VMA): Define.
	(long_options): Add "addjust-vma".
	(display_bfd): If adjust_section_vma is not 0, add it to all the
	section addresses.
	(main): Handle OPTION_ADJUST_VMA.
	* binutils.texi, objdump.1: Document --adjust-vma.
1997-02-26 02:30:31 +00:00
Ian Lance Taylor 54f74247cb fix copyrights, add NEWS entry 1997-01-29 19:00:54 +00:00
Ian Lance Taylor 51b8c41677 * objdump.c (objdump_print_value): Add skip_zeroes parameter.
Change all callers.
	(objdump_print_addr_with_sym): Likewise.  Call objdump_print_value
	to print address.
	(objdump_print_addr): New static function.
	(objdump_print_address): Just call objdump_print_addr.
	(disassemble_bytes): Print real address, not function offset.
	Skip a certain number of leading zeroes.

	* objdump.c (disassemble_zeroes): New static variable.
	(usage): Mention --disassemble-zeroes.
	(long_options): Add "disassemble-zeroes".
	(disassemble_bytes): Check disassemble_zeroes.
Changes requested by LSI.
1997-01-29 18:58:04 +00:00
Ian Lance Taylor 9a442fe8a5 Based on patch from Andrew J Klossner <andrew@pogo.wv.tek.com>:
* objcopy.c (OPTION_WEAKEN): Define.
	(copy_options): Add "weaken".
	(copy_usage): Mention --weaken.
	(weaken): New static variable.
	(filter_symbols): Handle weaken.
	(copy_object): Call filter_symbols if weaken.
	(copy_main): Handle OPTION_WEAKEN.
	* binutils.texi, objcopy.1: Document --weaken.
PR 11272.
1996-12-19 18:16:45 +00:00
Ian Lance Taylor cbcfa12917 * binutils.texi: Add section on reporting bugs. 1996-11-01 20:08:52 +00:00
Ian Lance Taylor 4cb99ff2a1 * objdump.c (prefix_addresses): New static variable.
(long_options): Add "prefix-addresses".
	(compare_symbols): Sort BSF_FUNCTION symbols before other
	symbols.
	(find_symbol_for_address): New static function, broken out of
	objdump_print_address.
	(objdump_print_addr_with_sym): New static function, broken out of
	objdump_print_address.
	(objdump_print_address): Call new functions.
	(disassemble_bytes): New static function, broken out of
	disassemble_data.  Change disassembly format, unless
	prefix_addresses is set.
	(disassemble_data): Call disassemble_bytes.  Unless
	prefix_addresses is set, disassemble in chunks headed by a
	symbol.
	* binutils.texi, objdump.1: Document --prefix-addresses.
1996-10-24 21:21:17 +00:00
Ian Lance Taylor 55311d1cf1 * binutils.texi (Target Selection): Document that you can now
specify targets using configuration triplets.
1996-10-03 21:43:00 +00:00
Ian Lance Taylor decf286508 * objcopy.c (change_leading_char): New static variable.
(OPTION_CHANGE_LEADING_CHAR): Define.
	(copy_options): Add "change-leading-char".
	(copy_usage): Mention --change-leading-char.
	(filter_symbols): Add obfd parameter.  Change all callers.
	Implement change_leading_char.
	(copy_object): Call filter_symbols if change_leading_char.
	(copy_main): Handle OPTION_CHANGE_LEADING_CHAR.
	* binutils.texi, objcopy.1: Document --change-leading-char.
1996-09-13 21:34:08 +00:00
Ian Lance Taylor 16c3e32aa0 * objcopy.c (strip_main): Add -o option, and handle it.
(strip_usage): Mention -o.
	* binutils.texi, strip.1: Mention -o.
1996-06-30 17:45:24 +00:00
Ian Lance Taylor 67c8c90141 * objdump.c (endian): New static variable.
(usage): Mention -EB/-EL/--endian.
	(long_options): Add "endian".
	(disassemble_data): If endianness was specified, replace
	abfd->xvec with a copy of itself with the given endianness.
	(main): Handle -EB/-EL/--endian.
	* binutils.texi, objdump.1: Mention -EB/-EL/--endian.
1996-06-24 20:49:28 +00:00
Ian Lance Taylor 11de29d03b * binutils.texi: Document change to binary format: file position
based on load address, not section VMA.
1996-06-19 18:50:41 +00:00
Ian Lance Taylor 77dd44697f * nm.c (struct get_relocs_info): Define.
(line_numbers): New static variable.
	(long_options): Add "line-numbers".
	(usage): Mention -l and --line-numbers.
	(main): Handle -l.
	(print_symbol): Print line numbers if requested.
	(get_relocs): New static function.
	* binutils.texi, nm.1: Document -l/--line-numbers.
1996-06-12 18:59:47 +00:00
Ian Lance Taylor 1154821182 * objdump.c (dump_reloc_set): Add sec parameter. Change all
callers.  If with_line_numbers is set, display line numbers of
	relocation entries.
	* binutils.texi, objdump.1: Document -l with -r.
1996-06-12 03:14:14 +00:00
Ian Lance Taylor 5da470b2bb Based on patches from H J Lu <hjl@zoom.com>:
* objcopy.c (remove_leading_char): New static variable.
	(OPTION_REMOVE_LEADING_CHAR): Define.
	(copy_usage): Mention --remove-leading-char.
	(filter_symbols): If remove_leading_char, and the first character
	of a global symbol matches the symbol leading char of the BFD,
	remove the first character.
	(copy_object): Filter the symbols if remove_leading_char is set.
	(copy_main): Handle --remove-leading-char.
	* binutils.texi, objcopy.1: Document --remove-leading-char.
1996-01-29 22:39:21 +00:00
Ian Lance Taylor 392e2505bb tipo 1996-01-26 20:43:50 +00:00
Ian Lance Taylor 85d4b87066 * binutils.texi (nm): Improve documentation on symbol types.
(objdump): Reference the stabs manual from the discussion of the
	--stabs option.
1996-01-26 16:54:35 +00:00
David Edelsohn 458bbd1f1e Add new option --show-raw-insn.
* objdump.c (show_raw_insn): New global.
	(usage): Update.
	(long_options): Update.
	(disassemble_data): Set disasm_info.flags if --show-raw-insn.

	* objdump.c (disassemble_data): Set new arch,mach,endian fields in
	disasm_info.
1996-01-23 00:50:24 +00:00
Ian Lance Taylor f5818d79dd * objcopy.c: Include budbg.h.
(convert_debugging): New static variable.
	(OPTION_DEBUGGING): Define.
	(copy_options): Add "debugging".
	(copy_usage): Mention --debugging.
	(is_strip_section): Skip debugging sections if convert_debugging.
	(setup_section, copy_section): Likewise.
	(filter_symbols): Skip debugging symbols if convert_debugging.
	(copy_object): If convert_debugging, read and write debugging
	information.
	(write_debugging_info): New static function.
	(copy_main): Handle --debugging.
	* Makefile.in (DEBUG_OBJS): New variable.
	($(OBJCOPY_PROG)): Depend upon and link against $(DEBUG_OBJS).
	($(STRIP_PROG)): Likewise.
	(OBJDUMP_OBJS): Remove variable.
	($(OBJDUMP_PROG)): Use objdump.o $(DEBUG_OBJS) rather than
	$(OBJDUMP_OBJS).
	* binutils.texi, objcopy.1: Document --debugging.
1996-01-08 23:18:29 +00:00
Ian Lance Taylor e1c145993e Implement generic debugging support. Implement a stabs reader and
a generic printer.
	* budbg.h, debug.c, debug.h, prdbg.c, rddbg.c, stabs.c: New files.
	* objdump.c: Include "debug.h" and "budbg.h".
	(dump_debugging): New global variable.
	(usage): Mention --debugging.
	(long_options): Add "debugging".
	(display_bfd): Handle --debugging.
	* Makefile.in (OBJDUMP_OBJS): New variable.
	($(OBJDUMP_PROG)): Use $(OBJDUMP_OBJS).
	* binutils.texi, objdump.1: Document --debugging.
1996-01-02 22:48:58 +00:00
Jeff Law dcd6706b1a * nm.c ( long_options): Add "--defined-only" option.
(usage): Update for new "--defined-only" option.
        (filter_symbols): Handle "--defined-only".
Part of mentor vm work.
1995-12-30 17:02:06 +00:00
Victoria Mixon b94ff92428 binutils.texi: modified from 95q4 1995-11-10 19:09:41 +00:00
Ian Lance Taylor 8490169d21 * binutils.texi: Change --with-targets to --enable-targets. 1995-10-20 22:42:21 +00:00
Ian Lance Taylor aa21a2a9ec * objdump.c (start_address): New variable.
(stop_address): New variable.
	(usage): Mention --start-address and --stop-address.
	(OPTION_START_ADDRESS, OPTION_STOP_ADDRESS): Define.
	(long_options): Add "start-address" and "stop-address".
	(disassemble_data): Handle start_address and stop_address.
	(dump_data, dump_reloc_set): Likewise.
	(main): Don't set seenflag for -l.  Handle OPTION_START_ADDRESS
	and OPTION_STOP_ADDRESS.
	* objcopy.c (parse_vma): Move to bucomm.c.
	* bucomm.c (parse_vma): New function, moved in from objcopy.c.
	* bucomm.h (parse_vma): Declare.
	* binutils.texi, objdump.1: Document new objdump options.
PR 7983.
1995-09-13 22:38:55 +00:00
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