Commit Graph

6341 Commits

Author SHA1 Message Date
Michael Snyder 5ba8816a2d Fix bollixed check-in 2007-07-26 21:58:44 +00:00
Michael Snyder 2d4f3e92ff 2007-07-26 Michael Snyder <msnyder@access-company.com>
* linker.c (already_linked_newfunc): Check for NULL return from
	bfd_hash_allocate.
2007-07-26 21:53:35 +00:00
Michael Snyder ac38308c95 2007-07-26 Michael Snyder <msnyder@access-company.com>
* coffgen.c (fixup_symbol_value): Guard against null;
	bfd_is_com_section will dereference the section pointer.
2007-07-26 19:06:12 +00:00
Michael Snyder c82a7c57df 2007-07-26 Michael Snyder <msnyder@access-company.com>
* syms.c (bfd_decode_symclass): Guard against NULL, since
	bfd_is_com_section dereferences the pointer.
2007-07-26 18:53:51 +00:00
Michael Snyder 3d7b34d85b 2007-07-26 Michael Snyder <msnyder@access-company.com>
* srec.c (srec_scan): Check for EOF (critical because return value
	will be used as array index).
2007-07-26 18:45:13 +00:00
Michael Snyder 44c62d9e24 2007-07-26 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs
	are not to be cached, free the temporary buffer.
2007-07-26 18:43:24 +00:00
Michael Snyder 078c4bfc87 2007-07-26 Michael Snyder <msnyder@access-company.com>
* aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero
	or count == zero.
2007-07-26 18:30:28 +00:00
Michael Snyder 814b5378b4 2007-07-26 Michael Snyder <msnyder@access-company.com>
* tekhex.c (first_phase): Check return value for null.
2007-07-26 18:18:07 +00:00
Michael Snyder b7fd5ce17d 2007-07-26 Michael Snyder <msnyder@access-company.com>
* elf.c (_bfd_elf_get_synthetic_symtab): Remove meaningless
	pointer increment.
2007-07-26 18:15:46 +00:00
Alan Modra 33774f084b * elflink.c (_bfd_elf_fix_symbol_flags): Remove unnecessary
check on dynobj.  Remove bed shadow.
2007-07-26 13:45:59 +00:00
Alan Modra e62071b60e * srec.c (srec_get_section_contents): Return immediately on
count zero.  Check that offset and count are within section.
	* libbfd.c (_bfd_generic_get_section_contents): Check that
	offset + count does not overflow.
2007-07-26 12:34:43 +00:00
Alan Modra b9da616afe * srec.c (srec_canonicalize_symtab): Don't alloc when symcount
is zero.  Correct return value on error.
	* mmo.c (mmo_canonicalize_symtab): Likewise.
	* binary.c (binary_canonicalize_symtab) Correct return on error.
2007-07-26 11:13:59 +00:00
Thiemo Seufer c2c966314b * bfd.c (_bfd_set_gp_value): Use abort instead of BFD_FAIL. 2007-07-26 11:05:23 +00:00
Alan Modra d494715016 * reloc.c (bfd_generic_get_relocated_section_contents): Avoid
bfd_canonicalize_reloc call when bfd_get_reloc_upper_bound
	says there are no relocs.
2007-07-26 09:37:13 +00:00
Nick Clifton bd210d54db Speed up bfd_dwarf2_find_line.
* dwarf2.c (struct dwarf2_debug): Add new fields to support function and variable info hash tables. Add last_comp_unit, info_hash_count, funcinfo_hash_table, varinfo_hash_table, hash_units_head.
  (struct comp_unit): Add prev_unit, cached.
  (struct info_list_node, struct info_hash_entry, struct info_hash_table): New.
  (info_hash_table_newfunc, create_info_hash_table, insert_info_hash_table, lookup_info_hash_table): New functions implementing function and variable info hash tables.
  (scan_unit_for_symbols): Add checks to make sure hash tables are consistent with compilation units.
  (comp_unit_maybe_decode_line_info): New function.
  (comp_unit_find_line): Use comp_unit_maybe_decode_line_info.
  (reverse_funcinfo_list, reverse_varinfo_list, comp_unit_hash_info, info_hash_lookup_funcinfo, info_hash_lookup_varinfo, stash_maybe_update_info_hash_table, stash_verify_info_hash_table, stash_maybe_enable_info_hash_tables, stash_find_line_fast): New functions. Make use of info hash tables to speed up bfd_dwarf2_find_line.
  (find_line): Use hash table for faster lookup if it is turned on.
  Also add code to maintain bi-directional link in comp units.
2007-07-26 08:31:03 +00:00
Michael Snyder 353c55748a 2007-07-25 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done
	if size == 0; return and avoid possible null pointer issues.
2007-07-26 02:01:49 +00:00
Alan Modra d429448cf8 daily update 2007-07-26 00:00:07 +00:00
Alan Modra 7124a847c2 daily update 2007-07-25 00:00:17 +00:00
Alan Modra f08c429c32 warning fix 2007-07-24 23:38:13 +00:00
Michael Snyder f6eea5aed8 2007-07-23 Michael Snyder <msnyder@access-company.com>
* opncls.c (bfd_make_writable): Check return from bfd_malloc.
2007-07-24 19:58:06 +00:00
Michael Snyder d0f16d5ece 2007-07-24 Michael Snyder <msnyder@access-company.com>
* elflink.c (bfd_elf_final_link): Avoid redundant frees -- return
	on bfd_malloc error rather than goto error_return.
2007-07-24 19:54:01 +00:00
Alan Modra 4d269e42e3 * elflink.c (_bfd_elf_link_just_syms, merge_sections_remove_hook,
_bfd_elf_merge_sections, _bfd_elf_link_hash_newfunc,
	_bfd_elf_link_hash_copy_indirect, _bfd_elf_link_hash_hide_symbol,
	_bfd_elf_link_hash_table_init, _bfd_elf_link_hash_table_create,
	bfd_elf_set_dt_needed_name, bfd_elf_get_dyn_lib_class,
	bfd_elf_set_dyn_lib_class, bfd_elf_get_needed_list,
	bfd_elf_get_runpath_list, bfd_elf_get_dt_soname,
	bfd_elf_get_bfd_needed_list, struct elf_symbuf_symbol,
	struct elf_symbuf_head, struct elf_symbol, elf_sort_elf_symbol,
	elf_sym_name_compare, elf_create_symbuf,
	bfd_elf_match_symbols_in_sections,
	_bfd_elf_match_sections_by_type): Move to here..
	* elf.c: ..from here.
2007-07-24 08:09:20 +00:00
Alan Modra 685b3d2680 daily update 2007-07-24 00:00:06 +00:00
Richard Sandiford a26587bab5 bfd/
* elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
	of weakdef->root.type if weakdef has no regular definition.

ld/testsuite/
	* ld-elf/weak-dyn-1a.s, ld-elf/weak-dyn-1b.s, ld-elf/weak-dyn-1.ld,
	* ld-elf/weak-dyn-1.rd: New test.
	* ld-elf/elf.exp: Run it.
