Commit Graph

11211 Commits

Author SHA1 Message Date
Ian Lance Taylor
809ee7e036 * ld.h (ld_config_type): Add new field warn_once.
* ldmain.c (undefined_symbol): Handle -warn-once.
	* lexsup.c (parse_args): Recognize -warn-once.
	* ld.texinfo (Options): Document -warn-once.
	* ld.1: Likewise.
PR 4456.
1994-09-14 22:27:16 +00:00
Jeff Law
a8d0866480 * som.h (struct somdata): New field sorted_syms.
(obj_som_sorted_syms): Accessor macro.
	* som.c (som_object_setup): Initialize sorted_syms to NULL.
	(som_prep_for_fixups): Sort a copy of the BFD's symbol table;
	store the sorted symbol table in sorted_syms.
	(som_write_fixups): Initalize tmp_reloc to NULL to make GCC happy.
	(som_begin_writing): Similarly for exec_header.  Pass the sorted
	symbol table to som_write_symbol_strings.
	(som_build_and_write_symbol_table): Use the sorted symbols rather
	than the canonical symbol table.
1994-09-14 22:24:56 +00:00
Ian Lance Taylor
8490907307 * mips-opc.c (mips_opcodes): Set WR_t for sc and scd.
PR 5632
1994-09-14 21:53:14 +00:00
Jeff Law
8a2cdc6278 * som.h (som_symbol_type): Add "stringtab_offset" field.
* som.c (som_write_symbol_strings): Use "stringtab_offset"
	rather than destroying the "name" field in the BFD symbol.
	(som_build_and_write_symbol_table): Likewise.
1994-09-14 21:44:35 +00:00
Steve Chamberlain
467a038026 Wed Sep 14 12:49:12 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* ldlang.c (lang_do_assignments): Make sure output statement
	has an attached bfd_section before trying to dereference it.
1994-09-14 20:45:43 +00:00
J.T. Conklin
1c1d90f1fe Updated for recent NetBSD changes 1994-09-14 20:26:54 +00:00
Ian Lance Taylor
060ea29053 Rebuilt dependencies. 1994-09-14 20:26:40 +00:00
Ian Lance Taylor
e4798f4093 * objdump.c (disassemble_data): Initialize prevline to 0. Make
prev_function non const.  Copy functionname into an malloc buffer
	when setting prev_function, instead of assuming that the string
	will last forever.
1994-09-14 20:21:21 +00:00
Ian Lance Taylor
9be909aef7 * libecoff.h (struct ecoff_tdata): Add field find_buffer.
* ecoff.c: Include aout/stab_gnu.h.
	(ecoff_find_nearest_line): Handle stabs debugging information.
PR 3954.
1994-09-14 20:19:09 +00:00
Ian Lance Taylor
8c62064a26 * elfcode.h (elf_link_output_extsym): Keep a symbol marked as weak
even if it is referenced by another object.
1994-09-14 19:08:26 +00:00
Ian Lance Taylor
31c271643b Tweak the new handling of function names. 1994-09-14 18:29:06 +00:00
Ian Lance Taylor
cc23cc69c5 * ldmisc.c (vfinfo): Handle %D as %C, but never print the function
name.  For %C, print the function name on a separate line, to keep
	the length of error messages under control.
	* ldmain.c (multiple_definition): Use %D for ``first defined
	here.''
	(undefined_symbol): Use %D for ``more undefined references
	follow''.
