Commit Graph

7367 Commits

Author SHA1 Message Date
Richard Sandiford e450936a6f bfd/
* libcoff-in.h (xcoff_tdata): Change debug_indices to a signed long.
	* libcoff.h: Regenerate.
	* xcofflink.c (xcoff_keep_symbol_p): New function, using the
	"skip" logic from xcoff_link_input_bfd.
	(bfd_xcoff_size_dynamic_sections): Explicitly skip dynamic
	objects in a dynamic link, rather than checking whether csectpp
	is null.  Always allocate debug_index for other objects,
	and always go through the loop.  Update the type of debug_index
	after the change above.  Read the auxillary csect information
	and use xcoff_keep_symbol_p to decide whether a symbol should
	be kept.  Set its debug_index to -2 if not.
	(xcoff_link_input_bfd): Update the type of debug_index after
	the change above and always expect it to be nonnull.  Use it to
	test whether a symbol should be stripped, rather than making the
	decision here.  Postpone all symbol creation to the second pass.
2009-03-14 09:32:06 +00:00
Richard Sandiford 47dfb2ca05 bfd/
* xcofflink.c: (xcoff_mark_symbol): Mark the TOC section when
	creating a descriptor.
	(xcoff_sweep): Don't mark toc_section unless it's needed.
	(bfd_xcoff_size_dynamic_sections): Skip the toc_section
	when marking every bfd.
	(xcoff_link_input_bfd): Skip all TOC anchors.
	(xcoff_toc_section_p, xcoff_find_tc0): New functions.
	(_bfd_xcoff_bfd_final_link): Don't set the output bfd's TOC anchor
	to -1; call xcoff_find_tc0 instead.

ld/testsuite/
	* ld-powerpc/aix-toc-1.ex, ld-powerpc/aix-toc-1a.s,
	ld-powerpc/aix-toc-1b.s, ld-powerpc/aix-toc-1-32.dd,
	ld-powerpc/aix-toc-1-64.dd: New tests.
	* ld-powerpc/aix52.exp: Run them.
2009-03-14 09:18:22 +00:00
Richard Sandiford 4cc02a022b bfd/
* libcoff-in.h (xcoff_section_tdata): Update commentary.
	* libcoff.h: Regenerate.
	* xcofflink.c (xcoff_link_add_symbols): Set the csect of XTY_ER
	symbols to bfd_und_section_ptr or bfd_abs_section_ptr, rather than
	the previous symbol's csect.  Treat last_symndx as an inclusive value
	and simplify its handling.
	(xcoff_mark): Treat last_symndx as an inclusive value.  Only mark
	symbols with the right csect.  Don't mark rsec when processing
	relocations against undefined or absolute sections.
	(bfd_xcoff_size_dynamic_sections): Don't check the SEC_MARK flag
	of bfd_und_section_ptr.
	(xcoff_link_input_bfd): Likewise.
2009-03-14 09:17:56 +00:00
Richard Sandiford 858ef0ce3b include/coff/
* xcoff.h (XCOFF_CALLED, XCOFF_IMPORT): Update comments.
	(XCOFF_WAS_UNDEFINED): New flag.
	(xcoff_link_hash_table): Add an "rtld" field.

bfd/
	* coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations
	against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED
	flag is set.  Assert that all undefined symbols are either
	imported or defined by a dynamic object.
	* coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
	* xcofflink.c (xcoff_link_add_symbols): Extend function-symbol
	handling to all relocations.  Only set XCOFF_CALLED for function
	symbols.
	(xcoff_find_function): New function, split out from...
	(bfd_xcoff_export_symbol) ...here.
	(xcoff_set_import_path): New function, split out from...
	(bfd_xcoff_import_symbol): ...here.  Remove assertion for old
	meaning of XCOFF_CALLED.
	(xcoff_mark_symbol): If we mark an undefined and unimported
	symbol, find some way of defining it.  If the symbol is a function
	descriptor, fill in its definition automatically.  If the symbol
	is a function, mark its descriptor and allocate room for global
	linkage code.  Otherwise mark the symbol as implicitly imported.
	Move the code for creating function descriptors from...
	(xcoff_build_ldsyms): ...here.  Use XCOFF_WAS_UNDEFINED to
	check for symbols that were implicitly defined.
	(xcoff_mark): Don't count any dynamic relocations against
	function symbols.
	(bfd_xcoff_size_dynamic_sections): Save the rtld parameter
	in the xcoff link info.
	(xcoff_link_input_bfd): Remove handling of undefined and
	unexported symbols.

