Commit Graph

219 Commits

Author SHA1 Message Date
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
Ian Lance Taylor 8291be48a9 * nm.c: HOST_64_BIT was renamed to BFD_HOST_64_BIT. 1994-06-10 21:14:49 +00:00
Ian Lance Taylor 90f6517da9 * objcopy.c (copy_archive): Make the temporary directory in the
same directory as the output BFD, since we may not have write
	permission on the current directory.  Set the permissions of the
	new directory to 0700, not 0777.
1994-06-10 19:43:49 +00:00
David Henkel-Wallace b5775df3dc rs6k lynx changes 1994-06-08 05:05:21 +00:00
Ian Lance Taylor 105da05c1a * objdump.c (display_target_list): Remove unused local ok. 1994-06-03 15:00:55 +00:00
Ken Raeburn c06e55d99a changes from gas-2.3/binutils-2.4 dist (details in branch log msgs, changelogs) 1994-05-27 16:58:05 +00:00
Ian Lance Taylor d5e29b6090 Remove sanitization of PowerPC NetWare. 1994-05-20 18:09:48 +00:00
Ian Lance Taylor 1a5b12f719 * bucomm.c: Check ANSI_PROTOTYPES rather than __STDC__. 1994-05-14 03:26:26 +00:00
Jason Molenda 6f9077cdc1 Tue May 10 18:22:06 1994 Jason Molenda (crash@sendai.cygnus.com)
* objcopy.c (copy_section): Set section size correctly if using
        interleave.
1994-05-11 01:28:18 +00:00
Ken Raeburn 5e54009453 syslex.l, objdump.c/config changes 1994-05-05 22:53:04 +00:00
Steve Chamberlain 932315388d lint. 1994-04-29 16:51:18 +00:00
Steve Chamberlain 7bf6856e9c * Makefile.in (syslex, sysinfo): Use CC_FOR_BUILD.
* coffdump.c, coffgroc.c, coffgrog.h, srconv.c, sysdump.c,
	sysroff.info: Major changes.
1994-04-27 18:27:18 +00:00
Stan Shebs 22111f0eb2 Tue Apr 26 18:18:24 1994 Stan Shebs (shebs@andros.cygnus.com)
* objdump.c (print_section_stabs): Indicate the stab header symbol
	more clearly, print numbers of unrecognized stab n_type values.
1994-04-27 01:21:56 +00:00
Ian Lance Taylor 88d8ae09ff * Makefile.in (distclean): Remove $(PROGS) and underscore.c. 1994-04-25 20:15:04 +00:00
Ian Lance Taylor f645a4bf38 * nlmconv.c (setup_sections): Remove special handling of .reginfo
section.
	(copy_sections): Likewise.
	(alpha_mangle_relocs): Use bfd_ecoff_get_gp_value rather than the
	special ECOFF .reginfo section.
1994-04-22 22:13:23 +00:00
Ian Lance Taylor 45f82cf72a * objcopy.c (copy_object): Call bfd_copy_private_bfd_data after
copying everything else, to let it fiddle with the file in its
	final state.
1994-04-22 20:27:30 +00:00
Ian Lance Taylor a963bfc888 * objdump.c: Include libiberty.h.
(display_target_list): If a format fails, just go on to the next
	one.  Check return value of bfd_set_format.
	(display_info_table): Likewise.  Don't increment loop variable in
	for loop test, since that skips the first element.
	(display_target_tables): Rewrite loop for clarity.  Ensure that it
	always prints at least one element.
1994-04-22 17:15:27 +00:00
Ian Lance Taylor 162794fe9d * nlmconv.c (main): Use CyGnUsEx rather than CyGnUsSeCs for
sections header.  Rename from cygnus_sections to cygnus_ext.
1994-04-22 15:15:42 +00:00
Ian Lance Taylor de04bcebc0 * objdump.c (_DUMMY_NAME_): Don't define.
(display_target_list): Use tmpnam to get a file name rather than
	using _DUMMY_NAME_.  Unlink it when done.
	(display_info_table): Likewise.
