Commit Graph

10792 Commits

Author SHA1 Message Date
Alan Modra 310bf259c3 daily update 2013-12-03 09:30:22 +10:30
Alan Modra ce3ca210b5 daily update 2013-12-02 09:30:01 +10:30
Alan Modra 4f36e1fee3 daily update 2013-12-01 09:30:12 +10:30
Alan Modra f1ec7f0f3e daily update 2013-11-30 09:30:12 +10:30
Alan Modra 5425b0d80b daily update 2013-11-29 09:30:13 +10:30
Alan Modra a6c8f227fe daily update 2013-11-28 09:30:14 +10:30
Tristan Gingold 48d5accb7a Improve dump of xdata/pdata on x86_64.
bfd/
2013-11-27  Tristan Gingold  <gingold@adacore.com>

	* pei-x86_64.c (pex_regs): Make it const.  Add comments.
	(pex64_get_runtime_function): Do not split UnwindData.
	(pex64_get_unwind_info): Extract the chain and the handler.
	(pex64_xdata_print_uwd_codes): Rewritten: do not reverse print
	the opcode, handle version 2, add consistency check, make the
	code host neutral.
	(pex64_dump_xdata): Change arguments to pass the section and its
	content.  Handle version 2, change output.
	(pex64_bfd_print_pdata): Add comments, load section for xdata.
	Avoid duplicate outputs.

include/coff
2013-11-27  Tristan Gingold  <gingold@adacore.com>

	* pe.h (struct pex64_runtime_function): Remove isChained.
	(UWOP_SAVE_XMM): Add comment.
	(struct pex64_unwind_info): Remove extra fields.
2013-11-27 11:21:03 +01:00
Alan Modra 247196c840 daily update 2013-11-27 09:30:14 +10:30
Will Newton 4920638856 bfd/elfnn-aarch64.c: Handle static links with ifunc correctly.
The code for handling GOT references to ifunc symbols in static links
was missing.

bfd/ChangeLog:

2013-11-26  Will Newton  <will.newton@linaro.org>

	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol):
	Handle STT_GNU_IFUNC symbols correctly in static links.

ld/testsuite/ChangeLog:

2013-11-26  Will Newton  <will.newton@linaro.org>

	* ld-aarch64/aarch64-elf.exp: Add ifunc-22.
	* ld-aarch64/ifunc-22.d: New file.
	* ld-aarch64/ifunc-22.s: Likewise.
2013-11-26 15:25:11 +00:00
Will Newton b1ee0cc489 bfd/elfnn-aarch64.c: Fix miscalculation of GOTPLT offset for ifunc syms.
The .got.plt header size was not being correctly taken into account
when calculating the offset for relocations against ifunc symbols.

bfd/ChangeLog:

2013-11-26  Will Newton  <will.newton@linaro.org>

	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Ensure
	PLT_INDEX is calculated using correct header size.

ld/testsuite/ChangeLog:

2013-11-26  Will Newton  <will.newton@linaro.org>

	* ld-aarch64/aarch64-elf.exp: Add ifunc-21 test.
	* ld-aarch64/ifunc-21.d: New file.
	* ld-aarch64/ifunc-21.s: Likewise.
2013-11-26 15:24:54 +00:00
Alan Modra 88e80851c9 daily update 2013-11-26 09:30:12 +10:30
Alan Modra 5a75f60bc2 daily update 2013-11-25 09:30:20 +10:30
Alan Modra 1fd4d43dbe daily update 2013-11-24 09:30:12 +10:30
Alan Modra 08f4871a65 daily update 2013-11-23 09:30:01 +10:30
Cory Fields 0cb112f740 * windres.c (define_resource): Use zero for timestamp, making
output deterministic. time.h include is no longer needed.
	* resres.c (res_append_resource): Likewise.

	* pe-dll.c (fill_edata): Only use a real timestamp if
	--insert-timestamp was used.
	* emultempl/pe.em: Add the --insert-timestamp option.
	* emultempl/pep.em: Likewise for 64bit.
	* ld.texinfo: Document the --insert-timestamp option.

	* libcoff-in.h: Add insert_timestamp flag to the pe_data struct.
	* libcoff.h: Regenerate.
	* peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Only use a real
	timestamp if --insert-timestamp was used.
