Commit Graph

1298 Commits

Author SHA1 Message Date
Ian Lance Taylor f10d31aa32 * i386linux.c (linux_add_one_symbol): Don't do anything Linux
specific if this is not a Linux hash table.  From Eric Youngdale
	<eric@aib.com>.
1994-12-21 00:46:03 +00:00
Ian Lance Taylor 182b9e9f52 Patches from kkojima@mix.or.jp (Kazumoto Kojima):
* mipsbsd.c (mips_howto_table_ext): Change sizes of memory relocs
	apply to from two bytes to four bytes.
	* MY(reloc_howto_type_lookup): Handle BFD_RELOC_CTOR.
1994-12-21 00:36:26 +00:00
Ken Raeburn 85200ebce9 * elfcode.h (assign_file_positions_except_relocs): In assertion, force all
values to the same type.
1994-12-20 20:31:36 +00:00
Steve Chamberlain e7d9ee909c * coff-h8300.c (howto_table): All relocs get a special function.
(special): Never do anything when linking -r.
1994-12-20 19:13:55 +00:00
Ian Lance Taylor 9b09a01580 * elf32-i386.c (elf_i386_relocate_section): Correct and expand the
list of cases for which relocation need not be computed.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1994-12-20 19:07:11 +00:00
Jeff Law 5874427fb9 * elf32-hppa.c (elf32_hppa_read_symext_info): Delete do_locals and
do_globals arguments, always read symbol extension information for
	globals and locals.  All callers changed.
	(elf32_hppa_size_stubs): Rework to only read symbol extension
	information once for each input bfd.  Another 10% improvement in
	linker performance.
1994-12-20 06:17:09 +00:00
Ian Lance Taylor 963747b358 * elfcode.h (elf_section_from_bfd_section): Check
bfd_is_abs_section, etc., only after checking for the section in
	the BFD and after calling the backend routine.
1994-12-16 17:30:08 +00:00
Ian Lance Taylor 2f19e36d97 * elfcode.h (elf_map_symbols): Only use section symbols whose
value is the start of the section, checking output_offset when
	using output_section.  When creating a new symbol, set the value
	to 0, since BFD symbol values are section relative.
1994-12-15 04:41:39 +00:00
Ian Lance Taylor f5202354c3 * elfcode.h (elf_map_symbols): Only use section symbols whose
value is the start of the section.
1994-12-15 01:23:40 +00:00
Ian Lance Taylor 1088e1483c * cpu-z8k.c (arch_info_struct): Make z8002 the default
architecture.
1994-12-13 18:33:05 +00:00
Ian Lance Taylor a0020ea1a4 * aoutx.h (NAME(aout,link_add_symbols)): Similar change if the
first object is not an a.out object.
1994-12-09 22:18:49 +00:00
Ian Lance Taylor 4c124191db * elfcode.h (elf_bfd_link_add_symbols): If the first object in the
archive is not an ELF object, pass the archive to the add_symbols
	entry point appropriate for the first object.  From Eric Youngdale
	<eric@aib.com>.
1994-12-09 17:57:47 +00:00
Ian Lance Taylor aeec67f08c * elf32-i386.c (elf_i386_relocate_section): Don't compute
relocation in cases where we won't use it.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
1994-12-09 17:44:45 +00:00
Ken Raeburn f8368802df * pc532-mach.c (NAME): Define to use ns32kaout prefix.
* ns32knetbsd.c (NAME): Ditto.
(ns32kaout_32_get_section_contents): Define to standard aout-32 version.
1994-12-08 20:47:46 +00:00
Ian Lance Taylor 729850916c * coff-sh.c: Use _bfd_dummy_target instead of no_archive. 1994-11-30 19:14:23 +00:00
David Edelsohn 20e5867807 * config/arc-elf.mt: New file. 1994-11-30 01:35:40 +00:00
David Edelsohn 05cedcf6c1 Initial ARC support. 1994-11-30 01:29:26 +00:00
J.T. Conklin 5b0f1ab5f1 * config.bfd (i[345]86-*-freebsd*): Use i386-bsd as bfd_name.
* configure.host (i[345]86-*-freebsd*): Use i386bsd as my_host.
CVSn:
1994-11-29 22:24:39 +00:00
J.T. Conklin 382229dc12 * config/m68k-nbsd.mt (DEFAULT_VECTOR): set to m68knetbsd_vec.
* Makefile.in: Rebuilt dependancies.
  (CFILES): Added m68knetbsd.c.
  (HFILES): Added netbsd.h.
