Commit Graph

1932 Commits

Author SHA1 Message Date
Kim Knuttila 545bf026d5 Removed some debugging prints. duh 1995-12-04 21:47:37 +00:00
Ian Lance Taylor 1f4ae0d6b1 * elflink.h (elf_link_output_extsym): Just ignore warning and
indirect references to symbols which don't really exist.
1995-12-04 16:23:36 +00:00
Kim Knuttila 53d45489e3 Dumper for PowerPC .edata section 1995-12-04 01:58:54 +00:00
David Edelsohn 361e8876a0 * aout-arm.c (MY_swap_std_reloc_out): Use KEEPIT to get the symbol
index, don't call stoi.
1995-12-03 23:29:09 +00:00
Ian Lance Taylor ffd1548911 * ihex.c: New file; support for Intel Hex format.
* targets.c (enum bfd_flavour): Add bfd_target_ihex_flavour.
	(ihex_vec): Declare.
	(bfd_target_vector): Always include ihex_vec.
	* bfd.c (struct _bfd): Add ihex_data field to tdata union.
	* Makefile.in: Rebuild dependencies.
	(BFD_LIBS): Add ihex.o
	(BFD_LIBS_CFILES): Add ihex.c.
	* bfd-in2.h: Rebuild.
1995-12-02 02:00:08 +00:00
Ian Lance Taylor ae0a6bea51 * bfd.c (bfd_record_phdr): New function.
* bfd-in.h (bfd_record_phdr): Declare.
	* bfd_in2.h: Rebuild.
1995-12-01 21:45:33 +00:00
Ian Lance Taylor ce0ee4bf49 * elf32-sparc.c (elf32_sparc_relocate_section): Remove bogus
BFD_ASSERT.
PR 8562.
1995-12-01 20:59:10 +00:00
Ian Lance Taylor 58142f101d * libbfd.c (bfd_malloc, bfd_realloc): New functions.
(bfd_zmalloc): Return PTR, not char *.  Take size_t, not
	bfd_size_type.
	* libbfd-in.h (bfd_malloc, bfd_realloc): Declare.
	(bfd_zmalloc): Change declaration.
	* libbfd.h: Rebuild.
	* Many files: Use bfd_malloc and bfd_realloc rather than malloc
	and realloc.  Don't set bfd_error_no_memory if they fail.
1995-12-01 19:48:10 +00:00
Kim Knuttila 590662481c PowerPC DLL Support 1995-12-01 01:01:42 +00:00
Ian Lance Taylor 6933148af0 * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on
p_paddr if p_paddr is zero.
	(make_mapping): Set includes_filehdr and includes_phdrs for first
	PT_LOAD segment.
	(map_sections_to_segments): Set includes_phdrs for PT_PHDR
	segment.
	(assign_file_positions_for_segments): Handle includes_filehdr and
	includes_phdrs.  Remove special handling of PT_PHDR and first
	PT_LOAD segments.
	(copy_private_bfd_data): Set includes_filehdr and includes_phdr
	when appropriate.  Remove special handling of PT_PHDR segment.
	Use a more complex condition for when a section is included in a
	segment to handle Solaris linker oddities.
1995-11-30 22:15:13 +00:00
Ian Lance Taylor f62fed1c4a Thu Nov 30 11:17:33 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
* coff-m88k.c (howto_table): Reformatted for easier reading;
	special_function now points to new function m88k_special_reloc.
	(howto_hvrt16): Function previously used for handling HVRT16 relocs
	removed.
	(rtype2howto): Do not add reloc's r_offset to the addend, this will
	be done correctly by m88k_special_reloc.
	(reloc_processing): New function to be used by RELOC_PROCESSING.
	(RELOC_PROCESSING): Define to call reloc_processing.
1995-11-30 16:23:05 +00:00
Ian Lance Taylor b00c57ec37 * peicode.h (pe_print_idata): Call malloc rather than xmalloc.
(pe_print_pdata): Likewise.
1995-11-29 22:10:57 +00:00
Ian Lance Taylor a9713b91a7 * opncls.c (bfd_alloc_by_size_t): Set bfd_error_no_memory if
obstack_alloc fails.
	(bfd_alloc_finish): Set bfd_error_no_memory if obstack_finish
	fails.
	* libbfd.c (bfd_zmalloc): Set bfd_error_no_memory if malloc fails.
	* Many files: don't set bfd_error_no_memory if one of the above
	routines fails.
1995-11-29 22:05:37 +00:00
Ian Lance Taylor 3dbf33eeb4 * elf.c (assign_file_positions_for_segments): Don't adjust p_paddr
if p_paddr_valid is set.
	(copy_private_bfd_data): New static function.
	(_bfd_elf_copy_private_section_data): Call copy_private_bfd_data.
1995-11-29 20:04:17 +00:00
Ian Lance Taylor 44ef8897da * elf.c (assign_file_positions_for_segments): Fix case where extra
program headers were allocated.
1995-11-29 19:14:33 +00:00
Ian Lance Taylor 27fb8f2933 * elf.c (_bfd_elf_print_private_bfd_data): New function.
* elf-bfd.h (_bfd_elf_print_private_bfd_data): Declare.
	* elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define to
	_bfd_elf_print_private_bfd_data.
1995-11-29 18:46:07 +00:00
Ian Lance Taylor 64ecde4619 * coff-alpha.c (alpha_ecoff_swap_reloc_in): Don't abort if
r_symndx is RELOC_SECTION_NONE for an ALPHA_R_IGNORE reloc.
	Change a RELOC_SECTION_LITA symndx to RELOC_SECTION_ABS.
	(alpha_ecoff_swap_reloc_out): Change RELOC_SECTION_ABS to
	RELOC_SECTION_LITA for ALPHA_R_IGNORE.
	(alpha_adjust_reloc_out): For ALPHA_R_IGNORE, don't change
	RELOC_SECTION_ABS to RELOC_SECTION_NONE.
1995-11-29 17:40:58 +00:00
Ian Lance Taylor fd0198f023 * elf-bfd.h (struct elf_obj_tdata): Add segment_map field.
* elf.c (make_mapping): New static function.
	(map_sections_to_segments): New static function.
	(elf_sort_sections): New static function.
	(assign_file_positions_for_segments): New static function.
	(map_program_segments): Remove.
	(get_program_header_size): Remove sorted_hdrs, count, and
	maxpagesize parameters.  Simplify.
	(assign_file_positions_except_relocs): When generating an
	executable, use assign_file_positions_for_segments.
	(elf_sort_hdrs): Remove.
	(_bfd_elf_sizeof_headers): Remove eliminated parameters from call
	to get_program_header_size.
1995-11-28 22:02:13 +00:00
Ian Lance Taylor 1ff0461b4e * hp300hpux.c (MY(callback)): Set lma as well as vma. 1995-11-27 20:11:40 +00:00
Ian Lance Taylor 80c8485c44 * configure, config.in: Regenerate with autoconf 2.7. 1995-11-27 18:02:58 +00:00
Ian Lance Taylor 3b3f762596 * elf32-i386.c (elf_backend_plt_readonly): Set correctly, to 1.
* elf32-sparc.c (elf_backend_plt_readonly): Set correctly, to 0.
PR 8513.
1995-11-27 17:42:27 +00:00
Ian Lance Taylor a877f5917f * ecoff.c (_bfd_ecoff_new_section_hook): Handle .rconst section.
(ecoff_sec_to_styp_flags): Likewise.
	(_bfd_ecoff_styp_to_sec_flags): Handle STYP_RCONST.
	(ecoff_set_symbol_info): Handle scRConst.
	(ecoff_slurp_reloc_table): Handle RELOC_SECTION_RCONST.
	(ecoff_compute_section_file_positions): Handle .rconst section.
	(_bfd_ecoff_write_object_contents): Likewise.
	(ecoff_link_check_archive_element): Handle scRConst.
	(ecoff_link_add_externals): Likewise.
	(ecoff_link_write_external): Handle .rconst section.
	(ecoff_reloc_link_order): Likewise.
	* ecofflink.c (bfd_ecoff_debug_accumulate): Handle scRConst.
	* coff-alpha.c (alpha_convert_external_reloc): Handle .rconst
	section.
	(alpha_relocate_section): Handle RELOC_SECTION_RCONST.
1995-11-22 19:01:43 +00:00
Ian Lance Taylor fa63d1ef23 * sunos.c (sunos_scan_dynamic_symbol): Only set written if the
DEF_DYNAMIC flag is set.
PR 8493.
1995-11-22 17:04:56 +00:00
Ken Raeburn 25bada65f5 * host-aout.c: If TRAD_HEADER is defined, include it. 1995-11-22 00:57:55 +00:00
Ian Lance Taylor bd77213b85 * acconfig.h: Put NEED_DECLARATION_* in @TOP@ section.
* config.in: Rebuild with autoconf 2.6.
1995-11-21 23:26:26 +00:00
Ian Lance Taylor 85e493f0c7 * aclocal.m4 (AC_PROG_CC): Remove local definition.
(BFD_BINARY_FOPEN): Require AC_CANONICAL_SYSTEM.
	(BFD_NEED_DECLARATION): New function.
	* configure.in: Use BFD_NEED_DECLARATION.
	* configure: Rebuild with autoconf 2.6.
1995-11-21 23:02:13 +00:00
Ian Lance Taylor 83dcdc6168 * xcofflink.c (bfd_xcoff_size_dynamic_sections): Clear
special_sections before returning when called with a non XCOFF
	BFD.
1995-11-21 21:25:35 +00:00
Ian Lance Taylor 7938b4cb15 * coffgen.c (coff_renumber_symbols): Sort common symbols with
global symbols.
1995-11-21 18:06:41 +00:00
Ian Lance Taylor a418e05d6d * coffcode.h (coff_compute_section_file_positions): If
RS6000COFF_C, set up the .debug section.
1995-11-20 22:23:30 +00:00
Ian Lance Taylor b5403ad754 * xcofflink.c (xcoff_link_input_bfd): Adjust the TOC anchor value
if it is not large enough to accomodate the entire TOC area with
	signed 16 bit offsets.
	(xcoff_write_global_symbol): Handle negative TOC offsets in global
	linkage code.
	(_bfd_ppc_xcoff_relocate_section): Adjust relocations against a
	TOC anchor to use the TOC value used in the output file.
