Commit Graph

5541 Commits

Author SHA1 Message Date
Tristan Gingold d9071b0c42 2011-12-13 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>
* dwarf2.c (bfd_dwarf2_cleanup_debug_info): Accept stash as an
	argument like other functions to support formats other than ELF.
	* elf-bfd.h (bfd_dwarf2_cleanup_debug_info): Move to bfd-in.h.
	* elf.c (_bfd_elf_close_and_cleanup): Pass dwarf2_find_line_info
	in tdata as a parameter.
	* libbfd-in.h (bfd_dwarf2_cleanup_debug_info): Move from
	elf-bfd.h.
	* libbfd.h (bfd_dwarf2_cleanup_debug_info): Regenerate.
	* mach-o-target.c (bfd_mach_o_close_and_cleanup): Remove the
	fallback macro.
	(bfd_mach_o_find_nearest_line): Likewise.
	* mach-o.c (bfd_mach_o_find_nearest_line): Add the definition
	which calls _bfd_dwarf2_find_nearest_line.
	(bfd_mach_o_close_and_cleanup): Likewise.
	* mach-o.h (mach_o_data_struct): Add dwarf2_find_line_info.
	(bfd_mach_o_find_nearest_line): Add declaration.
	(bfd_mach_o_close_and_cleanup): Add declaration.
2011-12-13 14:02:20 +00:00
Tristan Gingold c5012cd8d5 bfd/
2011-12-13  Tristan Gingold  <gingold@adacore.com>

	* mach-o.c (bfd_mach_o_read_symtab_symbols): Make global.  Remove
	prototype.
	(bfd_mach_o_section_get_entry_size): Make global.
	(bfd_mach_o_section_get_nbr_indirect): Likewise.
	(bfd_mach_o_read_symtab_strtab): Likewise.
	(struct bfd_mach_o_xlat_name): Move to mach-o.h
	(bfd_mach_o_print_flags): Move to binutils/od-macho.c
	(bfd_mach_o_get_name_of_null, bfd_mach_o_get_name): Likewise.
	(bfd_mach_o_cpu_name, bfd_mach_o_filetype_name): Likewise.
	(bfd_mach_o_header_flags_name): Likewise.
	(bfd_mach_o_load_command_name): Likewise.
	(bfd_mach_o_print_private_header): Likewise.
	(bfd_mach_o_print_section_map, bfd_mach_o_print_section): Likwise.
	(bfd_mach_o_print_segment, bfd_mach_o_print_dysymtab): Likewise.
	(bfd_mach_o_print_dyld_info): Likewise.
	(bfd_mach_o_print_private_bfd_data): Remove.
	(bfd_mach_o_type_name): Make global.
	(bfd_mach_o_section_attribute_name): Likewise.
	* mach-o.h (bfd_mach_o_xlat_name): Added.
	(bfd_mach_o_section_get_nbr_indirect)
	(bfd_mach_o_section_get_entry_size)
	(bfd_mach_o_read_symtab_symbols)
	(bfd_mach_o_read_symtab_strtab)
	(bfd_mach_o_section_attribute_name)
	(bfd_mach_o_section_type_name): Likewise.
	* mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data): Define.

binutils/
2011-12-13  Tristan Gingold  <gingold@adacore.com>

	* od-macho.c: New file.
	* objdump.h (objdump_private_desc_mach_o): Add.
	* configure.in: Add Mach-O od_vectors.
	* Makefile.am (CFILES): Add od-macho.c
	* configure: Regenerate.
	* Makefile.in: Regenerate.
2011-12-13 09:13:15 +00:00
Chung-Lin Tang 888b9c016b 2011-12-13 Chung-Lin Tang <cltang@codesourcery.com>
* elfxx-mips.c (mips_elf_calculate_relocation): Correct
	R_MIPS16_HI16/R_MIPS16_LO16 handling of two cleared lower bits,
	update comments.
2011-12-13 06:22:01 +00:00
Tristan Gingold 69499dca19 2011-12-12 Iain Sandoe <iains@gcc.gnu.org>
* mach-o.c (bfd_mach_o_read_section_32): Null-terminate sectname.
	(bfd_mach_o_read_section_64): Likewise.
2011-12-12 13:45:47 +00:00
Dave Anglin 143bb59922 PR binutils/13476
* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
	R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
	R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
	R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
	R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
	and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.