PR 3770.
1994-09-14 17:08:37 +00:00
Ian Lance Taylor
8bff41c1b7 * ldmisc.c (multiple_warn): Remove; no longer used.
* ldmisc.h (multiple_warn): Don't declare.
1994-09-14 16:50:19 +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
Stu Grossman
335129a977 * gdbtk.tcl: Add ref counts to breakpoint tags.
* Put quotes around function name in disassemble command to better
	handle assembler names containing `.'.
	* Make pclist element 0 be filler to avoid off-by-one problem with
	line numbers.
	* Set names of top-level windows.
	* Add register display window.
	* Add PC to label of assembly window.
1994-09-14 08:02:51 +00:00
Steve Chamberlain
3deb20fbc1 * ldlang.c (print_output_section_statement): Print all lines
to the map file.
1994-09-14 04:55:00 +00:00
Jeff Law
fcacfef6ae * expr.c (expr): Don't reduce the difference of two symbols in the
same frag if the symbols are not in normal sections.
1994-09-14 03:53:14 +00:00
Jeff Law
a0f5033df3 * objcopy.c (copy_main): Initialize input_filename and
output_filename to NULL.
1994-09-14 03:08:55 +00:00
Jeff Law
ae880afc1b * som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both
'T' and 'U' to grab all the unwind information.
	(som_set_reloc_info): Make 'U' unwind bits persist across
	multiple SOM relocations.  Set the addend field of an R_ENTRY
	relocation to the value in 'T'; set the addend field on an
	R_EXIT relocation to the value in 'U'.
1994-09-14 03:03:15 +00:00
Jeff Law
e10639db44 * som.h (som_symbol_type): Delete unwind field.
* som.c (som_write_fixups): For R_ENTRY fixups, get 32bits of
	unwind information from the addend field of the R_ENTRY, get the
	other 32bits from the addend field of the R_EXIT.
	(bfd_som_attach_unwind_info): Delete function and all references.
1994-09-14 02:28:52 +00:00
Jeff Law
75c28b4966 * config/obj-som.h (S_SET_OTHER, S_SET_TYPE): Delete a.out crud.
(S_SET_DESC, S_GET_OTHER, S_GET_TYPE, S_GET_DESC): Likewise.
	(obj_attach_unwind_info): Do not define.  Not needed anymore.
	* config/tc-hppa.c: Delete whitespace at EOL.
	(struct hppa_fix_struct): Delete fx_unwind field and all references.
	(fix_new_hppa): Last arg is now a pointer to an int.  Do not
	call obj_attach_unwind_info anymore.  For SOM R_ENTRY and R_EXIT
	fixups, store 32bits of unwind information in the fx_addnumber
	field of the fixup.
	(md_assemble, pa_entry, process_exit, pa_procend): For SOM R_ENTRY
	and R_EXIT fixups, pass a NULL pointer to fix_new_hppa, and a
	pointer to 32 bits of unwind info.
	(tc_gen_reloc): For SOM R_ENTRY and R_EXIT fixups, set the symbol
	pointer to the dummy symbol; set the addend field to fx_addnumber.
	(pa_comm, pa_equ, pa_type_args, pa_import): Use bfd_XXX_section_ptr
	rather than &bfd_XXX_section.
1994-09-14 02:20:24 +00:00
Ken Raeburn
d7152d074b 386_GOTPC fix from ericy 1994-09-14 01:43:21 +00:00
Ken Raeburn
26f4447a60 Some Vax and VMS bug fixes from Pat Rankin. 1994-09-14 01:30:56 +00:00
Ken Raeburn
b9419dd224 Do unlink/delete test properly.
Replace HO_VMS tests with VMS.
1994-09-14 00:54:00 +00:00
Jeff Law
39836432f8 * som.h (som_symbol_type): Delete unused a.out-related fields.
* som.c (bfd_section_from_som_symbol): Use bfd_abs_section_ptr
	instead of &bfd_abs_section.
1994-09-14 00:51:33 +00:00
Jeff Law
a0b4aa6265 * som.c (som_object_setup): Handle exec_entry and exec_flags being
switched in executables created by the OSF1 linker.
	(som_write_fixups): Handle R_EXIT just like the R_{F,L,R}SEL
	fixups.  Support R_ALT_ENTRY (handle just like R_EXIT).
1994-09-14 00:29:11 +00:00
Rob Savoye
c9e7a4b46f * w89k-rom.c op50-rom.c monitor.c config/pa/hppapro.mt: New files
to add a generic ROM monitor interface, and support file for the
	WinBond W89K and the Oki OP50N PA based target boards.
1994-09-14 00:26:51 +00:00
Rob Savoye
32cb1c537c Add support for the w89k and op50n PA target board code. 1994-09-14 00:21:23 +00:00
Rob Savoye
25ca0dfc5a Oop, make sure Sanitize doesn't nuke new files. 1994-09-14 00:19:26 +00:00
Rob Savoye
e8b73ba7c3 A generic ROM monitor interface abnd support for the WinBond w89k board
and the Oki op59n board.
1994-09-14 00:14:53 +00:00
Steve Chamberlain
cf345e3687 Tue Sep 13 16:04:07 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* cofflink.c (coff_link_input_bfd): syment_base is unsigned
	so can't compare -ve numbers with it.

Mon Sep 12 20:31:17 1994  Steve Chamberlain  (sac@jonny.cygnus.com)

	* configure.in (shcoff_vec): Use cofflink.o now.
	* coff-sh.c: Rewritten to use new fast coff backend.
1994-09-14 00:10:42 +00:00
Steve Chamberlain
a989856340 Tue Sep 13 16:45:08 1994 Steve Chamberlain (sac@jonny.cygnus.com)
* config/obj-coff.c (do_relocs_for):  If TC_KEEP_FX_OFFSET
	is defined, put the tx_offset into the r_offset.
	* config/tc-sh.c (line_comment_chars): Add #
	(tc_reloc_mangle): Deleted.
	* config/tc-sh.h (TC_KEEP_FX_OFFSET): Define.
	(TC_RELOC_MANGLE): Delete.
1994-09-14 00:01:45 +00:00
Steve Chamberlain
6613462ec3 * config/obj-coff.c (do_relocs_for): If TC_KEEP_FX_OFFSET
is defined, put the tx_offset into the r_offset.
	* config/tc-sh.c (line_comment_chars): Add #
	(tc_reloc_mangle): Deleted.
	* config/tc-sh.h (TC_KEEP_FX_OFFSET): Define.
	(TC_RELOC_MANGLE): Delete.
1994-09-13 23:53:52 +00:00
Ken Raeburn
460531dad9 Use EXIT_SUCCESS and EXIT_FAILURE in all exit calls.
Use exit rather than returning from main, for consistency on VMS.
Call as_fatal instead of as_bad or as_warn followed by exit.
1994-09-13 23:07:48 +00:00
Ken Raeburn
28d3e4a3f8 * Makefile.in (*_FOR_TARGET, INSTALL_XFORM, install, uninstall): Rewrite
handling of program_transform_name.

* configure.in: Test for "unlink" and "delete", define USE_DELETE_FOR_UNLINK if
only the latter is found.  Not expected to be triggered on UNIX/POSIX systems.
* acconfig.h (USE_DELETE_FOR_UNLINK): Undef here, provide comments.

Update for autoconf 1.118:
* gdbinit.in: New file, created from old .gdbinit.
* .gdbinit: Deleted.
* aclocal.m4 (GAS_GDBINIT): Deleted.
* configure.in: Don't use it.  Instead, generate .gdbinit from gdbinit.in.
Don't substitute cpu_type, obj_format, emulation, atof.  Switched order of
AC_LINK_FILES arguments.  Use AC_PREREQ to ensure that older versions of
autoconf aren't used.
* Makefile.in: Added @configure_input@ line.
(configure): Deleted rule.

[regenerated conf.in, configure]
1994-09-13 22:27:20 +00:00
Ian Lance Taylor
0b3499f672 * ldlang.c (load_symbols): Check for archive before object. Use
bfd_check_format_matches, and, if ambiguous, print a list of
	matching formats.  If file format is not recognized, treat file as
	a linker script.
	* ldgram.y (yyerror): If assuming an object file is a script,
	mention that.  Tweak the format of the error messages.
	* ldlex.l (lex_warn_invalid): If assuming an object is a script,
	guess that this is not actually a script, and just report that the
	file format was not recognized.
	* ld.texinfo (Options): Admit that -( may be used more than once.
	Add note that unrecognized object files are now treated as linker
	scripts.

	* ldfile.c (ldfile_input_filename): Make const.
	(ldfile_assumed_script): New variable.
	(try_open): Change arguments types to const.
	(ldfile_find_command_file): Likewise.
	(ldfile_open_command_file): Likewise.  Also, set lineno to 1.
	* ldfile.h: Update declarations for ldfile.c changes.
	* ldlex.l: Include <ctype.h>.
	(file_name_stack): Change to be const char *.
	(lineno_stack): New static variable.
	(<<EOF>>): Set lineno as well as ldfile_input_filename.
	(lex_push_file): Make name argument const.  Initialize
	lineno_stack entry.
	(lex_redirect): Initialize lineno_stack entry.
	(lex_warn_invalid): Handle non printable characters nicely.
	* ldlex.h (lex_push_file): Declare second argument as const.

	* ldgram.y (ifile_p1): Recognize GROUP.
	* ldlex.l: Recognize GROUP.
	* ld.texinfo (Option Commands): Document GROUP.
1994-09-13 20:42:47 +00:00
Ian Lance Taylor
204ba9e37e * aoutx.h (NAME(aout,final_link)): Don't assume that all the input
files are a.out.
1994-09-13 20:25:46 +00:00
J.T. Conklin
a3f7a777c6 * configure.host (sparc-*-netbsd): use sparcnbsd.
(ns32k-*-netbsd): use ns32knbsd.

* hosts/{nbsd,i386nbsd,ns32knbsd,sparcnbsd}.h: New files, NetBSD
  host support.

* sparcnetbsd.c: New file, adds support for NetBSD/sparc.
* config/sparc-nbsd.mt: Likewise.

* netbsd.h: New file, definitions common to all netbsd ports.
* i386netbsd.c: Use it.
* ns32knetbsd.c: Use it.

* Makefile.in, configure.in, targets.c, config/i386-nbsd.mt,
  config/ns32k-nbsd.mt: canonicalize netbsd targets to conform to
  file/variable naming conventions.
* i386netbsd.c: New file, renamed from netbsd386.c.
* ns32knetbsd.c: New file, renamed from netbsd532.c.
1994-09-13 18:39:47 +00:00
Ian Lance Taylor
5e39c98765 * Makefile.in (version.o): Depend upon Makefile, so that version.o
gets rebuilt when make variable VERSION is changed.
1994-09-13 18:19:24 +00:00
Ian Lance Taylor
28d1b01e43 * objdump.c (dump_section_header): Print the SEC_NEVER_LOAD flag. 1994-09-13 18:18:01 +00:00
Ian Lance Taylor
430a399719 * config/obj-coff.c (fixup_segment): After handling the difference
of two symbols from the same segment, set fx_subsy to NULL, to
	satisfy existing TC_COUNT_RELOC macros.
1994-09-13 17:06:26 +00:00
Stu Grossman
8532893d17 * gdbtk.c (gdbtk_flush gdbtk_fputs): Buffer up output to make
disassembly more efficient.
	* (breakpoint_notify):  Include pc in gdbtk_tcl_breakpoint
	callback.
	* (gdb_loc):  Include pc in return value.  Also, return function
	name if arg was specified.
	* (gdb_cmd_stub):  Call gdb_flush to drain internal GDB buffers
	after command completes.
	* (gdbtk_init):  Improve error handling.

	* gdbtk.tcl:  Add lots of comments.  Clean up code.
	* (gdbtk_tcl_fputs):  Make output window redirectable.
	* Add assembly window, and breapoint support.
	* Make button 1 in margin toggle breakpoints.
	* Use stippling to indicate breakpoint disabling.
1994-09-13 16:24:01 +00:00
Jeffrey Osier
ece44a1fb6 gasp.texi: a few edits thanks to crash 1994-09-13 09:52:15 +00:00
Ken Raeburn
e23b25eccd Generate .gdbinit file:
* aclocal.m4 (GAS_GDBINIT): New macro.
	* configure.in: Use it.
	* configure: Regenerated.
(using autoconf-1.117)
1994-09-13 05:54:13 +00:00
Jeff Law
7e9825f0b7 * gas/hppa/reloc/r_no_relocbug.s: New test.
* gas/hppa/reloc/reloc.exp: Run it.

	* gas/hppa/reloc/reloc.exp (do_function_reloc_bug): Update
	expected output.
1994-09-13 04:22:49 +00:00
Jeff Law
c7ca67cb67 * som.c (som_reloc_skip): Correct off-by-one error for 4-byte
R_NO_RELOCATION fixups.
	(bfd_section_from_som_symbol): Return the absolute section if the
	symbol isn't contained in any section in the output file.
	(som_slurp_symbol_table): ST_PRI_PROG and ST_SEC_PROG symbols are
	not function symbols (they are magic code labels which *can* be the
	targets of cross space branches).  $START$ is not a section symbol.
1994-09-13 04:06:07 +00:00
Ken Raeburn
c570d36139 PIC enhancements just checked in (based on work of Paul Kranenburg and Eric
Youngdale).

New debugging code for .gdbinit.  "this file generated..." msg in config.h.
1994-09-13 02:20:55 +00:00
Ken Raeburn
f0b37b4ad6 * tc-i386.c (TC_RELOC): New macro.
(struct _i386_insn): New field disp_reloc.
(GOT_symbol): New variable.
(operand_special_chars): Added square-brackets and at-sign.
(reloc) [BFD_ASSEMBLER]: Added new argument OTHER; if it is not NO_RELOC, just
return it.
(reloc) [! BFD_ASSEMBLER]: Add third argument to dummy macro.
(BFD_RELOC_386_PLT32, _GOT32, _GOTOFF) [! BFD_ASSEMBLER]: More dummy macros.
(tc_i386_fix_adjustable): New function.  Returns zero if symbol in fixup is not
local, to prevent relocations against externals from being dropped.
(md_assemble): Initialize disp_reloc field to NO_RELOC.  Pass disp_reloc field
to reloc() function, and use TC_RELOC to generate value to pass to fix_new_exp.
(md_assemble): Change 32-bit reloc against GOT_symbol into a GOTPC reloc.
(i386_operand): Initialize disp_reloc field to NO_RELOC.  Handle @GOTOFF, @PLT,
@GOT operands.  For GOTOFF relocations with local symbols, force generation of
the section symbol.
(md_estimate_size_before_relax): If GOT_symbol exists, decide we're generating
PIC code, and convert relocations against undefined symbols from PCREL to
PLT32.
(md_apply_fix_1) [OBJ_ELF]: Fix up values for dynamic-linking relocs.
(md_undefined_symbol): Notice GLOBAL_OFFSET_TABLE_NAME and set and return
GOT_symbol if it matches.
(F, MAP): Move macro definitions outside function.
(tc_gen_reloc): Only switch on size and pcrel if code wasn't already supplied
as PLT32. GOT32, GOTOFF, or GOTPC.  Convert BFD_RELOC_32 using GOT_symbol into
GOTPC.

* tc-i386.h (TC_RELOC, tc_fix_adjustable, TC_RELOC_GLOBAL_OFFSET_TABLE,
TC_RELOC_RTSYM_LOC_FIXUP): New macros.
(NEED_FX_R_TYPE): Define.
(LOCAL_LABEL): Accept ".X" prefix too.
(GLOBAL_OFFSET_TABLE_NAME): Default to "_GLOBAL_OFFSET_TABLE_".
1994-09-13 02:15:23 +00:00
Ken Raeburn
d9d6f09465 * write.c (fixup_segment): Test TC_RELOC_RTSYM_LOC_FIXUP on fixup before
processing same-section pcrel relocations.
(TC_RELOC_RTSYM_LOC_FIXUP): Default to 1.
1994-09-13 02:11:25 +00:00
Ken Raeburn
d90f530be0 * expr.c (make_expr_symbol): If operator is O_symbol and X_add_number is zero,
just return the symbol.  If operator is O_constant, resolve the symbol's value
before returning.
(operand): Permit use of "[]" for grouping.
(clean_up_expression): For difference of two symbols in the same frag, add the
difference of their offsets into X_add_number.
(expr): Reduce difference of two symbols in same frag to their difference.
1994-09-13 02:10:43 +00:00