2007-07-23 09:56:19 +00:00
Alan Modra 07a5aea53e daily update 2007-07-23 00:00:06 +00:00
Adam Nemet 0e53d9daab * elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
small_data_overflow_reported.
	(_bfd_mips_elf_link_hash_table_create): Initialize it.
	(_bfd_mips_elf_relocate_section) <bfd_reloc_overflow>: Report
	small-data section overflow.
2007-07-22 16:45:06 +00:00
Alan Modra 9516781d06 daily update 2007-07-22 00:00:05 +00:00
Alan Modra 8dcdf3b7aa daily update 2007-07-21 00:00:05 +00:00
Alan Modra dec4bb46b3 daily update 2007-07-20 00:00:07 +00:00
Nick Clifton 6b33789f61 PR binutils/4797
* dwarf2.c: (find_line) Do not dereference functionname_ptr if do_line is true.
2007-07-19 16:51:10 +00:00
Alan Modra b93bc07744 daily update 2007-07-19 00:00:06 +00:00
Bob Wilson 13161072f2 * elf32-xtensa.c (xtensa_callback_required_dependence): Ignore
non-ELF sections.
2007-07-18 21:06:06 +00:00
Bob Wilson e29297b73c * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Get section
vma and size for dynamic tags from the output sections.
2007-07-18 18:23:47 +00:00
Alan Modra a5d1b3b53e * elf-bfd.h (struct sym_sec_cache): Delete "sec". Add "shndx".
* elf.c (bfd_section_from_r_symndx): Don't cache bfd section of
	symbol.  Instead cache ELF section index.  Remove redundant
	checks of st_shndx.
2007-07-18 11:23:37 +00:00
Alan Modra e6b368d89f daily update 2007-07-18 00:00:05 +00:00
Alan Modra bd4dd364df daily update 2007-07-17 00:00:06 +00:00
Alan Modra cbafdc0d90 daily update 2007-07-16 00:00:06 +00:00
Mike Frysinger d955dada99 * trad-core.c (NBPG): If not defined, set to getpagesize(). 2007-07-15 06:33:34 +00:00
Alan Modra 20ee575b1e daily update 2007-07-15 00:00:06 +00:00
Alan Modra c144990811 daily update 2007-07-14 00:00:06 +00:00
Roland McGrath 979dc3bca9 . 2007-07-13 10:44:44 +00:00
Roland McGrath bfb53a4f5b 2007-07-13 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_obj_tdata): Revert last change.
	Add after_write_object_contents, after_write_object_contents_info.
	* elf.c (_bfd_elf_write_object_contents): Revert last change.
	Instead, call after_write_object_contents if set.
2007-07-13 10:44:12 +00:00
Alan Modra 44139f2d0c daily update 2007-07-13 00:00:05 +00:00
Nick Clifton d2df793a71 Add support for building on a 64-bit Windows host. 2007-07-12 07:16:41 +00:00
Alan Modra 2d9d480e3b daily update 2007-07-12 00:00:06 +00:00
Alan Modra 5aa7ce4b0a daily update 2007-07-11 00:00:06 +00:00
H.J. Lu a3a4ddad29 2007-07-10 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.in: Regenerated.
2007-07-10 15:03:03 +00:00
H.J. Lu 329b43c490 2007-07-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/4756
	* simple.c (bfd_simple_get_relocated_section_content): Don't
	apply relocation on executable and shared library.
2007-07-10 13:49:04 +00:00
Nathan Sidwell cfd2c77310 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate
copy relocs on vxworks.
2007-07-10 07:42:30 +00:00
Alan Modra 1489a3a0d7 * elf32-arm.c (elf32_arm_size_info): Init checksum_contents field.
* elf64-alpha.c (alpha_elf_size_info): Likewise.
	* elf64-hppa.c (hppa64_elf_size_info): Likewise.
	* elf64-mips.c (mips_elf64_size_info): Likewise.
	* elf64-s390.c (s390_elf64_size_info): Likewise.
	* elf64-sparc.c (elf64_sparc_size_info): Likewise.
2007-07-10 04:08:12 +00:00
H.J. Lu 00cbee0aa8 2007-07-09 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (bfd_elf_record_link_assignment): Handle indirect
	symbol.
	(_bfd_elf_merge_symbol): Properly update normal symbol when
	overriding the versioned symbol from a dynamic library.
2007-07-10 02:40:31 +00:00
Alan Modra e93cb65d42 daily update 2007-07-10 00:00:05 +00:00
Roland McGrath fd2f25da9b . 2007-07-09 21:25:39 +00:00
Roland McGrath ff59fc360e 2007-07-09 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_obj_tdata): Add members
	emit_note_gnu_build_id and note_gnu_build_id_sec.
	* elf.c (_bfd_id_note_section_size): New global function.
	(read_hex, _bfd_elf_write_build_id_section): New static functions.
	(_bfd_elf_write_object_contents): Call _bfd_elf_write_build_id_section
	if emit_note_gnu_build_id is set.
	* Makefile.am (elf.lo): Update dependencies.
2007-07-09 21:23:43 +00:00
Roland McGrath 20a761b5e9 2007-07-09 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_obj_tdata): Add members
	emit_note_gnu_build_id and note_gnu_build_id_sec.
	* elf.c (_bfd_id_note_section_size): New global function.
	(read_hex, _bfd_elf_write_build_id_section): New static functions.
	(_bfd_elf_write_object_contents): Call _bfd_elf_write_build_id_section
	if emit_note_gnu_build_id is set.
	* Makefile.am (elf.lo): Update dependencies.
	* elf-bfd.h (struct elf_size_info): Add checksum_contents hook.
	(bfd_elf32_checksum_contents, bfd_elf64_checksum_contents): Declare.
	* elfcode.h (elf_checksum_contents): New macro and function.
	(NAME(_bfd_elf,size_info)): Initialize checksum_contents hook.
2007-07-09 21:23:39 +00:00
Roland McGrath d94838b102 2007-07-09 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_size_info): Add checksum_contents hook.
	(bfd_elf32_checksum_contents, bfd_elf64_checksum_contents): Declare.
	* elfcode.h (elf_checksum_contents): New macro and function.
	(NAME(_bfd_elf,size_info)): Initialize checksum_contents hook.
2007-07-09 21:23:37 +00:00
Alan Modra 049c3c6b72 daily update 2007-07-09 00:00:06 +00:00
Alan Modra 5da62ef0e8 daily update 2007-07-08 00:00:06 +00:00
Alan Modra 489cadc25a daily update 2007-07-07 00:00:06 +00:00
Alan Modra 9af2a943ee * elflink.c (elf_link_add_object_symbols): Return via
error_free_vers on "notice" failure.
2007-07-06 02:29:10 +00:00
Alan Modra e3bb9257f6 daily update 2007-07-06 00:00:05 +00:00
H.J. Lu a93221e521 2007-07-04 H.J. Lu <hongjiu.lu@intel.com>
* peicode.h (pe_bfd_object_p): Don't check PE vs. EFI target
	if arch is unknown.
