[arm] compute framereg and framesize when needed

I find local variables framereg and framesize is only used when cache
isn't NULL.  This patch to move the code into "if (cache)" block.

gdb:

2014-11-29  Yao Qi  <yao@codesourcery.com>

	* arm-tdep.c (arm_analyze_prologue): Move local variables
	'framereg' and 'framesize' to inner block.  Move code to
	inner block too.
Check that thread stack temps are not already enabled before enabling them.

This fixes a regression introduced by 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a.

gdb/ChangeLog:

	* eval.c (evaluate_subexp): Check that thread stack temporaries
	are not already enabled before enabling them.
Automatic date update in version.in
Don't output symbol version definitions for non-DT_NEEDED libs

	PR 16452, 16457
	* elflink.c (_bfd_elf_link_find_version_dependencies): Exclude
	symbols from libraries that won't be listed in DT_NEEDED.
	(elf_link_output_extsym): Don't output verdefs for such symbols.
Power4 should treat mftb as extended mfspr mnemonic

On further reading of ISA manual it appears gas should have been
treating mftb and mftbu as extended mnemonics for mfspr, for ISA 2.03
and later.

opcodes/
	* ppc-opc.c (powerpc_opcodes): Make mftb* generate mfspr for
	power4 and later.
gas/testsuite/
	* gas/ppc/a2.d: Update for mftb change.
	* gas/ppc/476.d: Likewise.
frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq()

I noticed in frame_id_eq() we were checking for the "l" frame_id being
invalid twice instead of checking both "l" and "r", so this patch
corrects it.

gdb/ChangeLog:

	* frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
Fix add-auto-load-safe-path typo.

gdb/doc/ChangeLog
2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (Auto-loading safe path): Fix add-auto-load-safe-path
	description typo.
Add add-auto-load-scripts-directory.

There is already "add-auto-load-safe-path" which works
like "set auto-load safe-path" but in append mode.

There was missing an append equivalent for "set auto-load scripts-directory".

ABRT has directory /var/cache/abrt-di/ as an alternative one
to /usr/lib/debug/ . Therefore ABRT needs to use -iex parameters to add this
/var/cache/abrt-di/ directory as a first-class debuginfo directory.
Using absolute "set auto-load scripts-directory" would hard-code the path
possibly overriding local system directory additions; besides it would not be
nice anyway.

gdb/ChangeLog
2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Add add-auto-load-scripts-directory.
	* NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
	* auto-load.c (add_auto_load_dir): New function.
	(_initialize_auto_load): Install it.

gdb/doc/ChangeLog
2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Add add-auto-load-scripts-directory.
	* gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link.
	(objfile-gdbdotext file): Add add-auto-load-scripts-directory.
Automatic date update in version.in
Don't enable gdbtk in testsuite

When I skim configure.ac and Makefile.in in gdb/testsuite, I happen to
see that directory gdb.gdbtk is added to subdirs, however it doesn't
exist.  gdb/testsuite/gdb.gdbtk was removed by the patch below,

  [rfa] git repo fixup: delete gdb/testsuite/gdb.gdbtk
  http://thread.gmane.org/gmane.comp.gdb.patches/61489

and we should cleanup configure.ac accordingly.

gdb/testsuite:

2014-12-01  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Remove AC_ARG_ENABLE for gdbtk.  Don't invoke
	AC_CONFIG_SUBDIRS(gdb.gdbtk).
	* configure: Re-generated.
Add checks for memory access violations exposed by fuzzed archives.

	PR binutils/17531
	* dwarf.c (process_cu_tu_index): Check for an out of range row
	index.
	* elfcomm.c (adjust_relative_path): Change name_len parameter to
	an unsigned long.  Check for path length overflow.
	(process_archive_index_and_symbols): Check for invalid header
	size.
	(setup_archive): Add checks for invalid archives.
	(get_archive_member_name): Add range checks.
	* elfcomm.h (adjust_relative_path): Update prototyoe.
	* readelf.c (process_archive): Add range checks.
Use core regset iterators on GNU Hurd

Remove native-only core file handling on GNU Hurd.  Instead, enable the
x86 target generic core regset logic on the Hurd by providing an
appropriate register offset map.

