public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  jankratochvil/gdbserverbuildid-locate: sticky
Date: Wed, 05 Aug 2015 20:59:00 -0000	[thread overview]
Message-ID: <20150805205922.13388.qmail@sourceware.org> (raw)

The branch, jankratochvil/gdbserverbuildid-locate has been updated
  discards  c4548a84652950f57463d70603dde29f066bdb0b (commit)
  discards  cce9f46b5c424e1ac224b6f081308b065cb8b61e (commit)
  discards  a66162093d3d97b2deef4e844baf5268e6f80651 (commit)
  discards  0f8e3a26b93c75ed92e165651a176260086d9a1e (commit)
  discards  51f724cbca43668c451c2a9f22057a783515d67e (commit)
  discards  f674b145edf0fe8ea6eac606cc3098317e5291c0 (commit)
  discards  e8d83eaa0768cf05ec40d4fd32c44f5b414987d9 (commit)
  discards  b41d3e6c42587da057ac45f12619c5aec027dfd2 (commit)
  discards  a1030db283121514b653580dbc28b675aa392b84 (commit)
  discards  96894af66352751e2650141735170719faf38252 (commit)
  discards  ded23229bf6337eb9f06bff14e9548149a4494b5 (commit)
  discards  512599fc5f3cab287166d3499c26c5b8dca784dc (commit)
  discards  dfd6a88cfa6295b698c69638ee0e9474efe27089 (commit)
  discards  98e5ee5efc518de4732105a5933405fc23f1373b (commit)
  discards  91c65e38f4f062a62f03b24a0baa83bd2be50e2e (commit)
  discards  b21e77c8e9b0a072da23b73c0594ff660084da5e (commit)
  discards  ab326528f9b1a06436b436f8873ec918d3cf5792 (commit)
  discards  3631dfc83cbb62db32f9ffe607aabd34f5a35d39 (commit)
  discards  d8f77df297b7bd174d96feccd2ad1f43164c3dfc (commit)
  discards  4e8b7950c90b91692d3b3660c4d47464d5081013 (commit)
  discards  77349f9a27c0b1ad34a16b8245dd8f89663a6b99 (commit)
  discards  d0ec4ffa44abbfb3ae91d073d9e173d08add716a (commit)
  discards  53ecd8abae0b52b4972c15d71174e0ba0f141976 (commit)
  discards  90f484011751e127565e5600bfde5308773edb93 (commit)
  discards  0ad719190dd1375219d3bcdc3718daf109dff476 (commit)
       via  d11dfeff36085e72697b0935fa9ea7b478502be3 (commit)
       via  5bb913190de7ef138463e6dac4fd4161e00a352b (commit)
       via  652d48b40862076ce2bf51dfa3cf721e51be78d6 (commit)
       via  5ff39b6e672dd158110b59091137c51558e8a17a (commit)
       via  c9a2870e237c57bd791a761f35a3657c405388c0 (commit)
       via  aba047ecde86b2aca84b6ea403645dbc6dfda4f9 (commit)
       via  7b78ff694e36c0391a51d08764c9070eb864fcab (commit)
       via  1fb2a28254f3fa02b876e7c9eac8ed50fad20b3c (commit)
       via  29ae97c2a99b590f7a1e5fce610bb07562fb77b4 (commit)
       via  2858b417b03809d653a1b432adfc1e05ba8e2eca (commit)
       via  a3110c7b4bb8e1d8705e72c5d7aa31e2e889f34d (commit)
       via  111af182305566a065841f51a42e48d34e4159fa (commit)
       via  c291ee26e669f02ae872956ad5f39263d7351a7d (commit)
       via  108dd1aa6d678f8b2f3938eb9854502c2ceb4c1f (commit)
       via  5f7f919b9f15e4158eaa9ba8d1865182a29ff5fb (commit)
       via  028d23ba5152daa5c59a7f85bd3a08c2ba93ae68 (commit)
       via  fd1312a6b9f9a54c69ca6852a5e305213dfe7fd5 (commit)
       via  a61ca3ebe307358102d7a172ef8ec39cd02e9db7 (commit)
       via  38e9eefa67fd1b6dbc477227bb2aca8f8ed81ccc (commit)
       via  d4ce568a895cd2567bf06f4be2e51e9417401fc4 (commit)
       via  c37f1754c8e7fc3993edf9be4f959823508fd4b2 (commit)
       via  903dc1fe73d28ed8cfb49e2639438529084568cd (commit)
       via  04f4385dea44eb3b377181c2aef85c420ce7bfbd (commit)
       via  fa4273cdac197b1ee9bd9ced0302ad6cb81baad9 (commit)
       via  e9ca80639af74cbc23b266e1bf7a4abd2fb63e7a (commit)
       via  d02982822a709b5ccfcddeeaf6a2648bcecff266 (commit)
       via  99416e9384ecd012925eaaaa1ded88df88d37546 (commit)
       via  0a39bb3218ec528236da4953a97d07f0da9313ce (commit)
       via  63b9bbb7d7bcdcb6e0f59dd8da9615d80c537b8d (commit)
       via  260439cb8ec21ffd75b240aadc55fd341c8c8dd4 (commit)
       via  32f25203b47b1823bf77724e3eb7bbd15ca3e429 (commit)
       via  d89fa914ad6f10cf2827df9b3b86da1a7d9ddfd8 (commit)
       via  ea546fbb602046f4681319971bc7d5044d04f116 (commit)
       via  4efd80aa8a99adbb38d0719ba56b07c9970793b5 (commit)
       via  7e27a9d5f22f9f7ead11738b1546d0b5c737266b (commit)
       via  4e13f8fb05eb7ffd163d96e519cc011d8d21e3d7 (commit)
       via  524b57e6b3a36e0ce6573bbc4dba9f0bd9c165b1 (commit)
       via  6085d6f69562472c389679052dcfe66cf3068a76 (commit)
       via  8a7e4587c4e7d78ebbb9bcc0e65bc03f784fde6b (commit)
       via  3b53ae99fbb6bea515284f725b83125d09cfea6f (commit)
       via  bd9e6534b7be7a228ce339bced963d2d15856390 (commit)
       via  ded48a5ef34314f7af698b7ec7916b084c94b18d (commit)
       via  c6343a91d94e9516afe56dfe85e435922bd9ea04 (commit)
       via  978b9495b78054b76052a09064cae8c94a58b93e (commit)
       via  9c98104c4c8f558176311dad055897c45b7d8032 (commit)
       via  bb57e4c7bd1d27c45195efd0b7a612bac831d2df (commit)
       via  0a61824343c98b9440fe13752f800d65f765c4c1 (commit)
       via  96e9210fd6fecc1926559dbfa45e7c7c59f7d821 (commit)
       via  beab5d94abdbea50febb1e189198fdec43db47c9 (commit)
       via  edc66de9a5883295bb32fad2c87bf4c62f97f54a (commit)
       via  a26b73ed2d90d6ef080810fa9dd166b43e8a3eb7 (commit)
       via  127fcdff0541697ffd7169abafe5a51118bf65d0 (commit)
       via  4122b41366b2e810bbf016d7c5514a496f0aca86 (commit)
       via  af60a1ef46d2c4aca22868b0f2819234b949018e (commit)
       via  cb1c8103f13d413e05ca6e61e21b56bba3baae74 (commit)
       via  ee2d2b102071f89a04f93f0434df818f69ef1e50 (commit)
       via  666fcf91c0117da8294207f631df5a97fdc4157c (commit)
       via  c8bd4544607d4f41b89b78630fc233f53f90b6a2 (commit)
       via  8e1afc817ca50aec1e77b5bd2613844bb4b4d932 (commit)
       via  4e1bdb00c63a839037f31f005349c87702d50cfe (commit)
      from  c4548a84652950f57463d70603dde29f066bdb0b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit d11dfeff36085e72697b0935fa9ea7b478502be3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:41:00 2015 +0200

    sticky
    
    Message-Id: <1433754079-10395-1-git-send-email-gbenson@redhat.com>
    
    Philippe Waroquiers wrote:
    > On Fri, 2015-06-05 at 12:22 +0100, Gary Benson wrote:
    > > Built and regtested on RHEL6.6 x86_64.
    > I tested with the last SVN version of the Valgrind gdbserver (that
    > supports qXfer:exec-file:read+).
    >
    > The patch introduces a regression:
    > with the patch, GDB does not anymore automatically load the
    > exec-file.
    >
    > I bypassed this problem by ignoring fake_pid_p in remote.c:
    > --- a/gdb/remote.c
    > +++ b/gdb/remote.c
    > @@ -1624,9 +1624,13 @@ remote_add_inferior (int fake_pid_p, int pid, int
    > attached,
    >    inf->attach_flag = attached;
    >    inf->fake_pid_p = fake_pid_p;
    >
    > -  /* If no main executable is currently open then attempt to
    > -     open the file that was executed to create this inferior.  */
    > -  if (try_open_exec && get_exec_file (0) == NULL)
    > +  /* Attempt to open the file that was executed to create this
    > +     inferior.  If the user has explicitly specified executable
    > +     and/or symbol files then warn the user if their choices do
    > +     not match.  Otherwise, set exec_file and symfile_objfile to
    > +     the new file.  */
    > +  printf("fake_pid_p %d\n", fake_pid_p);
    > +  if (try_open_exec)// && !fake_pid_p)
    >      exec_file_locate_attach (pid, 1);
    >
    > Effectively, the printf shows that with Valgrind gdbsrv,
    > fake_pid_p value is 1.
    >
    > When ignoring fake_pid_p, GDB can properly attach
    > to different Valgrind gdbsrv, and changes of executable
    > as expected.
    
    Ah, it seems I mailed a bad patch, my apologies!  I was working on
    two fixes that touched the same line, and it looks like I rebased
    them in the wrong order.
    
    This updated patch has been created against the latest gdb/master
    (80fb91378c91a8239817a5ab2b1c3e346109db25).  Could you please try
    your tests again?
    
    Thanks,
    Gary
    
    
    ---
    On attach, GDB will only attempt to determine the main executable's
    filename if one is not already set.  This causes problems if you
    attach to one process and then attach to another: GDB will not attempt
    to discover the main executable on the second attach.  If the two
    processes have different main executable files then the symbols will
    now be wrong.  This is PR gdb/17626.
    
    In GDB some filenames are supplied by the user (e.g. using the "file"
    or "symbol-file" commands) and some are determined by GDB (e.g. while
    processing an "attach" command).  This commit updates GDB to track
    which filenames were supplied by the user.  When GDB might attempt to
    determine an executable filename and one is already set, filenames
    determined by GDB may be overridden but user-supplied filenames will
    not.
    
    gdb/ChangeLog:
    
    	PR gdb/17626
    	* progspace.h (struct program_space)
    	<pspace_exec_file_is_user_supplied>: New field.
    	<symfile_object_file_is_user_supplied>: Likewise.
    	(symfile_objfile_is_user_supplied): New macro.
    	* exec.h (exec_file_is_user_supplied): Likewise.
    	* exec.c (exec_close): Clear exec_file_is_user_supplied.
    	(exec_file_locate_attach): Remove get_exec_file check.
    	Do not replace user-supplied executable or symbol files.
    	Warn if user-supplied executable or symbol files do not
    	match discovered file.
    	(exec_file_command): Set exec_file_is_user_supplied.
    	* symfile.c (symbol_file_clear): Clear
    	symfile_objfile_is_user_supplied.
    	(symbol_file_command): Set symfile_objfile_is_user_supplied.
    	* inferior.c (add_inferior_command): Set
    	exec_file_is_user_supplied and symfile_objfile_is_user_supplied.
    	* main.c (captured_main): Likewise.
    	* infcmd.c (attach_command_post_wait): Always call
    	exec_file_locate_attach.  Only call reopen_exec_file and
    	reread_symbols if exec_file_is_user_supplied.
    	* remote.c (remote_add_inferior): Remove get_exec_file check
    	around exec_file_locate_attach.

commit 5bb913190de7ef138463e6dac4fd4161e00a352b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:34 2015 +0200

    mainbuildid

commit 652d48b40862076ce2bf51dfa3cf721e51be78d6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:33 2015 +0200

    hexallocate

commit 5ff39b6e672dd158110b59091137c51558e8a17a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:33 2015 +0200

    locatetest

commit c9a2870e237c57bd791a761f35a3657c405388c0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:33 2015 +0200

    buildidwarn

commit aba047ecde86b2aca84b6ea403645dbc6dfda4f9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:33 2015 +0200

    buildidsolibbfdopen

commit 7b78ff694e36c0391a51d08764c9070eb864fcab
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:32 2015 +0200

    buildidverify

commit 1fb2a28254f3fa02b876e7c9eac8ed50fad20b3c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:32 2015 +0200

    buildidsolibsearch

commit 29ae97c2a99b590f7a1e5fce610bb07562fb77b4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:32 2015 +0200

    buildidtofile

commit 2858b417b03809d653a1b432adfc1e05ba8e2eca
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:32 2015 +0200

    buildidproto

commit a3110c7b4bb8e1d8705e72c5d7aa31e2e889f34d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:31 2015 +0200

    buildidtobfd

commit 111af182305566a065841f51a42e48d34e4159fa
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:31 2015 +0200

    buildidforcemove

commit c291ee26e669f02ae872956ad5f39263d7351a7d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:31 2015 +0200

    buildidfreefix

commit 108dd1aa6d678f8b2f3938eb9854502c2ceb4c1f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:30 2015 +0200

    unvalidate

commit 5f7f919b9f15e4158eaa9ba8d1865182a29ff5fb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:30 2015 +0200

    openpsymfile

commit 028d23ba5152daa5c59a7f85bd3a08c2ba93ae68
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:30 2015 +0200

    openpsolib

commit fd1312a6b9f9a54c69ca6852a5e305213dfe7fd5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:30 2015 +0200

    openp

commit a61ca3ebe307358102d7a172ef8ec39cd02e9db7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:29 2015 +0200

    filelib

commit 38e9eefa67fd1b6dbc477227bb2aca8f8ed81ccc
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:29 2015 +0200

    targetfd

commit d4ce568a895cd2567bf06f4be2e51e9417401fc4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:29 2015 +0200

    openpnullpathname

commit c37f1754c8e7fc3993edf9be4f959823508fd4b2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:28 2015 +0200

    openpmode

commit 903dc1fe73d28ed8cfb49e2639438529084568cd
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:28 2015 +0200

    openppath

commit 04f4385dea44eb3b377181c2aef85c420ce7bfbd
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:28 2015 +0200

    openpenum

commit fa4273cdac197b1ee9bd9ced0302ad6cb81baad9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 21:28:28 2015 +0200

    sysrootdelim

commit e9ca80639af74cbc23b266e1bf7a4abd2fb63e7a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Aug 5 22:55:04 2015 +0200

    sysrootconst

commit d02982822a709b5ccfcddeeaf6a2648bcecff266
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Jul 17 22:31:05 2015 +0200

    build-id: -config,+configure.tgt

commit 99416e9384ecd012925eaaaa1ded88df88d37546
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Jul 17 22:30:32 2015 +0200

    Revert "Revert the previous 7 commits of: Validate binary before use"
    
    This reverts commit db1ff28b60f8886b8d7c634f1db2f939ba47a13c.
    
    Conflicts:
    	gdb/ChangeLog
    	gdb/gdbserver/ChangeLog
    	gdb/testsuite/ChangeLog

commit 0a39bb3218ec528236da4953a97d07f0da9313ce
Author: Pedro Alves <palves@redhat.com>
Date:   Wed Aug 5 20:01:42 2015 +0100

    stepping is disturbed by setjmp/longjmp | try/catch in other threads
    
    At https://sourceware.org/ml/gdb-patches/2015-08/msg00097.html, Joel
    observed that trying to next/step a program on GNU/Linux sometimes
    results in the following failed assertion:
    
    	% gdb -q .obj/gprof/main
        (gdb) start
        (gdb) n
        (gdb) step
        [...]/infrun.c:2391: internal-error:
        resume: Assertion `sig != GDB_SIGNAL_0' failed.
    
    What happened is that, during the "next" operation, GDB hit a
    longjmp/exception/step-resume breakpoint but failed to see that this
    breakpoint was set for a different thread than the one being stepped.
    
    Joel's detailed analysis follows:
    
    More precisely, at the end of the "start" command, we are stopped at
    the start of function Main in main.adb; there are 4 threads in total,
    and we are in the main thread (which is thread 1):
    
        (gdb) info thread
          Id   Target Id         Frame
          4    Thread 0xb7a56ba0 (LWP 28379) 0xffffe410 in __kernel_vsyscall ()
          3    Thread 0xb7c5aba0 (LWP 28378) 0xffffe410 in __kernel_vsyscall ()
          2    Thread 0xb7e5eba0 (LWP 28377) 0xffffe410 in __kernel_vsyscall ()
        * 1    Thread 0xb7ea18c0 (LWP 28370) main () at /[...]/main.adb:57
    
    All the logs below reference Thread ID/LWP, but it'll be easier to
    talk about the threads by GDB thread number.  For instance, thread 1
    is LWP 28370 while thread 3 is LWP 28378.  So, the explanations below
    translate the LWPs into thread numbers.
    
    Back to what happens while we are trying to "next' our program:
        (gdb) n
        infrun: clear_proceed_status_thread (Thread 0xb7a56ba0 (LWP 28379))
        infrun: clear_proceed_status_thread (Thread 0xb7c5aba0 (LWP 28378))
        infrun: clear_proceed_status_thread (Thread 0xb7e5eba0 (LWP 28377))
        infrun: clear_proceed_status_thread (Thread 0xb7ea18c0 (LWP 28370))
        infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT)
        infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x805451e
        infrun: target_wait (-1.0.0, status) =
        infrun:   28370.28370.0 [Thread 0xb7ea18c0 (LWP 28370)],
        infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
        infrun: TARGET_WAITKIND_STOPPED
        infrun: stop_pc = 0x8054523
    
    We've resumed thread 1 (LWP 28370), and received in return a signal
    that the same thread stopped slightly further.  It's still in the
    range of instructions for the line of source we started the "next"
    from, as evidenced by the following trace...
    
        infrun: stepping inside range [0x805451e-0x8054531]
    
    ... and thus, we decide to continue stepping the same thread:
    
        infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523
        infrun: prepare_to_wait
    
    That's when we get an event from a different thread (thread 3)...
    
        infrun: target_wait (-1.0.0, status) =
        infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
        infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
        infrun: TARGET_WAITKIND_STOPPED
        infrun: stop_pc = 0x80782d0
        infrun: context switch
        infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)
    
    ... which we find to be at the address where we set a breakpoint on
    "the unwinder debug hook" (namely "_Unwind_DebugHook").  But GDB fails
    to notice that the breakpoint was inserted for thread 1 only, and so
    decides to handle it as...
    
        infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME
    
    ... and inserts a breakpoint at the corresponding resume address, as
    evidenced by this the next log:
    
        infrun: exception resume at 80542a2
    
    That breakpoint seems innocent right now, but will play a role fairly
    quickly.  But for now, GDB has inserted the exception-resume
    breakpoint, and needs to single-step thread 3 past the breakpoint it
    just hit.  Thus, it temporarily disables the exception breakpoint, and
    requests a step of that thread:
    
        infrun: skipping breakpoint: stepping past insn at: 0x80782d0
        infrun: skipping breakpoint: stepping past insn at: 0x80782d0
        infrun: skipping breakpoint: stepping past insn at: 0x80782d0
        infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 0xb7c5aba0 (LWP 28378)] at 0x80782d0
        infrun: prepare_to_wait
    
    We then get a notification, still from thread 3, that it's now past
    that breakpoint...
    
        infrun: prepare_to_wait
        infrun: target_wait (-1.0.0, status) =
        infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
        infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
        infrun: TARGET_WAITKIND_STOPPED
        infrun: stop_pc = 0x8078424
    
    ... so we can resume what we were doing before, which is single-stepping
    thread 1 until we get to a new line of code:
    
        infrun: switching back to stepped thread
        infrun: Switching context from Thread 0xb7c5aba0 (LWP 28378) to Thread 0xb7ea18c0 (LWP 28370)
        infrun: expected thread still hasn't advanced
        infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523
    
    The "resume" log above shows that we're resuming thread 1 from where
    we left off (0x8054523).  We get one more stop at 0x8054529, which is
    still inside our stepping range so we go again.  That's when we get
    the following event, from thread 3:
    
        infrun: prepare_to_wait
        infrun: target_wait (-1.0.0, status) =
        infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
        infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
        infrun: TARGET_WAITKIND_STOPPED
        infrun: stop_pc = 0x80542a2
    
    Now the stop_pc address is interesting, because it's the address of
    "exception resume" breakpoint...
    
        infrun: context switch
        infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)
        infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
    
    ... and since that location is at a different line of code, this is
    where it decides the "next" operation should stop:
    
        infrun: stop_waiting
        [Switching to Thread 0xb7c5aba0 (LWP 28378)]
        0x080542a2 in inte_tache_rt.ttache_rt (
            <_task>=0x80968ec <inte_tache_rt_inst.tache2>)
            at /[...]/inte_tache_rt.adb:54
        54            end loop;
    
    However, what GDB should have noticed earlier that the exception
    breakpoint we hit was for a different thread, thus should have
    single-stepped that thread out of the breakpoint _without_ inserting
    the exception-return breakpoint, and then resumed the single-stepping
    of the initial thread (thread 1) until that thread stepped out of its
    stepping range.
    
    This is what this patch does, and after applying it, GDB now correctly
    stops on the next line of code.
    
    The patch adds a C++ test that exercises this, both for setjmp/longjmp
    and exception breakpoints.  With an unpatched GDB it shows:
    
     (gdb) next
     [Switching to Thread 22445.22455]
     thread_try_catch (arg=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/next-other-thr-longjmp.c:59
     59            catch (...)
     (gdb) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 1
     next
     /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:4865: internal-error: process_event_stop_test: Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' fa
     iled.
     A problem internal to GDB has been detected,
     further debugging may prove unreliable.
     Quit this debugging session? (y or n) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 2 (GDB internal error)
     Resyncing due to internal error.
     n
    
    Tested on x86_64-linux, no regressions.
    
    gdb/ChangeLog:
    2015-08-05  Pedro Alves  <palves@redhat.com>
    	    Joel Brobecker  <brobecker@adacore.com>
    
            * breakpoint.c (bpstat_what) <bp_longjmp, bp_longjmp_call_dummy>
    	<bp_exception, bp_longjmp_resume, bp_exception_resume>: Handle the
    	case where BS->STOP is not set.
    
    gdb/testsuite/ChangeLog:
    2015-08-05  Pedro Alves  <palves@redhat.com>
    
    	* gdb.threads/next-while-other-thread-longjmps.c: New file.
    	* gdb.threads/next-while-other-thread-longjmps.exp: New file.

commit 63b9bbb7d7bcdcb6e0f59dd8da9615d80c537b8d
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Aug 5 16:16:39 2015 +0100

    Change the behaviour of the --only-keep-debug option to objcopy and strip so that the sh_link and sh_info fields in stripped section headers are preserved.
    
    bfd	* elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
    	sh_info fields of sections whose type has been changed to
    	SHT_NOBITS.
    
    bin	* doc/binutils.texi: Document that the --only-keep-debug option
    	to strip and objcopy preserves the section headers of stripped
    	sections.
    
    tests	* binutils-all/objcopy.exp (keep_debug_symbols_and_check_links):
    	New proc.  Checks that debug-info-only binaries retain the
    	sh_link field in stripped sections.

commit 260439cb8ec21ffd75b240aadc55fd341c8c8dd4
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date:   Wed Aug 5 16:30:57 2015 +0200

    Protect nat/gdb_thread_db.h against multiple inclusion.
    
    Fixes a build error due to typedef redefinition with some compilers.
    
    Also added missing copyright header.
    
    gdb/
    	* nat/gdb_thread_db.h: Add copyright header.
    	Protect against multiple inclusion.

commit 32f25203b47b1823bf77724e3eb7bbd15ca3e429
Author: Nick Clifton <nickc@redhat.com>
Date:   Wed Aug 5 14:58:21 2015 +0100

    Fix building GDB for the M32C by providing a stub sim_info function.
    
    	* gdb-if.c (sim_info): Stub function to allow GDB to be built
    	with this simulator.

commit d89fa914ad6f10cf2827df9b3b86da1a7d9ddfd8
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Aug 5 08:41:19 2015 +0100

    Remove get_thread_id
    
    This patch removes get_thread_id from aarch64-linux-nat.c,
    arm-linux-nat.c and xtensa-linux-nat.c.
    
    get_thread_id was added in this commit below in 2000,
    
      41c49b06c471443d3baf2eaa2463a315f9b5edca
      https://sourceware.org/ml/gdb-patches/2000-04/msg00398.html
    
    which predates the ptid_t stuff added into GDB.  Nowadays, lwpid of
    inferior_ptid is only zero when the inferior is created (in
    fork-child.c:fork_inferior) and its lwpid will be set after
    linux_nat_wait_1 gets the first event.  After that, lwpid of
    inferior_ptid is not zero for linux-nat target, then we can use
    ptid_get_lwp, so this function isn't needed anymore.
    
    Even when GDB attaches to a process, the lwp of inferior_ptid
    isn't zero,  see linux-nat.c:linux_nat_attach,
    
      /* The ptrace base target adds the main thread with (pid,0,0)
         format.  Decorate it with lwp info.  */
      ptid = ptid_build (ptid_get_pid (inferior_ptid),
    		     ptid_get_pid (inferior_ptid),
    		     0);
    
    Note that linux_nat_xfer_partial shifts lwpid to pid for inferior_ptid
    temperately for calling linux_ops->to_xfer_partial, but all the
    affected functions in this patch are not called in
    linux_ops->to_xfer_partial.
    
    I think we can safely remove get_thread_id for all linux native targets.
    
    Regression tested on arm-linux and aarch64-linux.  Unable to build
    native GDB and test it on xtensa-linux.
    
    gdb:
    
    2015-08-05  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (get_thread_id): Remove.
    	(debug_reg_change_callback): Call ptid_get_lwp instead of
    	get_thread_id.
    	(fetch_gregs_from_thread): Likewise.
    	(store_gregs_to_thread): Likewise.
    	(fetch_fpregs_from_thread): Likewise.
    	(store_fpregs_to_thread): Likewise.
    	(aarch64_linux_get_debug_reg_capacity): Likewise.
    	* arm-linux-nat.c (get_thread_id): Remove.
    	(GET_THREAD_ID): Update macro to use ptid_get_lwp.
    	* xtensa-linux-nat.c (get_thread_id): Remove.
    	(GET_THREAD_ID): Update macro to use ptid_get_lwp.
    	* arm-linux-nat.c (get_thread_id): Remove.
    	(GET_THREAD_ID): Remove.
    	(fetch_fpregs): Call ptid_get_lwp instead of GET_THREAD_ID.
    	(store_fpregs, fetch_regs, store_regs): Likewise.
    	(fetch_wmmx_regs, store_wmmx_regs): Likewise.
    	(fetch_vfp_regs, store_vfp_regs): Likewise.
    	(arm_linux_read_description): Likewise.
    	(arm_linux_get_hwbp_cap): Likewise.
    	* xtensa-linux-nat.c (get_thread_id): Remove.
    	(GET_THREAD_ID): Remove.
    	(fetch_gregs, store_gregs): Call ptid_get_lwp instead of
    	GET_THREAD_ID.

commit ea546fbb602046f4681319971bc7d5044d04f116
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Wed Aug 5 00:00:08 2015 +0000

    Automatic date update in version.in

commit 4efd80aa8a99adbb38d0719ba56b07c9970793b5
Author: Ciro Santilli <ciro.santilli@gmail.com>
Date:   Tue Aug 4 09:03:15 2015 -0700

    python: fix Linetable case to LineTable in docstrings and comments
    
    The class is called LineTable, not Linetable, as specified by
    py-linetable.c/gdbpy_initialize_linetable:
    
        if (gdb_pymodule_addobject (gdb_module, "LineTable",
    
    gdb/ChangeLog:
    
            * python/py-linetable.c: Fix case of Linetable to LineTable
            in docstrings and code comments.
            * python/py-symtab.c: Same.

commit 7e27a9d5f22f9f7ead11738b1546d0b5c737266b
Author: Yuriy M. Kaminskiy <yumkam@gmail.com>
Date:   Tue Aug 4 16:51:53 2015 +0100

    Fix stack buffer overflows when parsing corrupt ihex files.
    
    	PR binutils/18750
    	* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
    	and stack overflow when char is signed and \200-\376 was in place of hex
    	digit; also fixes \377 was handled as EOF instead of "incorrect character".
    	(ihex_read_section): Changed for consistency.
    	(ihex_bad_byte): Prevent (now impossible to trigger) stack
    	overflow and incorrect escape sequence handling.
    	* srec.c (srec_bad_byte): Likewise.
    
    	* readelf.c (process_mips_specific): Fix incorrect escape
    	sequence handling.

commit 4e13f8fb05eb7ffd163d96e519cc011d8d21e3d7
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Aug 4 14:50:40 2015 +0100

    Fix memory leak in ar if it encounters an invalid path whilst extracting files.
    
    	* ar.c (extract_file): Free cbuf if the path is invalid.

commit 524b57e6b3a36e0ce6573bbc4dba9f0bd9c165b1
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    Disable tracepoint support for aarch32
    
    We only support tracepoint for aarch64.  Although arm program can run
    on aarch64, GDBserver doesn't support tracepoint for it.
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
    	if current_thread is 32 bit.

commit 6085d6f69562472c389679052dcfe66cf3068a76
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    Disable Z0 packet on aarch64 on multi-arch debugging
    
    In multi-arch debugging, if GDB sends Z0 packet, GDBserver should be
    able to do several things below:
    
     - choose the right breakpoint instruction to insert according to the
       information available, such as 'kind' in Z0 packet and address,
    
     - choose the right breakpoint instruction to check memory writes and
       validate inserted memory breakpoint
    
     - be aware of different breakpoint instructions in $ARCH_breakpoint_at.
    
    unfortunately GDBserver can't do them now.  Although x86 GDBserver
    supports multi-arch, it doesn't need to support them above because
    breakpoint instruction on i686 and x86_64 is the same.  However,
    breakpoint instructions on aarch64 and arm (arm mode, thumb1, and thumb2)
    are different.
    
    I tried to teach aarch64 GDBserver backend to be really
    multi-arch-capable in the following ways,
    
     - linux_low_target return the right breakpoint instruction according to
       the 'kind' in Z0 packet, and insert_memory_breakpoint can do the right
       thing.
     - once breakpoint is inserted, the breakpoint data and length is recorded
       in each breakpoint object, so that validate_breakpoint and
       check_mem_write can get the right breakpoint instruction from each
       breakpoint object, rather than from global variable breakpoint_data.
     - linux_low_target needs another hook function for pc increment after
       hitting a breakpoint.
     - let set_breakpoint_at, which is widely used for tracepoint, use the
       'default' breakpoint instruction.  We can always use aarch64 breakpoint
       instruction since arm doesn't support tracepoint yet.
    
    looks it is not a small piece of work, so I decide to disable Z0 packet
    on multi-arch, which means aarch64 GDBserver only supports Z0 packet
    if it is started to debug only one process (extended protocol is not
    used) and process target description is 64-bit.
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_supports_z_point_type): Return
    	0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
    	* server.c (extended_protocol): Remove "static".
    	* server.h (extended_protocol): Declare it.

commit 8a7e4587c4e7d78ebbb9bcc0e65bc03f784fde6b
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    Get and set PC correctly on aarch64 in multi-arch
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_get_pc): Get PC register on
    	both aarch64 and aarch32.
    	(aarch64_set_pc): Likewise.

commit 3b53ae99fbb6bea515284f725b83125d09cfea6f
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    Use arm target description and regs_info for 32-bit file on aarch64 GDBserver
    
    This patch teaches aarch64-linux GDBserver use 32-bit arm target
    description and regs_info if the elf file is 32-bit.
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
    	to srv_regobj and append arm-core.xml arm-vfpv3.xml and
    	arm-with-neon.xml to srv_xmlfiles.
    	* linux-aarch64-low.c: Include linux-aarch32-low.h.
    	(is_64bit_tdesc): New function.
    	(aarch64_linux_read_description): New function.
    	(aarch64_arch_setup): Call aarch64_linux_read_description.
    	(regs_info): Rename to regs_info_aarch64.
    	(aarch64_regs_info): Return right regs_info.
    	(initialize_low_arch): Call initialize_low_arch_aarch32.

commit bd9e6534b7be7a228ce339bced963d2d15856390
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    New regs_info for aarch32
    
    This patch adds a new regs_info regs_info_aarch32 for aarch32, which
    can be used by both aarch64 and arm backend.
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
    	* linux-aarch32-low.c: New file.
    	* linux-aarch32-low.h: New file.
    	* linux-arm-low.c (arm_fill_gregset): Move it to
    	linux-aarch32-low.c.
    	(arm_store_gregset): Likewise.
    	(arm_fill_vfpregset): Call arm_fill_vfpregset_num
    	(arm_store_vfpregset): Caa arm_store_vfpregset_num.
    	(arm_arch_setup): Check if PTRACE_GETREGSET works.
    	(regs_info): Rename to regs_info_arm.
    	(arm_regs_info): Return regs_info_aarch32 if
    	have_ptrace_getregset is 1 and target description is
    	arm_with_neon or arm_with_vfpv3.
    	(initialize_low_arch): Don't call init_registers_arm_with_neon.
    	Call initialize_low_arch_aarch32 instead.

commit ded48a5ef34314f7af698b7ec7916b084c94b18d
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 4 14:34:14 2015 +0100

    Move have_ptrace_getregset to linux-low.c
    
    This patch moves variable have_ptrace_getregset from linux-x86-low.c
    to linux-low.c, so that arm can use it too.
    
    gdb/gdbserver:
    
    2015-08-04  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-x86-low.c (have_ptrace_getregset): Move it to ...
    	* linux-low.c: ... here.
    	* linux-low.h (have_ptrace_getregset): Declare it.

commit c6343a91d94e9516afe56dfe85e435922bd9ea04
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Aug 4 13:42:56 2015 +0200

    signal_command: Leftover cleanup chain regression
    
    gdb/ChangeLog
    2015-08-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* infcmd.c (signal_command): Call do_cleanups for args_chain.

commit 978b9495b78054b76052a09064cae8c94a58b93e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Aug 4 13:40:44 2015 +0200

    ASAN attach crash - 7.9 regression
    
    -fsanitize=address
    gdb.base/attach-pie-noexec.exp
    
    ==32586==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200004ed90 at pc 0x48ad50 bp 0x7ffceb3aef50 sp 0x7ffceb3aef20
    READ of size 2 at 0x60200004ed90 thread T0
        #0 0x48ad4f in __interceptor_strlen (/home/jkratoch/redhat/gdb-test-asan/gdb/gdb+0x48ad4f)
        #1 0xeafe5c in xstrdup xstrdup.c:33
        #2 0x85e024 in attach_command /home/jkratoch/redhat/gdb-test-asan/gdb/infcmd.c:2680
    
    regressed by:
    
    commit 6c4486e63f7583ed85a0c72841f6ccceebbf858e
    Author: Pedro Alves <palves@redhat.com>
    Date:   Fri Oct 17 13:31:26 2014 +0100
        PR gdb/17471: Repeating a background command makes it foreground
    
    gdb/ChangeLog
    2015-08-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	PR gdb/18767
    	* infcmd.c (attach_command): Move ARGS_CHAIN cleanup after last ARGS
    	use.

commit 9c98104c4c8f558176311dad055897c45b7d8032
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Tue Jul 28 19:14:37 2015 +0100

    ld: map option for run_dump_test requires no program.
    
    When using run_dump_test with the map option to compare the linker map
    file produced, no additional dump program should be required.  A dump
    program can still be given if needed, but leaving it off will no longer
    produce an error.
    
    ld/testsuite/ChangeLog:
    
    	* ld/ld-lib.exp (run_dump_test): When using the map option, no
    	program is required.

commit bb57e4c7bd1d27c45195efd0b7a612bac831d2df
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Tue Jul 28 16:20:41 2015 +0100

    ld: Add file based error/warning regexp for run_dump_test.
    
    The run_dump_test mechanism supports options error and warning, which
    allow regexp to be specified within the test file, these regexp are
    matched against the stderr output from the linker.
    
    Similar dump test style functions for gas and gdb also support file
    based matching versions of these options; the patterns are placed into a
    file which the test driver then references.  It is sometimes clearer,
    when the pattern to be matched spans multiple lines if the patterns can
    be placed into a separate file.
    
    This patch adds new options error_output and warning_output for the
    linker run_dump_test function.  These new options take a filename
    parameter, this file is then used (with regexp_diff) to compare against
    the linker output.
    
    ld/testsuite/ChangeLog:
    
    	* ld/ld-lib.exp (run_dump_test): Add error_output and
    	warning_output options.

commit 0a61824343c98b9440fe13752f800d65f765c4c1
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Wed Jul 15 18:37:30 2015 +0100

    ld: Add '--require-defined' command line option.
    
    Add a new command line option '--require-defined' to the linker.  This
    option operates identically to the '--undefined' option, except that if
    the symbol is not defined in the final output file then the linker will
    exit with an error.
    
    When making use of --gc-section, or just when trying to pull in parts of
    a library, it is not uncommon for a user to use the '--undefined'
    command line option to specify a symbol that the user then expects to be
    defined by one of the object files supplied to the link.
    
    However, if for any reason the symbol is not satisfied by an object
    provided to the link the user will be left with an undefined symbol in
    the output file, instead of a defined symbol.
    
    In some cases the above behaviour is what the user wants, in other cases
    though we can do better.  The '--require-defined' option tries to fill
    this gap.  The symbol passed to the '--require-defined' option is
    treated exactly as if the symbol was passed to '--undefined', however,
    before the linker exits a check is made that all symbols passed to
    '--require-defined' are actually defined, if any are not then the link
    will fail with an error.
    
    ld/ChangeLog:
    
    	* ld.texinfo (Options): Document --require-defined option.
    	* ldlang.c (struct require_defined_symbol): New structure.
    	(require_defined_symbol_list): New variable.
    	(ldlang_add_require_defined): New function.
    	(ldlang_check_require_defined_symbols): New function.
    	(lang_process): Check required symbols are defined.
    	* ldlang.h (ldlang_add_require_defined): Declare.
    	* ldlex.h (enum option_values): Add OPTION_REQUIRE_DEFINED_SYMBOL.
    	* lexsup.c (ld_options): Add '--require-defined' entry.
    	(parse_args): Handle '--require-defined' entry.
    	* NEWS: Mention new '--require-defined' option.
    
    ld/testsuite/ChangeLog:
    
    	* ld-undefined/require-defined-1.d: New file.
    	* ld-undefined/require-defined-2.d: New file.
    	* ld-undefined/require-defined-3.d: New file.
    	* ld-undefined/require-defined-4.d: New file.
    	* ld-undefined/require-defined-5.d: New file.
    	* ld-undefined/require-defined.exp: New file.
    	* ld-undefined/require-defined.s: New file.

commit 96e9210fd6fecc1926559dbfa45e7c7c59f7d821
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Aug 4 09:39:47 2015 +0100

    C++: dlsym casts in gdb/linux-thread-db.c and gdb/gdbserver/thread-db.c
    
    Implicit void * -> function pointer conversion doesn't work in C++, so
    in C++, we need to cast the result of dlsym.  This adds a few typedefs
    and macros that make this easy.  GDBserver's version already had the
    CHK macro, so I added it to GDB too.
    
    Tested on x86_64 Fedora 20, native and gdbserver.
    
    gdb/gdbserver/ChangeLog:
    2015-08-04  Pedro Alves  <palves@redhat.com>
    
    	* thread-db.c (struct thread_db): Use new typedefs.
    	(try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
    	CHK calls.
    	(disable_thread_event_reporting): Cast result of dlsym to
    	destination function pointer type.
    	(thread_db_mourn): Use td_ta_delete_ftype.
    
    gdb/ChangeLog:
    2015-08-04  Pedro Alves  <palves@redhat.com>
    
    	* nat/gdb_thread_db.h (td_init_ftype, td_ta_new_ftype)
    	(td_ta_map_lwp2thr_ftype, td_ta_thr_iter_ftype)
    	(td_ta_event_addr_ftype, td_ta_set_event_ftype)
    	(td_ta_clear_event_ftype, td_ta_event_getmsg_ftype)
    	(td_thr_validate_ftype, td_thr_get_info_ftype)
    	(td_thr_event_enable_ftype, td_thr_tls_get_addr_ftype)
    	(td_thr_tlsbase_ftype, td_symbol_list_ftype, td_ta_delete_ftype):
    	New typedefs.
    	* linux-thread-db.c (struct thread_db_info): Use new typedefs.
    	(try_thread_db_load_1): Define TDB_VERBOSE_DLSYM, TDB_DLSYM , CHK
    	local macros and use them instead of verbose_dlsym and dlsym
    	calls.

commit beab5d94abdbea50febb1e189198fdec43db47c9
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Aug 4 08:19:12 2015 +0100

    Update description of proc run_dump_test
    
    	* lib/utils-lib.exp (run_dump_test): Document DUMPPROG, readelf
    	and size parameters.  Alpha-sort switch tables.  Include
    	addr2line, and size in list of possible auto-detected dump
    	programs.

commit edc66de9a5883295bb32fad2c87bf4c62f97f54a
Author: Thomas Preud'homme <thomas.preudhomme@arm.com>
Date:   Thu Jul 16 17:51:04 2015 +0800

    2015-08-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>
    
            * doc/c-aarch64.texi (.xword): Document directive.

commit a26b73ed2d90d6ef080810fa9dd166b43e8a3eb7
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Tue Aug 4 00:00:08 2015 +0000

    Automatic date update in version.in

commit 127fcdff0541697ffd7169abafe5a51118bf65d0
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Tue Jul 14 16:19:22 2015 +0100

    ld/doc: Document that multiple MEMORY commands are allowed.
    
    The linker documentation explicitly states that there can be only one
    MEMORY command.  This is not true.  Multiple MEMORY commands are
    allowed, the contents of all will be treated as if a single MEMORY
    command was given.
    
    Update the documentation to make this clear to the users.
    
    ld/ChangeLog:
    
    	* ld.texinfo (MEMORY): Explain that multiple MEMORY commands are
    	acceptable.

commit 4122b41366b2e810bbf016d7c5514a496f0aca86
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date:   Mon Aug 3 20:44:05 2015 +0200

    Fix ChangeLog for "FAIL: -Bsymbolic-functions" for cris-linux in ld
    
    It's bfd_link_info, not elf_link_hash_entry, for the old reference:
    
    	* elf32-cris.c (cris_elf_relocate_section)
    	(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
    	(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
    	just bfd_link_info->symbolic, to check if a symbol should be bound
    	symbolically.

commit af60a1ef46d2c4aca22868b0f2819234b949018e
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Mon Aug 3 11:39:52 2015 -0700

    Nios II R2 support for GDB.
    
    2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/
    	* nios2-tdep.h: Include opcode/nios2.h here.
    	(NIOS2_CDX_OPCODE_SIZE): New.
    	(struct gdbarch_tdep): Add OP parameter to syscall_next_pc.
    	* nios2-tdep.c: Don't include opcode/nios2.h here.
    	(nios2_fetch_insn): For R2, try reading 2-byte instruction if
    	4-byte read fails.
    	(nios2_match_add, nios2_match_sub): Add cases for R2 encodings.
    	(nios2_match_addi, nios2_match_orhi): Likewise.
    	(nios2_match_stw, nios2_match_ldw): Likewise.
    	(nios2_match_rdctl): Likewise.
    	(nios2_match_stwm, nios2_match_ldwm): New.
    	(nios2_match_branch): Add cases for R2 encodings.
    	(nios2_match_jmpi, nios2_match_calli): Likewise.
    	(nios2_match_jmpr, nios2_match_callr): Likewise.
    	(nios2_match_break, nios2_match_trap): Likewise.
    	(nios2_in_epilogue_p): Add R2 support.
    	(nios2_analyze_prologue): Update comments.  Recognize R2 CDX
    	prologues.
    	(nios2_breakpoint_from_pc): Handle R2 instructions.
    	(nios2_get_next_pc): Likewise.  Adjust call to
    	tdep->syscall_next_pc.
    	* nios2-linux-tdep.c (nios2_r1_linux_rt_sigreturn_tramp_frame):
    	Renamed from nios2_linux_rt_sigreturn_tramp_frame.  Use
    	instruction field macros instead of literal hex values.
    	(nios2_r2_linux_rt_sigreturn_tramp_frame): New.
    	(nios2_linux_syscall_next_pc): Adjust signature to pass OP.
    	Use size field from OP instead of assuming all instructions
    	are the same size.
    	(nios2_linux_init_abi): Register appropriate unwinder for mach.
    
    	gdb/gdbserver/
    	* linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
    	arch variant.
    	(CDX_BREAKPOINT): Define for R2.
    	(nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
    	(the_low_target): Add comments.

commit cb1c8103f13d413e05ca6e61e21b56bba3baae74
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date:   Mon Aug 3 20:34:51 2015 +0200

    Fix "FAIL: -Bsymbolic-functions" for cris-linux in ld
    
    	* elf32-cris.c (cris_elf_relocate_section)
    	(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
    	(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
    	just h->symbolic, to check if a symbol should be bound
    	symbolically.

commit ee2d2b102071f89a04f93f0434df818f69ef1e50
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Mon Aug 3 11:09:32 2015 -0700

    Further robustify gdb.base/bp-permanent.exp.
    
    2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/testsuite/
    	* gdb.base/bp-permanent.exp: Report test as unsupported if
    	the target cannot stop at the permanent breakpoint.

commit 666fcf91c0117da8294207f631df5a97fdc4157c
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 3 18:55:12 2015 +0100

    dwarf2read.c: fix latent buglet
    
    cust->includes is:
    
    struct compunit_symtab
    {
    ...
      struct compunit_symtab **includes;
    
    gdb/ChangeLog:
    2015-08-03  Pedro Alves  <palves@redhat.com>
    
    	* dwarf2read.c (compute_compunit_symtab_includes): Use size of struct
    	compunit_symtab pointer.

commit c8bd4544607d4f41b89b78630fc233f53f90b6a2
Author: Doug Evans <dje@google.com>
Date:   Mon Aug 3 09:27:57 2015 -0700

    Missing changelog entry for previous commit: Add gmonster-{1,2} perf testcases.
    
    These testcases are mocks of real programs.
    GDB doesn't care what the programs do, they just have to look
    and/or behave like the real program.
    These testcases exercise gdb when debugging really large programs.
    E.g., gmonster-1 has 10,000 CUs, and gmonster-2 has 1000 shared libs
    (which is actually a little small, 5000 would be more accurate).
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.perf/lib/perftest/utils.py: New file.
    	* gdb.perf/gm-hello.cc: New file.
    	* gdb.perf/gm-pervasive-typedef.cc: New file.
    	* gdb.perf/gm-pervasive-typedef.h: New file.
    	* gdb.perf/gm-std.cc: New file.
    	* gdb.perf/gm-std.h: New file.
    	* gdb.perf/gm-use-cerr.cc: New file.
    	* gdb.perf/gm-utils.h: New file.
    	* gdb.perf/gmonster-null-lookup.py: New file.
    	* gdb.perf/gmonster-pervasive-typedef.py: New file.
    	* gdb.perf/gmonster-print-cerr.py: New file.
    	* gdb.perf/gmonster-ptype-string.py: New file.
    	* gdb.perf/gmonster-runto-main.py: New file.
    	* gdb.perf/gmonster-select-file.py: New file.
    	* gdb.perf/gmonster1-null-lookup.exp: New file.
    	* gdb.perf/gmonster1-pervasive-typedef.exp: New file.
    	* gdb.perf/gmonster1-print-cerr.exp: New file.
    	* gdb.perf/gmonster1-ptype-string.exp: New file.
    	* gdb.perf/gmonster1-runto-main.exp: New file.
    	* gdb.perf/gmonster1-select-file.exp: New file.
    	* gdb.perf/gmonster1.cc: New file.
    	* gdb.perf/gmonster1.exp: New file.
    	* gdb.perf/gmonster2-null-lookup.exp: New file.
    	* gdb.perf/gmonster2-pervasive-typedef.exp: New file.
    	* gdb.perf/gmonster2-print-cerr.exp: New file.
    	* gdb.perf/gmonster2-ptype-string.exp: New file.
    	* gdb.perf/gmonster2-runto-main.exp: New file.
    	* gdb.perf/gmonster2-select-file.exp: New file.
    	* gdb.perf/gmonster2.cc: New file.
    	* gdb.perf/gmonster2.exp: New file.

commit 8e1afc817ca50aec1e77b5bd2613844bb4b4d932
Author: Doug Evans <dje@google.com>
Date:   Mon Aug 3 09:23:41 2015 -0700

    Fix file paths in earlier entry.

commit 4e1bdb00c63a839037f31f005349c87702d50cfe
Author: Doug Evans <dje@google.com>
Date:   Mon Aug 3 09:21:09 2015 -0700

    gdb.perf/single-step.exp (SINGLE_STEP_COUNT): Change to 1000 from 10000.
    
    single-step.exp takes a while to run, and while that's not necessarily
    bad, here it's because the default value of SINGLE_STEP_COUNT is 10,000.
    We're not going to gain any more insight into perf issues
    single-stepping (stepi) 10,000 times over 1,000 times,
    so this patch changes the default to 1,000.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.perf/single-step.exp (SINGLE_STEP_COUNT): Change to 1000 from
    	10000.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                                      |   26 +
 bfd/elf.c                                          |   57 ++
 bfd/elf32-cris.c                                   |   14 +-
 bfd/ihex.c                                         |    6 +-
 bfd/srec.c                                         |    2 +-
 bfd/version.h                                      |    2 +-
 binutils/ChangeLog                                 |   17 +
 binutils/ar.c                                      |    1 +
 binutils/doc/binutils.texi                         |   17 +-
 binutils/readelf.c                                 |    2 +-
 binutils/testsuite/ChangeLog                       |   13 +
 binutils/testsuite/binutils-all/objcopy.exp        |   67 ++
 binutils/testsuite/lib/utils-lib.exp               |   36 +-
 gas/ChangeLog                                      |    4 +
 gas/doc/c-aarch64.texi                             |    4 +
 gdb/ChangeLog                                      |  102 +++
 gdb/aarch64-linux-nat.c                            |   26 +-
 gdb/arm-linux-nat.c                                |   37 +-
 gdb/breakpoint.c                                   |   18 +-
 gdb/dwarf2read.c                                   |    2 +-
 gdb/exec.c                                         |   30 +-
 gdb/exec.h                                         |    2 +
 gdb/gdbserver/ChangeLog                            |   72 ++
 gdb/gdbserver/configure.srv                        |    5 +
 gdb/gdbserver/linux-aarch32-low.c                  |  140 ++++
 gdb/gdbserver/linux-aarch32-low.h                  |   29 +
 gdb/gdbserver/linux-aarch64-low.c                  |  100 +++-
 gdb/gdbserver/linux-arm-low.c                      |   78 +--
 gdb/gdbserver/linux-low.c                          |    3 +
 gdb/gdbserver/linux-low.h                          |    2 +
 gdb/gdbserver/linux-nios2-low.c                    |   25 +-
 gdb/gdbserver/linux-x86-low.c                      |    3 -
 gdb/gdbserver/server.c                             |    2 +-
 gdb/gdbserver/server.h                             |    1 +
 gdb/gdbserver/thread-db.c                          |   70 +--
 gdb/infcmd.c                                       |   25 +-
 gdb/inferior.c                                     |    3 +
 gdb/linux-thread-db.c                              |  100 ++--
 gdb/main.c                                         |   24 +-
 gdb/nat/gdb_thread_db.h                            |   60 ++
 gdb/nios2-linux-tdep.c                             |   36 +-
 gdb/nios2-tdep.c                                   |  709 +++++++++++++++++---
 gdb/nios2-tdep.h                                   |    7 +-
 gdb/progspace.h                                    |   17 +
 gdb/python/py-linetable.c                          |   14 +-
 gdb/python/py-symtab.c                             |    8 +-
 gdb/remote.c                                       |    9 +-
 gdb/solib.c                                        |   17 +-
 gdb/symfile.c                                      |    3 +
 gdb/testsuite/ChangeLog                            |   54 ++-
 gdb/testsuite/gdb.base/bp-permanent.exp            |   17 +-
 gdb/testsuite/gdb.perf/single-step.exp             |    2 +-
 .../gdb.threads/next-while-other-thread-longjmps.c |  127 ++++
 .../next-while-other-thread-longjmps.exp           |   40 ++
 gdb/xtensa-linux-nat.c                             |   18 +-
 ld/ChangeLog                                       |   19 +
 ld/NEWS                                            |    3 +
 ld/ld.texinfo                                      |   23 +-
 ld/ldlang.c                                        |   52 ++
 ld/ldlang.h                                        |    2 +
 ld/ldlex.h                                         |    1 +
 ld/lexsup.c                                        |    6 +
 ld/testsuite/ChangeLog                             |   20 +
 ld/testsuite/ld-undefined/require-defined-1.d      |    4 +
 ld/testsuite/ld-undefined/require-defined-2.d      |    8 +
 ld/testsuite/ld-undefined/require-defined-3.d      |    8 +
 ld/testsuite/ld-undefined/require-defined-4.d      |    8 +
 ld/testsuite/ld-undefined/require-defined-5.d      |   10 +
 ld/testsuite/ld-undefined/require-defined.exp      |   58 ++
 ld/testsuite/ld-undefined/require-defined.s        |    9 +
 ld/testsuite/lib/ld-lib.exp                        |   95 +++-
 sim/m32c/ChangeLog                                 |    5 +
 sim/m32c/gdb-if.c                                  |    6 +
 73 files changed, 2223 insertions(+), 419 deletions(-)
 create mode 100644 gdb/gdbserver/linux-aarch32-low.c
 create mode 100644 gdb/gdbserver/linux-aarch32-low.h
 create mode 100644 gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.c
 create mode 100644 gdb/testsuite/gdb.threads/next-while-other-thread-longjmps.exp
 create mode 100644 ld/testsuite/ld-undefined/require-defined-1.d
 create mode 100644 ld/testsuite/ld-undefined/require-defined-2.d
 create mode 100644 ld/testsuite/ld-undefined/require-defined-3.d
 create mode 100644 ld/testsuite/ld-undefined/require-defined-4.d
 create mode 100644 ld/testsuite/ld-undefined/require-defined-5.d
 create mode 100644 ld/testsuite/ld-undefined/require-defined.exp
 create mode 100644 ld/testsuite/ld-undefined/require-defined.s

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e9776bf..601ce3b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,29 @@
+2015-08-05  Nick Clifton  <nickc@redhat.com>
+
+	* elf.c (_bfd_elf_copy_private_bfd_data): Copy the sh_link and
+	sh_info fields of sections whose type has been changed to
+	SHT_NOBITS.
+
+2015-08-04  Yuriy M. Kaminskiy"  <yumkam@gmail.com>
+	    Tyler Hicks  <tyhicks@canonical.com>
+
+	PR binutils/18750
+	* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
+	and stack overflow when char is signed and \200-\376 was in place of hex
+	digit; also fixes \377 was handled as EOF instead of "incorrect character".
+	(ihex_read_section): Changed for consistency.
+	(ihex_bad_byte): Prevent (now impossible to trigger) stack
+	overflow and incorrect escape sequence handling.
+	* srec.c (srec_bad_byte): Likewise.
+
+2015-08-03  Hans-Peter Nilsson  <hp@axis.com>
+
+	* elf32-cris.c (cris_elf_relocate_section)
+	(elf_cris_finish_dynamic_symbol, cris_elf_check_relocs)
+	(elf_cris_discard_excess_dso_dynamics): Use SYMBOLIC_BIND, not
+	just link_info->symbolic, to check if a symbol should be bound
+	symbolically.
+
 2015-07-30  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/18735
diff --git a/bfd/elf.c b/bfd/elf.c
index 05ee025..67e4240 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1203,6 +1203,63 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   /* Copy object attributes.  */
   _bfd_elf_copy_obj_attributes (ibfd, obfd);
+
+  /* This is an feature for objcopy --only-keep-debug:  When a section's type
+     is changed to NOBITS, we preserve the sh_link and sh_info fields so that
+     they can be matched up with the original.  */
+  Elf_Internal_Shdr ** iheaders = elf_elfsections (ibfd);
+  Elf_Internal_Shdr ** oheaders = elf_elfsections (obfd);
+
+  if (iheaders != NULL && oheaders != NULL)
+    {
+      unsigned int i;
+
+      for (i = 0; i < elf_numsections (obfd); i++)
+	{
+	  unsigned int j;
+	  Elf_Internal_Shdr * oheader = oheaders[i];
+
+	  if (oheader == NULL
+	      || oheader->sh_type != SHT_NOBITS
+	      || oheader->sh_size == 0
+	      || (oheader->sh_info != 0 && oheader->sh_link != 0))
+	    continue;
+
+	  /* Scan for the matching section in the input bfd.
+	     FIXME: We could use something better than a linear scan here.
+	     Unfortunately we cannot compare names as the output string table
+	     is empty, so instead we check size, address and type.  */
+	  for (j = 0; j < elf_numsections (ibfd); j++)
+	    {
+	      Elf_Internal_Shdr * iheader = iheaders[j];
+	      
+	      if (iheader->sh_type != SHT_NOBITS
+		  && iheader->sh_size == oheader->sh_size
+		  && iheader->sh_addr == oheader->sh_addr
+		  && (iheader->sh_info != oheader->sh_info
+		      || iheader->sh_link != oheader->sh_link))
+		{
+		  /* Note: Strictly speaking these assignments are wrong.
+		     The sh_link and sh_info fields should point to the
+		     relevent sections in the output BFD, which may not be in
+		     the same location as they were in the input BFD.  But the
+		     whole point of this action is to preserve the original
+		     values of the sh_link and sh_info fields, so that they
+		     can be matched up with the section headers in the
+		     original file.  So strictly speaking we may be creating
+		     an invalid ELF file, but it is only for a file that just
+		     contains debug info and only for sections without any
+		     contents.  */
+		  if (oheader->sh_link == 0)
+		    oheader->sh_link = iheader->sh_link;
+		  if (oheader->sh_info == 0)
+		    oheader->sh_info = iheader->sh_info;
+		  break;
+		}
+	    }
+	}
+    }
+
   return TRUE;
 }
 
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index d5670ac..439ce11 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1093,7 +1093,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 		 h->elf_link_hash_flags test, though it's there in
 		 other targets.  */
 	      if (info->shared
-		  && ((! info->symbolic && h->dynindx != -1)
+		  && ((!SYMBOLIC_BIND (info, h) && h->dynindx != -1)
 		      || !h->def_regular)
 		  && (input_section->flags & SEC_ALLOC) != 0
 		  && (r_type == R_CRIS_8
@@ -1212,7 +1212,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 			    || h->type == STT_FUNC
 			    || h->needs_plt))
 		    || (info->shared
-			&& (info->symbolic || h->dynindx == -1)
+			&& (SYMBOLIC_BIND (info, h) || h->dynindx == -1)
 			&& h->def_regular))
 		  {
 		    /* This wasn't checked above for ! info->shared, but
@@ -1432,7 +1432,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	      && ((r_type != R_CRIS_8_PCREL
 		   && r_type != R_CRIS_16_PCREL
 		   && r_type != R_CRIS_32_PCREL)
-		  || (!info->symbolic
+		  || (!SYMBOLIC_BIND (info, h)
 		      || (h != NULL && !h->def_regular))))
 	    {
 	      Elf_Internal_Rela outrel;
@@ -1484,7 +1484,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	      /* h->dynindx may be -1 if the symbol was marked to
 		 become local.  */
 	      else if (h != NULL
-		       && ((! info->symbolic && h->dynindx != -1)
+		       && ((!SYMBOLIC_BIND (info, h) && h->dynindx != -1)
 			   || !h->def_regular))
 		{
 		  BFD_ASSERT (h->dynindx != -1);
@@ -2245,7 +2245,7 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd,
       where = sgot->contents + (h->got.offset &~ (bfd_vma) 1);
       if (! elf_hash_table (info)->dynamic_sections_created
 	  || (info->shared
-	      && (info->symbolic || h->dynindx == -1)
+	      && (SYMBOLIC_BIND (info, h) || h->dynindx == -1)
 	      && h->def_regular))
 	{
 	  rela.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE);
@@ -3661,7 +3661,7 @@ cris_elf_check_relocs (bfd *abfd,
 	     this shared library) then we can also eliminate the
 	     reloc.  See comment above for more eliminable cases which
 	     we can't identify at this time.  */
-	  if (info->symbolic
+	  if (SYMBOLIC_BIND (info, h)
 	      && h->root.type != bfd_link_hash_defweak
 	      && h->def_regular)
 	    break;
@@ -3953,7 +3953,7 @@ elf_cris_discard_excess_dso_dynamics (struct elf_cris_link_hash_entry *h,
      any relocs.  */
   if (h->root.def_regular
       && (h->root.forced_local
-	  || info->symbolic))
+	  || SYMBOLIC_BIND (info, &h->root)))
     {
       for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
 	{
diff --git a/bfd/ihex.c b/bfd/ihex.c
index 8e66372..38112f6 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -219,7 +219,7 @@ ihex_bad_byte (bfd *abfd, unsigned int lineno, int c, bfd_boolean error)
       char buf[10];
 
       if (! ISPRINT (c))
-	sprintf (buf, "\\%03o", (unsigned int) c);
+	sprintf (buf, "\\%03o", (unsigned int) c & 0xff);
       else
 	{
 	  buf[0] = c;
@@ -276,7 +276,7 @@ ihex_scan (bfd *abfd)
       else
 	{
 	  file_ptr pos;
-	  char hdr[8];
+	  unsigned char hdr[8];
 	  unsigned int i;
 	  unsigned int len;
 	  bfd_vma addr;
@@ -553,7 +553,7 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents)
   error = FALSE;
   while ((c = ihex_get_byte (abfd, &error)) != EOF)
     {
-      char hdr[8];
+      unsigned char hdr[8];
       unsigned int len;
       unsigned int type;
       unsigned int i;
diff --git a/bfd/srec.c b/bfd/srec.c
index 24573cf..96b6a2f 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -249,7 +249,7 @@ srec_bad_byte (bfd *abfd,
       char buf[40];
 
       if (! ISPRINT (c))
-	sprintf (buf, "\\%03o", (unsigned int) c);
+	sprintf (buf, "\\%03o", (unsigned int) c & 0xff);
       else
 	{
 	  buf[0] = c;
diff --git a/bfd/version.h b/bfd/version.h
index 3ee5693..d6a887b 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20150803
+#define BFD_VERSION_DATE 20150805
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 75f5d21..0b5ff7f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,20 @@
+2015-08-05  Nick Clifton  <nickc@redhat.com>
+
+	* doc/binutils.texi: Document that the --only-keep-debug option
+	to strip and objcopy preserves the section headers of stripped
+	sections.
+
+2015-08-04  Yuriy M. Kaminskiy"  <yumkam@gmail.com>
+	    Tyler Hicks  <tyhicks@canonical.com>
+
+	PR binutils/18750
+	* readelf.c (process_mips_specific): Fix incorrect escape
+	sequence handling.
+
+2015-08-04  Nick Clifton  <nickc@redhat.com>
+
+	* ar.c (extract_file): Free cbuf if the path is invalid.
+
 2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* configure: Regenerated.
diff --git a/binutils/ar.c b/binutils/ar.c
index 94c79e2..2765dcc 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -1041,6 +1041,7 @@ extract_file (bfd *abfd)
     {
       non_fatal (_("illegal pathname found in archive member: %s"),
 		 bfd_get_filename (abfd));
+      free (cbuf);
       return;
     }
 
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 466f125..fef5f3e 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -1731,6 +1731,12 @@ Strip a file, removing contents of any sections that would not be
 stripped by @option{--strip-debug} and leaving the debugging sections
 intact.  In ELF files, this preserves all note sections in the output.
 
+Note - the section headers of the stripped sections are preserved,
+including their sizes, but the contents of the section are discarded.
+The section headers are preserved so that other tools can match up the
+debuginfo file with the real executable, even if that executable has
+been relocated to a different address space.
+
 The intention is that this option will be used in conjunction with
 @option{--add-gnu-debuglink} to create a two part executable.  One a
 stripped binary which will occupy less space in RAM and in a
@@ -3074,9 +3080,16 @@ When stripping a file, perhaps with @option{--strip-debug} or
 which would otherwise get stripped.
 
 @item --only-keep-debug
-Strip a file, removing contents of any sections that would not be
+Strip a file, emptying the contents of any sections that would not be
 stripped by @option{--strip-debug} and leaving the debugging sections
-intact.  In ELF files, this preserves all note sections in the output.
+intact.  In ELF files, this preserves all the note sections in the
+output as well.
+
+Note - the section headers of the stripped sections are preserved,
+including their sizes, but the contents of the section are discarded.
+The section headers are preserved so that other tools can match up the
+debuginfo file with the real executable, even if that executable has
+been relocated to a different address space.
 
 The intention is that this option will be used in conjunction with
 @option{--add-gnu-debuglink} to create a two part executable.  One a
diff --git a/binutils/readelf.c b/binutils/readelf.c
index a9b9f2d..6298f1e 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -14467,7 +14467,7 @@ process_mips_specific (FILE * file)
 	      len = sizeof (* eopt);
 	      while (len < option->size)
 		{
-		  char datum = * ((char *) eopt + offset + len);
+		  unsigned char datum = * ((unsigned char *) eopt + offset + len);
 
 		  if (ISPRINT (datum))
 		    printf ("%c", datum);
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index a0fb962..9255fb9 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,16 @@
+2015-08-05  Nick Clifton  <nickc@redhat.com>
+
+	* binutils-all/objcopy.exp (keep_debug_symbols_and_check_links):
+	New proc.  Checks that debug-info-only binaries retain the
+	sh_link field in stripped sections.
+
+2015-08-04  Nick Clifton  <nickc@redhat.com>
+
+	* lib/utils-lib.exp (run_dump_test): Document DUMPPROG, readelf
+	and size parameters.  Alpha-sort switch tables.  Include
+	addr2line, and size in list of possible auto-detected dump
+	programs.
+
 2015-07-24  Nick Clifton  <nickc@redhat.com>
 
 	* binutils-all/localize-hidden-1.d: Allow for extra symbols in the
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index ae21b22..01d2e17 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -829,12 +829,70 @@ proc keep_debug_symbols_and_test_copy { prog1 flags1 test1 prog2 flags2 test2 }
     pass $test2
 }
 
+# Tests that in a debug only copy of a file the sections
+# headers whoes types have been changed to NOBITS still
+# retain their sh_link fields.
+
+proc keep_debug_symbols_and_check_links { prog flags test } {
+    global READELF
+
+    remote_file build delete tmpdir/striprog
+    remote_download build tmpdir/copyprog tmpdir/striprog
+    if [is_remote host] {
+	set copyfile [remote_download host tmpdir/striprog]
+    } else {
+	set copyfile tmpdir/striprog
+    }
+
+    set exec_output [binutils_run $prog "$flags ${copyfile}"]
+    if ![string match "" $exec_output] {
+	fail $test
+	return
+    }
+
+    set got [binutils_run $READELF "-S --wide ${copyfile}"]
+
+    set fails 0
+    # Regexp to match a section with NOBITS type and extract its name and sh_link fields
+    while {[regexp \
+		{[^a-zA-Z]+([a-zA-Z0-9_\.]+)[ 	]+NOBITS[ 	]+[0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9]+[ A]+([0-9]+)(.*)} \
+		$got all name link rest]} {
+	set sh_link 0x$link
+	if {$sh_link == 0} {
+	    # Only some NOBITS sections should have a non-zero sh_link field.
+	    # Look for them by name.
+	    verbose "NOBITS section .$name has a 0 sh_link field\n"
+	    switch $name {
+		"rela.*"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"rel.*"		{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"hash"		{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"gnu_version"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"dynsym"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"gnu.version_r"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"dynamic"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+		"symtab"	{ set fails 1 ; send_log "Expected non-zero sh_link for .$name\n" }
+	    }
+	}
+	set got $rest
+    }
+
+    if {$fails == 0} {
+	pass $test
+    } else {
+	fail $test
+    }
+}
+
+
 set test1 "simple objcopy of executable"
 set test2 "run objcopy of executable"
 set test3 "run stripped executable"
 set test4 "run stripped executable with saving a symbol"
 set test5 "keep only debug data"
 set test6 "simple objcopy of debug data"
+if [is_elf_format] {
+    set test7 "NOBITS sections retain sh_link field"
+}
 
 switch [copy_setup] {
     "1" {
@@ -847,6 +905,9 @@ switch [copy_setup] {
 	untested $test4
 	untested $test5
 	untested $test6
+	if [is_elf_format] {
+	    untested $test7
+	}
     }
     "3" {
 	copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" ""
@@ -855,6 +916,9 @@ switch [copy_setup] {
 	unsupported $test4
 	unsupported $test5
 	unsupported $test6
+	if [is_elf_format] {
+	    unsupported $test7
+	}
     }
     "0" {
 	copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "$test2"
@@ -862,6 +926,9 @@ switch [copy_setup] {
 	strip_executable_with_saving_a_symbol "$STRIP" "-K main -K _main $STRIPFLAGS" "$test4"
 	keep_debug_symbols_and_test_copy "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test5" \
 					 "$OBJCOPY" "$OBJCOPYFLAGS" "$test6"
+	if [is_elf_format] {
+	    keep_debug_symbols_and_check_links "$STRIP" "--only-keep-debug $STRIPFLAGS" "$test7"
+	}
     }
 }
 
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index f87b390..9c24cf1 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -180,14 +180,22 @@ proc exe_ext {} {
 #	When assembling FILE.s, pass FLAGS to the assembler.
 #
 #   PROG: PROGRAM-NAME
-#       The name of the program to run to analyze the .o file produced
-#       by the assembler.  This can be omitted; run_dump_test will guess
-#       which program to run by seeing which of the flags options below
-#	is present.
+#       The name of the program to run to modify or analyze the .o file
+#       produced by the assembler.  This option is required.  Recognised
+#       names are: ar, elfedit, nm, objcopy, ranlib, strings, and strip.
+#
+#   DUMPPROG: PROGRAM-NAME
+#       The name of the program to run to analyze the .o file after it has
+#       has been modified by PROG.  This can be omitted; run_dump_test will
+#       guess which program to run by seeing if any of the flags options
+#       for the recognised dump programs are set.  Recognised names are:
+#       addr2line, nm, objdump, readelf and size.
 #
-#   objdump: FLAGS
 #   nm: FLAGS
 #   objcopy: FLAGS
+#   objdump: FLAGS
+#   readelf: FLAGS
+#   size: FLAGS
 #	Use the specified program to analyze the .o file, and pass it
 #	FLAGS, in addition to the .o file name.  Note that they are run
 #	with LC_ALL=C in the environment to give consistent sorting
@@ -269,16 +277,16 @@ proc run_dump_test { name {extra_options {}} } {
     set opts(addr2line) {}
     set opts(ar) {}
     set opts(as) {}
+    set opts(elfedit) {}
+    set opts(name) {}
     set opts(nm) {}
     set opts(objcopy) {}
     set opts(objdump) {}
-    set opts(strip) {}
     set opts(ranlib) {}
     set opts(readelf) {}
     set opts(size) {}
     set opts(strings) {}
-    set opts(name) {}
-    set opts(elfedit) {}
+    set opts(strip) {}
     set opts(PROG) {}
     set opts(DUMPPROG) {}
     set opts(source) {}
@@ -337,7 +345,7 @@ proc run_dump_test { name {extra_options {}} } {
     verbose "Testing $testname"
 
     if {$opts(PROG) == ""} {
-	perror "program isn't set in $file.d"
+	perror "PROG isn't set in $file.d"
 	unresolved $testname
 	return
     }
@@ -345,15 +353,15 @@ proc run_dump_test { name {extra_options {}} } {
     set destopt ""
     switch -- $opts(PROG) {
 	ar	{ set program ar }


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2015-08-05 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 20:59 jkratoch [this message]
2015-08-11 21:01 jkratoch
2015-08-12 14:18 jkratoch
2015-08-12 15:39 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150805205922.13388.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).