1995-11-20 19:57:30 +00:00
Ian Lance Taylor 90a7abbca3 * coffgen.c (_bfd_coff_get_external_symbols): Cast malloc return.
(_bfd_coff_read_string_table): Likewise.
1995-11-18 23:04:26 +00:00
David Edelsohn 177b193219 Clean up some comments. 1995-11-18 20:05:06 +00:00
Ian Lance Taylor 535e9e2943 * coffcode.h (coff_pointerize_aux_hook): I960 version: don't
pointerize C_LEAFSTAT or C_LEAFEXT entries.
1995-11-17 21:59:17 +00:00
Ian Lance Taylor e34314c45d Fri Nov 17 10:41:25 1995 Philippe De Muyter <phdm@info.ucl.ac.be>
* elf-bfd.h (struct elf_link_hash_table): Change type of
	dynsymcount and bucketcount fields from size_t to bfd_size_type.
1995-11-17 15:43:18 +00:00
Ian Lance Taylor 73a684473d * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
DT_INIT and DT_FINI entries if the _init or _fini symbol is
	defined or mentioned in a regular file.
PR 8462.
1995-11-17 15:05:44 +00:00
Kim Knuttila cd2b240203 Reloc fixes for PowerPC PE 1995-11-16 20:51:08 +00:00
Ken Raeburn b218076e59 version 2.6 1995-11-16 10:12:33 +00:00
Ken Raeburn ae75c4a423 log for this morning's makefile (make dep) change 1995-11-16 00:32:34 +00:00
Ian Lance Taylor e9f3061668 * targets.c (bfd_target): Change type of second argument to
_bfd_print_private_bfd_data from void * to PTR.
	* libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): Cast
	using PTR rather than void *.
	* bfd-in2, libbfd.h: Rebuild.
	* peicode.h (pe_print_private_bfd_data): Change vfile from void *
	to PTR.
	* elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): Define as
	_bfd_generic_bfd_print_private_bfd_data rather than casting
	bfd_true.
1995-11-15 23:17:21 +00:00
Ian Lance Taylor 4b71e164cd * peicode.h (coff_swap_aouthdr_out): For PPC PE, start isize at 0,
not at the file position of the first section.
	* coffcode.h (coff_compute_section_file_positions): Avoid using
	unportable #elif.
	(coff_write_object_contents): When generating a PPC PE executable
	with no symbols, round up the file size to a COFF_PAGE_SIZE
	boundary.
	* cofflink.c (_bfd_coff_final_link): If there are no symbols,
	don't write out a string table.
1995-11-15 04:41:10 +00:00
Ian Lance Taylor 631b10f44e * elf.c (bfd_section_from_shdr): When using a different section
header, pass the new one to _bfd_elf_make_section_from_shdr.
	(elf_fake_sections): Don't set sh_info and sh_entsize fields.
	(elf_map_symbols): Add section VMA to symbol value when comparing
	against 0.
	(_bfd_elf_compute_section_file_positions): Only build symbol table
	if there are some symbols.  Set file offset of symtab and strtab
	sections.
	(assign_file_positions_except_relocs): Remove dosyms parameter.
	Change all callers.  Never set file offset of symtab and strtab
	sections.
	(_bfd_elf_copy_private_section_data): New function.
	(MAP_ONESYMTAB, MAP_DYNSYMTAB, MAP_STRTAB, MAP_SHSTRTAB): Define.
	(_bfd_elf_copy_private_symbol_data): New function.
	(swap_out_syms): Check for special mapping of st_shndx created by
	copy_private_symbol_data.
	* elfxx-target.h: Use new copy routines.
	* elf-bfd.h (_bfd_elf_copy_private_symbol_data): Declare.
	(_bfd_elf_copy_private_section_data): Declare.
1995-11-15 01:34:56 +00:00
Ian Lance Taylor bebcd3db3b * coff-sh.c (shlcoff_vec): Use _bfd_generic_archive_p, not
_bfd_dummy_target, matching the recent change to archive
	recognition.
1995-11-14 16:55:23 +00:00
Ian Lance Taylor afa67334cb * libbfd.c (bfd_get_file_window): Use casts to avoid doing
arithmetic on PTR types.
1995-11-13 20:25:21 +00:00
Ian Lance Taylor f2bd89150f * aout-target.h (MY(callback)): Set the lma of the sections. 1995-11-13 18:31:50 +00:00
Ian Lance Taylor 7ad4ba8143 * ecoff.c (ecoff_reloc_link_order): Turn a reloc against a defined
symbol into a reloc against the section.
1995-11-13 18:27:49 +00:00
Kim Knuttila 125d37c471 Missed a debug macro (duh) 1995-11-13 15:21:12 +00:00
Kim Knuttila 93b6a3f8e2 Implemented IMGLUE reloc + dumping 1995-11-13 12:54:05 +00:00
Stan Shebs c769947b4a * Makefile.in (bfd_libs_here, etc): Provide empty definitions.
* coff-rs6000.c (rs6000coff_vec): Add conditional defines
	TARGET_SYM and TARGET_NAME for vector and BFD name.
	* coff-pmac.c (pmac_xcoff_vec): Remove.
	(TARGET_SYM, TARGET_NAME): Define.
	* coffcode.h (coff_set_arch_mach_hook) [POWERMAC]: Set the
	machine to 0, not all PowerMacs are 601s.
1995-11-12 20:39:38 +00:00
Ian Lance Taylor 839087b7f1 * archive.c (bfd_generic_archive_p): Preserve tdata in case of
failure.
1995-11-10 04:50:15 +00:00
Ian Lance Taylor 922530a691 * aoutx.h (NAME(aout,final_link)): Report a reasonable error when
trying to do a relocateable link with a non-a.out object file.
1995-11-09 20:54:30 +00:00
Ian Lance Taylor a1774c51f2 * aoutx.h (NAME(aout,set_section_contents)): If a section can not
be represented, report the name via _bfd_error_handler.
	(translate_to_native_sym_flags): Likewise.
	* elf32-mips.c (mips_elf_final_link): Likewise.
	* oasys.c (oasys_write_sections): Likewise.
1995-11-09 20:09:00 +00:00
Ian Lance Taylor 4a378b13e4 * coffcode.h (coff_set_alignment_hook): Write RS6000COFF_C version
which checks for STYP_OVRFLO sections.
	(coff_compute_section_file_positions): If RS6000COFF_C, handle
	reloc and lineno count overflows.
	(coff_write_object_contents): Call coff_count_linenumbers before
	coff_compute_section_file_positions.  If RS6000COFF_C, handle
	reloc and lineno count overflows.
	* xcofflink.c (_bfd_xcoff_bfd_final_link): Count line numbers and
	relocs before dealing with .pad sections.  Count overflow section
	headers when handling .pad sections.
1995-11-09 19:44:09 +00:00
Ian Lance Taylor 7906bf87b9 * coffcode.h (coff_write_object_contents): Set a.out vstamp to 1
if RS6000COFF_C.
1995-11-09 18:26:10 +00:00
Ian Lance Taylor ee17481566 * xcofflink.c (XCOFF_DESCRIPTOR): Define.
(struct xcoff_link_hash_table): Add descriptor_section and
	special_sections fields.
	(_bfd_xcoff_bfd_link_hash_table_create): Initialize new fields.
	(xcoff_link_add_symbols): Set linkage section alignment.  Create
	descriptor section.  Check for magic symbol names (_text, etc.),
	and record them in special_sections if found.  Set
	XCOFF_DESCRIPTOR flag for a function descriptor, and set its
	descriptor field to point back to the function code symbol.
	(xcoff_sweep): Always mark the special descriptor_section.
	(bfd_xcoff_export_symbol): Check whether the symbol might be a
	function descriptor, and mark it if it is.
	(bfd_xcoff_size_dynamic_sections): Add new special_sections
	parameter, and fill it in.  Allocate space for the descriptor
	section.
	(xcoff_build_ldsyms): Set XCOFF_DEF_REGULAR flag when defining
	global linkage code.  If an undefined function descriptor is
	exported, arrange to define it.  Warn about any other undefined
	exported symbol.
	(_bfd_xcoff_bfd_final_link): Write out the descriptor section.
	(xcoff_write_global_symbol): Create a function descriptor when
	necessary.
	* bfd-in.h (bfd_xcoff_size_dynamic_sections): Update declaration.
	* bfd-in2.h: Rebuild.
1995-11-09 18:08:56 +00:00
Kim Knuttila 0e829f1854 Build derived hash table for PowerPC PE 1995-11-09 14:08:28 +00:00
Ken Raeburn b27cc4bcea fix "make dep" for non-NetBSD systems 1995-11-09 09:19:13 +00:00
Ken Raeburn 7ac847361b * configure.in: Added new option --with[out]-mmap. Set USE_MMAP if it is given
and mmep is available.
* acconfig.h: Undef USE_MMAP.
* configure, config.in: Regenerated.
* aoutx.h: If USE_MMAP is not defined, do all symbol and string table handling
the old way.
(aout_get_external_symbols): Don't complain if last byte of string table is
nonzero.
* libbfd.c [HAVE_MADVISE]: Include sys/types.h and sys/mman.h.
(bfd_free_window) [! USE_MMAP]: Don't define.
(bfd_get_file_window, _bfd_generic_get_section_contents_in_window)
 [! USE_MMAP]: Abort.
1995-11-09 09:14:01 +00:00
Ian Lance Taylor 33698029db * coff-a29k.c (a29k_reloc): Change handling of R_IREL reloc to be
compatible with AMD generated COFF files.  Try to support both AMD
	and GNU formats simultaneously.
	(coff_a29k_relocate_section): Likewise.
1995-11-09 02:30:33 +00:00
Ian Lance Taylor 1b3b0c0343 Wed Nov 8 20:03:44 1995 Eric Freudenthal <freudenthal@nyu.edu>
* coff-a29k.c (SIGN_EXTEND_HWORD): Use ~0xffff rather than
	0xffff0000.
1995-11-09 01:04:56 +00:00
Ian Lance Taylor 0bb8ff191e * libbfd.c (bfd_get_file_window): Change writable parameter from
int to boolean; update all callers.  Pass MAP_SHARED if not
	writable--it's required on Solaris.  Cast fprintf argument to
	avoid warning.
	* bfd-in.h (bfd_get_file_window): Update declaration.
	* bfd-in2.h: Rebuild.
	* aoutx.h: Update calls to bfd_get_file_window.
