Commit Graph

3527 Commits

Author SHA1 Message Date
H.J. Lu 6566b43c4a 2006-05-25 H.J. Lu <hongjiu.lu@intel.com>
* config.bfd: (sh-*-linux*): Treat as 64bit target.
	(sh*l*-*-netbsdelf*): Likewise.
	(sh-*-netbsdelf*): Likewise.
	(shl*-*-elf*): Likewise.
	(sh[1234]l*-*-elf*): Likewise.
	(sh3el*-*-elf*): Likewise.
	(shl*-*-kaos*): Likewise.
	(sh-*-elf*): Likewise.
	(sh[1234]*-elf*): Likewise.
	(sh-*-rtems*): Likewise.
	(sh-*-kaos*): Likewise.
2006-05-25 13:59:25 +00:00
H.J. Lu 314e9a4e32 bfd/
2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1485
	* config.bfd: Set want64 to true if 64bit bfd is used.
	(sh-*-linux*): Use targ64_selvecs for 64bit targets.
	(sh*l*-*-netbsdelf*): Likewise.
	(sh-*-netbsdelf*): Likewise.
	(shl*-*-elf*): Likewise.
	(sh[1234]l*-*-elf*): Likewise.
	(sh3el*-*-elf*): Likewise.
	(shl*-*-kaos*): Likewise.
	(sh-*-elf*): Likewise.
	(sh[1234]*-elf*): Likewise.
	(sh-*-rtems*): Likewise.
	(sh-*-kaos*): Likewise.

ld/

2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1485
	* configure.in: Use ${srcdir}/../bfd/config.bfd to check 64bit
	bfd.  Support 64bit host for --enable-targets=all.
	* configure: Regenerated.
2006-05-25 01:03:09 +00:00
Paul Brook 4e617b1e97 2006-05-24 Paul Brook <paul@codesourcery.com>
bfd/
	* elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms
	* elf32-arm.c (output_arch_syminfo): Define.
	(elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map,
	elf32_arm_output_arch_local_syms): New functions.
	(elf_backend_output_arch_local_syms): Define.
	* elflink.c (bfd_elf_final_link): Call
	elf_backend_output_arch_local_syms.
	* elfxx-target.h (elf_backend_output_arch_local_syms): Provide default
	definition.
	(elfNN_bed): Add elf_backend_output_arch_local_syms.
ld/testsuite/
	* ld-arm/arm-app-abs32.d: Update expected output.
	* ld-arm/arm-app.d: Ditto.
	* ld-arm/arm-lib-plt32.d: Ditto.
	* ld-arm/arm-lib.d: Ditto.
	* ld-arm/mixed-app-v5.d: Ditto.
	* ld-arm/mixed-app.d: Ditto.
	* ld-arm/mixed-lib.d: Ditto.
2006-05-24 17:10:02 +00:00
Paul Brook 52ab56c201 2006-05-24 Paul Brook <paul@codesourcery.com>
* elf32-arm.c (put_arm_insn, put_thumb_insn): New functions.
	(elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
	elf32_arm_finish_dynamic_symbol): Use them.
2006-05-24 16:23:50 +00:00
Nick Clifton 9b52905e69 Add TLS support for hppa-linux 2006-05-24 11:05:42 +00:00
Nick Clifton 28c9d252b4 Add support for AVR6 family 2006-05-24 07:36:12 +00:00
H.J. Lu a34a056a10 2006-05-23 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2655
	PR ld/2657
	* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
	update CIE/FDE length.  Don't pad to the section alignment.