ld/
	* emultempl/aix.em (gld${EMULATION_NAME}_handle_option): Make
	-berok and -bernotok control link_info.unresolved_syms_in_objects
	and link_info.unresolved_syms_in_shared_libs instead of
	force_make_executable.

ld/testsuite/
	* ld-powerpc/aix-glink-1.ex, ld-powerpc/aix-glink-1.s,
	ld-powerpc/aix-glink-1-32.dd, ld-powerpc/aix-glink-1-64.dd,
	ld-powerpc/aix-glink-1-32.d, ld-powerpc/aix-glink-1-64.d: New tests.
	* ld-powerpc/aix52.exp: Run them.
2009-03-14 09:17:32 +00:00
Richard Sandiford 12b2cce914 bfd/
* coff-rs6000.c (xcoff_reloc_type_br): Make the branch absolute
	if the target is absolute.  Fix comment typo.
	(xcoff_ppc_relocate_section): Remove FIXME.
	* coff64-rs6000.c (xcoff64_reloc_type_br): Make the branch absolute
	if the target is absolute.

ld/testsuite/
	* ld-powerpc/aix-abs-branch-1.im, ld-powerpc/aix-abs-branch-1.ex,
	ld-powerpc/aix-abs-branch-1.s,
	ld-powerpc/aix-abs-branch-1.dd: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-03-14 09:16:01 +00:00
Richard Sandiford 0e3212aded bfd/
* xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy
	R_POS and R_NEG relocations against absolute symbols to the
	.loader section.

ld/testsuite/
	* ld-powerpc/aix-abs-reloc-1.ex, ld-powerpc/aix-abs-reloc-1.im,
	ld-powerpc/aix-abs-reloc-1.od, ld-powerpc/aix-abs-reloc-1.s: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-03-14 09:15:34 +00:00
Richard Sandiford d19d97e928 bfd/
* coff64-rs6000.c (xcoff64_write_object_contents): Set the cputype
	to 2 for bfd_mach_ppc_620.
2009-03-14 09:14:57 +00:00
Richard Sandiford e52315924b bfd/
* config.bfd: Treat AIX 6+ in the same way as AIX 5.
	* configure.in: Likewise.
	* configure: Regenerate.

binutils/
	* configure.tgt: Extend AIX 5 behavior to AIX 6 and above.
	* configure.in: Likewise.
	* configure: Regenerate.

gas/
	* configure.tgt: Extend AIX 5 behavior to AIX 6 and above.
	* configure.in: Likewise.
	* configure: Regenerate.

ld/
	* configure.tgt: Extend AIX 5 behavior to AIX 6 and above.
2009-03-14 09:11:38 +00:00
Alan Modra 57898e0296 daily update 2009-03-14 00:00:09 +00:00
H.J. Lu 3516e9841c bfd/
2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/9945
	* elf.c (assign_section_numbers): Generate symbol table if there
	is any relocation in output.
	(_bfd_elf_compute_section_file_positions): Likewise.

binutils/

2009-03-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/9945
	* objcopy.c (copy_object): Clear HAS_RELOC when stripping all.
2009-03-13 13:39:57 +00:00
Nick Clifton ce98a316e9 PR 9934
* elf-bfd.h (NUM_SHDR_ENTRIES): Cope with an empty section.
        * elflink.c (elf_link_read_relocs_from_section): Use
        NUM_SHDR_ENTRIES.  Gracefully handle the case where there are
        relocs but no symbol table.
        * elf32-arm.c (elf32_arm_check_relocs): Likewise.
2009-03-13 11:34:43 +00:00
Alan Modra f8abd13f3d daily update 2009-03-13 00:00:04 +00:00
H.J. Lu c4fb387b7c 2009-03-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/9938
	* elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
	to check ___tls_get_addr.

	* elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
	strncmp to check __tls_get_addr.
2009-03-12 17:13:41 +00:00
Andrew Stubbs 53638231ad 2009-03-12 Andrew Stubbs <ams@codesourcery.com>
* dwarf2.c (read_section): Always check the offset, even when the
	section has been read before.