1994-11-28 23:43:02 +00:00
Steve Chamberlain 7a1d45675e * coff-sh.c (shlcoff_vec): New target vector.
(no_archive): New function.
	* coffcode.h (coff_set_arch_mach_hook, coff_set_flags): Handle
	little endian SH.
	* configure.in: Handle shl.
	* targets.c (bfd_target_vector): Add shlcoff_vec.
	* config/sh-coff.mt (SELECT_VECS): Handle shl_coff_vec.
1994-11-24 03:33:48 +00:00
Jeff Law 150bd9910b * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Do not add
input_section->vma to the relocation's offset.
1994-11-23 06:36:43 +00:00
Ian Lance Taylor ba3eb9c013 * srec.c (srec_get_reloc_upper_bound): Define.
(srec_canonicalize_reloc): Define.
	(srec_bfd_reloc_type_lookup): Define.
	(srec_vec, symbolsrec_vec): Use BFD_JUMP_TABLE_RELOCS (srec).
PR 5975.
1994-11-21 17:42:04 +00:00
Peter Schauer ae4471f628 * configure.host (i[345]86-*-solaris*): Use solaris2 to
enable extraction of procfs info from core file for GDB.
1994-11-19 11:14:01 +00:00
Ken Raeburn fca2b81b88 * reloc.c (bfd_reloc_code_type): Add new value BFD_RELOC_12_PCREL.
* bfd-in2.h, libbfd.h: Rebuilt.
1994-11-17 22:46:22 +00:00
Jeff Law b68a74d193 * bfd/elf32-hppa.c (elf32_hppa_bfd_final_link_relocated): Use the
vma from the output_section containing $global$ when computing
        global_vlaue.
1994-11-17 20:14:19 +00:00
Ian Lance Taylor cf9557f5ea * archive.c (_bfd_write_archive_contents): Round up the archive
header size of the extended name table to an even number.
1994-11-17 19:32:06 +00:00
Ken Raeburn f6f350fe5b * coff-sh.c: Deleted some code that was commented out or inside "#if 0".
(COFF_LONG_FILENAMES): Define.

* cpu-sh.c (arch_info_struct): Convert name to lowercase, for consistency with
other architectures.
1994-11-16 22:28:22 +00:00
Ian Lance Taylor e6fb0df7c0 * elfcode.h (elf_export_symbol): Also export symbols which are
referenced by a regular file.
1994-11-13 04:51:53 +00:00
Ian Lance Taylor 11bb5591d6 * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add
export_dynamic argument, and handle it.
	(elf_export_symbol): New function.
	* bfd-in.h (bfd_elf32_size_dynamic_sections): Update declaration.
	(bfd_elf64_size_dynamic_sections): Update declaration.
	* bfd-in2.h: Rebuild.
1994-11-12 20:55:33 +00:00
Jeff Law 63ba709f37 * hpux-core.c (hpux_core_struct): Delete handles for the
data, reg and stack sections.  They're never used.  Delete
	accessor macros.
	(make_bfd_asection): Use bfd_make_section_anyway since debugging
	cores from dynamic executables may have several sections with the
	same logical name.
	(hpux_core_core_file_p): Don't save handles to data, reg and
	stack sections.  Handle CORE_TEXT, CORE_MMF and CORE_SHM.
1994-11-11 17:40:27 +00:00
Ian Lance Taylor 0631def34c * bout.c (callj_callback): Add new argument shrinking. Change all
callers.  Handle relocs against section symbols correctly.  If not
	shrinking, don't subtract out dstidx; the subtraction is already
	in the object file.
PR 5883.
1994-11-08 18:05:43 +00:00
Ken Raeburn 30d1f88c98 configure.in: fix ns32knetbsd_vec -> pc532netbsd_vec 1994-11-04 00:02:18 +00:00
Ken Raeburn 9e6473f52a aoutx.h fixes from net 1994-11-03 23:52:52 +00:00
Ken Raeburn 72f2e98420 go32 patches from dj 1994-11-03 23:50:48 +00:00
Ken Raeburn 1ef625b778 Makefile.in (ALL_MACHINES): Include m68knetbsd.o. 1994-11-03 23:49:17 +00:00
Ken Raeburn 2c5cdec23d i386linux.mh: include -lm in EXTRALIBS 1994-11-03 23:21:32 +00:00
Ian Lance Taylor 9cb8eb5c28 * archive.c (normalize): Change to take a BFD as an argument.
Change VMS version to use bfd_alloc rather than malloc, so that we
	don't lose the memory forever.
	(_bfd_construct_extended_name_table): Check the name of an archive
	entry which is not being extended, and correct it if it is wrong.
	This is necessary in case the archive was constructed by another
	program which put an entry in the extended name table which we
	don't plan to put in ourselves.  From jjc@jclark.com (James
	Clark).
	(bfd_dont_truncate_arname): Check return value of normalize.