1994-04-22 03:47:57 +00:00
Ian Lance Taylor dcb210cb09 * nlmconv.c (secsec): New static variable.
(main): Create .nlmsections section in output BFD.  Store
	information about it in sections header.
	(setup_sections): Allocate space in sections header.
	(copy_sections): Copy zero sized sections.  Put information about
	each section in the sections header.
1994-04-21 16:15:00 +00:00
Ian Lance Taylor a95abbb3ec PowerPC NetWare changes. 1994-04-20 18:49:18 +00:00
Ian Lance Taylor ebc9eebab0 * objdump.c: Do an ifdef on __GO32__, not unix. 1994-04-13 14:54:18 +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
Ian Lance Taylor ae5d2ff573 Update for recent BFD changes to symbol and reloc reading. Rename
all uses of get_symtab_upper_bound to bfd_get_symtab_upper_bound.
	Also:
	* coffgrok.c (symcount): Change to long.
	(do_sections_p1): Check for error return from
	bfd_get_reloc_upper_bound.  Change relcount to long, and check for
	error from bfd_canonicalize_reloc.
	(coff_grok): Change storage to long.  Check for error from
	bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
	* nlmconv.c (main): Change symcount, newsymalloc, newsymcount, and
	i to long.  Check for error from bfd_get_symtab_upper_bound and
	bfd_canonicalize_symtab.
	(copy_sections): Change reloc_size and reloc_count to long.  Check
	for error from bfd_get_reloc_upper_bound and
	bfd_canonicalize_reloc.
	(mangle_relocs, i386_mangle_relocs, alpha_mangle_relocs): Change
	reloc_count_ptr argument to long *.  Make corresponding changes to
	variables loaded from *reloc_count_ptr.
	* nm.c (display_rel_file): Change storage and symcount to long.
	Check for errors from bfd_get_symtab_upper_bound and
	bfd_canonicalize_symtab.
	* objcopy.c (filter_symbols): Change symcount, src_count and
	dst_count to long.
	(copy_object): Change symcount to long.  Pass another argument to
	fprintf.  Check for errors from bfd_get_symtab_upper_bound and
	bfd_canonicalize_symtab.
	(copy_section): Change relcount to long.  Check for errors from
	bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
	(mark_symbols_used_in_relocations): Change relcount and i to long.
	Check for errors form bfd_get_reloc_upper_bound and
	bfd_canonicalize_reloc.
	* objdump.c (storage): Remove global variable.
	(symcount): Changed to long.
	(slurp_symtab): New local variable storage.  Check for errors from
	bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
	(remove_useless_symbols): Change return value and count to long.
	(objdump_print_address): Change min, max, thisplace and i to long.
	(disassemble_data): Change i to long.
	(dump_symbols): Change count to long.
	(dump_relocs): Change relcount to long.  Check for errors from
	bfd_ret_reloc_upper_bound and bfd_canonicalize_reloc.
	(display_info_table): Add casts when passing LONGEST_ARCH for
	printf %* argument.
1994-03-30 22:06:17 +00:00
Ian Lance Taylor 8f197c94e3 * objdump.c (display_file): Close each archive element after it
has been displayed.
1994-03-29 21:34:44 +00:00
Ian Lance Taylor 9f191108c1 * nm.c (display_archive): Close each archive element after it has
been displayed.
1994-03-29 20:00:09 +00:00
Ian Lance Taylor 934ec70a4e * configure.in: Change error message to refer to bfd/config.bfd
rather than bfd/configure.in.
1994-03-28 18:05:12 +00:00
Jeff Law 77ccab3c95 * More fixes for object formats which allow multiple sections
with the same name:
        * objcopy.c (setup_section): Make a new output section even if
        one already exists with the given name.
        (copy_section): Use isection->output_section rather than trying
        to look the output section up by its (possibly non-unique) name.
1994-03-28 00:25:15 +00:00
Ian Lance Taylor 93e53ea4d9 * objdump.c (objdump_print_address): Make static. Declare with
prototype.  Change vardiff from int to bfd_signed_vma.  Correct
	binary search termination condition.  When looking for same
	section symbol in relocatable file, handle final symbol correctly.
