Commit Graph

1374 Commits

Author SHA1 Message Date
Chris Demetriou afdbd6d03b [ bfd/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@demetriou.com>

	* elf32-mips.c (_bfd_mips_elf_hi16_reloc): Handle PC-relative
	relocations properly.

[ gas/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@broadcom.com>

	* config/tc-mips.c (HAVE_32BIT_ADDRESSES): If compiling embedded
	PIC code, assume pointers the same size as GPRs.
	(macro): In M_LA_AB handling for embedded PIC code, support
	"la $treg,foo-bar($breg)".  In load/store handling
	(label ld_st) support "<op> $treg,<sym>-<local_sym>($breg)"
	which is used by the compiler for switch statements.
	In load/store double multi-instruction macro handling
	(label ldd_std) add a comment that no special handling
	is currently done for embedded PIC.
	(mips_ip): In 'o' (16-bit offset) case, only accept 16
	bit offsets.

[ gas/testsuite/ChangeLog ]
2001-10-31  Chris Demetriou  <cgd@broadcom.com>

	* gas/mips/empic.s: Undo damage inflicted on 2000-12-02.
	* gas/mips/empic.d: Likewise.
	* gas/mips/elempic.d: Likewise (it was copied into other files).
	* gas/mips/telempic.d: Likewise.
	* gas/mips/tempic.d: Likewise.

	* gas/mips/empic2.s: New test to check new 'la' and 'lw' (and
	related ops) syntax, test loads with large offsets.
	* gas/mips/emcic2.d: Likewise.
	* gas/mips/mips.exp: Run the new test on ELF platforms.
2001-11-01 01:33:47 +00:00
Alan Modra 0a299a95a8 daily update 2001-10-31 23:00:35 +00:00
H.J. Lu 2cd533b769 2001-10-31 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_output_extsym): Don't clear the visibility
	field for relocateable.
2001-10-31 16:42:48 +00:00
Alan Modra 4e12ff7fc2 Revert previous delta, instead do this.
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Don't count
	.plt relocs in DT_RELASZ.
2001-10-31 15:32:09 +00:00
Alan Modra 4578e0a726 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Set DT_RELASZ
whenever DT_PLTRELSZ.
2001-10-31 14:58:14 +00:00
Nick Clifton 7649aa5088 Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu targets 2001-10-31 09:50:09 +00:00
Nick Clifton a53ecf01a5 Fix typo: bfd_mmo_mmix_vec => bfd_mmo_vec. 2001-10-31 09:01:50 +00:00
Hans-Peter Nilsson ed73733d7d Remove #if 0 around bfd_mmo_mmix_vec 2001-10-31 03:08:59 +00:00
Hans-Peter Nilsson e06fcc8615 Split file by ^L:s as in original submitted patch 2001-10-31 03:07:48 +00:00
Alan Modra 6180d2b004 daily update 2001-10-30 23:01:01 +00:00
Nick Clifton 3c3bdf30e4 Add MMIX support 2001-10-30 15:20:14 +00:00
Nick Clifton f5ffc9190a If the LMA for a segment is known, use it for matching sections to segments.
Use the LMA when adjusting for inter-section alignment padding.
2001-10-30 11:40:28 +00:00
Nick Clifton e0e8c97fe9 Set the LMA based on the p_paddr of the segment that contains it. 2001-10-30 11:34:46 +00:00
Alan Modra 3109ff8fb4 daily update 2001-10-29 23:00:04 +00:00
Kazu Hirata 5b74f489cb * README: Fix a typo. 2001-10-29 22:29:59 +00:00
Kazu Hirata fe03258071 * bfdsumm.texi: Fix a typo. 2001-10-29 22:26:12 +00:00
Alan Modra cdf1fe3060 daily update, a bit late.. 2001-10-29 04:00:48 +00:00
Alan Modra 04820a4664 daily update 2001-10-27 23:00:06 +00:00
Nick Clifton 07d8a8910a Change footer to refer to FSF. Change subtitle to refer to original creation date. 2001-10-27 07:31:26 +00:00
Alan Modra a05798b13e daily update 2001-10-27 00:00:04 +00:00
Alan Modra aaaaf2ae5d daily update 2001-10-26 00:00:04 +00:00
Richard Henderson 0b6488e20b * peXXigen.c (_bfd_XX_print_private_bfd_data_common): Copy
timestamp to time_t for ctime.
2001-10-25 06:33:56 +00:00
Alan Modra cc7e8be27e daily update 2001-10-25 00:00:03 +00:00
Hans-Peter Nilsson 908d94bfcd * elf32-cris.c (cris_reloc_type_lookup): Change loop to use
unsigned, increasing index.
2001-10-24 03:39:54 +00:00
Alan Modra db328227fa daily update 2001-10-24 00:00:35 +00:00
H.J. Lu 1b58be7e74 2001-10-23 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_modify_segment_map): Check
	m != NULL before accessing it.
2001-10-23 20:24:23 +00:00
Alan Modra ce757d1518 * elflink.h (elf_link_input_bfd): Zero the reloc instead of doing
bfd_reloc_type_lookup (bfd, BFD_RELOC_NONE) as bfd_reloc_type_lookup
	doesn't accept BFD_RELOC_* on some targets, eg. hppa.

	* elf32-hppa.c (elf32_hppa_link_hash_entry): Remove plt_abs.
	(hppa_link_hash_newfunc): Likewise.
	(elf32_hppa_finish_dynamic_symbol): Likewise.
	(allocate_dynrelocs): Always allocate .got relocs if shared.
	(elf32_hppa_relocate_section): Output them too.  Similarly
	consolidate .plt reloc code, and no longer initialise .plt
	when a reloc is output.
	(elf32_hppa_finish_dynamic_symbol): Only initialise .plt entries
	when no reloc is output.

	From Herbert Xu <herbert@gondor.apana.org.au>
	* elf32-hppa.c (final_link_relocate): Call bfd_set_error for
	unreachable branches.
2001-10-23 03:55:24 +00:00
Alan Modra 806203e6cb daily update 2001-10-23 00:00:04 +00:00
H.J. Lu ca51bffffb 2001-10-22 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Use -L../libiberty for
	mips*-*-linux*.
	* configure: Rebuild.
2001-10-22 18:45:35 +00:00
H.J. Lu 78be1d6e75 2001-10-21 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
	if shared library is enabled only for Linux hosts.
	* configure: Rebuild.
2001-10-22 00:40:48 +00:00
Alan Modra c85828c515 daily update 2001-10-22 00:00:04 +00:00
H.J. Lu 1b90af266c 2001-10-21 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Check if PICFLAG is defined in
	../libiberty/Makefile instead of $enable_shared.
	* configure: Rebuild.