1994-11-02 20:29:18 +00:00
Ian Lance Taylor b531cfe94e * elf32-hppa.c (ELF32_PARISC_SX_SIZE): Define.
(ELF32_PARISC_SX_GET, ELF32_PARISC_SX_PUT): Define.
	(symextn_entry): Don't define.
	(symext_chain_size): Change type to bfd_size_type.
	(symextn_contents): Change type to bfd_byte *.
	(elf32_hppa_backend_begin_write_processing): Use
	ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS).
	(elf32_hppa_size_symext): Likewise.  Also, change type of sizep to
	bfd_size_type *.
	(elf_hppa_tc_make_sections): Cast symextn_contents assignment to
	bfd_byte *.  Use ELF32_PARISC_SX_PUT instead of direct assignment.
	(elf32_hppa_backend_symbol_table_processing): Use
	ELF32_PARISC_SX_SIZE instead of sizeof (symext_entryS).  Use
	ELF32_PARISC_SX_GET insetad of direct assignment.
	(elf32_hppa_read_symext_info): Change type of contents, and its
	assignment cast, to bfd_byte *.  Use ELF32_PARISC_SX_SIZE instead
	of sizeof (symextn_entry).  Use symext_entryS instead of
	symextn_entry.  Use ELF32_PARISC_SX_GET instead of direct
	assignment.
1994-11-01 04:46:07 +00:00
Ian Lance Taylor da6c4a8b3c * archive.c (bfd_dont_truncate_arname): Add the ar padding
character, if there is room for it, even if the name is the
	maximum length.
PR 5859.
1994-10-31 20:23:47 +00:00
Ian Lance Taylor 2d2d08ed7b * elfcode.h (assign_file_positions_except_relocs): Sort the ELF
headers by section address when assigning file positions.
	(elf_sort_hdrs): New static function.
1994-10-31 19:21:40 +00:00
Ian Lance Taylor 197e30e560 * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Create DT_INIT
and DT_FINI dynamic entries based on the existence of _init and
	_fini symbols, not on the .init and .fini sections.  This is
	compatible with some SVR4 linkers.
	(elf_bfd_final_link): Corresponding change.
1994-10-31 00:04:03 +00:00
Ian Lance Taylor dd4219176d * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't move a
symbol with a PLT entry into the .plt section if it is defined in
	a regular file.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
1994-10-30 03:41:50 +00:00
Ian Lance Taylor 54f16fc4bb * linker.c (_bfd_generic_link_add_archive_symbols): It's not an
error if an empty archive has no symbol table.
	* ecoff.c (ecoff_link_add_archive_symbols): Likewise.
	* elfcode.h (elf_link_add_archive_symbols): Likewise.
1994-10-29 16:20:41 +00:00
J.T. Conklin ec35a1c2f3 NetBSD/m68k support, based on work by mikeb@snow.datametrics.com:
* config.bfd (m68*-*-netbsd*): Use m68k-nbsd as bfd_name.
* configure.in (m68knetbsd_vec): Added.
* targets.c (bfd_m68knetbsd_vec): Added.
* hosts/m68knbsd.h, config/m68k-nbsd.mt, m68knetbsd.c: New files.
* Makefile.in (BFD32_BACKENDS, CFILES): Add m68knetbsd.c.

miscellaneous cleanup required by all netbsd targets, based on work
by Andrew Cagney <cagney@highland.com.au>:
* netbsd.h (N_MAGIC, N_SET_MAGIC, N_GETMAGIC, N_GETMAGIC2, N_TXTADDR,
  N_TXTOFF, N_ALIGN, N_DATADDR, N_DATOFF): Removed.  Generic a.out
  definitions work.
