Commit Graph

6 Commits

Author SHA1 Message Date
Ian Lance Taylor 6c534df0c9 * libnlm.h (struct nlm_obj_tdata): Add nlm_cygnus_section_hdr
field.
	(nlm_cygnus_section_header): New accessor macro.
	* nlmcode.h (nlm_object_p): Free new tdata structure if failure.
	Add fixed sections before swapping in auxiliary headers.  After
	adding sections, treat errors as real, not as wrong format.
	(nlm_swap_auxiliary_headers_in): Swap in the sections header; add
	sections to the BFD for each section it describes.
	(nlm_swap_auxiliary_headers_out): Swap out the sections header.
	(nlm_compute_section_file_positions): Account for the size of the
	sections header.
1994-04-21 16:13:01 +00:00
Ian Lance Taylor 326e32d7ce Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from
	get_symtab_upper_bound, bfd_canonicalize_symtab,
	bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc.  They now
	return long instead of unsigned int, and use -1 to indicate an
	error.  Along the way, rename get_symtab_upper_bound to
	bfd_get_symtab_upper_bound.
	* bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on
	errors.
	(bfd_canonicalize_reloc): Likewise.
	* syms.c (bfd_get_symtab_upper_bound): Renamed from
	get_symtab_upper_bound.
	* targets.c (bfd_target): Renamed _get_symtab_upper_bound to
	_bfd_get_symtab_upper_bound, and changed it and
	_bfd_canonicalize_symtab and _get_reloc_upper_bound and
	_bfd_canonicalize_reloc to all return long.
	* aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors.
	(NAME(aout,canonicalize_reloc)): Likewise.
	(NAME(aout,get_reloc_upper_bound)): Likewise.
	(NAME(aout,get_symtab_upper_bound)): Likewise.
	* bout.c (b_out_canonicalize_reloc): Likewise.
	(b_out_get_reloc_upper_bound): Likewise.
	* coffcode.h (coff_canonicalize_reloc): Likewise.
	* coffgen.c (coff_get_symtab_upper_bound): Likewise.
	(coff_get_symtab): Likewise.
	(coff_get_reloc_upper_bound): Likewise.
	* ecoff.c (ecoff_get_symtab_upper_bound): Likewise.
	(ecoff_get_symtab): Likewise.
	(ecoff_canonicalize_reloc): Likewise.
	* elfcode.h (elf_get_symtab_upper_bound): Likewise.
	(elf_get_reloc_upper_bound): Likewise.
	(elf_canonicalize_reloc): Likewise.
	(elf_get_symtab): Likewise.
	* hp300hpux.c (MY(get_symtab)): Likewise.
	(MY(get_symtab_upper_bound)): Likewise.
	(MY(canonicalize_reloc)): Likewise.
	* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
	* ieee.c (ieee_slurp_external_symbols): Change return type to
	boolean.  Check for errors from get_symbol.
	(ieee_slurp_symbol_table): Change return type to boolean.  Check
	for errors from ieee_slurp_external_symbols.
	(ieee_get_symtab_upper_bound): Return long, and -1 on errors.
	(ieee_get_symtab): Likewise.
	(ieee_get_reloc_upper_bound): Likewise.
	(ieee_canonicalize_reloc): Likewise.
	* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
	* nlmcode.h (nlm_get_symtab_upper_bound): Likewise.
	(nlm_get_symtab): Likewise.
	(nlm_get_reloc_upper_bound): Likewise.
	(nlm_canonicalize_reloc): Likewise.
	* oasys.c (oasys_get_symtab_upper_bound): Likewise.
	(oasys_get_symtab): Likewise.
	(oasys_get_reloc_upper_bound): Likewise.
	(oasys_canonicalize_reloc): Likewise.
	* som.c (som_get_symtab_upper_bound): Likewise.
	(som_get_symtab): Likewise.
	(som_get_reloc_upper_bound): Likewise.
	(som_canonicalize_reloc): Likewise.
	* srec.c (srec_get_symtab_upper_bound): Likewise.
	(srec_get_symtab): Likewise.
	(srec_get_reloc_upper_bound): Define as bfd_0l.
	(srec_canonicalize_reloc): Likewise.
	* tekhex.c (tekhex_get_symtab): Return long, and -1 on errors.
	(tekhex_get_symtab_upper_bound): Likewise.
	(tekhex_get_reloc_upper_bound): Define as bfd_0l.
	(tekhex_canonicalize_reloc): Likewise.
	* libaout.h (NAME(aout,get_symtab_upper_bound)): Change
	declaration to return long.
	(NAME(aout,get_symtab)): Likewise.
	(NAME(aout,canonicalize_reloc)): Likewise.
	(NAME(aout,get_reloc_upper_bound)): Likewise.
	* libcoff-in.h (coff_get_symtab_upper_bound): Likewise.
	(coff_get_symtab): Likewise.
	(coff_get_reloc_upper_bound): Likewise.
	* libecoff.h (ecoff_get_symtab_upper_bound): Likewise.
	(ecoff_get_symtab): Likewise.
	(ecoff_canonicalize_reloc): Likewise.
	* libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise.
	(bfd_elf32_get_symtab): Likewise.
	(bfd_elf32_get_reloc_upper_bound): Likewise.
	(bfd_elf32_canonicalize_reloc): Likewise.
	(bfd_elf64_get_symtab_upper_bound): Likewise.
	(bfd_elf64_get_symtab): Likewise.
	(bfd_elf64_get_reloc_upper_bound): Likewise.
	(bfd_elf64_canonicalize_reloc): Likewise.
	* libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise.
	(nlmNAME(get_symtab)): Likewise.
	(nlmNAME(get_reloc_upper_bound)): Likewise.
	(nlmNAME(canonicalize_reloc)): Likewise.
	* archive.c (compute_and_write_armap): Use error_return and
	no_memory_return labels rather than freeing information in various
	places.  Change storage, symcount and src_count to long.  Check
	errors from bfd_get_symtab_upper_bound and
	bfd_canonicalize_symtab.
	* bout.c (b_out_relax_section): Change reloc_size to long.  Check
	for errors from bfd_get_reloc_upper_bound and
	bfd_canonicalize_reloc.
	(b_out_get_relocated_section_contents): Likewise.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
	Likewise.
	* elf32-mips.c: Likewise.
	* elf32-hppa.c (hppa_elf_stub_finish): Likewise.
	(hppa_look_for_stubs_in_section): Check for errors from
	bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
	bfd_canonicalize_reloc.
	* ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors
	from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
	* linker.c (generic_link_read_symbols): Likewise.
	(_bfd_generic_final_link): Check for errors from
	bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
	* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
	(bfd_coff_reloc16_get_relocated_section_contents): Likewise.
	* libbfd.c (bfd_0l): New function.
	* libbfd-in.h (bfd_0l): Declare.
	* aix386-core.c: Change get_symtab_upper_bound, get_symtab,
	get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather
	than bfd_0u.
	* cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise.
	* irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise.
	* bfd-in2.h: Rebuilt.
	* libbfd.h: Rebuilt.
	* libcoff.h: Rebuilt.

	* nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables
	temp and name.