1994-03-21 17:58:39 +00:00
Jeff Law 4e85e79f4f * Makefile.in: Avoid bug in hpux sed. 1994-03-20 23:40:41 +00:00
Jeff Law fb158b92f9 * objcopy.c: Changes to keep it from stripping symbols used
in output relocations.
        (mark_symbols_used_in_relocations): New function.  Mark symbols
        used in output relocations with BSF_KEEP.
        (filter_symbols): Do not strip symbols marked with BSF_KEEP.
        (copy_object): Reorder actions.  First setup sections, then
        build the output symbol table, then copy the section contents.
1994-03-20 19:27:40 +00:00
Ian Lance Taylor 60e9faebc1 * ar.c (write_archive): Allocate space for the null byte. From
Robert Lipe <robertl@arnet.com>.
1994-03-18 15:55:27 +00:00
Ian Lance Taylor 06459c063e * Makefile.in: Built nm.new and strip.new to avoid problems with
collect when . is in PATH.
	(STRIP_PROG): Change from strip to strip.new.
	(NM_PROG): Change from nm to nm.new.
	(install): Remove the .new when installing.
1994-03-17 21:22:30 +00:00
Jeff Law 1d483829ad * objcopy.c (filter_symbols): Use bfd_is_local_label to determine
if a symbol represents a compiler-generated local label.
	(copy_object): Give the BFD backends a chance to copy any private
	bfd data from the input BFD to the output BFD.
	(setup_section): Give the BFD backends a chance to copy any private
	section data from the input section to the output section.
1994-03-16 07:04:42 +00:00
Jeff Law c956356797 * objcopy.c (mangle_section): Delete unused function.
(setup_section): Set osection here instead of calling
        mangle section to do it.
1994-03-14 19:36:15 +00:00
Ian Lance Taylor ad8e3db940 * ar.c (write_archive): Close inarch before unlinking it. 1994-03-14 17:14:08 +00:00
Ian Lance Taylor 4bd7a65f5f * nlmconv.c (main): For PowerPC, call powerpc_build_stubs and
powerpc_resolve_stubs.  Use __GOT0, not __toc_start.  Handle it if
	the start and end symbols are not in the text section.
	(struct powerpc_stub): New struct definition.
	(powerpc_stubs, powerpc_stub_insns): New static variables.
	(powerpc_initial_got_size): New static variable.
	(powerpc_build_stubs): New function.
	(powerpc_resolve_stubs): New function.
	(powerpc_mangle_relocs): Clear extraneous data in .got section.
	Rearrange reloc handling to handle ELF relocs that are not
	partial_inplace.  Resolve PC relative relocs.
1994-03-12 03:26:12 +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
Steve Chamberlain e52e2acd51 * coffgrok.[ch]: New files, understand coff objects.
* coffdump.c: Uses coffgrok to dump out the debug info of a coff
	file.
	* sysroff.info: Description of a SYSROFF object file.
	* sysinfo.y, syslex.l: Parse info file, generate a reader, writer,
	header files and a printer.
	* srconv.c: Uses coffgrok.c and sysroff.info to convert a coff
	file to a SYSROFF file.
1994-03-08 21:53:19 +00:00
Ian Lance Taylor 33e61c95a2 Set Emacs local variables to never use version control. 1994-03-08 19:16:31 +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 7681bc7b30 * ar.c, bucomm.c, nlmconv.c, nm.c, objcopy.c, objdump.c,
size.c: Use bfd_get_error and bfd_set_error and new error names.
1994-02-17 18:10:18 +00:00
David MacKenzie 704bbd0dc3 * objcopy.c (strip_main, copy_main): Add missing 'break' in switch. 1994-02-11 23:56:49 +00:00
David MacKenzie 5d2f7e30c5 * objcopy.c (filter_bytes): Make MEMHUNK a char *, not PTR, so we
can do arithmetic on it.
1994-02-04 18:47:33 +00:00
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 6f9dff07e1 More changes to print ambiguous matches and use the
abstracting macros.
1994-02-03 13:08:29 +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