Commit Graph

2020 Commits

Author SHA1 Message Date
Ian Lance Taylor
66e4e64904 * archive.c (bfd_construct_extended_name_table): SVR4 uses slash
newline at the end of the file name, not just newline.
1994-10-05 18:43:30 +00:00
Ian Lance Taylor
ea4849d5b7 * ecoff.c (_bfd_ecoff_new_section_hook): Default section alignment
power to 4, rather than using align_power_min.
1994-10-04 21:30:45 +00:00
Ian Lance Taylor
28d19d0321 * coffcode.h (coff_new_section_hook): Don't use align_power_min;
use COFF_DEFAULT_SECTION_ALIGNMENT_POWER instead.  Force the .stab
	and .stabstr sections to be aligned to no more than 2.  Remove
	COFF_SPARC special cases.
	* coff-a29k.c: Define COFF_DEFAULT_SECTION_ALIGNMENT_POWER.
	* coff-apollo.c, coff-go32.c, coff-h8300.c: Likewise.
	* coff-h8500.c, coff-i386.c, coff-i960.c, coff-m68k.c: Likewise.
	* coff-m88k.c, coff-rs6000.c, coff-sh.c, coff-sparc.c: Likewise.
	* coff-we32k.c, coff-z8k.c: Likewise.
PR 5706.
1994-10-04 21:13:51 +00:00
Ian Lance Taylor
995b0d3ff3 * configure.in: Use ${config_shell} when running config.bfd. 1994-10-04 16:18:19 +00:00
Ian Lance Taylor
a297d42c27 * cofflink.c (coff_link_input_bfd): Don't try to convert a long
filename if the offset field is zero.
1994-10-04 15:54:27 +00:00
Ian Lance Taylor
dfaf9ef608 * elfcode.h (swap_out_syms): If the alignment of a common symbol
was not set, use a sensible default rather than zero.
PR 5751.
1994-10-04 15:25:02 +00:00
Peter Schauer
7a6c910ea1 * rs6000-core.c (rs6000coff_core_p): Set SEC_HAS_CONTENTS flag
for .stack and .ldinfo sections. Cast coredata.c_tab to a
	file_ptr to avoid warnings from gcc.
1994-10-03 11:47:38 +00:00
Ian Lance Taylor
fb562be02f * elfcode.h (elf_bfd_final_link): Remove assertion when a non
SEC_IN_MEMORY section is found in dynobj.  This can happen when
	linking PIC compiled code.
1994-09-30 17:13:08 +00:00
Ken Raeburn
12cf5d98c7 fix typu 1994-09-29 20:51:57 +00:00
Ken Raeburn
85f340909d * reloc.c (bfd_install_relocation): Change type of data to bfd_byte *, to go
along with yesterday's change.
1994-09-29 20:39:27 +00:00
Ken Raeburn
64e21e0fd7 * elf.c (bfd_elf_print_symbol): Moved here from elf_print_symbol in elfcode.h.
(case bfd_print_symbol_all): Print symbol's size field, except for common
symbols; print their alignment.
* elfcode.h (elf_print_symbol): Deleted.
* libelf.h (bfd_elf_print_symbol): Declare.
(bfd_elf{32,64}_print_symbol): Replace declarations with macros.
1994-09-29 20:36:24 +00:00
Ken Raeburn
9afa408e4f * syms.c (bfd_print_symbol_vandf): Show BSF_LOCAL and BSF_GLOBAL in one column.
Use the column freed up to show BSF_FUNCTION and BSF_FILE.
1994-09-29 20:29:54 +00:00
Ian Lance Taylor
ec591fcf45 * syms.c (stt): Add .rdata and .rodata.
PR 5714.
1994-09-29 16:30:12 +00:00
Ian Lance Taylor
094e8be303 * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte *
before trying to add values to it.
1994-09-28 17:36:42 +00:00
Ian Lance Taylor
5ea9089194 * elfcode.h (assign_file_positions_except_relocs): Align the
section VMA and the file position even if D_PAGED is not set.
1994-09-26 15:40:12 +00:00
Ian Lance Taylor
d80ebaacea * bfd-in.h (bfd_seek): Change declaration to not mark fp const.
* bfd-in2.h: Rebuild.
	* libbfd.c (bfd_seek): Don't mark parameters const, to avoid
	conflicts with declaration.