2001-10-21 17:14:08 +00:00
H.J. Lu ebe7507a64 2001-10-21 H.J. Lu <hjl@gnu.org>
* elf32-cris.c (cris_reloc_type_lookup): Use int for index.
2001-10-21 07:23:24 +00:00
H.J. Lu 3969176296 2001-10-20 H.J. Lu <hjl@gnu.org>
* configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
	if shared library is enabled.
	* configure: Rebuild.
2001-10-21 06:51:03 +00:00
Alan Modra 7ba87d746b daily update 2001-10-21 00:00:04 +00:00
H.J. Lu 6a7805b5c0 2001-10-20 H.J. Lu <hjl@gnu.org>
* elf32-cris.c (cris_reloc_type_lookup): Allow index 0.
2001-10-20 23:16:17 +00:00
Alan Modra e1a0bf5185 daily update 2001-10-20 00:00:06 +00:00
H.J. Lu e0740195c7 2001-10-19 H.J. Lu <hjl@gnu.org>
* elfcode.h (elf_object_p): Don't clear D_PAGED if the section
	size is empty.
2001-10-19 16:29:12 +00:00
H.J. Lu 7595d19387 2001-10-18 H.J. Lu <hjl@gnu.org>
* elf32-i370.c (i370_elf_relocate_section): Ignore R_XXX_NONE.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2001-10-19 02:11:04 +00:00
Alan Modra 6c5108aec9 daily update 2001-10-19 00:00:04 +00:00
Jakub Jelinek 25263aad5c * section.c (_bfd_strip_section_from_output): Don't count
SEC_EXCLUDE sections as references.  Set SEC_EXCLUDE.
2001-10-18 08:22:44 +00:00
Alan Modra c080b94227 daily update 2001-10-18 00:00:04 +00:00
Alan Modra 973ffd6335 * elf-m10200.c (mn10200_elf_relax_section): Cast assignment to
Elf_Internal_Shdr.contents now that it's no longer a PTR.
	* elf-m10300.c (mn10300_elf_relax_section): Likewise.
	* elf32-h8300.c (elf32_h8_relax_section): Likewise.
	* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
	* elf32-sh.c (sh_elf_relax_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relax_section): Likewise.
	* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
	* elf.c (setup_group): Warning fixes.
	* elflink.h (elf_link_sort_relocs): Likewise.
	* pdp11.c (slurp_reloc_table): Likewise.
2001-10-17 12:01:05 +00:00
Jeff Holcomb df22989b95 2001-10-16 Jeff Holcomb <jeffh@redhat.com>
* elflink.h (elf_link_sort_relocs): Remove unnecessary pointer
        casts.
2001-10-17 01:44:10 +00:00
Alan Modra fe68b33ddb daily update 2001-10-17 00:00:04 +00:00
H.J. Lu 1e09179fb7 2001-10-15 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE
	for relocations against discarded link-once section.
2001-10-16 06:33:52 +00:00
Alan Modra f45a6ffc19 daily update 2001-10-16 00:00:05 +00:00
Alan Modra cf5c0c5bc6 * elf32-i386.c (elf_i386_relocate_section): Report some detail on
bfd_reloc_outofrange and similar errors.
2001-10-15 12:58:48 +00:00
Alan Modra 1e370bd243 * elf.c (_bfd_elf_link_hash_copy_indirect): Test ind->root.type
rather than ind->weakdef.
	* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
	* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
	* elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
	* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
2001-10-15 09:45:48 +00:00
Alan Modra bbd7ec4a06 * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Merge dyn_reloc
counts for aliases instead of aborting.
	* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.

	* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set plt.offset
	to -1 for non-function symbols.
	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
	* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
	* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
	* elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Refer to
	plt.offset instead of plt.refcount when setting to -1.
2001-10-15 07:28:45 +00:00
Alan Modra 616f309768 daily update 2001-10-15 01:16:16 +00:00
Alan Modra 07a796b857 daily update 2001-10-14 00:00:05 +00:00
Alan Modra 7e295ae4db daily update 2001-10-13 00:00:11 +00:00
Nick Clifton 6a360bf4f9 Treat R_ARM_THM_PC22 like R_ARM_PC24. 2001-10-12 11:16:21 +00:00
Alan Modra d4b77c5671 daily update 2001-10-12 00:00:09 +00:00
Alan Modra b58266b5a9 daily update 2001-10-11 00:00:06 +00:00
Jakub Jelinek 290394d607 * elflink.h (elf_link_sort_cmp2): Don't mix PLT and non-PLT
relocations against the same symbol in .rel{,a}.dyn section.
2001-10-10 19:32:02 +00:00
Kazu Hirata 08da05b004 * aout-encap.c: Fix comment typos.
* aoutx.h: Likewise.
	* archive.c: Likewise.
	* bout.c: Likewise.
	* coff64-rs6000.c: Likewise.
	* coffcode.h: Likewise.
	* coffgen.c: Likewise.
	* cofflink.c: Likewise.
	* coff-mips.c: Likewise.
	* ecoff.c: Likewise.
	* elf32-m32r.c: Likewise.
	* libcoff-in.h: Likewise.
	* libecoff.h: Likewise.
	* libxcoff.h: Likewise.
	* nlm32-i386.c: Likewise.
	* pdp11.c: Likewise.
	* section.c: Likewise.
	* som.c: Likewise.
	* som.h: Likewise.
	* bfd-in2.h: Regenerate.
	* libcoff.h: Likewise.
2001-10-10 12:08:29 +00:00
Alan Modra 079e9a2ffe * elf.c (elf_map_symbols): Don't create new section symbols; Use
existing section syms.  Update comments.
	(copy_private_bfd_data): Formatting fixes.
	(elfcore_grok_win32pstatus): Likewise.
	(swap_out_syms): Likewise.  Remove unnecessary level of braces.
2001-10-10 11:19:54 +00:00
Alan Modra f42a25be0a daily update 2001-10-10 00:00:08 +00:00
Alan Modra 945906ff86 * elf-bfd.h (struct bfd_elf_section_data): Rename "group" to
"group_name".
	(elf_group_name): Define.
	(elf_next_in_group): Define.
	* elf.c: Make use of elf_group_name and elf_next_in_group throughout.
	(setup_group): Don't use sec->lineno for SHT_GROUP section to store
	first member section; Instead use elf_next_in_group.
	(bfd_section_from_shdr): Likewise.
	(set_group_contents): Likewise.  Use elf_section_syms, not sec->symbol.