1994-03-30 22:15:07 +00:00
Ian Lance Taylor cdbfad1cd7 * libnlm.h (struct nlm_backend_data): New fields
optional_prefix_size, nlm_backend_object_p, nlm_write_prefix,
	nlm_set_public_section, nlm_get_public_offset.  Removed unused
	nlm_write_reloc field.  Changed nlm_write_import to remove
	unnecessary symbol argument.  Renamed nlm_write_externals to
	nlm_write_external, and changed cound argument from bfd_vma to
	bfd_size_type.
	(nlm_optional_prefix_size, nlm_backend_object_p_func,
	nlm_write_prefix_func, nlm_set_public_section_func,
	nlm_get_public_offset_func): New accessor macros.
	(nlm_write_reloc_func): Removed.
	(nlm_write_external_func): Adjusted for field renaming.
	* nlm32-i386.c (nlm_i386_write_import): Renamed from
	nlm_i386_write_reloc.  Removed old nlm_i386_write_import which
	just called old nlm_i386_write_reloc.
	(nlm_i386_write_external): Renamed from nlm_i386_write_externals.
	Declared.  Changed second argument from bfd_vma to bfd_size_type.
	(nlm32_i386_backend): Adjusted for changes to fields and names.
	* nlm32-sparc.c (nlm_sparc_mangle_relocs): Removed unused,
	ifdeffed out code.
	(nlm_sparc_write_import): Removed second argument.
	(nlm_sparc_write_external): Renamed from
	nlm_sparc_write_externals.  Changed second argument from bfd_vma
	to bfd_size_type.
	(nlm32_sparc_backend): Adjusted for changes to fields and names.
	* nlmcode.h: Removed some unused code.
	(nlm_object_p): Don't destroy tdata pointer.  Call
	backend_object_p function if it exists.
	(nlm_slurp_symbol_table): Removed unused variable rcount.  Call
	set_public_section_func if it exists instead of checking
	NLM_HIBIT.
	(nlm_compute_section_file_positions): Account for
	optional_prefix_size.
	(nlm_write_object_contents): Account for optional_prefix_size.
	Removed useless variable write_reloc_func.  Changed declaration
	and call of write_import_func.  Call write_prefix_func if it
	exists.  Removed unused variables len and temp.  Call
	get_public_offset_func if it exists rather than setting NLM_HIBIT.
