Commit Graph

87298 Commits

Author SHA1 Message Date
Yao Qi fcdad592cd Use unsuspend_all_lwps
This patch is to replace find_inferior (&all_threads, unsuspend_one_lwp, NULL)
with unsuspend_all_lwps (NULL), which is shorter.  They are equivalent
to each other.

gdb/gdbserver:

2016-05-17  Yao Qi  <yao.qi@linaro.org>

	* linux-low.c (linux_stabilize_threads): Call unsuspend_all_lwps
	instead of find_inferior.
2016-05-17 08:24:26 +01:00
GDB Administrator acac2e457a Automatic date update in version.in 2016-05-17 00:00:18 +00:00
Yao Qi 155b7f573b Match shell_prompt # in batch-preserve-term-settings.exp
batch-preserve-term-settings.exp fails if the shell prompt isn't $.  It
is # in our testing env.  In fact, the shell prompt can be anything.

The perfect solution would be "set_board_info shell_prompt" in the
host board file, and use board_info shell_prompt in
batch-preserve-term-settings.exp.  This is a little bit overkill to
me, and we still need to figure out the different prompts on different
shells.  I also tried to start shell with the prompt preset, but there is
not unique way to set shell prompt in different shells, so I give up.

It is reasonably simple to match either $ or # for the shell prompt, and
we can easily extend it to match other char, like >.

gdb/testsuite:

2016-05-16  Yao Qi  <yao.qi@linaro.org>

	* gdb.base/batch-preserve-term-settings.exp: Remove variable
	shell_prompt.  Update shell_prompt_re.
2016-05-16 17:32:43 +01:00
Maciej W. Rozycki 71de341392 V850/BFD: Call `_bfd_elf_copy_private_bfd_data' again
Correct a regression introduced with commit 685080f210 ("Adds support
for generating notes in V850 binaries.") which replaced rather than
extending the call to `_bfd_elf_copy_private_bfd_data' with
`v850_elf_copy_private_bfd_data'.  Consequently ELFOSABI_GNU marking is
not propagated to output by `objcopy' from objects containing
STB_GNU_UNIQUE symbols.

	bfd/
	* elf32-v850.c (v850_elf_copy_notes): New function, factored out
	from...
	(v850_elf_copy_private_bfd_data): ... here.  Call the new
	function and `_bfd_elf_copy_private_bfd_data'.

	binutils/
	* testsuite/binutils-all/objcopy.exp: Don't skip the `strip-10'
	test for the V850.
2016-05-16 13:31:20 +01:00
Trevor Saunders 7b14583ef0 m32r: make mach_table static and const
It is only read in tc-m32r.c, so it might as well be static and const, and
that should help the compiler slightly.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-m32r.c (mach_table): Make static and const.
2016-05-16 05:06:48 -04:00
Trevor Saunders 0591130a7c tc-vax.c: make prototype of flonum_gen2vax match its definition
gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-vax.c (flonum_gen2vax): Adjust prototype to match
	definition.
2016-05-16 05:04:01 -04:00
Trevor Saunders 9117cd3e10 stop defining linkrelax in multiple places
Defining linkrelax to have different values in as.c and tc-msp430.c /
tc-mn10300.c is at least rather tricky, and seems fragile, when we can just set
it in md_begin instead.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-mn10300.c (md_begin): set linkrelax here instead of
	defining it.
	* config/tc-msp430.c (md_begin): Likewise.
2016-05-16 05:01:52 -04:00
Trevor Saunders e18382406c m68hc11: make some vars type bfd_reloc_code_real_type
These variables only hold values from the bfd_reloc_code_real_type enum, and
are passed to functions that expect the argument to be of type
bfd_reloc_code_real_type, so it seems to make sense that there type is
bfd_reloc_code_real_type rather than int.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-m68hc11.c (fixup8): Change variables type from int to
	bfd_reloc_code_real_type where appropriate.
	(fixup16): Likewise.
	(fixup8_xg): Likewise.
2016-05-16 04:55:31 -04:00
Maciej W. Rozycki 69a1c8561a ld/testsuite/ld-elf/flags1.d: Update the xfail list
Update to match commit 924bc11ba4 ("Update section merge test.").

	ld/
	* testsuite/ld-elf/flags1.d: Update the xfail list.