2001-10-09 13:12:19 +00:00
Alan Modra dbb410c3e2 * elf-bfd.h (struct bfd_elf_section_data): Add "group" and
"next_in_group".  Fix gp and gp_size comments.
	* elf.c (union elf_internal_group): New.
	(setup_group): New function.
	(_bfd_elf_make_section_from_shdr): Set BFD flags for SHT_GROUP.
	Call setup_group for SHF_GROUP sections.
	(bfd_section_from_shdr): Build a BFD section for SHT_GROUP.
	(elf_fake_sections): Set header type for SEC_GROUP, and header
	flags for sections in a group.
	(set_group_contents): New function.
	(_bfd_elf_compute_section_file_positions): Call it.
	(assign_section_numbers): Set sh_link for SHT_GROUP.
	* elflink.h (gc_mark_hook): Handle section groups.
	* elfxx-target.h: Add SEC_GROUP to applicable_flags.
	* section.c (SEC_GROUP): Define.
	(struct sec): Comment fixes.
	* bfd-in2.h: Regenerate.

	* elf.c (bfd_elf_print_symbol): Formatting fix; migrate expression
	out of function args.
	(_bfd_elf_canonicalize_reloc): Similarly.
	(_bfd_elf_get_symtab): Here too.
	(_bfd_elf_canonicalize_dynamic_symtab): And here.
	* elfcode.h (elf_slurp_symbol_table): Don't recalculate size for
	bfd_bread, and remove unnecessary cast.
2001-10-09 06:05:17 +00:00
Aldy Hernandez 24c603fab2 * bfd/config.bfd (targ_cpu): Add arm9e-*-elf. 2001-10-08 19:11:36 +00:00
Alan Modra 7f0b3a8f8d daily update 2001-10-07 00:00:06 +00:00
Stephane Carrez 3f5864e1f4 * dwarf2.c (comp_unit_find_nearest_line): Check for end of
compilation unit.
2001-10-06 10:01:09 +00:00
Alan Modra aec2f56188 * bfd.c (bfd_assert): Report bfd version.
(_bfd_abort): Likewise.
2001-10-06 07:40:44 +00:00
Alan Modra 50b4d48631 * elflink.h (elf_link_input_bfd): Don't zero discarded link-once
section sym values.  Instead replace any relocs against them with
	relocs against STN_UNDEF, which has a zero value.
2001-10-06 07:25:40 +00:00
Alan Modra fb9ceeac4e * elf32-arc.c (elf_arc_howto_table): Set partial_inplace for all
relocs.
2001-10-06 06:41:47 +00:00
Alan Modra 55e369b374 daily update 2001-10-06 00:00:07 +00:00
Jeff Law 1761749581 * som.h (som_exec_data): New field "version_id".
* som.c (som_object_setup): Record the version_id if it
        exists.
        (som_prep_headers): Do not initialize version_id here.
        (som_finish_writing): Initialize version_id here.
2001-10-05 21:55:12 +00:00
Thiemo Seufer 7e766c3b49 * elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos
according to the MIPS/SGI ELF64 ABI Draft.
	(mips_elf_sort_hash_table): Typo.
2001-10-05 16:14:39 +00:00
Alan Modra 5abe4e058f daily update 2001-10-05 00:00:06 +00:00
Alan Modra 8ea52284ab Fix a comment typo in last commit. 2001-10-04 16:18:32 +00:00
Alan Modra 58e3d09d2a * elf32-mips.c (_bfd_mips_elf_copy_indirect_symbol): Bail out after
copying flags if this is a weakdef.
2001-10-04 16:09:03 +00:00
Alan Modra d828d54ea4 somehow missed committing this.
* dep-in.sed: Remove symcat.h from dependencies.
2001-10-04 15:37:38 +00:00
Alan Modra a90b9fca6f * elf-bfd.h (struct elf_link_hash_entry): Reorganise for better
packing.
2001-10-04 12:30:26 +00:00
Alan Modra 3a6b859720 * elf32-mips.c (mips_elf_record_global_got_symbol): Set got.offset
to 1 rather than 0 to avoid confusing copy_indirect_symbol.
	(mips_elf_sort_hash_table_f): Compare got.offset against 1.
2001-10-04 05:50:29 +00:00
Alan Modra b13c7b49d6 * Makefile.am (BFD_H_DEPS): Add symcat.h. Ensure everything
depends on $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS), not just those
	backends we configure.  Run "make dep-am".
	(install-data-local): Install symcat.h.
	* dep-in.sed: Remove symcat.h from dependencies.
	* Makefile.in: Regenerate.
2001-10-04 05:40:43 +00:00
Alan Modra ad681e7b5f daily update 2001-10-04 00:03:26 +00:00
Alan Modra 8bd621d883 Add support for -z nocopyreloc. 2001-10-03 15:11:48 +00:00
Thiemo Seufer 1e2be829b6 * elf64-mips.c (elf_backend_may_use_rela_p): New define.
(elf_backend_default_use_rela_p): New define.
2001-10-03 14:12:12 +00:00
Alan Modra 57c7194e0e * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Fix typos in last
change.
2001-10-03 13:16:18 +00:00
Alan Modra 87b632fc07 bfd/ChangeLog
* configure.in (AC_OUTPUT <bfd-in3.h>): Remove version.h.
	* configure: Regenerate.
	* Makefile.am (BFD_H_FILES): Add version.h.
	* Makefile.in: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.

bfd/doc/ChangeLog
	* Makefile.am (BFD_H_DEP): Add ../version.h.
	* Makefile.in: Regenerate.
2001-10-03 12:29:10 +00:00
Alan Modra 0a991dfe0d * elflink.h (elf_fix_symbol_flags): Copy flags to weakdef using
elf_backend_copy_indirect_symbol so that backend has a chance to
	copy other necessary fields.
	* elf-bfd.h (struct elf_backend_data): Update description of
	elf_backend_copy_indirect_symbol.
	* elf.c (_bfd_elf_link_hash_copy_indirect): Bail out after
	copying flags if this is a weakdef.
	* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
	(elfNN_ia64_aix_add_symbol_hook): Use elf_link_hash_lookup rather
	than bfd_link_hash_lookup.
	* elf32-i386 (elf_i386_adjust_dynamic_symbol): Don't do copy
	reloc processing for weakdefs.
	* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
2001-10-03 08:33:18 +00:00
Alan Modra 7997c6eaf4 daily update 2001-10-03 02:02:26 +00:00
Nick Clifton ea04a8f6ec Fix (for the last time, I hope) handling of R_ARC_B22_PCREL. 2001-10-02 14:28:42 +00:00
Alan Modra a33d1f7775 * elf64-ppc.c (ppc64_elf_check_relocs): Use a local var and cast
result of ELF64_R_TYPE to enum before using in a switch.
	(ppc64_elf_gc_mark_hook): Likewise.
	(ppc64_elf_gc_sweep_hook): Likewise.
	(ppc64_elf_reloc_type_class): Likewise.
