Commit Graph

1554 Commits

Author SHA1 Message Date
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
Ken Raeburn b818a3257f fix some compilation warnings from sun cc 1995-07-12 22:00:57 +00:00
Ian Lance Taylor f55900af7f * elf.c (bfd_section_from_shdr): In case SHT_REL[A], only get the
BFD section for the sh_link section if it is a SYMTAB section.
PR 7392.
1995-07-12 01:23:10 +00:00
Ian Lance Taylor 6c481b58a6 * aoutx.h (NAME(aout,link_add_symbols)): Don't bother to check
that archives hold a.out objects.
	* cf-i386lynx.c (coff_bfd_link_add_symbols): Don't define.
	(lynx_link_add_symbols): Remove.
	* cf-m68klynx.c (coff_bfd_link_add_symbols): Don't define.
	(lynx_link_add_symbols): Remove.
	* elflink.h (elf_bfd_link_add_symbols): Don't bother to check that
	archives hold ELF objects.
1995-07-11 21:22:17 +00:00
Ian Lance Taylor 0e75a8d6da * archive.c (bfd_generic_archive_p): If the archive has a map, and
the target was defaulted, but the first object in the archive can
	not be matched with that target, then return a bad format error.
1995-07-11 21:12:41 +00:00
Ian Lance Taylor 18bf5d5f2f * elf64-sparc.c (elf_sparc_howto_table): Set howto for WDISP16 to
elf64_wdisp16_reloc.
	(elf64_wdisp16_reloc): New static function.
	(elf64_sparc_relocate_section): New static function.
	(elf_backend_relocate_section): Define.
PR 7333.
1995-07-11 20:16:48 +00:00
Ian Lance Taylor cf9fb9f243 * libelf.h (struct elf_size_info): Change type of last argument to
swap_symbol_out from char * to PTR.
	(bfd_elf32_swap_symbol_out): Update declaration.
	(bfd_elf64_swap_symbol_out): Likewise.
	* elfcode.h (elf_swap_symbol_out): Change type of cdst from char *
	to PTR.
	* elf.c (swap_out_syms): Cast to PTR, not char *, when calling
	swap_symbol_out routine.
	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Likewise.
	(elf_link_output_sym): Likewise.
	(elf_link_output_extsym): Likewise.
	* elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Likewise.
1995-07-11 19:24:46 +00:00
Ian Lance Taylor 6f904fce87 Tue Jul 11 12:29:49 1995 Rick Sladkey <jrs@world.std.com>
* elf.c (_bfd_elf_find_nearest_line): Handle the simple case where
	there is no debugging information.
1995-07-11 16:31:39 +00:00
Ian Lance Taylor 9ab8a0e87b * coff-arm.c (PCRELOFFSET): Define if not already defined.
* Makefile.in: Rebuild dependencies.
	(BFD32_BACKENDS): Add coff-arm.o
	(CFILES): Add coff-arm.c, pe-arm.c, pei-arm.c.
1995-07-10 18:24:39 +00:00
Ian Lance Taylor 56fd39e800 * cofflink.c (_bfd_coff_generic_relocate_section): Remove unused
local i.
	* coff-arm.c (coff_arm_rtype_to_howto): Don't declare.
1995-07-10 18:16:25 +00:00
Ian Lance Taylor 921fc2819c * coff-i960.c (coff_i960_relocate): Correct typo: use ! on strcmp,
not on string.
1995-07-10 18:11:13 +00:00
Ian Lance Taylor e336470145 * aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table
using bfd_alloc, not malloc.
	* cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
	* ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
	* i386linux.c (linux_link_hash_table_create): Likewise.
	* linker.c (_bfd_generic_link_hash_table_create): Likewise.
	* sunos.c (sunos_link_hash_table_create): Likewise.
