Commit Graph

9668 Commits

Author SHA1 Message Date
Andreas Schwab 3a4ae68123 * elf32-m68k.c (elf_m68k_relocate_section): Allow
R_68K_TLS_LE{8,16,32} for PIE.
2012-03-31 14:27:33 +00:00
Alan Modra f5c0003ef3 daily update 2012-03-30 23:00:08 +00:00
Andreas Krebbel a7e28bbe63 2012-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf64-s390.c: Fix several comments regarding PLT entry
	description.
	* elf32-s390.c: Likewise.
2012-03-30 13:38:04 +00:00
Andreas Krebbel f41345a758 2012-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf64-s390.c: Use the section pointer shortcuts in
	elf_link_hash_table and remove them from the target specific
	variant.
	* elf32-s390.c: Likewise.
2012-03-30 13:37:13 +00:00
Andreas Krebbel 9aa174530d 2012-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf64-s390.c (elf_s390x_plt_entry, elf_s390x_first_plt_entry):
	New definitions.
	(PLT_PIC_ENTRY_WORD*, PLT_PIC12_ENTRY_WORD*): Remove.
	(elf_s390_finish_dynamic_symbol): Use memcpy instead of bfd_put_32.
	(elf_s390_finish_dynamic_sections): Likewise.
	* elf32-s390.c (elf_s390_plt_entry, elf_s390_plt_pic_entry)
	(elf_s390_plt_pic12_entry, elf_s390_plt_pic16_entry)
	(elf_s390_plt_first_entry, elf_s390_plt_pic_first_entry): New definitions.
	(PLT_PIC16_ENTRY_WORD*, PLT_ENTRY_WORD*)
	(PLT_PIC_FIRST_ENTRY_WORD*, PLT_FIRST_ENTRY_WORD*): Remove.
2012-03-30 13:36:22 +00:00
Andreas Krebbel 00d8c7a9d4 2012-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf32-s390.c (struct elf_s390_dyn_relocs): Remove.
	Rename all occurrences in the file to elf_dyn_relocs.
	* elf64-s390.c: Likewise.
2012-03-30 13:35:33 +00:00
Alan Modra a66eed7a5d * elflink.c (_bfd_elf_gc_mark_reloc): Don't delve into dynamic
libraries.
2012-03-29 23:17:37 +00:00
Alan Modra 0c1f93989b daily update 2012-03-29 23:00:05 +00:00
Alan Modra f67f98b55b * bfd-in.h (bfd_get_arch_size, bfd_get_sign_extend_vma): Delete.
* bfd-in2.h: Regenerate.
2012-03-29 13:22:43 +00:00
Alan Modra 0643b94473 daily update 2012-03-28 23:00:04 +00:00
Alan Modra 921deac4aa daily update 2012-03-27 23:00:05 +00:00
Alan Modra 87a6f30243 daily update 2012-03-26 23:00:04 +00:00
Alan Modra b411de145e daily update 2012-03-25 23:00:05 +00:00
Alan Modra 361ac46c6d daily update 2012-03-24 23:00:05 +00:00
Alan Modra 203d9758b3 daily update 2012-03-23 23:00:06 +00:00
Alan Modra e8d2ba5354 * elf.c (assign_file_positions_for_non_load_sections): Don't warn
on empty alloc sections.
2012-03-23 09:34:57 +00:00
Alan Modra 051d833a41 * linker.c (_bfd_nearby_section): New function, split out from..
(fix_syms): ..here.
	* bfd-in.h (_bfd_nearby_section): Declare.
	* bfd-in2.h: Regenerate.
	* elflink.c (elf_link_input_bfd): Don't use text_index_section or
	data_index_section with ld -q or ld -r output relocs against
	stripped output sections.  Instead use _bfd_nearby_section.
2012-03-23 09:27:43 +00:00
Alan Modra 62599110be PR binutils/13894
* elf64-ppc.c (opd_entry_value): Read full symbol table when
	sym hashes unavailable.
2012-03-23 06:41:21 +00:00
Alan Modra fc90a9c610 daily update 2012-03-22 23:00:05 +00:00
Alan Modra 5255715a40 daily update 2012-03-21 23:00:05 +00:00
Joseph Myers b781d74fe1 2012-03-21 Eliot Dresselhaus <eliot@sonic.net>
* elf32-tic6x.c (elf32_tic6x_merge_private_bfd_data): Return TRUE
	for non-C6X objects.
2012-03-21 14:55:45 +00:00
Alan Modra a319231e66 daily update 2012-03-20 23:00:05 +00:00
Kai Tietz 17d5dae239 PR ld/12742
* configure.in (AC_CHECK_HEADERS): Test for windows.h and dlfcn.h.
        * plugin.c: Guard include of dlfcn.h if HAVE_DLFCN_H is defined.
        Add windows.h header include if HAVE_WINDOWS_H is defined.
        (dlerror): New static function if windows variant is used instead
        of dlfcn.h.
        (dlclose): Likewise.
        (dlopen): Likewise.
        (dlsym): Likewise.
        * configure: Regenerated.
        * config.in: Regenerated.