2001-10-02 09:22:46 +00:00
Alan Modra 8c96f6f4c8 * Makefile.in: Regenerate. 2001-10-02 05:59:30 +00:00
Alan Modra e43d48ccc3 * version.h: New file.
* bfd-in.h: (BFD_VERSION): Substitute bfd_version.
	(BFD_VERSION_DATE): Define.
	(BFD_VERSION_STRING): Define.
	* configure.in: AC_SUBST bfd_version, bfd_version_date and
	bfd_version_string.
	(AC_OUTPUT <bfd-in3.h>): Depend on version.h.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* Makefile.am: Run "make dep-am"
	* Makefile.in: Regenerate.

	* bfd-in.h: Include "symcat.h".
	(CONCAT4): Redefine as for old CAT4.
	* aout-arm.c: Use equivalent CONCAT* macro in place of CAT* macros.
	Add warning regarding whitespace.
	* aout-cris.c: Likewise.
	* aout-ns32k.c: Likewise.
	* aout-sparcle.c: Likewise.
	* aout-tic30.c: Likewise.
	* aout0.c: Likewise.
	* armnetbsd.c: Likewise.
	* demo64.c: Likewise.
	* elf-bfd.h: Likewise.
	* gen-aout.c: Likewise.
	* host-aout.c: Likewise.
	* hp300bsd.c: Likewise.
	* hp300hpux.c: Likewise.
	* i386aout.c: Likewise.
	* i386bsd.c: Likewise.
	* i386dynix.c: Likewise.
	* i386freebsd.c: Likewise.
	* i386linux.c: Likewise.
	* i386lynx.c: Likewise.
	* i386mach3.c: Likewise.
	* i386netbsd.c: Likewise.
	* libaout.h: Likewise.
	* m68k4knetbsd.c: Likewise.
	* m68klinux.c: Likewise.
	* m68klynx.c: Likewise.
	* m68knetbsd.c: Likewise.
	* m88kmach3.c: Likewise.
	* mipsbsd.c: Likewise.
	* newsos3.c: Likewise.
	* ns32knetbsd.c: Likewise.
	* pc532-mach.c: Likewise.
	* pdp11.c: Likewise.
	* riscix.c: Likewise.
	* sparclinux.c: Likewise.
	* sparclynx.c: Likewise.
	* sparcnetbsd.c: Likewise.
	* sunos.c: Likewise.
	* targets.c: Likewise.
	* vaxnetbsd.c: Likewise.
	* vms-hdr.c: Likewise.
2001-10-02 05:58:41 +00:00
Alan Modra 4eef72c77d bfd/
* bfd-in.h: Remove comments regarding generated files.
	* libbfd-in.h: Likewise.
	* libcoff-in.h: Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Likewise.
	* libcoff.h: Likewise.
bfd/doc/
	* header.sed: New file, adds header to generated files.
	* Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and
	bfd.h, using above.  Add missing elf.c dependecy for libbfd.h.
	* Makefile.in: Regenerate.
2001-10-01 14:03:36 +00:00
Hans-Peter Nilsson 146be91a2b * elf32-sh.c (sh_elf_howto_table, R_SH_REL32): Make
partial_inplace, matching assembler output.  Set src_mask to
	all ones.
	(sh_elf_relocate_section): Delete misplaced comment.
	For relocatable linking against section symbol, call
	_bfd_relocate_contents for partial_inplace relocs and adjust
	rel->r_addend for others.
	<case R_SH_DIR32, R_SH_REL32>: Fetch partial_inplace addend with
	bfd_get_32, not at rel->r_addend.
2001-10-01 00:16:27 +00:00
Alan Modra 3c3e9281c3 * elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to
the old dir refcount, so we indirectly set them to init_refcount.
	Short-circuit asserts when we've just verified they are true.
2001-09-30 03:03:11 +00:00
Alan Modra 862517b650 * section.c (struct sec): Remove kept_section.
(STD_SECTION): Remove kept_section initialisation.
	(bfd_make_section_anyway): Here too.
	* ecoff.c (bfd_debug_section): Remove kept_section initialisation.
	* cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
	* elflink.h (elf_link_input_bfd): Set discarded link-once section
	symbols to zero, and remove all code involved with kept_section
	and tracking section symbol values.
	* bfd-in2.h: Regenerate.
	* configure.in: Bump version number.
	* configure: Regenerate.

	* ldlang.c (section_already_linked): Remove assignment to kept_section.
2001-09-29 12:07:01 +00:00
Alan Modra 65f38f15bf * elf64-ppc.c (struct ppc_dyn_relocs): New.
(IS_ABSOLUTE_RELOC): Define.
	(struct ppc_link_hash_entry): New.
	(struct ppc_link_hash_table): New.
	(ppc_hash_table): Define.
	(link_hash_newfunc): New function.
	(ppc64_elf_link_hash_table_create): New function.
	(create_got_section): New function.
	(ppc64_elf_create_dynamic_sections): Call create_got_section.  Stash
	pointers to our dynamic sections in hash table.
	(ppc64_elf_copy_indirect_symbol): New function.
	(ppc64_elf_check_relocs): Remove DEBUG code.  Use short-cuts to
	dynamic sections.  Localise vars.  Modify code for refcounts
	starting from zero.  Don't allocate here, or force symbols dynamic.
	Don't copy all relocs if shared, select ones we need.  Add code
	to track possible copy relocs for non-shared link.
	(ppc64_elf_gc_mark_hook): Update comment.
	(ppc64_elf_gc_sweep_hook): Sweep dynrelocs too.
	(ppc64_elf_adjust_dynamic_symbol): Remove DEBUG code.  Rewrite .plt
	code for reference counting garbage collection.  Don't create .plt
	entries for functions that don't comply with ABI naming convention,
	and don't allocate .plt space here.  Use short-cuts to dynamic
	sections.  If possible, keep dynamic relocations instead of using
	copy relocs.  Remove confused comments.
	(ppc_adjust_dynindx): Delete.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
	(allocate_dynrelocs): New function.
	(readonly_dynrelocs): New function.
	(ppc64_elf_size_dynamic_sections): Rewrite.  Allocate local .got
	space here, and call allocate_dynrelocs to allocate space for
	global .plt, .got and reloc sections.  Use short-cuts to dynamic
	sections.  Call readonly_dynrelocs to determine whether we need
	DT_TEXTREL.  Don't generate section symbols here, the generic
	ELF linker code does it for us.
	(ppc64_elf_final_link): Call regular ELF backend linker rather than
	gc variety, since we do our own .got handling.
	(ppc64_elf_relocate_section): Remove DEBUG code.  Make use of
	dynamic section short-cuts.  Localise vars, and delay setting.
	Handle unknown relocs in main switch statement.  Replace ugly
	complicated tests for unresolvable relocs with a simple direct
	scheme using "unresolved_reloc" var.  Test ELF_ST_VISIBILITY
	before allowing an undefined sym in a shared lib.  Do R_*_DS tests
	after main switch, when we've set addend.  Do non-addend insn
	tweaks before main swithc.  Ignore input_section->vma when
	calculating reloc offsets as it's always zero.  Rewrite dynamic
	reloc handling.  Consolidate R_*_HA handling.  Handle more relocs.
	(ppc64_elf_finish_dynamic_symbol): Remove DEBUG code.  Make use
	of dynamic section short-cuts.  Reorganise .plt handling code.
	Remove confused comments.  Take note of ELF_LINK_FORCED_LOCAL.
	Move expressions out of swap_reloca_out function calls.
	(ppc64_elf_reloc_type_class): New function.
	(ppc64_elf_info_to_howto): Move common expression to local var.
	(ppc64_elf_finish_dynamic_sections): Remove DEBUG code.  Make use
	of dynamic section short-cuts.  Don't fiddle with section syms
	here as the ELF linker does it for us.
	(elf_backend_can_refcount): Define.
	(bfd_elf64_bfd_link_hash_table_create): Define.
	(elf_backend_copy_indirect_symbol): Define.
	(elf_backend_reloc_type_class): Define.
	(elf_backend_*, bfd_elf64_bfd_* defines): Sort.
