Commit Graph

1605 Commits

Author SHA1 Message Date
Ian Lance Taylor 5f710a3a89 * libcoff-in.h (struct xcoff_tdata): Define.
(xcoff_data): Define.
	* bfd.c (struct _bfd): Add xcoff_obj_data field to tdata union.
	* bfd-in2.h, libcoff.h: Rebuild.
	* coff-rs6000.c (xcoff_mkobject): New static function.
	(coff_mkobject): Define.
	(xcoff_copy_private_bfd_data): New static function.
	(coff_bfd_copy_private_bfd_data): Define.
	(rs6000coff_howto_table): Change R_TOC complain_on_overflow from
	signed to bitfield.
	(rs6000coff_vec): Add DYNAMIC to object_flags.
	* coffcode.h (sec_to_styp_flags): If RS6000COFF_C, handle .pad and
	.loader sections specially.
	(coff_new_section_hook): If RS6000COFF_C, get the .text and .data
	section alignment from the XCOFF tdata information.
	(coff_mkobject_hook): If RS6000COFF_C, set DYNAMIC based on
	F_SHROBJ, and copy the extra a.out header information into the
	XCOFF tdata structure.
	(coff_write_object_contents): If RS6000COFF_C, set F_SHROBJ,
	F_DYNLOAD and the extra a.out header information.
	(coff_slurp_symbol_table): Set BSF_NOT_AT_END for a C_EXT or
	C_HIDEXT symbol with attached csect information.
	* coffswap.h (coff_swap_aouthdr_in): If RS6000COFF_C, swap
	in the o_maxdata field.
	(coff_swap_aouthdr_out): If RS6000COFF_C, swap extra XCOFF fields.
	* coffgen.c (coff_renumber_symbols): Don't move any symbol to the
	end if BSF_NOT_AT_END is set.
1995-10-09 21:19:53 +00:00
Ian Lance Taylor 3f2c5b2d2f * coffcode.h (coff_slurp_symbol_table): Set BSF_NOT_AT_END for an
XCOFF XTY_LD symbol.
1995-10-09 15:40:38 +00:00
Ian Lance Taylor 0322af0d62 * targets.c (bfd_target): Rename _bfd_read_ar_hdr field to
_bfd_read_ar_hdr_fn.
	* libbfd-in.h (_bfd_read_ar_hdr): Update accordingly.
	* bfd-in2.h, libbfd.h: Rebuild.
	* archive.c (_bfd_get_elt_at_filepos): Cast _bfd_read_ar_hdr
	return value.
	(do_slurp_bsd_armap, do_slurp_coff_armap): Likewise.
	(bfd_slurp_bsd_armap_f2): Likewise.
	(_bfd_slurp_extended_name_table): Likewise.
1995-10-09 15:29:04 +00:00
Ian Lance Taylor 4372f33ffb * coffgen.c (coff_fix_symbol_name): Don't try to set up file
auxent if there isn't one.
	(coff_write_symbols): If there is no file auxent, use SYMNMLEN
	rather than FILNMLEN as the maximum name length.
1995-10-06 22:35:01 +00:00
Ken Raeburn 3266eaffb7 Mon Sep 25 22:49:32 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* archive.c (bfd_get_next_mapent): Return BFD_NO_MORE_SYMBOLS when the symbol
table is empty.

* elf32-m68k.c (elf_m68k_size_dynamic_sections): Don't reserve space for
section symbols, since we don't output them either.
(elf_m68k_adjust_dynindx): Removed.

* ptrace-core.c (rawptr): Make it a local variable of ptrace_unix_core_file_p.
* trad-core.c (rawptr): Likewise, for trad_unix_core_file_p.
1995-10-06 21:30:51 +00:00
Ian Lance Taylor 0fc9ada91e * coffcode.h (bfd_coff_backend_data): Add new field
_bfd_coff_print_aux.
	(bfd_coff_print_aux): New static function.
	(coff_pointerize_aux_hook (RS6000COFF_C version)): Pointerize the
	scnlen field of an XTY_LD csect aux entry.
	(coff_print_aux): New static function.
	(coff_slurp_symbol_table): Don't pointerize scnlen field; now done
	in coff_pointerize_aux_hook.
	(bfd_coff_std_swap_table): Initialize new field.
	* coffgen.c (coff_print_symbol): Call bfd_coff_print_aux.
	* libcoff.h: Rebuild.
	* coff-alpha.c (alpha_ecoff_backend_data): Initialize new field.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
1995-10-06 20:36:26 +00:00
Ian Lance Taylor 7860fe3846 * coffcode.h (coff_write_object_contents): On AIX, clear F_RELFLG
if there are symbols, for native AIX ld compatibility.
1995-10-06 19:49:48 +00:00
Ian Lance Taylor c80cc8332c * coffcode.h (bfd_coff_backend_data): Add new field
_bfd_coff_pointerize_aux_hook.
	(coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
	or I960, and as 0 otherwise.
	(bfd_coff_std_swap_table): Initialize new field.
	* libcoff.h: Rebuild.
	* coffgen.c (coff_pointerize_aux): Change parameters  to take
	symbol pointer instead of type and class, and to take aux index.
	Call _bfd_coff_pointerize_aux_hook if it is defined.
	(coff_get_normalized_symtab): Always call coff_pointerize_aux.
	* coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
1995-10-06 19:19:48 +00:00
Ian Lance Taylor d11e6b5276 * coffcode.h (OTHER_GLOBAL_CLASS): Do not define to be C_HIDEXT
if RS6000COFF_C.
1995-10-06 18:00:29 +00:00
Michael Meissner 45b5d2f039 Fix typo in last change 1995-10-06 16:37:31 +00:00
Michael Meissner 249479faf1 Add NT/MAC object file formats to powerpc eabi. 1995-10-06 16:25:45 +00:00
Ian Lance Taylor c53fac125a * targets.c (bfd_target): Add _bfd_read_ar_hdr field. Modify
BFD_JUMP_TABLE_ARCHIVE accordingly.
	* libbfd-in.h (_bfd_snarf_ar_hdr): Don't declare.
	(_bfd_compute_and_write_armap): Declare.
	(_bfd_generic_read_ar_hdr): Declare.
	(_bfd_read_ar_hdr): Define.
	(_bfd_noarchive_read_ar_hdr): Define.
	(_bfd_archive_bsd_read_ar_hdr): Define.
	(_bfd_archive_coff_read_ar_hdr): Define.
	* archive.c: Change all callers of _bfd_snarf_ar_hdr to call
	_bfd_read_ar_hdr instead.
	(_bfd_generic_read_ar_hdr): Rename from _bfd_snarf_ar_hdr.
	(_bfd_compute_and_write_armap): Rename from
	compute_and_write_armap.  Make non-static.  Change all callers.
	* ecoff.c (_bfd_ecoff_slurp_armap): Call _bfd_read_ar_hdr rather
	than _bfd_snarf_ar_hdr.
	* aout-target.h (MY_read_ar_hdr): Define if not defined.
	* ieee.c (ieee_read_ar_hdr): Define.
	* libecoff.h (_bfd_ecoff_read_ar_hdr): Define.
	* oasys.c (oasys_read_ar_hdr): Define.
	* som.c (som_read_ar_hdr): Define.
	* bfd-in2.h, libbfd.h: Rebuild.
1995-10-06 16:15:35 +00:00
Steve Chamberlain f8e47484d9 * peicode.c (coff_swap_filehdr_in): If symptr is
zero, there aren't any symbols, even if nsyms is set.
1995-10-05 21:07:24 +00:00
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