2007-07-05 02:50:02 +00:00
Alan Modra 004082e09a daily update 2007-07-05 00:00:06 +00:00
Nick Clifton b49281938d * elf32-mep.c (mep_final_link_relocate) [R_MEP_HI16S]: Correctly compensate
for high bit set in R_MEP_LOW16.
2007-07-04 14:23:22 +00:00
Alan Modra 51afcce0d3 daily update 2007-07-04 00:00:05 +00:00
Joseph Myers 3cfad14c4a bfd:
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from
	input attributes if value has been copied.

ld/testsuite:
	* ld-arm/attr-merge-2a.s, ld-arm/attr-merge-2b.s,
	ld-arm/attr-merge-2.attr: New.
	* ld-arm/arm-elf.exp (armelftests): Add new test.
2007-07-03 15:21:30 +00:00
Nick Clifton cd123cb70c Switch sources over to use the GPL version 3 2007-07-03 14:26:43 +00:00
Alan Modra 6e29ef6d28 daily update 2007-07-03 00:00:05 +00:00
Joseph Myers 741d6ea85b bfd:
* elfxx-mips.c (mips_elf_calculate_relocation): Handle
	R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64.
	* elf64-mips.c (mips_elf64_howto_table_rela): Support
	R_MIPS_TLS_DTPREL64.

gas:
	* config/tc-mips.c (s_dtprelword, s_dtpreldword,
	s_dtprel_internal): New.
	(mips_pseudo_table): Add .dtprelword and .dtpreldword.
	(md_apply_fix): Handle BFD_RELOC_MIPS_TLS_DTPREL32 and
	BFD_RELOC_MIPS_TLS_DTPREL64.
2007-07-02 10:49:42 +00:00
Alan Modra ae351704e2 Regenerate files. 2007-07-02 07:12:53 +00:00
Alan Modra 3e5484dbb9 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Tidy
symsec != NULL tests.
2007-07-02 06:51:57 +00:00
Alan Modra 08a40648e5 PR 4712
* elf.c (assign_file_positions_for_load_sections): Adjust lma
	by p_vaddr_offset.
2007-07-02 06:47:43 +00:00
Alan Modra 3adf154903 daily update 2007-07-02 00:00:06 +00:00
Alan Modra 89526cc00d daily update 2007-07-01 00:00:04 +00:00
H.J. Lu 86b57e315d bfd/
2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* Makefile.in: Likewise.

bfd/doc/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in: Likewise.

binutils/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* doc/Makefile.in: Likewise.
	* Makefile.in: Likewise.

gas/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* doc/Makefile.in: Likewise.
	* Makefile.in: Likewise.

gprof/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* Makefile.in: Likewise.

ld/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* Makefile.in: Likewise.

opcodes/

2007-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	* aclocal.m4: Regenerated.
	* Makefile.in: Likewise.
2007-06-30 17:21:16 +00:00
Joseph Myers 34c8bcbae2 bfd:
* elf32-ppc.c (ppc_elf_merge_obj_attributes): New.
	(ppc_elf_merge_private_bfd_data): Call it.

binutils:
	* readelf.c (display_power_gnu_attribute, process_power_specific):
	New.
	(process_arch_specific): Call process_power_specific.

include/elf:
	* ppc.h (Tag_GNU_Power_ABI_FP): Define.

ld/testsuite:
	* ld-powerpc/attr-gnu-4-0.s, ld-powerpc/attr-gnu-4-00.d,
	ld-powerpc/attr-gnu-4-01.d, ld-powerpc/attr-gnu-4-02.d,
	ld-powerpc/attr-gnu-4-1.s, ld-powerpc/attr-gnu-4-10.d,
	ld-powerpc/attr-gnu-4-11.d, ld-powerpc/attr-gnu-4-12.d,
	ld-powerpc/attr-gnu-4-13.d, ld-powerpc/attr-gnu-4-2.s,
	ld-powerpc/attr-gnu-4-20.d, ld-powerpc/attr-gnu-4-21.d,
	ld-powerpc/attr-gnu-4-22.d, ld-powerpc/attr-gnu-4-3.s,
	ld-powerpc/attr-gnu-4-31.d: New.
	* ld-powerpc/powerpc.exp: Run these new tests.
2007-06-30 00:03:40 +00:00
Alan Modra 89ebe69733 daily update 2007-06-30 00:00:05 +00:00
Joseph Myers 2cf19d5cb9 bfd:
* elfxx-mips.c (mips_elf_merge_obj_attributes): New.
	(_bfd_mips_elf_merge_private_bfd_data): Call it.

binutils:
	* readelf.c (display_mips_gnu_attribute): New.
	(process_mips_specific): Call process_attributes.

include/elf:
	* mips.h (Tag_GNU_MIPS_ABI_FP): Define.

ld/testsuite:
	* ld-mips-elf/attr-gnu-4-0.s, ld-mips-elf/attr-gnu-4-00.d,
	ld-mips-elf/attr-gnu-4-01.d, ld-mips-elf/attr-gnu-4-02.d,
	ld-mips-elf/attr-gnu-4-03.d, ld-mips-elf/attr-gnu-4-1.s,
	ld-mips-elf/attr-gnu-4-10.d, ld-mips-elf/attr-gnu-4-11.d,
	ld-mips-elf/attr-gnu-4-12.d, ld-mips-elf/attr-gnu-4-13.d,
	ld-mips-elf/attr-gnu-4-14.d, ld-mips-elf/attr-gnu-4-2.s,
	ld-mips-elf/attr-gnu-4-20.d, ld-mips-elf/attr-gnu-4-21.d,
	ld-mips-elf/attr-gnu-4-22.d, ld-mips-elf/attr-gnu-4-23.d,
	ld-mips-elf/attr-gnu-4-3.s, ld-mips-elf/attr-gnu-4-30.d,
	ld-mips-elf/attr-gnu-4-31.d, ld-mips-elf/attr-gnu-4-32.d,
	ld-mips-elf/attr-gnu-4-33.d, ld-mips-elf/attr-gnu-4-4.s,
	ld-mips-elf/attr-gnu-4-41.d: New.
	* ld-mips-elf/mips-elf.exp: Run these new tests.
