Commit Graph

44 Commits

Author SHA1 Message Date
David MacKenzie 250e36fe2d * objdump.c (dump_section_stabs, read_section_stabs,
print_section_stabs): Functions broken out of dump_stabs_1.
	Free the stabs and strings when done with them.
1994-02-03 22:21:28 +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 334d6e7603 Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com)
* objdump.c (display_target_list, display_info_table): Check that
	the bfd of the dummy output file is not null.
1994-02-01 02:52:22 +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 abdcac0f52 * objdump.c (display_file): Remove call to list_matching_formats.
It would never be called.
	(list_matching_formats): Take an arg giving the list of matching
	formats.
	(display_bfd): Pass the arg, and get it filled in by calling
	bfd_check_format_matches instead of bfd_check_format.
	(display_info, display_info_table): target_vector was renamed to
	bfd_target_vector.
1994-01-25 13:27:56 +00:00
David MacKenzie 209e561041 * objdump.c (display_file): Remove call to list_matching_formats.
It would never be called.
	(list_matching_formats): Take an arg giving the list of matching
	formats.
	(display_bfd): Pass the arg, and get it filled in by calling
	bfd_check_format_matches instead of bfd_check_format.

	* binutils.texi (objdump): Note some limitations of -h section
	address printing.
1994-01-24 23:38:03 +00:00
Stan Shebs 3785367375 Minor MPW compatibility tweaks. 1994-01-23 00:31:14 +00:00
David MacKenzie eae821453c * objdump.c (list_matching_formats): If the file format is ambiguous,
print the matching names so the user can choose one.
	(display_bfd): Call it.
	(display_file): Call it.
1994-01-22 05:11:40 +00:00
Ian Lance Taylor 722087ec13 * objdump.c (disassemble_data): Support bfd_arch_rs6000. 1994-01-22 00:19:02 +00:00
Stan Shebs fe2750e101 Mon Jan 17 13:57:25 1994 Stan Shebs (shebs@andros.cygnus.com)
* objdump.c (stab_name): Allocate dynamically.
	(stab_print): Use pointers to strings instead of char arrays.
	(dump_stabs): Change alloc and init of arrays appropriately.
	(dump_stabs_1): Always decide whether to print stab_name or
	the stab's type number, if unnamed.
1994-01-17 22:03:42 +00:00
Ian Lance Taylor 02a68547b9 * objdump.c (dump_relocs): Don't crash if section name is NULL. 1994-01-13 22:34:51 +00:00
Stan Shebs e1ec9f078f Rename a variable that conflicts with Lynx 1993-10-29 18:15:01 +00:00
Mark Eichin 80d19ec1fc hide declaration of fprintf inside FPRINTF_ALREADY_DECLARED, because
this declaration can be wrong but there must *be* a declaration for
include/dis-asm.h to work.
1993-10-22 18:04:09 +00:00
Ian Lance Taylor 9b018ecd1b * objdump.c (usage): Mention --stabs. 1993-09-23 05:21:21 +00:00
Ken Raeburn 195d1adff1 * objdump.c (ARCH_all): Define ARCH_hppa too.
(dump_headers): Don't test for SEC_BALIGN if it's not defined by bfd.h.