2011-12-11 15:42:10 +00:00
David Daney b4082c7000 2011-12-10 David Daney <david.daney@cavium.com>
* elfxx-mips.c (mips_elf_link_hash_table.rld_value): Remove.
	(mips_elf_link_hash_table.rld_symbol): New field;
	(MIPS_ELF_RLD_MAP_SIZE): New macro.
	(_bfd_mips_elf_add_symbol_hook): Remember __rld_obj_head symbol
	in rld_symbol.
	(_bfd_mips_elf_create_dynamic_sections): Remember __rld_map symbol
	in rld_symbol.
	(_bfd_mips_elf_size_dynamic_sections): Set correct size for .rld_map.
	(_bfd_mips_elf_finish_dynamic_symbol): Remove .rld_map handling.
	(_bfd_mips_elf_finish_dynamic_sections): Use rld_symbol to
	calculate DT_MIPS_RLD_MAP value.
	(_bfd_mips_elf_link_hash_table_create): Initialize rld_symbol,
	quit initializing rld_value.
2011-12-11 02:05:40 +00:00
Andrew Pinski 432233b359 bfd:
2011-12-08  Andrew Pinski  <apinski@cavium.com>
            Adam Nemet  <anemet@caviumnetworks.com>

	* archures.c (bfd_mach_mips_octeon2): New macro
	* bfd-in2.h: Regenerate.
	* cpu-mips.c (I_mipsocteon2): New enum value.
	(arch_info_struct): Add bfd_mach_mips_octeon2.
	* elfxx-mips.c (_bfd_elf_mips_mach): Support E_MIPS_MACH_OCTEON2.
	(mips_set_isa_flags): Add bfd_mach_mips_octeon2.
	(mips_mach_extensions): Add bfd_mach_mips_octeon2.

gas:
2011-12-08  Andrew Pinski  <apinski@cavium.com>
            Adam Nemet  <anemet@caviumnetworks.com>

        * tc-mips.c (CPU_IS_OCTEON): Add Octeon2.
        (mips_cpu_info_table): Add Octeon2.
        * doc/c-mips.texi: Document octeon2 as an acceptable value for -march=.

gas/testsuite:
2011-12-08  Andrew Pinski  <apinski@cavium.com>
            Adam Nemet  <anemet@caviumnetworks.com>

        * gas/mips/mips.exp: Add Octeon2 for an architecture.
        Run octeon2 test.
        * gas/mips/octeon2.d: New file.
        * gas/mips/octeon2.s: New file.

include/opcode:
2011-12-08  Andrew Pinski  <apinski@cavium.com>
            Adam Nemet  <anemet@caviumnetworks.com>

        * mips.h (INSN_CHIP_MASK): Update according to INSN_OCTEON2.
        (INSN_OCTEON2): New macro.
        (CPU_OCTEON2): New macro.
        (OPCODE_IS_MEMBER): Add Octeon2.

opcodes:
2011-12-08  Andrew Pinski  <apinski@cavium.com>
            Adam Nemet  <anemet@caviumnetworks.com>

	* mips-dis.c (mips_arch_choices): Add Octeon2.
	For "octeon+", just include OcteonP for the insn.
	* mips-opc.c (IOCT): Include Octeon2.
	(IOCTP): Include Octeon2.
	(IOCT2): New macro.
	(mips_builtin_opcodes): Add "laa", "laad", "lac", "lacd", "lad",
	"ladd", "lai", "laid", "las", "lasd", "law", "lawd".
	Move "lbux", "ldx", "lhx", "lwx", and "lwux" up to where the standard
	loads are, and add IOCT2 to them.
	Add "lbx" and "lhux".
	Add "qmac.00", "qmac.01", "qmac.02", "qmac.03", "qmacs.00",
	"qmacs.01", "qmacs.01", "qmacs.02" and "qmacs.03".
	Add "zcb" and "zcbt".
2011-12-08 20:47:27 +00:00
Alan Modra 6673f753c0 PR ld/12772
* elflink.c (elf_gc_sweep_symbol): Discard unmarked symbols
	defined in shared libraries.