2006-05-24 02:37:47 +00:00
Jie Zhang 8aafe8b463 * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
deteted entries in .eh_frame section.
2006-05-23 05:45:22 +00:00
Jie Zhang 5592d7ec4e * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
instead of _GLOBAL_OFFSET_TABLE_.
	(bfin_relocate_section): Ditto.
	(_bfin_create_got_section): Ditto.
	(elf32_bfinfdpic_create_dynamic_sections): Use
	__PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_.
	(bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC.
2006-05-23 03:58:33 +00:00
Alan Modra 4d35a0aa88 * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
function syms over other syms.
2006-05-23 01:36:07 +00:00
Daniel Jacobowitz 943284cc7c bfd/
* elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
	check.
	(bfd_elf_final_link): Add a late DT_TEXTREL check.
	* elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
	(mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
	(_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
	Use MIPS_ELF_READONLY_SECTION.
	(_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
	creating DT_TEXTREL.
	(_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
	if no text relocations were generated.
ld/testsuite/
	* ld-mips-elf/textrel-1.d: Relax some patterns.
2006-05-22 15:06:23 +00:00
Nick Clifton 7ff7c29e1f Remove ChangeLog entries, since the template files were already up to date. 2006-05-22 08:30:57 +00:00
Nick Clifton 5002adadc5 Update translation templates 2006-05-22 08:25:15 +00:00
H.J. Lu 4d345610f7 2006-05-19 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment.
2006-05-19 14:08:02 +00:00
Alan Modra 1ea63fd215 * elf.c (elf_fake_sections): Formatting.
(assign_file_positions_for_load_sections): Only add SEC_ALLOC
	sections to p_memsz.  Remove hack for PT_NOTE sections.  Allow
	section alignment to increase p_align for PT_LOAD.
	(assign_file_positions_for_non_load_sections): Remove ARM BPABI
	hack for PT_DYNAMIC.  Instead, set p_filesz for all segments
	other than PT_LOAD, and PT_NOTE in core.
2006-05-19 00:51:28 +00:00
Daniel Jacobowitz 27106ff0dd Fix a typo. 2006-05-17 14:57:33 +00:00
Alan Modra f3520d2f1d * elf.c (assign_file_positions_for_segments): Split into..
(assign_file_positions_for_load_sections): ..this, and..
	(assign_file_positions_for_non_load_sections): ..this new function,..
	(assign_file_positions_except_relocs): ..writing program headers here.
2006-05-17 05:09:24 +00:00
Alan Modra dea5f36af5 * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
non-load sections if they have relocs.
2006-05-17 00:36:30 +00:00
Paul Brook b079691183 2006-05-15 Paul Brook <paul@codesourcery.com>
bfd/
	* cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ...
	(bfd_is_arm_special_symbol_name): ... to this.  Add type argument.
	Check symbol name is of specified type.
	* elf32-arm.c (elf32_arm_is_target_special_symbol,
	arm_elf_find_function, elf32_arm_output_symbol_hook): Use
	bfd_is_arm_special_symbol_name.
	* bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP,
	BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER,
	BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define.
	(bfd_is_arm_mapping_symbol_name): Remove prototype.
	(bfd_is_arm_special_symbol_name): Add prototype.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-arm.c (arm_adjust_symtab): Use
	bfd_is_arm_special_symbol_name.
ld/testsuite/
	* ld-arm/arm-be8.d: New test.
	* ld-arm/arm-be8.s: New test.
	* ld-arm/arm-elf.exp: Add arm-be8.
2006-05-15 19:57:35 +00:00
Bob Wilson 64b607e61b bfd:
* elf32-xtensa.c (check_loop_aligned): Fix reversed check for
        undefined opcode.  Clean up assertions.
        (narrow_instruction, widen_instruction): Remove "do_it" parameters.
        Factor most of the code into separate functions....
        (can_narrow_instruction, can_widen_instruction): New.
        (prev_instr_is_a_loop): New.
        (compute_ebb_proposed_actions): Combine error handling code for
        decode errors.  Replace call to insn_decode_len with inline code.
        Use can_narrow_instruction and can_widen_instruction.  Handle errors
        from call to xtensa_opcode_is_loop.
        (relax_section): Adjust calls to narrow_instruction and
        widen_instruction.
gas:
        * config/tc-xtensa.c (is_direct_call_opcode, is_branch_jmp_to_next,
        xg_assemble_vliw_tokens, xtensa_mark_narrow_branches,
        xtensa_fix_short_loop_frags, is_local_forward_loop, relax_frag_immed):
        Handle errors from calls to xtensa_opcode_is_* functions.
2006-05-15 17:03:15 +00:00
Alan Modra 7de713b9e5 PR 2658
* elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
	-shared link.
2006-05-15 02:22:20 +00:00
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
Paul Brook b6895b4f37 2006-05-11 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs.
	(elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs.
	(elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
	* reloc.c: Ditto.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* libcoff.h: Regenerate.
gas/
	* config/tc-arm.c (parse_half): New function.
	(operand_parse_code): Remove OP_Iffff.  Add OP_HALF.
	(parse_operands): Ditto.
	(do_mov16): Reject invalid relocations.
	(do_t_mov16): Ditto.  Use Thumb reloc numbers.
	(insns): Replace Iffff with HALF.
	(md_apply_fix): Add MOVW and MOVT relocs.
	(tc_gen_reloc): Ditto.
	* doc/c-arm.texi: Document relocation operators
ld/testsuite/
	* ld-arm/arm-elf.exp: Add arm-movwt.
	* ld-arm/arm-movwt.d: New test.
	* ld-arm/arm-movwt.s: New test.
	* ld-arm/arm.ld: Add .far.
2006-05-11 15:17:34 +00:00
Alan Modra 8b95791f5b * elf.c (_bfd_elf_init_private_section_data): Don't change
section type if already set.
2006-05-11 12:34:46 +00:00
Nick Clifton 5e1b4a6d17 PR ld/2607
* elfcode.h (valid_section_index_p): New function: Checks for a valid section
  index.  Allows indicies in the range SHN_LOPROC to SHN_HIOS.
  (elf_object_p): Use valid_section_index_p.
2006-05-11 08:57:08 +00:00
Nick Clifton 53baae4870 Apply fixes to allow arm WinCE toolchain to produce working executables. 2006-05-11 08:48:58 +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
Nick Clifton 337ff0a5af * config/tc-arm.c (arm_fix_adjustable): For COFF, convert fixups against
symbols which are not going to be placed into the symbol table.
* coffcode.h (coff_write_relocs): Produce an error message if a an
   out-of-range symbol index is detected in a reloc.
2006-05-09 11:47:48 +00:00
Ben Elliston e4d4d200c0 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
local variable `dynobj'.
2006-05-09 03:38:30 +00:00
H.J. Lu 336e5de1c9 Remove bfd/ in ChangeLog entry. 2006-05-08 14:17:11 +00:00
Nick Clifton 731608473a * gas/config/tc-avr.h (TC_VALIDATE_FIX): Define. Disable fixups for PMEM
related expressions.
* bfd/elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all of the
    bfd's sections for the reloc-addend adjustments.
2006-05-05 17:46:47 +00:00
Martin Schwidefsky 77df29685b * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
(elf_s390_relocate_section): Add code to do the GD->LE and
	LD->LE TLS linker optimizations if a brasl instruction is used
	for the __tls_get_offset function call.
	* elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
2006-05-05 13:21:34 +00:00
Alan Modra 30038c5930 * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
	the .toc and referenced by a TLS code sequence.
	(ppc64_elf_edit_toc): Cater for the unlikely situation that
	.toc is the first section in a file.
2006-05-05 13:07:30 +00:00
Andreas Schwab ff8b75c71e * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
regs instead of an array of int.
	(struct external_solaris_bcp_core): Likewise.
	(swapcore_sun3): Use offsetof instead of computing the offset
	manually.
	(swapcore_sparc): Likewise.  Simplify reference to c_regs.
	(swapcore_solaris_bcp): Likewise.
2006-05-04 21:25:52 +00:00
Daniel Jacobowitz 003b8e1dad * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
for missing GOTs.
2006-05-04 19:03:24 +00:00
Daniel Jacobowitz efacb0fb73 * bfd/cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
mapping symbols.
2006-05-04 18:15:21 +00:00
Ben Elliston 9578239d3e * coff-or32.c (bfd_section_from_shdr): Remove unused local
variable `ptr'.
	* cofflink.c (process_embedded_commands): Remove unused local
	variables `had_read' and `had_shared'.
	* ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
	variable `fdr_adr'.
	* ihex.c (ihex_read_section): Remove unused local variable `addr'.
2006-05-04 05:05:25 +00:00
Alan Modra f592407e4d bfd/
* libbfd-in.h (_bfd_generic_new_section_hook): Declare.
	* section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
	(bfd_und_symbol, bfd_ind_symbol): Delete.
	(BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
	&SEC.symbol.
	(STD_SECTION): Adjust.
	(_bfd_generic_new_section_hook): New function, extracted from..
	(bfd_section_init): ..here.
	(bfd_make_section_old_way): Call new_section_hook for abs, com,
	und and ind sections.
	* elf.c (_bfd_elf_large_com_section): Adjust.
	* aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
	* pdp11.c (new_section_hook): Likewise.
	* coffcode.h (coff_new_section_hook): Likewise.
	* ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
	* elf.c (_bfd_elf_new_section_hook): Likewise.
	* vms.c (vms_new_section_hook): Likwise.
	* elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
	already set.
	* elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
	* elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
	* elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
	* elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
	* ieee.c (ieee_new_section_hook): Likewise.  Call
	_bfd_generic_new_section_hook too.
	* mmo.c (mmo_new_section_hook): Likewise.
	* oasys.c (oasys_new_section_hook): Likewise.
	* som.c (som_new_section_hook): Likewise.
	* coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
gas/
	* subsegs.c (subseg_get): Don't call obj_sec_set_private_data.
	* config/obj-elf.h (obj_sec_set_private_data): Delete.
	* config/tc-hppa.c (tc_gen_reloc): Don't use bfd_abs_symbol.
	* config/tc-mn10300.c (tc_gen_reloc): Likewise.
2006-05-03 14:26:41 +00:00
Alan Modra bd75c995a7 * hash.c (DEFAULT_SIZE): Revert last change.
(higher_prime_number): Correct test for no larger prime.  Don't
	abort on error, instead return 0.  Depopulate primes[].
	(bfd_hash_lookup): If we overflow size, refuse to grow table.
2006-05-03 04:20:52 +00:00
Paul Brook a8bc6c780e 2006-05-02 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
	for R_ARM_REL32.
gas/
	* config/tc-arm.c (arm_optimize_expr): New function.
	* config/tc-arm.h (md_optimize_expr): Define
	(arm_optimize_expr): Add prototype.
	(TC_FORCE_RELOCATION_SUB_SAME): Define.
ld/testsuite/
	* ld-arm/arm-elf.exp: Add thumb-rel32.
	* ld-arm/thumb-rel32.d: New test.
	* ld-arm/thumb-rel32.s: New test.
2006-05-02 13:09:18 +00:00
Ben Elliston b48c61bccb * archive.c (bfd_generic_archive_p): Remove unused local variable
`fail'.
	* dwarf2.c (decode_line_info): Remove unused local variable
	`basic_block'.
	* elfcode.h (elf_slurp_reloc_table_from_section): Remove unsed
	local varibale `s'.
	* tekhex.c (tekhex_write_object_contents): Remove unused local
	variable `bytes_written'.
	* aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
	variable `r_addend'.
	* elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
	* elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
	(_bfd_ns32k_relocate_contents): Remove break after return.
	* elf.c (bfd_section_from_shdr): Remove breaks after returns.
2006-05-02 10:01:56 +00:00
Nick Clifton 63f2fc3083 Rename DEBUG to SYMBIAN_DEBUG to avoid conflicts with global DEBUG definition 2006-05-02 09:56:00 +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
DJ Delorie aa149cf7d1 * bfd-in.h (bfd_hash_table): Add count field.
* bfd-in2.h: Regenerate.
* hash.c (higher_prime_number): New.
(bfd_hash_table_inint_n): Init count field.
(bfd_hash_lookup): Grow table as needed.
2006-05-01 19:36:27 +00:00
Kaz Kojima 75b8939e07 PR binutils/2584
* tekhex.c (getvalue): Change return type to bfd_boolean and
	add the new parameter.  Return false if the unexpected character
	is found.
	(getsym): Likewise.
	(first_phase): Change return type to bfd_boolean and return
	false if the unexpected character is found.  Replace abort
	with returning false.
	(pass_over): Change return type to bfd_boolean and the type of
	the second argument to bfd_boolean (*) (bfd *, int, char *).
	Return false if FUNC returns false.
	(tekhex_object_p): Return NULL if pass_over fails.
2006-04-27 05:57:09 +00:00
Alan Modra f05742e672 * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix. 2006-04-27 01:19:35 +00:00
H.J. Lu e843e0f880 2006-04-26 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/2593
	* elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
	and flags if its BFD flags have been set.
	(_bfd_elf_init_private_section_data): Don't copy the output ELF
	section type from input if it has been set to something
	different.
2006-04-26 13:32:26 +00:00
Andreas Jaeger 9ca26584e9 Add missing changelog entry 2006-04-26 09:24:07 +00:00
H.J. Lu b25e3d8745 2006-04-25 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/2467
	* elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
	is NULL first.

	* elf32-arm.c (elf32_arm_close_and_cleanup): Check if
	abfd->sections is NULL.
	(elf32_arm_bfd_free_cached_info): New.
	(bfd_elf32_bfd_free_cached_info): Defined.

	* elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
	to _bfd_free_cached_info.

	* libbfd-in.h (_bfd_free_cached_info): New.
	* libbfd: Regenerated.

	* opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
	(_bfd_free_cached_info): New.
2006-04-25 17:46:15 +00:00
Alan Modra 5c182d5fce * elf.c (assign_file_positions_except_relocs): Move code setting
file position of non-loaded sections..
	(assign_file_positions_for_segments): ..to here.
2006-04-21 07:26:09 +00:00