Commit Graph

20 Commits

Author SHA1 Message Date
Ian Lance Taylor accc7f6940 * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
if they appear to be specially created by the linker.
1999-07-19 19:08:33 +00:00
Andreas Schwab a9602746fa * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash
and rel_hdr.
1999-07-19 09:11:14 +00:00
Mark Mitchell 31367b81b7 * elflink.h (elf_link_adjust_relocs): New function.
(elf_bfd_final_link): Use it.
	(elf_link_input_bfd): Deal with the fact that there can be
	two relocation sections for a single section.
	(elf_reloc_link_order): Likewise.

	* elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for
	a relocateable object.
	(_bfd_mips_elf_relocate_section): Handle relocateable links.
1999-07-18 06:31:29 +00:00
Andreas Schwab 318da145ed * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused
variables `link' and `elfsec'.
	(elf_bfd_final_link): Remove unused variable `os'.
1999-07-16 08:10:27 +00:00
Richard Henderson 30b30c2181 * elf-bfd.h (struct elf_link_local_dynamic_entry): New.
(struct elf_link_hash_table): Add dynlocal.
	(_bfd_elf_link_lookup_local_dynindx): Prototype.
	(_bfd_elf_link_adjust_dynindx): Delete.
	(_bfd_elf_link_renumber_dynsyms): Prototype.
	(_bfd_elf,link_record_local_dynamic_symbol): Prototype.
	* elfcode.h (elf_link_record_local_dynamic_symbol): New alias.
	* elflink.c (_bfd_elf_link_adjust_dynindx): Delete.
	(_bfd_elf_link_lookup_local_dynindx): New function.
	(elf_link_renumber_hash_table_dynsyms): New function.
	(_bfd_elf_link_renumber_dynsyms): New function.
	* elflink.h (elf_link_record_local_dynamic_symbol): New function.
	(struct elf_assign_sym_version_info): Delete removed_dynamic.
	(bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output
	instead of elf_link_remove_section_and_adjust_dynindices.
	Remove removed_dynamic code.  Use _bfd_elf_link_renumber_dynsyms.
	(elf_link_assign_sym_version): Remove removed_dynamic code.
	(elf_link_renumber_dynsyms): Delete.
	(elf_bfd_final_link): Install section and local symbols into .dynsym.
	* elf32-m68k.c (elf_m68k_adjust_dynindx): Delete.
	(elf_m68k_size_dynamic_sections): Don't set section dynindicies.
	(elf_m68k_finish_dynamic_sections): Don't write section dynsyms.
	* elf32-mips.c: Similarly.
	* elf32-ppc.c: Similarly.
	* elf32-sparc.c: Similarly.
	* elf64-alpha.c: Similarly.
	* elf64-sparc.c: Similarly.
1999-07-13 18:21:29 +00:00
Ian Lance Taylor 7442e600c8 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
as appropriate.  Fill in structure initializations.  Add variable
	initializations.  Add casts.
	* dwarf1.c (parse_line_table): Change eachLine to unsigned long.
	(dwarf1_unit_find_nearest_line): Change i to unsigned long.
1999-07-11 19:49:48 +00:00
Ian Lance Taylor 3a99b017b3 * elf.c (bfd_elf_hash): Change parameter from unsigned char * to
char *.
	* elf-bfd.h (bfd_elf_hash): Update declaration.
	* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts
	when calling bfd_elf_hash.
1999-07-11 17:13:36 +00:00
Mark Mitchell 65388f2d50 * elflink.h (elf_link_read_relocs_from_section): Be type-correct. 1999-07-11 00:12:14 +00:00
Mark Mitchell c7ac6ff835 * elflink.h (elf_link_create_dynamic_sections): Handle non-standard
hash-entry sizes.
	(size_dynamic_sections): Likewise.
	(elf_link_output_extsym): Likewise.
	* elf.c: (elf_fake_sections): Likewise.
	* libbfd.c (bfd_get): New macro.
	(bfd_put): Likewise.
	* bfd-in2.h: Regenerated.
	* elf-bfd.h (elf_size_info): Add hash_entry_size,
	int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out,
	wap_reloca_in, and swap_reloca_out.
	* elflink.h (elf_link_read_relocs_from_section): Adjust to handle
	multiple internal relocations per external relocation.
	(link_read_relocs): Likewise.
	(elf_bfd_final_link): Likewise.
	(elf_link_input_bfd): Likewise.
	(elf_gc_mark): Likewise.
	(elf_gc_smash_unused_vtentry_relocs): Likewise.
	* elfcode.h (elf_swap_dyn_out): Adjust type to match
	elf_swap_dyn_in.
	(size_info): Add entries for new fields.
	* elf64-mips.c (mips_elf64_swap_reloc_out): Enable.
	(mips_elf64_be_swap_reloc_in): New function.
	(mips_elf64_be_swap_reloc_out): Likewise.
	(mips_elf64_be_swap_reloca_in): Likewise.
	(mips_elf64_be_swap_reloca_out): Likewise.
	(mips_elf64_size_info): Add entries for new fields.
1999-07-07 17:50:56 +00:00
Ian Lance Taylor b4536acd1f tweak last elf_merge_symbol patch 1999-07-07 15:29:06 +00:00
Ian Lance Taylor 0525d26ec3 * elflink.h (elf_bfd_final_link): Assert that section reloc_count
field equals the new rel_count field.
	(elf_link_input_bfd): When doing a relocateable link, use the new
	rel_count field rather than the reloc_count field.
	(elf_reloc_link_order): Likewise.
	(elf_finish_pointer_linker_section): Likewise.
	Based on patch from H.J. Lu <hjl@gnu.org>:
	* elflink.h (elf_merge_symbol): Permit a non-weak definition in a
	shared library to override a weak definition in a regular object.
1999-07-07 11:39:43 +00:00
Mark Mitchell 23bc299bd8 * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2
fields.
	(_bfd_elf_init_reloc_shdr): New function.
	* elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than
	bfd_alloc followed by memset.
	(_bfd_elf_init_reloc_shdr): New function, split out from ...
	(elf_fake_sections): Here.
	(assign_section_numbers): Assign section numbers for the second
	relocation section, if required.
	* elflink.h (elf_link_output_relocs): New function.
	(elf_link_size_reloc_section): Likewise.
	(elf_bfd_final_link): Use elf_link_size_reloc_section.
	(elf_link_input_bfd): Use elf_link_output_relocs.
	* elf32-mips.c (_bfd_mips_elf_fake_sections): Use
	_bfd_elf_init_reloc_shdr to initialize rel_hdr2.
1999-07-01 23:20:08 +00:00
Ian Lance Taylor 1d7b28df8d * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic
shared library to have an undefined symbol.
1999-06-26 09:00:19 +00:00
Mark Mitchell f0c2e336c8 * elflink.h (size_dynamic_sections): Use user-specified init/fini
functions instead of _init/_fini if requested.
1999-06-23 11:06:57 +00:00
Mark Mitchell 2f5116e25d * elflink.h (link_read_relocs): Explicitly cast external_relocs to
bfd_byte * before performing pointer arithmetic.
1999-06-22 13:57:15 +00:00
Ian Lance Taylor f800e11d88 * elflink.h (elf_link_remove_section_and_adjust_dynindices):
Remove unused local variable spp.
1999-06-19 14:10:28 +00:00
Mark Mitchell 78de0b4335 * elflink.h (elf_link_remove_section_and_adjust_dynindices):
Remove abfd parameter.  Use _bfd_strip_section_from_output.
	(bfd_elf_size_dynamic_sections): Adjust callers accordingly.
1999-06-13 18:35:29 +00:00
Mark Mitchell 42751cf354 * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function.
* elflink.c (_bfd_elf_link_adjust_dynindx): Define it.
	* elflink.h (elf_link_remove_section_and_adjust_dynindices): New
	function.
	(bfd_elf_size_dynamic_sections): Use it.
1999-06-13 14:49:51 +00:00
Mark Mitchell 6b5bd373fb * elflink.h (elf_link_read_relocs_from_section): New function,
split out from ...
	(elf_link_read_relocs): Here.  Use it for both relocation
	sections.
1999-06-13 01:13:26 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00