1995-11-08 21:24:33 +00:00
Ian Lance Taylor 7812bf9c25 * xcofflink.c (xcoff_find_reloc): Handle the case of a single
reloc correctly.
1995-11-08 19:26:19 +00:00
Ian Lance Taylor 417acf225f more XCOFF linker hackery 1995-11-08 19:08:18 +00:00
Ian Lance Taylor 0634a43142 * xcofflink.c (XCOFF_DEF_DYNAMIC): Rename from XCOFF_REF_DYNAMIC.
Change all uses.
	(xcoff_swap_ldhdr_in): New static function.
	(xcoff_swap_ldsym_in): New static function.
	(xcoff_link_add_symbols): If we just created a descriptor, pass it
	to _bfd_generic_link_add_one_symbol, to save a hash lookup.
	(xcoff_link_add_dynamic_symbols): Rewrite to read .loader symbols
	rather than normal symbol table.
	(xcoff_mark): When considering called symbols, check whether the
	descriptor is from a dynamic object, rather than the symbol
	itself.
	(xcoff_build_ldsyms): Likewise.
1995-11-08 18:17:44 +00:00
Ian Lance Taylor 092abcdfba * libbfd.c (bfd_get_file_window): Change return type to boolean.
Cast realloc and malloc return values.  If malloc or realloc fail,
	set bfd_error_no_memory.
	* bfd-in.h (bfd_get_file_window): Change type to boolean.
	* bfd-in2.h: Rebuild.
1995-11-08 16:32:40 +00:00
Ian Lance Taylor c09712980d * ecofflink.c (_bfd_ecoff_locate_line): Keep looking through stabs
entries until both the line number address and the function name
	address are too large.
PR 8364.
1995-11-07 21:43:07 +00:00
Kim Knuttila d6f41a7d3e First round ld support for PPC PE 1995-11-07 21:33:33 +00:00
Ian Lance Taylor 6a46885044 * configure.in: Call AC_CHECK_PROG to find and cache AR.
* configure: Rebuilt.
1995-11-07 20:21:37 +00:00
Ian Lance Taylor 6bc200f28d * aclocal.m4 (BFD_CC_FOR_BUILD): Don't define CC_FOR_BUILD if it
is defined in the environment.
1995-11-07 18:51:35 +00:00
Jeff Law c44bf94c73 * som.c (som_get_section_contents_in_window): Define to use
generic version.
1995-11-07 17:59:22 +00:00
Ian Lance Taylor cf587de853 Mon Nov 6 17:13:15 1995 Harry Dolan <dolan@ssd.intel.com>
* coff-i860.c: New file, based on coff-i386.c.
	* cpu-i860.c: New file, based on cpu-i386.c.
	* hosts/i860mach3.h: New file, based on hosts/i386mach3.h.
	* config.bfd (i860-*-mach3*, i860-*-osf1*, i860-*-coff*): New
	targets, using i860coff_vec.
	* configure.in (i860-*-mach3*, i860-*-osf1*): New hosts, using
	trad-core.o and hosts/i860mach3.h.
	(i860coff_vec): Use coff-i860.o and cofflink.o.
	* configure: Rebuild.
	* Makefile.in: Rebuild dependencies.
	(ALL_MACHINES): Add cpu-i860.o.
	(BFD32_BACKENDS): Add coff-i860.o.
	(CFILES): Add cpu-i860.c and coff-i860.c.
	* targets.c (i860coff_vec): Declare.
	(bfd_target_vector): Add &i860coff_vec.
	* archures.c (bfd_i860_arch): Declare.
	(bfd_archures_list): Add &bfd_i860_arch.
	* coffcode.h (coff_set_arch_mach_hook): Handle I860 magic number.
	(coff_set_flags): Handle bfd_arch_i860.
	(coff_write_object_contents): Handle I860 a.out magic number.
1995-11-06 23:04:44 +00:00
Ian Lance Taylor 83c23fca5b * xcofflink.c (xcoff_link_add_symbols): Set the alignment power of
the created .tc section to 2.
	(xcoff_mark): Don't keep a .loader reloc for a call to an
	undefined symbol when creating a shared library.
	(xcoff_build_ldsyms): When creating a shared library, generate
	global linkage code for a call to an undefined symbol.
1995-11-06 19:36:29 +00:00
Ken Raeburn 4fe6d901bd Changes for mmap; details in change log.
Added some new interfaces, and a new entry in the target vector.  Under the new
interfaces, mmap will be used if available, otherwise malloc/seek/read, as
before.  Old interfaces all still intact.

Most configurations (including all used by "--enable-targets=all") simply
changed to call the default routine for that entry in the target vector.  I
might've missed some targets only included in special configurations.

Support for a.out symbol and string table reading now goes through new
interfaces, and will use mmap when available.

Linker hooks (e.g., avoiding reallocation under malloc) not ready yet.
1995-11-06 10:08:03 +00:00
Ken Raeburn ffacb892eb real log for ecoff change - cast _bfd_read_ar_hdr return value 1995-11-06 02:54:36 +00:00
Ken Raeburn 5d9eb9c386 * Makefile.in (CFILES): Rebuild list from BFD_LIBS, ALL_MACHINES,
BFD32_BACKENDS, BFD64_BACKENDS.
(.dep1): Put mkdep output in a separate file.
Rebuilt dependencies.
1995-11-06 02:51:26 +00:00
Fred Fish d9e771e3b0 * core.c: Renamed to corefile.c
* makefile.dos (OBJS): Change core.o to corefile.o
	* Makefile.in (CFILES, BFD_LIBS): Use corefile.c instead of core.c
1995-11-05 00:29:13 +00:00
Stu Grossman bf917766db * config.bfd (mips*-*-magic*): Add bfd_elf32_bigmips_vec to
targ_selvecs to allow debugging under Irix-5 native.
1995-11-04 18:21:17 +00:00
Ian Lance Taylor 583db7a8e1 * xcofflink.c (xcoff_link_add_symbols): Rename local variable sub
to o.  Clobber and restore the list of new csects around the call
	to _bfd_generic_link_add_one_symbol, in case it wants to report a
	linker error and the linker wants to read the symbol table.  Reset
	the line number count of a real section even if it has no relocs.
	(_bfd_xcoff_bfd_final_link): If shared, set the DYNAMIC flag.
1995-11-03 21:20:41 +00:00
Ian Lance Taylor 18a9609c03 * xcofflink.c (_bfd_ppc_xcoff_relocate_section): Don't warn about
an undefined symbol in a shared link.
1995-11-03 04:18:55 +00:00
Ian Lance Taylor 68aed7db3b * linker.c (_bfd_generic_link_add_one_symbol): Correct type of
oldtype from bfd_link_order_type to bfd_link_hash_type.  From
	phdm@info.ucl.ac.be (Philippe De Muyter).
1995-11-03 04:17:36 +00:00
Ian Lance Taylor 4c8b9746b2 use m68k-motorola-sysv*, not sysv3* 1995-11-03 04:16:12 +00:00
Ian Lance Taylor e8d6d5d0a5 * reloc16.c (bfd_coff_reloc16_get_relocated_section_contents):
Pass input_bfd, not in_bfd, to bfd_coff_reloc16_extra_cases.
1995-11-01 22:12:57 +00:00
Ian Lance Taylor 7f82c7e1ee Wed Nov 1 14:26:02 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
* coff-m88k.c (rtype2howto): New static function.
	(RTYPE2HOWTO): Use it rather than a macro definition.

	* coffcode.h (coff_write_object_contents): set internal_a.magic
	to PAGEMAGICPEXECPAGED #if defined (M68) && !defined (LYNXOS).

	* configure.in: m68*-motorola-sysv3* does not use ptrace-core.o;
	define TRAD_HEADER to new file hosts/delta68.h.
	m88*-motorola-sysv*, however, does use ptrace-core.o.
	* hosts/delta68.h: New file.

	* ptrace-core.c (ptrace_unix_core_file_p): change bfd_zmalloc to
	bfd_zalloc; provide proper parm abfd to calls to bfd_zalloc.
1995-11-01 19:31:48 +00:00
Ken Raeburn 619c7730f0 * i386linux.c (MY(vec)): Declare before use. 1995-11-01 18:56:16 +00:00
Ian Lance Taylor b2193cc594 * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
BFD is not of the right type.
	(bfd_elf_get_needed_list): Likewise.
	* i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
	* sunos.c (bfd_sunos_get_needed_list): Likewise.
	* xcofflink.c (XCOFF_XVECP): Define.
	(bfd_xcoff_link_record_set): Don't do anything if the BFD is not
	of the right type.
	(bfd_xcoff_import_symbol): Likewise.
	(bfd_xcoff_export_symbol): Likewise.
	(bfd_xcoff_link_count_reloc): Likewise.
	(bfd_xcoff_record_link_assignment): Likewise.
	(bfd_xcoff_size_dynamic_sections): Likewise.
1995-11-01 18:25:35 +00:00
Ian Lance Taylor baabeb74a7 * sunos.c (sunos_scan_ext_relocs): Only check the reloc symbol
table index against the number of symbols for a base relative
	reloc.
1995-11-01 18:09:06 +00:00
Ian Lance Taylor 73246ff837 * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Change from macro to
static function.
	* xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Set
	full_aouthdr flag here...
	(_bfd_xcoff_bfd_final_link): ...not here.
1995-11-01 16:47:14 +00:00
Fred Fish 6ab826bd98 * libelf.h: Rename to elf-bfd.h to avoid conflict with
systems that have a system <libelf.h>.
	* Makefile.in: Globally replace libelf.h with elf-bfd.h.
	* bfd.c, elf.c, elf32-arc.c, elf32-gen.c, elf32-hppa.c,
	elf32-hppa.h, elf32-i386.c, elf32-i860.c, elf32-m68k.c,
	elf32-m88k.c, elf32-mips.c, elf32-ppc.c, elf32-sparc.c,
	elf64-gen.c, elf64-sparc.c, elfcode.h, elflink.c,
	elfxx-target.h: Include elf-bfd.h rather than libelf.h.
	* elfxx-target.h: Change libelf.h reference to elf-bfd.h.
