Commit Graph

748 Commits

Author SHA1 Message Date
David MacKenzie 00fe3f5326 * hosts/i386mach3.h (HOST_SEGMENT_SIZE): Fix value. 1994-01-01 23:39:18 +00:00
Rob Savoye e38bcbdb72 * config.bfd: Add support for VSTa micro-kernel. It currently uses
i386-aout.
1994-01-01 20:52:24 +00:00
David MacKenzie f4d7c848df * i386mach3.c (SEGMENT_SIZE): Fix value. 1994-01-01 19:09:51 +00:00
Ian Lance Taylor 728472f170 Minor cleanups suggested by CodeCenter.
* aoutx.h, coffgen.c, ecoff.c, ecofflink.c, elf.c, libbfd.c,
	linker.c, reloc.c, section.c, srec.c: Added /*ARGSUSED*/ as
	appropriate.
	* aoutx.h (struct external_exec): Removed unnecessary declaration.
	(NAME(aout,some_aout_object_p)): Set some tdata pointers to NULL.
	(adjust_z_magic): Removed useless variable data_vma.
	(stringtab_init): Initialize hash_zero.
	(add_to_stringtab): Removed unused fourth argument.
	(NAME(aout,swap_std_reloc_out)): Removed useless variable
	r_addend.
	(aout_link_input_section): Added some casts.
	* archive.c (get_extended_arelt_filename, do_slurp_coff_armap,
	bfd_ar_hdr_from_filesystem, bsd_write_armap, coff_write_armap):
	Minor code rewriting to make it more C like.
	(do_slurp_bsd_armap): Added some casts.
	* ecoff.c (ecoff_write_object_contents): Removed useless variable
	scn_base.
	(ecoff_write_armap): Added some casts.  Use "" rather than "\0".
	* ecofflink.c (bfd_ecoff_write_debug): Added a cast.
	* libaout.h (struct internal_exec): Removed unnecessary
	declaration.
	* linker.c (_bfd_generic_indirect_link_order): Added a cast.
	* opncls.c (new_bfd): Removed a cast.
	* reloc.c (bfd_generic_get_relocated_section_contents): Added
	some casts.
	* srec.c (internal_srec_write_object_contents): Removed useless
	variable bytes_written.