2011-12-07 12:15:54 +00:00
Tristan Gingold afbb9e17e4 2011-12-07 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_canonicalize_symtab): Fix indentation.
	Adjust the condition.
	(bfd_mach_o_read_symtab_symbol): Now returns a bfd_boolean.
	Adjust return statements.
	(bfd_mach_o_read_symtab_strtab): Likewise.
	(bfd_mach_o_read_symtab_symbols): Likewise.
	(bfd_mach_o_scan_start_address): Likewise.  Make it static.
	(bfd_mach_o_scan): Likewise.
	(bfd_mach_o_read_dysymtab_symbol): Remove unused function.
	(bfd_mach_o_header_p): Adjust call.
	(bfd_mach_o_cpu_name): Make it const.
	(bfd_mach_o_filetype_name): Likewise.
	(bfd_mach_o_header_flags_name): Likewise.
	(bfd_mach_o_section_type_name): Likewise.
	(bfd_mach_o_section_attribute_name): Likewise.
	(bfd_mach_o_load_command_name): Likewise.
	(bfd_mach_o_get_section_type_from_name): Add a const qualifier
	after above change.
	(bfd_mach_o_get_section_attribute_from_name): Likewise.
	* mach-o.h (bfd_mach_o_read_dysymtab_symbol)
	(bfd_mach_o_scan_start_address, bfd_mach_o_scan): Remove.
2011-12-07 10:09:22 +00:00
Ulrich Weigand 355b81d949 include/elf/ChangeLog:
* common.h (NT_S390_LAST_BREAK): Define.
	(NT_S390_SYSTEM_CALL): Likewise.

bfd/ChangeLog:

	* elf-bfd.h (elfcore_write_s390_last_break): Add prototype.
	(elfcore_write_s390_system_call): Likewise.
	* elf.c (elfcore_write_s390_last_break): New function.
	(elfcore_write_s390_system_call): Likewise.
	(elfcore_write_register_note): Call them.
	(elfcore_grok_s390_last_break): New function.
	(elfcore_grok_s390_system_call): Likewise.
	(elfcore_grok_note): Call them.
2011-12-06 14:09:12 +00:00
Tristan Gingold 0596a831a2 2011-12-05 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_read_symtab_symbol): Accept indirect symbols.
2011-12-05 14:42:31 +00:00
Tristan Gingold 73017762b2 2011-12-05 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_write_contents): Handle LC_LOAD_UPWARD_DYLIB.
	(bfd_mach_o_read_dylib): Likewise.
	(bfd_mach_o_read_command): Likewise.
	(bfd_mach_o_bfd_print_private_bfd_data): Likewise.
2011-12-05 14:10:11 +00:00
Tristan Gingold c0d9d05149 2011-12-05 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_read_command): Add the bfd in the error
	message.
	(bfd_mach_o_openr_next_archived_file): Use arch name as member name.
	(bfd_mach_o_fat_extract): Ditto.
2011-12-05 13:48:54 +00:00
Alan Modra be7b303d27 PR ld/13468
* elflink.c (bfd_elf_final_link): Don't segfault when checking
	for DT_TEXTREL and .dynamic does not exist.
2011-12-03 10:29:01 +00:00
Alan Modra 68ba6d402d PR ld/13470
* elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
	change in 2011-07-01 commit.  Comment.
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
2011-12-03 00:55:50 +00:00
Nick Clifton 810e698684 * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For
non-SEC_ALLOC sections break before GOT and PLT accounting.
2011-12-01 15:50:58 +00:00
Hans-Peter Nilsson 28f68c73a4 * elf32-cris.c (cris_elf_check_relocs) <plt accounting for
R_CRIS_8, R_CRIS_16, and R_CRIS_32>: Move early break for
	non-SEC_ALLOC sections before GOT and PLT accounting.
2011-12-01 02:51:14 +00:00
Andrew Pinski dd6a37e700 opcode/
2011-11-29  Andrew Pinski  <apinski@cavium.com>

        * mips-dis.c (mips_arch_choices): Add Octeon+.
        * mips-opc.c (IOCT): Include Octeon+.
        (IOCTP): New macro.
        (mips_builtin_opcodes): Add "saa" and "saad".
bfd/
2011-11-29  Andrew Pinski  <apinski@cavium.com>

        * archures.c (bfd_mach_mips_octeonp): New macro.
        * bfd-in2.h: Regenerate.
        * bfd/cpu-mips.c (I_mipsocteonp): New enum value.
        (arch_info_struct): Add bfd_mach_mips_octeonp.
        * elfxx-mips.c (mips_set_isa_flags): Add bfd_mach_mips_octeonp.
        (mips_mach_extensions): Add bfd_mach_mips_octeonp.