2016-05-16 08:52:35 +01:00
GDB Administrator 558e50badb Automatic date update in version.in 2016-05-16 00:00:08 +00:00
Maciej W. Rozycki 9dfa3e6347 SH64/GAS: Fix a -Wwrite-strings build failure
Fix a commit 6757cf5769 ("enable -Wwrite-strings for gas") regression.

	gas/
	* config/tc-sh64.c (shmedia_check_limits): Constify `msg'.
2016-05-15 23:23:47 +01:00
Maciej W. Rozycki 180c87d999 ld/testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail removal
ld/
	* testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail
	removal.
2016-05-15 06:42:18 +01:00
GDB Administrator ea0ebc4fd8 Automatic date update in version.in 2016-05-15 00:00:08 +00:00
H.J. Lu bf6f87e726 Remove redundant sizeof on EXPECTED_VIEW_LENGTH
PR ld/20097
	* testplug2.c (onall_symbols_read): Remove redundant sizeof
	on EXPECTED_VIEW_LENGTH.
	* testplug4.c (onall_symbols_read): Likewise.
2016-05-14 05:51:28 -07:00
GDB Administrator 34ac9af335 Automatic date update in version.in 2016-05-14 00:00:14 +00:00
Peter Bergner 1178da445a Accept valid one byte signed and unsigned values for the IMM8 operand.
opcodes/
	* ppc-opc.c (IMM8): Use PPC_OPERAND_SIGNOPT.

gas/
	* testsuite/gas/ppc/power9.d <xxspltib>: Add additional operand tests.
	* testsuite/gas/ppc/power9.s: Likewise.
2016-05-13 15:15:00 -05:00
H.J. Lu 2168b2688a Don't convert GOTPCREL relocation against large section
bfd/

	PR ld/20093
	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
	GOTPCREL relocation against large section.

ld/

	PR ld/20093
	* testsuite/ld-x86-64/pr20093-1.d: New file.
	* testsuite/ld-x86-64/pr20093-1.s: Likewise.
	* testsuite/ld-x86-64/pr20093-2.d: Likewise.
	* testsuite/ld-x86-64/pr20093-2.s: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run pr20093-1 and pr20093-2.
2016-05-13 11:07:02 -07:00
Alan Modra d2edc834f7 Fix build breakage
* config/obj-coff.c (weak_uniquify): Delete unused var.
2016-05-13 15:58:07 +09:30
Alan Modra 4ade44b727 Set dynamic tag VMA and size from dynamic section when possible
Rather than searching the output for a specific named section, it's
better, where possible, to use a linker created dynamic section to set
a dynamic tag's value.  That way ld doesn't depend on the output
section name, making it possibile to map dynamic sections differently.

bfd/
	* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Use
	linker dynamic sections in calculating size and address of
	* dynamic tags rather than using output sections.  Remove asserts.
	* elf32-arm.c (elf32_arm_finish_dynamic_sections): Likewise.
	* elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Likewise.
	* elf32-cris.c (elf_cris_finish_dynamic_sections): Likewise.
	* elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
	* elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
	* elf32-m32r.c (m32r_elf_finish_dynamic_sections): Likewise.
	* elf32-m68k.c (elf_m68k_finish_dynamic_sections): Likewise.
	* elf32-metag.c (elf_metag_finish_dynamic_sections): Likewise.
	* elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Likewise.
	* elf32-nds32.c (nds32_elf_finish_dynamic_sections): Likewise.
	* elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Likewise.
	* elf32-or1k.c (or1k_elf_finish_dynamic_sections): Likewise.
	* elf32-s390.c (elf_s390_finish_dynamic_sections): Likewise.
	* elf32-score.c (s3_bfd_score_elf_finish_dynamic_sections): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_finish_dynamic_sections): Likewise.
	* elf32-vax.c (elf_vax_finish_dynamic_sections): Likewise.
	* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Likewise.
	* elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Likewise.
	* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
	* elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
	* elflink.c (bfd_elf_final_link): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise.
	* elfxx-sparc.c (sparc_finish_dyn): Likewise.  Adjust error message.
	* elf32-arc.c (GET_SYMBOL_OR_SECTION): Remove ASSERT arg and
	don't set doit.  Look up dynobj section.
	(elf_arc_finish_dynamic_sections): Adjust GET_SYMBOL_OR_SECTION
	invocation and dynamic tag vma calculation.  Don't test
	boolean var == TRUE.
	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Fix
	DT_JMPREL calc.
ld/
	* testsuite/ld-arm/arm-elf.exp: Adjust for arm-no-rel-plt now passing.
	Use different output file name for static app without .rel.plt.
	* testsuite/ld-arm/arm-no-rel-plt.ld: Align .rel.dyn and .rela.dyn.
	* testsuite/ld-arm/arm-no-rel-plt.out: Delete.
	* testsuite/ld-arm/arm-no-rel-plt.r: New.
	* testsuite/ld-arm/arm-static-app.d: Don't check file name.
	* testsuite/ld-arm/arm-static-app.r: Likewise.
2016-05-13 14:34:45 +09:30
Alan Modra c8e44c6d16 ld -z combreloc elf_link_sort_relocs
A linker script may put .rela.plt in with other .rela.dyn relocs.
The change to elf_reloc_type_class puts any PLT relocs last.  This
patch makes the input section layout better match the sorted relocs.

	* elflink.c (elf_link_sort_relocs): Wrap overlong lines.  Fix
	octets_per_byte.  Put dynamic .rela.plt last in link orders.
	Assign output_offset for reloc sections rather than writing
	sorted relocs from block corresponding to output_offset.
2016-05-13 14:34:45 +09:30
Trevor Saunders add39d2344 use XNEW and related macros more
Its a bit shorter and simpler than raw xmalloc.

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* app.c (app_push): Use XNEW and related macros.
	* as.c (parse_args): Likewise.
	* cgen.c (make_right_shifted_expr): Likewise.
	(gas_cgen_tc_gen_reloc): Likewise.
	* config/bfin-defs.h: Likewise.
	* config/bfin-parse.y: Likewise.
	* config/obj-coff.c (stack_init): Likewise.
	(stack_push): Likewise.
	(coff_obj_symbol_new_hook): Likewise.
	(coff_obj_symbol_clone_hook): Likewise.
	(add_lineno): Likewise.
	(coff_frob_symbol): Likewise.
	* config/obj-elf.c (obj_elf_section_name): Likewise.
	(build_group_lists): Likewise.
	* config/obj-evax.c (evax_symbol_new_hook): Likewise.
	* config/obj-macho.c (obj_mach_o_indirect_symbol): Likewise.
	* config/tc-aarch64.c (insert_reg_alias): Likewise.
	(find_or_make_literal_pool): Likewise.
	(add_to_lit_pool): Likewise.
	(fill_instruction_hash_table): Likewise.
	* config/tc-alpha.c (load_expression): Likewise.
	(emit_jsrjmp): Likewise.
	(s_alpha_ent): Likewise.
	(s_alpha_end): Likewise.
	(s_alpha_linkage): Likewise.
	(md_begin): Likewise.
	(tc_gen_reloc): Likewise.
	* config/tc-arc.c (arc_insert_opcode): Likewise.
	(arc_extcorereg): Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-cr16.c: Likewise.
	* config/tc-cris.c: Likewise.
	* config/tc-crx.c (preprocess_reglist): Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-frv.c (frv_insert_vliw_insn): Likewise.
	(frv_tomcat_shuffle): Likewise.
	* config/tc-h8300.c: Likewise.
	* config/tc-i370.c (i370_macro): Likewise.
	* config/tc-i386.c (lex_got): Likewise.
	(md_parse_option): Likewise.
	* config/tc-ia64.c (alloc_record): Likewise.
	(set_imask): Likewise.
	(save_prologue_count): Likewise.
	(dot_proc): Likewise.
	(dot_endp): Likewise.
	(ia64_frob_label): Likewise.
	(add_qp_imply): Likewise.
	(add_qp_mutex): Likewise.
	(mark_resource): Likewise.
	(dot_alias): Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c (m68k_frob_label): Likewise.
	(s_save): Likewise.
	(mri_control_label): Likewise.
	(push_mri_control): Likewise.
	(build_mri_control_operand): Likewise.
	(s_mri_else): Likewise.
	(s_mri_break): Likewise.
	(s_mri_next): Likewise.
	(s_mri_for): Likewise.
	(s_mri_endw): Likewise.
	* config/tc-metag.c (create_mnemonic_htab): Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mmix.c (s_loc): Likewise.
	* config/tc-nds32.c (nds32_relax_hint): Likewise.
	* config/tc-nios2.c (nios2_insn_reloc_new): Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c (rx_include): Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-sh64.c (shmedia_frob_section_type): Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-spu.c: Likewise.
	* config/tc-tic6x.c (static tic6x_unwind_info *tic6x_get_unwind): Likewise.
	(tic6x_start_unwind_section): Likewise.
	* config/tc-tilegx.c: Likewise.
	* config/tc-tilepro.c: Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-visium.c: Likewise.
	* config/tc-xgate.c: Likewise.
	* config/tc-xtensa.c (xtensa_translate_old_userreg_ops): Likewise.
	(new_resource_table): Likewise.
	(resize_resource_table): Likewise.
	(xtensa_create_trampoline_frag): Likewise.
	(xtensa_maybe_create_literal_pool_frag): Likewise.
	(cache_literal_section): Likewise.
	* config/xtensa-relax.c (append_transition): Likewise.
	(append_condition): Likewise.
	(append_value_condition): Likewise.
	(append_constant_value_condition): Likewise.
	(append_literal_op): Likewise.
	(append_label_op): Likewise.
	(append_constant_op): Likewise.
	(append_field_op): Likewise.
	(append_user_fn_field_op): Likewise.
	(enter_opname_n): Likewise.
	(enter_opname): Likewise.
	(split_string): Likewise.
	(parse_insn_templ): Likewise.
	(clone_req_or_option_list): Likewise.
	(clone_req_option_list): Likewise.
	(parse_option_cond): Likewise.
	(parse_insn_pattern): Likewise.
	(parse_insn_repl): Likewise.
	(build_transition): Likewise.
	(build_transition_table): Likewise.
	* dw2gencfi.c (alloc_fde_entry): Likewise.
	(alloc_cfi_insn_data): Likewise.
	(cfi_add_CFA_remember_state): Likewise.
	(dot_cfi_escape): Likewise.
	(dot_cfi_fde_data): Likewise.
	(select_cie_for_fde): Likewise.
	* dwarf2dbg.c (dwarf2_directive_loc): Likewise.
	* ecoff.c (ecoff_add_bytes): Likewise.
	(ecoff_build_debug): Likewise.
	* input-scrub.c (input_scrub_push): Likewise.
	(input_scrub_begin): Likewise.
	(input_scrub_next_buffer): Likewise.
	* itbl-ops.c (append_insns_as_macros): Likewise.
	(alloc_entry): Likewise.
	(alloc_field): Likewise.
	* listing.c (listing_newline): Likewise.
	(listing_listing): Likewise.
	* macro.c (get_any_string): Likewise.
	(delete_macro): Likewise.
	* stabs.c (generate_asm_file): Likewise.
	(stabs_generate_asm_lineno): Likewise.
	* subsegs.c (subseg_change): Likewise.
	(subseg_get): Likewise.
	* symbols.c (define_dollar_label): Likewise.
	(symbol_relc_make_sym): Likewise.
	* write.c (write_relocs): Likewise.
2016-05-13 00:35:51 -04:00
Trevor Saunders 29a2809e42 use xstrdup, xmemdup0 and concat more
gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/obj-coff.c (obj_coff_def): Simplify string copying.
	(weak_name2altname): Likewise.
	(weak_uniquify): Likewise.
	(obj_coff_section): Likewise.
	(obj_coff_init_stab_section): Likewise.
	* config/obj-elf.c (obj_elf_section_name): Likewise.
	(obj_elf_init_stab_section): Likewise.
	* config/obj-evax.c (evax_shorten_name): Likewise.
	* config/obj-macho.c (obj_mach_o_make_or_get_sect): Likewise.
	* config/tc-aarch64.c (create_register_alias): Likewise.
	* config/tc-alpha.c (load_expression): Likewise.
	(s_alpha_file): Likewise.
	(s_alpha_section_name): Likewise.
	(tc_gen_reloc): Likewise.
	* config/tc-arc.c (md_assemble): Likewise.
	* config/tc-arm.c (create_neon_reg_alias): Likewise.
	(start_unwind_section): Likewise.
	* config/tc-hppa.c (pa_build_unwind_subspace): Likewise.
	(hppa_elf_mark_end_of_function): Likewise.
	* config/tc-nios2.c (nios2_modify_arg): Likewise.
	(nios2_negate_arg): Likewise.
	* config/tc-rx.c (rx_section): Likewise.
	* config/tc-sh64.c (sh64_consume_datalabel): Likewise.
	* config/tc-tic30.c (tic30_find_parallel_insn): Likewise.
	* config/tc-tic54x.c (tic54x_include): Likewise.
	(tic54x_macro_info): Likewise.
	(subsym_get_arg): Likewise.
	(subsym_substitute): Likewise.
	(tic54x_start_line_hook): Likewise.
	* config/tc-xtensa.c (xtensa_literal_prefix): Likewise.
	(xg_reverse_shift_count): Likewise.
	* config/xtensa-relax.c (enter_opname_n): Likewise.
	(split_string): Likewise.
	* dwarf2dbg.c (get_filenum): Likewise.
	(process_entries): Likewise.
	* expr.c (operand): Likewise.
	* itbl-ops.c (alloc_entry): Likewise.
	* listing.c (listing_message): Likewise.
	(listing_title): Likewise.
	* macro.c (check_macro): Likewise.
	* stabs.c (s_xstab): Likewise.
	* symbols.c (symbol_relc_make_expr): Likewise.
	* write.c (compress_debug): Likewise.
2016-05-13 00:35:51 -04:00
GDB Administrator 59441ccdbd Automatic date update in version.in 2016-05-13 00:00:12 +00:00
H.J. Lu 3355cb3b64 Handle symbols defined/referenced only within IR
The plugin is called to claim symbols in an archive element from
plugin_object_p.  But those symbols aren't needed to create output.
They are defined and referenced only within IR.  get_symbols should
return resolution based on IR symbol kinds.

	PR ld/20070
	* Makefile.am (noinst_LTLIBRARIES): Add libldtestplug4.la.
	(libldtestplug4_la_SOURCES): New.
	(libldtestplug4_la_CFLAGS): Likewise.
	(libldtestplug4_la_LDFLAGS): Likewise.
	* Makefile.in: Regenerated.
	* plugin.c (get_symbols): Return resolution based on IR symbol
	kinds for symbols defined/referenced only within IR.
	* testplug4.c: New file.
	* ld/testsuite/ld-plugin/pr20070.d: Likewise.
	* ld/testsuite/ld-plugin/pr20070a.c: Likewise.
	* ld/testsuite/ld-plugin/pr20070b.c: Likewise.
	* testsuite/ld-plugin/plugin.exp (plugin4_name): New.
	(plugin4_path): Likewise.
	Add a test for ld/20070.
2016-05-12 16:50:52 -07:00
Doug Evans 8ddd5a6cd6 PR symtab/19999 gdb unable to resolve vars with fission+PIE
gdb/ChangeLog:

	* dwarf2loc.c (dwarf2_find_location_expression): For DWO files still
	add base_offset.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (build_executable_from_fission_assembler): Pass
	$options when building executable.
	* gdb.dwarf2/fission-loclists-pie.c: New file.
	* gdb.dwarf2/fission-loclists-pie.exp: New file.
2016-05-12 09:24:24 -07:00
Nick Clifton 58c7f094c0 Use correct regexp syntax in ARM PR20068 test 2016-05-12 17:19:44 +01:00
Alan Modra 1997c9943a ld -z combreloc reloc sorting
PLT relocs don't appear in .rela.dyn, at least not when using
normal linker scripts.  However, if they do, then they ought to be
placed last rather than in the middle of other relocs.

	* elf-bfd.h (elf_reloc_type_class): Put reloc_class_plt last.
2016-05-13 00:17:19 +09:30
GDB Administrator 001c250f57 Automatic date update in version.in 2016-05-12 00:00:11 +00:00
Nick Clifton d5e74e8d3e Update pr20068 test to allow for big endian ARM configuration 2016-05-11 18:04:03 +01:00
Matthew Fortune 8f4f9071ad Add MIPS32 DSPr3 support.
bfd/

	* elfxx-mips.c (print_mips_ases): Add DSPR3.

binutils/

	* readelf.c (print_mips_ases): Add DSPR3.

gas/

	* config/tc-mips.c (options): Add OPTION_DSPR3 and
	OPTION_NO_DSPR3.
	(md_longopts): Likewise.
	(md_show_usage): Add help for -mdspr3 and -mno-dspr3.
	(mips_ases): Define availability for DSPr3.
	(mips_ase_groups): Add ASE_DSPR3 to the DSP group.
	(mips_convert_ase_flags): Map ASE_DSPR3 to AFL_ASE_DSPR3.
	* doc/as.texinfo: Document -mdspr3, -mno-dspr3.  Fix -mdspr2
	formatting.
	* doc/c-mips.texi: Document -mdspr3, -mno-dspr3, .set dspr3 and
	.set nodspr3.  Fix -mdspr2 formatting.
	* testsuite/gas/mips/mips32-dspr3.d: New file.
	* testsuite/gas/mips/mips32-dspr3.s: Likewise.
	* testsuite/gas/mips/mips.exp: Run mips32-dspr3 test.

include/

	* elf/mips.h (AFL_ASE_DSPR3): New macro.
	(AFL_ASE_MASK): Update to include AFL_ASE_DSPR3.
	* opcode/mips.h (ASE_DSPR3): New macro.

opcodes/

	* mips-dis.c (mips_arch_choices): Add ASE_DSPR3 to mips32r6 and
	mips64r6.
	* mips-opc.c (D34): New macro.
	(mips_builtin_opcodes): Define bposge32c for DSPr3.
2016-05-11 17:06:13 +01:00
Alan Modra a464198b01 [HPPA] Attach linker created dynamic sections to stub bfd
bfd/
	* elf32-hppa.c (elf32_hppa_init_stub_bfd): New function.
	(elf32_hppa_check_relocs): Don't set dynobj.
	(elf32_hppa_size_stubs): Test !SEC_LINKER_CREATED for stub sections.
	(elf32_hppa_build_stubs): Likewise.
	* elf32-hppa.h (elf32_hppa_init_stub_bfd): Declare.
ld/
	* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
	Call elf32_hppa_init_stub_bfd.
2016-05-11 22:51:14 +09:30
Alan Modra 3bd43ebcb6 ld --gc-sections fail with __tls_get_addr_opt
When --gc-sections is active, __tls_get_addr_opt is marked as not
needed and forced local before ppc*_elf_tls_setup is run.

bfd/
	PR 20060
	* elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
	* elf32-ppc.c (ppc_elf_tls_setup): Likewise.
ld/
	PR 20060
	* testsuite/ld-powerpc/powerpc.exp: Run new tests.
	* testsuite/ld-powerpc/tlsdll.s: New.
	* testsuite/ld-powerpc/tlsdll.ver: New.
	* testsuite/ld-powerpc/tlsdll_32.s: New.
	* testsuite/ld-powerpc/tlsopt5.d: New.
	* testsuite/ld-powerpc/tlsopt5.s: New.
	* testsuite/ld-powerpc/tlsopt5_32.d: New.
	* testsuite/ld-powerpc/tlsopt5_32.s: New.
2016-05-11 22:40:09 +09:30
Nick Clifton a6684f0ddd Ensure that padding in the constant pool uses constant values.
PR target/20068
	* config/tc-arm.c (add_to_lit_pool): Ensure that the padding added
	to the pool uses O_constant.
	* testsuite/gas/arm/pr20068.s: New test.
	* testsuite/gas/arm/pr20068.d: Test driver.
2016-05-11 12:53:12 +01:00
Jiong Wang 4e7fbb34f0 [AArch64] Remove redundant tls relax in elfNN_aarch64_final_link_relocate
bfd/
  * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Remove redundant
  aarch64_tls_transition check.
2016-05-11 11:55:02 +01:00
Nick Clifton 4179a6a209 oops - fix up changelog entry 2016-05-11 09:06:58 +01:00
Nick Clifton be5c445b69 Skip new ARM security extension tests on non-ELF based targets.
* testsuite/gas/arm/archv8m-cmse-base.d: Skip for non-ELF ARM targets.
	* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-msr-base.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
2016-05-11 09:04:17 +01:00
Trevor Saunders df140a0bc3 fix up two issues with the removal of unused variables
gdb/ChangeLog:

2016-05-10  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* iq2000-tdep.c (iq2000_scan_prologue): Remove if that shouldn't guard
	anything.
	* linespec.c (add_sal_to_sals): Restore call to symtab_to_fullname.
2016-05-10 21:36:02 -04:00
GDB Administrator aa79adb05d Automatic date update in version.in 2016-05-11 00:00:18 +00:00
Alexander Fomin 8bc526963e Enable Intel RDPID instruction.
This patch enables Intel RDPID instruction described in Intel64 and
IA-32 Architectures Software Developer's Manual, April 2016.

gas/

	* config/tc-i386.c (cpu_arch): Add RDPID.
	* doc/c-i386.texi: Document RDPID.

gas/testsuite/

	* gas/i386/i386.exp: Run RDPID tests.
	* gas/i386/prefix.d: Adjust.
	* gas/i386/rdpid.s: New test.
	* gas/i386/rdpid.d: Ditto.
	* gas/i386/rdpid-intel.d: Ditto.
	* gas/i386/x86-64-rdpid.s: Ditto.
	* gas/i386/x86-64-rdpid.d: Ditto.
	* gas/i386/x86-64-rdpid-intel.d: Ditto.

opcodes/

	* i386-dis.c (prefix_table): Add RDPID instruction.
	* i386-gen.c (cpu_flag_init): Add RDPID flag.
	(cpu_flags): Add RDPID bitfield.
	* i386-opc.h (enum): Add RDPID element.
	(i386_cpu_flags): Add RDPID field.
	* i386-opc.tbl: Add RDPID instruction.
	* i386-init.h: Regenerate.
	* i386-tbl.h: Regenerate.
2016-05-10 21:38:39 +03:00
Thomas Preud'homme 4f4faa4d43 Allow veneers to claim veneered symbols
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* elf32-arm.c (enum elf32_arm_stub_type): New max_stub_type
	enumerator.
	(arm_stub_sym_claimed): New function.
	(elf32_arm_create_stub): Use veneered symbol name and section if
	veneer needs to claim its symbol, and keep logic unchanged otherwise.
	(arm_stub_claim_sym): New function.
	(arm_map_one_stub): Call arm_stub_claim_sym if veneer needs to claim
	veneered symbol, otherwise create local symbol as before.
2016-05-10 16:20:19 +01:00
Thomas Preud'homme 39d911fc3c Use getters/setters to access ARM branch type
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* elf32-arm.c (elf32_arm_size_stubs): Use new macros
	ARM_GET_SYM_BRANCH_TYPE and ARM_SET_SYM_BRANCH_TYPE to respectively get
	and set branch type of a symbol.
	(bfd_elf32_arm_process_before_allocation): Likewise.
	(elf32_arm_relocate_section): Likewise and fix identation along the
	way.
	(allocate_dynrelocs_for_symbol): Likewise.
	(elf32_arm_finish_dynamic_symbol): Likewise.
	(elf32_arm_swap_symbol_in): Likewise.
	(elf32_arm_swap_symbol_out): Likewise.

gas/
	* config/tc-arm.c (arm_adjust_symtab): Use ARM_SET_SYM_BRANCH_TYPE to
	set branch type of a symbol.

gdb/
	* arm-tdep.c (arm_elf_make_msymbol_special): Use
	ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.

include/
	* arm.h (enum arm_st_branch_type): Add new ST_BRANCH_ENUM_SIZE
	enumerator.
	(NUM_ENUM_ARM_ST_BRANCH_TYPE_BITS): New macro.
	(ENUM_ARM_ST_BRANCH_TYPE_BITMASK): Likewise.
	(ARM_SYM_BRANCH_TYPE): Replace by ...
	(ARM_GET_SYM_BRANCH_TYPE): This and ...
	(ARM_SET_SYM_BRANCH_TYPE): This in two versions depending on whether
	BFD_ASSERT is defined or not.

ld/
	* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Use
	ARM_GET_SYM_BRANCH_TYPE to get branch type of a symbol.

opcodes/
	* arm-dis.c (get_sym_code_type): Use ARM_GET_SYM_BRANCH_TYPE to get
	branch type of a symbol.
	(print_insn): Likewise.
2016-05-10 16:17:04 +01:00
Thomas Preud'homme 6bde4c52fb Allow stubs without associated input section in ARM backend
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* bfd-in.h (elf32_arm_size_stubs): Add an output section parameter.
	* bfd-in2.h: Regenerated.
	* elf32-arm.c (struct elf32_arm_link_hash_table): Add an output section
	parameter to add_stub_section callback.
	(elf32_arm_create_or_find_stub_sec): Get output section from link_sec
	and pass it down to add_stub_section.
	(elf32_arm_add_stub): Set section to stub_sec if NULL before using it
	for error message.
	(elf32_arm_size_stubs): Add output section parameter to
	add_stub_section function pointer parameter.

ld/
	* emultempl/armelf.em (elf32_arm_add_stub_section): Add output_section
	parameter and rename input_section parameter to after_input_section.
	Append input stub section to the output section if after_input_section
	is NULL.
2016-05-10 15:45:01 +01:00
Thomas Preud'homme b715f643ef Factor our stub creation in ARM backend
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* elf32-arm.c (elf32_arm_create_stub): New function.
	(elf32_arm_size_stubs): Use elf32_arm_create_stub for stub creation.
2016-05-10 15:42:20 +01:00
Thomas Preud'homme 8d9d949014 Refactor Cortex-A8 erratum workaround in preparation
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* elf32-arm.c (enum elf32_arm_stub_type): Delete
	arm_stub_a8_veneer_lwm enumerator.
	(arm_stub_a8_veneer_lwm): New unsigned constant to replace
	aforementioned enumerator.
	(struct elf32_arm_stub_hash_entry): Delete target_addend
	field and add source_value.
	(struct a8_erratum_fix): Delete addend field and add target_offset.
	(stub_hash_newfunc): Initialize source_value field amd remove
	initialization for target_addend.
	(arm_build_one_stub): Stop special casing Thumb relocations: promote
	the else to being always executed, moving the
	arm_stub_a8_veneer_b_cond specific code in it.  Remove
	stub_entry->target_addend from points_to computation.
	(cortex_a8_erratum_scan): Store in a8_erratum_fix structure the offset
	to target symbol from start of section rather than the offset from the
	stub address.
	(elf32_arm_size_stubs): Set stub_entry's source_value and target_value
	fields from struct a8_erratum_fix's offset and target_offset
	respectively.
	(make_branch_to_a8_stub): Rename target variable to loc.  Compute
	veneered_insn_loc and loc using stub_entry's source_value.
2016-05-10 15:28:10 +01:00
Thomas Preud'homme 15afaa63f3 Add support for ARMv8-M Mainline with DSP extension
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	(elf32_arm_merge_eabi_attributes): Add merging logic for
	Tag_DSP_extension.

binutils/
	* readelf.c (display_arm_attribute): Add output for Tag_DSP_extension.
	(arm_attr_public_tags): Define DSP_extension attribute.

gas/
	* NEWS: Document ARMv8-M and ARMv8-M Security and DSP Extensions.
	* config/tc-arm.c (arm_ext_dsp): New feature for Thumb DSP
	instructions.
	(arm_extensions): Add dsp extension for ARMv8-M Mainline.
	(aeabi_set_public_attributes): Memorize the feature bits of the
	architecture selected for Tag_CPU_arch.  Use it to set
	Tag_DSP_extension to 1 for ARMv8-M Mainline with DSP extension.
	(arm_convert_symbolic_attribute): Define Tag_DSP_extension.
	* testsuite/gas/arm/arch7em-bad.d: Rename to ...
	* testsuite/gas/arm/arch7em-bad-1.d: This.
	* testsuite/gas/arm/arch7em-bad-2.d: New file.
	* testsuite/gas/arm/arch7em-bad-3.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-5.d: Likewise.
	* testsuite/gas/arm/attr-march-armv8m.main.dsp.d: Likewise.

include/
	* elf/arm.h (Tag_DSP_extension): Define.

ld/
	* testsuite/ld-arm/arm-elf.exp (EABI attribute merging 10 (DSP)): New
	test.
	* testsuite/ld-arm/attr-merge-10b-dsp.s: New file.
	* testsuite/ld-arm/attr-merge-10-dsp.attr: Likewise.
2016-05-10 15:24:10 +01:00
Thomas Preud'homme d942732e82 Allow extension availability to depend on several architecture bits
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
	* config/tc-arm.c (struct arm_option_extension_value_table): Make
	allowed_archs an array with 2 entries.
	(ARM_EXT_OPT): Adapt to only fill the first entry of allowed_archs.
	(ARM_EXT_OPT2): New macro filling the two entries of allowed_archs.
	(arm_extensions): Use separate entries in allowed_archs when several
	archs are allowed to use an extension and change ARCH_ANY in
	ARM_ARCH_NONE in allowed_archs.
	(arm_parse_extension): Check that, for each allowed_archs entry, all
	bits are set in the current architecture, ignoring ARM_ANY entries.
	(s_arm_arch_extension): Likewise.

include/
	* arm.h (ARM_FSET_CPU_SUBSET): Define macro.
2016-05-10 15:12:11 +01:00
Thomas Preud'homme 16a1fa25be Add support for ARMv8-M security extensions instructions
2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
	* config/tc-arm.c (arm_ext_m): Add feature bit ARM_EXT2_V8M_MAIN.
	(arm_ext_v8m_main): New feature set for bit ARM_EXT2_V8M_MAIN.
	(arm_ext_v8m_m_only): New feature set for instructions in ARMv8-M not
	shared with a non M profile architecture.
	(do_rn): New function.
	(known_t32_only_insn): Check opcode against arm_ext_v8m_m_only rather
	than arm_ext_v8m.
	(v7m_psrs): Add ARMv8-M security extensions new special registers.
	(insns): Add ARMv8-M Security Extensions instructions.
	(aeabi_set_public_attributes): Use arm_ext_v8m_m_only instead of
	arm_ext_v8m_m to decide the profile and the Thumb ISA.
	* testsuite/gas/arm/archv8m-cmse.s: New file.
	* testsuite/gas/arm/archv8m-cmse-main.s: Likewise..
	* testsuite/gas/arm/archv8m-cmse-msr.s: Likewise.
	* testsuite/gas/arm/any-cmse.d: Likewise.
	* testsuite/gas/arm/any-cmse-main.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-base.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-msr-base.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.

include/
	* opcode/arm.h (ARM_EXT2_V8M_MAIN): new feature bit.
	(ARM_AEXT2_V8M_MAIN): New architecture extension feature set.
	(ARM_ARCH_V8M_MAIN): Use ARM_AEXT2_V8M_MAIN instead of ARM_AEXT2_V8M
	for the high core bits.

opcodes/
	* arm-dis.c (coprocessor_opcodes): Add entries for VFP ARMv8-M
	Mainline Security Extensions instructions.
	(thumb_opcodes): Add entries for narrow ARMv8-M Security
	Extensions instructions.
	(thumb32_opcodes): Add entries for wide ARMv8-M Security Extensions
	instructions.
	(psr_name): Add new MSP_NS and PSP_NS ARMv8-M Security Extensions
	special registers.
2016-05-10 15:03:38 +01:00
Andrew Burgess 29f4fdc42d binutils/doc: Update documentation for nm --size-sort
The documentation for 'nm --size-sort' is out of step with the code, the
special handling for ELF is not mentioned in the documentation, and
could cause confusion to a user.

binutils/ChangeLog:

	* doc/binutils.texi (nm): Update description of --size-sort.
2016-05-10 08:47:14 +01:00
Christophe Lyon d63a50b79e 2016-05-10 Christophe Lyon <christophe.lyon@linaro.org>
* ld/testsuite/ld-elf/flags1.d (xfail): Remove *-*-nacl*".
2016-05-10 09:33:08 +02:00
Pip Cet 66a368220c PR 20059 _bfd_elf_copy_link_hash_symbol_type segfault
PR ld/20059
	* elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type):
	Define as _bfd_generic_copy_link_hash_symbol_type when using
	generic hash table.
2016-05-10 11:04:55 +09:30