1993-12-31 21:51:05 +00:00
David MacKenzie 696df58f2d * i386mach3.c (N_TXTADDR): Don't define after all.
(TEXT_START_ADDR): Don't include exec header size in value.
1993-12-31 21:11:49 +00:00
David MacKenzie e450eb45f5 Define N_TXTADDR 1993-12-30 23:48:44 +00:00
Ian Lance Taylor 4c3721d514 Extensive changes to move the bulk of the linker into BFD so that
more efficient backend code can be written for specific object
	files.  Only existing efficient backend is a.out.
	* seclet.c, seclet.h: Removed.
	* hash.c, linker.c, genlink.h: New files.
	* bfd-in.h: Removed bfd_error_vector.  Declared hash table
	structures and functions.
	(JUMP_TABLE): Removed bfd_seclet_link, added
	bfd_link_hash_table_create, bfd_link_add_symbols and
	bfd_final_link.
	* All backends: Changed accordingly.
	* bfd-in2.h: Rebuilt.
	* bfd.c (struct _bfd): Added link_next and archive_pass fields.
	Removed ld_symbols field.
	(bfd_nonrepresentable_section, bfd_undefined_symbol,
	bfd_reloc_value_truncated, bfd_reloc_is_dangerous,
	bfd_error_vector): Removed.
	(bfd_default_error_trap, bfd_error_trap,
	bfd_error_nonrepresentabltrap): Removed.
	(bfd_get_relocated_section_contents): Pass link_info.  Pass
	link_order instead of seclet.  Pass symbols.
	(bfd_relax_section): Pass link_info.
	(bfd_seclet_link): Removed.
	(bfd_link_hash_table_create, bfd_link_add_symbols,
	bfd_final_link): New macros.
	* libbfd-in.h: If __GNUC__ is defined and alloca is not, define
	alloca as __builtin_alloca.  Declare internal linking functions.
	* libbfd.h: Rebuilt.
	* libbfd.c (bfd_seek): Comment out fseek assertion.  It's worked
	for months.
	* reloc.c (reloc_howto_type): Added error_message argument to
	special_function field.  Changed all callers and all definitions.
	(bfd_get_reloc_size): Make argument a const pointer.
	(bfd_perform_relocation): Add error_message argument to hold
	string set if return value if bfd_reloc_dangerous.  Changed all
	callers.
	(_bfd_final_link_relocate, _bfd_relocate_contents): New functions.
	* section.c (asection): Renamed seclets_head and seclets_tail to
	link_order_head and link_order_tail.
	* targets.c (bfd_target): Replaced seclet argument with link_info
	and link_order and symbols arguments in
	bfd_get_relocated_section_contents.  Added symbols argument to
	bfd_relax_section.  Removed bfd_seclet_link.  Added
	bfd_link_hash_table_create, bfd_link_add_symbols and
	bfd_final_link.
	* libaout.h (struct aoutdata): Added external_syms,
	external_sym_count, external_strings, sym_hashes fields.
	(obj_aout_external_syms, obj_aout_external_sym_count,
	obj_aout_external_strings, obj_aout_sym_hashes): New accessor
	macros.
	(WRITE_HEADERS): Only output symbols if outsymbols is not NULL.
	* aoutx.h: Wrote new back end linker routines.
	(translate_to_native_sym_flags): Return boolean value.  Don't use
	bfd_error_vector.
	(NAME(aout,write_syms)): Return boolean value.  Check return value
	of translate_to_native_sym_flags and bfd_write.
	* aout-target.h (final_link_callback): New function.
	(MY_bfd_final_link): New function.
	* aout-adobe.c (aout_adobe_write_object_contents): Check return
	value of aout_32_write_syms.
	* hp300hpux.c (MY(write_object_contents)): Likewise.
	* i386lynx.c (WRITE_HEADERS): Likewise.
	* libaout.h (WRITE_HEADERS): Likewise.
	* bout.c: Changed functions to use link_info->callbacks rather
	than bfd_error_vector, and link_orders rather than seclets.
	* coff-alpha.c: Likewise.
	* coff-h8300.c: Likewise.
	* coff-h8500.c: Likewise.
	* coff-sh.c: Likewise.
	* coff-z8k.c: Likewise.
	* elf32-hppa.c: Likewise.
	* reloc16.c: Likewise.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Look
	up _gp in the hash table rather than in outsymbols.
	* coff-a29k.c (a29k_reloc): Pass errors back in new error_message
	argument rather than printing them.
	* coffcode.h (bfd_coff_reloc16_extra_cases): Take link_info and
	link_order arguments rather than seclet.  Changed all uses and
	definitions.
	(bfd_coff_reloc16_estimate): Pass link_info arguments.  Changed
	all uses and definitions.
	* libcoff.h: Rebuilt.
	* ecoff.c (ecoff_get_extr): If symbol is defined by linker, but
	not by ECOFF, make it scAbs.
	(ecoff_bfd_final_link): Renamed from ecoff_bfd_seclet_link and
	rewritten.
	* elf32-mips.c (mips_elf_final_link): Renamed from
	mips_elf_seclet_link and rewritten.
	* elf32-hppa.c (elf32_hppa_stub_description): Added link_info
	field.
	(new_stub, add_stub_by_name, hppa_elf_build_arg_reloc_stub,
	hppa_elf_build_long_branch_stub, hppa_look_for_stubs_in_section):
	Added link_info arguments.  Changed all callers.
	* elfcode.h (elf_slurp_symbol_table): Don't quit if outsymbols is
	not NULL.
	* oasys.c (oasys_write_sections): Return boolean value rather than
	using bfd_error_vector.
	(oasys_write_object_contents): Check return value of
	oasys_write_sections.
	* hosts/std-host.h: Don't declare qsort or strtol.
	* Makefile.in: Rebuild dependencies.
	(BFD_LIBS): Removed seclet.o.  Added hash.o and linker.o.
	(CFILES): Removed seclet.c.  Added hash.c and linker.c.
	(HFILES): Removed seclet.h.  Added genlink.h.
