Commit Graph

213 Commits

Author SHA1 Message Date
H.J. Lu 83180ade02 2006-05-11 Michael Matz <matz@suse.de>
* elflink.c (match_group_member): Correctly iterate group
	members.
2006-05-11 15:55:40 +00:00
Alan Modra 69d54b1bfa PR 2342
* elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
2006-05-10 04:55:43 +00:00
Alan Modra e460dd0d29 * dwarf2.c: Formatting.
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
	output section check.
	* elf32-i370.c: Warning fixes inside #ifdef DEBUG.
	* elf32-m32c.c: Similarly.
	* elf32-ppc.c: Similarly.
	* elf32-v850.c: Similarly.
	* nlm32-sparc.c: Similarly.
	* elfcode.h: Similarly.
	(elf_symbol_flags): Delete.
	* elflink.c (elf_link_input_bfd): Comment typo.
2006-05-02 01:41:20 +00:00
H.J. Lu c0d5a53d52 2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2411
	* elflink.c (check_dynsym): New.
	(elf_link_output_extsym): Use it.
	(bfd_elf_final_link): Likewise.
2006-04-05 13:37:32 +00:00
H.J. Lu 580a2b6ef3 2006-04-05 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2404
	* elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
	symbol from the dynamic definition with the default version if
	its type and the type of existing regular definition mismatch.
2006-04-05 13:36:32 +00:00
Ben Elliston b761a20733 PR ld/2267
* elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
	special section number that exceeds the number of ELF sections
	(eg. SHN_MIPS_SCOMMON).
2006-03-30 00:22:20 +00:00
H.J. Lu a46767362a 2006-03-17 Daniel Jacobowitz <dan@codesourcery.com>
PR ld/2462
	* elflink.c (bfd_elf_final_link): Remove
	bed->elf_backend_emit_relocs from emit_relocs.
2006-03-17 18:37:21 +00:00
Alan Modra 2de922512d PR 2434
* elflink.c (elf_link_add_object_symbols): Save and restore
	warning sym's linked sym.