1993-12-02 02:22:35 +00:00
Ian Lance Taylor 7389debf1c * libnlm.h (nlm_backend_data): Added nlm_mangle_relocs.
(nlm_mangle_relocs_func): New macro.
	* nlm32-i386.c (nlm_i386_write_reloc): Rewrote correctly.
	(nlm_i386_mangle_relocs): New function.
	* nlmcode.h (nlm_compute_section_file_positions): Move all common
	symbols into the .bss section.
	(nlm_set_section_contents): Call the mangle_relocs function.
	(nlm_write_object_contents): Treat a reloc against any defined
	symbol as an internal reloc.  Fix bug in external reloc counting.
	Get the offset and debugging type right for .bss symbols.  Only
	output debugging symbols for defined symbols.
1993-08-04 20:25:53 +00:00
Fred Fish f03b1f0d44 * libnlm.h (nlm_obj_tdata): Rename hidden struct members to avoid
apparent Sun C preprocessor recursion.  Fix access macros.
	* nlmcode.h:  Remove spurious '&' before several array references.
1993-07-20 22:07:39 +00:00
Fred Fish c3e964b955 * configure.in (*-*-netware, i[34]86-*-netware): New configs.
* Makefile.in (BFD32_BACKENDS):  Add nlm.o, nlm32.o, nlm32-gen.o.
	* Makefile.in (BFD64_BACKENDS):  Add nlm64.o, nlm64-gen.o.
	* Makefile.in (CFILES):  Add nlm{32,64}.c, nlm{32,64}-gen.c.
	* Makefile.in (nlm.o, nlm{32,64}.o, nlm{32,64}-gen.o:  New targets.
	* bfd-in2.h (INLINE):  Defines moved here.
	* {aoutx.h, elf.c, elfcode.h}:  Move INLINE defines to bfd-in2.h.
	* libelf.h (CAT4):  Move define to bfd-in2.h.
	* bfd-in2.h (CAT4):  Merge CAT4 macro with other CAT macros.
	* bfd-in2.h (union tdata):  Add nlm_obj_data.
	* bfd-in2.h (enum target_flavour):  Add bfd_target_nlm_flavour.
	* targets.c (bfd_nlm{32,64}_{big,little}_vec):  Add prototypes.
	* targets.c (target_vector):  Add bfd_nlm{32,64}_{big,little}_vec.
	* (libnlm.h, nlm.c, nlmcode.h, nlm{32,64}-gen.c,
	nlm{32,64}-target.h, nlm{32,64}.c, config/i386-nlm.mt):  New files
	for NLM support.
1993-07-20 04:45:13 +00:00