1993-12-30 19:56:50 +00:00
Peter Schauer 1adbf66264 * section.c (bfd_get_section_contents): Return zero filled buffer
if section has no contents.
1993-12-30 15:51:16 +00:00
Ian Lance Taylor d1b44e837e * elf.c (bfd_elf_generic_reloc): If this is not an inplace reloc,
then skip bfd_perform_relocation even if the addend is non-zero.
1993-12-28 17:45:14 +00:00
Ken Raeburn a2805287bd changes so far 1993-12-21 17:47:38 +00:00
Jeff Law 277b2d2b23 * hosts/hp300bsd.h: Correctly identify 4.3BSD vs 4.4BSD. 1993-12-16 21:07:44 +00:00
David MacKenzie f8af9b40a2 cleanups and mach3 changes 1993-12-15 17:08:52 +00:00
Jeff Law c97ae6e42d * som.c (som_begin_writing): Fix thinkos in auxiliary header
support.
        (bfd_som_attach_aux_hdr): Likewise.
1993-12-15 05:50:44 +00:00
Jeff Law a36b6f1d05 * elf32-hppa.c (hppa_elf_gen_reloc_type): Handle 'T' field
selectors for PIC code.

        * som.c (hppa_som_gen_reloc_type): Handle 'T' field selectors.
        (som_write_fixups): Handle R_DLT_REL, R_FSEL, R_RSEL, R_LSEL
        relocations needed by PIC.
1993-12-14 07:36:15 +00:00
Stu Grossman 9e6f24986a * nlmcode.h: Fixes to avoid compiler warnings... 1993-12-07 23:49:32 +00:00
Ian Lance Taylor 900e6d96f3 * libnlm.h (nlm_backend_data): Removed macro definition.
(nlm_alpha_backend_data): Adjusted accordingly.
1993-12-07 23:13:43 +00:00
Jeff Law f6c2300b0a * som.c (som_begin_writing): Flesh out code for handling simple
auxiliary headers.
        (bfd_som_attach_aux_hdr): New function.

        * som.h (struct somdata): Add fields for attaching version and
        copyright headers.  Add accessor macros.
1993-12-06 08:53:53 +00:00
Jeff Law 744069b8ab * som.c (R_DLT_REL, R_AUX_UNWIND, R_SEC_STMT): Add protected
definitions for old versions of HPUX which fail to define them.
        (som_hppa_howto_talbe): Add R_DLT_REL, R_AUX_UNWIND, and R_SEC_STMT
        now that they're safe.  Delete bogus R_STATEMENT relocations.
1993-12-06 06:55:48 +00:00
Jeff Law 017a52d7a9 * som.c (som_hppa_howto_table): Add missing R_END_TRY. Delete
extra R_DATA_OVERRIDE.
        (hppa_som_gen_reloc_type): Generate a relocation for the rounding
        mode selector if needed.
        (som_write_fixups): Handle requests for a change in the default
        rounding mode.  Rounding modes do not consume input bytes, but
        are just markers much like R_ENTRY and R_EXIT.
1993-12-06 03:33:06 +00:00
Jeff Law 4861ac76c7 * elf32-hppa.c: (elf_hppa_howto_table): PLABEL and DLT
relocations are not pc-relative.
1993-12-05 03:46:12 +00:00
Jeff Law 48eb5281b5 Fri Dec 3 09:55:17 1993 Pete Hoogenboom (hoogen@cs.utah.edu)
* hppa_stubs.h: (BLE_N_XXX_0_31):  New instruction used in
        linker stub code.
        (COPY_2_31):  Likewise.
1993-12-05 03:41:25 +00:00
Ian Lance Taylor ecb2d88791 * config/solaris2.mh (HDEFINES): Remove -Dconst=
* hosts/solaris.h: If not __GNUC__, define const as empty.
1993-12-03 23:42:59 +00:00
Ian Lance Taylor 4919d3ab70 * ecoff.c: Added various casts for 32/64 bit cross targeting.
(ecoff_mkobject_hook): Set SEC_SHARED_LIBRARY for the .reginfo
	section so that the linker ignores it.
	* ecofflink.c: Added various casts for 32/64 bit cross targeting.
	(ecoff_add_bytes): Changed need argument to size_t.
	(bfd_ecoff_debug_link_other): Check return value of
	ecoff_add_string.