2013-11-22 14:55:56 +00:00
Alan Modra 46b2ff5b53 daily update 2013-11-22 09:32:36 +10:30
Alan Modra 76fbd4629c daily update 2013-11-21 09:30:14 +10:30
Roland McGrath 33aa641a5d Fix *-nacl* target objcopy/strip of binary made with custom linker script
bfd/
	* elf-nacl.c (nacl_modify_segment_map): Calculate SIZEOF_HEADERS
	when not doing linking (i.e. INFO is a null pointer).
2013-11-19 15:05:15 -08:00
Alan Modra aa01e46a4c daily update 2013-11-20 09:30:14 +10:30
H.J. Lu 0c7231013c Re-indent elf_x86_64_section_from_shdr
* elf64-x86-64.c (elf_x86_64_section_from_shdr): Re-indent.
2013-11-19 13:00:42 -08:00
Alan Modra 3737b3210b daily update 2013-11-19 09:30:19 +10:30
Alan Modra 0e7c43d8ec daily update 2013-11-18 09:30:16 +10:30
H.J. Lu c33205431a Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND
bfd/

	* elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_PC32_BND
	and R_X86_64_PLT32_BND.
	(R_X86_64_standard): Replace R_X86_64_RELATIVE64 with
	R_X86_64_PLT32_BND.
	(IS_X86_64_PCREL_TYPE): Add R_X86_64_PLT32_BND.
	(x86_64_reloc_map): Add BFD_RELOC_X86_64_PC32_BND and
	BFD_RELOC_X86_64_PLT32_BND.
	(elf_x86_64_check_relocs): Handle R_X86_64_PC32_BND and
	R_X86_64_PLT32_BND.
	(elf_x86_64_gc_sweep_hook): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	* reloc.c (bfd_reloc_code_real): Add BFD_RELOC_X86_64_PC32_BND
	and BFD_RELOC_X86_64_PLT32_BND.
	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

gas/

	* config/tc-i386.c (reloc): Add an argument, bnd_prefix, to
	indicate if instruction has the BND prefix.  Return
	BFD_RELOC_X86_64_PC32_BND instead of BFD_RELOC_32_PCREL if
	bnd_prefix isn't zero.
	(output_branch): Pass BFD_RELOC_X86_64_PC32_BND to frag_var
	if needed.
	(output_jump): Update reloc call.
	(output_interseg_jump): Likewise.
	(output_disp): Likewise.
	(output_imm): Likewise.
	(x86_cons_fix_new): Likewise.
	(lex_got): Add an argument, bnd_prefix, to indicate if
	instruction has the BND prefix.  Use BFD_RELOC_X86_64_PLT32_BND
	if needed.
	(x86_cons): Update lex_got call.
	(i386_immediate): Likewise.
	(i386_displacement): Likewise.
	(md_apply_fix): Handle BFD_RELOC_X86_64_PC32_BND and
	BFD_RELOC_X86_64_PLT32_BND.
	(tc_gen_reloc): Likewise.
	* config/tc-i386-intel.c (i386_operator): Update lex_got call.

gas/testsuite/

	* gas/i386/i386.exp: Run x86-64-mpx-branch-1 and
	x86-64-mpx-branch-2 on 64-bit ELF targets.
	* gas/i386/x86-64-mpx-branch-1.d: New file.
	* gas/i386/x86-64-mpx-branch-1.s: Likewise.
	* gas/i386/x86-64-mpx-branch-2.d: Likewise.
	* gas/i386/x86-64-mpx-branch-2.s: Likewise.

include/elf/

	* x86-64.h: Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND.

ld/testsuite/

	* ld-x86-64/mpx.exp: New file.
	* ld-x86-64/mpx1.out: Likewise.
	* ld-x86-64/mpx1a.c: Likewise.
	* ld-x86-64/mpx1a.rd: Likewise.
	* ld-x86-64/mpx1b.c: Likewise.
	* ld-x86-64/mpx1c.c: Likewise.
	* ld-x86-64/mpx1c.rd: Likewise.