1995-10-31 23:29:05 +00:00
Ian Lance Taylor 0652d579db Tue Oct 31 15:30:07 1995 David Mosberger-Tang <davidm@azstarnet.com>
* ecoff.c (ecoff_set_symbol_info): Add new parameter weak.  If
	set, set BSF_WEAK in symbol.  Change all callers.
	(ecoff_get_extr): Set weakext based on BSF_WEAK.
	(ecoff_link_add_externals): If weakext is set, pass BSF_WEAK to
	_bfd_generic_link_add_one_symbol.
	(ecoff_indirect_link_order): Check that the section tdata relocs
	are not NULL before using them.
1995-10-31 20:50:25 +00:00
Ian Lance Taylor 999cc186c5 Tue Oct 31 15:30:07 1995 David Mosberger-Tang <davidm@azstarnet.com>
* configure.in (alpha*-*-linux*): Set COREFILE to trad-core.o and
	define TRAD_HEADER as hosts/alphalinux.h.
	* configure: Rebuild.
	* hosts/alphalinux.h: New file.
	* trad-core.c (trad_unix_core_file_p): Cast u.u_ar0 to bfd_vma,
	not int.
1995-10-31 20:32:53 +00:00
Ian Lance Taylor 2bd0aeb941 * coffcode.h (coff_slurp_symbol_table): Accept C_BCOMM and
C_ECOMM storage classes.
1995-10-31 19:20:58 +00:00
Ian Lance Taylor e608052057 * xcofflink.c (xcoff_mark_symbol): New static function, broken out
of xcoff_mark.
	(xcoff_mark): Call xcoff_mark_symbol.
	(bfd_xcoff_export_symbol): Call xcoff_mark_symbol.
	(bfd_xcoff_link_count_reloc): Call xcoff_mark_symbol rather than
	doing it by hand.
	(xcoff_build_ldsyms): Build a .loader symbol for an export symbol.
1995-10-31 17:36:12 +00:00
Ian Lance Taylor f630a0a41a * xcofflink.c (struct xcoff_final_link_info): Add new line_filepos
field.
	(xcoff_find_reloc): New static function.
	(xcoff_link_add_symbols): Use it.
	(_bfd_xcoff_bfd_final_link): Set finfo.line_filepos.
	(xcoff_link_input_bfd): Handle C_BINCL and C_EINCL.  Don't
	relocate the value of C_DECL.
1995-10-30 23:53:16 +00:00
Ian Lance Taylor 5fe14a9f51 * elf.c (elf_fake_sections): Remove bogus BFD_ASSERT.
PR 8293.
1995-10-30 19:56:30 +00:00
Steve Chamberlain dff77ed71f Sat Oct 28 01:25:34 1995 steve chamberlain <sac@slash.cygnus.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Make
	callback decide what goes in .relocs.
	* pe[i]-i386.c (TARGET_UNDERSCORE): Define.
	* peicode.h (pe_mkobject_hook): Only copy aouthdr if
	there is one.
1995-10-28 08:30:37 +00:00
Ian Lance Taylor 697a8fe872 * xcofflink.c (xcoff_link_add_symbols): Handle csects in the
absolute section.
1995-10-28 05:51:49 +00:00
Niklas Hallqvist 6fd1f40d22 * m68k4knetbsd.c: New file.
* hosts/mipsnbsd.h: New file.
1995-10-28 01:01:52 +00:00
Niklas Hallqvist f552f751e9 * PORTING, aout-arm.c, aout-encap.c, aout-rce.c, aout-target.h,
aoutx.h, gen-aout.c, host-aout.c, hp300bsd.c, i386aout.c
	i386bsd.c, i386dynix.c, i386linux.c, i386lynx.c, i386mach3.c,
	i386netbsd.c, m68klynx.c, m88kmach3.c, mipsbsd.c, newsos3.c,
	ns32knetbsd.c, pc532-mach.c, riscix.c, sparclynx.c, sparcnetbsd.c:
	Change PAGE_SIZE to TARGET_PAGE_SIZE.

	* m68knetbsd.c: Ditto as well as add support for the m68k4k object
	format.

	* netbsd.h: Double ditto (incl. m68k4k support).  NetBSD's text
	segments includes the a.out header.  See to that the magic number
	*always* is big-endian.

	* config.bfd: Add m68*-hp*-netbsd* case.  Cross-pollinate m68k and
	m68k4k NetBSD configurations.

	* configure.in, configure: Separate i386 & mips NetBSD
	configurations from other BSD ones.  Don't assume DEC is the only
	thing NetBSD/mips run on.  Add {m68k,ns32k,sparc}-*-netbsd*
	configurations.  Add support for m68k4k NetBSD object format.

	* libaout.h: Added M_68K4K_NETBSD magic.

	* hosts/{m68k,sparc}nbsd.h: Don't define HOST_BIG_ENDIAN_P.

	* hosts/nbsd.h: Define HOST_BIG_ENDIAN_P according to
	<machine/endian.h>.
1995-10-28 00:45:51 +00:00
Ian Lance Taylor 2d7de17d61 * xcofflink.c: More improvements, mostly to fix handling of
constructors and a few other special cases.
	* coff-rs6000.c (rs6000coff_vec): Set symbol_leading_char back to
	zero, reverting yesterday's change.
	* bfd-in.h (bfd_xcoff_link_record_set): Declare.
	(bfd_xcoff_link_count_reloc): Declare.
	(bfd_xcoff_record_link_assignment): Declare.
	* bfd-in2.h: Rebuild.
1995-10-27 22:20:19 +00:00
Stu Grossman d6d44ef984 * config.bfd: Add config stuff for mips*-*-magic* to set
targ_defvec to ecoff_big_vec.
1995-10-27 16:45:28 +00:00
Ian Lance Taylor aad2c618d3 more XCOFF linker tweaks 1995-10-27 03:36:17 +00:00
Ian Lance Taylor 867d923d18 * xcofflink.c: Numerous changes to get closer to a working XCOFF
linker.
	* libcoff-in.h (struct xcoff_tdata): Add full_aouthdr,
	toc_section, and entry_section fields.
	(struct xcoff_section_tdata): Remove ldrel_count field.
	* libcoff.h: Rebuild.
	* coffcode.h (coff_mkobject_hook): Initialize new xcoff_data
	fields.
	(coff_compute_section_file_positions): If RS6000COFF_C, generate
	full a.out header if full_aouthdr is set in xcoff_data.
	(coff_write_object_contents): Likewise.  Set o_snentry and o_sntoc
	based on sections stored in xcoff_data.
	* coff-rs6000.c (xcoff_copy_private_bfd_data): Copy new xcoff_data
	fields.
	* coffgen.c (coff_get_symbol_info): If fix_value is set, fix the
	value stored in ret rather than returning a pointer value.
1995-10-26 18:25:13 +00:00
Michael Meissner 6bd9ffdb07 Remove MAC object format support from powerpc-eabi for now 1995-10-26 03:12:19 +00:00
Jeff Law 9d14250f9d * som.c (som_slurp_string_table): Allocate the strings with malloc
since they're free'd by free_cached_info.
        (som_slurp_symbol_table): Similarly for the symbol table.
Fixes crash (nm /lib/libc.a on hpux10).
1995-10-25 22:23:33 +00:00
Per Bothner a2bd052926 * Makefile.in (diststuff): Don't make headers. 1995-10-25 21:59:47 +00:00
Ian Lance Taylor 356cd46521 * Makefile.in: Rebuild dependencies. 1995-10-25 20:42:36 +00:00
Ian Lance Taylor b73322d9fd fix XCOFF line number handling 1995-10-25 20:33:38 +00:00
Ian Lance Taylor 1edd3a7b3d * sunos.c (bfd_sunos_record_link_assignment): Don't do anything if
output_bfd is not SunOS.
	(bfd_sunos_size_dynamic_sections): Likewise.  Don't scan relocs of
	non-SunOS input files.
PR 8270.
1995-10-25 16:33:02 +00:00
Ian Lance Taylor 28a0c10399 * xcofflink.c: Extensive changes to support linking shared objects
and generating a .loader section.
	* libcoff-in.h (struct xcoff_tdata): Add import_file_id field.
	(struct xcoff_section_tdata): Add first_symndx, last_symndx,
	and ldrel_count fields.
	* libcoff.h: Rebuild.
	* coff-rs6000.c (xcoff_howto_table): Correct reloc names.
	* coffcode.h (styp_to_sec_flags): Don't set any flags if STYP_PAD
	is set.
	* bfd-in.h (bfd_xcoff_import_symbol): Declare.
	(bfd_xcoff_export_symbol): Declare.
	(bfd_xcoff_size_dynamic_sections): Declare.
	* bfd-in2.h: Rebuild.
1995-10-25 15:37:47 +00:00
Stan Shebs aadf04f736 * configure.in: Add xcofflink.o to pmac_xcoff_vec.
* configure: Rebuild.
	* mpw-config.in: Add xcofflink.c.o to powerpc-apple-macos.
	* coff-pmac.c: Include coff-rs6000.c instead of duplicating its
	contents.
	(pmac_xcoff_vec): Update to use new xcoff support.
	* coff-rs6000.c (xcoff_generic_stat_arch_elt): Make static.
	(xcoff_write_armap): Declare buf as unsigned char.
	* xcofflink.c (xcoff_link_add_symbols): Declare a local as PTR.

	* mpw-make.sed: Generalize subdir_do edit.
1995-10-25 00:54:55 +00:00
Jeff Law ddf4639bc8 * hppabsd-core.c (make_bfd_asection): Initialize asect->filepos
correctly.  Don't initialize asect->vma.
1995-10-24 16:27:25 +00:00
Ken Raeburn e7bedf65ef * opncls.c (_bfd_new_bfd): If _bfd_chunksize wasn't preset, use something a
little less than the page size.
1995-10-20 17:25:27 +00:00
Steve Chamberlain 3a70e2988d Wed Oct 18 16:20:08 1995 steve chamberlain <sac@slash.cygnus.com>
* coff-i386.c (coff_i386_reloc_type_lookup): New.
	* coffcode.h (coff_write_object_contents): If .bss is before
	.data us that as data_start.
	* cofflink.c (_bfd_coff_generic_relocate_section): Get reloc
	calc correct.
	* peicode.h (add_data_entry): Use _cooked_size of data directory.
	(coff_swap_outhdr_out): Hardwire in version number.