1995-07-10 18:07:17 +00:00
Ian Lance Taylor 951fe66d62 Based on patches from Eric Youngdale <eric@aib.com>:
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): If -Bsymbolic,
	output a DT_SYMBOLIC dynamic entry.
	(elf_adjust_dynamic_symbol): If -Bsymbolic, don't require a PLT
	entry for a locally defined symbol.
	* elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, do warn
	about undefined symbols, and fill in the GOT entry for a symbol
	defined in a regular object file.
	(elf_i386_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
	reloc rather than a GLOB_DAT reloc for a symbol defined in a
	regular object file.
	* elf32-m68k.c (elf_m68k_relocate_section): If -Bsymbolic, do warn
	about undefined symbols, and fill in the GOT entry for a symbol
	defined in a regular object file.
	(elf_m68k_finish_dynamic_symbol): If -Bsymbolic, output a RELATIVE
	reloc rather than a GLOB_DAT reloc for a symbol defined in a
	regular object file.
	* elf32-sparc.c (elf32_sparc_relocate_section): If -Bsymbolic, do
	warn about undefined symbols, and fill in the GOT entry for a
	symbol defined in a regular object file.
	(elf32_sparc_finish_dynamic_symbol): If -Bsymbolic, output a
	RELATIVE reloc rather than a GLOB_DAT reloc for a symbol defined
	in a regular object file.
1995-07-10 17:31:31 +00:00
Ken Raeburn 5b2c2b363d add binary.o, tekhex.o 1995-07-10 15:48:58 +00:00
Ian Lance Taylor d11d1fb673 * config/m68k-coff.mt (SELECT_VECS): Rename from SELECT_VECTORS.
Correct elements to be actual BFD vector names.
1995-07-10 15:12:33 +00:00
Ian Lance Taylor c7e76b5eea * coffgen.c (coff_renumber_symbols): Sort defined symbols that are
neither BSF_FUNCTION not BSF_NOT_AT_END just before undefined
	symbols.
	* coffcode.h (coff_slurp_symbol_table): Set BSF_FUNCTION as well
	as BSF_NOT_AT_END.
PR 5491.
1995-07-07 21:40:56 +00:00
Ken Raeburn 5375150754 clean up new config stuff for mostlyclean, distclean 1995-07-07 21:34:08 +00:00
Ian Lance Taylor 1d5d75e90a * elf32-i386.c (elf_i386_relocate_section): Revert May 24 patch.
Don't copy PC32 reloc against section into shared object.
PR 6997, 7381.
1995-07-06 19:40:51 +00:00
Ian Lance Taylor b10e9afbfd * Makefile.in: Rebuild dependencies.
(CFILES): Added elflink.c.
	(Makefile): Depend upon config.status, not configure.in.
	(config.status): New target; depend upon configure configure.host
	and config.bfd.
1995-07-06 18:39:19 +00:00
Ken Raeburn 0a8310aca8 * Makefile.in (BFD_LIBS): No, don't put elflink.o here.
* configure.in: Include it here whenever elf.o is specified.
1995-07-06 02:28:46 +00:00
Ken Raeburn ede4eed483 Added new files elflink.c, elflink.h, elfcore.h.
Moved some mostly size-independent stuff from elfcode.h to elf.c, adding a data
structure to elfcode.h with some misc data and callback functions.  Added a
pointer to that structure to the target back end data.  More work can be done
here.

Renamed generic elf routines (not cpu-specific stuff) to start with bfd_elf or
_bfd_elf.  Updated most call sites, sometimes defined some macros.

Moved some dynamic linking support code from m68k, sparc, i386 to common files,
using target back end flags to control behavior.  More work can probably be
done here too.

Moved core- and linker-support code out of elfcode.h to elf.c, elfcore.h,
elflink.h, or elflink.c.  Now elfcode.h contains only .o and executable
support, plus #includes of elfcore.h and elflink.h.  Much of the contents of
these other header files can probably still be moved from the .h files to the
.c files, to get compiled only once.

Cleaned up some "gcc -Wall" warnings regarding unused or uninitialized
variables, in generic and cpu-specific code.
1995-07-06 02:22:00 +00:00
Ian Lance Taylor 6c495350ae * elf32-mips.c (mips_elf_object_p): Unconditionally set
elf_bad_symtab, since sometimes the symbol table is messed up and
	the last symbol is global.
PR 6921.
1995-07-05 20:54:57 +00:00
Ian Lance Taylor a2546fcef7 * ecoff.c (_bfd_ecoff_bfd_is_local_label): New function.
* libecoff.h (_bfd_ecoff_bfd_is_local_label): Declare.
	* elf32-mips.c (mips_elf_is_local_label): New static function.
	(bfd_elf32_bfd_is_local_label): Define.
PR 6978.
1995-07-05 16:31:07 +00:00
Ian Lance Taylor 9525b61b1b * configure.in: Use $ac_config_sub, not $configsub.
* configure: Likewise.
1995-07-05 14:34:12 +00:00
Ken Raeburn b6113657eb don't define FASCIST_FDOPEN for i386aix host 1995-07-05 09:47:20 +00:00
Ken Raeburn 8c69366021 autoconfiscation 1995-07-05 09:32:47 +00:00
Ian Lance Taylor 27b1ec9478 * archive.c (_bfd_construct_extended_name_table): If
BFD_TRADITIONAL_FORMAT is set, limit the length of all file names
	to ar_max_namelen.
	(bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call
	bfd_bsd_truncate_arname.
PR 6888.
1995-07-04 20:22:43 +00:00
Ian Lance Taylor e510074320 * archive.c (_bfd_write_archive_contents): Revert June 1 change. 1995-07-04 18:07:47 +00:00
Ian Lance Taylor b5279eb6a9 * elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
argument.
	* bfd-in.h (bfd_elf32_record_link_assignment): Update prototype.
	(bfd_elf64_record_link_assignment): Likewise.
	* bfd-in2.h: Rebuild.
PR 7164.
1995-07-04 17:43:05 +00:00
Ian Lance Taylor b176e1e92a * libelf.h (struct elf_link_hash_table): Add needed field. Remove
saw_needed field.
	* elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
	is an empty string, don't make a DT_NEEDED entry in the output
	file.  Record all DT_NEEDED entries found in input dynamic
	objects.
	(elf_link_output_extsym): Don't check saw_needed when issuing
	warnings.
	* elf.c (_bfd_elf_link_hash_table_init): Initialize needed, not
	saw_needed.
	(bfd_elf_get_needed_list): New function.
	* bfd-in.h (struct bfd_elf_link_needed_list): Define.
	(bfd_elf_get_needed_list): Define.
	* bfd-in2.h: Rebuild.
PR 7083.
1995-07-04 16:54:49 +00:00
Ian Lance Taylor 194fc93542 * ecoff.c (_bfd_ecoff_find_nearest_line): Also initialize
find_buffer and fdrtab_len fields of newly allocated
	find_line_info structure.
1995-07-04 16:23:58 +00:00
Jeff Law c40439a219 * som.c (hppa_som_gen_reloc_type): New argument "sym_diff",
nonzero when we're generating relocations for an expression
	using the difference of two symbols.  All callers changed.
	Handle difference of symbols for both R_HPPA and R_COMPLEX
	cases.
	(som_write_fixups): Handle R_COMP1, R_COMP2 and R_CODE_EXPR
	fixups.
1995-07-03 23:27:25 +00:00
Ian Lance Taylor 3a6eecd42f * ecoff.c (_bfd_ecoff_find_nearest_line): If we allocate
find_line_info, clear the fdrtab field.
1995-07-03 22:41:51 +00:00
Ian Lance Taylor 9fd10c34d0 x 1995-07-03 22:19:02 +00:00
Steve Chamberlain bd676d26ea Mon Jul 3 13:55:18 1995 Steve Chamberlain <sac@slash.cygnus.com>
* config.bfd (win32): New configuration.
	* configure.host (pe): Changed to i386win32.
	* config/i386pe.mh: Deleted.
	* config/i386win32.mh: New file.
1995-07-03 21:11:15 +00:00
Ian Lance Taylor 3004a68c46 * elfcode.h (elf_link_add_object_symbols): Permit common and
indirect symbols in weakdefs BFD_ASSERT.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Simplify
	BFD_ASSERT to permit some legal, but odd, cases.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
1995-07-03 17:57:25 +00:00
Ian Lance Taylor 30dc85f1b8 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Correct
BFD_ASSERT to handle __start_SECNAME symbols automatically defined
	by the linker.
	* elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
1995-07-03 17:05:56 +00:00
Ian Lance Taylor 8809320bb9 * Makefile.in: Rebuild dependencies.
(BFD32_BACKENDS): Add versados.o.
	(CFILES): Add pe-i386.c, pei-i386.c, and versados.c.
start-sanitize-arc
	(elf32-arc.o): New target.  This should be removed when
	elf32-arc.c can be added to CFILES.
end-sanitize-arc
1995-07-03 15:41:52 +00:00
Ian Lance Taylor be89267cfc * cofflink.c (_bfd_coff_generic_relocate_section): Cast base_file
to FILE * before using it.
	* stab-syms.c: Revert yesterday's patch.
1995-07-02 21:51:36 +00:00
Fred Fish 033d545b29 * stab-syms.c (stdio.h): Include prior to libaout.h, which
includes bfdlink.h, which now uses FILE.
1995-07-01 19:14:29 +00:00
Ken Raeburn 5cab016b72 removed unused elf_64_p field 1995-07-01 04:20:05 +00:00
Ken Raeburn b968e4f491 generate elf*-target.h from common elfxx-target.h source 1995-07-01 04:16:03 +00:00
Steve Chamberlain ece22cd04c Fri Jun 30 16:07:18 1995 Steve Chamberlain <sac@slash.cygnus.com>
* cofflink.c (_bfd_coff_generic_relocate_section): Compare
	the full text of .reloc or .edata section names.
1995-06-30 23:19:57 +00:00
Fred Fish d84d840f18 * cofflink.c (_bfd_coff_generic_relocate_section):
Remove extra '+'.
1995-06-30 22:53:13 +00:00
Steve Chamberlain 69b799dfd7 * coff-h8300.c (COFF_LONG_FILENAMES): Define. 1995-06-30 00:26:53 +00:00
Steve Chamberlain 89665c8562 Wed Jun 28 18:04:42 1995 Steve Chamberlain <sac@slash.cygnus.com>
* Makefile.in: versados.o is now conditionally built.
	* coffcode.h (add_data_entry): New function.
	(coff_write_object_contents): Clean up. Calculate
	data entries.
	* cofflink.c (_bfd_coff_generic_relocate_section):
	.reloc and .edata sections are IMAGE_BASED too.
	If there's a base_file then write out base information.
	* configure.host (i386-*-pe): New.
	* syms.c (coff_section_type): Only scan prefixes.
	* targets.c (bfd_target_vector): Versados is now conditionally
	built.
	* config/m68k-coff.mt: Build versados.o
	* hosts/i386pe.h: New file.
1995-06-29 01:17:58 +00:00
Jeff Law 6cb964d4ef * elf32-hpa.c (elf32_hppa_relocate_section): Close comment before
R_PARISC_DPREL21L handling.
1995-06-26 19:55:27 +00:00
Steve Chamberlain f4761bb244 * reloc.c (bfd_perform_relocation): Add case for -ve words. 1995-06-22 15:59:14 +00:00
Jeff Law 775d12552e * elf32-hppa.c (elf32_hppa_relocate_section): Don't try to apply a
relocation against an undefined symbols.
1995-06-21 19:14:39 +00:00
Steve Chamberlain 9eacc5c494 * versados.c: Second pass/rewrite. 1995-06-21 17:19:25 +00:00
Jeff Law 9fe4fade31 * elf32-hppa.c (elf32_hppa_size_stubs): Set the size of the stub
section if we get an error.
1995-06-18 03:39:23 +00:00
Jeff Law 9a6880571c * elf32-hppa.c (elf32_hppa_bfd_final_link_relocate): Don't mess
with the operands of an R_PARISC_DPREL21L relocation if the insn
        is not "addil <symbol>,%r27".
1995-06-17 15:43:06 +00:00
Stan Shebs 018dafca8a * bfd-in.h (NT_subsystem, NT_stack_heap): Declare but don't
define.
	* bfd-in2.h: Rebuilt.
	* bfd.c (NT_subsystem, NT_stack_heap): Define.
1995-06-16 22:08:26 +00:00
Jeff Law 31dabb6cc9 * elf32-hppa.c (elf32_hppa_bfd_link_link_relocate): Use the right
type field (there are two!) when checking to see if $global$ is
	defined.
1995-06-16 06:09:07 +00:00
Stan Shebs e0151f38e1 * bfd-in.h, bfd-in2.h (bfd_boolean): Rename bfd_true, bfd_false
to bfd_tttrue, bfd_fffalse so as not to conflict with functions.
	* coffswap.h (coff_swap_scnhdr_out): Remove version that was
	hacked for MPW C.
	* mpw-config.in: Set shell vars instead of pasting to makefile
	for each configuration, edit coffswap.h to make MPW C not choke.
	(i386-unknown-coff, sh-hitachi-hms): Recognize.
	* mpw-make.in (BFD_LIBS): Add versados.c.o.

	* versados.c (versados_scan): Properly cast results from bfd_alloc.
1995-06-15 21:18:17 +00:00
Jeff Law 080f1fcb8b * bfd-in.h (bfd_set_section_vma): Case true to a boolean.
(bfd_set_cacheable): Likewise.
	* bfd-in2.h: Rebuilt.
1995-06-12 18:12:00 +00:00
Jeff Law 6167a840e5 * targets.c: Add copy_private_symbol_data and link_split_section
to the target vector.
	* libbfd-in.h (_bfd_generic_bfd_copy_private_symbol_data): Define.
	(_bfd_nolink_bfd_link_split_section): Likewise.
	(bfd_generic_link_split_section): Declare.
	* syms.c (bfd_copy_private_symbol_data): Define.
	* linker.c (bf_link_split_section): Likewise.
	* som.c (som_bfd_copy_private_symbol_data): New function
	(som_bfd_link_split_section): Likewise.
	* All other targets updated with default versions of new routines.

	* Take out my braindamaged bfd_true/bfd_false changes from earlier
	today.  Replace with just:
	* bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if
	compiling with g++-2.6 or later.
	* bfd-in2.h: Rebuilt.
1995-06-10 00:05:51 +00:00
Jeff Law 9f28686c2b * bfd-in.h (bfd_true, bfd_false): Define these to true and false
if TRUE_FALSE_ALREADY_DEFINED is not defined.
        * bfd-in2.h: Rebuilt.
1995-06-09 19:40:00 +00:00
Steve Chamberlain d1ec549d7b * elfcode.h (elf_sort_hdrs): Rewrite to be symmetrical. 1995-06-09 19:21:47 +00:00
Jeff Law 3b1f83adad * bfd-in.h: (TRUE_FALSE_ALREADY_DEFINED): Define this if
compiling with g++-2.6 or later.
        (bfd_set_section_vma): Use bfd_true and bfd_false rather than
        true and false.
        (bfd_set_section_alignment): Likewise.
        (bfd_set_section_userdata): Likewise.
        (bfd_set_cacheable): Likewise.
        * bfd-in2.h: Rebuilt.
1995-06-09 19:16:33 +00:00
Steve Chamberlain e6304bc755 * versados.c (struct esd, get_4): Lint; use unsigned chars. 1995-06-09 15:24:09 +00:00
Steve Chamberlain 9ff2fb3d25 * coff-i960.c (coff_i960_relocate): Compare output section names
when converting for vxworks.
1995-06-09 14:57:17 +00:00
Ken Raeburn 0ef449dfad * elfcode.h (elf_fake_sections): Permit .scommon or COMMON sections as random
SHT_NOBITS sections, in case a linker script is strange.
1995-06-08 20:12:25 +00:00
Ken Raeburn 9e1b4d5750 Linker support for m68k-elf from Andreas Schwab
<schwab@issan.informatik.uni-dortmund.de>:

* elfcode.h (elf_link_add_object_symbols): Check for NULL when looping through
the symbol hashes.
(elf_bfd_final_link): When looking for _init and _fini don't use the symbol if
it is imported from another object.

* elf32-m68k.c: Relocation type changed from REL to RELA.  Regular and dynamic
linking support functions added, similar to other elf targets.
1995-06-05 07:04:51 +00:00
Ken Raeburn 1be0c30e50 change i386-gnu to elf 1995-06-05 06:36:11 +00:00
Steve Chamberlain c3c112fc84 *** empty log message *** 1995-06-03 02:26:19 +00:00
Steve Chamberlain fa29f969c1 Thu Jun 1 13:51:49 1995 Steve Chamberlain <sac@slash.cygnus.com>
* coffcode.h (sec_to_styp_flags, styp_to_sec_flags,
	coff_new_section_hook):  Any section that starts ".stab"
	is now marked as debugging.
1995-06-01 22:20:30 +00:00
Ken Raeburn db88e79a6a * archive.c (_bfd_write_archive_contents): Disable extended name table until it
can be made optional, so that native AR has half a chance on SunOS and HP/UX.
[PR binutils/6888]
1995-06-01 20:22:53 +00:00
Ken Raeburn 45fb9cd1ee * linker.c (_bfd_generic_link_output_symbols, case bfd_link_hash_indirect): Add
cast to correct pointer types.
1995-06-01 20:17:12 +00:00
Steve Chamberlain a3444c4926 Wed May 24 10:52:01 1995 Steve Chamberlain <sac@slash.cygnus.com>
pr ld/6997

	* elf32-i386.c (elf_i386_relocate_section): Give error
	message when linking to a shared reloc which isn't there.

Wed May 24 10:40:00 1995  Steve Chamberlain  <sac@slash.cygnus.com>

	Support for ARM-PE.

	* Makefile.in, coffcode.h, config.bfd, configure.in, pe-arm.c,
	 pei-arm.c, reloc.c, targets.c, config/arm-pe.mt:
	 Support for ARM COFF/PE.
1995-05-24 18:14:23 +00:00
Jeff Law 58c56c60ca * Makefile.in: Install bfdlink.h too. 1995-05-23 22:01:20 +00:00
Steve Chamberlain 7cdedb42c1 * coffswap.h: (IMAGE_BASE): Define to 0 if not. 1995-05-19 17:01:27 +00:00
Ken Raeburn ff15324f63 Bunch of changes from Richard Earnshaw for generic bi-endian ARM aout targets.
Details in change logs.
1995-05-18 22:21:18 +00:00
Jim Kingdon 8558c4e316 * libbfd.c (bfd_stat): If bfd_cache_lookup returns an error,
return an error to the caller.  Call bfd_set_error on errors.
1995-05-18 05:20:37 +00:00
Steve Chamberlain b297038d0b Thu May 11 16:43:14 1995 Steve Chamberlain <sac@slash.cygnus.com>
tekhex.c (first_phase): Understand type 0 symbols.
	(tekhex_write_object_contents): Fix typo in final record.

Thu May 11 16:43:14 1995  Steve Chamberlain  <sac@slash.cygnus.com>

	pr ld/6840

	* coff-i960.c (optcall_callback): don't try and optimize
	undefined refs.
	(coff_write_relocs): Search for broken relocs on the way
	out and fix them up.
	(coff_renumber_symbols): Calculate and return index of
	first undefined symbol.
	(coff_write_object_contents): Call coff_renumber_symbols
	and coff_write_relocs with the new args.
	* libcoff.h: (coff_renumber_symbols, coff_renumber_symbols):
	Modified prototypes.

Thu May 11 16:43:14 1995  Steve Chamberlain  <sac@slash.cygnus.com>
			  Tom Griest <griest@cs.yale.edu>

	Initial support for PE format.

	* Makefile.in, targets.c, configure.in, config.bfd:
	Add support for i386-*-winnt and i386-*-pe.
	* archive.c (do_slurp_coff_armap):  Understand NTPE format
	archives.
	(_bfd_slurp_extended_name_table): Turn \ in a filename
	into /.
	* bfd-in.h (bfd_link_subsystem, _bfd_link_stack_heap): New.
	* coff-i386.c  (howto_table): Conditionalize PCRELOFFSET.
	* coffcode.h (IMAGE_BASE): New.
	(coff_compute_section_file_positions): Throw away .junk
	sections for PE, align symbols.
	(coff_write_object_contents): Throw away .junk sections
	for PE. Remember info on .idata and .rsrc sections.
	Fill in the PE header.
	(coff_slurp_symbol_table): PE uses C_SECTION class.
	* cofflink.c (_bfd_coff_final_link): Keep PE info up to date.
	(_bfd_coff_generic_relocate_section): Cope with PE relocs.
	* coffswap.h (coff_swap_{aout/file/scn/sym}hdr_{in/out}):
	New code for PE headers.
1995-05-13 18:03:25 +00:00
Michael Meissner c7b44b0425 Add little endian PowerPC support. 1995-05-09 21:07:06 +00:00
Jason Molenda 0c3c868b2b * hosts/std-host.h: #include ansidecl.h 'cause PTR is used in
std-host.h.
1995-04-25 18:07:43 +00:00
Michael Meissner 423b654e17 Provide escape hatch for HAVE_PROCFS being defined. 1995-04-24 14:38:05 +00:00
Michael Meissner a96c03cca5 Do not continue processing unknown symbols. 1995-04-24 12:41:37 +00:00