2007-06-29 16:41:32 +00:00
Joseph Myers 104d59d19c bfd:
* elf-attrs.c: New.
	* Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo.
	(BFD32_BACKENDS_CFILES): Add elf-attrs.c.
	(elf-attrs.lo): Generate dependencies.
	* Makefile.in: Regenerate.
	* configure.in (elf): Add elf-attrs.lo.
	* configure: Regenerate.
	* elf-bfd.h (struct elf_backend_data): Add entries for object
	attributes.
	(NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list,
	OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST,
	Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility):
	New.
	(struct elf_obj_tdata): Add entries for object attributes.
	(elf_known_obj_attributes, elf_other_obj_attributes,
	elf_known_obj_attributes_proc, elf_other_obj_attributes_proc):
	New.
	(bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents,
	bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int,
	bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string,
	bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat,
	bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup,
	_bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type,
	_bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New.
	* elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes.
	(bfd_section_from_shdr): Handle attributes sections.
	* elflink.c (bfd_elf_final_link): Handle attributes sections.
	* elfxx-target.h (elf_backend_obj_attrs_vendor,
	elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type,
	elf_backend_obj_attrs_section_type): New.
	(elfNN_bed): Update.
	* elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute,
	aeabi_attribute_list): Remove.
	(struct elf32_arm_obj_tdata): Remove object attributes fields.
	(check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2,
	elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes):
	Update for new object attributes interfaces.
	(uleb128_size, is_default_attr, eabi_attr_size,
	elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute,
	elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link,
	elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int,
	elf32_arm_add_eabi_attr_int, attr_strdup,
	elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
	copy_eabi_attributes, elf32_arm_parse_attributes): Remove.  Moved
	to generic code in elf-attrs.c.
	(elf32_arm_obj_attrs_arg_type): New.
	(elf32_arm_fake_sections): Do not handle .ARM.attributes.
	(elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES.
	(bfd_elf32_bfd_final_link): Remove.
	(elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section,
	elf_backend_obj_attrs_arg_type,
	elf_backend_obj_attrs_section_type): New.
	* elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object
	attributes.
	* elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise.
	* elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise.
	* elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise.
	* elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise.
	* elf32-sh.c (sh_elf_copy_private_data): Likewise.
	* elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.

binutils:
	* readelf.c (display_gnu_attribute): New.
	(process_arm_specific): Rearrange as process_attributes.
	(process_arm_specific): Replace by wrapper of process_attributes.

gas:
	* as.c (create_obj_attrs_section): New.
	(main): Call create_obj_attrs_section for ELF.
	* read.c (s_gnu_attribute, skip_whitespace, skip_past_char,
	skip_past_comma, s_vendor_attribute): New.
	(potable): Add gnu_attribute for ELF.
	* read.h (s_vendor_attribute): Declare.
	* config/tc-arm.c (s_arm_eabi_attribute): Replace by wrapper
	round s_vendor_attribute.
	(aeabi_set_public_attributes): Update for new attributes
	interfaces.
	(arm_md_end): Remove attributes contents setting now done
	generically.

include/elf:
	* arm.h (elf32_arm_add_eabi_attr_int,
	elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
	elf32_arm_get_eabi_attr_int, elf32_arm_set_eabi_attr_contents,
	elf32_arm_eabi_attr_size, Tag_NULL, Tag_File, Tag_Section,
	Tag_Symbol, Tag_compatibility): Remove.
	* common.h (SHT_GNU_ATTRIBUTES): Define.

ld:
	* emulparams/armelf.sh (OTHER_SECTIONS): Remove .ARM.attributes.
	(ATTRS_SECTIONS): Define.
	* scripttempl/elf.sc, scripttempl/elf32sh-symbian.sc,
	scripttempl/elf_chaos.sc, scripttempl/elfi370.sc,
	scripttempl/elfxtensa.sc: Handle ATTRS_SECTIONS.
2007-06-29 16:29:17 +00:00
Paul Brook 5ab7998193 2007-06-29 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress
	call veneers for call relocations against undefined symbols.
	(elf32_arm_final_link_relocate): Turn call to undefined symbol
	into a jump to the next instruction.

	ld/testuite/
	* ld-arm/arm-elf.exp (armelftests): Add callweak.
	* ld-arm/callweak.d: New test.
	* ld-arm/callweak.s: New test.
2007-06-29 15:05:47 +00:00
Nick Clifton 32e8a950c4 * bfd.c (bfd_demangle): Plug memory leak (Coverity). 2007-06-29 14:36:21 +00:00
Nick Clifton 3d3d428f04 New port: National Semiconductor's CR16 2007-06-29 14:09:34 +00:00
Alan Modra c55fe0967e * elflink.c (_bfd_elf_link_assign_sym_version): Improve error
message for undefined version nodes.
	(elf_gc_sweep): Don't warn when zero size sections are
	removed.
2007-06-29 02:09:42 +00:00
Alan Modra 375de94a5e * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation
types.
2007-06-29 01:51:55 +00:00
Alan Modra 7d3287cb71 * elf32-spu.c (spu_elf_fake_sections): New function.
(elf_backend_fake_sections): Define.
2007-06-29 01:39:54 +00:00
H.J. Lu 36fc76aebb Mention PR ld/4701. 2007-06-29 01:22:40 +00:00
Alan Modra 6a3cd2b4ed * elf.c (assign_file_positions_for_load_sections): Use elf
section header sh_size rather than bfd section size, simplifying
	.tbss handling.
2007-06-29 01:21:08 +00:00
Alan Modra bf988460f1 * elf.c (assign_file_positions_for_load_sections): Ensure bss
segments meet gABI alignment requirements.  Don't allocate
	file space for bss sections in a segment also containing file
	or program headers.
2007-06-29 01:12:52 +00:00
Alan Modra 0f504e0094 daily update 2007-06-29 00:00:05 +00:00
Alan Modra fe0a07a117 daily update 2007-06-28 00:00:05 +00:00
Alan Modra cc481421d0 bfd/
* bfd.c (struct bfd): Rename "next" to "archive_next".
	* archive.c: Rename uses throughout file.
	* archive64.c: Likewise.
	* coff-rs6000.c: Likewise.
	* ecoff.c: Likewise.
	* som.c: Likewise.
	* bfd-in2.h: Regenerate.
binutils/
	* ar.c: Rename uses of bfd.next to bfd.archive_next throughout.
	* arsup.c: Likewise.
	* binemul.c: Likewise.
	* objcopy.c: Likewise.
	* dlltool.c: Likewise.
ld/
	* pe-dll.c: Rename uses of bfd.next to bfd.archive_next throughout.
2007-06-27 11:54:10 +00:00
Alan Modra 58eb693ef1 * elf32-spu.c (spu_elf_create_sections): Properly iterate over
input bfds.
2007-06-27 07:12:54 +00:00
Alan Modra 60b31e8d17 * elf32-ppc.c (ppc_elf_select_plt_layout): Properly iterate over
input bfds.
2007-06-27 06:42:14 +00:00
Alan Modra bd30bda7eb daily update 2007-06-27 00:00:05 +00:00
Nick Clifton bec42b1574 * dwarf2.c (find_line): New. Contains the duplicated code from:
(_bfd_dwarf2_find_nearest_line): Use it.
  (_bfd_dwarf2_find_line): Use it.
2007-06-26 14:28:13 +00:00
Joseph Myers 3d3e6f9a7c bfd:
* elf32-arm.c (copy_eabi_attributes): Copy type of attributes.

ld/testsuite:
	* ld-arm/attr-merge.s, ld-arm/attr-merge.attr: New.
	* ld-arm/arm-elf.exp (armelftests): Add new test.
2007-06-26 13:55:04 +00:00
Alan Modra 5bbffd3d1d daily update 2007-06-26 00:00:05 +00:00
Richard Sandiford b314ec0eae bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs
	to be used for calls from MIPS16 code.

gas/
	* config/tc-mips.h (TC_SYMFIELD_TYPE): New.
	* config/tc-mips.c (append_insn): Record which symbols have
	R_MIPS16_26 relocations against them.
	(mips_fix_adjustable): Don't reduce relocations against such symbols.

ld/testsuite/
	* ld-mips-elf/mips16-local-stubs-1.s,
	* ld-mips-elf/mips16-local-stubs-1.d: New tests.
	* ld-mips-elf/mips-elf.exp: Run them.
2007-06-25 10:13:57 +00:00
Alan Modra 10efce5dc8 daily update 2007-06-25 00:00:06 +00:00
Alan Modra fa1de3c9b5 daily update 2007-06-24 00:00:05 +00:00
Andreas Schwab 0d4a14760d * configure.in (--with-separate-debug-dir): New option.
* configure: Regenerate.
	* Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR.
	* Makefile.in: Regenerate.
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to
	bfd_follow_gnu_debuglink.
	(_bfd_dwarf2_find_line): Likewise.
2007-06-23 08:40:54 +00:00
Alan Modra b181e6240c daily update 2007-06-23 00:00:05 +00:00
Nick Clifton 0d161102d0 * dwarf2.c: Add support for reading in debug information via a .gnu_debuglink section:
(struct dwarf2_debug): Add bfd field to record the bfd containing the debug info.
  (parse_comp_unit): Remove ABFD parameter.  Instead use the bfd field in the dwarf2_debug structure.
  (_bfd_dwarf2_find_nearest_line): If a debug info section could not be found in the current bfd call bfd_follow_gnu_debuglink to see if another file contains the debug information.  If it does, open it and continue.
  (bfd_dwarf2_find_line): Likewise.
2007-06-22 08:13:12 +00:00
Alan Modra b547d72b61 daily update 2007-06-22 00:00:05 +00:00
Alan Modra 8685c9a3b1 daily update 2007-06-21 00:00:05 +00:00
Alan Modra e44b7a179e daily update 2007-06-20 00:00:04 +00:00
H.J. Lu 293a012441 bfd/
2007-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4590
	* elfxx-ia64.c (sort_dyn_sym_info): Keep the valid got_offset
	when removing duplicated entries.
	(get_dyn_sym_info): Initialize the got_offset field to -1.
	Update call to sort_dyn_sym_info.
	(elfNN_ia64_relocate_section): Call sort_dyn_sym_info to sort
	array of addend and remove duplicates.

ld/testsuite/

2007-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4590
	* ld-ia64/merge1.d: New.
	* ld-ia64/merge1.s: Likewise.
	* ld-ia64/merge2.d: Likewise.
	* ld-ia64/merge2.s: Likewise.
	* ld-ia64/merge3.d: Likewise.
	* ld-ia64/merge3.s: Likewise.
	* ld-ia64/merge4.d: Likewise.
	* ld-ia64/merge4.s: Likewise.
	* ld-ia64/merge5.d: Likewise.
	* ld-ia64/merge5.s: Likewise.
2007-06-19 13:05:55 +00:00
Alan Modra d308ef20d1 daily update 2007-06-19 00:00:06 +00:00
H.J. Lu 0d823e126f Move entry for doc/Makefile.in to doc/ChangeLog. 2007-06-18 17:44:45 +00:00
H.J. Lu dc1f3d8a2d 2007-06-18 H.J. Lu <hongjiu.lu@intel.com>
* libpei.h (_bfd_XXi_final_link_postscript): Remove
	duplication.
	(bfd_target_pei_p): New.
	(bfd_target_pei_arch): New
	(bfd_target_efi_p): Likewise.
	(bfd_target_efi_arch): New
	(bfd_pe_executable_p): Use bfd_target_pei_p and
	bfd_target_efi_p.

	* peicode.h (arch_type): New enum.
	(pe_arch): New function.
	(pe_bfd_object_p): Don't match PE/EFI target with EFI/PE file
	if there is an EFI/PE target.
2007-06-18 16:26:28 +00:00
Alan Modra af4a3a18d9 daily update 2007-06-18 00:00:05 +00:00
Alan Modra d434a860bd daily update 2007-06-17 00:00:05 +00:00
Alan Modra 7cc23052d5 daily update 2007-06-16 00:00:05 +00:00
Alan Modra 3c2d9dec5b daily update 2007-06-15 00:00:06 +00:00
H.J. Lu 798879259b bfd/
2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I . -I ../config.

	* acinclude.m4: Don't include m4 files. Remove libtool
	kludge.

	* Makefile.in: Regenerated.
	* doc/Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.

binutils/

2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.

	* acinclude.m4: Removed.

	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.

gas/

2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.

	* acinclude.m4: Don't include m4 files.
	(BFD_BINARY_FOPEN): Removed.
	Remove libtool kludge.

	* Makefile.in: Regenerated.
	* doc/Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.

gprof/

2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.

	* acinclude.m4: Removed.

	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.

ld/

2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.

	* acinclude.m4: Removed.

	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.

opcodes/

2007-06-14  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config -I ../bfd.

	* acinclude.m4: Removed.

	* Makefile.in: Regenerated.
	* doc/Makefile.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.
2007-06-14 15:31:01 +00:00
Alan Modra f2029b3aad daily update 2007-06-14 00:00:05 +00:00
Alan Modra 6326e5da7f daily update 2007-06-13 00:00:05 +00:00
Alan Modra 5adbd72d2e daily update 2007-06-12 00:00:06 +00:00
Bob Wilson 99ded152a5 bfd/
* elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed
        XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM.
        (extend_ebb_bounds_backward, compute_text_actions): Likewise.
        (compute_ebb_proposed_actions, coalesce_shared_literal): Likewise.
        (xtensa_get_property_predef_flags): Likewise.
        (compute_removed_literals): Pass new arguments to is_removable_literal.
        (is_removable_literal): Add sec, prop_table and ptblsize arguments.
        Do not remove literal if the NO_TRANSFORM property flag is set.
gas/
        * config/tc-xtensa.c (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to...
        (XTENSA_PROP_NO_TRANSFORM): ...this.
        (frag_flags_struct): Move is_no_transform out of the insn sub-struct.
        (xtensa_mark_frags_for_org): New.
        (xtensa_handle_align): Set RELAX_ORG frag subtype for rs_org.
        (xtensa_post_relax_hook): Call xtensa_mark_frags_for_org.
        (get_frag_property_flags): Adjust reference to is_no_transform flag.
        (xtensa_frag_flags_combinable): Likewise.
        (frag_flags_to_number): Likewise.  Use XTENSA_PROP_NO_TRANSFORM.
        * config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_ORG.
include/elf/
        * xtensa.h (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to...
        (XTENSA_PROP_NO_TRANSFORM): ...this.
ld/
        * emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec): Use renamed
        XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM.
2007-06-11 16:53:08 +00:00
Alan Modra 33c02870f4 daily update 2007-06-11 00:00:05 +00:00
Alan Modra d6fb1e5cc9 daily update 2007-06-10 00:00:06 +00:00
Alan Modra ba6bd54195 daily update 2007-06-09 00:00:05 +00:00
Alan Modra bf7c57a85e daily update 2007-06-08 00:00:06 +00:00
Alan Modra 22c0ef5c12 daily update 2007-06-07 00:00:05 +00:00
Alan Modra 81103de8dd daily update 2007-06-06 00:00:08 +00:00
Alan Modra a9beac614b daily update 2007-06-05 00:00:05 +00:00
Alan Modra f6c489bc53 daily update 2007-06-04 00:00:05 +00:00
Alan Modra a901c493b8 daily update 2007-06-03 00:00:05 +00:00
Alan Modra d142e9b5b4 daily update 2007-06-02 00:00:06 +00:00
Alan Modra 1b10b7bfe2 daily update 2007-06-01 00:00:06 +00:00
Richard Sandiford cbf2cba4be bfd/
* elfxx-mips.c (mips_elf_initialize_tls_index): When processing a
	type (3) single-GOT entry, read tls_type from the hash table entry
	rather than the GOT entry.
2007-05-31 20:22:56 +00:00
Alan Modra a9a4c53ecc include/
* bfdlink.h (struct bfd_link_info): Add input_bfds_tail.
bfd/
	* simple.c (bfd_simple_get_relocated_section_content): Init
	input_bfds_tail.
ld/
	* ldlang.c (ldlang_add_file): Use input_bfds_tail.
	* ldmain.c (main): Init input_bfds_tail.  Sort link_info
	initialization.
2007-05-31 15:04:52 +00:00
Alan Modra 8fd3aac734 daily update 2007-05-31 00:00:05 +00:00
Alan Modra 42bb2e3317 bfd/
* elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections
	created by objcopy --only-keep-debug.
	(_bfd_elf_init_private_section_data): Only change elf_section_type
	if it is SHT_NULL.
binutils/
	* objcopy.c (copy_object): Revert 2007-05-11 change.  Don't
	avoid calling bfd_copy_private_bfd_data for ELF STRIP_NONDEBUG.
	(setup_section): Don't modify flags, and don't avoid calling
	bfd_copy_private_section_data for ELF STRIP_NONDEBUG.
	* readelf.c (process_program_headers): Ignore .dynamic of type
	SHT_NOBITS.
2007-05-30 14:29:27 +00:00
Alan Modra 02bf8d82b5 * elf.c (assign_file_positions_for_load_sections): Correct sh_type
to SHT_NOBITS earlier.  Base actions in rest of function on sh_type
	and sh_flags instead of bfd section flags.  Delete voff and code
	keeping nobits segments aligned.
2007-05-30 13:38:50 +00:00
Alan Modra 4e57dfd62a daily update 2007-05-30 00:00:06 +00:00
Alan Modra 846a3c3a49 daily update 2007-05-29 00:00:06 +00:00
Alan Modra e92a48353d daily update 2007-05-28 00:00:05 +00:00
Alan Modra afa923e792 daily update 2007-05-27 00:00:05 +00:00
Alan Modra be69418222 daily update 2007-05-26 00:00:07 +00:00
Eric Christopher 4e591bc17f 2007-05-25 Eric Christopher <echristo@apple.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame):
        Check that sym_sec isn't NULL before accessing.
2007-05-25 23:06:11 +00:00
Alan Modra 53d33df97a daily update 2007-05-25 00:00:05 +00:00
Steve Ellcey d7040cdb28 * regenerated files from updating libtool. 2007-05-24 18:12:51 +00:00
Steve Ellcey 37ad95141b * ltmain.sh: Update from GCC.
* libtool.m4: Update from GCC.
	* ltsugar.m4: New. Update from GCC.
	* ltversion.m4: New. Update from GCC.
	* ltoptions.m4: New. Update from GCC.
	* ltconfig: Remove.
	* ltcf-c.sh: Remove.
	* ltcf-cxx.sh: Remove.
	* ltcf-gcj.sh: Remove.
	* src-release: Update with new libtool file list.
	* newlib/*/configure.in: invoke _LD_DECL_SED.
	* newlib/*/Makefile.am: Ensure toplevel is included in ACLOCAL_AMFLAGS.
	* Regenerate subdirectories
2007-05-24 17:33:42 +00:00
Alan Modra 6f60ca4eac daily update 2007-05-24 00:00:07 +00:00
Alan Modra 950c3b7d2c daily update 2007-05-23 00:00:10 +00:00
Paul Brook 91a5743d01 2007-05-22 Paul Brook <paul@codesourcery.com>
ld/testsuite/
	* ld-arm/arm-pic-veneer.d: Update expected output.
	* ld-arm/arm-call.d: Ditto.

	bfd/
	* elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset
	with sec and sec_shndx.
	(elf32_arm_ouput_plt_map_sym): Use them.
	(elf32_arm_output_arch_local_syms): Output mapping symbols for
	interworking glue.
2007-05-22 17:17:53 +00:00
Nick Clifton 0e9517a90d Use @copying around copyright notices 2007-05-22 09:16:39 +00:00
Alan Modra 1d47bfb06d daily update 2007-05-22 00:00:06 +00:00
Nick Clifton f07575174a * bfdint.texi: Add GNU Free Documentation License notice. 2007-05-21 16:39:51 +00:00
Alan Modra 56c40d18e2 daily update 2007-05-21 00:00:06 +00:00
Alan Modra d8073b87c8 daily update 2007-05-20 00:00:05 +00:00
Alan Modra 379c558d32 daily update 2007-05-19 00:00:13 +00:00
Paul Brook 26079076f5 2007-05-18 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define.
	(a2t1v5_ldr_insn, a2t1v5_ldr_insn): New.
	(record_arm_to_thumb_glue): Add v5t non-pic glue.
	(elf32_arm_create_thumb_stub): Ditto.

	ld/testsuite/
	* ld-arm/arm-call.d: Update expected output.
2007-05-18 00:25:04 +00:00
Alan Modra 0ee68a72db daily update 2007-05-18 00:00:05 +00:00
Alan Modra 2106c1f0c5 daily update 2007-05-17 00:00:07 +00:00
H.J. Lu 91ac591132 2007-05-16 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra  <amodra@bigpond.net.au>

	* elflink.c (_bfd_elf_adjust_dynamic_copy): Align dynamic bss
	section to the minimum alignment.
2007-05-16 12:52:03 +00:00
Alan Modra 017f71b6e8 daily update 2007-05-16 00:00:05 +00:00
H.J. Lu 027297b7a8 2007-05-15 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra  <amodra@bigpond.net.au>

	PR ld/4504
	* elf-bfd.h (_bfd_elf_adjust_dynamic_copy): New.
	* elflink.c (_bfd_elf_adjust_dynamic_copy): New.

	* elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Call
	_bfd_elf_adjust_dynamic_copy to adjust for the copy in dynamic
	bss section.
	* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
	* elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
	* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
	* elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
	* elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
	* elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
	* elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
	* elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
	* elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
	* elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
	* elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
	* elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
	* elf64-x86-64.c (elf64_x86_64_adjust_dynamic_symbol): Likewise.
	* elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
2007-05-15 13:55:54 +00:00
Richard Sandiford 5c18022ec5 bfd/
* elfxx-mips.c (mips_elf_create_local_got_entry): Remove
	input_section argument.  Create .rela.dyn relocations against
	symbol 0 rather than the section symbol.
	(mips_elf_local_got_index): Remove input_section argument.
	Update call to mips_elf_create_local_got_entry.
	(mips_elf_got_page, mips_elf_got16_entry): Likewise.
	(mips_elf_calculate_relocation): Update calls to
	mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page.

ld/testsuite/
	* ld-mips-elf/vxworks1-lib.rd: Expect the GOT relocation to be
	against symbol 0.
2007-05-15 12:18:53 +00:00
Mark Shinwell a00a1f35e1 bfd/
* elf32-arm.c (elf32_arm_final_link_relocate): Correctly
	handle the Thumb-2 JUMP19 relocation.

	ld/testsuite/
	* ld-arm/arm-elf.exp: Add jump19 testcase.
	* ld-arm/jump19.d: New.
	* ld-arm/jump19.s: New.
2007-05-15 09:54:09 +00:00
Alan Modra 0414f35b82 PR 4479
* elf.c (elf_fake_sections): Don't allow backend to change
	SHT_NOBITS if called for strip/objcopy --only-keep-debug.
	* elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar
	fix from here.
2007-05-15 08:39:58 +00:00
Alan Modra 78832c11e4 daily update 2007-05-15 00:00:05 +00:00
Alan Modra 74f2e02bf4 * elf.c (bfd_elf_string_from_elf_section): Return NULL on
invalid shstrndx.
	(bfd_elf_get_str_section): Likewise.
2007-05-14 04:15:53 +00:00
Alan Modra a1513dafcc daily update 2007-05-14 00:00:05 +00:00
Alan Modra adc44effcb daily update 2007-05-13 00:00:06 +00:00
Alan Modra f137a54e7a PR 4497
* elf-eh-frame.c (struct cie): Add "local_personality".  Make
	"personality" a union.
	(cie_eq): Compare local_personality too.  Adjust personality
	comparison.
	(_bfd_elf_discard_section_eh_frame): Check binding on personality
	reloc sym to allow for bad symtab.  Use stashed local syms rather
	than reading personality local sym.  Handle discarded sections.
2007-05-12 14:27:34 +00:00
Alan Modra 4f4416b5f9 include/elf/
* spu.h (R_SPU_ADDR16X): Define.
	(R_SPU_PPU32, R_SPU_PPU64): Renumber.
bfd/
	* elf32-spu.c (elf_howto_table): Add howto for R_SPU_ADDR16X.
2007-05-12 06:45:33 +00:00
Alan Modra 1602ef01c2 daily update 2007-05-12 00:00:05 +00:00
Alan Modra 016687f8ba bfd/
* elf32-ppc.h (ppc_elf_select_plt_layout): Update prototype.
	(enum ppc_elf_plt_type): Move from..
	* elf32-ppc.c: ..here.
	(struct ppc_elf_obj_tdata): Add makes_plt_call and has_rel16.
	(struct ppc_elf_link_hash_table): Reorder.  Add old_bfd.  Delete
	can_use_new_plt.  Make is_vxworks a bitfield.
	(ppc_elf_link_hash_table_create): Don't clear is_vxworks (again).
	(ppc_elf_check_relocs): Update setting of reloc flags.  Set old_bfd.
	(ppc_elf_select_plt_layout): Modify parameters.  Use bfd reloc
	flags to better detect object files needing old bss-style plt.
	Allow secure plt to be used without rel16 relocs being detected.
	Warn if secure plt request cannot be allowed.
ld/
	* emultempl/ppc32elf.em (plt_style): New variable.
	(old_plt): Delete.
	(ppc_after_open): Adjust ppc_elf_select_plt_layout call.
	(PARSE_AND_LIST_PROLOGUE): Define OPTION_NEW_PLT, renumber
	OPTION_OLD_PLT, OPTION_OLD_GOT and OPTION_STUBSYMS.
	(PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add secure-plt.
	(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_NEW_PLT.
	* ld.texinfo (--secure-plt): Document.
2007-05-11 06:39:05 +00:00
Alan Modra ece5ef6079 include/elf/
* spu.h (R_SPU_PPU32, R_SPU_PPU64): Define.
bfd/
	* reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define.
	* elf-bfd.h (struct elf_backend_data): Change return type of
	elf_backend_relocate_section to int.
	* elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and
	R_SPU_PPU64.
	(spu_elf_bfd_to_reloc_type): Convert new relocs.
	(spu_elf_count_relocs): New function.
	(elf_backend_count_relocs): Define.
	(spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and
	R_SPU_PPU64 relocs.
	* elflink.c (elf_link_input_bfd): Emit relocs if relocate_section
	returns 2.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
gas/
	* config/tc-spu.c (md_pseudo_table): Add int, long, quad.  Call
	spu_cons for word.
	(md_assemble): Tidy use of insn.flag.
	(get_imm): Likewise.  Handle uppercase input too.
	(spu_cons): New function.
	* config/tc-spu.h (tc_fix_adjustable): Don't adjust SPU_PPU relocs.
	(TC_FORCE_RELOCATION): Don't resolve them either.
binutils/
	* embedspu.sh (find_prog): Prefer prog in same dir as embedspu
	over one found on the users path.
	(main): Generate .reloc for each R_SPU_PPU* reloc.
2007-05-11 03:10:11 +00:00
Alan Modra 18f9fa0ab7 daily update 2007-05-11 00:00:06 +00:00
Richard Sandiford d3753b85b4 bfd/
* elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries
	for R_ARM_ABS12 relocs.
	(elf32_arm_finish_dynamic_symbol): Fix the loop that creates
	non-shared VxWorks PLT entries.

ld/testsuite/
	* ld-arm/vxworks1-lib.dd: Expect "push" instead of stmdb and
	"pop" instead of ldmia.  Don't require specific symbolic addresses
	for in-text addresses.  Expect data to be rendered as .words rather
	than disassembled.
	* ld-arm/vxworks1.dd: Likewise.
2007-05-10 17:00:03 +00:00
Alan Modra ef8c95ad21 PR 4454
* elf-eh-frame.c (struct cie): Make "personality" a bfd_vma.
	(_bfd_elf_discard_section_eh_frame): Handle local syms on
	personality relocation.
2007-05-10 15:08:02 +00:00
Richard Sandiford 8c252fd9c3 bfd/
* elf.c (assign_file_positions_for_load_sections): Use p_memsz
	rather than p_filesz to calculate the LMA of the end of a segment.

ld/testsuite/
	* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
2007-05-10 14:46:48 +00:00
Jakub Jelinek b186458a4d * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc
processing if symbol is defined in the executable.
2007-05-10 11:45:07 +00:00
Alexandre Oliva 8857127957 * elf32-frv.c (_frvfdpic_check_discarded_relocs): New.
(frvfdpic_elf_discard_info): New.
(elf_backend_discard_info): Define for FDPIC.
2007-05-10 05:18:42 +00:00
Alan Modra 4b5e3fb90d daily update 2007-05-10 00:00:06 +00:00
Mark Shinwell 2e6030b931 bfd/
* elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't
        attempt to scan if the bfd doesn't correspond to an ELF image.
        (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2007-05-09 13:02:10 +00:00
Alan Modra 39909b2a75 daily update 2007-05-09 00:00:06 +00:00
Alexandre Oliva 0d4cc89286 * elf32-frv.c (elf32_frv_relocate_section): Discard dynamic relocs
for which _bfd_elf_section_offset returns -1.
2007-05-08 06:09:30 +00:00
Alan Modra d02496489e * elf32-spu.c (spu_elf_size_stubs): Use "void *" for psyms.
(mark_functions_via_relocs): Likewise.
2007-05-08 02:29:27 +00:00
Alan Modra b80f943be5 daily update 2007-05-08 00:00:06 +00:00
Alan Modra 1182cb9397 * elflink.c (bfd_elf_final_link): Correct reloc handling for
elf_backend_count_relocs.
	(bfd_elf_discard_info): Print an error if we can't read syms.
2007-05-07 14:47:28 +00:00
Alan Modra b16f296eba * elf32-spu.c (spu_elf_reloc_type_lookup): Return NULL on
invalid reloc code.
	(spu_elf_gc_mark_hook, spu_elf_section_processing): Delete functions.
	(elf_backend_gc_mark_hook, elf_backend_section_processing): Don't
	define.
2007-05-07 14:37:27 +00:00
Alan Modra 7c9283002d * elf.c (assign_file_positions_for_load_sections): Don't check
core segment.
2007-05-07 01:05:46 +00:00
Alan Modra ee6f74de9b daily update 2007-05-07 00:00:05 +00:00
Alan Modra df1891da55 daily update 2007-05-06 00:00:06 +00:00
Alan Modra 345d3bb99a daily update 2007-05-05 00:00:06 +00:00
H.J. Lu fc66a176eb 2007-05-04 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_link_sort_relocs): Return if both .rela.dyn
	and .rel.dyn aren't present.
2007-05-04 21:53:02 +00:00
Nick Clifton 3410fea824 * elflink.c (elf_link_sort_relocs): If both .rela.dyn and .rel.dyn sections
are present examine the indirect sections in an attempt to compute the
  correct relocation size.  If there is any ambiguity, produce an error and
  refuse to sort.
2007-05-04 14:17:07 +00:00
Alan Modra 330ecedfe9 daily update 2007-05-04 00:00:06 +00:00
Sandra Loosemore 7bdca076ec 2007-05-03 Sandra Loosemore <sandra@codesourcery.com>
bfd/
	* elf32-arm.c (allocate_dynrelocs): Fix typo in comment.
2007-05-03 19:27:14 +00:00
Nick Clifton 22184a77be PR gas/3041
* gas/config/tc-m68k.c (relaxable_symbol): Do not relax weak symbols.
    (tc_gen_reloc): Adjust the addend of relocs against weak symbols.
     (md_apply_fix): Put zero values into the frags referencing weak symbols.
* bfd/aoutx.h (swap_std_reloc_out): Treat relocs against weak symbols in the same way as relocs against external symbols.
2007-05-03 15:55:38 +00:00
Alan Modra 09968e6866 daily update 2007-05-03 00:00:06 +00:00
Alan Modra 627b32bcf9 include/elf/
* internal.h (ELF_IS_SECTION_IN_SEGMENT): Check both file offset
	and vma for appropriate sections.
bfd/
	* elf.c (assign_file_positions_for_load_sections): Set sh_offset
	here.  Set sh_type to SHT_NOBITS if we won't be allocating
	file space.  Don't bump p_memsz for non-alloc sections.  Adjust
	section-in-segment check.
	(assign_file_positions_for_non_load_sections): Don't set sh_offset
	here for sections that have already been handled above.
2007-05-02 13:44:37 +00:00
Alan Modra d92353a580 daily update 2007-05-02 00:00:38 +00:00
Alan Modra c766957eea daily update 2007-05-01 00:00:05 +00:00
Alan Modra 49fa1e1518 bfd/
* elf32-spu.c (struct spu_link_hash_table): Add stack_analysis
	and emit_stack_syms bitfields.
	(get_sym_h): Read all symbols if stack analysis will be done.
	(spu_elf_create_sections): Add stack_analysis and emit_stack_syms
	params, and stash in hash table.
	(is_hint): Split off from..
	(is_branch): ..here.  Adjust callers.
	(spu_elf_size_stubs): Add stack_analysis param.  Arrange to read
	and keep all syms.
	(write_one_stub): Fix mem leak.
	(find_function_stack_adjust): New function.
	(sort_syms_syms, sort_syms_psecs): New vars.
	(sort_syms): New function.
	(struct call_info, struct function_info): New.
	(struct spu_elf_stack_info): New.
	(alloc_stack_info, maybe_insert_function, func_name): New functions.
	(is_nop, insns_at_end, check_function_ranges): Likewise.
	(find_function, insert_callee, mark_functions_via_relocs): Likewise.
	(pasted_function, interesting_section, discover_functions): Likewise.
	(mark_non_root, call_graph_traverse, build_call_tree): Likewise.
	(sum_stack, spu_elf_stack_analysis, spu_elf_final_link): Likewise.
	(bfd_elf32_bfd_final_link): Define.
	* elf32-spu.h (struct _spu_elf_section_data): Add stack_info field.
	(spu_elf_create_sections, spu_elf_size_stubs): Update prototypes.
include/
	* bfdlink.h (struct bfd_link_info): Add "info" and "minfo".
ld/
	* ldmain.c (link_callbacks): Init info and minfo fields.
	* ldmisc.c (minfo): Do nothing if no map file.
	* emultempl/spuelf.em (stack_analysis, emit_stack_syms): New vars.
	(spu_after_open): Adjust spu_elf_create_sections call.
	(spu_before_allocation): Likewise for spu_elf_size_stubs.
	(OPTION_SPU_STACK_ANALYSIS, OPTION_SPU_STACK_SYMS): Define.
	(PARSE_AND_LIST_LONGOPTS): Add new entries.
	(PARSE_AND_LIST_OPTIONS, PARSE_AND_LIST_ARGS_CASES): Likewise.
	* gen-doc.texi: Add @set for SPU and other missing targets.
	* ld.texinfo: Update man page selection to match gen-doc.texi.
	Document SPU features.
2007-04-30 14:06:40 +00:00
Alan Modra a8bf1262d7 daily update 2007-04-30 00:00:07 +00:00