Skip tests on completion and readline when readline lib isn't used

The completion feature and other features on readline depend on the
readline library.  However, readline library is not always used, for
example, running testsuite like

  make check RUNTESTFLAGS="--host_board=local-remote-host"

the input stream is not a tty, and GDB doesn't use readline library
as a result.

This patch is to skip tests on completion and readline if
'show editing' is off, which means readline isn't used.  Note that
some tests in gdb.base/completion.exp test command complete, which
isn't related to readline, so these tests aren't affected by readline
library.  This patch also moves these tests up, run them
unconditionally, and run the rest if readline library is used.

gdb/testsuite:

2014-03-26  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (readline_is_used): New proc.
	* gdb.base/completion.exp: Move tests on command complete up.
	Skip the rest of tests if readline is not used.
	* gdb.ada/complete.exp: Skp the test if readline is not
	used.
	* gdb.base/filesym.exp: Likewise.
	* gdb.base/macscp.exp: Likewise.
	* gdb.base/readline-ask.exp: Likewise.
	* gdb.base/readline.exp: Likewise.
	* gdb.python/py-cmd.exp: Likewise.
	* gdb.trace/tfile.exp: Likewise.
Referencing a function's address on PowerPC64 ELFv2

ELFv2 needs to create plt entries in a non-PIC executable for an
address reference to a function defined in a shared object.  It's
possible that an object file has no features that distinguish it as
ELFv1 or ELFv2, eg. an object only containing data.  Such files need
to be handled like those that are known to be ELFv2.
However, this unnecessarily creates plt entries for the analogous
ELFv1 case, so arrange to set output abi version earlier, and use the
output abi version to further distinguish ambiguous input files.

bfd/
	* elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly
	needed plt entries when taking the address of functions for
	abiversion == 0 (ie. unknown) as well as abiversion == 2.
	Move opd setup and abiversion checks to..
	(ppc64_elf_before_check_relocs): ..here.  Renamed from
	ppc64_elf_process_dot_syms.  Set output abiversion from input and
	input abiversion from output, if either is not set.
	(ppc64_elf_merge_private_bfd_data): Don't merge flags here.
	(elf_backend_check_directives): Update.
ld/testsuite/
	* ld-powerpc/startv1.s, * ld-powerpc/startv2.s, * ld-powerpc/funref.s,
	* ld-powerpc/funv1.s, * ld-powerpc/funv2.s,
	* ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv2.d: New test files.
	* ld-powerpc/powerpc.exp: Run new tests.
Mach-O: Add BFD_MACH_O_CPU_TYPE_ARM64.