2013-11-17 08:57:56 -08:00
Alan Modra 2acaf6f952 daily update 2013-11-17 12:36:08 +10:30
Alan Modra 650948f9dc daily update 2013-11-16 09:30:19 +10:30
H.J. Lu bb81b736af Make room for PLT0 directly
* elf32-i386.c (elf_i386_allocate_dynrelocs): Make room for
	PLT0 directly.
	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2013-11-15 09:32:24 -08:00
Alan Modra 993a449f17 daily update 2013-11-15 09:30:20 +10:30
Nick Clifton 57460bcf82 PR ld/16017
* elf32-arm.c (elf32_arm_populate_plt_entry): Return a boolean
	value, TRUE for success, FALSE for failure.
	Fail if attempting to create a PLT entry for a thumb only target.
	(elf32_arm_final_link_relocate): Check result of calling
	elf32_arm_populate_plt_entry.
	(elf32_arm_finish_dynamic_symbol): Likewise.
2013-11-14 15:39:51 +00:00
Nick Clifton 31fc8a0b2f PR ld/16082
* elf32-hppa.c (elf32_hppa_hide_symbol): Remove old version
	information when forcing a symbol to be local.
2013-11-14 14:24:34 +00:00
Alan Modra ec2af0ee47 daily update 2013-11-14 09:30:19 +10:30
Yufeng Zhang da0781dc5f bfd/
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Use
	R_AARCH64_TLS_DTPMOD64 instead of R_AARCH64_TLS_DTPMOD;
	likewise for R_AARCH64_TLS_DTPREL and R_AARCH64_TLS_TPREL.

include/elf/

	* aarch64.h: Define R_AARCH64_TLS_DTPMOD64,
	R_AARCH64_TLS_DTPREL64 and R_AARCH64_TLS_TPREL64; guard
	R_AARCH64_TLS_DTPMOD, R_AARCH64_TLS_DTPREL and
	R_AARCH64_TLS_TPREL with RELOC_MACROS_GEN_FUNC.
2013-11-13 14:47:04 +00:00
Alan Modra 995407397c daily update 2013-11-13 09:30:27 +10:30
Alan Modra 130eeb0196 daily update 2013-11-12 09:30:18 +10:30
Yufeng Zhang 3b570dee4f * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Fix hard-coded
size of struct elf_prstatus.
2013-11-11 10:26:41 +00:00
Alan Modra 14b5f73fac PowerPC64 ELFv2, allocate dynreloc space for ifunc
* elf64-ppc.c (allocate_dynrelocs): Revert 2013-11-04 change.
2013-11-11 14:33:01 +10:30
Alan Modra afe397ea85 Correct elf64-ppc.c handling of protected symbols
Some places in elf64-ppc.c carelessly used SYMBOL_CALLS_LOCAL when
the proper test is SYMBOL_REFERENCES_LOCAL for cases where we take the
address of a protected symbol.  This works OK for function descriptors
but not for ELFv2.  Setting symbols to their global entry stub a
little earlier is to ensure _bfd_elf_hash_symbol allows such symbols
in .gnu.hash.

	* elf64-ppc.c (ppc64_elf_edit_toc): Use SYMBOL_REFERENCES_LOCAL
	here, not SYMBOL_CALLS_LOCAL.
	(ppc64_elf_relocate_section): Likewise.
	(size_global_entry_stubs): Set undefined symbols on their global
	entry stubs here..
	(build_global_entry_stubs): ..rather than here.
	(ppc64_elf_build_stubs): Don't reset glink->size before calling
	build_global_entry_stubs.
2013-11-11 14:31:58 +10:30
Alan Modra 32798b4b81 daily update 2013-11-11 09:30:01 +10:30
Alan Modra f215dd6bc8 daily update 2013-11-10 09:30:02 +10:30
Alan Modra 15e0e5f284 daily update 2013-11-09 09:30:18 +10:30
H.J. Lu 94d60ebd79 Remove strayed entry 2013-11-08 08:46:07 -08:00
Alan Modra fcb8d9c2f4 daily update 2013-11-08 09:30:18 +10:30
Roland McGrath 64b384e1e8 Set CPU type in BFD backend for x86_64-nacl* and i?86-nacl* targets
bfd/
	* archures.c (bfd_mach_i386_nacl): Fix definition so it doesn't
	collide with bfd_mach_l1om.
	* bfd-in2.h: Regenerate.

	* elf32-i386.c (elf32_i386_nacl_elf_object_p): New function.
	(elf_backend_object_p): Use that in elf32-i386-nacl definition.
	* elf64-x86-64.c (elf64_x86_64_nacl_elf_object_p): New function.
	(elf_backend_object_p): Use that in elf64-x86-64-nacl definition.
	(elf32_x86_64_nacl_elf_object_p): New function.
	(elf_backend_object_p): Use that in elf32-x86-64-nacl definition.