2006-03-17 03:19:56 +00:00
Alan Modra 66eb6687c9 PR 2434
bfd/
	* elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
	(elf_link_add_object_symbols): Delete unnecessary locals.  Rename
	hash_table -> htab.  Formatting.  Save entire symbol table
	before loading as-needed syms, and restore afterwards if lib not
	needed.  Use bfd_hash_allocate rather than bfd_alloc for sym
	name.  Free some buffers earlier.
	* bfd-in.h (struct bfd_hash_table): Add entsize.
	(bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
	* elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
	* hash.c (bfd_hash_table_init_n): Add entsize param, save to
	hash table.
	(bfd_hash_table_init): Add param, adjust calls.
	* aoutx.h: Adjust all hash_table_init functions and calls.
	* bfd.c: Likewise.
	* coff-arm.c: Likewise.
	* coff-h8300.c: Likewise.
	* coff-ppc.c: Likewise.
	* cofflink.c: Likewise.
	* ecoff.c: Likewise.
	* ecofflink.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf-strtab.c: Likewise.
	* elf.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* i386linux.c: Likewise.
	* libaout.h: Likewise.
	* libbfd-in.h: Likewise.
	* libcoff-in.h: Likewise.
	* linker.c: Likewise.
	* m68klinux.c: Likewise.
	* merge.c: Likewise.
	* opncls.c: Likewise.
	* pdp11.c: Likewise.
	* sparclinux.c: Likewise.
	* stabs.c: Likewise.
	* sunos.c: Likewise.
	* vms.c: Likewise.
	* xcofflink.c: Likewise.
	* section.c (struct section_hash_entry): Move to..
	* libbfd-in.h: ..here.
	* Makefile.am: Run "make dep-am"
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* libcoff.h: Regenerate.
binutils/
	* ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls.
	* wrstabs.c (write_stabs_in_sections_debugging_info): Likewise.
ld/
	* ldcref.c (add_cref): Adjust bfd_hash_table_init calls.
	* ldlang.c (output_statement_table_init, lang_init): Likewise.
	* ldmain.c (add_ysym, add_wrap, add_keepsyms_file): Likewise.
	(undefined_symbol): Likewise.
2006-03-16 12:20:16 +00:00
Richard Sandiford 7325306f39 bfd/
* elf-bfd.h (elf_link_hash_table): Add hplt field.
	* elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
	* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
	* elf32-frv.c (_frv_create_got_section): Likewise.
	* elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
	* elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
	* elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
	* elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
	* elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
	(elf_i386_link_hash_table_create): Don't initialize them.
	(elf_i386_size_dynamic_sections): Use the generic ELF hplt and
	hgot fields.
	(elf_i386_finish_dynamic_symbol): Likewise.
	* elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
	(ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
	(ppc_elf_finish_dynamic_symbol): Likewise.
2006-02-25 09:23:30 +00:00
H.J. Lu 508c39462a 2006-02-24 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2218
	* elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
	(_bfd_elf_link_hash_fixup_symbol): New.

	* elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
	(_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
	it isn't NULL.

	* elfxx-ia64.c (elf_backend_fixup_symbol): Defined.

	* elfxx-target.h (elf_backend_fixup_symbol): New.
	(elfNN_bed): Initialize elf_backend_fixup_symbol.
2006-02-24 15:47:25 +00:00
Alan Modra e0ae6d6fe9 * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
debug sections.
	(elf_link_input_bfd): Adjust comments.
2006-02-15 14:12:54 +00:00
Alan Modra 64d03ab565 * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
(bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
	* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
	elf_gc_mark_dynamic_ref_symbol.  Make global.
	(bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
	* elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
	(elfNN_bed): Init new field.
	* elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
	(ppc64_elf_gc_mark_dynamic_ref): New function.
2006-01-17 15:32:41 +00:00
Nick Clifton 12ac1cf537 PR 1150
* elf-bfd.h (struct elf_backend_data): New field 'elf_backend_ignore_undef_symbol'.
* elfxx-target.h (elf_backend_ignore_undef_symbol): Define to NULL if not
  already defined.
  (elfNN_bed): Initialise the elf_backend_ignore_undef_symbol field.
* elfxx-mips.c (_bfd_mips_elf_ignore_undef_symbol): New function.
* elfxx-mips.h (elf_backend_ignore_undef_symbol): Define and prototype.
* elflink.c (elf_link_output_extsym): Check elf_backend_ignore_undef_symbol
  before reporting an undefined symbol in a shared library.
2005-12-23 12:29:36 +00:00
Alan Modra 5adcfd8b2c * elflink.c (elf_gc_mark_dynamic_ref_symbol): Use !info-executable
to test for linking shared libs, not info->shared.
2005-12-10 03:31:03 +00:00
H.J. Lu fe21a8fc74 bfd/
2005-12-07  Thiemo Seufer  <ths@networkno.de>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1932
	* bfd-in.h (bfd_elf_record_link_assignment): Add output_bfd
	and hidden arguments.

	* bfd.c (bfd_hide_symbol): Removed.

	* bfd-in2.h: Regenerated.

	* elflink.c (bfd_elf_record_link_assignment): Handle hidden
	symbols which were provided by a linker script.

ld/

2005-12-07  Thiemo Seufer  <ths@networkno.de>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1932
	* emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
	Adjust bfd_elf_record_link_assignment call.

	* ldexp.c (exp_fold_tree_1): Remove call to bfd_hide_symbol.
2005-12-07 14:43:54 +00:00
Alan Modra 3a800eb947 * elf.c (elf_fake_sections): When calculating tbss size, just use
the last link_order.
	(assign_file_positions_for_segments): Likewise.
	* elflink.c (bfd_elf_final_link): Likewise.
	(elf_reloc_link_order): Correct comment.
2005-11-03 02:53:38 +00:00
Alan Modra fcfa13d2b2 PR ld/1540
* elf-bfd.h (elf_backend_copy_indirect_symbol): Replace pointer to
	elf_backend_data with pointer to bfd_link_info.
	(_bfd_elf_link_hash_copy_indirect): Likewise.
	* elf.c (_bfd_elf_link_hash_copy_indirect): Likewise.  Handle
	direct and indirect symbols both having dynamic link info.
	* elf32-arm.c (elf32_arm_copy_indirect_symbol): Likewise.
	* elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise.
	* elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise.
	* elf32-m32r.c (m32r_elf_copy_indirect_symbol): Likewise.
	* elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise.
	* elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise.
	* elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
	* elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise.
	* elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise.
	* elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
	* elflink.c: Adjust all calls to bed->elf_backend_copy_indirect_symbol.
	* elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Update prototype.
	* elfxx-sparc.h (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
2005-10-25 16:19:08 +00:00
Alan Modra f02571c5d9 * elflink.c (elf_link_input_bfd): Don't use linker_mark and
SEC_EXCLUDE to test for sections dropped from output.  Instead,
	use bfd_section_removed_from_list on normal sections.  Don't
	attempt to handle symbols with unknown reserved section indices.
	* linker.c (_bfd_generic_link_output_symbols): Don't use
	linker_mark to test for symbols belonging to dropped sections.
	Do allow absolute symbols.
2005-10-24 11:24:31 +00:00
H.J. Lu d33cdfe369 2005-09-28 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_fixup_link_order): Report locations for mixed
	ordered and unordered input sections.
2005-09-28 14:52:02 +00:00
Alan Modra 707bba77b5 * elflink.c (_bfd_elf_merge_symbol): Simplify. 2005-09-19 23:30:05 +00:00
H.J. Lu e04bcc6d65 2005-09-08 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_get_linked_section_vma): Fix a typo in comment.
	* elfxx-ia64.c (elf_backend_link_order_error_handler): Likewise.
2005-09-09 05:11:51 +00:00
H.J. Lu 92fd189de1 2005-09-08 H.J. Lu <hongjiu.lu@intel.com>
PR ld/1263
	* elflink.c (elf_link_add_object_symbols): Abort for
	--just-symbols on DSO.
2005-09-08 14:24:22 +00:00
H.J. Lu 68f49ba335 2005-09-06 H.J. Lu <hongjiu.lu@intel.com>
PR ld/1301
	* elflink.c (_bfd_elf_merge_symbol): Don't check undefined
	symbol introduced by "ld -u" for TLS.
2005-09-07 05:01:16 +00:00
Alan Modra ccabcbe51e * elflink.c (_bfd_elf_define_linkage_sym): Don't call
bfd_elf_link_record_dynamic_symbol.  Call elf_backend_hide_symbol.
	(_bfd_elf_link_renumber_dynsyms): Formatting.
	(struct elf_gc_sweep_symbol_info): New.
	(elf_gc_sweep_symbol): Rewrite.
	(elf_gc_sweep): Adjust params and elf_gc_sweep_symbol call.
	Call _bfd_elf_link_renumber_dynsyms.
	(bfd_elf_gc_sections): Adjust elf_gc_sweep call.
2005-08-17 03:07:12 +00:00
Alan Modra d98685ac81 * elf-bfd.h (_bfd_elf_define_linkage_sym): Declare.
* elflink.c (_bfd_elf_define_linkage_sym): New function, extracted
	from..
	(_bfd_elf_create_got_section): ..here.
	(_bfd_elf_link_create_dynamic_sections): Call it for _DYNAMIC.
	(_bfd_elf_create_dynamic_sections): ..and _PROCEDURE_LINKAGE_TABLE_.
	* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Use
	_bfd_elf_define_linkage_sym.
	* elf32-frv.c (_frv_create_got_section): Likewise.
	* elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
2005-08-15 15:39:08 +00:00
Alan Modra 046183de0e bfd/
* elf32-ppc.c (struct elf_linker_section): Replace sym_val field
	with sym.
	(ppc_elf_relocate_section): Adjust for above.
	(create_sdata_sym): New function.
	(ppc_elf_create_linker_section): Call it.
	(ppc_elf_check_relocs): Correct has_sda_refs and non_got_refs.
	Create sdata syms for all SDA relocs.
	(ppc_elf_adjust_dynamic_symbol): Don't special case _SDA_BASE_
	and _SDA2_BASE_.
	(ppc_elf_set_sdata_syms): Delete.
	* elflink.c (bfd_elf_size_dynamic_sections): Don't create DT_INIT
	and DT_FINI tags unless associated section has input.
	(bfd_elf_set_symbol, _bfd_elf_provide_symbol): Delete.
	(_bfd_elf_provide_section_bound_symbols): Delete.
	* bfd-in.h (_bfd_elf_provide_symbol): Delete.
	(_bfd_elf_provide_section_bound_symbols): Delete.
	* bfd-in2.h: Regenerate.
ld/
	* ldemul.c (ldemul_do_assignments, do_assignments_default): Delete.
	* ldemul.h (ldemul_do_assignments, do_assignments_default): Delete.
	(struct ld_emulation_xfer_struct): Remove do_assignments field.
	* ldlang.c (lang_do_assignments): Don't call ldemul_do_assignments.
	* emulparams/elf32ppc.sh (SDATA_START_SYMBOLS): New.
	(SDATA2_START_SYMBOLS, SBSS_START_SYMBOLS, SBSS_END_SYMBOLS): New.
	* emultempl/aix.em (ld_*_emulation): Delete do_assignments init.
	* emultempl/armcoff.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/generic.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68kcoff.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/vanilla.em: Likewise.
	* emultempl/elf32.em: Likewise.
	(gld*_provide_bound_symbols): Delete.
	(gld*_provide_init_fini_syms): Delete.
	(gld*_before_allocation): Don't call ldemul_do_assignments.
	* emultempl/ppc32elf.em (ppc_do_assignments): Delete.
	(LDEMUL_DO_ASSIGNMENTS): Delete.
	* scripttempl/elf.sc: Provide init/fini syms.  Add SBSS_START_SYMBOLS,
	SBSS_END_SYMBOLS, SDATA2_START_SYMBOLS.
2005-08-04 06:22:14 +00:00
Alan Modra 1e035701d6 bfd/
* elflink.c (fix_syms, _bfd_elf_fix_excluded_sec_syms): Move to..
	* linker.c (fix_syms, _bfd_fix_excluded_sec_syms): ..here.
	* bfd-in.h (_bfd_fix_excluded_sec_syms): Rename.
	* bfd-in2.h: Regenerate.
ld/
	* ldemul.c (ldemul_finish): Call ld_emulation->finish unconditionally.
	(finish_default): New function.
	* ldemul.h (finish_default): Declare.
	* emultempl/aix.em (gld*_before_allocation): Call
	before_allocation_default rather than strip_excluded_output_sections.
	(ld_*_emulation): Init finish field to finish_default.
	* emultempl/armcoff.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/generic.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68kcoff.em: Likewise.
	* emultempl/mmo.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/vanilla.em: Likewise.
2005-08-04 01:19:10 +00:00
David Daney 1b9ee6a2f0 * elflink.c (elf_gc_sweep): Set dynsymcount to correct value. 2005-07-31 06:14:15 +00:00
Alan Modra 8a69675106 * elf-bfd.h (struct elf_backend_data): Add action_discarded.
(enum action_discarded): Move from..
	* elflink.c (enum action_discarded): ..here.
	(_bfd_elf_default_action_discarded): Rename from elf_action_discarded.
	Remove target specific section checks.
	(elf_link_input_bfd): Adjust.
	* elfxx-target.h (elf_backend_action_discarded): Define.
	(elfNN_bed): Init new field.
	* bfd-in.h (_bfd_elf_default_action_discarded): Declare.
	* bfd-in2.h: Regenerate.
	* elf-hppa.h (elf_hppa_action_discarded): New function.
	* elf32-hppa.c (elf_backend_action_discarded): Define.
	* elf64-hppa.c (elf_backend_action_discarded): Define.
	* elf32-ppc.c (ppc_elf_action_discarded): New function.
	(elf_backend_action_discarded): Define.
2005-07-29 02:46:04 +00:00
Alan Modra 2f5028a7c8 * elflink.c (fix_syms): Handle symbols defined in input sections. 2005-07-27 08:32:53 +00:00
Alan Modra f41d945bae * elflink.c (_bfd_elf_merge_symbol): Skip weak redefinition
regardless of strength of previous definition.
2005-07-26 15:19:37 +00:00
Alan Modra 87538722be * elflink.c (elf_gc_mark_dynamic_ref_symbol): Handle -shared.
(bfd_elf_gc_sections): Allow -gc-sections when -shared.
	* elf32-ppc.c (ppc_elf_gc_sweep_hook): Correct for -shared.
2005-07-26 12:06:38 +00:00
Alan Modra 9e8cc8b4bf * elflink.c (elf_gc_sweep): Move gcc_except_table code..
(bfd_elf_gc_sections): ..to here.
2005-07-26 11:47:05 +00:00
H.J. Lu a4d8e49b50 2005-07-25 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Add common_definition,
	common_section_index, common_section, and merge_symbol.
	(_bfd_elf_common_definition): New.
	(_bfd_elf_common_section_index): New.
	(_bfd_elf_common_section): New.

	* elf.c (elf_fake_sections): Don't clear sh_flags.

	* elflink.c (_bfd_elf_merge_symbol): Call backend merge_symbol
	if it is available.
	(is_global_data_symbol_definition): Call backend
	common_definition instead of checking SHN_COMMON.
	(elf_link_add_object_symbols): Likewise.
	(elf_link_output_extsym): Call backend common_section_index
	for common section index.
	(_bfd_elf_common_definition): New.
	(_bfd_elf_common_section_index): New.
	(_bfd_elf_common_section): New.

	* elfxx-target.h (elf_backend_common_definition): New.
	(elf_backend_common_section_index): New.
	(elf_backend_common_section): New.
	(elf_backend_merge_symbol): New.
	(elfNN_bed): Initialize common_definition, common_section_index,
	common_section, and merge_symbol.

	* section.c (BFD_FAKE_SECTION): New.
	(STD_SECTION): Use it.
	* bfd-in2.h: Regenerated.
2005-07-25 15:35:37 +00:00
H.J. Lu 58ac56d0c8 2005-07-23 Olaf Hering <olh@suse.de>
* elflink.c (elf_link_input_bfd): Add '\n' for linker einfo
	callback.
2005-07-23 15:42:51 +00:00
Eric Botcazou cc86ff917d PR ld/1021
PR ld/1031
	* elflink.c (elf_link_add_object_symbols): Also append the version
	name to non-hidden absolute symbols that are functions.
2005-07-16 15:08:14 +00:00
Alan Modra eaae8ded62 * elflink.c (bfd_elf_record_link_assignment): Remove output_bfd param.
(_bfd_elf_provide_symbol): Allow redefinition of weak syms and those
	defined in output sections.  Call bfd_elf_record_link_assignment.
	* bfd-in.h (bfd_elf_record_link_assignment): Update prototype.
	* bfd-in2.h: Regenerate.
2005-07-15 12:18:01 +00:00
Alan Modra a3c2b96af6 bfd/
* bfd-in.h (_bfd_elf_fix_excluded_sec_syms): Declare.
	(_bfd_elf_provide_section_bound_symbols): Remove param name.
	Formatting.
	* bfd-in2.h: Regenerate.
	* elflink.c (bfd_elf_gc_sections): Don't call generic function.
	(_bfd_elf_provide_symbol): Formatting.
	(_bfd_elf_provide_section_bound_symbols): Remove all hacks, just
	create section relative syms.
	(fix_syms, _bfd_elf_fix_excluded_sec_syms): New functions.
	* elf32-ppc.c (ppc_elf_set_sdata_syms): Use
	_bfd_elf_provide_section_bound_symbols.
	* reloc.c (bfd_mark_used_section): Delete.
	(bfd_generic_gc_sections): Don't call the above.
ld/
	* ldlang.c (strip_excluded_output_sections): Don't call
	bfd_gc_sections.
	* emultempl/elf32.em (gld*_provide_bound_symbols): Move.
	(gld*_provide_init_fini_syms): Move.
	(gld*_before_allocation): Call the above from here..
	(gld*_finish): ..not here.  Call _bfd_elf_fix_excluded_sec_syms.
	* emultempl/hppaelf.em (hppaelf_finish): Likewise.
	* emultempl/ppc64elf.em (ppc_finish): Likewise.
2005-07-14 13:54:23 +00:00
H.J. Lu 49ff44d641 2005-07-11 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_symbol_refs_local_p): Revert the last
	change.
2005-07-11 17:40:25 +00:00
H.J. Lu 9968d831f9 2005-07-07 H.J. Lu <hongjiu.lu@intel.com>
PR 975
	* elflink.c (_bfd_elf_symbol_refs_local_p): Only undefined
	symbol with default visibility is local.
2005-07-07 17:44:58 +00:00
Alan Modra b116d4a7eb * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Ignore dynamic
_SDA_BASE_ and _SDA2_BASE_ symbols.
	* elflink.c (_bfd_elf_provide_symbol): Correct comment.  Define
	sym if not def_regular.
	(_bfd_elf_provide_section_bound_symbols): Similarly.
2005-06-30 08:11:15 +00:00
Alan Modra 39c2f51bd9 * elflink.c (_bfd_elf_gc_mark): Mark sections referenced by
.eh_frame specially..
	(bfd_elf_gc_sections): ..rather than totally ignoring .eh_frame.
	Don't recheck sections we have already marked.
	(elf_gc_sweep): Keep non-code sections referenced from .eh_frame.
	* section.c (struct bfd_section): Add gc_mark_from_eh.
	(STD_SECTION): Adjust.
	* ecoff.c (bfd_debug_section): Adjust.
	* bfd-in2.h: Regenerate.
2005-06-29 14:05:21 +00:00
Alan Modra e8aaee2ad4 * elflink.c (elf_gc_sweep): Do not refcount on sections that have
not been processed by check_relocs.
2005-06-29 13:56:06 +00:00
Paul Brook 3b2175db9a 2005-06-29 Paul Brook <paul@codesourcery.com>
* bfd-in.h (_bfd_elf_provide_symbol): Update prototype.
	* bfd-in2.h: Regenerate.
	* elf32-ppc.c (ppc_elf_set_sdata_syms): Make sdata symbols section
	relative.
	* elflink.c (bfd_elf_set_symbol): Add section argument.
	(_bfd_elf_provide_symbol): Ditto.
	(_bfd_elf_provide_section_bound_symbols): Pass NULL section argument.
2005-06-29 13:16:44 +00:00
H.J. Lu 91134c823b 2005-06-14 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_merge_symbol): Fix a typo in comment.
2005-06-14 19:25:45 +00:00
Alan Modra 0e58fcf315 * elflink.c (elf_mark_used_section): Delete.
(bfd_elf_gc_sections): Call bfd_generic_gc_sections.
	* reloc.c (bfd_mark_used_section): New function.
	(bfd_generic_gc_sections): Call bfd_mark_used_section.
2005-06-09 02:02:18 +00:00
Alan Modra e1fffbe6e9 include/
* bfdlink.h (struct bfd_link_callbacks): Add einfo.
bfd/
	* configure.in: Bump version
	* configure: Regenerate.
	* elflink.c (elf_link_input_bfd): Use einfo linker callback to print
	discarded section sym refs and kill linker output.
	* simple.c (simple_dummy_einfo): New function.
	(bfd_simple_get_relocated_section_contents): Init callbacks.einfo.
ld/
	* ldmain.c (link_callbacks): Add einfo.
	(add_archive_element): Use passed info, not link_info.
	(constructor_callback): Likewise.
	(reloc_overflow): Don't handle null bfd specially.
	(reloc_dangerous, unattached_reloc): Likewise.
	* ldmisc.c (vfinfo <B>): Print "ld generated" for null bfd.
	(vfinfo <C, D, G>): Handle null bfd.  Wrap comments.
2005-06-03 09:52:50 +00:00
Alan Modra a6aa51957c * elf-bfd.h (struct elf_link_hash_table): Delete init_refcount and
init_offset.  Add init_got_refcount, init_plt_refcount,
	init_got_offset and init_plt_offset.
	* elf.c (_bfd_elf_link_hash_newfunc): Adjust for above change.
	(_bfd_elf_link_hash_hide_symbol): Likewise.
	(_bfd_elf_link_hash_table_init): Likewise.
	* elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
	* elflink.c (_bfd_elf_adjust_dynamic_symbol): Likewise.
	(bfd_elf_size_dynamic_sections): Likewise.
	* elf32-ppc.c (GLINK_PLTRESOLVE): Now 16 insns.
	(LWZU_0_X_12, LWZ_0_4_30, LWZ_0_X_12, LWZ_11_X_11, LWZ_11_X_30,
	LWZ_12_4_12, LWZ_12_8_30, LWZ_12_X_12, SUB_11_11_30): Delete.
	(ADDIS_12_12, BCL_20_31, LWZU_0_12, LWZ_0_12, LWZ_11_11, LWZ_11_30,
	LWZ_12_12, MFLR_0, MFLR_12, MTLR_0, SUB_11_11_12): Define.
	(struct plt_entry): New.
	(ppc_elf_link_hash_table_create): Set new init_plt fields.
	(ppc_elf_copy_indirect_symbol): Handle merge of plt plist.  Don't
	use _bfd_elf_link_hash_copy_indirect.
	(update_plt_info, find_plt_ent): New functions.
	(ppc_elf_check_relocs): Handle R_PPC_PLTREL24 with non-zero addend
	and adjust for use of plt list rather than refcount.
	(ppc_elf_gc_sweep_hook): Likewise.
	(ppc_elf_tls_optimize): Likewise.
	(ppc_elf_adjust_dynamic_symbol): Likewise.
	(allocate_dynrelocs): Likewise.
	(ppc_elf_relax_section): Likewise.
	(ppc_elf_relocate_section): Likewise.  Adjust R_PPC_PLTREL24 addends
	when performing a relocatable link.
	(ppc_elf_finish_dynamic_symbol): Likewise.  Write .glink stubs here..
	(ppc_elf_finish_dynamic_sections): ..rather than here.  Use new
	pic resolver stub.
2005-05-19 08:26:56 +00:00
Mark Kettenis 060848126d * elflink.c (bfd_elf_size_dynamic_sections): Use lbasename instead
of basename.
2005-05-14 13:49:42 +00:00