1994-09-26 15:01:59 +00:00
Ian Lance Taylor
0d9e139762 tipo 1994-09-26 02:48:36 +00:00
Ian Lance Taylor
57b400818d * elfcode.h (map_program_segments): Don't abort if we allocated
too much space for the program header, only if we allocated too
	little.
1994-09-23 19:19:41 +00:00
J.T. Conklin
237402b49b * libaout.h: Fix comment.
* ns32knbsd.h: Changed M_NS32K_NETBSD to M_532_NETBSD to match
  libaout.h.
1994-09-20 20:20:12 +00:00
Ian Lance Taylor
f90a2cdcb0 * coff-sh.c (rtype2howto): Remove; unused.
(coff_sh_relocate_section): Remove unused local variable rstat.
	(reloc_processing): Comment out; unused.
1994-09-20 19:24:50 +00:00
Ian Lance Taylor
fb9a219279 * aoutx.h (aout_link_write_other_symbol): If h->indx is -2, then
always write it out even if it would normally be stripped.
	(aout_link_input_section_std): If we find a reloc against a
	stripped global symbol, force it to be written out rather than
	merely calling unattached_reloc.
	(aout_link_input_section_ext): Likewise.
	(aout_link_reloc_link_order): Likewise.
1994-09-16 16:14:51 +00:00
Ian Lance Taylor
ab0434c26d * aoutx.h (aout_link_write_symbols): Rename skip_indirect to
skip_next.  If we find an N_WARNING symbol which has already been
	written out, set skip_next.
PR 5634.
1994-09-14 23:28:25 +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
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
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
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
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
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
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
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
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
Stan Shebs
5e766076dc * mpw-make.in (ctor.c): Remove references.
* hosts/mpw.h [BFD_TRUE_FALSE]: Remove macro redefinitions of true
	and false.
1994-09-12 23:54:12 +00:00
Ian Lance Taylor
3c9832f89f * elfcode.h (swap_out_syms): Set the type of an undefined symbol
to STT_FUNC if the BSF_FUNCTION flag is set.
1994-09-12 22:16:27 +00:00
Ian Lance Taylor
2a89559527 * cofflink.c (coff_link_input_bfd): If r_symndx is -1, don't
change it.
	(_bfd_coff_generic_relocate_section): If r_symndx is -1, it is an
	absolute reloc.  Don't dump core using r_symndx as an array index.
	* cf-m68klynx.c (coff_bfd_link_add_symbols): Define.
	(lynx_link_add_symbols): New static function (copy of function in
	coff-i386.c).
	(coff_m68k_lynxrtype_to_howto): sym argument may be NULL.
	* coff-i386.c (coff_i386_rtype_to_howto): Likewise.
	* coff-a29k.c (coff_a29k_relocate_section): Handle an r_symndx
	value of -1, meaning an absolute reloc.
1994-09-12 21:01:19 +00:00
Ian Lance Taylor
3cd942de1e * ctor.c: Remove; obsolete.
* Makefile.in: Rebuild dependencies.
	(BFD_LIBS): Remove ctor.o.
	(CFILES): Remove ctor.c.
	* libbfd.h: Rebuild.