Thanks to Samuel Thibault for testing!

gdb/

	* config/i386/i386gnu.mh (NATDEPFILES): Remove core-regset.o.
	* i386gnu-nat.c: Do not include <sys/procfs.h> or "gregset.h".
	(CREG_OFFSET, creg_offset, CREG_ADDR): Remove.
	(supply_gregset, supply_fpregset): Remove.
	* i386gnu-tdep.c (i386gnu_gregset_reg_offset): New variable.
	(i386gnu_init_abi): Set tdep->gregset_reg_offset, gregset_num_regs,
	and sizeof_gregset.
Fix Python help() test for Python 3

The message displayed when using help() changed a bit with time, so this
adjusts the test accordingly.

gdb/testsuite/ChangeLog:

	* gdb.python/python.exp: Change expected reply to help().
Add tests for PR ld/16452 and PR ld/16457

	PR ld/16452
	PR ld/16457
	* ld-elf/pr16452.map: New file.
	* ld-elf/pr16452.od: Likewise.
	* ld-elf/pr16452a.c: Likewise.
	* ld-elf/pr16452b.c: Likewise.
	* ld-elf/pr16457.od: Likewise.

	* ld-elf/shared.exp (build_tests): Add tests for PR ld/16452 and
	PR ld/16457.
Remove duplicate comment

gdb/ChangeLog:

	* objfiles.c (allocate_objfile): Remove duplicate comment.
More fixes for memory access violations exposed by fuzzed binaries.

	PR binutils/17512
	* dwarf.h (struct dwarf_section): Add user_data field.
	* dwarf.c (frame_need_space): Check for an over large register
	number.
	(display_debug_frames): Check the return value from
	frame_need_space.  Check for a CFA expression that is so long the
	start address wraps around.
	(debug_displays): Initialise the user_data field.
	* objdump.c (load_specific_debug_section): Save the BFD section
	pointer in the user_data field of the dwarf_section structure.
	(free_debug_section): Update BFD section data when freeing section
	contents.
	* readelf.c (load_specific_debug_section): Initialise the
	user_data field.

	* archive.c (do_slurp_coff_armap): Add range checks to prevent
	running off the end of the string table.
	* compress.c (bfd_get_full_section_contents): Return a NULL
	pointer for zero sized sections.  Do not attempt to copy a buffer
	onto itself.
	* elf-attrs.c (_bfd_elf_parse_attributes): Check for an empty
	header.  Add range checks to avoid running off the end of the
	section.
	* elf.c (bfd_elf_get_str_section): Seek before allocating so that
	if the seek fails, no memory is allocated.
	(bfd_elf_string_from_elf_section): Do not allocate a string from a
	non string section.  It only leads to trouble later on.
	(_bfd_elf_print_private_bfd_data): Check for there being too
	little external dynamic data.
	(bfd_section_from_shdr): Replace assertion with a failure mode.
	(bfd_section_from_shdr): When walking a loaded group section use
	the internal structure size, not the external size.  Check for the
	group section being empty.
	* elf32-i386.c (elf_i386_rtype_to_howto): Replace assertion with a
	failure mode.
	* elfcode.h (elf_slurp_reloc_table): Likewise.
	* reloc.c (bfd_perform_relocation): Avoid seg-fault if the howto
	parameter is NULL.
Properly check for an out of range row index

	* dwarf.c (process_cu_tu_index): Properly check for an out of
	range row index.
Fix extraneous warning about executable stack.

PR gold/17578 notes that gold will print a warning about an executable stack
when the -z execstack option is given, even when there is no --warn_execstack
option. The warning is completely useless and unexpected, since the user
explicitly requested an executable stack, and did not even ask for warnings.

This patch fixes that, and adds an extra warning when --warn_execstack
and -z noexecstack are both given and an input file requires an executable
stack.

gold/
	PR gold/17578
	* layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
	is given.
	(Layout::create_executable_stack_info): Warn when -z noexecstack is
	given but some inputs require executable stack.
Add support for -z global.

gold/
	* layout.cc (Layout::finish_dynamic_section): When '-z global'
	is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
	* options.h (General_options): New -z option (global).
Automatic date update in version.in