include/opcodes/
2011-11-29  Andrew Pinski  <apinski@cavium.com>

        * mips.h (INSN_CHIP_MASK): Update according to INSN_OCTEONP.
        (INSN_OCTEONP): New macro.
        (CPU_OCTEONP): New macro.
        (OPCODE_IS_MEMBER): Add Octeon+.
        (M_SAA_AB, M_SAAD_AB, M_SAA_OB, M_SAAD_OB): New enum values.
gas/
2011-11-29  Andrew Pinski  <apinski@cavium.com>

        * config/tc-mips.c (CPU_IS_OCTEON): New macro function.
        (CPU_HAS_SEQ): Change to use CPU_IS_OCTEON.
        (NO_ISA_COP): Likewise.
        (macro) <ld_st>: Add support when off0 is true.
        Add support for M_SAA_AB, M_SAA_OB, M_SAAD_OB and M_SAAD_AB.
        (mips_cpu_info_table): Add octeon+.
        * doc/c-mips.texi: Document octeon+ as an acceptable value for -march=.
gas/testsuite/
2011-11-29  Andrew Pinski  <apinski@cavium.com>

        * gas/mips/mips.exp: Add octeon+ for an architecture.
        Run octeon-saa-saad test.
        (run_dump_test_arch): For Octeon architectures, also try octeon@.
        * gas/mips/octeon-pref.d: Remove -march=octeon from command line.
        * gas/mips/octeon.d: Likewise.
        * gas/mips/octeon-saa-saad.d: New file.
        * gas/mips/octeon-saa-saad.s: New file
2011-11-29 20:28:55 +00:00
Tristan Gingold 91ea3caed7 2011-11-23 Tristan Gingold <gingold@adacore.com>
* vms-lib.c (get_idxlen): Add comments.  Fix type in sizeof.
	(vms_write_index): Add comments.
2011-11-23 11:22:22 +00:00
DJ Delorie fc87b9e825 * elf32-rx.c (rx_elf_object_p): Add more checks for "scanning" to
avoid using the special non-swapping target when not explicitly
requested.
2011-11-22 19:50:36 +00:00
DJ Delorie c52bd2321a * elf32-rx.c (rx_elf_object_p): Correct typo: lma->vma. 2011-11-22 19:46:20 +00:00
Tristan Gingold e0ce100545 2011-11-22 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_print_symbol): Display COM for common
	symbols.  Print section name in brackets.
2011-11-22 10:47:50 +00:00
Alan Modra 7b8e7dad71 * config.bfd: Add vectors for powerpc and powerpc64-freebsd.
* configure.in (TDEFINES): Add rules for powerpc*-freebsd.
	* configure: Regenerate.
	* elf32-ppc.c: Add powerpc-freebsd definitions.
	* elf64-ppc.c: Add powerpc64-freebsd definitions.
	* targets.c: Add bits for powerpc and powerpc64-freebsd.
2011-11-21 13:18:07 +00:00
Alan Modra 3aaeb7d3ca * elf32-arm.c (elf32_thumb_to_arm_stub): Sync message so that it
needs to be translated only once.
2011-11-17 00:20:01 +00:00
Maciej W. Rozycki 72c4ab07b7 * elf64-mips.c (mips_elf64_howto_table_rela): Set src_mask to
zero throughout.
	(mips16_elf64_howto_table_rela): Likewise.
	(micromips_elf64_howto_table_rela): Likewise.
	* elfn32-mips.c (elf_mips_howto_table_rela): Likewise.
	(elf_mips16_howto_table_rela): Likewise.
	(elf_micromips_howto_table_rela): Likewise.
2011-11-16 12:12:22 +00:00
Maciej W. Rozycki 7e51250f06 Fix a typo. 2011-11-15 13:01:20 +00:00
Alan Modra 14b2f83106 * elflink.c (_bfd_elf_create_got_section): Replace
bfd_make_section_with_flags with bfd_make_section_anyway_with_flags.
	(_bfd_elf_link_create_dynamic_sections): Likewise.
	* elf32-ppc.c (ppc_elf_create_glink): Likewise.
	(ppc_elf_create_dynamic_sections): Likewise.
2011-11-15 11:33:57 +00:00
Maxim Kuvyrkov 81f5d455de * elfxx-mips.c (mips_n64_exe_plt0_entry): Use 64-bit move. 2011-11-15 03:23:56 +00:00
Nick Clifton 6746a626dc * elf-m10300.c (mn10300_elf_relax_section): Fix check for an
immediate move into an address register.
2011-11-08 15:07:17 +00:00
Alan Modra 409ff343a4 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in
executables when export_dynamic.
2011-11-08 13:49:11 +00:00
Alan Modra 560c8763d3 bfd/
* elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename
	ha_relocs_not_using_r2 to unexpected_toc_insn.
	(ok_lo_toc_insn): New function.
	(ppc64_elf_edit_toc): Check insn on lo toc reloc.  Emit warning.
	(ppc64_elf_relocate_section): Don't check insn on lo toc reloc here.
	Handle addic on lo toc reloc.