2009-03-12 10:57:18 +00:00
Alan Modra b937c27c4e daily update 2009-03-12 00:00:09 +00:00
H.J. Lu 09e8c3bf89 2009-03-11 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_check_tls_transition): Fix a typo in
	comments.
2009-03-11 16:42:23 +00:00
Chris Demetriou 36e4dce69d [bfd/ChangeLog]
2009-03-11  Chris Demetriou  <cgd@google.com>

	* bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag.
	* bfd-in2.h: Regenerate.
	* archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT
	flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file
	mode.
	(bsd_write_armap): Likewise.
	(_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT
	flag is set, do nothing.
	(coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0
	for timestamp.

[binutils/ChangeLog]
2009-03-11  Chris Demetriou  <cgd@google.com>

	* ar.c (deterministic): New global variable.
	(main): Recognize new 'D' option, which enables 'deterministic mode'.
	(usage): Document new 'D' option.
	(write_archive): Set BFD_DETERMINISTIC_OUTPUT in output archive's
	flags if deterministic mode was requested.
	* doc/binutils.texi (ar): Document deterministic mode ('D' option).

[binutils/testsuite/ChangeLog]
2009-03-11  Chris Demetriou  <cgd@google.com>

	* binutils-all/ar.exp (deterministic_archive): New test.
2009-03-11 04:36:40 +00:00
Ulrich Weigand 9b175a76d1 * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
used to update stack pointer.
2009-03-11 00:18:02 +00:00
Alan Modra 881e1e5652 daily update 2009-03-11 00:00:04 +00:00
Alan Modra 7598b09291 daily update 2009-03-10 00:00:08 +00:00
Alan Modra 8ac6d8b9dd daily update 2009-03-09 00:00:04 +00:00
Alan Modra db37ab6c7c daily update 2009-03-08 00:00:04 +00:00
Dave Anglin f501de170c PR binutils/9921
* som.c (som_bfd_derive_misc_symbol_info): Set symbol type ST_ABSOLUTE
	for unknown symbols in absolute section.
2009-03-07 23:38:13 +00:00
Alan Modra b264ba2c90 daily update 2009-03-07 00:00:04 +00:00
Nick Clifton d11fd24905 Updated Spanish translations. 2009-03-06 12:14:40 +00:00
Christophe Lyon 8cd931b713 09-03-05 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (group_sections): Take next section size into
	account before accepting to group it.

	testsuite/
	* ld-arm/arm-elf.exp: Add new farcall-group-limit test.
	* ld-arm/farcall-group-limit.d: New file.
	* ld-arm/farcall-group3.s: New file.
	* ld-arm/farcall-group4.s: New file.
2009-03-06 08:57:58 +00:00
Alan Modra a4616131b3 daily update 2009-03-06 00:00:04 +00:00
Christophe Lyon 5fa9e92f74 2009-03-05 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (arm_type_of_stub): Handle long branches targetting
	PLT entries.
	(elf32_arm_final_link_relocate): Likewise.

	testsuite/
	* ld-arm/arm-elf.exp: Add 2 more tests to check long branch stubs
	in PLT context.
	* ld-arm/farcall-mixed-app-v5.d: New file.
	* ld-arm/farcall-mixed-app.d: Likewise.
	* ld-arm/farcall-mixed-app.r: Likewise.
	* ld-arm/farcall-mixed-app.s: Likewise.
	* ld-arm/farcall-mixed-app.sym: Likewise.
	* ld-arm/farcall-mixed-lib.d: Likewise.
	* ld-arm/farcall-mixed-lib.r: Likewise.
2009-03-05 17:28:21 +00:00
Alan Modra b92997d66d PR 9923
* peXXigen.c (_bfd_XXi_final_link_postscript): Check h->root.type.
2009-03-05 01:04:56 +00:00
Alan Modra b9deb64656 daily update 2009-03-05 00:00:04 +00:00
Alan Modra 727fc41e07 include/elf/
* ppc.h (R_PPC_TLSGD, R_PPC_TLSLD): Add new relocs.
	* ppc64.h (R_PPC64_TLSGD, R_PPC64_TLSLD): Add new relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New.
	* section.c (struct bfd_section): Add has_tls_get_addr_call.
	(BFD_FAKE_SECTION): Init new flag.
	* ecoff.c (bfd_debug_section): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD.
	(ppc_elf_reloc_type_lookup): Handle new relocs.
	(ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such
	without marker relocs.
	(ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
	if section has no old-style calls.
	(ppc_elf_relocate_section): Set tls_mask for non-tls relocs too.
	Don't try to optimize new-style __tls_get_addr call when handling
	arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
	relocs.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD.
	(ppc64_elf_reloc_type_lookup): Handle new relocs.
	(ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such
	without marker relocs.
	(ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs
	if section has no old-style calls.  Set toc_ref for new relocs as
	appropriate.
	(ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too.
	Don't try to optimize new-style __tls_get_addr call when handling
	arg setup relocs.  Instead do so for R_PPC_TLSGD and R_PPC_TLSLD
	relocs.
gas/
	* config/tc-ppc.c (ppc_elf_suffix): Error if ppc32 tls got relocs
	have non-zero addend.
	(md_assemble): Parse args of __tls_get_addr calls.
	(md_apply_fix): Handle BFD_RELOC_PPC_TLSGD and BFD_RELOC_PPC_TLSLD.
ld/testsuite/
	* ld-powerpc/tlsmark.s, * ld-powerpc/tlsmark.d: New test.
	* ld-powerpc/tlsmark32.s, * ld-powerpc/tlsmark32.d: New test.
	* ld-powerpc/powerpc.exp: Run them.
2009-03-04 05:50:50 +00:00
Alan Modra 51dec22749 bfd/
PR 6768
	* configure.in: Test for ld --as-needed support.  Link shared
	libbfd against libm.
	* configure: Regenerate.
opcodes/
	PR 6768
	* configure.in: Test for ld --as-needed support.  Link shared
	libopcodes against libm.
	* configure: Regenerate.
2009-03-04 02:10:34 +00:00
Alan Modra a1f7ca36bf missing from make dep-am commit 2009-03-04 01:16:15 +00:00
Alan Modra f2ee4e3518 daily update 2009-03-04 00:00:05 +00:00
Alan Modra 500b1f4473 make dep-am and regen
opcodes/
	* Makefile.am (HFILES): Move lm32-desc.h and lm32-opc.h from..
	(CFILES): ..here.
2009-03-03 02:41:14 +00:00
Alan Modra 3f1a2bb360 daily update 2009-03-03 00:00:07 +00:00
Nick Clifton c3b7224ae4 Add support for Score7 architecture. 2009-03-02 10:33:08 +00:00
Alan Modra c493b4aa97 daily update 2009-03-02 00:00:04 +00:00
Ralf Wildenhues 58e2467181 Backport from git Libtool:
2009-01-19  Robert Millan  <rmh@aybabtu.com>
	Support GNU/kOpenSolaris.
	* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
	(_LT_CHECK_MAGIC_METHOD, _LT_COMPILER_PIC, _LT_LINKER_SHLIBS)
	(_LT_LANG_CXX_CONFIG) [kopensolaris*-gnu]: Recognize
	GNU/kOpenSolaris.

binutils/
	* configure: Regenerate.

opcodes/
	* configure: Regenerate.

bfd/
	* configure: Regenerate.

gas/
	* configure: Regenerate.

gprof/
	* configure: Regenerate.

ld/
	* configure: Regenerate.
2009-03-01 18:57:19 +00:00
Dave Anglin d45b7d7459 * elf32-hppa.c (hppa32_elf_local_refcounts): New function.
(elf32_hppa_check_relocs): Use it.
2009-03-01 18:15:53 +00:00
Dave Anglin 5887528b24 * elf_hppa_add_symbol_hook (elf_hppa_add_symbol_hook): Move to
elf64-hppa.c.
	(elf_hppa_unmark_useless_dynamic_symbols): Likewise.
	(elf_hppa_remark_useless_dynamic_symbols): Likewise.
	(elf_hppa_is_dynamic_loader_symbol): Likewise.
	(elf_hppa_record_segment_addrs): Likewise.
	(elf_hppa_final_link): Likewise.
	(elf_hppa_relocate_insn): Likewise.
	(elf_hppa_final_link_relocate): Likewise.
	(elf64_hppa_relocate_section): Likewise.
	* elf64-hppa.c: Insert above.
2009-03-01 17:08:54 +00:00
Dave Anglin a03bd320bd * elf-hppa.h (elf_hppa_final_link): Use elf_hppa_final_link.
(elf_hppa_final_link_relocate ): Rewrite eliminating dynamic hash table.
	(elf_hppa_relocate_section): Likewise.
	* elf64-hppa.c (struct elf64_hppa_link_hash_entry): Change to derive
	from struct elf_link_hash_entry.  Add count field.
	(struct elf64_hppa_dyn_hash_table): Delete.
	(struct elf64_hppa_link_hash_table): Delete dyn_hash_table field.
	(elf64_hppa_hash_table): Rename to hppa_link_hash_table.
	(hppa_elf_hash_entry, eh_name): Define.
	(elf64_hppa_new_dyn_hash_entry): Delete.
	(elf64_hppa_dyn_hash_lookup): Delete.
	(elf64_hppa_dyn_hash_traverse): Delete.
	(get_dyn_name): Delete.
	(elf64_hppa_finalize_opd): Use struct elf_link_hash_entry * instead
	of struct elf64_hppa_dyn_hash_entry *.
	(elf64_hppa_finalize_dlt, llocate_global_data_dlt,
	allocate_global_data_plt, allocate_global_data_stub,
	allocate_global_data_opd, count_dyn_reloc, allocate_dynrel_entries):
	Likewise.
	(hppa64_link_hash_newfunc): New.
	(elf64_hppa_hash_table_create): Rework.
	(count_dyn_reloc): Likewise.
	(hppa64_elf_local_refcounts): New.
	(elf64_hppa_check_relocs): Rework using standard technique for recording
	local DLT, PLT and OPD reference counts.
	(elf64_hppa_dynamic_symbol_p): Revise using "eh" for struct
	elf_link_hash_entry *.
	(elf64_hppa_mark_exported_functions, allocate_global_data_dlt,
	allocate_global_data_plt, allocate_global_data_stub,
	allocate_global_data_opd, allocate_dynrel_entries,
	elf64_hppa_adjust_dynamic_symbol,
	elf64_hppa_mark_milli_and_exported_functions): Likewise.
	(elf64_hppa_create_dynamic_sections, elf64_hppa_size_dynamic_sections):
	Use hppa_link_hash_table.  Rework.
	(elf64_hppa_link_output_symbol_hook): Rework.
	(elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd,
	elf64_hppa_finalize_dlt, elf64_hppa_finalize_dynreloc,
	elf64_hppa_finish_dynamic_sections): Likewise.
2009-03-01 02:10:49 +00:00
Alan Modra a8a886ba79 daily update 2009-03-01 00:00:05 +00:00
Alan Modra 8ca6feb110 daily update 2009-02-28 00:00:05 +00:00
Alan Modra 933f52b463 daily update 2009-02-27 00:00:08 +00:00
Christophe Lyon ebe24dd4f8 2009-02-26 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (stub_reloc_type): Removed.
	(insn_sequence): Renamed reloc_type field to r_type.
	(elf32_arm_stub_long_branch_v4t_arm_thumb_pic): New stub.
	(elf32_arm_stub_long_branch_v4t_thumb_arm_pic): Likewise.
	(elf32_arm_stub_long_branch_thumb_only_pic): Likewise.
	(elf32_arm_stub_type): Add new enum entries for the new stubs.
	(arm_stub_is_thumb): Catch new stubs.
	(arm_type_of_stub): Handle new stubs.
	(arm_size_one_stub): Use ARRAY_SIZE. Handle new stubs.
	(bfd_elf32_arm_process_before_allocation): Remove useless
	condition.

	testsuite/
	* ld-arm/arm-elf.exp: Add 3 tests for the 3 new stubs.
	* ld-arm/farcall-thumb-arm-pic-veneer.d: New expected result, the
	test is now expected to pass.
	* ld-arm/farcall-thumb-thumb-m-pic-veneer.d: Likewise.
	* ld-arm/farcall-thumb-thumb-pic-veneer.d: Likewise.
2009-02-26 15:37:53 +00:00
Alan Modra 5be39b1ebe daily update 2009-02-26 00:00:10 +00:00
Tristan Gingold a60a89d65d Update contributors list for update of alpha-vms bfd.
(Sorry).
2009-02-25 16:50:01 +00:00
H.J. Lu b9d678e09f 2009-02-25 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (elf_find_function): Use is_function_type to check
	function symbol.
2009-02-25 14:39:35 +00:00
Alan Modra 6fe0eb5ea5 daily update 2009-02-25 00:00:05 +00:00