(The latter is done with #ifdef in case it turns out SEC_BALIGN has to be
put back.  I didn't *see* any uses of it besides this one, though.)
1993-08-31 18:15:50 +00:00
Ian Lance Taylor b3a2b4975f * objdump.c (disassemble_data): Handle the m88k.
(display_bfd): Use bfd_errmsg, rather than just claiming that the
	bfd is not an object file.
1993-07-15 16:46:50 +00:00
Ken Raeburn d086adf85a Elf bfd routines and types are now size-independent again. 1993-06-26 00:47:23 +00:00
Per Bothner 3ae36cb686 * objdump.c (syms2): Removed unused variable.
* objdump.c (remove_useless_symbols):  New function.
	* objdump.c (comp):  Simplify.
	* objdump.c (dis-assemble_data):  Make simpler and more
	efficient how we filter out useless symbols:  Just filter
	BEFORE the sort (using remove_useless_symbols).
	* objdump.c (objdump_print_address):  Simplify.
	Change output syntax to match gdb.
1993-06-18 21:37:21 +00:00
Ken Raeburn 875607cb0d elf32 updates 1993-05-25 20:39:21 +00:00
Ken Raeburn f50af42bbf Makefile.in (DISTSTUFF): Don't build binutils.mm.
objdump.c (slurp_symtab): Print warning for bad symbol table.
1993-05-25 04:28:56 +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
Steve Chamberlain 6f57570423 Support for the SH. 1993-04-27 01:39:38 +00:00
Ian Lance Taylor 545a27683e Please don't add declarations of random system functions to general
source files if you can possibly avoid it.  They inevitably fail on
some system somewhere.

	* objdump.c: Removed useless fprintf declaration.
1993-04-09 18:22:57 +00:00
Jim Kingdon f7ed13c7d5 merge binutils and gdb sparc disassemblers 1993-04-01 16:56:06 +00:00
Jim Kingdon 5d0734a7d7 provide a new interface (using read_memory_func) to call the disassemblers
which copes with errors in a plausible way
1993-03-31 21:43:25 +00:00
Ken Raeburn 12da177528 objdump.c: Use correct prototype of fprintf, else it won't compile on ANSI
C systems.
1993-03-29 13:22:16 +00:00
Jim Kingdon 452b40b631 mention long options in usage message 1993-03-19 18:58:10 +00:00
Per Bothner 2e8adbd7f4 * m68k-pinsn.c: Removed. Subsumed by ../opcodes/m68k-dis.c.
* i386-pinsn.c:  Removed.  Subsumed by ../opcodes/i386-dis.c.
	* Makefile.in:  Adjust accordingly.
	* objdump.c:  Support new-style disassemblers (ones that use
	the interface of ../include/dis-asm.h).
1993-03-19 00:12:50 +00:00
Ken Raeburn d9971b8304 from minyard@bnr.ca: free up copy of section contents each time through loop 1993-02-22 15:31:30 +00:00
Rob Savoye 249c6fc0d6 Added +version (-V) option to print version number. 1992-08-19 03:25:51 +00:00
John Gilmore 770cde303d Lint 1992-06-13 05:24:22 +00:00
John Gilmore 73b8f10233 New feature: --stabs prints out a .stab section from an ELF file.
Installed under #ifdef ELF_STAB_DISPLAY so it can be easily disabled,
since it requires bfd-internals header files and such.
1992-06-11 08:23:11 +00:00
Steve Chamberlain aa0a709adc Wed Jun 10 07:53:24 1992 Steve Chamberlain (sac@thepub.cygnus.com)
* objdump.c(display_info), patches from
	mohring@informatik.tu-muenchen.de to print the table much more
	nicely.
1992-06-10 14:57:25 +00:00
Steve Chamberlain 60c8001642 Add support for 386 disassembly 1992-05-01 22:45:45 +00:00
Steve Chamberlain 65cceb7879 * objdump.c (disassemble_data): don't print a section's contents
if it's not loadable (eg bss)
1992-02-06 20:15:19 +00:00
Steve Chamberlain d20f480f8a * copy.c, nm.c, objdump.c, size.c : changed to use the
new reloc scheme.
1992-01-24 22:49:24 +00:00
John Gilmore e779a58cf4 Cope with renames of a few BFD types & enums. 1991-10-05 04:50:54 +00:00
Per Bothner 3fdbfe8d12 * bucomm.c (fatal): Conditionally compile fatal() depending on
MISSING_VFPRINTF, and don't confuse the issue with NO_VARARGS.
	* objdump.c (dump_headers):  Trivial output format change.
	* objdump.c (display_info): Loop over integers, not enums,
	to appease old compilers.
1991-09-30 19:47:49 +00:00
K. Richard Pixley 7cffe88a92 Added -A switch. 1991-06-09 20:38:35 +00:00
Steve Chamberlain 96d7950b55 When disassembling, now prints ... instead of pages of whatever the
instruction for 0x0000 is.
1991-06-07 01:33:38 +00:00
Steve Chamberlain fc5d607456 Mon May 20 16:14:07 1991 Steve Chamberlain (steve at cygint.cygnus.com)
* Changed some types to work with 64 bit object files
1991-05-20 23:15:15 +00:00
Steve Chamberlain 9872a49c27 *** empty log message *** 1991-04-23 16:02:09 +00:00
Steve Chamberlain bf66105649 Fixed some prototypes 1991-04-18 21:14:53 +00:00
David Henkel-Wallace 2fa0b342a5 Initial revision 1991-03-21 21:29:06 +00:00