ld/testsuite/
	* ld-powerpc/powerpc.exp: Expect ld warnings for tocopt test.
	* ld-powerpc/tocopt.out: New file.
2011-11-08 13:06:03 +00:00
Dave Anglin 4340287bb5 PR ld/13387
* elf32-hppa.c (elf32_hppa_hide_symbol): Make STT_GNU_IFUNC symbol
	go through PLT.  Reset plt field with init_plt_offset.
	(elf32_hppa_adjust_dynamic_symbol): Ensure that a PLT slot is
	allocated for symbols referenced by a plabel.
2011-11-06 20:25:17 +00:00
DJ Delorie 6652d298c0 [bfd]
* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Delete unused
	variable.

[gas]
	* config/tc-rl78.c (tc_gen_reloc): Remove unused variable.
2011-11-02 20:40:22 +00:00
Jan Beulich e7ebb21483 Building EFI binaries, particularly larger ones (like e.g. Xen does), on Linux
(where relocatable objects are in ELF format) so far led to all local (aka
static) symbols to be discarded, making debugging quite a bit more difficult
(like Linux, Xen builds an internal symbol lookup table from nm output
generated on the binary produced by an earlier linking pass). Therefore, this
patch arranges to insert all (relevant) local symbols from non-COFF objects
into the final executable's symbol table between those coming from COFF input
files and the global ones.

bfd/
2011-11-02  Jan Beulich  <jbeulich@suse.com>

	* coffgen.c (coff_write_alien_symbol): Make public. Add 'struct
	internal_syment *' parameter. Extend 'dummy' to an array with two
	elements. Set n_numaux early. Handle BSF_FILE.
	(coff_write_symbols): Pass NULL as new third argument to
	coff_write_alien_symbol().
	* cofflink.c (_bfd_coff_final_link): Don't use COFF-specific
	obj_raw_syment_count() on non-COFF input BFD. Insert local symbols
	from non-COFF input BFDs.
	* libcoff-in.h (coff_write_alien_symbol): Declare.
	* libcoff.h (coff_write_alien_symbol): Re-generate.
2011-11-02 14:53:04 +00:00
DJ Delorie 99c513f6ac [.]
* configure.ac (rl78-*-*) New case.
	* configure: Regenerate.

[bfd]
	* Makefile.am (ALL_MACHINES): Add cpu-rl78.lo.
	(ALL_MACHINES_CFILES): Add cpu-rl78.c.
	(BFD32_BACKENDS): Add elf32-rl78.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-rl78.c.
	(Makefile.in): Regenerate.
	* archures.c (bfd_architecture): Define bfd_arch_rl78.
	(bfd_archures_list): Add bfd_rl78_arch.
	* config.bfd: Add rl78-*-elf.
	* configure.in: Add bfd_elf32_rl78_vec.
	* reloc.c (bfd_reloc_code_type): Add BFD_RELOC_RL78_* relocations.
	* targets.c (bfd_target_vector): Add bfd_elf32_rl78_vec.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* libbfd.h: Regenerate.
	* cpu-rl78.c: New file.
	* elf32-rl78.c: New file.

[binutils]
	* readelf.c: Include elf/rl78.h
	(guess_is_rela): Handle EM_RL78.
	(dump_relocations): Likewise.
	(get_machine_name): Likewise.
	(is_32bit_abs_reloc): Likewise.
	* NEWS: Mention addition of RL78 support.
	* MAINTAINERS: Add myself as RL78 port maintainer.

[gas]
	* Makefile.am (TARGET_CPU_CFILES): Add tc-rl78.c.
	(TARGET_CPU_HFILES): Add rc-rl78.h.
	(EXTRA_DIST): Add rl78-parse.c and rl78-parse.y.
	(rl78-parse.c, rl78-parse.h, rl78-parse.o, rl78-defs.h): New rules.
	* Makefile.in: Regenerate.
	* configure.in: Add rl78 case.
	* configure: Regenerate.
	* configure.tgt: Add rl78 case.
	* config/rl78-defs.h: New file.
	* config/rl78-parse.y: New file.
	* config/tc-rl78.c: New file.
	* config/tc-rl78.h: New file.
	* NEWS: Add Renesas RL78.

	* doc/Makefile.am (c-rl78.texi): New.
	* doc/Makefile.in: Likewise.
	* doc/all.texi: Enable it.
	* doc/as.texi: Add it.