include/mach-o/
        * loader.h (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_ARM64.

bfd/
        * mach-o.c (bfd_mach_o_convert_architecture): Add
        BFD_MACH_O_CPU_TYPE_ARM64.

binutils/
        * od-macho.c (bfd_mach_o_cpu_name): Add BFD_MACH_O_CPU_TYPE_ARM64.
Remove VAR_DOMAIN/STRUCT_DOMAIN ambiguity from ada-tasks.c.

2014-03-26  Keith Seitz  <keiths@redhat.com>

	* ada-tasks.c (get_tcb_types_info): Search STRUCT_DOMAIN for
	types, not VAR_DOMAIN.
This fixes a problem for 64-bit Cygwin, where building some packages can
produce spurious errors about truncated relocations.  The relocations are
only truncated because they are being made against sections which are going
to be discarded so that base address is zero instead of the expected 64-bit
base value.

	* cofflink.c (_bfd_coff_generic_relocate_section): Skip
	relocations in discarded sections.
Add support for %hi8, %hi16 and %lo16 being used when relocation are necessary.

	* config/tc-rl78.c (rl78_op): Issue an error message if a 16-bit
	relocation is used on an 8-bit operand or vice versa.
	(tc_gen_reloc): Use the RL78_16U relocation for RL78_CODE.
	(md_apply_fix): Add support for RL78_HI8, RL78_HI16 and RL78_LO16.
[AArch64 disassembler] Add missing checks of undefine encodings on
st1/st2/st3/st4 instructions.

opcodes/

	* aarch64-dis.c (aarch64_ext_ldst_elemlist): Check H/S undefined
	instructions.

binutils/testsuite/

	* binutils-all/aarch64/aarch64.exp: New test driver for AArch64.
	* binutils-all/aarch64/unallocated-encoding.s: New testcase.
	* binutils-all/aarch64/unallocated-encoding.d: Ditto.
daily update
objdump: set address of debug sections.

This patche fixes the values of FDE pc in output of objdump -Wf. They now
match readelf ones.

binutils/
	* objdump.c (load_specific_debug_section): Set address of section.
Return zero in can_single_step_to_signal_handler for nios2-*-* target

nios2 uses software single step, so GDB is unable to single step to
the signal handler.  In order to reflect this, teach
can_single_step_to_signal_handler to return zero for nios2 target.

gdb/testsuite:

2014-03-27  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (can_single_step_to_signal_handler): Return zero
	if target is nios2-*-*.
Mach-O: add objdump -P function_starts to display function starts.

bfd/
	* mach-o.h (bfd_mach_o_get_base_address): New prototype.
	* mach-o.c (bfd_mach_o_write_symtab)
	(bfd_mach_o_write_contents)
	(bfd_mach_o_set_section_flags_from_bfd)
	(bfd_mach_o_build_seg_command): Fix indentation.
	(bfd_mach_o_get_base_address): New function.

binutils/
	* od-macho.c (OPT_FUNCTION_STARTS): New macro.
	(options): Add entry for function_starts.
	(mach_o_help): Ditto.
	(disp_segment_prot): New function.
	(dump_section_map): Call disp_segment_prot.
	(dump_function_starts): New function.
	(dump_obj_compact_unwind): Fix ouput indentation.
	(dump_exe_compact_unwind): Fix ouput indentation.
	(mach_o_dump): Handle function_starts.
This fixes a compile time error triggered by -Werror=format-security because
a call to sprintf was being made with a non-constant formatting string.

	* config/tc-score.c (s3_parse_pce_inst): Add "%s" parameter to
	sprintf in order to avoid a compile time warning.
Mach-O: disp dyld environment command in objdump -P load.

bfd/
	* mach-o.c (bfd_mach_o_read_dylinker): Remove assert.
	(bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT.
binutils/
	* od-macho.c (dump_load_command): Display value for
	BFD_MACH_O_LC_DYLD_ENVIRONMENT.  Handle BFD_MACH_O_LC_DATA_IN_CODE
	and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS.
This is a fix for PR ld/16761 - the linker now has a dependence upon the binutils
because it needs to windres tool (for some targets).

	* Makefile.def (dependencies): Make all-ld depend on all-binutils
	for WINDRES_FOR_TARGET in default-manifest.o rule.
	* Makefile.in: Regenerate.
Add support for limited pretty-printing of ARM PLT entries on eabi and nacl targets.

    	* elf32-arm.c (elf32_arm_get_synthetic_symtab): Add new callback.
    	(elf32_arm_nacl_plt_sym_val): Likewise.
    	(elf32_arm_plt0_size): Add helper function.
    	(elf32_arm_plt_size): Likewise.

    	* ld-arm/arm-app-abs32.d: Updated test.
    	* ld-arm/arm-app.d: Likewise.
    	* ld-arm/arm-lib-plt32.d: Likewise.
    	* ld-arm/arm-lib.d: Likewise.
    	* ld-arm/armthumb-lib.d: Likewise.
    	* ld-arm/cortex-a8-fix-b-plt.d: Likewise.
    	* ld-arm/cortex-a8-fix-bcc-plt.d: Likewise.
    	* ld-arm/cortex-a8-fix-bl-plt.d: Likewise.
    	* ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
    	* ld-arm/cortex-a8-fix-blx-plt.d: Likewise.
    	* ld-arm/farcall-mixed-app-v5.d: Likewise.
    	* ld-arm/farcall-mixed-app.d: Likewise.
    	* ld-arm/farcall-mixed-lib-v4t.d: Likewise.
    	* ld-arm/farcall-mixed-lib.d: Likewise.
    	* ld-arm/ifunc-10.dd: Likewise.
    	* ld-arm/ifunc-14.dd: Likewise.
    	* ld-arm/ifunc-15.dd: Likewise.
    	* ld-arm/ifunc-3.dd: Likewise.
    	* ld-arm/ifunc-4.dd: Likewise.
    	* ld-arm/ifunc-7.dd: Likewise.
    	* ld-arm/ifunc-8.dd: Likewise.
    	* ld-arm/ifunc-9.dd: Likewise.
    	* ld-arm/long-plt-format.d: Likewise.
    	* ld-arm/mixed-app-v5.d: Likewise.
    	* ld-arm/mixed-app.d: Likewise.
    	* ld-arm/mixed-lib.d: Likewise.
    	* ld-arm/thumb2-bl-undefweak.d: Likewise.
    	* ld-arm/thumb2-bl-undefweak1.d: Likewise.
Scan all input files for symbol reference warning

This patch scans all input files for symbol reference warning if the
symbol reference doesn't exist in the current input file.

ld/

	PR ld/16756
	* ldmain.c (symbol_warning): New function.
	(warning_callback): Use it.  Scan all input files for a reference
	to SYMBOL.

ld/testsuite/

	PR ld/16756
	* ld-plugin/lto.exp: Expect filename and line number for PR
	ld/12760 test.
	* gdb.dwarf2/dw2-abs-hi-pc.exp: Build tests with "nodebug".
	* dwarf2read.c (struct dwarf2_cu): Improve comments for members
	addr_base, ranges_base.
	* dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments.
	Remove argument abbrev_section.  All callers updated.
	* dwarf2read.c (read_str_index): Delete arg cu.  All callers updated.