* elf32-rl78.c (elf32_rl78_relax_delete_bytes): Make sure relocs
are loaded before trying to use them.
New make target 'check-perf' and new dir gdb.perf

We add a new dir gdb.perf in testsuite for all performance tests.
However, current 'make check' logic will either run dejagnu in
directory testsuite or iterate all gdb.* directories which has *.exp
files.  Both of them will run tests in gdb.perf.  We want to achieve:

 1) typical 'make check' should not run performance tests.  In each perf
    test case, GDB_PERFTEST_MODE is checked.  If it doesn't exist, return.
 2) run perf tests easily.  We add a new makefile target 'check-perf'.

gdb:

2013-11-06  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (check-perf): New target.

gdb/testsuite:

2013-11-06  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (check-perf): New target.
	* configure.ac (AC_OUTPUT): Output Makefile in gdb.perf.
	* configure: Re-generated.
	* gdb.perf/Makefile.in: New.
Perf test framework

This patch adds a basic framework to do performance testing for GDB.
perftest.py is about the test case, testresult.py is about test
results, and how are they saved.  reporter.py is about how results
are reported (in what format).  measure.py is about measuring the
execution of tests by a collection of measurements.

In V5:
 - Simplify perftest.exp.

In V4:

 - Rename MeasurementCPUTime to MeasurementCpuTime,
 - Add 'pass' in empty method,
 - Simplify string comparison in perftest.exp.
 - Rename GDB_PERFORMANCE to GDB_PERFTEST_MODE and rename
   GDB_PERFORMANCE_TIMEOUT to GDB_PERFTEST_TIMEOUT.

In V3, there are some changes,

 - Add wall time measurement, cpu time measurement and vmsize
   measurement.
 - Rename SingleStatisticTestCase to TestCaseWithBasicMeasurements,
   which measures cpu time, wall time, and memory (vmsize).
 - GDB_PERFORMANCE=run|compile|both to control the mode of perf
   testing.
 - New GDB_PERFORMANCE_TIMEOUT to specify the timeout.
 - Split proc prepare to proc compile and startup.
 - Disable GC while doing measurements.

In V2, there are several changes to address Doug and Sanimir's
comments.

 - Add copyright header and docstring in perftest/__init__.py
 - Remove config.py.
 - Fix docstring format.
 - Rename classes "SingleVariable" to "SingleStatistic".
 - Don't extend gdb.Function in class TestCase.  Add a new method run
   to run the test case so that we can pass parameters to test.
 - Allow to customize whether to warm up and to append test log.
 - Move time measurement into test harness.  Add a new class
   Measurement for a specific measurement and a new class Measure to
   measure them for a given test case.
 - A new class ResultFactory to create instances of TestResult.
 - New file lib/perftest.exp, which is to do some preparations and
   cleanups to simplify each *.exp file.
 - Skip compilation step if GDB_PERFORMANCE_SKIP_COMPILE is set.

gdb/testsuite/

2013-11-06  Yao Qi  <yao@codesourcery.com>

	* lib/perftest.exp: New.
	* gdb.perf/lib/perftest/__init__.py: New.
	* gdb.perf/lib/perftest/measure.py: New.
	* gdb.perf/lib/perftest/perftest.py: New.
	* gdb.perf/lib/perftest/reporter.py: New.
	* gdb.perf/lib/perftest/testresult.py: New.
Mention perf test in testsuite/README

gdb/testsuite:

2013-11-06  Yao Qi  <yao@codesourcery.com>

	* README: Mention performance tests.
Test on solib load and unload

This patch is to add a test case to on the performance of GDB handling
load and unload of shared library.

In V4:

 - Handle malloc and dlopen failure,
 - Document test parameters.

In V3, there are some changes,

 - Adapt to perf test framework changes.
 - Measure load and unload separately.

In V2, there are some changes,

 - A new proc gdb_produce_source to produce source files.  I tried to
   move all source file generation code out of solib.exp, but
   compilation step still needs to know the generated file names.  I
   have to hard-code the file names in compilation step, which is not
   good to me, so I give up on this moving.
 - SOLIB_NUMBER -> SOLIB_COUNT
 - New variable SOLIB_DLCLOSE_REVERSED_ORDER to control the order of
   iterating a list of shared libs to dlclose them.
 - New variable GDB_PERFORMANCE to enable these perf test cases.
 - Remove dlsym call in solib.c.
 - Update solib.py for the updated framework.

gdb/testsuite/

	* lib/gdb.exp (gdb_produce_source): New procedure.
	* gdb.perf/solib.c: New.
	* gdb.perf/solib.exp: New.
	* gdb.perf/solib.py: New.
2013-11-06  Muhammad Bilal  <mbilal@codesourcery.com>

       PR cli/16122
       * top.c (command_line_input): Unify interactivity tests to use
       input_from_terminal_p.
       * event-top.c (command_line_handler): Likewise.
[DOC] shell startup files, clarifications and fixes.

When Bash is started non-interactively, it runs the script pointed by
the BASH_ENV environment variable, not .bashrc.  While at it, mention
Z shell in the warning too, and mention non-interactive mode
explicitly.

gdb/doc/
2013-11-06  Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (Starting) <set/show startup-with-shell>: Mention
	non-interactive mode.
	(Environment) <shell startup files warning>: Mention
	non-interactive mode.  Mention .zshenv for Z shell, and talk about
	BASH_ENV instead of .bashrc for BASH.
2013-11-06  Muhammad Bilal  <mbilal@codesourcery.com>

	PR cli/15224
	* top.c (init_main): 'set history save on' by default.
Revert "2013-11-06  Muhammad Bilal  <mbilal@codesourcery.com>"

This reverts commit dd99d3d15a7d8f41e139dea7871c4fe44cd4b616.
gdb/dwarf2read.c: Sanity check DW_AT_sibling values.

When reading objects with corrupt debug information it is possible that
the sibling chain can form a loop, which leads to an infinite loop and
memory exhaustion.

Avoid this situation by disregarding and DW_AT_sibling values that point
to a lower address than the current entry.

gdb/ChangeLog:

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

	PR gdb/12866
	* dwarf2read.c (skip_one_die): Sanity check DW_AT_sibling
	values.  (read_partial_die): Likewise.
Fix assert failure with --emit-relocs and .eh_frame sections.

gold/
	PR gold/15758
	* object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
	before reloc sections.
S390: Fix TDB regset recognition

When checking for the presence of the TDB regset, the current code
interprets ENODATA from PTRACE_GETREGSET as an indication that the TDB
regset *could* occur on this system, but the inferior stopped outside
a transaction.  However, the Linux kernel actually reports ENODATA
even on systems without the transactional execution facility.  Thus
the logic is now changed to check the TE field in the HWCAP as well.

This version also checks the existence of the TDB regset -- just to be
on the safe side when running on TE-enabled hardware with a kernel
that does not offer the TDB regset for some reason.

gdb/
	* s390-linux-nat.c (s390_read_description): Consider the TE field
	in the HWCAP for determining 'have_regset_tdb'.

gdbserver/
	* linux-s390-low.c (HWCAP_S390_TE): New define.
	(s390_arch_setup): Consider the TE field in the HWCAP for
	determining 'have_regset_tdb'.
daily update