1995-10-18 23:26:12 +00:00
Ken Raeburn 3c3a526818 * sunos.c (sunos_add_dynamic_symbols): Rename local variables major and minor
to *_vno, since the former are also macros in SunOS header files.  Cast result
of bfd_alloc to appropriate type.
1995-10-18 21:32:53 +00:00
Ken Raeburn 5a2846e3dd * coffgen.c (coff_find_nearest_line): Cast used_by_bfd value before assigning
to sec_data.
1995-10-18 20:53:24 +00:00
Ian Lance Taylor 0f6c885ef0 * ecoff.c (_bfd_ecoff_find_nearest_line): The offset argument is
now relative to the section, not absolute.
	* ecofflink.c (_bfd_ecoff_locate_line): Use the right symbol to
	get the file name when there is a N_SO directory name.  When
	handling stabs, remember that section->vma was added to the
	offset.
PR 8223.
1995-10-18 17:29:38 +00:00
Ian Lance Taylor 11fa66365b * sunos.c (struct sunos_link_hash_table): Add needed field.
(sunos_link_hash_table_create): Call bfd_release, not free.
	(sunos_link_hash_table_create): Initialize needed field.
	(sunos_add_dynamic_symbols): Record needed objects.
	(bfd_sunos_get_needed_list): New function.
	* bfd-in.h (bfd_sunos_get_needed_list): Declare.
	* bfd-in2.h: Rebuild.
1995-10-17 22:30:42 +00:00
Ian Lance Taylor 54406786f0 * bfd-in.h (struct bfd_link_needed_list): Rename from
bfd_elf_link_needed_list.
	* bfd-in2.h: Rebuild.
	* elf.c, elflink.h, libelf.h: Corresponding changes.
1995-10-16 23:10:56 +00:00
Ian Lance Taylor dd98464413 Add start at AIX linker support; no shared libraries yet.
* xcofflink.c: New file.
	* configure.in (rs600coff_vec): Use xcofflink.o.
	* configure: Rebuild.
	* libcoff-in.h (struct xcoff_tdata): Add csects and debug_indices
	fields.
	(struct xcoff_section_tdata): Define.
	(xcoff_section_data): Define macro.
	(_bfd_xcoff_bfd_link_hash_table_create): Declare.
	(_bfd_xcoff_bfd_link_add_symbols): Declare.
	(_bfd_xcoff_bfd_final_link): Declare.
	(_bfd_ppc_xcoff_relocate_section): Declare.
	* libcoff.h: Rebuild.
	* coff-rs6000.c: Clean up a bit.
	(xcoff_mkobject): Default modtype to 1L, not RE.  Initialize
	cputype, csects, and debug_indices.
	(xcoff_copy_private_bfd_data): Copy cputype.
	(xcoff_howto_table): Rename from rs6000coff_howto_table.
	(xcoff_rtype2howto): Rename from rs6000coff_rtype2howto.
	(xcoff_reloc_type_lookup): Rename from
	rs6000coff_reloc_type_lookup.
	(coff_relocate_section): Define.
	(_bfd_xcoff_sizeof_headers): Define.
	(_bfd_xcoff_bfd_get_relocated_section_contents): Define.
	(_bfd_xcoff_bfd_relax_section): Define.
	(_bfd_xcoff_bfd_link_split_section): Define.
	(rs6000coff_vec): For BFD_JUMP_TABLE_LINK, use _bfd_xcoff, not
	coff.
	* coffcode.h (coff_compute_section_file_positions): If AIX,
	increment sofar by SMALL_AOUTSZ if not executable.
	(coff_write_object_contents): If AIX, always output an a.out
	header; if not executable, header size of SMALL_AOUTSZ.
	* hash.c (struct bfd_strtab_hash): Add xcoff field.
	(_bfd_stringtab_init): Initialize xcoff field.
	(_bfd_xcoff_stringtab_init): New function.
	(_bfd_stringtab_add): In XCOFF mode, leave two bytes for length.
	(_bfd_stringtab_emit): In XCOFF mode, write out length.
	* libbfd-in.h (_bfd_xcoff_stringtab_init): Declare.
	* libbfd.h: Rebuild.
	* Makefile.in: Rebuild dependencies.
	(BFD32_BACKENDS): Add xcofflink.o.
	(CFILES): Add xcofflink.c.
ld -r works on hello, world.
1995-10-16 21:54:48 +00:00
Steve Chamberlain c974e19ef4 * libcoff-in.h (pe_data_type.in_reloc_p): New. 1995-10-16 21:46:48 +00:00
Ian Lance Taylor 22a35f0b05 * elf32-mips.c (mips_elf_symbol_processing): Set SEC_ALLOC, not
SEC_NO_FLAGS, for .acommon section.  From Peter Schauer
	<Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>.
1995-10-16 14:54:17 +00:00
Michael Meissner fb417a2138 Add in_reloc_p, cloned from coff-i386.c 1995-10-15 01:37:23 +00:00
Steve Chamberlain b1e463692c Fri Oct 13 11:22:01 1995 steve chamberlain <sac@slash.cygnus.com>
* coff-arm.c (in_reloc_p): New.
	* coff-i386.c (in_reloc_p): New.
	* coffcode.h: Allways include peicode.h if COFF_WITH_PE.
	(coff_write_object_contents): Only set has_reloc_section
	if PE_IMAGE.
	* cofflink.c (_bfd_coff_generic_relocate_section): Call
	in_reloc_p to decide if reloc should be emitted.
	* libcoff.h (pe_data_type.in_reloc_p): New.
	* peicode.h (pe_mkobject): Initialize in_reloc_p.
1995-10-13 18:28:31 +00:00
Ian Lance Taylor ee9f09cd26 * elflink.h (elf_link_add_object_symbols): Correct conditions
under which type and size change warnings are issued.
1995-10-11 04:50:20 +00:00
Ian Lance Taylor 78b31b6bb8 x 1995-10-10 22:51:22 +00:00
Fred Fish 9dd7e56f74 * Makefile.in (FLAGS_TO_PASS): Remote BISON. 1995-10-10 19:23:54 +00:00
Ian Lance Taylor 8235c11240 * elflink.h (elf_link_add_object_symbols): Don't warn about
changing the size or type if the old definition was weak.
1995-10-10 05:30:17 +00:00
Ian Lance Taylor 49488f2b2d * coffcode.h (combined_entry_type): Add fix_line field.
(coff_slurp_line_table): Warn if we try to set the lineno field of
	a symbol twice.
	(coff_slurp_symbol_table): If RS6000COFF_C, handle C_BINCL and
	C_EINCL by setting fix_line.  Fix C_BSTAT symbol value.
	* coffgen.c (coff_mangle_symbols): Handle fix_line.
	(coff_write_symbol): Only use N_DEBUG if the symbol is in the
	absolute section.
	(coff_print_symbol): Print fix_value symbols in a useful fashion.
	* libcoff.h: Rebuild.
1995-10-09 23:32:22 +00:00
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
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
Ian Lance Taylor b088e4b229 * sunos.c (sunos_scan_std_relocs): Fix BFD_ASSERT: it's OK to find
a symbol with a non-zero plt_offset.
1995-09-11 14:56:49 +00:00
Ian Lance Taylor 2b71e1e4d7 * elfcode.h (align_file_position): Remove; not used. 1995-09-08 22:43:31 +00:00
Ian Lance Taylor 1dff79026a * configure.in: Only check for <sys/procfs.h> on a native system,
and make sure it defines prstatus_t.
	* configure: Rebuild.
1995-09-08 15:50:29 +00:00
Ian Lance Taylor 535c89f0a5 * sunos.c (sunos_write_dynamic_symbol): Correct m68k abort test. 1995-09-07 20:29:24 +00:00
Ian Lance Taylor a7873a6cbd tweak last change 1995-09-07 17:09:48 +00:00
Ian Lance Taylor 936b870cfd * config.in: Rename from config.h.in.
* configure.in: Call AC_CONFIG_HEADER with config.h:config.in.
	* configure: Rebuild.
	* Makefile.in (stamp-h): Set CONFIG_HEADERS to config.h:config.in
	when calling config.status.
1995-09-07 17:03:55 +00:00
Ian Lance Taylor 870015b1b8 * Makefile.in (do_distclean): Remove config.h and stamp-h.
(Makefile): Just rebuild Makefile.
	(config.h, stamp-h): New targets.
	* configure.in: Create stamp-h when rebuilding config.h.
	* configure: Rebuild.