2012-03-20 19:24:32 +00:00
H.J. Lu bdb892b995 Handle relocation against protected function for -Bsymbolic
bfd/

2012-03-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13880
	* elf32-i386.c (elf_i386_relocate_section): Don't issue an error
	for R_386_GOTOFF relocation against protected function if
	SYMBOLIC_BIND is true.

	* elf64-x86-64.c (elf_x86_64_relocate_section): Don't issue an
	error for R_X86_64_GOTOFF64 relocation against protected function
	when building executable or SYMBOLIC_BIND is true.

ld/testsuite/

2012-03-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13880
	* ld-i386/i386.exp: Run protected4 and protected5.
	* ld-x86-64/x86-64.exp: Likewise.

	* ld-i386/protected4.d: New.
	* ld-i386/protected4.s: Likewise.
	* ld-i386/protected5.d: Likewise.
	* ld-i386/protected5.s: Likewise.
	* ld-x86-64/protected4.d: Likewise.
	* ld-x86-64/protected4.s: Likewise.
	* ld-x86-64/protected5.d: Likewise.
	* ld-x86-64/protected5.s: Likewise.
2012-03-20 18:16:38 +00:00
Alan Modra e918b09c1c daily update 2012-03-19 23:00:05 +00:00
Alan Modra 371cf10e70 daily update 2012-03-18 23:00:05 +00:00
Alan Modra 1c4c34148c daily update 2012-03-17 23:00:05 +00:00
Roland McGrath 8059fb196e bfd/
2012-03-16  Roland McGrath  <mcgrathr@google.com>

	* config.bfd: Handle x86_64-*-nacl*.
	* elf64-x86-64.c (bfd_elf64_x86_64_nacl_vec): New backend vector stanza.
	(bfd_elf32_x86_64_nacl_vec): Likewise.
	* targets.c: Support them.
	* configure.in: Likewise.
	* configure: Regenerated.

gas/
2012-03-16  Roland McGrath  <mcgrathr@google.com>

	* config/tc-i386.h [TE_NACL] (ELF_TARGET_FORMAT32, ELF_TARGET_FORMAT64):
	Define for this case.
	* configure.tgt (i386-*-nacl*): If ${cpu} is x86_64*, default to x32.
2012-03-16 23:19:47 +00:00
Alan Modra b2ecfddf1c daily update 2012-03-16 23:00:05 +00:00
Matthew Gretton-Dann ac56ee8f4c * bfd/elf32-arm.c (elf32_arm_attributes_accept_div): New function.
(elf32_arm_attributes_forbid_div): Likewise.
	(elf32_arm_merge_eabi_attributes): Correct handling of
	Tag_DIV_use.
2012-03-16 15:15:14 +00:00
Alan Modra de4a15510f daily update 2012-03-15 23:00:05 +00:00
Roland McGrath a4456d242d * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use
elf_x86_64_backend_data parameters for plt_eh_frame.