1994-09-12 15:47:52 +00:00
Jeff Law
27ebd9525d * elf32-hppa.c (elf32_hppa_relocate_section): If there was a link
error of some sort (for example, undefined symbols), then do not
	apply any relocs, just notify the user of the errors.
	(elf32_hppa_backend_begin_write_processing): Do not build a symbol
	extension section for an executable (it's useless).
	(elf32_hppa_link_output_symbol_hook): Do nothing if there was a
	link error of some sort (for example, undefined symbols).
	(elf32_hppa_read_symext_info): Kludge.  Turn off SEC_HAS_CONTENTS
	for all the input symbol extension sections to keep the generic
	BFD code happy.  Temporarily turn it on to read the contents of
	the symbol extension section.
1994-09-12 08:07:13 +00:00
Jeff Law
29f1ccee6d Revert last change (never should have been checked in to begin with). 1994-09-12 04:06:07 +00:00
Jeff Law
95bc714ee8 * config/hppaosf.mh (RANLIB): Do not set.
* config/hppabsd.mh (RANLIB): Likewise.
1994-09-12 04:04:09 +00:00
Ian Lance Taylor
5b89e1a00c Get the new COFF linker code working for i386-lynx.
* cf-i386lynx.c: Remove #if 0 code.
	(i386_lynxos_coff_object_p): Remove unused function.
	(coff_bfd_link_add_symbols): Define.
	(lynx_link_add_symbols): New static function.
	* coffcode.h (coff_bfd_link_hash_table_create): If
	coff_relocate_section is defined, only define this if not already
	defined.
	(coff_bfd_link_add_symbols, coff_bfd_final_link): Likewise.

	* linker.c (_bfd_generic_final_link): Handle
	bfd_indirect_link_order explicitly, rather than via
	_bfd_default_link_order.
	(set_symbol_from_hash): New static function, broken out of
	_bfd_generic_link_write_global_symbol.
	(_bfd_generic_link_write_global_symbol): Symbol setting code moved
	to set_symbol_from_hash; call it.
	(default_indirect_link_order): Add generic_linker argument.
	Change all callers.  If false, set the generic symbols based on
	the hash table entries.
1994-09-12 02:57:23 +00:00
Ian Lance Taylor
67ff4a5616 * coffgen.c (coff_get_symtab): Reindented. Removed commented out
call to bfd_constructor_entry.
1994-09-09 20:38:37 +00:00
Ken Raeburn
6c3bc2b8f6 keep arm files 1994-09-09 18:35:11 +00:00
Ian Lance Taylor
bd23b552ef Convert m68k COFF to use new COFF backend linker.
* coff-m68k.c (coff_relocate_section): Define.
	* cf-m68klynx.c (coff_rtype_to_howto): Define.
	(coff_m68k_lynx_rtype_to_howto): New static function.
	* configure.in (m68kcoff_vec): Build cofflink.o.
	(m68kcoffun_vec, m68klynx_coff_vec): Likewise.
1994-09-09 15:54:45 +00:00
Steve Chamberlain
2546fb27f0 * coff-h8300.c (h8300_reloc16_extra_cases, case RELBYTE): Flag overflows
correctly.
1994-09-08 23:27:56 +00:00
Ian Lance Taylor
1208625d33 * libelf.h (struct elf_backend_data): Change second argument of
elf_backend_final_write_processing hook to boolean.
	(struct elf_obj_tdata): Add linker field.
	* elfcode.h (NAME(bfd_elf,write_object_contents)): Pass value of
	tdata linker field to final_write_processing, rather than NULL.
	(elf_bfd_final_link): Don't call final_write_processing hook.  Set
	tdata linker field to true.
	* elf32-mips.c (mips_elf_final_write_processing): Change type of
	second argument to boolean.
	* elf32-hppa.c (elf32_hppa_backend_final_write_processing):
	Likewise.
1994-09-07 23:41:58 +00:00
Ian Lance Taylor
dc5fff10dd * coff-go32.c (RTYPE2HOWTO): Fully parenthesize arguments.
* coff-i960.c (RTYPE2HOWTO): Likewise.
	* coff-m88k.c (RTYPE2HOWTO): Likewise.
	* coff-we32k.c (RTYPE2HOWTO): Likewise.

	Make i386 COFF use new COFF backend linker.
	* coff-i386.c (RTYPE2HOWTO): Fully parenthesize arguments.
	(coff_relocate_section): Define.
	(coff_i386_rtype_to_howto): New function.
	* configure.in (i386coff_vec): Use cofflink.o.
	(i386lynx_coff_vec): Likewise.

	* coffcode.h (bfd_coff_backend_data): Add new field
	_bfd_coff_rtype_to_howto.
	(bfd_coff_rtype_to_howto): Define.
	(coff_rtype_to_howto): Define to use RTYPE2HOWTO, if not already
	defined.
	(bfd_coff_std_swap_table): Initialize new field.
	* cofflink.c (_bfd_coff_final_link): Allocate section_count + 1
	section_info structures, since the target_index is 1 based.
	(coff_link_input_bfd): Set *secpp to bfd_com_section_ptr for a
	common symbol.  Adjust rel_hash by the output reloc count.
	(_bfd_coff_generic_relocate_section): New function.
	* libcoff-in.h (_bfd_coff_generic_relocate_section): Declare.
	* libcoff.h: Rebuild.
	* coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
1994-09-07 23:16:23 +00:00