[include]
	* dis-asm.h (print_insn_rl78): Declare.

[include/elf]
	* common.h (EM_RL78, EM_78K0R): New.
	* rl78.h: New.

[include/opcode]
	* rl78.h: New file.

[ld]
	* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32rl78.c.
	(+eelf32rl78.c): New rule.
	* Makefile.in: Regenerate.
	* configure.tgt: Add rl78-*-* case.
	* emulparams/elf32rl78.sh: New file.
	* NEWS: Mention addition of Renesas RL78 support.

[opcodes]
	* Makefile.am (TARGET_LIBOPCODES_CFILES): Add rl78-decode.c and
	rl78-dis.c.
	(MAINTAINERCLEANFILES): Add rl78-decode.c.
	(rl78-decode.c): New rule, built from rl78-decode.opc and opc2c.
	* Makefile.in: Regenerate.
	* configure.in: Add bfd_rl78_arch case.
	* configure: Regenerate.
	* disassemble.c: Define ARCH_rl78.
	(disassembler): Add ARCH_rl78 case.
	* rl78-decode.c: New file.
	* rl78-decode.opc: New file.
	* rl78-dis.c: New file.
2011-11-02 03:09:11 +00:00
Nick Clifton 29942be825 PR ld/13049
* elf64-ppc.c (STUB_SUFFIX): Revert previous delta.
	* elf32-hppa.c (STUB_SUFFIX): Likewise.
2011-10-26 09:47:58 +00:00
Nick Clifton cfb8c0921c bfd:
* Makefile.am (ALL_MACHINES): Add cpu-epiphany.lo .
	(ALL_MACHINES_CFILES): Add cpu-epiphany.c .
	(BFD32_BACKENDS): Add elf32-epiphany.lo .
	(BFD32_BACKENDS_CFILES): Add elf32-epiphany.c .
	* Makefile.in, bfd-in2.h, configure, libbfd.h: Regenerate.
	* archures.c (bfd_arch_epiphany): Add.
	(bfd_mach_epiphany16, bfd_mach_epiphany32): Define.
	(bfd_epiphany_arch): Declare.
	(bfd_archures_list): Add &bfd_epiphany_arch.
	* config.bfd (epiphany-*-elf): New target case.
	* configure.in (bfd_elf32_epiphany_vec): New target vector case.
	* reloc.c (BFD_RELOC_EPIPHANY_SIMM8): New relocation.
	(BFD_RELOC_EPIPHANY_SIMM24, BFD_RELOC_EPIPHANY_HIGH): Likewise.
	(BFD_RELOC_EPIPHANY_LOW, BFD_RELOC_EPIPHANY_SIMM11): Likewise.
	(BFD_RELOC_EPIPHANY_IMM11, BFD_RELOC_EPIPHANY_IMM8): Likewise.
	* targets.c (bfd_elf32_epiphany_vec): Declare.
	(_bfd_target_vector): Add bfd_elf32_epiphany_vec.
	* po/SRC-POTFILES.in, po/bfd.pot: Regenerate.
	* cpu-epiphany.c, elf32-epiphany.c: New files.
binutils:
	* readelf.c (include "elf/epiphany.h")
	(guess_is_rela, dump_relocation): Handle EM_ADAPTEVA_EPIPHANY.
	(get_machine_name, is_32bit_abs_reloc, is_32bit_pcrel_reloc): Likewise.
	(is_16bit_abs_reloc, is_none_reloc): Likewise.
	* po/binutils.pot: Regenerate.
cpu:
	* cpu/epiphany.cpu, cpu/epiphany.opc: New files.
gas:
	* NEWS: Mention addition of Adapteva Epiphany support.
	* config/tc-epiphany.c, config/tc-epiphany.h: New files.
	* Makefile.am (TARGET_CPU_CFILES): Add config/tc-epiphany.c .
	(TARGET_CPU_HFILES): Add config/tc-epiphany.h .
	* Makefile.in, configure, doc/Makefile.in, po/POTFILES.in: Regenerate.
	* configure.in: Also set using_cgen for epiphany.
	* configure.tgt: Handle epiphany.
	* doc/Makefile.am (CPU_DOCS): Add c-epiphany.texi .
	* doc/all.texi: Set EPIPHANY.
	* doc/as.texinfo: Add EPIPHANY-specific text.
	* doc/c-epiphany.texi: New file.
	* po/gas.pot: Regenerate.