1995-09-07 16:50:40 +00:00
Ian Lance Taylor b7577823b6 * configure.in: Call AC_CONFIG_HEADER. Substitute
HOST_64BIT_LONG.  Check that various header files exist.  Check
	that fcntl exists.  Call BFD_BINARY_FOPEN.  Check whether malloc
	and/or free need to be declared.  Don't make a link to sysdep.h.
	Define TRAD_HEADER for various hosts.
	* configure: Rebuild.
	* configure.host: Don't set my_host.  Add definitions taken from
	host header files for various entries.  Remove entries which now
	do nothing.
	* acconfig.h: New file.
	* config.h.in: New file, built by autoheader.
	* sysdep.h: New file.
	* Makefile.in (do_distclean): Don't remove sysdep.h.
	(RECONFIG): Remove.
	(LOCAL_H_DEPS): New variable.
	($(BFD_LIBS)): Use $(LOCAL_H_DEPS) rather than libbfd.h and
	$(RECONFIG).
	($(BFD_MACHINES), $(BFD_BACKENDS)): Likewise.
	($(OPTIONAL_BACKENDS)): Likewise.
	(stmp-bfd.h): Just substitute for BFD_HOST_64BIT_LONG, rather than
	looking through sysdep.h.
	* bfd-in.h (BFD_HOST_64BIT_LONG): Define; set by Makefile.
	(BFD_HOST_64_BIT): Define based on BFD_HOST_64BIT_LONG.
	(fprintf_vma, sprintf_vma): Likewise.
	(int64_type, uint64_type): Don't define.
	* bfd-in2.h: Rebuild.
	* archures.c, bfd.c, srec.c: Include <ctype.h>.
	* elfcore.h: Check HAVE_SYS_PROCFS_H rather than HAVE_PROCFS.
	* lynx-core.c: Include stuff from old hosts/lynx.h.
	* opncls.c (bfd_fdopenr): Check HAVE_FNCTL and defined (F_GETFL),
	rather than NO_FCNTL.
	* targets.c (bfd_target_list): Check HOST_HPPAHPUX and ! __STDC__
	rather than NATIVE_HPPAHPUX_COMPILER.
	* trad-core.c: Don't include <errno.h>.  Include TRAD_HEADER if it
	is defined.
	* hosts/*.h: Remove all header files which merely include,
	declare, and define things.  Leave header files which define
	information needed by trad-core.c.
1995-09-06 22:53:43 +00:00
Ian Lance Taylor 4c2e4d0e01 * aclocal.m4: Don't try to grep ../Makefile if it doesn't exist.
* configure: Rebuild.
1995-09-06 00:02:00 +00:00
Ian Lance Taylor 7a93ebdd58 * coff-sparc.c (CALC_ADDEND): Don't set the addend to the value of
a global symbol.
PR 7908.
1995-09-05 23:36:49 +00:00
Jason Molenda 866bb9e5c1 * config.bfd: i386pe_ve -> i386pe_vec. 1995-09-05 19:50:50 +00:00
Ian Lance Taylor f515fb2f93 * configure.host: Incorporate host Makefile fragments by setting
shell variables.
	* configure.in: Call AC_PROG_CC.  Substitute CFLAGS, HDEFINES and
	AR.  Call AC_PROG_INSTALL.  Substitute CC_FOR_BUILD, choosing a
	value based on whether the code is being compiled by a cross
	compiler.  Don't substitute host_makefile_frag or frags.
	* aclocal.m4: New file to define local AC_PROG_CC.
	* configure: Rebuild.
	* Makefile.in (INSTALL): Set to @INSTALL@.
	(INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@.
	(INSTALL_DATA): Set to @INSTALL_DATA@.
	(AR): Set to @AR@.
	(CC): Define as @CC@.
	(CFLAGS): Set to @CFLAGS@.
	(CC_FOR_BUILD): Set to @CC_FOR_BUILD@.
	(@host_makefile_frag@): Remove.
	(ALL_CFLAGS): Change $(HDEFINES) to @HDEFINES@.  Move $(CFLAGS)
	after other options.
	(config.status): Remove dependency upon @frags@.
	* config/*.mh, config/README: Remove.
1995-09-04 21:13:51 +00:00
Ian Lance Taylor 2b79a10471 * config.bfd: Rewrite to incorporate the contents of the Makefile
fragments by setting shell variables, rather than merely returning
	the name of a Makefile fragment.
	* configure.in: Use shell variables set by config.bfd rather than
	looking at the target Makefile fragment files.  Don't substitute
	target_makefile_frag.  Do substitute TDEFINES.
	* configure: Rebuild.
	* Makefile.in (@target_makefile_frag@): Remove.
	(ALL_CFLAGS): Change $(TDEFINES) to @TDEFINES@.
	* config/*.mt: Remove.
1995-09-04 18:31:40 +00:00
Ken Raeburn 2cb159a52a Wrap "i[345]86" patterns in changequote lines. 1995-09-04 07:15:54 +00:00
Jeff Law ef07871c96 * som.c (som_bfd_print_private_bfd_data): Define to use the
generic version.
1995-09-03 17:33:44 +00:00
Steve Chamberlain 1613e0758e Split. 1995-09-02 00:24:04 +00:00
Ian Lance Taylor a21227ef2c * Makefile.in (OFILES): Remove $(TDEPFILES).
* config/apollo.mt (TDEPFILES): Remove.
	* config/README: Update.
1995-09-01 22:32:19 +00:00
Ian Lance Taylor a52a3ce8e0 * configure.in: For a native configuration, set COREFILE and
COREFLAG based on the canonical host name.
	* configure: Rebuild.
	* Makefile.in: Rebuild dependencies.
	(ALL_CFLAGS): Add @COREFLAG@.
	(OFILES): Replace $(HDEPFILES) with @COREFILE@.
	* coff-rs6000.c: Check AIX_CORE rather than HOST_AIX for core file
	support routines.  Check LYNX_CORE rather than HOST_LYNX.
	* lynx-core.c: Check LYNX_CORE rather than HOST_LYNX.
	* i386lynx.c: Likewise.
	* m68klynx.c: Likewise.
	* sparclynx.c: Likewise.
	* rs6000-core.c: Check AIX_CORE rather than HOST_AIX.
	* *-core.c: Comment changes.
	* config/decstation.mh (HDEPFILES): Remove.
	(HDEFINES): Remove -DTRAD_CORE.
	* config/irix3.mh (RANLIB): Remove.
	* config/irix4.mh (HDEPFILES, RANLIB): Remove.
	(HDEFINES): Remove -DIRIX_CORE.
	* config/riscos.mh (RANLIB, HDEPFILES): Remove.
	(HDEFINES): Remove -DTRAD_CORE.
	* config/ncr3000.mh (AR_FLAGS, RANLIB): Remove.
	* config/ultra3.mh (RANLIB): Remove.
	* config/aix4.mh, config/alphaosf.mh, config/amix.mh: Remove.
	* config/apollo.mh, config/delta68.mh, config/delta88.mh: Remove.
	* config/dpx2.mh, config/esix.mh, config/harris.mh: Remove.
	* config/hp300.mh, config/hp300bsd.mh, config/hppabsd.mh: Remove.
	* config/hppahpux.mh, config/hppaosf.mh: Remove.
	* config/i386aix.mh, config/i386bsd.mh: Remove.
	* config/i386linux.mh, config/i386mach3.mh: Remove.
	* config/i386sco.mh, config/i386v.mh, config/i386v4.mh: Remove.
	* config/irix5.mh, config/m88kmach3.mh, config/mipsbsd.mh: Remove.
	* config/mipsmach3.mh, config/news-mips.mh: Remove.
	* config/news.mh, config/pc532mach.mh, config/riscix.mh: Remove.
	* config/rs600.mh, config/rs6000lynx.mh: Remove.
	* config/solaris2.mh, config/stratus.mh: Remove.
	* config/symmetry.mh, config/sysv4.mh, config/tahoe.mh: Remove.
	* config/vaxbsd.mh, config/vaxult.mh, config/vaxult2.mh: Remove.
1995-09-01 22:23:04 +00:00
Ian Lance Taylor d6f672b881 Fri Sep 1 15:18:50 1995 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
* elflink.h (elf_bfd_final_link): Don't change a DT_INIT or
	DT_FINI entry if the appropriate symbol is not in the hash table.

	* libelf.h (struct elf_backend_data): Add create_program_headers
	and want_hdr_in_seg fields.
	* elfxx-target.h (elf_backend_want_hdr_in_seg): Define if not
	defined.
	(elf_backend_create_program_headers): Likewise.
	(elfNN_bed): Initialize create_program_headers and
	want_hdr_in_seg.
	* elf.c (get_program_header_size): Call create_program_headers
	backend routine.
	(map_program_segments): Check want_hdr_in_seg backend field.  Call
	create_program_headers backend routine.

	* elf.c (assign_file_positions_except_relocs): Align non allocated
	sections when creating an executable.

	* elfcode.h (elf_swap_phdr_in): Make non static.
	(elf_swap_phdr_out): Make non static.
	* libelf.h (bfd_elf32_swap_phdr_in): Declare.
	(bfd_elf32_swap_phdr_out): Declare.
	(bfd_elf64_swap_phdr_in): Declare.
	(bfd_elf64_swap_phdr_out): Declare.
1995-09-01 19:29:43 +00:00
Ian Lance Taylor 0cb705689d * elflink.h (elf_link_add_object_symbols): Handle indirect and
warning symbols.  If any section is named .gnu.warning.XXX, treat
	the contents as a warning to be issued if the symbol XXX is
	referenced.
	(elf_link_output_extsym): For an indirect or warning symbol, just
	output the symbol it points to.
1995-09-01 18:08:28 +00:00
Jackie Smith Cashion f14db88017 Fri Sep 1 08:12:50 1995 James G. Smith <jsmith@beauty.cygnus.com>
* config.bfd: Add mips*vr4300-*-elf* target.
        * config/mipsbvr4300.mt: Added.
1995-09-01 15:15:57 +00:00
Steve Chamberlain 4e98461f60 Thu Aug 31 16:00:53 1995 steve chamberlain <sac@slash.cygnus.com>
* Makefile.in: Update dependencies.
	* aout-target.h (MY_bfd_print_private_bfd_data): New.
	* bfd-in.h (PE STUFF): Deleted.
	* bfd.c (tdata->pe_obj_data): New.
	(bfd_print_private_bfd_data): New.
	* coff-i386.c, coff-arm.c (coff_*-rtype_to_howto): Get image base from
	new place.
	* libcoff.h, libbfd.h, bfd-in2.h: Rebuilt.
	* coffcode.h (pe_value): Delete
	(coff_mkobject, coff_mkobject_hook): Conditionally build.
	(coff_compute_section_file_positions): Look in new place.
	(add_data_entry, fill_pe_header_info): Deleted.
	(coff_write_object_contents): Remove PE stuff.
	(coff_bfd_print_private_bfd_data): New.
	* coffswap.h: Remove PE stuff.
	* elfxx-target.h (bfd_elfNN_bfd_print_private_bfd_data): New.
	* libbfd-in.h (_bfd_generic_bfd_print_private_bfd_data): New.
	* libcoff-in.h (pe_data_type): New.
	* libecoff.h (_bfd_ecoff_bfd_print_private_bfd_data): New.
	* targets.c (_bfd_print_private_bfd_data): New.
	* peicode.h: New file.
1995-08-31 23:33:37 +00:00
Ian Lance Taylor 815179af80 * bfd-in.h: Add extern "C" if __cplusplus.
* bfd-in2.h: Rebuild.
PR 7882.
1995-08-31 16:23:02 +00:00
Ian Lance Taylor 61228e36e8 * coff-mips.c (mips_relocate_section): Don't convert a reloc
against an absolute symbol into a reloc against a section.
PR 7880.
1995-08-31 15:54:27 +00:00
Steve Chamberlain da7afe3b8a Thu Aug 31 08:00:14 1995 steve chamberlain <sac@slash.cygnus.com>
* coff-arm.c (coff_arm_reloc): Fix common size problem.
	(i3coff_object_p): Delete.

Wed Aug 30 20:41:27 1995  steve chamberlain  <sac@slash.cygnus.com>

	* coff-arm.c (deletemeacoff_arm_reloc): Deleted.
	(arm26): Not partial inplace.
	* coffcode.h (coff_compute_section_file_positions): Don't
	do page aligning if COFF_PAGE_SIZE isn't defined.
	* coffswap.h (coff_swap_scnhdr_in): Update image base correctly.
1995-08-31 15:05:27 +00:00
Steve Chamberlain c7f6ebe2c3 * coffswap.h (coff_swap_scnhdr_in): Don't always add IMAGE_BASE.
Swap in PE header.
	* coffcode.h (coff_write_object_contents): Remove #if0ed code
	Only remove empty sections in PE inmage files.
1995-08-29 23:26:43 +00:00
Steve Chamberlain 3332ea9c4f * coff-arm.c (coff_rtype_to_howto): Deal with reloc 11.
* coffcode.h (coff_write_object_contents): Remove #if0ed code
	Only remove empty sections in PE inmage files.
1995-08-29 22:28:30 +00:00
Steve Chamberlain 3ea928f5a9 Tue Aug 29 13:50:21 1995 steve chamberlain <sac@slash.cygnus.com>
* libbfd.h, bfd-in2.h: regenerated.
	* coff-arm.c (aoutarm_std_relo): New entry at 11.
	(arm_reloc_type_lookup) : Understand type 11.
	* coff-i386.c (howto_table): fix name of rva type.
	(coff-i386_rtype_to_howto): Understand R_IMAGEBASE type.
	* coffcode.h (sec_to_styp_flags): .edata is data.
	(coff_compute_section_file_positions): Get page size right for PE.
	(fill_pe_header_info): Fix fields.
	(coff_write_object_contents): Remove end_of_image calc.
	(_bfd_coff_generate_reloc_section): Remove orphaned comment.
	* coffswap.h (coff_swap_scnhdr_in): Don't always add IMAGE_BASE.
	(coff_swap_scnhdr_out): Setup PE flags correctly.
	* reloc.c (BFD_RELOC_RVA): New field.
1995-08-29 21:05:59 +00:00
Ian Lance Taylor a48752a0a3 * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Add parentheses to FIX
expression to avoid compiler bug on HP-UX 9.01.
1995-08-23 23:50:35 +00:00
Steve Chamberlain 2abfcdf3f5 * coffcode.h (pe_value): Unansify. 1995-08-23 16:51:07 +00:00
Steve Chamberlain 9162a94eff (coff_write_object_contents): Initialze link_data if not set. 1995-08-22 06:54:07 +00:00
Steve Chamberlain 7494201cbf * libcoff-in.h (coff_data_type.link_info): New field. 1995-08-22 01:21:52 +00:00
Steve Chamberlain e9614321da Mon Aug 21 17:49:28 1995 steve chamberlain <sac@slash.cygnus.com>
* bfd-in.h (bfd_link_subsystem): Turn enum into #defines.
	(bfd_link_pe_info_dval): New
	(bfd_link_stack_heap): Renamed and massaged into bfd_link_pe_info.
	* bfd-in2.h: rebuilt.
	* bfd.c (NT_subsystem, NT_stack_heap): Deleted.
	* coffcode.h (pe_value): New function.
	(fill_pe_header_info): New function.
	(coff_write_object_contents): Use new function.
	* cofflink.c (coff_final_link_info): Remove pe randomness.
	(dores_com): Update info in bfd_link_pe_info_dval.
	(process_embedded_commands): Use the bfd_link_pe_info_dval.
	(_bfd_coff_final_link): Remove PE stuff, initialize
	coff_data->link_info.
	* coffswap.h (coff_swap_[aout|filehdr]_out): Use indirect PE pointer.
	(coff_swap_scnhdr_out): Use real imagebase.
	* libcoff (coff_data_type.link_info): New field.
1995-08-22 01:02:23 +00:00
Ian Lance Taylor 68807a39e4 * linker.c (link_action): If an undefined reference follows an
undefined weak reference, change the type to undefined.
	* elflink.h (elf_link_add_archive_symbols): Don't record an
	undefined weak reference as defined, in case it turns into a real
	undefined reference later in the same archive.
1995-08-21 15:12:34 +00:00
Ken Raeburn ff31ebda50 * coff-sh.c (sh_relax_section): Cast value for used_by_bfd field to PTR, not
coff_section_tdata pointer, since PTR is the real type of the field.
* cofflink.c (_bfd_coff_read_internal_relocs): Ditto.
1995-08-17 21:00:14 +00:00
Ian Lance Taylor 92962c7188 Add support for linking SPARC SunOS PIC compiled code.
* sunos.c (SPARC_PLT_PIC_WORD0): Define.
	(SPARC_PLT_PIC_WORD1, SPARC_PLT_PIC_WORD2): Define.
	(struct sunos_link_hash_entry): Add got_offset and plt_offset
	fields.
	(struct sunos_link_hash_table): Add dynamic_sections_created and
	dynamic_sections_needed fields.
	(sunos_link_hash_newfunc): Initialize new fields.
	(sunos_link_hash_table_create): Initialize new fields.
	(sunos_create_dynamic_sections): New static function, broken out
	of sunos_add_dynamic_symbols.
	(sunos_add_dynamic_symbols): Call sunos_create_dynamic_sections.
	(sunos_add_one_symbol): Call sunos_create_dynamic_sections.
	(bfd_sunos_size_dynamic_sections): Call sunos_scan_relocs before
	checking whether we need to set up the dynamic link information.
	Define __GLOBAL_OFFSET_TABLE if anything referred to it.
	(sunos_scan_std_relocs): Call sunos_create_dynamic_sections.  Use
	plt_offset field; only put symbol in .plt if it is not defined by
	a regular object.
	(sunos_scan_ext_relocs): Likewise.  Handle base relative relocs.
	(sunos_scan_dynamic_symbol): Store dynobj in local variable.
	(sunos_write_dynamic_symbol): Check plt_offset rather than
	checking whether symbol is in .plt section.  If symbol is defined
	in a regular object file, use SPARC_PLT_PIC_WORD[012], and don't
	add a JMP_TBL reloc.
	(sunos_check_dynamic_reloc): Add contents and relocationp fields.
	If plt_offset is set, redirect relocation to PLT.  If this is a
	base relative reloc, redirect relocation to GOT.  Check
	dynamic_sections_needed field rather than whether dynobj is set.
	(sunos_finish_dynamic_link): Check dynamic_sections_needed field
	rather than whether dynobj is set.  Don't die if .need and .rules
	sections were not created.
	* aoutx.h (howto_table_ext): Mark PC10, PC22, and JMP_TBL entries
	PC relative.  Mark PC10 complain_overflow_dont.  Mark PC22 and
	JMP_TBL complain_overflow_signed.
	(NAME(aout,final_link)): If info->shared is set, set DYNAMIC.
	(aout_link_input_section_std): Call check_dynamic_reloc for all
	relocs.  Pass contents and &relocation.  Don't warn about an
	undefined symbol until check_dynamic_reloc has been called.  Don't
	warn about an undefined symbol for a base relative reloc.
	(aout_link_input_section_ext): Likewise.  For a base relative
	reloc, always treat r_index as an index into the symbol table.
	* libaout.h (struct aout_backend_data): Add contents and
	relocation argument to check_dynamic_reloc entry point.
	(struct aoutdata): Add local_got_offsets field.
1995-08-17 19:30:46 +00:00
Ian Lance Taylor 708fd841b6 * aoutx.h (NAME(aout,machine_type)): Handle a machine of
bfd_mach_sparc or bfd_mach_sparc64.
1995-08-14 16:43:17 +00:00
Ian Lance Taylor 452a5efbaf * elflink.h (elf_link_add_object_symbols): If a symbol is a weak
definition, add it to the dynamic symbol table if any dynamic
	object mentions it.  If we do add it, make sure we add the
	corresponding real symbol.
	(elf_adjust_dynamic_symbol): Adjust a weak defined symbol which we
	put in the dynamic symbol table, even if no regular object refers
	to it.
	* elf32-i386.c (elf_i386_check_relocs): When creating a shared
	library, don't allocate space for a PC relative reloc against a
	local symbol.
	* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
	* elf32-sparc.c (elf32_sparc_check_relocs): Likewise.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Change assertion
	to accept symbol with weakdef set.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): When creating a shared
	libary, don't copy over a PC relative reloc against a local
	symbol.
	* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
PR 7711.
1995-08-14 15:57:17 +00:00
Jeff Law e289647bf8 * som.h (R_HPPA_BEGIN_BRTAB): Define.
(R_HPPA_END_BRTAB): Likewise.
	* som.c (som_write_fixups): Handle R_BEGIN_BRTAB and R_END_BRTAB.

More PA optimization infrastructure.
1995-08-13 06:43:23 +00:00
Ian Lance Taylor baaffcefe2 * coffswap.h (coff_swap_aux_in): Swap the array dimensions
whenever x_fcnary is not being used for something else, rather
	than only for an array.
	(coff_swap_aux_out): Likewise.
PR 7373.
1995-08-10 19:58:56 +00:00
Steve Chamberlain b84d6efbcc Tue Aug 8 16:34:57 1995 steve chamberlain <sac@slash.cygnus.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Remove most
	of special case stuff for PE.  Now handled by relocs.
	* coff-i386.c (coff_i386_reloc): Special case of PE type 7s.
	(howto_table): Type 7 is dir32-rva.
1995-08-08 23:54:27 +00:00
Jeff Law 0a552864e8 * configure.host: Recognize aix4 explicitly.
* rs6000-core.c (CORE_DATA_SIZE_FIELD): New macro to get a the size
        of a core dump's data section.  Provide alternate definition for aix4.
        (SAVE_FIELD): Similarly for save state field (register info).
        (STACK_END_ADDR): Provide definition suitable for aix4.
        * config/{aix4.mh,aix4.mt}: New configuration files.
        * hosts/aix4.h: Likewise.

Mike's aix4 changes, slightly modified.
1995-08-08 17:31:52 +00:00
Ian Lance Taylor f918d3ccc7 * som.c (som_bfd_copy_private_symbol_data): Cast initializations
to avoid warnings.
1995-08-08 03:05:16 +00:00
Jeff Law 515b81046b * som.c (som_decode_symclass): Handle absolute symbols by checking
the SOM type (since they will rarely if ever be in the absolute
	section).

Something Ian noticed.
1995-08-07 20:53:29 +00:00
Jeff Law 08683c8ae7 * som (som_get_reloc_upper_bound): Return -1 on error. Compute
return value with sizeof (arelent *), not sizeof (arelent).

Net bug and something I noticed while fixing it.
1995-08-05 06:07:33 +00:00
Ian Lance Taylor 981f444144 * ecofflink.c (_bfd_ecoff_locate_line): When handling stabs:
correct setting of sym_ptr_end to consider symbols skipped when
	setting sym_ptr; don't leave loop early unless an N_FUN is found
	with a larger value.
1995-07-24 21:42:41 +00:00
Ian Lance Taylor d06004cb3a * cofflink.c (coff_link_add_object_symbols): Call
_bfd_coff_get_external_symbols, not coff_link_get_symbols.  Call
	_bfd_coff_free_symbols, not coff_link_free_symbols.  Call
	_bfd_coff_read_string_table, not coff_read_string_table.
	(coff_link_check_archive_element): Likewise.
	(coff_link_input_bfd): Likewise.
	(coff_link_get_symbols): Move to coffgen.c.
	(coff_read_string_table): Likewise.
	(coff_link_free_symbols): Likewise.
	(_bfd_coff_internal_syment_name): New static function.
	(coff_link_check_ar_symbols): Use _bfd_coff_internal_syment_name.
	(coff_link_add_symbols): Likewise.
	(coff_link_input_bfd): Likewise.
	(_bfd_coff_generic_relocate_section): Likewise.
	(_bfd_coff_read_internal_relocs): New function.
	(coff_link_input_bfd): Use cached section contents if available.
	Use _bfd_coff_read_internal_relocs.
	* coffcode.h (coff_slurp_symbol_table): Don't call bfd_seek.
	(coff_bfd_get_relocated_section_contents): Only define if not
	already defined.
	(coff_bfd_relax_section): Likewise.
	* coffgen.c (build_string_table): Remove.
	(_bfd_coff_get_external_symbols): New function, moved in from old
	coff_link_get_symbols in cofflink.c.
	(_bfd_coff_read_string_table): New function, moved in from old
	coff_read_string_table in cofflink.c.
	(_bfd_coff_free_symbols): New function, moved in frmo old
	coff_link_free_symbols in cofflink.c.
	(coff_get_normalized_symtab): Use _bfd_coff_get_external_symbols
	rather than reading the symbols directly.  To free them, call
	_bfd_coff_free_symbols.  Use _bfd_coff_read_string_table rather
	than build_string_table.
	* libcoff-in.h (obj_coff_keep_syms): Define.
	(obj_coff_keep_strings): Define.
	(coff_data_type): Add fields keep_syms and keep_strings.
	(coff_section_tdata): Define new structure.
	(coff_section_data): Define.
	(_bfd_coff_get_external_symbols): Declare.
	(_bfd_coff_read_string_table): Declare.
	(_bfd_coff_free_symbols): Declare.
	(_bfd_coff_read_internal_relocs): Declare.
	* libcoff.h: Rebuild.
1995-07-24 19:23:53 +00:00
Jeff Law 297faf8cff * elf32-hppa.c (hppa_elf_gen_reloc_type): Add new (ignored)
argument.
        * elf32-hppa.h: Corresponding change.
1995-07-21 04:49:23 +00:00
Ken Raeburn 883e2f510d fix some compilation problems 1995-07-20 23:11:44 +00:00
Fred Fish e365a606ed * hosts/i386v4.h (getgid, getuid): Change prototypes to be
compatible with Unixware 1.x and Unixware 2.x, and probably other
	i386 svr4 versions as well.
1995-07-20 19:57:07 +00:00
Ken Raeburn dfdcff13c0 * targets.c (bfd_target_vector): Since armpe and armpei have been split into
big- and little-endian variants, list all of them, instead of the
now-nonexistant armpe[i]_vec.
1995-07-20 17:56:18 +00:00
Ian Lance Taylor b5727da67b * elf.c (bfd_section_from_phdr): Set lma based on p_paddr.
(elf_fake_sections): Set sh_addr based on lma, not vma.
PR 7478.
1995-07-20 04:10:18 +00:00
David Edelsohn d6fc77df4d * coff-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
* configure.in (armpe_vec, armpei_vec): Add bi-endian support.
	* configure: "regenerated".
	* pe-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
	(TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME.
	* pei-arm.c (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Replaces TARGET_SYM.
	(TARGET_LITTLE_NAME, TARGET_BIG_NAME): Replaces TARGET_NAME.
	* targets.c (armpe_vec, armpei_vec): Deleted.
	(armpe_little_vec, armpe_big_vec, armpei_little_vec, armpei_big_vec):
	Added.
	* config/arm-pe.mt (DEFAULT_VECTOR): Default is armpe_little_vec.
	(SELECT_VECS): Add bi-endian support.
1995-07-19 23:02:21 +00:00
Ian Lance Taylor d0d491b17e * aoutx.h (KEEPIT): Change definition to udata.i.
(KEEPITTYPE): Remove.
	(NAME(aout,reloc_type_lookup)): Add cases to the
	extended reloc type switch: SPARC_GOT10, SPARC_GOT13, SPARC_GOT22,
	SPARC_PC10, SPARC_PC22, SPARC_WPLT30.
	(NAME(aout,swap_std_reloc_out)): Don't bother to use stoi when
	retrieving KEEPIT value.
	(NAME(aout,swap_ext_reloc_out)): Likewise.  Also, only add in
	output section VMA for section symbols, and check BSF_SECTION_SYM
	to control whether to set r_extern to 1.
1995-07-14 23:52:34 +00:00
Ian Lance Taylor 80b44d8a2c * syms.c: Fix comments so that `make info' works. 1995-07-14 17:23:07 +00:00
Ian Lance Taylor 175b3c0f1e * elf32-mips.c (mips_elf_find_nearest_line): Set SEC_HAS_CONTENTS
in .mdebug section, in case backend linker has cleared it.
1995-07-14 17:15:07 +00:00
Michael Meissner 0c51f21a53 Fix PPC_ADDR16_HA relocations 1995-07-14 16:01:44 +00:00
Jeff Law d4654e380e * som.c (hppa_som_gen_reloc_type): Choose a reasonable field
selector relocation for the difference of two symbols.
1995-07-14 03:15:15 +00:00
Ian Lance Taylor 3fe22b980b * aoutx.h (NAME(aout,slurp_reloc_table)): Cast argument to size_t
for malloc.
	* coff-mips.c (mips_relocate_section): Likewise, for memmove.
	(mips_relax_section): Likewise, for malloc.
	* cofflink.c (process_embedded_commands): Likewise.
	(_bfd_coff_final_link): Likewise.
	* ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
	(ecoff_final_link_debug_accumulate): Likewise.
	(ecoff_indirect_link_order): Likewise, for memcpy and malloc.
	(ecoff_reloc_link_order): Likewise, for malloc.
	* ecofflink.c (ecoff_align_debug): Likewise, for memset.
	(ecoff_write_symhdr): Likewise, for malloc.
	* elf32-hppa.c (elf32_hppa_read_symext_info): Likewise.
	* elf.c (assign_file_positions_except_relocs): Likewise, for
	qsort.
	* elf32-mips.c (mips_elf_read_ecoff_info): Likewise, for malloc.
	* elfcode.h (elf_slurp_reloc_table): Likewise.
	* elfcore.h (elf_corefile_note): Likewise.
	* elflink.h (elf_link_add_object_symbols): Likewise.
	(elf_link_read_relocs): Likewise.
	(NAME(bfd_elf,size_dynamic_sections)): Likewise, for memset.
	* i386linux.c (bfd_linux_size_dynamic_sections): Likewise.
	* ieee.c (do_with_relocs): Likewise.
	* linker.c (default_indirect_link_order): Likewise, for malloc.
	* nlmcode.h (nlm_object_p): Likewise.
	(nlm_write_object_contents): Likewise.
	* oasys.c (oasys_set_section_contents): Likewise, for memcpy.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise,
	for malloc.
	* section.c (bfd_get_section_contents): Likewise, for memcpy.
	* srec.c (srec_get_section_contents): Likewise.
	(srec_set_section_contents): Likewise.
	* sunos.c (bfd_sunos_size_dynamic_sections): Likewise, for
	realloc and memset.
	(sunos_scan_relocs): Likewise, for malloc.
	(sunos_scan_dynamic_symbol): Likewise, for realloc.
	* syms.c (_bfd_generic_read_minisymbols): Likewise, for malloc.
	* versados.c (versados_get_section_contents): Likewise, for
	memcpy.
1995-07-13 18:14:45 +00:00
Ian Lance Taylor c3246d9b00 * targets.c (bfd_target): Add fields _read_minisymbols and
_minisymbol_to_symbol.
	(BFD_JUMP_TABLE_SYMBOLS): Add _read_minisymbols and
	_minisymbol_to_symbol.
	(bfd_read_minisymbols): Define.
	(bfd_minisymbol_to_symbol): Define.
	* syms.c (_bfd_generic_read_minisymbols): Define.
	(_bfd_generic_minisymbol_to_symbol): Define.
	* libbfd-in.h (_bfd_nosymbols_read_minisymbols): Define.
	(_bfd_nosymbols_minisymbol_to_symbol): Define.
	(_bfd_generic_read_minisymbols): Declare.
	(_bfd_generic_minisymbol_to_symbol): Declare.
	* bfd-in2.h: Rebuild.
	* libbfd.h: Rebuild.
	* aoutx.h (MINISYM_THRESHOLD): Define.
	(NAME(aout,read_minisymbols)): New function.
	(NAME(aout,minisymbol_to_symbol)): New function.
	* libaout.h (NAME(aout,read_minisymbols)): Declare.
	(NAME(aout,minisymbol_to_symbol)): Declare.
	* aout-target.h (MY_read_minisymbols): Define.
	(MY_minisymbol_to_symbol): Define.
	* All targets: Define read_minisymbols and minisymbol_to_symbol.
PR 5332.
1995-07-13 14:46:06 +00:00