* i386nbsd.c, ns32knbsd.c, sparcnbsd.c (__LDPGSZ): Removed.
  (MY(write_object_contents)): Use NetBSD's magic numbers
1994-10-28 18:11:15 +00:00
Ian Lance Taylor 14cac507a8 * libelf.h (struct bfd_elf_section_data): Add field dynindx.
* elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Don't finalize
	the .dynsym, .dynstr or .hash sections until after the backend
	size_dynamic_sections routine, so that it can add dynamic symbols
	if it wants to.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Don't define the
	symbol to be in the .plt section when generating a shared library
	if it is a defined symbol.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	(elf32_sparc_size_dynamic_sections): When generating a shared
	library, allocate space for a dynamic symbol for each output
	section, storing the index in the dynindx field of the ELF section
	data.  Adjust the other dynindx fields to account for this.
	(elf32_sparc_adjust_dynindx): New static function.
	(elf32_sparc_relocate_section): When copying a reloc into a shared
	library, use the original addend as appropriate.  Convert an
	R_SPARC_32 reloc into an R_SPARC_RELATIVE reloc.  Use the dynamic
	symbol index of the output section, not the normal symbol index.
	(elf32_sparc_finish_dynamic_sections): Don't die if a section does
	not exist when setting the value of the dynamic tags.  Write out
	a dynamic symbol for each output section.
1994-10-27 21:25:31 +00:00
Ian Lance Taylor 875e471661 * aoutx.h (aout_link_input_section): Don't bother to read or write
the relocs if there aren't any.
1994-10-26 05:17:08 +00:00
Ian Lance Taylor 9c26be63fd * linker.c (enum link_action): Add CIND.
(link_action): Change COMMON_ROW\indr from MDEF to CREF.  Change
	INDR_ROW\common from MDEF to CIND.
	(_bfd_generic_link_add_one_symbol): In CREF case, handle an
	existing symbol which is indirect rather than defined.  Add new
	CIND case.
1994-10-25 15:47:59 +00:00
Ian Lance Taylor fd9a6abc83 Change S-record backend to use multiple sections to handle gaps in
file.
	* srec.c (srec_data_list_struct): Move field next from last place
	to first.  Change type of data to bfd_byte *.
	(struct srec_symbol): Define.
	(tdata_type): Remove done_symbol_read, count, strings, symbol_idx,
	string_size, string_idx.  Change type of symbols to struct
	srec_symbol *.  Add symtail and csymbols.
	(low, high): Remove.
	(size_symbols, fillup_symbols, size_srec, fillup): Remove.
	(white, skipwhite, pass_over, object_p): Remove.
	(srec_mkobject): Call srec_init.  Adjust tdata initialization for
	field changes.
	(srec_get_byte, srec_bad_byte): New static functions.
	(srec_new_symbol, srec_scan): New static functions.
	(srec_object_p): Change type of b to bfd_byte.  Explicitly set
	wrong_format error.  Call srec_mkobject and srec_scan instead of
	object_p.
	(symbolsrec_object_p): Likewise.  Also, change b to be only two
	bytes.
	(srec_read_section): New static function.
	(srec_get_section_contents): Call srec_read_section rather than
	pass_over.  Handle zero length section correctly.
	(set_set_arch_mach): Change from function to macro.
	(srec_set_section_contents): Change data to bfd_byte *.
	(srec_write_record): Change data, end and src to bfd_byte *.
	(srec_write_header): Change buffer and dst to bfd_byte *.
	(srec_write_section): Change location to bfd_byte *.
	(srec_write_terminator): Change buffer to bfd_byte *.
	(srec_get_symtab_upper_bound): Don't call
	srec_get_section_contents.
	(srec_get_symtab): Rewrite.
1994-10-24 20:08:33 +00:00
Ian Lance Taylor a56f23aeb9 * ecoff.c (ecoff_set_symbol_info): Set udata.i to 0, not NULL. 1994-10-24 19:37:18 +00:00
J.T. Conklin 32399d323e * libaout.h (machine_type): added M_68K_NETBSD and M_SPARC_NETBSD.
* i386netbsd.c, ns32knetbsd.c, sparcnetbsd.c: removed RCS Id's.
  changed how PAGE_SIZE and SEGMENT_SIZE are defined so they are
  consistant with each other.
* netbsd.h (N_HEADER_IN_TEXT, TEXT_START_ADDR): NetBSD fits its
  header into the start of its text segment.
1994-10-21 23:55:30 +00:00