1993-12-02 23:27:15 +00:00
Ian Lance Taylor 800748cdfc * libnlm.h (struct nlm_obj_tdata): New field backend_data.
(nlm_backend_data, nlm_alpha_backend_data): New accessor macros.
	(struct nlm_backend_data): New field no_uninitialized_data.
	(nlm_no_uninitialized_data): New accessor macro.
	* nlmcode.h (nlm_compute_section_file_positions): Handle
	no_uninitialized_data.
	(nlm_external_reloc_compare): Sort relocs by address for a
	particular symbol, to make the sort more stable.
	(nlm_write_object_contents): Cast the arguments to qsort.  Get the
	value of a debugging symbol the same way we get the value of a
	normal symbol.
	* nlm32-alpha.c: Various changes.  Write out GP and .lita relocs.
	Set no_uninitialized_data to true.
	* nlm32-i386.c (nlm32_i386_backend), nlm32-sparc.c
	(nlm32_sparc_backend): Set no_uninitialized_data field false.
	* nlmswap.h (nlm_swap_fixed_header_out): Zero out destination
	before filling it in.
1993-12-02 20:52:25 +00:00
Jeff Law a7f6a456c8 * som.c (som_section_type, som_decode_symcalss): New functions.
(som_get_symbol_info): Use them.
        (som_slurp_symbol_table): Set the section of common and undefined
        symbols correctly.
1993-12-02 05:48:46 +00:00
Ian Lance Taylor 68eaffda25 Various entries. 1993-12-02 02:22:59 +00:00
Ken Raeburn 848ace961e various 1993-12-01 22:37:57 +00:00
Ian Lance Taylor 2f555d79cd Various entries. Added entries for NetWare changes made by Sean a
couple of weeks ago.
1993-12-01 20:06:43 +00:00
Ian Lance Taylor 7cd39d6914 Irix 4 core support entries. 1993-11-30 21:58:09 +00:00
Ian Lance Taylor 6c35a16d6a * elfcode.h (map_program_segments): Restore check of file_size !=
mem_size, but only if SHT_PROGBITS.
1993-11-24 07:31:02 +00:00
Ian Lance Taylor 8d12f138ea * ecofflink.c: New file to hold ECOFF debug information linking
routines.
	* ecoff.c (ecoff_clear_output_flags, ecoff_rel, ecoff_dump_seclet,
	ecoff_add_string, ecoff_get_debug): Removed.  Functionality now in
	ecofflink.c.
	(ecoff_get_extr, ecoff_set_index): New functions.
	(ecoff_slurp_symbolic_info): Don't save raw_size.
	(ecoff_bfd_seclet_link): Rewrote to use ecofflink.c functions.
	(ecoff_compute_section_file_positions): Don't set EXEC_P just
	because there is a start address.
	(ecoff_write_object_contents): Handle external symbols here.  Use
	ecofflink.c functions to write out debugging information.
	* elf32-mips.c (mips_elf_read_ecoff_info, mips_elf_get_extr,
	mips_elf_set_index): New functions.
	(mips_elf_seclet_link): Discard empty sections, the .options
	section and .gptab sections.  Handle linking .mdebug section.
	* libecoff.h (ecoff_data_type): Removed raw_size and ifdbase.
	* libelf.h (elf_symbol_type): Added mips_extr to tc_data union.
	* bfd-in.h: Added prototypes for routines in ecofflink.c (some are
	called by gas, so they are public).
	* bfd-in2.h: Rebuilt.
	* Makefile.in (BFD_LIBS): Added ecofflink.o.
	(CFILES): Added ecofflink.c.
	(ecofflink.o): New target.  Rebuilt dependencies.
1993-11-24 07:21:28 +00:00
Steve Chamberlain ceeca31c76 Split ChangeLog into two. 1993-11-23 08:06:20 +00:00
Jeff Law abb324b2c9 * som.c (hppa_object_p): Also recognize SHARED_MAGIC_CNX as
a valid magic number if it's been defined.
1993-11-23 06:27:45 +00:00
Ian Lance Taylor 8f45f60421 * ecoff.c (ecoff_mkobject): Don't create .scommon section; linker
no longer requires it.
	(ecoff_bfd_seclet_link, ecoff_sizeof_headers,
	ecoff_write_object_contents): Don't treat .scommon section
	specially
1993-11-22 19:22:23 +00:00
Fred Fish c236d8b3a5 * bfd/config/delta88.mh (HDEFINES): Define this to be -DPTRACE_CORE.
* bfd/config/delta88.mh (HDEPFILES): Defined to be ptrace-core.o.
	* bfd/ptrace-core.c:  New file for dealing with core files with
	start with the ptrace_user structure found on BCS compliant systems.
	* bfd/targets.c (ptrace_core_vec):  New vector.