gas/testsuite:
	* gas/epiphany: New directory.
include:
	* dis-asm.h (print_insn_epiphany): Declare.
	* elf/epiphany.h: New file.
	* elf/common.h (EM_ADAPTEVA_EPIPHANY): Define.
ld:
	* NEWS: Mention addition of Adapteva Epiphany support.
	* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32epiphany.c .
	(eelf32epiphany.c): New rule.
	* Makefile.in: Regenerate.
	* configure.tgt: Handle epiphany-*-elf.
	* po/ld.pot: Regenerate.
	* testsuite/ld-srec/srec.exp: xfail epiphany.
	* emulparams/elf32epiphany.sh: New file.
opcodes:
	* Makefile.am (HFILES): Add epiphany-desc.h and epiphany-opc.h .
	(TARGET_LIBOPCODES_CFILES): Add  epiphany-asm.c, epiphany-desc.c,
	epiphany-dis.c, epiphany-ibld.c and epiphany-opc.c .
	(CLEANFILES): Add stamp-epiphany.
	(EPIPHANY_DEPS): Set.  Make CGEN-generated Epiphany files depend on it.
	(stamp-epiphany): New rule.
	* Makefile.in, configure, po/POTFILES.in, po/opcodes.pot: Regenerate.
	* configure.in: Handle bfd_epiphany_arch.
	* disassemble.c (ARCH_epiphany): Define.
	(disassembler): Handle bfd_arch_epiphany.
	* epiphany-asm.c, epiphany-desc.c, epiphany-desc.h: New files.
	* epiphany-dis.c, epiphany-ibld.c, epiphany-opc.c: Likewise.
	* epiphany-opc.h: Likewise.
2011-10-25 11:18:16 +00:00
Maciej W. Rozycki 61a2712e81 * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Remove
assertions.
2011-10-24 13:58:47 +00:00
Nick Clifton b6009aca9a PR ld/13273
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Do not warn about
	identical TAG_PCS_config attributes.
2011-10-24 12:52:37 +00:00
Nick Clifton 07725569e1 Updated Japanese translation 2011-10-24 11:51:22 +00:00
Nick Clifton f11632056d PR binutils/13292
* bfd-in.h: Include <sys/stat.h> rather than forward defining
	struct stat.
	* bfd-in2.h: Regenerate.
2011-10-24 11:23:40 +00:00
H.J. Lu 9892017203 Replace IRELATIVE relocations with RELATIVE in .rel.dyn.
bfd/

2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13302
	* elf32-i386.c (elf_i386_relocate_section): Replace
	R_386_IRELATIVE with R_386_RELATIVE.

	* elf64-x86-64.c (elf_x86_64_relocate_section): Replace
	R_X86_64_IRELATIVE with R_X86_64_RELATIVE.

ld/testsuite/

2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13302
	* ld-i386/i386.exp: Run pr13302.

	* ld-i386/pr13302.d: New.
	* ld-i386/pr13302.s: Likewise.

	* ld-x86-64/pr13082-5b.d: Updated.
	* ld-x86-64/pr13082-6a.d: Likewise.
	* ld-x86-64/pr13082-6b.d: Likewise.
2011-10-21 19:37:15 +00:00
H.J. Lu c293fa4964 Fix a typo in comments.
2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>.

	* elf32-i386.c (elf_i386_relocate_section): Fix a typo in
	comments.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2011-10-21 16:16:51 +00:00
H.J. Lu e1f987424b Put IRELATIVE relocations after JUMP_SLOT.
bfd/

2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13302
	* elf32-i386.c (elf_i386_link_hash_table): Add next_jump_slot_index
	and next_irelative_index.
	(elf_i386_link_hash_table_create): Initialize next_jump_slot_index
	and next_irelative_index.
	(elf_i386_allocate_dynrelocs): Increment reloc_count instead of
	next_tls_desc_index.
	(elf_i386_size_dynamic_sections): Set next_tls_desc_index and
	next_irelative_index from reloc_count.
	(elf_i386_finish_dynamic_symbol): Put R_386_IRELATIVE after
	R_386_JUMP_SLOT.

	* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
	next_jump_slot_index and next_irelative_index.
	(elf_x86_64_link_hash_table_create): Initialize
	next_jump_slot_index and next_irelative_index.
	(elf_x86_64_size_dynamic_sections): Set next_irelative_index
	from reloc_count.
	(elf_x86_64_finish_dynamic_symbol): Put R_X86_64_IRELATIVE after
	R_X86_64_JUMP_SLOT.