binutils/
	* objdump.c (dump_dwarf): Grok bfd_mach_x86_64_nacl and
	bfd_mach_x64_32_nacl as equivalent to bfd_mach_x86_64.

ld/testsuite/
	* ld-x86-64/x86-64.exp (mixed1, mixed2): Loosen error string match
	so it accepts "i386:nacl" in place of "i386".
	* ld-x86-64/ilp32-2.d: Likewise.
	* ld-x86-64/ilp32-3.d: Likewise.
	* ld-x86-64/lp64-2.d: Likewise.
	* ld-x86-64/lp64-3.d: Likewise.
2013-11-07 10:00:32 -08:00
Alan Modra 20d37e9aab daily update 2013-11-07 09:30:19 +10:30
DJ Delorie 2bc56d6613 * elf32-rl78.c (elf32_rl78_relax_delete_bytes): Make sure relocs
are loaded before trying to use them.
2013-11-05 22:13:04 -05:00
Alan Modra a5b5d5ae56 daily update 2013-11-06 09:30:19 +10:30
H.J. Lu 62d887d406 Pass ignored unresolved relocations to ld backend
bfd/

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-epiphany.c (epiphany_elf_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-metag.c (elf_metag_relocate_section): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-mep.c (mep_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	* elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
	* elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
	* elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.

	* elfnn-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/testsuite/

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
2013-11-05 10:29:44 -08:00
Alan Modra dba6fa9bce Hide ppc64 .TOC. from --export-dynamic
I can't see any good reason why anyone would want a dynamic .TOC., so
hide it in a way that is respected by _bfd_elf_export_symbol.  This
also fixes an abort in relocate_section on not finding sreloc for .TOC.

	* elf64-ppc.c (ppc64_elf_func_desc_adjust): Make .TOC. defined and
	hidden.
	(ppc64_elf_set_toc): Adjust.
2013-11-05 12:44:54 +10:30
Alan Modra 33e44f2eb2 Update elf64-ppc.c to use elf_link_hash_table shortcuts.
These shortcuts to dynamic sections in ppc_link_hash_table predated
their geneneric elf hash table equivalents.

	* elf64-ppc.c (struct ppc_link_hash_table): Remove got, plt, relplt,
	iplt, reliplt.  Update all references to use elf.sgot, elf.splt,
	elf.srelplt, elf.iplt and elf.irelplt.
2013-11-05 12:26:28 +10:30
Alan Modra cf2f8b3bf2 daily update 2013-11-05 09:30:21 +10:30
Sandra Loosemore 25153ba087 Remove incorrect ATTRIBUTE_UNUSED from nios2 bfd
2013-11-03  Sandra Loosemore  <sandra@codesourcery.com>

	bfd/
	* elf32-niso2.c (nios2_elf32_do_hi16_relocate): Remove incorrect
	ATTRIBUTE_UNUSED from parameter.
	(nios2_elf_do_lo16_relocate): Likewise.
	(nios2_elf32_do_hiadj16_relocate): Likewise.
	(nios2_elf32_do_pcrel_lo16_relocate): Likewise.
	(nios2_elf32_do_pcrel_hiadj16_relocate): Likewise.
	(nios2_elf32_do_pcrel16_relocate): Likewise.
	(nios2_elf32_do_call26_relocate): Likewise.
	(nios2_elf32_do_gprel_relocate): Likewise.
	(nios2_elf32_do_ujmp_relocate): Likewise.
	(nios2_elf32_do_cjmp_relocate): Likewise.
	(nios2_elf32_do_callr_relocate): Likewise.
	(nios2_elf32_gc_mark_hook): Likewise.
2013-11-03 18:39:07 -08:00