1993-11-22 19:01:55 +00:00
Jeff Law 36456a67f8 * Minimal support for reading SOM fixup streams. Allows
objdump -r to do something reasonable.
        * som.c (som_get_reloc_upper_bound): Implement.
        (som_canonicalize_reloc): Implement.
        (som_set_reloc_info, som_slurp_reloc_table): New functions.
1993-11-22 10:37:02 +00:00
Ian Lance Taylor 533af0314f * coff-a29k.c (a29k_reloc): For R_IREL, don't left shift
signed_value before sign extending it.  Don't subtract out
	reloc_entry->address.  This makes it compatible with what gas is
	generating.

Fixes PR 3790.
1993-11-19 19:51:52 +00:00
Ian Lance Taylor a1bff336ec * elfcode.h (elf_fake_sections): Accept .sbss as the name for a
SHT_NOBITS sections.
	(map_program_segments): Don't leave the loop after the first
	SHT_NOBITS section.
	(assign_file_positions_except_relocs): Only force sh_offset and
	sh_addr to match modulo maxpagesize for a section which is not
	SHT_NOBITS.  Changed the method used to force page alignment after
	a SHT_NOBITS section to only do it for the last such consecutive
	section, and to really force page alignment.
1993-11-19 19:41:49 +00:00
Ken Raeburn 4c01d9b5be * coffcode.h (coff_slurp_symbol_table): Print more verbose message
in the case of an unknown (or unhandled) storage class.
1993-11-19 19:17:14 +00:00
Ken Raeburn 96be1f522f recent coff/lynx changes 1993-11-19 17:00:07 +00:00
Ian Lance Taylor f8944f8414 Various entries. 1993-11-18 17:24:53 +00:00
Ian Lance Taylor c9668c588a * libecoff.h: Include coff/ecoff.h.
(struct ecoff_backend_data): Move external debugging information
	fields into a single field pointing to an ecoff_debug_swap
	structure.
	(ecoff_data_type): Move debugging information fields into a single
	field pointing to an ecoff_debug_info structure.
	* coff-alpha.c, coff-mips.c, ecoff.c: Corresponding changes.
1993-11-18 00:07:33 +00:00
Stan Shebs 55ff7aef7e Wed Nov 17 13:56:10 1993 Stan Shebs (shebs@rtl.cygnus.com)
* i386lynx.c (swap_std_reloc_in, swap_ext_reloc_in): Ignore
	garbage bits appearing in the upper end of symbolnums.

	* config/sparc-lynx.mt (TDEFINES): Add -DFPRINTF_ALREADY_DECLARED.
1993-11-17 23:25:23 +00:00
Stu Grossman 343c1a9641 * lynx-core.c (lynx_core_file_p): Change bfd_zalloc to bfd_alloc.
* m68klynx.c:  Define core file macros.
	* hosts/i386lynx.h, hosts/m68klynx.h, hosts/lynx.h:  Move all
	non-architecture specific stuff into lynx.h.
1993-11-17 01:11:30 +00:00
Jim Kingdon 794057a7c0 * i386linux.c: Define new macro ZMAGIC_DISK_BLOCK_SIZE to 1024, and
change PAGE_SIZE to 4096.
1993-11-16 23:07:40 +00:00
Jeff Law 3be544982d * som.c (som_object_setup): Do not create dummy ".text", ".data",
and ".bss" sections.
	(setup_sections): Do not set SEC_HAS_CONTENTS if a section's size
	is zero.  Recognize BSS type sections and turn off SEC_LOAD and
	SEC_DATA (so binutils/size works).  Set the correct value for
	a section's _raw_size.
	(som_slurp_symbol_table): Program entry points, and millicode are
	also functions.  Mark them as such.  Also mark L$* symbols as
	debugging symbols.
1993-11-15 08:43:36 +00:00
Jeff Law 097960116a * bfd-in2.h: Rebuilt. 1993-11-15 07:34:01 +00:00
Jeff Law 91c0bcbbd0 * som.c (som_bfd_reloc_type_lookup): Add missing prototype. Returns
a pointer to constant data.  Delete bogus #define which made the
        function useless.
1993-11-14 01:32:09 +00:00
Jeff Law 6eb644081a * som.c (som_begin_writing): New function. 1993-11-14 00:56:58 +00:00
Jeff Law 0b35f7ec59 * som.c (som_write_space_strings): New function.
(som_write_symbol_strings): New function.
1993-11-14 00:33:00 +00:00