Commit Graph

2599 Commits

Author SHA1 Message Date
Nick Clifton ed781d5d99 Change embedded documentation to use consistent indentation and to split up
long lines.  Change informal style of description for functions lacking real
documentation.
2003-02-14 11:16:09 +00:00
Nick Clifton 21efdc8d7c (_bfd_stab_section_find_nearest_line): For line number stabs outside of
functions, treat values as absolute addresses.
2003-02-14 09:31:57 +00:00
Nick Clifton 3193e2343c (elf_core_file_p): Compare alternate machine codes for ELF backends when
checking if the generic ELF target should be used.
2003-02-14 09:21:21 +00:00
Alan Modra 58ac9f718e * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
(ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
	(ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
	(allocate_dynrelocs): Don't treat undefined and undefweak specially.
	(ppc_size_one_stub): Fix warning, and tighten plt entry check.
	(group_sections): Don't share a stub section if stubs are for a large
	section.  Adjust comment.
	(ppc64_elf_size_stubs): Roughly double the size left for stubs if
	!stubs_always_before_branch.
	(ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
	treat undefined and undefweak specially when processing dyn relocs.
2003-02-13 23:48:31 +00:00
Alan Modra 224ec17a5e daily update 2003-02-13 23:00:06 +00:00
Jakub Jelinek 9147e853bf bfd/
* elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
ld/testsuite/
	* ld-shared/shared.exp: Run on s390*-*-linux* and x86_64-*-linux* too.
	xfail tests linking non-pic code into shared libs on x86_64-*-linux*.
	* ld-elfvsb/elfvsb.exp: Likewise.
	* ld-elfvers/vers.exp: Likewise.  Add vers24a, vers24b and vers24c
	tests.
	* ld-elfvers/vers3.ver: Allow VERS_2.0 to come before GLIBC_*
	version.
	* ld-elfvers/vers19.ver: Likewise.
	* ld-elfvers/vers24a.c: New test.
	* ld-elfvers/vers24b.c: New test.
	* ld-elfvers/vers24c.c: New test.
	* ld-elfvers/vers24.map: New test.
	* ld-elfvers/vers24.rd: New test.
	* lib/ld-lib.exp (run_ld_link_tests): Add optional 7th argument
	cflags.  If source files have .c extension, compile them first.
2003-02-13 22:14:11 +00:00
Nick Clifton 427bfd905d (elf32_thumb_to_arm_stub): Include section VMAs in computation of offset to
insert into BL instruction.
2003-02-13 19:35:22 +00:00
Nick Clifton 53954f5e85 Documenation formatting improvements.
Move Gnu Free Documenation License to a seperate file.
2003-02-13 11:26:41 +00:00
Alan Modra 5b54723e51 daily update 2003-02-12 23:00:05 +00:00
Alan Modra 44aa9df053 daily update 2003-02-11 23:00:05 +00:00
Nick Clifton 42b5d0eaa9 Add support for configuring *-*-kaos targets. 2003-02-11 13:47:08 +00:00
Alan Modra a48ebf4d62 * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
.__tls_get_addr too.
	(ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
2003-02-11 03:02:46 +00:00
Alan Modra 4c188e4954 daily update 2003-02-10 23:00:05 +00:00
Kaz Kojima c95b8a7ace * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
(elf_sh_link_hash_entry): Remove tls_tpoff32 field.
	(sh_elf_link_hash_newfunc): Remove the initialization of
	tls_tpoff32 field.
	(allocate_dynrelocs): Keep dyn_relocs if it includes the entry
	for which tls_tpoff32 flag is set.
	(sh_elf_relocate_section): Covert to LE only if the dyn_relocs
	of the symbol includes the entry matched with the input_section
	and having tls_tpoff32 flag on.	 When linking statically, set
	symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
	is defined in this executable.
	(sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
2003-02-10 22:17:18 +00:00
Jakub Jelinek a779acda15 * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
even if there is just non-empty .rela.plt.
2003-02-10 13:22:12 +00:00
Nick Clifton c178919ba9 Add function to set machine number based on flags in header. 2003-02-10 11:21:19 +00:00
Nick Clifton fde78edd7a Add support for marking ARM ELF binaries as support the Cirrus EP9312 Maverick
floating point co-processor.
2003-02-10 10:44:48 +00:00
Alan Modra e7b938ca5f * elf64-ppc.c: Rename assorted occurrences of tls_type and similar
variables, structure fields or function params to tls_mask or
	similar to better reflect usage.
	(struct got_entry): Comment.
	(struct ppc_link_hash_entry):  Expand comment, and renumber TLS_*.
	(get_tls_mask): Rename from get_tls_type.
2003-02-09 23:17:57 +00:00
Alan Modra 2d4c37e9e1 daily update 2003-02-09 23:00:15 +00:00
Alan Modra 951fd09be7 * elf64-ppc.c (TLS_GD_LD): Don't define..
(TLS_GD): ..define this instead and update all uses.
	(TLS_TPRELGD): Define.
	(ppc64_elf_link_hash_table_create): Tweak initialization of
	init_refcount and init_offset.
	(ppc64_elf_check_relocs): Add one extra element to t_symndx array.
	Mark second slot of GD or LD toc entries.
	(get_tls_type): Return an int.  Distinguish toc GD and LD entries
	from other tls types.
	(ppc64_elf_tls_setup): New function, split out from..
	(ppc64_elf_tls_optimize): ..here.  Don't optimize when symbols are
	defined in a dynamic object.  Fix LD optimization.  Don't set TLS_TPREL
	on GD->IE optimization, use TLS_TPRELGD instead.  Use get_tls_type
	return value to properly decide whether toc GD and LD entries can
	optimize away __tls_get_addr call.  Check next reloc after DTPMOD64
	to determine GD or LD rather than looking at TLS_LD flag.  Don't
	attempt to adjust got entry tls_type here..
	(allocate_dynrelocs): ..instead, adjust got entry tls_type here, and
	look for possible merges.
	(ppc64_elf_size_dynamic_sections): Adjust local got entries for
	optimization.
	(ppc64_elf_size_stubs): Tweak __tls_get_addr fudge.
	(ppc64_elf_relocate_section): Rename some vars to better reflect usage.
	Make use of return value from get_tls_type to properly detect GD and
	LD optimizations.  Split tlsld/gd hi/ha from lo/ds case.  Don't
	handle tls_get_addr removal when looking at REL24 relocs, do it when
	looking at the previous reloc.  Check reloc after DTPMOD64 to determine
	GD or LD.
	* elf64-ppc.h (ppc64_elf_tls_setup): Declare.
2003-02-09 04:36:23 +00:00
Alan Modra 6538ad7304 daily update 2003-02-08 23:00:06 +00:00
Alan Modra 00b28bb047 * elf32-hppa.c (group_sections): Don't share a stub section if
stubs are for a large section.
2003-02-08 08:18:41 +00:00
Alan Modra acc990f282 * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for
stubs if !stubs_always_before_branch.
2003-02-08 01:10:30 +00:00
Alan Modra c3eba5102a daily update 2003-02-07 23:00:04 +00:00
Nick Clifton 589e6347e9 Generate an error message if a section cannot be found for a symbol. 2003-02-07 14:27:59 +00:00
Jakub Jelinek c328dc3fe7 * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
local_got_entries is NULL.
2003-02-07 09:30:33 +00:00
Andreas Schwab 84f97cb641 * elf-eh-frame.c (get_DW_EH_PE_signed): Define.
(read_value): Add parameter is_signed, use signed extraction if
	the value is signed.
	(_bfd_elf_write_section_eh_frame): Pass signed flag of the
	encoding to read_value.
2003-02-06 23:01:04 +00:00
Alan Modra 9e1d9e8d68 daily update 2003-02-06 23:00:06 +00:00
Alan Modra ca44d00ab9 daily update 2003-02-05 23:00:04 +00:00
Alan Modra 6349e62823 * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and
plt info when called to transfer weak sym info.
2003-02-05 15:49:04 +00:00
Alan Modra abc0de032a daily update 2003-02-04 23:00:05 +00:00
Alan Modra 411e1bfb66 * reloc.c: Add PPC and PPC64 TLS relocs.
* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
	* elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare.
	(ppc64_elf_howto_raw): Add TLS howto's.  Adjust R_PPC64_NONE to be
	against a 32 bit field.
	(ppc64_elf_reloc_type_lookup): Handle TLS relocs.
	(_ppc64_elf_section_data): Add t_symndx and comments.
	(ppc64_elf_section_data): Use elf_section_data macro.
	(ppc64_elf_new_section_hook): American spelling.
	(struct got_entry, struct plt_entry): New.
	(MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC.
	(struct ppc_stub_hash_entry): Add "addend" field.
	(struct ppc_link_hash_entry): Add "tls_type".
	(TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL,
	TLS_EXPLICIT): Define.
	(struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got.
	(link_hash_newfunc): Init new fields.
	(ppc64_elf_link_hash_table_create): Likewise.  Set init_relcount and
	init_offset to NULL.
	(ppc64_elf_copy_indirect_symbol): Copy got and plt info.  Don't call
	_bfd_elf_link_hash_copy_indirect, rather insert relevant code from
	there.
	(update_local_sym_info, update_plt_info): New functions.
	(ppc64_elf_check_relocs): Use them.  Handle TLS relocs.  Adjust GOT
	handling to use got.glist rather than got.refcount.  Likewise for PLT.
	(ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists.
	(func_desc_adjust): Adjust for new PLT list.
	(ppc64_elf_adjust_dynamic_symbol): Likewise.
	(get_sym_h, get_tls_type): New functions.
	(ppc64_elf_edit_opd): Remove unused variable.  Use get_sym_h.
	(ppc64_elf_tls_optimize): New function.
	(allocate_dynrelocs): Adjust for new PLT and GOT lists.  Allocate
	TLS relocs.
	(ppc64_elf_size_dynamic_sections): Likewise.
	(ppc_type_of_stub): Adjust for new PLT list.
	(ppc_build_one_stub): Likewise.
	(ppc64_elf_size_stubs): Likewise.  Use get_sym_h.  Treat __tls_get_addr
	calls specially.
	(ppc64_elf_relocate_section): Adjust for new GOT and PLT lists.  Handle
	TLS relocs.  Report local syms using bfd_elf_local_sym_name.  Don't
	init GOT entries that have a reloc.  Generate GOT relocs here..
	(ppc64_elf_finish_dynamic_symbol): ..not here.  Adjust for PLT list.
	* elf64-ppc.h (ppc64_elf_tls_optimize): Declare.
2003-02-04 14:50:50 +00:00
Andreas Schwab 0cca5f05a9 * elf32-m68k.c (elf_m68k_hash_entry): Define.
(elf_m68k_link_hash_traverse): Remove.
	(elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and
	elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to
	reduce casting.
	(elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of
	casting.
	(elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse
	instead of elf_m68k_link_hash_traverse.
	(elf_m68k_discard_copies): Change first parameter to pointer to
	struct elf_link_hash_entry and use elf_m68k_hash_entry when struct
	elf_m68k_link_hash_entry is needed.
2003-02-04 13:23:40 +00:00
Alan Modra 5cab59f622 * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare.
(struct elf_link_hash_entry): Add "glist" and "plist" fields to
	"got" union, and declare as gotplt_union.  Use gotplt_uinion for
	"plt" field.
	(struct elf_link_hash_table): Make "init_refcount" a gotplt_union.
	Add "init_offset" field.
	(struct elf_obj_tdata <local_got>): Add "struct got_entry **" to union.
	(elf_local_got_ents): Declare.
	* elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got"
	and "plt".
	(_bfd_elf_link_hash_hide_symbol): Use "init_offset".
	(_bfd_elf_link_hash_table_init): Set "init_offset".
	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount
	from init_offset.
	(elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset.

	* elf.c (bfd_elf_local_sym_name): Split out from..
	(group_signature): ..here.
	* elf-bfd.h (bfd_elf_local_sym_name): Declare.
2003-02-04 12:49:57 +00:00
Alan Modra 68bfbfcc5a bfd
* elf-bfd.h (enum elf_link_info_type): Remove.
	(struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields
	to struct sec.  Remove linkonce_p field.
	(elf_linkonce_p): Delete.
	(elf_discarded_section): Update for sec_info_type change.
	* section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc,
	flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24.
	(ELF_INFO_TYPE_NONE): Define.
	(ELF_INFO_TYPE_STABS): Define.
	(ELF_INFO_TYPE_MERGE): Define.
	(ELF_INFO_TYPE_EH_FRAME): Define.
	(ELF_INFO_TYPE_JUST_SYMS): Define.
	(STD_SECTION): Update struct sec initializer.
	* ecoff.c (bfd_debug_section): Likewise.
	* elf.c: Likewise.  Update occurrences of sec_info_type and use_rela_p.
	* elflink.h: Likewise.
	* elf-eh-frame.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* bfd-in2.h: Regenerate.

	* elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than
	referring to used_by_bfd.
	* elf64-sparc.c (sec_do_relax): Likewise.
	* elf64-mmix.c (mmix_elf_section_data): Likewise.
	* elfxx-mips.c (mips_elf_section_data): Likewise.
	* ieee.c (ieee_slurp_section_data): Use ieee_per_section macro.
	(ieee_get_section_contents): Likewise.
	(ieee_new_section_hook): Formatting.
	(ieee_canonicalize_reloc): Remove commented out code.
	* mmo.c (mmo_section_data): Define.  Use throughout file.
	* oasys.c (oasys_get_section_contents): Use oasys_per_section macro.

gas
	* config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and
	SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p.
2003-02-04 12:34:08 +00:00
Alan Modra 5cb8c6cb8a daily update 2003-02-03 23:00:06 +00:00
Alan Modra 44c6ae1d17 daily update 2003-02-02 23:00:06 +00:00
Alan Modra b66cc1a0d2 daily update 2003-02-01 23:00:06 +00:00
Alan Modra 26c0321be8 daily update 2003-01-31 23:59:42 +00:00
Nick Clifton 31f7ba0423 bfd_follow_gnu_debuglink: New function. Follow the pointer contained inside a
.gnu_debuglink section.
2003-01-31 10:04:16 +00:00
Alan Modra 927f884ddb daily update 2003-01-30 23:00:05 +00:00
Alan Modra b92225a1b9 daily update 2003-01-29 23:00:05 +00:00
Alexandre Oliva 38985a1cb4 * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference
entry->abfd when it's NULL.
2003-01-29 08:29:34 +00:00
Alan Modra 2d313b2b7c daily update 2003-01-28 23:00:04 +00:00
Alexandre Oliva 70d554c0d0 Remove duplicate date line 2003-01-28 00:19:13 +00:00
Alexandre Oliva 4bb9a95f40 * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle
_bfd_elf_section_offset returning -2 the same way as -1.
2003-01-28 00:18:45 +00:00
Alexandre Oliva f4416af69e * elfxx-mips.c (mips_elf_multi_got): New function.
(struct mips_got_entry): Make symndx and gotidx signed.  Moved
addend into union along with address and link hash entry.
(struct mips_got_info): Added bfd2got and next.
(struct mips_elf_hash_sort_data): Added max_unref_got_dynindx.
(mips_elf_got_section, mips_elf_create_got_section): Use
SEC_EXCLUDE bit to tell whether we really need the got
section.  Take boolean arguments to disregard an excluded
section, or to create it as excluded.  Adjust all callers.
Use mips_elf_got_section all over.
(mips_elf_local_got_index, mips_elf_got_page,
mips_elf_got16_entry): Take input bfd as argument, and pass it
on to mips_elf_create_local_got_entry.
(mips_elf_global_got_index, mips_elf_create_local_got_entry):
Take input bfd as argument, and manage entries in the
appropriate GOT.
(mips_elf_got_offset_from_index): Take input bfd as argument,
and use it to adjust the GP offset of the bfd.
(mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move
unreferenced GOT entries of global symbols to the end.
(mips_elf_record_global_got_symbol): Take input bfd as
argument.  Add entries to the master GOT hash table.
(struct mips_elf_bfd2got_hash): New.
(struct mips_elf_got_per_bfd_arg): New.
(struct mips_elf_set_global_got_offset_arg): New.
(mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash,
mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash,
mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd,
mips_elf_merge_gots, mips_elf_set_global_got_offset,
mips_elf_resolve_final_got_entry,
mips_elf_resolve_final_got_entries, mips_elf_adjust_gp,
mips_elf_got_for_ibfd): New functions.
(ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT.
(MIPS_ELF_GOT_MAX_SIZE): New macro.
(STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT.
(mips_elf_got_entry_hash): Take new fields into account.  Use
mips_elf_hash_bfd_vma.
(mips_elf_got_entry_eq): Take new fields into account.
(mips_elf_create_got_section): Initialize new fields.
(mips_elf_calculate_relocation): Pass input_bfd to functions
that now take it.  Adjust gp for the input_bfd.
(mips_elf_allocate_dynamic_relocation,
mips_elf_create_dynamic_relocation,
_bfd_mips_elf_create_dynamic_sections): Use...
(mips_elf_rel_dyn_section): New function.  Borrow code from...
(_bfd_mips_elf_check_relocs): Pass input_bfd to functions that
now take it.  Create the got section if needed, even if
excluded, before recording a global got symbol.  Move some
code to...
(mips_elf_record_local_got_symbol): New fn.
(_bfd_mips_elf_size_dynamic_sections): Disable combreloc.
Compute multi-got global entries offsets.  Move GOT code to...
(_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got
if the GOT is too big.
(_bfd_mips_elf_finish_dynamic_symbol): Set got entry of
undefweak symbol to zero.  Generate dynamic relocations for
non-primary GOT entries for global symbols.
(_bfd_mips_elf_finish_dynamic_sections): Handle multi-got
case.  Generate dynamic relocations for local got entries.
Sort dynamic relocations on N64 too, using...
(sort_dynamic_relocs_64): New fns.
(_bfd_mips_elf_hide_symbol): Adjust multi-got counters.
(_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT.
2003-01-28 00:01:27 +00:00
Alexandre Oliva 52b69c9e01 * bfd.c (struct _bfd): Added id field.
* opncls.c (_bfd_id_counter): New static variable.
(_bfd_new_bfd): Use it.
* bfd-in2.h: Rebuilt.
2003-01-27 23:40:39 +00:00
Alan Modra 93ac67b5ec daily update 2003-01-27 23:00:05 +00:00
Alan Modra 71e5db1cc5 * elf32-sparc.c (bfd_elf32_new_section_hook): Define. 2003-01-25 08:20:38 +00:00
Jakub Jelinek b9734f3572 bfd/
* elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs.
	(elf32_sparc_rev32_howto): New variable.
	(sparc_reloc_map): Add TLS relocs.
	(elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto):
	Handle REV32.
	(sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject):
	New functions.
	(struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry,
	struct elf32_sparc_link_hash_table):
	New structures.
	(elf32_sparc_tdata, elf32_sparc_local_got_tls_type,
	elf32_sparc_hash_table): Define.
	(link_hash_newfunc, elf32_sparc_link_hash_table_create,
	create_got_section, elf32_sparc_create_dynamic_sections,
	elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New
	functions.
	(elf32_sparc_check_relocs): Handle TLS relocs.  Add dynamic reloc
	reference counting.
	(elf32_sparc_gc_sweep_hook): Likewise.
	(elf32_sparc_adjust_dynamic_symbol): Likewise.
	(elf32_sparc_size_dynamic_sections): Likewise.
	(elf32_sparc_relocate_section): Likewise.
	(allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff):
	New functions.
	(elf32_sparc_object_p): Allocate backend private object data.
	(bfd_elf32_bfd_link_hash_table_create,
	elf_backend_copy_indirect_symbol, bfd_elf32_mkobject,
	elf_backend_can_refcount): Define.
	(elf_backend_create_dynamic_sections): Define to
	elf32_sparc_create_dynamic_sections.
	* reloc.c: Add SPARC TLS relocs.
	* bfd-in2.h, libbfd.h: Rebuilt.
	* elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs.
	(sparc_reloc_map): Likewise.
gas/
	* config/tc-sparc.c (sparc_ip): Handle TLS % operators.
	(tc_gen_reloc): Handle TLS relocs.
	(sparc_cons, cons_fix_new_sparc): Handle %r_tls_dtpoff.
	* config/tc-sparc.h (tc_fix_adjustable): Don't adjust TLS
	relocs.
	* config/obj-elf.c (obj_elf_section_word): Handle tls.
	(obj_elf_type): Handle tls_object.
include/
	* elf/sparc.h: Add TLS relocs.  Move R_SPARC_REV32 to 252.
ld/testsuite/
	* ld-sparc/sparc.exp: New.
	* ld-sparc/tlsg32.s: New test.
	* ld-sparc/tlsg32.sd: Likewise.
	* ld-sparc/tlsg64.s: Likewise.
	* ld-sparc/tlsg64.sd: Likewise.
	* ld-sparc/tlslib.s: Likewise.
	* ld-sparc/tlsnopic.s: Likewise.
	* ld-sparc/tlspic.s: Likewise.
	* ld-sparc/tlssunbin32.dd: Likewise.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunbin32.s: Likewise.
	* ld-sparc/tlssunbin32.sd: Likewise.
	* ld-sparc/tlssunbin32.td: Likewise.
	* ld-sparc/tlssunbin64.dd: Likewise.
	* ld-sparc/tlssunbin64.rd: Likewise.
	* ld-sparc/tlssunbin64.s: Likewise.
	* ld-sparc/tlssunbin64.sd: Likewise.
	* ld-sparc/tlssunbin64.td: Likewise.
	* ld-sparc/tlssunbinpic32.s: Likewise.
	* ld-sparc/tlssunbinpic64.s: Likewise.
	* ld-sparc/tlssunnopic32.dd: Likewise.
	* ld-sparc/tlssunnopic32.rd: Likewise.
	* ld-sparc/tlssunnopic32.s: Likewise.
	* ld-sparc/tlssunnopic32.sd: Likewise.
	* ld-sparc/tlssunnopic64.dd: Likewise.
	* ld-sparc/tlssunnopic64.rd: Likewise.
	* ld-sparc/tlssunnopic64.s: Likewise.
	* ld-sparc/tlssunnopic64.sd: Likewise.
	* ld-sparc/tlssunpic32.dd: Likewise.
	* ld-sparc/tlssunpic32.rd: Likewise.
	* ld-sparc/tlssunpic32.s: Likewise.
	* ld-sparc/tlssunpic32.sd: Likewise.
	* ld-sparc/tlssunpic32.td: Likewise.
	* ld-sparc/tlssunpic64.dd: Likewise.
	* ld-sparc/tlssunpic64.rd: Likewise.
	* ld-sparc/tlssunpic64.s: Likewise.
	* ld-sparc/tlssunpic64.sd: Likewise.
	* ld-sparc/tlssunpic64.td: Likewise.
2003-01-24 23:44:45 +00:00
Alan Modra c34ee0383a daily update 2003-01-24 23:00:06 +00:00
Martin Schwidefsky 69fc87f180 * bfd-in2.h: Regenerate.
* elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition,
	s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions.
	(elf_howto_table): Add TLS relocs.
	(elf_s390_reloc_type_lookup): Likewise.
	(elf_s390_link_hash_entry): Add tls_type.
	(elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type):
	New macros.
	(elf_s390_link_hash_table): Add tls_ldm_got.
	(link_hash_newfunc): Initialize tls_type.
	(elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got.
	(elf_s390_copy_indirect_symbol): Copy tls_type information.
	(elf_s390_check_relocs): Support TLS relocs.
	(elf_s390_gc_sweep_hook): Likewise.
	(allocate_dynrelocs): Likewise.
	(elf_s390_size_dynamic_sections): Likewise.
	(elf_s390_relocate_section): Likewise.
	(elf_s390_finish_dynamic_symbol): Likewise.
	(bfd_elf32_mkobject): Define for TLS.
	* elf64-s390.c: Same changes as for elf32-s390.c.
	* libbfd.h: Regenerate.
	* reloc.c: Add s390 TLS relocations.
2003-01-24 17:12:42 +00:00
Nick Clifton 9aa4e50515 Fix name of --enable-install-libbfd switch. 2003-01-24 16:50:24 +00:00
Alan Modra 2e9d253267 daily update 2003-01-23 23:00:06 +00:00
Nick Clifton 5177500f26 Add SH2E support 2003-01-23 18:50:57 +00:00
Alan Modra f0abc2a11f include/elf/ChangeLog
* sh.h: Split out various bits to bfd/elf32-sh64.h.

include/opcode/ChangeLog
	* m68hc11.h (cpu6812s): Define.

bfd/ChangeLog
	* elf-bfd.h (struct bfd_elf_section_data): Remove tdata.  Change
	dynindx to an int.  Rearrange for better packing.
	* elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
	* elf32-mips.c (bfd_elf32_new_section_hook): Define.
	* elf32-sh64.h: New.  Split out from include/elf/sh.h.
	(struct _sh64_elf_section_data): New struct.
	(sh64_elf_section_data): Don't dereference sh64_info (was tdata).
	* elf32-sh64-com.c: Include elf32-sh64.h.
	* elf32-sh64.c: Likewise.
	(sh64_elf_new_section_hook): New function.
	(bfd_elf32_new_section_hook): Define.
	(sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
	(sh64_bfd_elf_copy_private_section_data): Likewise.
	(sh64_elf_final_write_processing): Likewise.
	* elf32-sparc.c (struct elf32_sparc_section_data): New.
	(elf32_sparc_new_section_hook): New function.
	(SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
	(sec_do_relax): Define.
	(elf32_sparc_relax_section): Adjust to use sec_do_relax.
	(elf32_sparc_relocate_section): Likewise.
	* elf64-mips.c (bfd_elf64_new_section_hook): Define.
	* elf64-mmix.c (struct _mmix_elf_section_data): New.
	(mmix_elf_section_data): Define.  Use throughout file.
	(mmix_elf_new_section_hook): New function.
	(bfd_elf64_new_section_hook): Define.
	* elf64-ppc.c (struct _ppc64_elf_section_data): New.
	(ppc64_elf_section_data): Define.  Use throughout.
	(ppc64_elf_new_section_hook): New function.
	(bfd_elf64_new_section_hook): Define.
	* elf64-sparc.c (struct sparc64_elf_section_data): New.
	(sparc64_elf_new_section_hook): New function.
	(SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
	(sec_do_relax): Define.
	(sparc64_elf_relax_section): Adjust to use sec_do_relax.
	(sparc64_elf_relocate_section): Likewise.
	(bfd_elf64_new_section_hook): Define.
	* elfn32-mips.c (bfd_elf32_new_section_hook): Define.
	* elfxx-mips.c (struct _mips_elf_section_data): New.
	(mips_elf_section_data): Define.  Use throughout.
	(_bfd_mips_elf_new_section_hook): New function.
	(mips_elf_create_got_section): Don't alloc used_by_bfd.
	* elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
	* elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.

opcodes/ChangeLog
	* sh64-dis.c: Include elf32-sh64.h.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.

gas/ChangeLog
	* config/tc-sh64.c (shmedia_frob_section_type): Adjust for changed
	sh64_elf_section_data.
	* config/tc-sh64.h: Include elf32-sh64.h.
	* config/tc-m68hc11.c: Don't include stdio.h.
	(md_show_usage): Fix missing continuation.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.

ld/ChangeLog
	* emultempl/sh64elf.em: Include elf32-sh64.h.
	(sh64_elf_${EMULATION_NAME}_before_allocation): Adjust for changed
	sh64_elf_section_data.
	(sh64_elf_${EMULATION_NAME}_after_allocation): Likewise.
2003-01-23 11:51:35 +00:00
Alan Modra f181ce6223 daily update 2003-01-22 23:00:06 +00:00
Richard Henderson cc03ec8004 * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
(struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value.
        (elf64_alpha_adjust_dynamic_symbol): Set them.
        (elf64_alpha_size_plt_section_1): Reset them when plt entry removed.
        (elf64_alpha_relax_tls_get_addr): Handle LDM relocs.  Frob the
        symbol index when relaxing LDM to TPREL.
        (elf64_alpha_relax_section): Likewise.  Allow relaxation of GD
        relocs, even if the target isn't locally defined.
        (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero.
        (elf64_alpha_relocate_section): Likewise.  Force TP-relative
        relocs vs symndx 0 to the tp base.
2003-01-22 00:47:58 +00:00
Alan Modra 5645d587de daily update 2003-01-21 23:00:06 +00:00
Nick Clifton da896d3fcc Add support for i386-*-aros triple. 2003-01-21 16:08:31 +00:00
Andreas Schwab 7fce784e9a * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define.
(struct ppc_elf_link_hash_entry): Define.
	(ppc_elf_hash_entry): New function.
	(struct ppc_elf_link_hash_table): Define.
	(ppc_elf_hash_table): New function.
	(ppc_elf_link_hash_newfunc): New function.
	(ppc_elf_link_hash_table_create): New function.
	(ppc_elf_copy_indirect_symbol): New function.
	(allocate_dynrelocs): New function.
	(readonly_dynrelocs): New function.
	(ppc_elf_size_dynamic_sections): Allocate space for dynamic
	relocs and determine DT_TEXTREL.
	(ppc_elf_check_relocs): Don't do that here, just count the
	dynamic relocs.
	(ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the
	removed section.
	(bfd_elf32_bfd_link_hash_table_create): Define.
	(elf_backend_copy_indirect_symbol): Define.
2003-01-21 12:55:11 +00:00
Richard Henderson 1bbc9cec6b * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and
TPREL also get a reloc if shared.  Remove SREL support.
        (elf64_alpha_emit_dynrel): New.
        (elf64_alpha_relocate_section): Use it.  Resolve dynamic TPREL
        and GOTTPREL relocs to local symbols against the tp base.
        (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel.

        * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got
        use count before clobbering r_type.
        (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn
        ordering would mean dataflow inspection is necessary.
2003-01-21 08:59:25 +00:00
Alan Modra de72e31e30 daily update 2003-01-20 23:00:05 +00:00
Svein Seldal 0da35f8be8 Updates for fixing tic4x arch tagging of its object files.
* bfd/coffcode.h (coff_set_flags): Added get/set arch hooks.
	* include/coff/tic4x.h (TICOFF_TARGET_MACHINE_GET): Fixed define bug
	* include/coff/ti.h (TICOFF_TARGET_MACHINE_GET): Added macros
	* ld/Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o
	* ld/Makefile.in: Regenerate
	* ld/configure.tgt: Added extra target emulations
	* ld/emulparams/tic3xcoff.sh: Remove old settings
	* ld/emulparams/tic4xcoff.sh: Ditto
	* ld/emulparams/tic3xcoff-onchip.sh: Added new
	* ld/scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x
	* ld/scripttempl/tic3xcoff.sc: Remove
2003-01-20 22:34:39 +00:00
Nick Clifton 571fe01fe0 Treat elfNN_bed like other macros defined in elfxx-target.h and #undef it
before #define'ing it.
2003-01-20 18:06:21 +00:00
Martin Schwidefsky 5236c819d2 * bfd-in2.h: Regenerate.
* elf32-s390.c (elf_s390_adjust_gotplt): New prototype.
	(elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add
	R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16,
	R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16,
	R_390_PLTOFF32 and R_390_PLTOFF64.
	(elf_s390_reloc_type_lookup): Likewise.
	(struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track
	of GOTPLT references to a function.
	(link_hash_newfunc): Initialize gotplt_refcount.
	(elf_s390_check_relocs): Move allocation of local_got_refcounts array
	and creation of the got section out of the main switch. Add support
	for the gotoff, gotplt and pltoff relocations.
	(elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt
	and pltoff.
	(elf_s390_adjust_gotplt): New function.
	(elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed
	plt entries.
	(allocate_dynrelocs): Add comment.
	(elf_s390_relocate_section): Change r_type to unsigned. Add support
	for gotoff, gotplt and pltoff relocations.
	* elf64-s390.c: Same changes as for elf32-s390.c.
	* libbfd.h: Regenerate.
	* reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12,
	BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64,
	BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32
	and BFD_RELOC_390_PLTOFF64.
2003-01-20 11:46:33 +00:00
Alan Modra 714033a189 daily update 2003-01-18 23:00:04 +00:00
Jakub Jelinek a823975ae0 * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle
R_IA64_TPREL64[LM]SB against non-global symbol properly.

	* ld-ia64/tlspic1.s: Add tests for IE in shared libraries.
	* ld-ia64/tlspic.rd: Adjust.
	* ld-ia64/tlspic.dd: Adjust.
	* ld-ia64/tlspic.sd: Adjust.
2003-01-17 23:27:57 +00:00
Alan Modra 0bcc87e7c5 daily update 2003-01-17 23:00:06 +00:00
Alan Modra 34c003401e daily update 2003-01-16 23:00:04 +00:00
Jakub Jelinek b3dfd7fe24 * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add
self_dtpmod_done and self_dtpmod_offset.
	(allocate_global_data_got): Only use one got entry for all
	dtpmod relocs against local symbols.
	(allocate_dynrel_entries): Only need .rela.got entry for
	dtpmod against global symbol.
	(elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset.
	Reserve space in .rela.got for the local dtpmod entry.
	(set_got_entry): Initialize the common local dtpmod .got entry.
	(elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB
	and R_IA_64_DTPREL64MSB.

	* config/tc-ia64.c (ia64_cons_fix_new): Handle @dtprel() in data.

	* ld-ia64/ia64.exp: New.
	* ld-ia64/tlsbin.dd: New test.
	* ld-ia64/tlsbinpic.s: New test.
	* ld-ia64/tlsbin.rd: New test.
	* ld-ia64/tlsbin.s: New test.
	* ld-ia64/tlsbin.sd: New test.
	* ld-ia64/tlsbin.td: New test.
	* ld-ia64/tlsg.s: New test.
	* ld-ia64/tlsg.sd: New test.
	* ld-ia64/tlslib.s: New test.
	* ld-ia64/tlspic1.s: New test.
	* ld-ia64/tlspic2.s: New test.
	* ld-ia64/tlspic.dd: New test.
	* ld-ia64/tlspic.rd: New test.
	* ld-ia64/tlspic.sd: New test.
	* ld-ia64/tlspic.td: New test.
2003-01-16 21:31:18 +00:00
Alan Modra 04c9666ac8 * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h.
(R_PPC_*): Rename all occurrences to R_PPC64_*.
	(R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30.
	(enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type.
	(ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other
	relative relocs, not with absolute ones.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
2003-01-16 04:09:37 +00:00
Alan Modra f0e2286b64 daily update 2003-01-15 23:00:06 +00:00
Andreas Schwab c87f1ff7eb * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a
relocation against a non-allocated readonly section.
2003-01-15 15:54:51 +00:00
Alan Modra cf6766ee5e daily update 2003-01-14 23:00:03 +00:00
Alan Modra 8bd1781d41 daily update 2003-01-13 23:00:04 +00:00
Alan Modra 8ad9bcdc8e daily update 2003-01-12 23:00:04 +00:00
Alan Modra fbe06c784a daily update 2003-01-11 23:00:03 +00:00
Alan Modra 9ac361894d daily update 2003-01-10 23:00:04 +00:00
Alan Modra f985e606c0 daily update 2003-01-09 23:00:04 +00:00
Alan Modra 86bbe32fa7 * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.  PLTGOT16_HA too.
2003-01-09 22:51:37 +00:00
Klee Dienes 32d95f29bf 2002-01-08 Klee Dienes <kdienes@apple.com>
* Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
        (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
        * Makefile.in: Regenerate.
2003-01-09 08:35:28 +00:00
Alan Modra 7692ea567d daily update 2003-01-08 23:00:05 +00:00
Alexandre Oliva ab7d0aa081 * elfn32-mips.c (prev_reloc_section): New.
(GET_RELOC_ADDEND): Use it.  Parenthesize macro arguments.
(SET_RELOC_ADDEND): Parenthesize macro argument.
2003-01-08 22:00:53 +00:00
Dave Anglin 95d0f04a0b * elf32-hppa.c (final_link_relocate): For all DP relative relocations,
adjust addil instructions if the symbol has no section.
2003-01-08 02:19:23 +00:00
Alan Modra 51fd0cf2af daily update 2003-01-07 23:00:04 +00:00
DJ Delorie 5c9e189cf7 * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not
partial_inplace.
2003-01-07 21:26:13 +00:00
Andreas Schwab 3e829b4a2f * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for
PC relative relocations.
	(elf_m68k_discard_copies): Set it here instead.
2003-01-07 13:12:35 +00:00
Alan Modra 973b7488f7 daily update 2003-01-06 23:00:05 +00:00
Alan Modra 1bacb52f88 daily update 2003-01-05 23:00:04 +00:00
Alan Modra ff2d781336 daily update 2003-01-04 23:00:04 +00:00
Alan Modra 38ea52b394 daily update 2003-01-03 23:00:34 +00:00
Stan Cox a75473eb66 * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo.
(ALL_MACHINES_CFILES): Add cpu-iq2000.c.
	(BFD32_BACKENDS): Add elf32-iq2000.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-iq2000.c.
	(cpu-iq2000.lo): New target.
	* Makefile.in: Regenerate.
	* config.bfd: Handle iq2000-*-elf.
	* archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000.
	(bfd_archures_list): Add bfd_iq2000_arch.
	* configure.in: Handle bfd_elf32_iq2000_vec.
	* configure: Regenerate.
	* reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21,
	and BFD_RELOC_IQ2000_UHI16.
	* targets.c (bfd_elf32_iq2000_vec): Declare.
	(bfd_target_vector): Add bfd_elf32_iq2000_vec.
	* elf.c (prep_headers): Set e_machine to EM_IQ2000.
	* cpu-iq2000.c: New file.
	* elf32-iq2000.c: Likewise.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Likewise.
2003-01-03 21:12:28 +00:00
Nick Clifton aecde77ed7 oops - omitted from previous delta - a reworking of the linker relaxation code. 2003-01-03 08:21:43 +00:00
Alan Modra 9ca7f3919c daily update 2003-01-02 23:00:03 +00:00
Richard Sandiford 64543e1acf bfd/
* elfxx-mips.c: Include libiberty.h.
	(elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove.
	(mips_set_isa_flags): New function, split out from...
	(_bfd_mips_elf_final_write_processing): ...here.  Only call
	mips_set_isa_flags if the EF_MIPS_MACH bits are clear.
	(mips_mach_extensions): New array.
	(mips_32bit_flags_p): New function.
	(_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks.
	Use mips_32bit_flags_p to check if one binary is 32-bit and the
	other is 64-bit.  When adopting IBFD's architecture, adopt the
	bfd_mach as well as the flags.

ld/testsuite/
	* ld-mips-elf/jr.s: New file.
	* ld-mips-elf/mips-elf-flags.exp: New test.
2003-01-02 21:31:32 +00:00
Nick Clifton 4852a44ef5 Rework IP2k linker relxation. 2003-01-02 11:26:17 +00:00
Alan Modra 0a99d72523 daily update 2003-01-01 23:00:03 +00:00
Alan Modra 3e632e7428 daily update 2002-12-31 23:00:03 +00:00