Commit Graph

104 Commits

Author SHA1 Message Date
Richard Henderson
a3a4bb5d4a * objcopy.c (compare_section_lma): Rename from _vma.
(copy_object): Gap fill based on LMA not VMA.
	* binutils.texi: Update and clarify.
	* objcopy.1: Likewise.

PR 14917
1998-02-18 02:45:07 +00:00
Ian Lance Taylor
eaa147a640 * addr2line.c (usage): Update bug-gnu-utils address.
* ar.c (usage): Likewise.
	* nlmconv.c (show_usage): Likewise.
	* nm.c (usage): Likewise.
	* objcopy.c (copy_usage): Likewise.
	(strip_usage): Likewise.
	* objdump.c (usage): Likewise.
	* size.c (usage): Likewise.
	* strings.c (usage): Likewise.
	* windres.c (usage): Likewise.
	* binutils.texi (Bug Reporting): Likewise.
1998-02-12 19:19:33 +00:00
Ian Lance Taylor
ee1f0bd101 * objcopy.c (parse_flags): Make flag check case insensitive.
Check for `contents' flag.  Give an error for unrecognized flags.
	(copy_section): If the contents flag was set for a section that
	had no contents, zero out the new contents.
	* binutils.texi (objcopy): Document contents section flag.
PR 10601.
1997-11-03 17:39:13 +00:00
Richard Henderson
246b7c9bc0 * objcopy.c, objcopy.1, binutils.texi: "localize" is a better name
than "privatize".  Update all references.
1997-10-10 21:14:29 +00:00
Ian Lance Taylor
18ef0a3df5 * binutils.texi (strip): Remove duplicate --target. From Marty
Leisner <leisner@sdsp.mc.xerox.com>.
1997-10-09 20:04:25 +00:00
Richard Henderson
8d2e72a1c8 * objcopy.c (keep_specific_list, privatize_specific_list,
weaken_specific_list): New variables.
        (keep_symbols): Removed.
        (add_specific_symbol): New function from the carcas of
        add_strip_symbol.  Takes a list as an argument.
        (is_specified_symbol): Likewise from is_strip_symbol.
        (filter_symbols): Honor the new privatize and weaken lists.
        Optimize bfd_asymbol_name handling.
        (copy_object, copy_options, copy_usage): Add privatize-symbol &
        weaken-symbol options.

        * objcopy.1, binutils.texi: Update docs.
1997-10-09 04:34:59 +00:00
Ian Lance Taylor
7a2db4e54c * binutils.texi (ar cmdline): Document that q now works like r.
From Marty Leisner <leisner@sdsp.mc.xerox.com>.
1997-09-24 19:54:57 +00:00
Ian Lance Taylor
f2843a175e * binutils.texi (size): The object file argument is optional.
From Marty Leisner <leisner@sdsp.mc.xerox.com>.
1997-09-24 19:52:17 +00:00
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