ld/testsuite/

2011-10-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13302
	* ld-ifunc/ifunc-16-i386.d: New.
	* ld-ifunc/ifunc-16-x86-64.d: Likewise.
	* ld-ifunc/ifunc-16-x86.s: Likewise.
2011-10-21 15:13:37 +00:00
Nick Clifton 9553db3cc3 PR ld/13049
* elf32-arm.c (STUB_SUFFIX): Avoid collision with user namespace
	symbol names.
	* elf64-ppc.c (STUB_SUFFIX): Likewise.
	* elf32-hppa.c (STUB_SUFFIX): Likewise.
2011-10-20 16:27:04 +00:00
Alan Modra fa289a5fde * elf32-i386.c (i386_opcode16): Delete.
(elf_i386_check_tls_transition): Use memcmp to compare contents.
	* elf64-x86-64.c (x86_64_opcode16, x86_64_opcode32): Delete.
	(elf_x86_64_check_tls_transition): Use memcmp to compare contents.
2011-10-19 23:02:50 +00:00
Alan Modra 1d5316ab67 PR ld/13177
bfd/
	* elflink.c (_bfd_elf_gc_mark_rsec): Set symbol "mark".
	(elf_gc_sweep_symbol): Don't test plt/got refcounts, instead test
	"mark".  Hide undefweak too.  Clear def_regular and ref_regular.
	* elf-m10300.c (mn10300_elf_relocate_section): Ignore unresolved
	reloc errors from garbage-collected code.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-bfin.c (bfin_relocate_section): Likewise.
	(bfinfdpic_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-sh.c (sh_elf_relocate_section): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-sh64.c (sh_elf64_relocate_section): Likewise.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
	* elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
ld/testsuite/
	* ld-elf/elf.exp: Move test for shared lib support..
	* lib/ld-lib.exp (check_shared_lib_support): ..to here. Add m68hc1*,
	and s/ms1/mt/.
	(check_gc_sections_available): Match hppa*64 not hppa64.  Comment.
	* ld-gc/libpersonality.s: New.
	* ld-gc/personality.s, * ld-gc/personality.d: New.
	* ld-gc/gc.exp: Run personality test.
2011-10-19 07:17:21 +00:00
Alan Modra 371a586695 PR ld/13311
* elflink.c (elf_link_output_extsym): Correct test for warning when
	forced local executable syms are referenced from shared libraries.
2011-10-19 05:24:38 +00:00
Alan Modra c192a13368 PR ld/13254
include/
	* bfdlink.h (struct bfd_link_info): Add error_textrel.
bfd/
	* elflink.c (bfd_elf_final_link): Emit error_textrel error.
ld/
	* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Add
	-z text, -z notext, -z textoff options for all targets having
	shared lib support.
2011-10-19 04:13:28 +00:00
David S. Miller abd242a908 Fix sparc TLS call relaxation when the delay slot sets up %o0.
bfd/

	PR binutils/13301
	* elfxx-sparc.c (sparc_elf_find_reloc_at_ofs): New function.
	(_bfd_sparc_elf_relocate_section): Always move the __tls_get_addr
	call delay slot instruction forward 4 bytes when performing
	relaxation.

gold/

	PR binutils/13301
	* sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
	member to track relocation locations that have moved during TLS
	reloc optimizations.
	(Target_sparc::Relocate::Relocate): Initialize to NULL.
	(Target_sparc::Relocate::relocate): Adjust view down by 4
	bytes if it matches reloc_adjust_addr_.
	(Target_sparc::Relocate::relocate_tls): Always move the
	__tls_get_addr call delay slot instruction forward 4 bytes when
	performing relaxation.

ld/testsuite/

	* ld-sparc/tlssunbin32.dd: Update for TLS call relaxation fix
	for PR 13301.
	* ld-sparc/tlssunbin64.dd: Likewise.
	* ld-sparc/tlssunpic32.dd: Likewise.
	* ld-sparc/tlssunpic64.dd: Likewise.
2011-10-19 00:32:25 +00:00