Commit Graph

1592 Commits

Author SHA1 Message Date
Ian Lance Taylor aca736871c * libecoff.h (struct ecoff_backend_data): Add adjust_headers
field.
	* ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha
	sections, and set styp correctly for them: .got, .hash, .dynamic,
	.liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment.
	(_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section
	types.
	(ecoff_sort_hdrs): New static function.
	(ecoff_compute_section_file_positions): Return boolean, not void.
	Sort the sections by VMA before looking through them.  Put the
	first non SEC_ALLOC section on a new page.  Put every SEC_ALLOC
	section on an appropriate boundary within the page.
	(ecoff_compute_reloc_file_positions): Check return value of
	ecoff_compute_section_file_positions.
	(_bfd_ecoff_set_section_contents): Likewise.
	(_bfd_ecoff_write_object_contents): Check for various Alpha
	section types when incrementing text_size and data_size.  Call
	adjust_headers backend function if it exists.
	* coff-alpha.c (alpha_adjust_headers): New static function.
	(alpha_ecoff_backend_data): Initialize adjust_headers field.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
PR 8141.
1995-10-05 17:48:32 +00:00
Ian Lance Taylor 2b874a2df4 * hosts/i386bsd.h: Restore file incorrectly deleted on Sep 6. 1995-10-05 15:46:40 +00:00
Jeff Law c780e5dbaf * rs6000-core.c (CORE_VERSION_1): Use CORE_VERSION_1 instead
of ALTERNATE_AIX_CORE_FORMAT.
	* configure.in (aix4): No longer need CORE_FLAGS.
	* configure: Updated.
1995-10-05 00:21:25 +00:00
Ken Raeburn 2a01c351e3 NS32k changes from Ian Dall:
* aoutx.h (MY_final_link_relocate, MY_relocate_contents): New macros.
(aout_link_input_section_std, aout_link_input_section_ext,
aout_link_reloc_link_order): Call them instead of _bfd_* versions.
* aout-target.h (MY_exec_header_not_counted): New macro, defaults to zero.
(backend_data): Use it instead of hardcoded zero.

* aout-ns32k.c (CTOR_TABLE_RELOC_HOWTO): New macro.
(MY_swap_std_reloc_out): Use udata.i for KEEPIT, don't call stoi.

* ns32knetbsd.c: Include bfd.h.
(MY_text_includes_header, MY_bfd_reloc_type_lookup): New macros.
(MY_bfd_reloc_type_lookup): Declare function too.
* pc532-mach.c (set_sizes): Don't declare.
(MY_text_includes_header, MY_exec_header_not_counted): Define.
(backend_data, MY_backend_data): Don't define.

* config.bfd: Treat ns32k-pc532-ux* like ns32k-pc532-mach*, and ns32k-*-lites*
like ns32k-*-netbsd*.

* hosts/nbsd.h: Swap order of sys/vmparam.h and sys/param.h, to compile on
lites.
1995-10-04 20:25:21 +00:00
Ian Lance Taylor 5944d75b46 * coffcode.h (coff_write_object_contents): Restore setting
f_timdat to 0, deleted on August 22.
1995-10-04 18:20:08 +00:00
Steve Chamberlain db344f829d Tue Oct 3 16:28:32 1995 steve chamberlain <sac@slash.cygnus.com>
* coffcode.h (coff_bfd_copy_private_symbol_data,
	coff_bfd_copy_private_section_data,
	coff_bfd_copy_private_bfd_data): ifdef to allow overrides.
	* peicode.h (coff_bfd_copy_private_bfd_data): New
	(pe_bfd_copy_private_bfd_data): New.
	(coff_swap_scnhdr_in): Swap bss size into the right place.
	(pe_print_private_bfd_data): Add some newlines.
1995-10-03 23:44:34 +00:00
Jeff Law 704257cb1b Remove last (incorrect) change. 1995-10-03 19:26:36 +00:00
Jeff Law 97f1feda83 * som.c (setup_sections): Don't die if a space has no subspaces. 1995-10-03 18:48:38 +00:00
Ian Lance Taylor 3d7c42c988 * elflink.h (elf_link_add_object_symbols): Don't let a weak
dynamic symbol override a common symbol.  Don't change the size or
	type if they have been set and the new symbol is not a definition.
	Warn if the size or type changes.
1995-10-02 18:11:12 +00:00
Jeff Law 709af562b8 * som.c (som_begin_writing): Don't write the symbol table or
symbol	strings.
	(som_finish_writing): Write them here.  Place them after the
	subspace data, but before the relocs.

Works around a truely stupid bug in the hpux8/hpux9 linker.  Fixes all
known link-time problems with -mlinker-opt.
1995-10-01 07:38:03 +00:00
Stan Shebs 7009e4519e Description of PowerMac changes. 1995-09-29 02:16:05 +00:00
Steve Chamberlain b91537be61 Thu Sep 28 17:06:23 1995 steve chamberlain <sac@slash.cygnus.com>
* binary.c (binary_get_symtab): Return an empty string on error.
	* opncls.c (bfd_fdpenr): Change WIN32 restriction to WINGDB.
1995-09-29 00:09:21 +00:00
Ian Lance Taylor 69fd4fddca * hp300hpux.c (convert_sym_type): Treat secondary symbols as weak
symbols rather than as indirect symbols.
	(MY(slurp_symbol_table)): Don't do anything special about
	secondary symbols.
1995-09-28 22:27:49 +00:00
Kim Knuttila 30360a6f96 Updated comments 1995-09-28 19:40:52 +00:00
Ian Lance Taylor 46b5a8926d * coffcode.h (coff_new_section_hook): Make sure that the alignment
of .ctors and .dtors sections is no larger than 2.
PR 8006.
1995-09-28 17:57:06 +00:00
Ian Lance Taylor 9db5923077 * sunos.c (sunos_add_one_symbol): Don't change
bfd_link_hash_common to bfd_link_hash_new, since it may be on the
	undef list.
	(bfd_sunos_record_link_assignment): Don't put __DYNAMIC in the
	dynamic symbols when creating a shared library.
	(sunos_scan_ext_relocs): Handle relocs correctly when creating a
	shared library.
	(sunos_scan_dynamic_symbol): Don't mark the __DYNAMIC symbol as
	written even if it is not defined in a regular object.
	(sunos_write_dynamic_symbol): Use plt_offset for the address of
	the jump table reloc.  Add an assertion.  Use RELOC_JMP_SLOT
	rather than the constant 22.
	(sunos_check_dynamic_reloc): Handle creating a shared library.
	(sunos_finish_dynamic_link): Set the first entry in the GOT to
	zero when creating a shared library.
	* aoutx.h (NAME(aout,final_link)): If there is a symbol __DYNAMIC,
	write it out at the start of the symbol table.
1995-09-28 16:30:54 +00:00
Ian Lance Taylor 20d1e233b6 * Makefile.in (BFD32_BACKENDS): Add coff-arm.o. 1995-09-28 15:21:35 +00:00
David Edelsohn a11e10fe44 * config.bfd: Add arm-*-coff.
* configure.in, configure: Add armcoff_{little,big}_vec.
	* targets.c (armcoff_{little,big}_vec): Declare.
	(bfd_target_vector): Add armcoff_{little,big}_vec.
	* coff-arm.c (armcoff_{little,big}_vec): Always define.
1995-09-28 08:08:49 +00:00
Ian Lance Taylor 99062cfcc9 * targets.c (bfd_find_target): Remove debugging code. 1995-09-27 14:38:03 +00:00
Kim Knuttila deacbe0fa0 PPC bfd support 1995-09-27 11:40:15 +00:00
Ian Lance Taylor e6cb7b411b * bfd.c (bfd_assert): Remove \n from string passed to
_bfd_error_handler.
1995-09-26 18:45:16 +00:00
Michael Meissner d22b02e0dc Flesh out branch prediction support. 1995-09-26 18:26:32 +00:00
Ian Lance Taylor 1af85fbbbb * coff-i386.c: (TWO_DATA_SECS): Don't define.
* coffcode.h (bfd_coff_backend_data): Remove _bfd_make_section_hook.
	(bfd_coff_make_section_hook): Don't define.
	(coff_make_section_hook): Remove.
	(sec_to_styp_flags): Remove TWO_DATA_SECS case.
	(styp_to_sec_flags): Likewise.
	(coff_write_object_contents): Likewise.
	(bfd_coff_std_swap_table): Don't initialize make_section_hook
	field.
	* libcoff.h: Rebuild.
	* coffgen.c (make_a_section_from_file): Just call
	bfd_make_section_anyway, not bfd_make_section or
	bfd_coff_make_section_hook.
	* ecoff.c (_bfd_ecoff_make_section_hook): Remove.
	* libecoff.h (_bfd_ecoff_make_section_hook): Don't declare.
	* coff-alpha.c (alpha_ecoff_backend_data): Don't initialize
	make_section_hook field.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
1995-09-26 17:58:38 +00:00
Ian Lance Taylor fcf490c05f * aoutx.h (translate_from_native_sym_flags): Don't try to stuff
pointers into value field for warning and indirect symbols; just
	leave the value field alone.
	* linker.c (generic_link_add_symbol_list): Use next symbol for
	warning and indirect symbols, rather than looking in symbol value.
	* ecoff.c (ecoff_set_symbol_info): Remove indirect_ptr_ptr
	parameter.  Change all callers.  Remove support for indirect
	symbols; it didn't work anyhow.
	(_bfd_ecoff_slurp_symbol_table): Remove indirect_ptr variable.
	* syms.c: Change comments about BSF_WARNING and BSF_INDIRECT.
	* bfd-in2.h: Rebuild.
1995-09-26 16:56:28 +00:00
Ian Lance Taylor 7a7fbffb25 * aout-adobe.c (aout_adobe_callback): Use _bfd_error_handler
rather than a direct fprintf.
	* archive.c (_bfd_write_archive_contents): Likewise.
	* coffcode.h (coff_slurp_symbol_table): Likewise.
	* elf32-ppc.c (ppc_elf_merge_private_bfd_data): Likewise.
	(ppc_elf_unsupported_reloc): Likewise.
	(ppc_elf_relocate_section): Likewise.
	* i386linux.c (linux_tally_symbols): Likewise.
	(linux_finish_dynamic_link): Likewise.
	* osf-core.c (osf_core_core_file_p): Likewise.
	* rs6000-core.c (rs6000coff_get_section_contents): Likewise.
	* som.c (som_sizeof_headers): Likewise.
	* srec.c (srec_bad_byte): Likewise.
	* bfd.c (bfd_assert): Likewise.  Also change file to be const.
	* libbfd-in.h (bfd_assert): Declare first parameter const.
	* libbfd.h: Rebuild.
	* coff-a29k.c (a29k_reloc): Don't bother to fprintf; returning
	bfd_reloc_overflow is enough.
	* coff-h8300.c (rtype2howto): Don't bother to fprintf; just abort.
	* coff-h8500.c (rtype2howto): Likewise.
	* coff-z8k.c (rtype2howto): Likewise.
	* coffcode.h (dummy_reloc16_extra_cases): Likewise.
	* elf.c (_bfd_elf_get_lineno): Likewise.
	(_bfd_elf_no_info_to_howto): Likewise.
	(_bfd_elf_no_info_to_howto_rel): Likewise.
	* hp300hpux.c (convert_sym_type): Likewise.
	(MY(swap_std_reloc_in)): Likewise.
	* elf.c (bfd_section_from_shdr): Remove #if 0 sections.
1995-09-25 21:31:29 +00:00
Ian Lance Taylor f1c6dd5d16 * libaout.h (struct aoutdata): Add line_buf field.
* aoutx.h (NAME(aout,find_nearest_line)): Remove statics buffer
	and filename_buffer.  Instead, use a malloc buffer stored in the
	new line_buf field.  Remove length restrictions.
1995-09-25 20:55:50 +00:00
Ian Lance Taylor f0500a41d0 * coffgen.c (string_size): Remove static variable.
(debug_string_size, debug_string_section): Likewise.
	(coff_fix_symbol_name): Add string_size_p, debug_string_section_p,
	and debug_string_size_p parameters.  Use them instead of the
	global variables.  Change all callers.
	(coff_write_symbol): Likewise.
	(coff_write_alien_symbol, coff_write_native_symbol): Likewise.
	(coff_write_symbols): Add local variables to replace removed
	global variables.
1995-09-25 20:25:12 +00:00
Michael Meissner cc47d19a93 Fix previous change 1995-09-25 20:07:26 +00:00
Ian Lance Taylor 25b5a53dac * libcoff-in.h (struct coff_section_tdata): Add offset, i,
function, and line_base fields.
	* libcoff.h: Rebuild.
	* coffgen.c (coff_find_nearest_line): Use section tdata to cache
	information, rather than using static variables.
1995-09-25 20:03:11 +00:00
Ian Lance Taylor 641ac26a06 * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
file.  From Peter DeWolf <pld@amt.tay1.dec.com>.
1995-09-25 16:45:16 +00:00
Ian Lance Taylor 81449d47c5 * init.c (initialized): Remove static variable.
(bfd_init): Don't bother setting initialized.
	(bfd_check_init): Remove.
	* opncls.c (_bfd_new_bfd): Don't call bfd_check_init.
	* libbfd.h: Rebuild.
1995-09-25 15:50:25 +00:00
Peter Schauer 138b9b81e3 * rs6000-core.c (rs6000coff_core_p): Don't check the core file
size for full core dumps. Copy core file header to private data.
	(rs6000coff_core_file_failing_command,
	rs6000coff_core_file_failing_signal):  New functions to extract
	the file name and terminating signal from the core file.
	* coff-rs6000.c:  Use them.
1995-09-23 11:04:45 +00:00
Ian Lance Taylor 2ffbb79ae4 Change arch info to be const, initialized at compile time.
* archures.c: Reindent many functions.  Change CONST to const.
	(bfd_arch_info_type): Make arch_name const.  Remove disassemble;
	nothing set it anyhow.  Make next const.
	(bfd_arch_info_list): Remove.
	(bfd_archures_list): Rename from archures_init_table.  Change from
	a table of function pointers to a table of bfd_arch_info_type
	structure addresses.
	(bfd_scan_arch): Rewrite accordingly.  Return a const pointer.
	(bfd_lookup_arch): Likewise.
	(bfd_set_arch_info): Rewrite accordingly.  Change argument to be a
	const pointer.
	(bfd_default_arch_struct): Make const.
	(bfd_arch_init, bfd_arch_linkin): Remove.
	(bfd_get_arch_info): Return a const pointer.
	* init.c (bfd_init): Don't call bfd_arch_init.
	* bfd.c (struct _bfd): Make arch_info const.
	* bfd-in2.h: Rebuild.
	* libbfd.h: Rebuild.
	* configure.in: Put & before everything in $selarchs.
	* configure: Rebuild.
	* cpu-*.c: Change bfd_*_arch from a function which calls
	bfd_arch_linkin to a const structure.
	* ieee.c (ieee_object_p): Make arch const.
1995-09-22 22:06:51 +00:00
Michael Meissner 02f85cda33 Start work to all full PowerPC V.4 reloc support. 1995-09-22 20:30:18 +00:00
Michael Meissner dd82c578be Add support -mrelocatable-lib 1995-09-22 02:30:57 +00:00
Ian Lance Taylor e18c4e8f8f * coffcode.h (coff_write_object_contents): Clear the vstamp field
in the a.out header.
1995-09-20 23:09:09 +00:00
Ian Lance Taylor f69e888e4d * aoutx.h (NAME(aout,swap_ext_reloc_out)): Don't set r_extern for
a reloc against a local symbol, even if it's not a section.
1995-09-20 16:10:18 +00:00
Ian Lance Taylor a56552441f * targets.c (bfd_target): Remove unused align_power_min field.
* bfd-in2.h: Rebuild.
	* All backends: Remove initialization of align_power_min.
1995-09-19 21:11:46 +00:00
Steve Chamberlain 500d7394cf Tue Sep 19 14:02:21 1995 steve chamberlain <sac@slash.cygnus.com>
* peicode.h (coff_swap_scnhdr_out): Get sizes for BSS right.
	(pr 8045)
1995-09-19 21:04:02 +00:00
Ian Lance Taylor 049df0a849 Mon Sep 18 14:35:01 1995 Arne H. Juul <arnej@pvv.unit.no>
* config.bfd (mips-dec-netbsd*): New target.
	* configure.host (mips-dec-netbsd*): New host.
	* configure.in (mips-dec-netbsd*): New native.
	* configure: Rebuild.
1995-09-18 18:37:58 +00:00
Ian Lance Taylor 1862bbd8d9 Make the COFF backend linker merge common types:
* cofflink.c (struct coff_debug_merge_element): Define.
	(struct coff_debug_merge_type): Define.
	(struct coff_debug_merge_hash_entry): Define.
	(struct coff_debug_merge_hash_table): Define.
	(coff_debug_merge_hash_table_init): Define.
	(coff_debug_merge_hash_table_free): Define.
	(coff_debug_merge_hash_lookup): Define.
	(struct coff_final_link_info): Add debug_merge field.
	(coff_debug_merge_hash_newfunc): New static function.
	(_bfd_coff_final_link): Allocate and free debug_merge table.
	(coff_link_input_bfd): Merge identical enum, struct and union
	types.
PR 7145.
1995-09-15 14:29:05 +00:00
Ian Lance Taylor a208a70f7a Convert i960 COFF to use COFF backend linker.
* coff-i960.c (coff_i960_relocate): Use a coff_section_data
	structure to store the symbol being used.
	(coff_i960_start_final_link): New static function.
	(coff_i960_relocate_section): New static function.
	(coff_i960_adjust_symndx): New static function.
	(coff_start_final_link): Define.
	(coff_relocate_section): Define.
	(coff_adjust_symndx): Define.
	* coffcode.h (bfd_coff_backend_data): Add new callback function
	_bfd_coff_start_final_link.
	(bfd_coff_start_final_link): Define.
	(coff_start_final_link): Define if not defined.
	(bfd_coff_std_swap_table): Add coff_start_final_link.
	* cofflink.c (_bfd_coff_internal_syment_name): Make globally
	visible.
	(_bfd_coff_final_link): Call bfd_coff_start_final_link if the
	function callback is not NULL.
	* libcoff-in.h (struct coff_section_tdata): Add tdata field.
	(_bfd_coff_internal_syment_name): Declare.
	* libcoff.h: Rebuild.
	* configure.in (icoff_big_vec): Add cofflink.o.
	(icoff_little_vec): Likewise.
	* configure: Rebuild.
1995-09-14 19:03:21 +00:00
Fred Fish f0abedbe98 * Makefile.in (clean-info): Remove extraneous tab from line
following action.
1995-09-14 00:39:41 +00:00
Ian Lance Taylor aa4b3dc509 * cofflink.c (coff_link_input_bfd): Fail if a section with no
contents has relocs.
PR 7979.
1995-09-13 17:29:05 +00:00
Ian Lance Taylor 9521bac394 * Makefile.in (do_maintainer_clean): Rename from do_realclean.
(maintainer-clean): Rename from realclean, passing
	maintainer-clean down to subdirectories, but leave realclean as a
	synonym.
1995-09-12 22:16:14 +00:00
Ian Lance Taylor 4ca6381165 * linker.c (_bfd_generic_link_add_one_symbol): Pass symbol name to
warning callback.
1995-09-12 20:31:29 +00:00
Steve Chamberlain beee31b1a2 Thu Sep 7 12:45:34 1995 steve chamberlain <sac@slash.cygnus.com>
* coffcode.h (coff_compute_section_file_positions): Keep the
	raw size safe.
	(coff_write_object_contents): Remember if it's a relocatable
	file.
	* libcoff-in.h (pe_data_type): New member 'has_reloc_section'
	* peicode.h (coff_swap_filehdr_out): Clear not-reloc flag
	if relocatable file. Swap out saved raw size.
1995-09-12 19:28:30 +00:00
Ian Lance Taylor 5aa4c3ffda * dep-in.sed: Remove config.h from generated dependencies. 1995-09-12 19:19:44 +00:00
Ian Lance Taylor 396aaeb2b6 * sunos.c (sunos_slurp_dynamic_symtab): New static function,
broken out of sunos_canonicalize_dynamic_symtab.
	(sunos_canonicalize_dynamic_symtab): Call new function
	sunos_slurp_dynamic_symtab.
	(sunos_add_dynamic_symbols): Add three new parameters.  Return the
	dynamic symbol table to the caller.
	* aoutx.h (aout_link_add_symbols): Permit add_dynamic_symbols
	callback to override the symbols being read.
	* libaout.h (struct aout_backend_data): Add three new parameters
	to add_dynamic_symbols callback.
1995-09-12 18:59:24 +00:00
Ian Lance Taylor ae115e5114 Extensive minor changes to avoid various gcc warnings. Also:
* Makefile.in (BFD32_BACKENDS): Remove coff-arm.o.
	* archures.c (bfd_arch_info_type): Change mach field from long to
	unsigned long.
	(bfd_lookup_arch): Change machine parameter from long to unsigned
	long.
1995-09-12 16:23:25 +00:00