2001-09-29 06:49:16 +00:00
Alan Modra 51b64d56a7 * elf-bfd.h (struct elf_link_local_dynamic_entry): Add init_refcount.
(struct elf_backend_data): Add can_refcount.
	* elf.c (_bfd_elf_link_hash_newfunc): Get rid of a few casts.  Set
	got.refcount and plt.refcount from init_refcount.
	(_bfd_elf_link_hash_table_init): Set up init_refcount.
	(_bfd_elf_link_hash_copy_indirect): Reference got/plt.refcount
	rather than got/plt.offset, and test for <= 0 rather than -1.
	* elflink.h (size_dynamic_sections): Set init_refcount to -1.
	* elfxx-target.h (elf_backend_can_refcount): Define.
	(elfNN_bed): Init can_refcount.
	* linker.c (_bfd_link_hash_newfunc): Get rid of a few casts.
	(_bfd_generic_link_hash_newfunc): Likewise.
	* elf32-cris.c (cris_elf_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
	* elf32-hppa.c (elf32_hppa_check_relocs): Modify for refcounts
	starting from zero.
	(elf32_hppa_copy_indirect_symbol): Make static to agree with
	prototype.
	(elf_backend_can_refcount): Define.
	* elf32-i386.c (elf_i386_check_relocs): Modify for refcounts
	starting from zero.
	(allocate_dynrelocs): Set plt/got.offset rather than *.refcount.
	(elf_i386_finish_dynamic_symbol): Expand SHN_UNDEF comment.
	(elf_i386_finish_dynamic_sections): Use local var so line < 80 chars.
	(elf_backend_can_refcount): Define.
	(elf_i386_copy_indirect_symbol): Make static to agree with
	prototype.  Formatting fix.
	* elf32-m68k.c (elf_m68k_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
	* elf32-ppc.c (ppc_elf_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
	* elf32-s390.c (elf_s390_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
	* elf64-s390.c (elf_s390_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
	* elf64-x86-64.c (elf64_x86_64_check_relocs): Modify for refcounts
	starting from zero.
	(elf_backend_can_refcount): Define.
2001-09-29 06:21:59 +00:00
Alan Modra 21d17a588f * som.c (som_write_symbol_strings): Cast current_offset in
bfd_seek call to match param type.
2001-09-29 06:13:53 +00:00
Richard Henderson e0aae569d6 * elfxx-target.h [section_flags]: Add SEC_ARCH_BIT_0, SEC_SMALL_DATA,
SEC_MERGE, SEC_STRINGS.
2001-09-28 21:47:25 +00:00
Joel Brobecker 78ae4cb9c0 Document changes to som.c revision 1.22. 2001-09-28 21:36:18 +00:00
Joel Brobecker 982cfd7867 som_write_symbol_strings: Fix incorrect type of current_offset to match
the function definition. Fixes a build failure on HPUX-11.00.
2001-09-28 21:35:45 +00:00
Richard Henderson 65db3b0dbf * section.c (SEC_ARCH_BIT_0): New; replace unused SEC_BALIGN.
* bfd-in2.h: Rebuild.
2001-09-28 20:51:15 +00:00
Alan Modra ffaef15911 * elf64-x86-64.c (elf64_x86_64_reloc_type_lookup): Don't map bfd
reloc code using x86_64_reloc_map.
2001-09-28 12:54:53 +00:00
Alan Modra 3ac8354b40 * elf32-hppa.c (elf32_hppa_check_relocs): Update comment since we
no longer allocate here.  Localise some vars to blocks where they
	are used.
	(elf32_hppa_adjust_dynamic_symbol): Correct a comment.  Delay
	setting of vars until needed.
	(allocate_dynrelocs): Don't create a .plt entry without a reloc
	when symbol visibilty makes a function local.
	(elf32_hppa_finish_dynamic_symbol): Move expressions out of
	swap_reloca_out function calls.
	(elf32_hppa_relocate_section): Likewies.  Comment typo fix.
	(elf32_hppa_finish_dynamic_sections): Migrate common code out of
	switch statement.
2001-09-28 08:56:51 +00:00
Alan Modra 0ac8d2cabf * elf32-i386.c (elf_i386_check_relocs): Update comment since we
no longer allocate here.  Localise some vars to blocks where they
	are used.  Remove separate switch stmt for creating .got sec.
	(elf_i386_adjust_dynamic_symbol): Correct a comment.  Remove
	redundant casts and aborts.  Delay setting of vars until needed.
	(allocate_dynrelocs): Remove redundant casts and aborts.
	(elf_i386_size_dynamic_sections): Move comment.
	(elf_i386_finish_dynamic_symbol): Move expressions out of function
	calls.
	(elf_i386_relocate_section): Likewise.  Comment typo fix.
	(elf_i386_finish_dynamic_sections): Migrate common code out of
	switch statement.
	(elf_backend_* defines): Sort.
2001-09-27 16:18:42 +00:00
Alan Modra ced53ee5da * elf32-i386.c (allocate_dynrelocs): Don't create a .plt entry
without a reloc when symbol visibilty makes a function local.
2001-09-27 16:10:28 +00:00
Nick Clifton 06317a278f Revert most of previous delta. Do not call bfd_archive_filename on output
bfd, nor twice in one expression.
2001-09-27 13:49:27 +00:00
Nick Clifton 63b0f74538 Replace bfd_get_filename with bfd_archive_filename in error message.
Fix detection of conflicting float flags.
2001-09-27 07:49:27 +00:00
Alan Modra ebe50baeda * elf32-i386 (elf_i386_copy_indirect_symbol): New function.
(elf_backend_copy_indirect_symbol): Define.
	(struct elf_i386_link_hash_entry): Rename "root" to "elf".
	(struct elf_i386_link_hash_table): Likewise.
	(link_hash_newfunc): Get rid of unnecessary casts.
	(elf_i386_link_hash_table_create): Likewise.
	(elf_i386_check_relocs): Initialise local_got_refcounts to 0.
	Don't test input section SEC_READONLY here to try to avoid copy
	relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
	(elf_i386_adjust_dynamic_symbol): Check output section SEC_READONLY
	here to properly test whether we need copy relocs.  Do so for weak
	syms too.

	* elf32-hppa (elf32_hppa_copy_indirect_symbol): New function.
	(elf_backend_copy_indirect_symbol): Define.
	(struct elf32_hppa_link_hash_table): Rename "root" to "elf".
	(stub_hash_newfunc): Get rid of unnecessary casts.
	(hppa_link_hash_newfunc): Likewise.
	(elf32_hppa_check_relocs): Initialise local_got_refcounts to 0.
	Don't test input section SEC_READONLY here to try to avoid copy
	relocs, and keep dyn_relocs regardleas of ELF_LINK_NON_GOT_REF.
	(elf32_hppa_adjust_dynamic_symbol): Check output section SEC_READONLY
	here to properly test whether we need copy relocs.  Do so for weak
	syms too.
2001-09-26 09:25:04 +00:00
Alan Modra af6166c063 * bfd.c (_bfd_default_error_handlerl): Define using VPARAMS,
VA_OPEN, VA_FIXEDARG, VA_CLOSE.
	(bfd_archive_filename): Cast bfd_malloc arg to the correct size.
2001-09-26 01:53:25 +00:00
Jakub Jelinek e62de969f0 * elf64-sparc.c (sparc64_elf_build_plt): Fix .plt[32768+] slot
computation.
2001-09-25 22:12:29 +00:00
H.J. Lu 09c1cc8828 2001-09-25 H.J. Lu <hjl@gnu.org>
* bfd-in2.h: Regenerated.
2001-09-25 16:35:05 +00:00
Alan Modra 387019538f * elf32-i386.c: Add comment re linker function names and ordering.
(elf_i386_link_hash_newfunc): Rename to link_hash_newfunc.
	(elf_i386_grok_prstatus): Move before linker functions.
	(elf_i386_grok_psinfo): Likewise.
	(elf_i386_fake_sections): Move so that functions are ordered.
	(elf_i386_reloc_type_class): Likewise.  Comment function purpose.
2001-09-25 10:11:46 +00:00
Alan Modra 83c81bfe97 * elf32-hppa.c: Rename all occurrences of "hplink" to "htab"
throughout file.
2001-09-25 07:28:13 +00:00
Alan Modra 98ceb8ce1d * elf32-hppa.c: (LONG_BRANCH_PIC_IN_SHLIB): Delete. Remove all
code handling this option.
	(LONG_BRANCH_VIA_PLT): Likewise.
	(RELATIVE_DYNRELOCS): Define as zero.
	(struct elf32_hppa_dyn_reloc_entry): Add "sec", and
	"pc_count" fields.  Remove "section" field.
	(elf32_hppa_link_hash_entry): Rename reloc_entries to dyn_relocs.
	(elf32_hppa_check_relocs): Don't allocate space for dynamic
	relocs here.  Instead, record all needed dynamic relocs via
	dyn_relocs and local_dynrel.  Cache pointer to "sreloc" section
	in elf_section_data.
	(elf32_hppa_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
	(allocate_plt_and_got_and_discard_relocs): Rename to
	allocate_dynrelocs.  Allocate rather than discarding dyn relocs.
	(readonly_dynrelocs): New function.
	(elf32_hppa_size_dynamic_sections): Mark output_bfd unused.
	Call readonly_dynrelocs to determine need for DT_TEXTREL.
	Rename "i" to "ibfd".  Allocate space for local dyn relocs.
	(elf32_hppa_relocate_section): Make use of cached sreloc.
	(elf32_hppa_reloc_type_class): New function.
	(elf_backend_reloc_type_class): Define.
2001-09-25 07:10:59 +00:00
Alan Modra 0c715baa72 * elf-bfd.h (struct bfd_elf_section_data): Add "local_dynrel"
and "sreloc" fields.
	* elf32-i386.c (struct elf_i386_dyn_relocs): Add "sec", and
	"pc_count" fields.  Remove "section" field.
	(elf_i386_check_relocs): Don't set DF_TEXTREL here.  Don't
	allocate space for dynamic relocs here.  Instead, record all
	needed dynamic relocs via dyn_relocs and local_dynrel.  Cache
	pointer to "sreloc" section in elf_section_data.
	(elf_i386_gc_sweep_hook): Sweep dyn_relocs and local_dynrel.
	(allocate_plt_and_got_and_discard_relocs): Rename to
	allocate_dynrelocs.  Allocate rather than discarding dyn relocs.
	(readonly_dynrelocs): New function.
	(elf_i386_size_dynamic_sections): Call readonly_dynrelocs.
	Rename "i" to "ibfd".  Allocate space for local dyn relocs.
	(elf_i386_relocate_section): Make use of cached sreloc.
2001-09-25 04:34:50 +00:00
Alan Modra f51e552e0e * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
reloc rather than just the type.
	(_bfd_elf_reloc_type_class): Likewise.
	* elf.c (_bfd_elf_reloc_type_class): Likewise.
	* elf32-arm.h (elf32_arm_reloc_type_class): Likewise.
	* elf32-cris.c (elf_cris_reloc_type_class): Likewise.
	* elf32-i386.c (elf_i386_reloc_type_class): Likewise.
	* elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise.
	* elf32-ppc.c (ppc_elf_reloc_type_class): Likewise.
	* elf32-s390.c (elf_s390_reloc_type_class): Likewise.
	* elf32-sh.c (sh_elf_reloc_type_class): Likewise.
	* elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise.
	* elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise.
	* elf64-s390.c (elf_s390_reloc_type_class): Likewise.
	* elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise.
	* elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise.
	* elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise.
	* elflink.h: Formatting fixes.
	(elf_link_sort_relocs): Make "count" and "size" bfd_size_type.
	Call bfd_zmalloc rather than calloc.  Remove unnecessary cast of
	o->contents to PTR.  Update call to elf_backend_reloc_type_class.
2001-09-24 01:38:31 +00:00
Alan Modra 0c35f01ab3 * elfcode.h (elf_object_p): Allow for no section header at all in
non-ET_REL files.  Honor 0 for e_shnum, e_shstrndx, e_shoff.
2001-09-22 03:16:01 +00:00
Nick Clifton 1e738b87c8 Fix compile time warnings 2001-09-21 14:25:09 +00:00
Alan Modra 923f08ff7a * Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.

	* aoutx.h: Formatting fixes.
	* merge.c (_bfd_merged_section_offset): Break line at 80 chars.

	* linker.c: Replace bfd_get_filename with bfd_archive_filename
	in error message.
2001-09-21 02:12:29 +00:00
Alan Modra 8f615d0704 * bfd.c (bfd_archive_filename): New function.
* bfd-in2.h: Regenerate.
	* aout-adobe.c: Replace bfd_get_filename with bfd_archive_filename
	in error messages where the bfd is an input bfd.
	* aout-cris.c: Likewise.
	* coff-arm.c: Likewise.
	* coff-mcore.c: Likewise.
	* coff-ppc.c: Likewise.
	* coff-rs6000.c: Likewise.
	* coff-sh.c: Likewise.
	* coff-tic54x.c: Likewise.
	* coff-tic80.c: Likewise.
	* coff64-rs6000.c: Likewise.
	* coffcode.h: Likewise.
	* coffgen.c: Likewise.
	* cofflink.c: Likewise.
	* ecofflink.c: Likewise.
	* elf-hppa.h: Likewise.
	* elf.c: Likewise.
	* elf32-arm.h: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-gen.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-mcore.c: Likewise.
	* elf32-mips.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-sparc.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-gen.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.h: Likewise.
	* elfxx-ia64.c: Likewise.
	* ieee.c: Likewise.
	* ihex.c: Likewise.
	* libbfd.c: Likewise.
	* pdp11.c: Likewise.
	* pe-mips.c: Likewise.
	* peicode.h: Likewise.
	* srec.c: Likewise.
	* xcofflink.c: Likewise.

	* elf32-arm.h: Make _bfd_error_handler calls K&R compatible.

	* elflink.c (_bfd_elf_create_linker_section): Better grammar for
	error message.

	* coff-mcore.c (coff_mcore_relocate_section): Internalionalise
	error message.

	* elf64-sparc.c (sparc64_elf_add_symbol_hook): Constify stt_types.
	Consolidate error messages, and split long messages to two lines.
2001-09-20 23:30:37 +00:00
Nick Clifton 671bae9c92 coordinate info->symbolic and info->allow_shlib_undefined 2001-09-20 10:37:35 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Alan Modra 17c1c87fca * bfdint.texi: Replace reference to bfd_read with bfd_bread.
Likewise for bfd_write.
2001-09-18 10:03:38 +00:00
Alan Modra dc810e3900 Touches most files in bfd/, so likely will be blamed for everything..
o  bfd_read and bfd_write lose an unnecessary param and become
   bfd_bread and bfd_bwrite.

o  bfd_*alloc now all take a bfd_size_type arg, and will error if
   size_t is too small.  eg. 32 bit host, 64 bit bfd, verrry big files
   or bugs in linker scripts etc.

o  file_ptr becomes a bfd_signed_vma.  Besides matching sizes with
   various other types involved in handling sections, this should make
   it easier for bfd to support a 64 bit off_t on 32 bit hosts that
   provide it.

o  I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
   generally available.  They now cast their args to bfd_vma and
   bfd_byte * as appropriate, which removes a swag of casts from the
   source.

o  Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
   aout-encap.c.

o  Zillions of formatting and -Wconversion fixes.
2001-09-18 09:57:26 +00:00
Nick Clifton 417412a27c Fix typo 2001-09-18 07:55:39 +00:00
H.J. Lu bb731fb645 2001-09-17 H.J. Lu <hjl@gnu.org>
* dwarf1.c (parse_die): Take a new arg for the end of the
	section. Return false if die is beyond the section.
	(parse_functions_in_unit): Pass the end of the section to
	parse_die ().
	(_bfd_dwarf1_find_nearest_line): Likewise.
2001-09-17 15:13:13 +00:00
Nick Clifton 841989d692 Fix bug emitting R_SPARC_UA32 relocs into shared objects 2001-09-14 13:56:45 +00:00
Nick Clifton 056a1d49d7 Add support for arm-openbsd target 2001-09-14 11:46:40 +00:00
Thiemo Seufer 4008bd9b57 /bfd/ChangeLog
* config.bfd: Change machine triplets from mips*el*-* to mips*el-*.
	Add support for mips64.

	/ChangeLog
	* config.sub: Change machine triplets from mipsel*-* to mips*el-*.
	Add support for mips64.

	/gas/ChangeLog
	* configure.in: Change machine triplets from mips-*-linux-gnu* to
	mips*-*-linux*.
2001-09-14 06:22:46 +00:00
Alexandre Oliva c11cc22789 * elf32-openrisc.c (ELF_MACHINE_ALT1): Define as EM_OPENRISC_OLD. 2001-09-13 21:02:36 +00:00
Alexandre Oliva 6f4514dc58 * elf.c (prep_headers): Get the machine code from the elf
backend data.
* elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200.
* elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
* elf-arc.c (arc_elf_final_write_processing): Don't override
e_machine, it's now properly set in prep_headers.
* elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and
EM_AVR_OLD.
(ELF_MACHINE_ALT1): Define to EM_AVR_OLD.
* elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V.
* elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V.
* elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30.
* elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R.
* elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD.
* elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850.
2001-09-13 00:15:54 +00:00
Alexandre Oliva aa4f99bbfd * elf.c (prep_headers): Get the machine code from the elf
backend data.
* elf-m10200.c (ELF_MACHINE_CODE): Redefine to EM_MN10200.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10200.
* elf-m10300.c (ELF_MACHINE_CODE): Redefine to EM_MN10300.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300.
* elf-arc.c (arc_elf_final_write_processing): Don't override
e_machine, it's now properly set in prep_headers.
* elf32-avr.c (elf32_avr_object_p): Accept both EM_AVR and
EM_AVR_OLD.
(ELF_MACHINE_ALT1): Define to EM_AVR_OLD.
* elf-d10v.c (ELF_MACHINE_CODE): Redefine to EM_D10V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D10V.
* elf-d30v.c (ELF_MACHINE_CODE): Redefine to EM_D30V.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_D30V.
* elf-fr30.c (ELF_MACHINE_CODE): Redefine to EM_FR30.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_FR30.
* elf-m32r.c (ELF_MACHINE_CODE): Redefine to EM_M32R.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_M32R.
* elf32-pj.c (ELF_MACHINE_ALT1): DEfine to EM_PJ_OLD.
* elf-v850.c (ELF_MACHINE_CODE): Redefine to EM_V850.
(ELF_MACHINE_ALT1): Define to EM_CYGNUS_V850.
2001-09-12 23:53:31 +00:00
Richard Henderson 204692d7e6 * elf64-alpha.c (elf64_alpha_section_flags): New.
(elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL.
2001-09-11 18:26:27 +00:00
Richard Henderson f94952df27 * elf64-alpha.c (elf64_alpha_relocate_section): Do not
apply HINT relocations against dynamic symbols.
2001-09-11 18:21:11 +00:00
H.J. Lu 146f1a875a 2001-09-11 H.J. Lu <hjl@gnu.org>
* inker.c (link_action): Change COMMON_ROW\defw from CREF to
	COM.
2001-09-11 18:10:20 +00:00
Richard Henderson 96e2734bcd * elf64-alpha.c: Delete all unused ERIC_neverdef and rth_notdef code. 2001-09-09 20:50:00 +00:00
Richard Henderson 1cd6895c55 * elf64-alpha.c (elf64_alpha_relax_with_lituse): Nop out gpdisp
following a call to a near function.
2001-09-09 20:42:11 +00:00
Richard Henderson f16fbd61d9 * elf64-alpha.c (elf64_alpha_relocate_section): Soft fail
relocation errors.  Fail gp-relative relocations against
        dynamic symbols.
2001-09-09 06:58:06 +00:00
Alan Modra 56882138c5 * elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR
as well as DEF_DYNAMIC in test for avoided copy relocs.
	(allocate_plt_and_got_and_discard_relocs): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	(allocate_plt_and_got_and_discard_relocs): Likewise.
2001-09-08 05:47:01 +00:00
Thiemo Seufer cb56d3d327 * elf32-mips.c (mips_elf_calculate_relocation): Fix overflow handling
of R_MIPS_PC16.

	* config/tc-mips.c (append_insn): Handle BFD_RELOC_16_PCREL.
	(macro_build): Use BFD_RELOC_16_PCREL_S2 only for embedded
	PIC, BFD_RELOC_16_PCREL for the rest.
	(mips_ip): Likewise.
        (md_pcrel_from): return the right offset for the differently shifted
        pcrel relocs.
	(md_apply_fix): Handle BFD_RELOC_16_PCREL.

	* gas/mips/beq.d: Check branches to external labels.
	* gas/mips/beq.s: Likewise.
	* gas/mips/bge.d: Likewise.
	* gas/mips/bge.s: Likewise.
	* gas/mips/bgeu.d: Likewise.
	* gas/mips/bgeu.s: Likewise.
	* gas/mips/blt.d: Likewise.
	* gas/mips/blt.s: Likewise.
	* gas/mips/bltu.d: Likewise.
	* gas/mips/bltu.s: Likewise.
	* gas/mips/elempic.d: Switch from R_MIPS_GNU_REL16_S2 to R_MIPS_PC16.
	* gas/mips/empic.d: Likewise.
	* gas/mips/empic.s: Likewise.
	* gas/mips/telempic.d: Likewise.
	* gas/mips/tempic.d: Likewise.
2001-09-07 05:00:37 +00:00
Thiemo Seufer 77bfe34f56 * elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO
definitions.
	(mips_elf64_howto_table_rel): Likewise.
2001-09-06 21:30:15 +00:00
Tom Rix 1fdf02497c Fix import symbols for AIX. 2001-09-06 15:20:01 +00:00
Richard Henderson dfe57ca0af * elf64-alpha.c (SKIP_HOWTO): New.
(elf64_alpha_howto_table): Use it to remove dead ECOFF relocs.
        Fix sizes of 16-bit mem format relocs.
        (elf64_alpha_reloc_map): Update to match.
        (elf64_alpha_relax_with_lituse): Use GPREL16 as appropriate.
        (elf64_alpha_relax_without_lituse): Likewise.
        (elf64_alpha_check_relocs): Handle GPREL16.
        (elf64_alpha_relocate_section): Likewise.
        * reloc.c (BFD_RELOC_ALPHA_USER_*): Remove.
        (BFD_RELOC_ALPHA_GPREL_HI16, BFD_RELOC_ALPHA_GPREL_LO16): New.
        * bfd-in2.h, libbfd.h: Rebuild.
2001-09-05 03:00:14 +00:00
Jeff Law 5907e6285e * elf32-h8300.c (elf32_h8_relax_section): New function.
(elf32_h8_relax_delete_bytes): Likewise.
        (elf32_h8_symbol_address_p): Likewise.
        (elf32_h8_get_relocated_section_contents): Likewise.
        (bfd_elf32_bfd_relax_section): Define.
        (bfd_elf32_bfd_get_relocated_section_contents): Likewise.
2001-09-04 21:06:01 +00:00
Jeff Law a00c9dbc18 * elf32-h8300.c (special): New function.
(h8_elf_howto_table): Use it for SPECIAL_FUNCTION field in
        all relocations.
        (elf32_h8_final_link_relocate): Treat R_H8_DIR24A8 like 32bit
        relocations.  Fix problems with the true 24bit reloc R_H8_DIR24R8.
        Fix minor problems with 8bit and 16bit PC relative relocations.
2001-09-04 17:29:36 +00:00
Andreas Jaeger 524f76c97e * vms-tir.c: Add missing prototypes.
* vms-hdr.c: Likewise.
	* vms-gsd.c: Likewise.
	* vms-misc.c: Likewise.
2001-09-01 10:29:27 +00:00
H.J. Lu 6140b3b903 2001-08-31 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_check_relocs): Report filename
	with bad relocation.
2001-08-31 21:41:10 +00:00
Eric Christopher a1cd6a8fe3 2001-08-31 Eric Christopher <echristo@redhat.com>
Jason Eckhardt  <jle@redhat.com>

	* bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32,
	mips32_4k and mips64.
	* bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k,
	bfd_mach_mips64.  Add bfd_mach_mipsisa32, bfd_mach_mipsisa64.
	* bfd/cpu-mips.c: Ditto.
	* bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto.
	* bfd/bfd-in2.h: Regenerate.
2001-08-31 21:24:28 +00:00
Jakub Jelinek 28cfee261d * elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory
value into R_ALPHA_RELATIVE's addend.
	(elf64_alpha_finish_dynamic_symbol): Likewise.
2001-08-31 19:20:12 +00:00
Nick Clifton 08bf74c587 amend entry to mention only if not USE_REL 2001-08-31 16:24:39 +00:00
Nick Clifton 5fb1c3f282 Do not rightshift recomputed addend during relocatable link if not USE_REL. 2001-08-31 16:23:25 +00:00