Change-Id: I4e1a7c2787ed1276765e269f50fc8ba89bab41d5
2012-03-15 18:20:22 +00:00
Roland McGrath eed180f84c * elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
(get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
	(elf_x86_64_arch_bed): New variable.
	(elf_backend_arch_data): New macro.
	(elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
	(elf_x86_64_allocate_dynrelocs): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	(elf_x86_64_plt_sym_val): Likewise.
	(elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
	parameters for PLT details.
	(elf_x86_64_finish_dynamic_sections): Likewise.
2012-03-15 16:37:25 +00:00
Alan Modra 9eca3be1dd daily update 2012-03-14 23:00:05 +00:00
Roland McGrath caa0075c38 * elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
to the full size, padding out with nop instructions.
2012-03-14 19:32:11 +00:00
Alan Modra 5bed0268de daily update 2012-03-13 23:00:05 +00:00
Alan Modra 1d7e9d183f * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Don't error
on zero size dynbss symbol.
	* elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
	* elf32-cr16.c (_bfd_cr16_elf_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-lm32.c (lm32_elf_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-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
	* elf32-tilepro.c (tilepro_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 (elf_x86_64_adjust_dynamic_symbol): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
	* elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
2012-03-13 06:04:37 +00:00
Alan Modra 894631572d daily update 2012-03-12 23:00:07 +00:00
Alan Modra 43b1a91f0a daily update 2012-03-11 23:00:05 +00:00
Alan Modra a094e1ce32 daily update 2012-03-10 23:00:04 +00:00
Alan Modra aea77599d0 include/opcode/
* ppc.h: Add PPC_OPCODE_ALTIVEC2, PPC_OPCODE_E6500, PPC_OPCODE_TMR.
opcodes/
	* ppc-dis.c (ppc_opts): Add entries for "e5500" and "e6500".
	* ppc-opc.c (insert_ls, TMR, ESYNC, XSYNCLE_MASK): New.
	(PPCVEC2, PPCTMR, E6500): New short names.
	(powerpc_opcodes): Add vabsdub, vabsduh, vabsduw, dni, mvidsplt,
	mviwsplt, icblq., mftmr, mttmr, dcblq., miso, lvexbx, lvexhx,
	lvexwx, stvexbx, stvexhx, stvexwx, lvepx, lvepxl, stvepx, stvepxl,
	lvtrx, lvtrxl, lvtlx, lvtlxl, stvfrx, stvfrxl, stvflx, stvflxl,
	lvswx, lvswxl, stvswx, stvswxl, lvsm mnemonics. Accept LS, ESYNC
	optional operands on sync instruction for E6500 target.
bfd/
	* archures.c: Add bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
	* bfd-in2.h: Regenerate.
	* cpu-powerpc.c (bfd_powerpc_archs): Add entryies for
	bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500.
gas/
	* config/tc-ppc.c (md_show_usage): Document -me5500 and -me6500.
	(ppc_handle_align): Add termination nop opcode for e500mc family.
	* doc/as.texinfo: Document options -me5500 and -me6500.
	* doc/c-ppc.texi: Likewise.
gas/testsuite/
	* gas/ppc/e500mc64_nop.s: New test case for e500mc family
	termination nops.
	* gas/ppc/e500mc64_nop.d: Likewise.
	* gas/ppc/e5500_nop.s: Likewise.
	* gas/ppc/e5500_nop.d: Likewise.
	* gas/ppc/e6500_nop.s: Likewise.
	* gas/ppc/e6500_nop.d: Likewise.
	* gas/ppc/e6500.s: New.
	* gas/ppc/e6500.d: Likewise.
	* gas/ppc/ppc.exp: Run e6500, e500mc64_nop, e5500_nop, and e6500_nop.
2012-03-09 23:39:06 +00:00
Alan Modra 15985358e6 daily update 2012-03-09 23:00:05 +00:00
H.J. Lu 56b8aada47 Restore R_386_IRELATIVE and R_X86_64_IRELATIVE
bfd/

2012-03-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13817
	* bfd/elf32-i386.c (elf_i386_relocate_section): Restore
	R_386_IRELATIVE.

	* * elf64-x86-64.c (elf_x86_64_relocate_section): Restore
	R_X86_64_IRELATIVE.

ld/testsuite/

2012-03-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13817
	* ld-i386/pr13302.d: Updated.
	* ld-x86-64/pr13082-5b.d: Likewise.
	* ld-x86-64/pr13082-6a.d: Likewise.
	* ld-x86-64/pr13082-6b.d: Likewise.
2012-03-09 16:28:38 +00:00
Alan Modra 491f66ba2b daily update 2012-03-08 23:00:06 +00:00
Tristan Gingold 460f1cdc3f 2012-03-08 Tristan Gingold <gingold@adacore.com>
* vms-lib.c (_bfd_vms_lib_write_archive_contents): Set maximum
	keylen according to archive kind.  Set nextvbn and nextrfa lhd
	fields.  Add comments.
2012-03-08 14:25:29 +00:00
Alan Modra 9fdc551be7 daily update 2012-03-07 23:00:05 +00:00
Nick Clifton 0a22ae8eb5 * mn10300.h (elf_mn10300_reloc_type): Add R_MN10300_TLS_GD,
R_MN10300_TLS_LD, R_MN10300_TLS_LDO, R_MN10300_TLS_GOTIE,
	R_MN10300_TLS_IE, R_MN10300_TLS_LE, R_MN10300_TLS_DPTMOD,
	R_MN10300_TLS_DTPOFF and R_MN10300_TLS_TPOFF.

	* elf-m10300.c (elf32_mn10300_link_hash_entry): Add tls_type
	field.
	(elf32_mn10300_link_hash_table): Add tls_ldm_got entry;
	(elf_mn10300_tdata): Define.
	(elf_mn10300_local_got_tls_type): Define.
	(elf_mn10300_howto_table): Add entries for R_MN10300_TLS_GD,
	R_MN10300_TLS_LD, R_MN10300_TLS_LDO, R_MN10300_TLS_GOTIE,
	R_MN10300_TLS_IE, R_MN10300_TLS_LE, R_MN10300_TLS_DPTMOD,
	R_MN10300_TLS_DTPOFF, R_MN10300_TLS_TPOFF relocs.
	(mn10300_reloc_map): Likewise.
	(elf_mn10300_tls_transition): New function.
	(dtpoff, tpoff, mn10300_do_tls_transition): New functions.
	(mn10300_elf_check_relocs): Add TLS support.
	(mn10300_elf_final_link_relocate): Likewise.
	(mn10300_elf_relocate_section): Likewise.
	(mn10300_elf_relax_section): Likewise.
	(elf32_mn10300_link_hash_newfunc): Initialise new field.
	(_bfd_mn10300_copy_indirect_symbol): New function.
	(elf32_mn10300_link_hash_table_create): Initialise new fields.
	(_bfd_mn10300_elf_size_dynamic_sections): Add TLS support.
	(_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
	(_bfd_mn10300_elf_reloc_type_class): Allocate an
	elf_mn10300_obj_tdata structure.
	(elf_backend_copy_indirect_symbol): Define.
	* reloc.c (BFD_MN10300_TLS_GD, BFD_MN10300_TLS_LD,
	BFD_MN10300_TLS_LDO, BFD_MN10300_TLS_GOTIE, BFD_MN10300_TLS_IE,
	BFD_MN10300_TLS_LE, BFD_MN10300_TLS_DPTMOD,
	BFD_MN10300_TLS_DTPOFF, BFD_MN10300_TLS_TPOFF): New relocations.
	(BFD_RELOC_MN10300_32_PCREL, BFD_RELOC_MN10300_16_PCREL): Move to
	alongside other MN10300 relocations.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	* config/tc-mn10300.c (other_registers): Add SSP and USP.
	(md_assemble): Add support for TLS relocs.
	(mn10300_parse_name): Likewise.

	* readelf.c (is_16bit_abs_reloc): Add detection of R_MN10300_16.
2012-03-07 17:52:00 +00:00
Alan Modra 9f3bdf60f9 daily update 2012-03-06 23:00:04 +00:00
Jakub Jelinek 3ce231f8e2 * elf64-x86-64.c (elf_x86_64_relocate_section): For R_X86_64_RELATIVE
set relocate to TRUE.
2012-03-06 20:15:56 +00:00
Alan Modra d9cb611b57 daily update 2012-03-05 23:00:05 +00:00
Rainer Orth 0bef263a74 PR ld/12152
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Also ignore
	overflows for R_SPARC_UA32 in .stab sections.
2012-03-05 16:02:19 +00:00
Alan Modra 92dd1f05e1 daily update 2012-03-04 23:00:05 +00:00
Alan Modra f108d3e4e7 daily update 2012-03-03 23:00:05 +00:00
Alan Modra 4cb07424db daily update 2012-03-02 23:00:05 +00:00
Alan Modra b38716c63a daily update 2012-03-01 23:00:05 +00:00
Alan Modra 84abc003c2 * elfxx-tilegx.c (tilegx_elf_relocate_section): Silence bogus warning. 2012-03-01 01:55:11 +00:00
Alan Modra 7882da91a3 daily update 2012-02-29 23:00:05 +00:00
Alan Modra 2008e330b1 daily update 2012-02-28 23:00:05 +00:00
Alan Modra 5b0a97c933 daily update 2012-02-27 23:00:04 +00:00
Alan Modra 709bcda1f4 * chew.c (print_stack_level, main): Use %ld to print stack delta. 2012-02-27 07:03:00 +00:00
Alan Modra 3d301fdc61 * elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfd
before calling elf specific function.
	(sh_elf_osec_readonly_p): Test for error return from above.
2012-02-27 06:48:10 +00:00
Alan Modra cb83c803b7 * elf32-spu.c (build_stub): Fix malloc under-allocation. 2012-02-26 23:12:16 +00:00
Alan Modra 3899aa3b5a daily update 2012-02-26 23:00:04 +00:00
Walter Lee 6f7be9592d Improve TLS support on TILE-Gx/TILEPro:
- Add support for TLS LE references.
- Support linker optimization of TLS references.
- Delete relocations of GOT/tp relative offsets beyond 32-bits.

This brings binutils in line with the support expected in gcc 4.7, for
TILE-Gx/TILEPro.

bfd/
	* reloc.c: Add BFD_RELOC_TILEPRO_TLS_GD_CALL,
	BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD,
	BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD,
	BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD,
	BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD,
	BFD_RELOC_TILEPRO_TLS_IE_LOAD, BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE,
	BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE,
	BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO,
	BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO,
	BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI,
	BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI,
	BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA,
	BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA,
	BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE,
	BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE,
	BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE,
	BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE,
	BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE,
	BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE,
	BFD_RELOC_TILEGX_TLS_GD_CALL, BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD,
	BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD,
	BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD,
	BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD, BFD_RELOC_TILEGX_TLS_IE_LOAD,
	BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD,
	BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD,
	BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD.
	Delete BFD_RELOC_TILEGX_IMM16_X0_HW1_GOT,
	BFD_RELOC_TILEGX_IMM16_X1_HW1_GOT,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_GOT,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_GOT,
	BFD_RELOC_TILEGX_IMM16_X0_HW3_GOT,
	BFD_RELOC_TILEGX_IMM16_X1_HW3_GOT,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_GOT,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_GOT,
	BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_GD,
	BFD_RELOC_TILEGX_IMM16_X0_HW1_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X1_HW1_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X0_HW3_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X1_HW3_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_TLS_IE,
	BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_TLS_IE.
	* elf32-tilepro.c (tilepro_elf_howto_table): Update tilepro
	relocations.
	(tilepro_reloc_map): Ditto.
	(tilepro_info_to_howto_rela): Ditto.
	(reloc_to_create_func): Ditto.
	(tilepro_tls_translate_to_le): New.
	(tilepro_tls_translate_to_ie): New.
	(tilepro_elf_tls_transition): New.
	(tilepro_elf_check_relocs): Handle new tls relocations.
	(tilepro_elf_gc_sweep_hook): Ditto.
	(allocate_dynrelocs): Ditto.
	(tilepro_elf_relocate_section): Ditto.
	(tilepro_replace_insn): New.
	(insn_mask_X1): New.
	(insn_mask_X0_no_dest_no_srca): New
	(insn_mask_X1_no_dest_no_srca): New
	(insn_mask_Y0_no_dest_no_srca): New
	(insn_mask_Y1_no_dest_no_srca): New
	(srca_mask_X0): New
	(srca_mask_X1): New
	(insn_tls_le_move_X1): New
	(insn_tls_le_move_zero_X0X1): New
	(insn_tls_ie_lw_X1): New
	(insn_tls_ie_add_X0X1): New
	(insn_tls_ie_add_Y0Y1): New
	(insn_tls_gd_add_X0X1): New
	(insn_tls_gd_add_Y0Y1): New
	* elfxx-tilegx.c (tilegx_elf_howto_table): Update tilegx
	relocations.
	(tilegx_reloc_map): Ditto.
	(tilegx_info_to_howto_rela): Ditto.
	(reloc_to_create_func): Ditto.
	(tilegx_elf_link_hash_table): New field disable_le_transition.
	(tilegx_tls_translate_to_le): New.
	(tilegx_tls_translate_to_ie): New.
	(tilegx_elf_tls_transition): New.
	(tilegx_elf_check_relocs): Handle new tls relocations.
	(tilegx_elf_gc_sweep_hook): Ditto.
	(allocate_dynrelocs): Ditto.
	(tilegx_elf_relocate_section): Ditto.
	(tilegx_copy_bits): New.
	(tilegx_replace_insn): New.
	(insn_mask_X1): New.
	(insn_mask_X0_no_dest_no_srca): New.
	(insn_mask_X1_no_dest_no_srca): New.
	(insn_mask_Y0_no_dest_no_srca): New.
	(insn_mask_Y1_no_dest_no_srca): New.
	(insn_mask_X0_no_operand): New.
	(insn_mask_X1_no_operand): New.
	(insn_mask_Y0_no_operand): New.
	(insn_mask_Y1_no_operand): New.
	(insn_tls_ie_ld_X1): New.
	(insn_tls_ie_ld4s_X1): New.
	(insn_tls_ie_add_X0X1): New.
	(insn_tls_ie_add_Y0Y1): New.
	(insn_tls_ie_addx_X0X1): New.
	(insn_tls_ie_addx_Y0Y1): New.
	(insn_tls_gd_add_X0X1): New.
	(insn_tls_gd_add_Y0Y1): New.
	(insn_move_X0X1): New.
	(insn_move_Y0Y1): New.
	(insn_add_X0X1): New.
	(insn_add_Y0Y1): New.
	(insn_addx_X0X1): New.
	(insn_addx_Y0Y1): New.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.

gas/
	* tc-tilepro.c (O_tls_le): Define operator.
	(O_tls_le_lo16): Ditto.
	(O_tls_le_hi16): Ditto.
	(O_tls_le_ha16): Ditto.
	(O_tls_gd_call): Ditto.
	(O_tls_gd_add): Ditto.
	(O_tls_ie_load): Ditto.
	(md_begin): Delete old operators; handle new operators.
	(emit_tilepro_instruction): Ditto.
	(md_apply_fix): Ditto.
	* tc-tilegx.c (O_hw1_got): Delete operator.
	(O_hw2_got): Ditto.
	(O_hw3_got): Ditto.
	(O_hw2_last_got): Ditto.
	(O_hw1_tls_gd): Ditto.
	(O_hw2_tls_gd): Ditto.
	(O_hw3_tls_gd): Ditto.
	(O_hw2_last_tls_gd): Ditto.
	(O_hw1_tls_ie): Ditto.
	(O_hw2_tls_ie): Ditto.
	(O_hw3_tls_ie): Ditto.
	(O_hw2_last_tls_ie): Ditto.
	(O_hw0_tls_le): Define operator.
	(O_hw0_last_tls_le): Ditto.
	(O_hw1_last_tls_le): Ditto.
	(O_tls_gd_call): Ditto.
	(O_tls_gd_add): Ditto.
	(O_tls_ie_load): Ditto.
	(O_tls_add): Ditto.
	(md_begin): Delete old operators; handle new operators.
	(emit_tilegx_instruction): Ditto.
	(md_apply_fix): Ditto.
	* doc/c-tilegx.texi: Delete old operators; document new operators.
	* doc/c-tilepro.texi: Ditto.

include/elf/
	* tilegx.h (R_TILEGX_IMM16_X0_HW1_GOT): Delete.
	(R_TILEGX_IMM16_X1_HW1_GOT): Ditto.
	(R_TILEGX_IMM16_X0_HW2_GOT): Ditto.
	(R_TILEGX_IMM16_X1_HW2_GOT): Ditto.
	(R_TILEGX_IMM16_X0_HW3_GOT): Ditto.
	(R_TILEGX_IMM16_X1_HW3_GOT): Ditto.
	(R_TILEGX_IMM16_X0_HW2_LAST_GOT): Ditto.
	(R_TILEGX_IMM16_X1_HW2_LAST_GOT): Ditto.
	(R_TILEGX_IMM16_X0_HW1_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X1_HW1_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X0_HW2_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X1_HW2_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X0_HW3_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X1_HW3_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X0_HW2_LAST_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X1_HW2_LAST_TLS_GD): Ditto.
	(R_TILEGX_IMM16_X0_HW1_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X1_HW1_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X0_HW2_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X1_HW2_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X0_HW3_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X1_HW3_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X0_HW2_LAST_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X1_HW2_LAST_TLS_IE): Ditto.
	(R_TILEGX_IMM16_X0_HW0_TLS_LE): New relocation.
	(R_TILEGX_IMM16_X1_HW0_TLS_LE): Ditto.
	(R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE): Ditto.
	(R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE): Ditto.
	(R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE): Ditto.
	(R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE): Ditto.
	(R_TILEGX_TLS_GD_CALL): Ditto.
	(R_TILEGX_IMM8_X0_TLS_GD_ADD): Ditto.
	(R_TILEGX_IMM8_X1_TLS_GD_ADD): Ditto.
	(R_TILEGX_IMM8_Y0_TLS_GD_ADD): Ditto.
	(R_TILEGX_IMM8_Y1_TLS_GD_ADD): Ditto.
	(R_TILEGX_TLS_IE_LOAD): Ditto.
	(R_TILEGX_IMM8_X0_TLS_ADD): Ditto.
	(R_TILEGX_IMM8_X1_TLS_ADD): Ditto.
	(R_TILEGX_IMM8_Y0_TLS_ADD): Ditto.
	(R_TILEGX_IMM8_Y1_TLS_ADD): Ditto.
	* tilepro.h (R_TILEPRO_TLS_GD_CALL): New relocation.
	(R_TILEPRO_IMM8_X0_TLS_GD_ADD): Ditto.
	(R_TILEPRO_IMM8_X1_TLS_GD_ADD): Ditto.
	(R_TILEPRO_IMM8_Y0_TLS_GD_ADD): Ditto.
	(R_TILEPRO_IMM8_Y1_TLS_GD_ADD): Ditto.
	(R_TILEPRO_TLS_IE_LOAD): Ditto.
	(R_TILEPRO_IMM16_X0_TLS_LE): Ditto.
	(R_TILEPRO_IMM16_X1_TLS_LE): Ditto.
	(R_TILEPRO_IMM16_X0_TLS_LE_LO): Ditto.
	(R_TILEPRO_IMM16_X1_TLS_LE_LO): Ditto.
	(R_TILEPRO_IMM16_X0_TLS_LE_HI): Ditto.
	(R_TILEPRO_IMM16_X1_TLS_LE_HI): Ditto.
	(R_TILEPRO_IMM16_X0_TLS_LE_HA): Ditto.
	(R_TILEPRO_IMM16_X1_TLS_LE_HA): Ditto.

include/opcode/
	* tilegx.h (tilegx_mnemonic): Add TILEGX_OPC_LD4S_TLS,
	TILEGX_OPC_LD_TLS.
	* tilepro.h (tilepro_mnemonic): Add TILEPRO_OPC_LW_TLS,
	TILEPRO_OPC_LW_TLS_SN.

opcodes/
	* tilegx-opc.c: Handle TILEGX_OPC_LD4S_TLS and TILEGX_OPC_LD_TLS.
	* tilepro-opc.c: Handle TILEPRO_OPC_LW_TLS and
	TILEPRO_OPC_LW_TLS_SN.
2012-02-25 22:24:21 +00:00
Walter Lee fb6ceddedd Add big-endian support for tilegx.
bfd/
	* config.bfd (tilegx-*-*): rename little endian vector; add big
	endian vector.
	(tilegxbe-*-*): New case.
	* configure.in (bfd_elf32_tilegx_vec): Rename...
	(bfd_elf32_tilegx_le_vec): ... to this.
	(bfd_elf32_tilegx_be_vec): New vector.
	(bfd_elf64_tilegx_vec): Rename...
	(bfd_elf64_tilegx_le_vec): ... to this.
	(bfd_elf64_tilegx_be_vec): New vector.
	* configure: Regenerate.
	* elf32-tilegx.c (TARGET_LITTLE_SYM): Rename.
	(TARGET_LITTLE_NAME): Ditto.
	(TARGET_BIG_SYM): Define.
	(TARGET_BIG_NAME): Define.
	* elf64-tilegx.c (TARGET_LITTLE_SYM): Rename.
	(TARGET_LITTLE_NAME): Ditto.
	(TARGET_BIG_SYM): Define.
	(TARGET_BIG_NAME): Define.
	* targets.c (bfd_elf32_tilegx_vec): Rename...
	(bfd_elf32_tilegx_le_vec): ... to this.
	(bfd_elf32_tilegx_be_vec): Declare.
	(bfd_elf64_tilegx_vec): Rename...
	(bfd_elf64_tilegx_le_vec): ... to this.
	(bfd_elf64_tilegx_be_vec): Declare.
	(_bfd_target_vector): Add / rename above vectors.

binutils/testsuite/
	* binutils-all/objdump.exp (cpus_expected): Add tilegx.

gas/
	* tc-tilegx.c (tilegx_target_format): Handle big endian.
	(OPTION_EB): Define.
	(OPTION_EL): Define.
	(md_longopts): Add entries for "EB" and "EL".
	(md_parse_option): Handle OPTION_EB and OPTION_EL.
	(md_show_usage): Add -EB and -EL.
	(md_number_to_chars): New.
	* tc-tilegx.h (TARGET_BYTES_BIG_ENDIAN): Guard definition with
	ifndef.
	(md_number_to_chars): Delete.
	* configure.tgt (tilegx*be): Handle.
	* doc/as.texinfo [TILE-Gx]: Document -EB and -EL.
	* doc/c-tilegx.texi: Ditto.

ld/
	* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32tilegx_be.c.
	(ALL_64_EMULATION_SOURCES): Add eelf64tilegx_be.c.
	(eelf32tilegx_be.c): Add rule to build this file.
	(eelf64tilegx_be.c): Ditto.
	* Makefile.in: Regenerate.
	* configure.tgt (tilegx-*-*): Support big endian.
	(tilegxbe-*-*): New.
	* emulparams/elf32tilegx.sh (OUTPUT_FORMAT): Rename.
	(BIG_OUTPUT_FORMAT): Define.
	(LITTLE_OUTPUT_FORMAT): Define.
	* emulparams/elf32tilegx_be.sh: New.
	* emulparams/elf64tilegx.sh (OUTPUT_FORMAT): Rename.
	(BIG_OUTPUT_FORMAT): Define.
	(LITTLE_OUTPUT_FORMAT): Define.
	* emulparams/elf64tilegx_be.sh: New.

ld/testsuite/
	* ld-tilegx/reloc-be.d: New.
	* ld-tilegx/reloc-le.d: New.
	* ld-tilegx/reloc.d: Delete.
	* ld-tilegx/tilegx.exp: Test big and little endian.
2012-02-25 19:51:34 +00:00
Walter Lee 825902491e Properly create and use a bfd_arch_info_type for 32-bit tilegx.
bfd/
	* arctures.c (bfd_architecture): Define bfd_mach_tilegx32.
	* bfd-in2.h: Regenerate.
	* cpu-tilegx.c (bfd_tilegx32_arch): define.
	  (bfd_tilegx_arch): link to bfd_tilegx32_arch.

gas/
	* tc-tilegx.c (md_begin): set architecture and machine.
2012-02-25 18:57:55 +00:00
Alan Modra 818f62b7c5 daily update 2012-02-24 23:00:05 +00:00
Nick Clifton 4115917d4b PR ld/13730
* reloc.c (bfd_generic_get_relocated_section_contents): Issue an
	error message instead of aborting, when an outofrange reloc is
	encountered.
2012-02-24 10:54:47 +00:00
Alan Modra 009db6a4cb daily update 2012-02-23 23:37:59 +00:00
Iain Sandoe 19765f5229 deal with endian-ness in mach-o non-scattered relocs.
BFD:

	* mach-o.c (bfd_mach_o_swap_in_non_scattered_reloc): New.
	(bfd_mach_o_canonicalize_one_reloc):  Swap non-scattered reloc
	bit-fields when target and host differ in endian-ness.  When
	PAIRs are non-scattered	find the 'symbol' from the preceding
	reloc.  Add FIXME re. reloc symbols on section boundaries.
	(bfd_mach_o_swap_out_non_scattered_reloc): New.
	(bfd_mach_o_write_relocs): Use bfd_mach_o_encode_non_scattered_reloc.

include/mach-o:

	* external.h: Add comments about relocations fields.  Add macros
	for non-scattered relocations.  Move scattered relocation macros to here.
	* reloc.h: Remove macros related to external representation of reloc fields.
2012-02-23 16:29:56 +00:00
Alan Modra fd323b9c19 daily update 2012-02-21 23:00:05 +00:00
Alan Modra e5a5827bd8 daily update 2012-02-20 23:00:05 +00:00
Alan Modra 498dd2e3c5 daily update 2012-02-19 23:00:06 +00:00
Alan Modra c942b7d5b5 daily update 2012-02-18 23:00:05 +00:00
Alan Modra b33aa3bffa daily update 2012-02-17 23:00:05 +00:00
Iain Sandoe 6639d37af3 support 16 sect-diffs for mach-o
bfd:

	* mach-o-i386.c (i386_howto_table): Add support for 16 bit
	sect-diffs.
	(bfd_mach_o_i386_swap_reloc_in): Handle 16bit sect-diffs.
	(bfd_mach_o_i386_swap_reloc_out): Likewise.
2012-02-17 11:23:44 +00:00
Iain Sandoe e1e81ed3c3 add LOCAL SECDIFF relocation for m32 mach-o
bfd:

	* reloc.c (BFD_RELOC_MACH_O_LOCAL_SECTDIFF):
	* libbfd.h: Regenerated.
	* bfd-in2.h: Likewise.
	* mach-o-i386.c (i386_howto_table): Include local sectdiff.
	(bfd_mach_o_i386_swap_reloc_in): Update for local sectdiff.
	(bfd_mach_o_i386_swap_reloc_out): Likewise.
2012-02-17 10:57:33 +00:00
Andreas Krebbel d0ddfe2750 2012-02-17 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf32-s390.c (elf_s390_relocate_section): Support basr in the
	GD->LE and LD->LE optimizations.
2012-02-17 08:38:06 +00:00
Alan Modra eb8c5f3f23 PR binutils/13355
* elf32-rx.c (elf32_rx_relax_section): Correct width check.
2012-02-16 07:40:23 +00:00
Alan Modra 997a393839 daily update 2012-02-15 23:00:07 +00:00
Alan Modra 9395078e8d daily update 2012-02-14 23:00:05 +00:00
Alan Modra 6ae3e978c3 Regenerate. 2012-02-14 01:24:35 +00:00
Alan Modra 662f60d3a0 daily update 2012-02-13 23:00:05 +00:00
Richard Henderson e1741a1ed1 PR ld/13621
bfd/
	* linker.c (fix_syms): Force symbols outside any section into
	bfd_abs_section_ptr.
ld/testsuite/
	* ld-elf/warn2.d: Expect ABS section for Foo.
	* ld-elf/zerosize1.d, zerosize1.s: New test.
2012-02-13 18:08:51 +00:00
Alan Modra 5efbbc4340 * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function.
* elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Declare.
	* elf32-m68hc11.c (elf_backend_merge_symbol_attribute): Define.
	* elf32-m68hc12.c (elf_backend_merge_symbol_attribute): Define.
2012-02-13 02:29:51 +00:00
Alan Modra f85c0d490a daily update 2012-02-12 23:00:07 +00:00
Alan Modra ec9d606732 daily update 2012-02-11 23:00:06 +00:00
Jan Kratochvil 3e3c397d77 bfd/
* oasys.c (oasys_write_header): Fix compilation warning on zero-sized
	memset.
2012-02-11 15:10:12 +00:00
Alan Modra 19ed63b22f daily update 2012-02-10 23:00:06 +00:00
Iain Sandoe 09903f4b53 bfd:
* mach-o.c (bfd_mach_o_build_seg_command): Count zerofill section
	vma additions in their logical, rather than physical order.
2012-02-10 11:24:44 +00:00
Iain Sandoe 632039e0a8 correct some mach-o section specification nits.
bfd:

	* mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
	parameters.
	* mach-o-x86-64.c (text_section_names_xlat): New.
	(mach_o_x86_64_segsec_names_xlat): New.
	(bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
	* mach-o-i386.c (text_section_names_xlat): Correct section parameters.
2012-02-10 11:07:33 +00:00
Tristan Gingold 565a6476ff 2012-02-10 Tristan Gingold <gingold@adacore.com>
* elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator
	to avoid infinite loop.  Add comments.
2012-02-10 10:09:14 +00:00
Alan Modra 52c93ca6fa daily update 2012-02-09 23:00:06 +00:00
H.J. Lu 923f257ffd Don't use multi byte nop instructions for i386
bfd/

2012-02-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13675
	* cpu-i386.c (bfd_arch_i386_fill): Updated to support multi byte
	nop instructions.
	(bfd_arch_i386_short_nop_fill): New.
	(bfd_arch_i386_long_nop_fill): Likewise.
	Use bfd_arch_i386_short_nop_fill in 32bit bfd_arch_info
	initializers.  Use bfd_arch_i386_long_nop_fill on 64bit
	bfd_arch_info initializers.

	* cpu-k1om.c (bfd_arch_i386_fill): Renamed to ...
	(bfd_arch_i386_short_nop_fill): This.
	Update bfd_arch_info initializers.
	* cpu-l1om.c: Likewise.

ld/testsuite/

2012-02-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13675
	* ld-i386/tlsnopic.dd: Update no-op padding.
	* ld-i386/tlspic.dd: Likewise.
2012-02-09 22:51:58 +00:00
Alan Modra 1fae2d8f52 daily update 2012-02-08 23:00:05 +00:00
Alan Modra 4e6b54a6ea * elflink.c (_bfd_elf_gc_mark_rsec): Mark weakdef syms too.
(_bfd_elf_fix_symbol_flags): When a weakdef is def_regular, clear
	the correct h->u.weakdef.
2012-02-08 10:12:20 +00:00
Alan Modra e8ca6f60a4 daily update 2012-02-07 23:00:05 +00:00
Alan Modra ff9e0f5bc8 * elf.c (elf_find_function): Don't use internal_elf_sym.
(_bfd_elf_maybe_function_sym): Likewise.  Replace elf_symbol_type
	parameter with asymbol.
	* elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
	* elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
	(struct elf_backend_data <maybe_function_sym>): Likewise.
2012-02-07 07:04:04 +00:00
Alan Modra 6004557ead daily update 2012-02-06 23:00:06 +00:00
Alan Modra 07a3880899 daily update 2012-02-05 23:00:05 +00:00