public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  jankratochvil/gdbserverbuildid: Support build-id for main executables
@ 2015-08-21 20:04 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2015-08-21 20:04 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid has been updated
  discards  ab595d5e41323a5e17d4fa2d73fe534f3f83b08a (commit)
  discards  6fb3663ddc5d5a99199833d949942aad7b681380 (commit)
  discards  bf911121a5734434aad51b715cc19eb8170eb5ef (commit)
  discards  fcda11731bd2c9c40339e82bc80d5e35d6dcdeb8 (commit)
  discards  cbeb2450722667ef8d7f1266f3099c3406e150ea (commit)
  discards  ae205911e654b6b405807fc7c650ac0e2b2888f2 (commit)
  discards  5a62beb82130814843c612d9359ec13f54308202 (commit)
  discards  b6717c38a322af00f62a943721db158dbc19f30d (commit)
  discards  99f2fd6bfd044c983ded576e832d7887e48c2ebe (commit)
  discards  cb74b650510f3b6dd0ae6a03f6ba19ae2d7afc47 (commit)
  discards  0f04cc7c1c666445744eea4a3eed119d9bec16b0 (commit)
  discards  de7fa43d28da0caea1fcd790d4b4e99b0ba3e2cc (commit)
  discards  6015f7902e795eccac05b40bc55712c7f9603bab (commit)
  discards  0d912487e5a386df01bc02645a44a9faef7de5d7 (commit)
  discards  e99ca88a03cd89a75e036bed16697f80f36a6c18 (commit)
  discards  7cff29ba8a59f275ed0611fd71d6ffe00e1dd75f (commit)
  discards  50c3d7c8425f78c29dcc6af0e46c0e0ad5456388 (commit)
  discards  4824eb06420698e713da82269d23d809e153cd17 (commit)
  discards  46eada5a83c042621b96bc61780f55289ef3d101 (commit)
  discards  cabfd87f9edbc4f6dcd3b13830788cae270adcff (commit)
  discards  730480bb5f5546e854ee8b0bd1ac2675d1c78f6f (commit)
  discards  20724d37ccb6523d45cc963f67ab6e39d346d7b8 (commit)
  discards  0259aa4b5c8a64eaa5df90af54ed4721e052ad09 (commit)
  discards  77fd6bd0e8adafc12638379be6c2f380e60f7c8f (commit)
  discards  521bf6f14bd907949c0afe161a291392137f54f9 (commit)
  discards  29a2e15387c7b901d3ff724eefc17da1d7c7972b (commit)
  discards  98f9d97afa805f97e4d458b16487b3eda72d67f0 (commit)
  discards  78902252d958c60f2e8bdc636a8580e685a42214 (commit)
  discards  297e4cca9e1ddd859a9409063e6edeb75cc5c164 (commit)
  discards  dcf8f42dd92db632477b9d0f803c098951eb771a (commit)
  discards  c3ff2fcf809287543c310c40edb5a9fd872177c7 (commit)
  discards  7d6a0cf97bf0080bac4686dbeb795f2bfbd7f4d2 (commit)
       via  b4e4b4764ce753d336d6b6de12c5ec5296bd4d2b (commit)
       via  eae34a38b1b6073a6380a670f832abeb31ac8e3e (commit)
       via  e30bfa019ec125c5c91edae344546a22c82b8fb5 (commit)
       via  6e63fc41f7eb6f24fe07e39468576d5460816cfd (commit)
       via  adf6af424c8843a91660a011d23492fd2775bd77 (commit)
       via  75428cfacf113f24c18c011cd371f1c17d55927a (commit)
       via  232606b55fd080d61dc80088be4f90273a42152b (commit)
       via  2f69fd3f00008f55d525365efb264d1411ffe706 (commit)
       via  157a9ea4235c203ffef98a1d01076b331a9dc7b3 (commit)
       via  b81b03b2d5a74e42fb3db91683f2e2e21350e384 (commit)
       via  46116c84f334482a7919c903e70e49302ded3113 (commit)
       via  57b773b9c32050bf0171feef3890ce59dce04be7 (commit)
       via  7126338cca73b4c8c626209d5135921be145c2a6 (commit)
       via  8a46a0bb6d85d35867afff33b23f5141a4d44257 (commit)
       via  52a72e3685e8d87315f61ab0eeb9abec75649c7e (commit)
       via  406712ee5ea7c37d0f585ce576e1577135cf72fe (commit)
       via  fa37623340e12495a724e520fa4c2c2419cc350c (commit)
       via  08a325927e2c8cacb0c68f18394bb4a4aeea55cb (commit)
       via  0092a2b7a1b7cb7cc73b9dbc663ffa4aff582738 (commit)
       via  5c773a41ae721c2260f8bdd440b2352d2f9d8754 (commit)
       via  1bf9fe0773948520ea46435f5cec76236384f898 (commit)
       via  405b76a55bd811ecd691e330dc62ded0410a0398 (commit)
       via  9190ee41e215de2239fb7fdfe1b350379e8fa406 (commit)
       via  86c34d43e014fdde2a8ead404bccf250515a1c9b (commit)
       via  0e392b9bb75d77f7b72f4e774c50471c28f86f5d (commit)
       via  0a26b660f625479dd1b44f9399d8635f59496d25 (commit)
       via  940be657e23cd76a0ccf1a40bec9b2d2ee3a1fe3 (commit)
       via  3c14f41e452101f2b334e3457e192cdaf6399ab4 (commit)
       via  4e740c7af8897af2135eccf99b462d66e21944a6 (commit)
       via  ee82cb85c7a59dc6a5dfcec0871a655e23212dc9 (commit)
       via  916c08762b5f7b08d55982ed0e8425407a924a67 (commit)
       via  6061861af8d9249058b90c604068a4f3600cc324 (commit)
       via  465a859e0a991d3bfe8a9ee65a29a223c42e2ce7 (commit)
       via  f0db101d9897732d6556456e542d12ecf9e12e42 (commit)
       via  2d7711a36720b0bc44fee20d0bf057614ead21c2 (commit)
       via  4313b8c0ed5877feb5034bfff4056e1ccfe221f1 (commit)
       via  f36b87190aed31b1ef7787e5966be542e8abdb58 (commit)
       via  d02603dc201f80cd9d2a1f4b1a16110b1e04222b (commit)
       via  40045d91812b25c88c8275b8c08d27c234b68ba8 (commit)
       via  ab4e4ed5dabc378c06ee647afd5793513393ae3f (commit)
       via  80152258b9dfe033828e5c5b6dc3252be1ba7a84 (commit)
       via  88fc5eb7e23af132eacb895e475b31be0f7623e6 (commit)
       via  6f1cb6eac2f28c6e1cb49c011f2b916afb90b4ff (commit)
       via  8e804db96b40c5c88d26b933fb19b6bfcfcb1101 (commit)
      from  ab595d5e41323a5e17d4fa2d73fe534f3f83b08a (commit)

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

- Log -----------------------------------------------------------------
commit b4e4b4764ce753d336d6b6de12c5ec5296bd4d2b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:56 2015 +0200

    Support build-id for main executables
    
    Hi,
    
    make all the existing shlibs build-id functionality working also for the main
    executables.
    
    I think target_so_ops::open_symbol_file_object() is already replaced by what
    exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but
    open_symbol_file_object() has been forgotten.
    
    This patch adds target_so_ops::main_build_id() which could be possibly marged
    with open_symbol_file_object() but I made it a separate function as I think it
    is easier to rather remove target_so_ops::open_symbol_file_object().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_verify): Add parameter advice.
    	* build-id.h (build_id_verify): Likewise.
    	* dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller.
    	* exec.c: Include build-id.h.
    	(exec_file_and_symbols_resync): Detect and use build-id by
    	solib_main_build_id.
    	* features/library-list-svr4.dtd: Add main-build-id.
    	* solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields
    	main_build_idsz and main_build_id.
    	(hex2bin_allocate): Generalize messages to binary files.
    	(svr4_library_list_start_list): Parse main-build-id.
    	(svr4_library_list_attributes): Add main-build-id.
    	(svr4_current_sos_direct): Set svr4_info main_build_id*.
    	(svr4_main_build_id): New function.
    	(svr4_clear_solib): Clear svr4_info main_build_id*.
    	(_initialize_svr4_solib): Install svr4_main_build_id.
    	* solib.c (solib_main_build_id): New function.
    	* solist.h (struct target_so_ops): Add method main_build_id.
    	(solib_main_build_id): New prototype.
    	* source.c (file_location_from_filename): Update build_id_verify caller.
    
    gdb/gdbserver/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id.
    
    gdb/doc/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    FIXME
    	* gdb.texinfo (Files):
    	(address the file was prelinked to during the library load.):
    	(A simple memory map):
    	(The format of an SVR4 library list is described by this DTD):
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/main-mismatch-mod.c: New file.
    	* gdb.base/main-mismatch.c: New file.
    	* gdb.base/main-mismatch.exp: New file.

commit eae34a38b1b6073a6380a670f832abeb31ac8e3e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Make only user-specified executable and symbol filenames sticky
    
    Message-ID: <559A7C37.6020501@redhat.com>
    
    On 07/03/2015 04:44 PM, Pedro Alves wrote:
    
    > (I still suspect that if we reverse the sense of the flag, then
    > its management ends up being more centralized, as then the
    > place that sets it is also the place that needs to check it,
    > instead of doing that in multiple places.  But, see below.)
    
    It didn't seem fair to impose a subjective preference, so I tried
    this in order to understand it myself, and I now agree that is really
    doesn't make much difference, as then we'd have to mark
    auto-discovered in a few more places that I wasn't originally
    seeing.  There's at least the execd handling in infrun.c, and
    also spu_symbol_file_add_from_memory.
    
    As I was playing with this already, I poked at the other review
    points I made, and came up with the variant of the patch below.
    
    > This function is called while the passed in PID is not the
    > current inferior.  E.g., the remote_add_inferior path.
    >
    > Therefore seems to me that these symbol_file_add_main / exec_file_attach
    > calls can change the symbols of the wrong inferior.
    
    ...
    
    > I also notice that reread_symbols has an exec_file_attach
    > call which seems to me results in losing the is_user_supplied
    > flag if the executable's timestamp changed, at least here:
    >
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    >
    > I also notice that the clone-inferior command ends up with
    > an exec_file_attach call in clone_program_space.  That one
    > should probably be setting the is_user_supplied flag too,
    > I'd think.  Or at least, copying it from the original.
    >
    > At this point, I'm wondering about adding a parameter to
    > exec_file_attach to force considering (now and in future)
    > the right value to put in the flag in each case.
    
    I tried this too (see patch below).  As this requires touching the user-supplied
    paths anyway, it didn't really matter to tag files user-supplied or
    auto-discovered, so I reverted back to user-supplied.  For symbols,
    we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead
    of a new boolean.
    
    >
    >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
    >>    inferior = current_inferior ();
    >>    inferior->control.stop_soon = NO_STOP_QUIETLY;
    >>
    >> -  /* If no exec file is yet known, try to determine it from the
    >> -     process itself.  */
    >> -  if (get_exec_file (0) == NULL)
    >> -    exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> -  else
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    > It seems to me that we should be able to move these reopen/reread
    > calls inside exec_file_locate_attach.
    
    I did this too.
    
    What do you think of the version below?
    
    I also tweaked the warnings a bit, to explicitly say "mismatch".
    
    This would still need docs/NEWS changes, and a test would be good too.
    
    ----------
    
    - pass user-supplied / auto-discovered as arguments to exec_file_attach and
      symbol_file_add_main
    
    - Change exec_file_locate_attach parameter from pid to inferior
      pointer.
    
    - Flip current program space temporarily to make sure we add/reload
      symbols to/of the right inferior/program space.
    
    - Move reopen_exec_file and reread_symbols calls inside
      exec_file_locate_attach.
    
    - Warning message tweaks.
    
    - Rename exec_file_locate_attach -> exec_file_and_symbols_resync

commit e30bfa019ec125c5c91edae344546a22c82b8fb5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Code cleanup: New hex2bin_allocate()
    
    Hi,
    
    make hex->bin parsing standalone, to be reused in later patch.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib-svr4.c (hex2bin_allocate): New function from ...
    	(library_list_start_library): ... here, call it.

commit 6e63fc41f7eb6f24fe07e39468576d5460816cfd
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    testcase: Test also locating shlibs by build-id
    
    Hi,
    
    testcase from the previous patch tests verification of build-id in shared
    libraries found by their name.  This test adds testing that a library can be
    found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY).
    
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them
    	global.
    	(solib_locate_test): New function.

commit adf6af424c8843a91660a011d23492fd2775bd77
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Tests for validate symbol file using build-id
    
    Hi,
    
    new testcase only.
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    
    	Tests for validate symbol file using build-id.
    	* gdb.base/solib-mismatch-lib.c: New file.
    	* gdb.base/solib-mismatch-libmod.c: New file.
    	* gdb.base/solib-mismatch.c: New file.
    	* gdb.base/solib-mismatch.exp: New file.

commit 75428cfacf113f24c18c011cd371f1c17d55927a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    build_id_verify: Make it more verbose
    
    Hi,
    
    it was discussed on this list that if build-ids do not match they should be
    printed for troubleshooting.  It is mostly independent from the other patches.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include rsp-low.h.
    	(build_id_verify): Print non-matching build-ids, update the messages.

commit 232606b55fd080d61dc80088be4f90273a42152b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_bfd_open: Optimize opening twice
    
    Hi,
    
    this is one of the optimizations allowed by file_location that prevents opening
    file twice when target build-id is known and it needs to be verified.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by
    	solib_find_file.

commit 2f69fd3f00008f55d525365efb264d1411ffe706
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Verify the build-id
    
    Hi,
    
    now it is possible to filter-out from openp() search files with non-matching
    build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c: Include build-id.h.
    	(file_location_from_filename): Call build_id_verify for the build-id
    	parameters.

commit 157a9ea4235c203ffef98a1d01076b331a9dc7b3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_find: Search also by build-id
    
    Hi,
    
    solib_find() can now try to search also by build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c: Include build-id.h.
    	(solib_find_3): Call build_id_to_file.

commit b81b03b2d5a74e42fb3db91683f2e2e21350e384
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    build_id_to_bfd: Make it return file_location
    
    Hi,
    
    refactor build_id_to_bfd so that it returns file_location.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include source.h.
    	(build_id_to_bfd): Rename to ...
    	(build_id_to_file): ... here, return file_location, add parameter opts,
    	make it public.
    	(build_id_to_debug_bfd): Use build_id_to_file.
    	* build-id.h (build_id_to_file): New prototype.

commit 46116c84f334482a7919c903e70e49302ded3113
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Add dummy build-id params to prototypes
    
    Hi,
    
    it is a lot of text with no functionality.  Add build-id parameters where
    needed, pass them where they are already available, otherwise pass 0 in the top
    callers.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Pass zero build-id.
    	* defs.h (openp, openp_file, source_full_path_of): Add build-id
    	parameters.
    	* dwarf2read.c (try_open_dwop_file): Pass zero build-id.
    	* exec.c (exec_file_locate_attach): Likewise.
    	* infrun.c (follow_exec): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass
    	them.
    	* nto-tdep.h (nto_find_and_open_solib): Add build-id parameters.
    	* solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them.
    	* solib-darwin.c (darwin_bfd_open): Likewise.
    	* solib-dsbt.c (enable_break): Pass zero build-id.
    	* solib-frv.c (enable_break2): Likewise.
    	* solib-spu.c (spu_bfd_open): Add build-id parameters, pass them.
    	* solib-svr4.c (enable_break): Pass zero build-id.
    	* solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find)
    	(solib_find_file, solib_find, solib_bfd_open): Add build-id
    	parameters, pass them.
    	(solib_map_sections): Pass so->build-id* to bfd_open.
    	(reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open.
    	* solist.h (struct target_so_ops): Add build-id parameters to bfd_open
    	and find_and_open_solib.
    	(exec_file_find, solib_find, solib_bfd_open): Add build-id parameters.
    	* source.c (file_location_from_filename): Add build-id parameters.
    	(filename_to_bfd): Pass zero build-id.
    	(openp): Add build-id parameters, pass them.
    	(openp_bfd): Pass zero build-id.
    	(openp_file, source_full_path_of): Add build-id parameters, pass them.
    	(find_and_open_source): Pass zero build-id.
    	* source.h (file_location_from_filename): Add build-id parameters.

commit 57b773b9c32050bf0171feef3890ce59dce04be7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    build_id_to_debug_bfd: Make it also non-.debug capable
    
    Hi,
    
    generalize the function by adding 'suffix' parameter.  To be reused later.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_to_debug_bfd): Rename to ...
    	(build_id_to_bfd): ... here, add parameter suffix.
    	(build_id_to_debug_bfd): New function.

commit 7126338cca73b4c8c626209d5135921be145c2a6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    symfile_bfd_open: Make it use openp_bfd()
    
    Hi,
    
    another function gets converted to the new API.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and
    	gdb_bfd_open.

commit 8a46a0bb6d85d35867afff33b23f5141a4d44257
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    solib_find: Make it use file_location
    
    Hi,
    
    refactor the solib*() code to use file_location functions.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* nto-tdep.c: Include source.h.
    	(nto_find_and_open_solib): Return file_location, remove parameter
    	temp_pathname.  Change openp to openp_file.
    	* nto-tdep.h (nto_find_and_open_solib): Update prototype.
    	* solib.c (solib_find_2): Rename to ...
    	(solib_find_3): ... here, return file_location, change parameter fd to
    	opts.  Change gdb_open_cloexec to file_location_from_filename and openp
    	to openp_file calls.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here, return file_location, change parameter fd to
    	opts.
    	(solib_find_1): New function.
    	(solib_find): Rename to ...
    	(solib_find_file) ... here, return file_location, change parameter fd
    	to opts.
    	(solib_find): New function.
    	* solist.h (find_and_open_solib): Return file_location, remove
    	parameter temp_pathname.

commit 52a72e3685e8d87315f61ab0eeb9abec75649c7e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Refactor openp() to return file_location
    
    Hi,
    
    openp() remains as a backward compatibility wrapper around renamed
    openp->openp_file().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add
    	OPF_BFD_CANONICAL.
    	(openp_bfd, openp_file): Add prototypes.
    	* exec.c (exec_file_attach): Replace openp by openp_bfd calls.
    	* source.c (file_location_from_filename): Support OPF_BFD_CANONICAL.
    	(openp, openp_bfd): New functions.
    	(openp): Rename to ...
    	(openp_file): ... here, return file_location, remove filename_opened
    	parameter.

commit 406712ee5ea7c37d0f585ce576e1577135cf72fe
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Add file_location utility functions
    
    Hi,
    
    build id verification faces a problem current codebase calls openp() and
    similar functions which search many directories and after they find the file
    they return its filename.  Caller then typically opens that file as BFD.
    
    But to search the directories openp() needs to open each file it iterates to
    verify their build-id.  Then it would close the file and caller would reopen it
    again.  This is inefficient (+racy), so a new intermediate representation of
    the found files is created (file_location).
    
    Another possibility would be to depends on bfd cache as being done in
    exec_file_attach.  But then a similar problem is needed for callers which want
    only fd (and not bfd).  Besides that I find depending on pending
    make_cleanup_bfd_unref() from openp() calls would be tricky.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Add OPF_IS_BFD.
    	* gdb_bfd.c (fileio_errno_to_host): Make it public.
    	* gdb_bfd.h (fileio_errno_to_host): Add prototype.
    	* source.c: Include inferior.h and gdb/fileio.h.
    	(file_location_enoent, file_location_free, file_location_cleanup)
    	(file_location_is_valid, file_location_from_filename)
    	(file_location_to_bfd, filename_to_bfd): New functions.
    	* source.h (struct file_location): New definition.
    	(file_location_enoent, file_location_free, file_location_is_valid)
    	(file_location file_location_from_filename, file_location_to_bfd)
    	(filename_to_bfd): New prototypes.

commit fa37623340e12495a724e520fa4c2c2419cc350c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Optionally do not close fd
    
    Hi,
    
    gdb_bfd_open_from_target currently always embedded passed fd into returned BFD
    and closed that fd after closing that BFD.  As one cannot do dup() for target
    fileio FDs one could not use FD after BFD using it has been closed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function.
    	(gdb_bfd_open_from_target): Add parameter do_close.  Optionally pass
    	gdb_bfd_iovec_fileio_close_nop.
    	(gdb_bfd_open): Update caller.
    	* gdb_bfd.h (gdb_bfd_open_from_target): Update prototype.

commit 08a325927e2c8cacb0c68f18394bb4a4aeea55cb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Support real fd
    
    Hi,
    
    gdb_bfd_open_from_target is extended so that it can be now passed also some
    non-(-1) fd.  non-(-1) fd was not supported for remote files in mainline.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function.
    	(gdb_bfd_open_from_target): Conditionally use it.

commit 0092a2b7a1b7cb7cc73b9dbc663ffa4aff582738
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Provide new gdb_bfd_open_from_target
    
    Hi,
    
    later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more
    special parameters.  So it is refactored out first (and extended later in the
    next patches).
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_open_from_target): New function from ...
    	(gdb_bfd_open): ... here.  Call it.
    	* gdb_bfd.h (gdb_bfd_open_from_target): New prototype.

commit 5c773a41ae721c2260f8bdd440b2352d2f9d8754
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Code cleanup: openp parameter filename_opened is never NULL
    
    Hi,
    
    this parameter is never passed as NULL in the codebase so the check can be
    removed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c (openp): Update function comment for filename_opened.
    	Remove NULL check for filename_opened.

commit 1bf9fe0773948520ea46435f5cec76236384f898
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove openp parameter mode
    
    Hi,
    
    simplify the code, make it also suitable for more code refactorings.
    The new flag OPF_OPEN_RW_TMP is removed later in this patch series.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Update openp caller.
    	* defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP.
    	(openp): Remove parameter mode.
    	* dwarf2read.c (try_open_dwop_file): Update openp caller.
    	* exec.c (exec_file_attach): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags,
    	update openp caller.
    	* nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags.
    	* solib.c (solib_find_2): Update openp and find_and_open_solib caller.
    	* solist.h (struct target_so_ops): Remove parameter o_flags from
    	find_and_open_solib method.
    	* source.c (openp): Change parameter mode to a new variable.
    	(source_full_path_of, find_and_open_source): Update openp caller.
    	* symfile.c (symfile_bfd_open): Likewise.

commit 405b76a55bd811ecd691e330dc62ded0410a0398
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove OPF_RETURN_REALPATH
    
    Hi,
    
    OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned
    values.  That is not useful, code can be simplified if callers that passed
    OPF_RETURN_REALPATH adjust the returned values on their own.  Or at least it
    helps further refactorizations.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree.
    	* defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH.
    	* dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH.  Call
    	gdb_realpath_and_xfree.
    	* nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree and xstrdup.
    	* solib.c (solib_find_2): New variable temp_pathname_is_realpath.
    	Remove OPF_RETURN_REALPATH.  Conditionally call gdb_realpath_and_xfree.
    	* source.c (openp): Remove OPF_RETURN_REALPATH processing.
    	(source_full_path_of, find_and_open_source): Remove
    	OPF_RETURN_REALPATH.  Call gdb_realpath_and_xfree.
    	* symfile.c (symfile_bfd_open): Likewise.
    	* utils.c (gdb_realpath_and_xfree): New function.
    	* utils.h (gdb_realpath_and_xfree): New prototype.

commit 9190ee41e215de2239fb7fdfe1b350379e8fa406
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Add enum for openp_flags
    
    Hi,
    
    it is for many reasons better, in C++ it could be even type safe.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for
    	search_flags.
    	* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
    	Wrap them to a new ...
    	(enum openp_flags): ... enum.
    	(openp): Update prototype.
    	* dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags.
    	* source.c (openp): Update opts parameter type.  Move out OPF_*
    	comments.

commit 86c34d43e014fdde2a8ead404bccf250515a1c9b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Change sysroot to ":target:"
    
    Hi,
    
    that is try "" first and "target:" second.
    
    Various performance problems should be fixed by trying to look up the remote
    file first on local filesystem.  Thanks to build-ids it is quick and safe to
    verify both files are the same build.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention sysroot.
    	* main.c (captured_main): Initialize new gdb_sysroot.
    
    gdb/testsuite/ChangeLog
    
    	* gdb.base/attach.exp (do_attach_tests): Update sysroot parsing.
    	* gdb.base/break-probes.exp: Likewise.

commit 0e392b9bb75d77f7b72f4e774c50471c28f86f5d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Permit multiple sysroot directories
    
    Hi,
    
    the goal is to have both "" and "target:" as the default gdb_sysroot, in this
    order.  Therefore permit multiple directory components of gdb_sysroot.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot.
    	* solib.c: Include source.h.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here and change the sysroot variable to parameter.
    	(solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc.
    	* source.c (dirnames_to_char_ptr_vec_target_exc): New function.
    	* source.h (dirnames_to_char_ptr_vec_target_exc): New declaration.
    
    gdb/doc/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Permit set sysroot and show sysroot to have
    	multiple components.

commit 0a26b660f625479dd1b44f9399d8635f59496d25
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Code cleanup: Make solib_find_1 variable const
    
    Hi,
    
    it gets used in the next patch.
    
    
    Jan
    
    
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_find_1): Make sysroot variable const.

commit 940be657e23cd76a0ccf1a40bec9b2d2ee3a1fe3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Validate symbol file using build-id
    
    Consumer part of the "build-id" attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Validate symbol file using build-id.
    	* NEWS (Changes since GDB 7.10): Add 'set validate-build-id'
    	and 'show validate-build-id'.  Add build-id attribute.
    	* build-id.c: Include gdbcmd.h.
    	(validate_build_id, show_validate_build_id, _initialize_build_id): New.
    	* build-id.h (validate_build_id): New declaration.
    	* solib-svr4.c: Include rsp-low.h.
    	(svr4_copy_library_list): Duplicate field build_id.
    	(library_list_start_library): Parse 'build-id' attribute.
    	(svr4_library_attributes): Add 'build-id' attribute.
    	* solib.c (free_so): Free build_id.
    	* solist.h (struct so_list): New fields 'build_idsz' and 'build_id'.
    
    gdb/doc/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Add 'set validate-build-id'
    	and 'show validate-build-id'.

commit 3c14f41e452101f2b334e3457e192cdaf6399ab4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    gdbserver build-id attribute generator
    
    Producer part of the new "build-id" XML attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* features/library-list-svr4.dtd (library-list-svr4): New
    	'build-id' attribute.
    
    gdb/doc/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* gdb.texinfo (Library List Format for SVR4 Targets): Add
    	'build-id' in description, example, new attribute in dtd.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* linux-low.c (linux-maps.h, search.h, rsp-low.h): Include.
    	(ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
    	(ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
    	(find_phdr): New.
    	(get_dynamic): Use find_pdhr to traverse program headers.
    	(struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
    	(compare_mapping_entry_range, struct find_memory_region_callback_data)
    	(read_build_id, find_memory_region_callback, lrfind_mapping_entry)
    	(get_hex_build_id): New.
    	(linux_qxfer_libraries_svr4): Add optional build-id attribute
    	to reply XML document.

commit 4e740c7af8897af2135eccf99b462d66e21944a6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Move linux_find_memory_regions_full & co.
    
    This should be just a move with no changes.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Move linux_find_memory_regions_full & co.
    	* linux-tdep.c (linux-maps.h): Include.
    	(gdb_regex.h): Remove the include.
    	(enum filterflags, struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Moved to common/linux-maps.c.
    	(linux_find_memory_region_ftype): Moved typedef to common/linux-maps.h.
    	(linux_find_memory_regions_full): Moved definition to
    	common/linux-maps.c.
    	* common/linux-maps.c: Include ctype.h, target/target-utils.h,
    	gdb_regex.h and target/target.h.
    	(struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Move from linux-tdep.c.
    	(linux_find_memory_regions_full): Move from linux-tdep.c.
    	* common/linux-maps.h (read_mapping): New declaration.
    	(linux_find_memory_region_ftype, enum filterflags): Moved from
    	linux-tdep.c.
    	(linux_find_memory_regions_full): New declaration.
    	* target.c (target/target-utils.h): Include.
    	(read_alloc_pread_ftype): Moved typedef to target/target-utils.h.
    	(read_alloc, read_stralloc_func_ftype, read_stralloc): Moved
    	definitions to target/target-utils.c.
    	* target.h (target_fileio_read_stralloc): Move it to target/target.h.
    	* target/target-utils.c (read_alloc, read_stralloc): Move definitions
    	from target.c.
    	* target/target-utils.h (read_alloc_pread_ftype): New typedef.
    	(read_alloc): New declaration.
    	(read_stralloc_func_ftype): New typedef.
    	(read_stralloc): New declaration.
    	* target/target.h (target_fileio_read_stralloc): Move it from target.h.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* target.c: Include target/target-utils.h and fcntl.h.
    	(target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
    	(target_fileio_read_stralloc): New functions.

commit ee82cb85c7a59dc6a5dfcec0871a655e23212dc9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:49 2015 +0200

    Prepare linux_find_memory_regions_full & co. for move
    
    Prepare code for move into gdb/common/.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Prepare linux_find_memory_regions_full & co. for move.
    	* linux-tdep.c (linux_find_memory_region_ftype): Comment.
    	(linux_find_memory_regions_full): Change signature and prepare
    	for moving to linux-maps.
    	(linux_find_memory_regions_data): Rename field 'obfd' to 'data'.
    	(linux_find_memory_regions_thunk): New.
    	(linux_find_memory_regions_thunk): Use 'data' field instead of 'obfd'.
    	(linux_find_memory_regions_gdb): New.
    	(linux_find_memory_regions): Rename argument 'obfd' to 'func_data'.
    	(linux_make_mappings_corefile_notes): Use
    	linux_find_memory_regions_gdb.
    	* target.c (read_alloc_pread_ftype): New typedef.
    	(target_fileio_read_alloc_1_pread): New function.
    	(read_alloc): Refactor from target_fileio_read_alloc_1.
    	(read_stralloc_func_ftype): New typedef.
    	(target_fileio_read_alloc_1): New implementation. Use read_alloc.
    	(read_stralloc): Refactored from target_fileio_read_stralloc.
    	(target_fileio_read_stralloc): New implementation, use read_stralloc.

commit 916c08762b5f7b08d55982ed0e8425407a924a67
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:49 2015 +0200

    Move gdb_regex* to common/
    
    Later patches need regex support also in gdbserver.
    
    gdb/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (HFILES_NO_SRCDIR): Change gdb_regex.h to
    	common/gdb_regex.h.
    	(COMMON_OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* common/common.m4 (GDB_AC_COMMON): Add gdb_use_included_regex,
    	--without-included-regex and USE_INCLUDED_REGEX.
    	* common/gdb_regex.c: New file from utils.c functions.
    	* common/gdb_regex.h: Move it here from gdb_regex.h, update include
    	file wrapping define name.
    	* configure: Rebuilt.
    	* configure.ac (gdb_use_included_regex, --without-included-regex)
    	(USE_INCLUDED_REGEX): Move them to common/common.m4.
    	* gdb_regex.h: Move it to common/gdb_regex.h.
    	* utils.c: Remove include gdb_regex.h.
    	(do_regfree_cleanup, make_regfree_cleanup, get_regcomp_error)
    	(compile_rx_or_error): Move them to common/gdb_regex.c.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* config.in: Rebuilt.
    	* configure: Rebuilt.

commit 6061861af8d9249058b90c604068a4f3600cc324
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:49 2015 +0200

    Create empty common/linux-maps.[ch] and common/target-utils.[ch]
    
    Prepare new files for later move.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (ALL_TARGET_OBS): Add linux-maps.o.
    	(HFILES_NO_SRCDIR); Add common/linux-maps.h,
    	common/target-utils.h.
    	(COMMON_OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* target/target-utils.c: New file.
    	* target/target-utils.h: New file.
    	* common/linux-maps.c: New file.
    	* common/linux-maps.h: New file.
    	* configure.tgt (aarch64*-*-linux*, alpha*-*-linux*)
    	(am33_2.0*-*-linux*, arm*-*-linux*, bfin-*-*linux*, cris*, frv-*-*)
    	(hppa*-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
    	(m68*-*-linux*, microblaze*-linux-*, microblaze*-*-linux*)
    	(mips*-*-linux*, nios2*-*-linux*, powerpc*-*-linux*, s390*-*-linux*)
    	(sh*-*-linux*, sparc-*-linux*, sparc64-*-linux*, tic6x-*-*linux)
    	(tilegx-*-linux*, x86_64-*-linux*, xtensa*-*-linux*): Add linux-maps.o
    	to gdb_target_obs.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* configure.srv (srv_linux_obj): Add linux-maps.o.

commit 465a859e0a991d3bfe8a9ee65a29a223c42e2ce7
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Aug 21 19:52:36 2015 +0100

    Fix gdbserver crash exposed by gdb.threads/process-dies-while-handling-bp.exp
    
    Running that test in a loop, I found a gdbserver core dump with the
    following back trace:
    
     Core was generated by `../gdbserver/gdbserver --once --multi :2346'.
     Program terminated with signal SIGSEGV, Segmentation fault.
     #0  0x0000000000406ab6 in inferior_regcache_data (inferior=0x0) at src/gdb/gdbserver/inferiors.c:236
     236       return inferior->regcache_data;
     (gdb) up
     #1  0x0000000000406d7f in get_thread_regcache (thread=0x0, fetch=1) at src/gdb/gdbserver/regcache.c:31
     31        regcache = (struct regcache *) inferior_regcache_data (thread);
     (gdb) bt
     #0  0x0000000000406ab6 in inferior_regcache_data (inferior=0x0) at src/gdb/gdbserver/inferiors.c:236
     #1  0x0000000000406d7f in get_thread_regcache (thread=0x0, fetch=1) at src/gdb/gdbserver/regcache.c:31
     #2  0x0000000000409271 in prepare_resume_reply (buf=0x20dd593 "", ptid=..., status=0x20edce0) at src/gdb/gdbserver/remote-utils.c:1147
     #3  0x000000000040ab0a in vstop_notif_reply (event=0x20edcc0, own_buf=0x20dd590 "T05") at src/gdb/gdbserver/server.c:183
     #4  0x0000000000426b38 in notif_write_event (notif=0x66e6c0 <notif_stop>, own_buf=0x20dd590 "T05") at src/gdb/gdbserver/notif.c:69
     #5  0x0000000000426c55 in handle_notif_ack (own_buf=0x20dd590 "T05", packet_len=8) at src/gdb/gdbserver/notif.c:113
     #6  0x000000000041118f in handle_v_requests (own_buf=0x20dd590 "T05", packet_len=8, new_packet_len=0x7fff742c77b8)
         at src/gdb/gdbserver/server.c:2862
     #7  0x0000000000413850 in process_serial_event () at src/gdb/gdbserver/server.c:4148
     #8  0x0000000000413945 in handle_serial_event (err=0, client_data=0x0) at src/gdb/gdbserver/server.c:4196
     #9  0x000000000041a1ef in handle_file_event (event_file_desc=5) at src/gdb/gdbserver/event-loop.c:429
     #10 0x00000000004199b6 in process_event () at src/gdb/gdbserver/event-loop.c:184
     #11 0x000000000041a735 in start_event_loop () at src/gdb/gdbserver/event-loop.c:547
     #12 0x00000000004123d2 in captured_main (argc=4, argv=0x7fff742c7ac8) at src/gdb/gdbserver/server.c:3562
     #13 0x000000000041252e in main (argc=4, argv=0x7fff742c7ac8) at src/gdb/gdbserver/server.c:3631
    
    Clearly this means that a thread pushed a stop reply in the event
    queue, and then before GDB confused the event, the whole process died,
    along with its thread.  But the pending thread event was left
    dangling.  When GDB fetched that event, gdbserver looked up the
    corresponding thread, but found NULL; not expecting this, gdbserver
    crashes when it tries to read this thread's registers.
    
    gdb/gdbserver/
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	PR gdb/18749
    	* inferiors.c (remove_thread): Discard any pending stop reply for
    	this thread.
    	* server.c (remove_all_on_match_pid): Rename to ...
    	(remove_all_on_match_ptid): ... this.  Work with a filter ptid
    	instead of a pid.
    	(discard_queued_stop_replies): Change parameter to a ptid.  Now
    	extern.
    	(handle_v_kill, kill_inferior_callback)
    	(process_serial_event): Adjust.
    	(captured_main): Call initialize_notif before starting the
    	program, thus before threads are created.
    	* server.h (discard_queued_stop_replies): Declare.

commit f0db101d9897732d6556456e542d12ecf9e12e42
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Aug 21 19:20:31 2015 +0100

    gdbserver: don't pick a random thread if the current thread dies
    
    In all-stop mode, if the current thread disappears while stopping all
    threads, gdbserver calls set_desired_thread(0) ['0' means "I want the
    continue thread"] which just picks the first thread in the list.
    
    This looks like a dangerous thing to do.  GDBserver continues
    processing whatever it was doing, but to the wrong thread.  If
    debugging more than one process, we may even pick the wrong process.
    Instead, GDBserver should detect the situation and bail out of
    whatever is was doing.
    
    The backends used to pay attention to the set 'cont_thread' (the Hc
    thread, used in the old way to resume threads, before vCont), but all
    such 'cont_thread' checks have been eliminated meanwhile.  The
    remaining implicit dependencies that I found on there being a selected
    thread in the backends are in the Ctrl-C handling, which some backends
    use as thread to send a signal to.  Even that seems to me to be better
    handled by always using the first thread in the list or by using the
    signal_pid PID.
    
    In order to make this a systematic approach, I'm making
    set_desired_thread never fallback to a random thread, and instead end
    up with current_thread == NULL, like already done in non-stop mode.
    Then I updated all callers to handle the situation.
    
    I stumbled on this while fixing other bugs exposed by
    gdb.threads/fork-plus-threads.exp test.  The problems I saw were fixed
    in a different way, but in any case, I think the potential for
    problems is more or less obvious, and the resulting code looks a bit
    less magical to me.
    
    Tested on x86-64 Fedora 20, w/ native-extended-gdbserver board.
    
    gdb/gdbserver/ChangeLog:
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	* linux-low.c (wait_for_sigstop): Always switch to no thread
    	selected if the previously current thread dies.
    	* lynx-low.c (lynx_request_interrupt): Use the first thread's
    	process instead of the current thread's.
    	* remote-utils.c (input_interrupt): Don't check if there's no
    	current thread.
    	* server.c (gdb_read_memory, gdb_write_memory): If setting the
    	current thread to the general thread fails, error out.
    	(handle_qxfer_auxv, handle_qxfer_libraries)
    	(handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
    	(handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
    	(handle_query): Check if there's a thread selected instead of
    	checking whether there's any thread in the thread list.
    	(handle_qxfer_threads, handle_qxfer_btrace)
    	(handle_qxfer_btrace_conf): Don't error out early if there's no
    	thread in the thread list.
    	(handle_v_cont, myresume): Don't set the current thread to the
    	continue thread.
    	(process_serial_event) <Hg handling>: Also set thread_id if the
    	previous general thread is still alive.
    	(process_serial_event) <g/G handling>: If setting the current
    	thread to the general thread fails, error out.
    	* spu-low.c (spu_resume, spu_request_interrupt): Use the first
    	thread's lwp instead of the current thread's.
    	* target.c (set_desired_thread): If the desired thread was not
    	found, leave the current thread pointing to NULL.  Return an int
    	(boolean) indicating success.
    	* target.h (set_desired_thread): Change return type to int.

commit 2d7711a36720b0bc44fee20d0bf057614ead21c2
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Aug 21 17:10:24 2015 +0100

    Make remote file transfers interruptible
    
    This commit makes it possible to interrupt remote file transfers.

commit 4313b8c0ed5877feb5034bfff4056e1ccfe221f1
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Aug 21 17:09:20 2015 +0100

    Warn when accessing binaries from remote targets
    
    GDB provides no indicator of progress during file operations, and can
    appear to have locked up during slow remote transfers.  This commit
    updates GDB to print a warning each time a file is accessed over RSP.
    An additional message detailing how to avoid remote transfers is
    printed for the first transfer only.
    
    gdb/ChangeLog:
    
    	* target.h (struct target_ops) <to_fileio_open>: New argument
    	warn_if_slow.  Update comment.  All implementations updated.
    	(target_fileio_open_warn_if_slow): New declaration.
    	* target.c (target_fileio_open): Renamed as...
    	(target_fileio_open_1): ...this.  New argument warn_if_slow.
    	Pass warn_if_slow to implementation.  Update debug printing.
    	(target_fileio_open): New function.
    	(target_fileio_open_warn_if_slow): Likewise.
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open): Use new function
    	target_fileio_open_warn_if_slow.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.trace/pending.exp: Cope with remote transfer warnings.

commit f36b87190aed31b1ef7787e5966be542e8abdb58
Author: Gary Benson <gbenson@redhat.com>
Date:   Fri Aug 21 16:55:53 2015 +0100

    Fix stale cleanup left by linux_mntns_access_fs
    
    This commit fixes a stale cleanup left by linux_mntns_access_fs.
    
    gdb/ChangeLog:
    
    	* nat/linux-namespaces.c (linux_mntns_access_fs):
    	Do not overwrite old_chain.

commit d02603dc201f80cd9d2a1f4b1a16110b1e04222b
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Aug 21 16:42:14 2015 +0100

    Allow symbol and label names to be enclosed in double quotes.
    
    gas	PR gas/18581
    	* expr.c (get_symbol_end): Rename to get_symbol_name.  Add a
    	return parameter pointing to the start of the symbol.  Allow
    	symbol names enclosed in double quotes.
    	(restore_line_pointer): New function.  Replace the NUL character
    	inserted into the input stream with the given character.  If the
    	character was a double quote, advance the input pointer.
    	* expr.h (get_symbol_end): Delete.
    	(get_symbol_name): Add prototype.
    	(restore_line_pointer): Prototype.
    	* read.h (SKIP_WHITESPACE_AFTER_NAME): New macro.
    	* doc/as.texinfo (Symbol Intro): Document that symbol names can
    	now be enclosed in double quotes.
    	* cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name.
    	Use restore_line_pointer to replace the NUL in the input stream.
    	Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol.
    	Check for the use of double quoted symbol names.
    	* expr.c: Likewise.
    	* config/obj-aout.c: Likewise.
    	* config/obj-coff-seh.c: Likewise.
    	* config/obj-coff.c: Likewise.
    	* config/obj-elf.c: Likewise.
    	* config/obj-evax.c: Likewise.
    	* config/obj-macho.c: Likewise.
    	* config/obj-som.c: Likewise.
    	* config/tc-alpha.c: Likewise.
    	* config/tc-arc.c: Likewise.
    	* config/tc-arm.c: Likewise.
    	* config/tc-dlx.c: Likewise.
    	* config/tc-h8300.c: Likewise.
    	* config/tc-hppa.c: Likewise.
    	* config/tc-i370.c: Likewise.
    	* config/tc-i386-intel.c: Likewise.
    	* config/tc-i386.c: Likewise.
    	* config/tc-i960.c: Likewise.
    	* config/tc-ia64.c: Likewise.
    	* config/tc-iq2000.c: Likewise.
    	* config/tc-m32r.c: Likewise.
    	* config/tc-m68hc11.c: Likewise.
    	* config/tc-m68k.c: Likewise.
    	* config/tc-microblaze.c: Likewise.
    	* config/tc-mips.c: Likewise.
    	* config/tc-mmix.c: Likewise.
    	* config/tc-mn10200.c: Likewise.
    	* config/tc-mn10300.c: Likewise.
    	* config/tc-nios2.c: Likewise.
    	* config/tc-ppc.c: Likewise.
    	* config/tc-s390.c: Likewise.
    	* config/tc-score.c: Likewise.
    	* config/tc-score7.c: Likewise.
    	* config/tc-sparc.c: Likewise.
    	* config/tc-tic4x.c: Likewise.
    	* config/tc-tic54x.c: Likewise.
    	* config/tc-tic6x.c: Likewise.
    	* config/tc-tilegx.c: Likewise.
    	* config/tc-tilepro.c: Likewise.
    	* config/tc-v850.c: Likewise.
    	* config/tc-xtensa.c: Likewise.
    	* config/tc-z80.c: Likewise.
    	* dw2gencfi.c: Likewise.
    	* dwarf2dbgc.: Likewise.
    	* ecoff.c: Likewise.
    	* read.c: Likewise.
    	* stabs.c: Likewise.
    
    tests	PR gas/18581
    	* gas/all/byte.d: Disable this test.  Quoted expressions
    	are now allowed in .byte directives.
    	* gas/all/quoted-sym-names.s: New test.
    	* gas/all/quoted-sym-names.d: Expected output.
    	* gas/all/gas.exp: Run the new test.

commit 40045d91812b25c88c8275b8c08d27c234b68ba8
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Thu Jul 2 15:10:58 2015 +0300

    xtensa: implement NPTL helpers
    
    These changes allow debugging multithreaded NPTL xtensa applications.
    
    2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
    gdb/gdbserver/
    	* configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
    	* linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
    	#includes.
    	(ps_get_thread_area): New function.
    
    2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
    gdb/
    	* arch/xtensa.h: New file.
    	* xtensa-linux-nat.c (gdb_proc_service.h): New #include.
    	(ps_get_thread_area): New function.
    	* xtensa-linux-tdep.c (xtensa_linux_init_abi): Add call to
    	set_gdbarch_fetch_tls_load_module_address to enable TLS support.
    	* xtensa-tdep.c (osabi.h): New #include.
    	(xtensa_gdbarch_init): Call gdbarch_init_osabi to register
    	xtensa-specific hooks.
    	* xtensa-tdep.h (struct xtensa_elf_gregset_t): Add threadptr
    	member and move the structure to arch/xtensa.h.

commit ab4e4ed5dabc378c06ee647afd5793513393ae3f
Author: Alexander Fomin <alexander.fomin@intel.com>
Date:   Fri Aug 21 14:06:41 2015 +0300

    PR binutils/18257: Properly decode x86/Intel mask instructions.
    
    opcodes/
    
    	PR binutils/18257
    	* i386-dis.c: Use MOD_TABLE for most of mask instructions.
    	(MOD enum): Add MOD_VEX_W_0_0F41_P_0_LEN_1, MOD_VEX_W_1_0F41_P_0_LEN_1,
    	MOD_VEX_W_0_0F41_P_2_LEN_1, MOD_VEX_W_1_0F41_P_2_LEN_1,
    	MOD_VEX_W_0_0F42_P_0_LEN_1, MOD_VEX_W_1_0F42_P_0_LEN_1,
    	MOD_VEX_W_0_0F42_P_2_LEN_1, MOD_VEX_W_1_0F42_P_2_LEN_1,
    	MOD_VEX_W_0_0F44_P_0_LEN_1, MOD_VEX_W_1_0F44_P_0_LEN_1,
    	MOD_VEX_W_0_0F44_P_2_LEN_1, MOD_VEX_W_1_0F44_P_2_LEN_1,
    	MOD_VEX_W_0_0F45_P_0_LEN_1, MOD_VEX_W_1_0F45_P_0_LEN_1,
    	MOD_VEX_W_0_0F45_P_2_LEN_1, MOD_VEX_W_1_0F45_P_2_LEN_1,
    	MOD_VEX_W_0_0F46_P_0_LEN_1, MOD_VEX_W_1_0F46_P_0_LEN_1,
    	MOD_VEX_W_0_0F46_P_2_LEN_1, MOD_VEX_W_1_0F46_P_2_LEN_1,
    	MOD_VEX_W_0_0F47_P_0_LEN_1, MOD_VEX_W_1_0F47_P_0_LEN_1,
    	MOD_VEX_W_0_0F47_P_2_LEN_1, MOD_VEX_W_1_0F47_P_2_LEN_1,
    	MOD_VEX_W_0_0F4A_P_0_LEN_1, MOD_VEX_W_1_0F4A_P_0_LEN_1,
    	MOD_VEX_W_0_0F4A_P_2_LEN_1, MOD_VEX_W_1_0F4A_P_2_LEN_1,
    	MOD_VEX_W_0_0F4B_P_0_LEN_1, MOD_VEX_W_1_0F4B_P_0_LEN_1,
    	MOD_VEX_W_0_0F4B_P_2_LEN_1, MOD_VEX_W_0_0F91_P_0_LEN_0,
    	MOD_VEX_W_1_0F91_P_0_LEN_0, MOD_VEX_W_0_0F91_P_2_LEN_0,
    	MOD_VEX_W_1_0F91_P_2_LEN_0, MOD_VEX_W_0_0F92_P_0_LEN_0,
    	MOD_VEX_W_0_0F92_P_2_LEN_0, MOD_VEX_W_0_0F92_P_3_LEN_0,
    	MOD_VEX_W_1_0F92_P_3_LEN_0, MOD_VEX_W_0_0F93_P_0_LEN_0,
    	MOD_VEX_W_0_0F93_P_2_LEN_0, MOD_VEX_W_0_0F93_P_3_LEN_0,
    	MOD_VEX_W_1_0F93_P_3_LEN_0, MOD_VEX_W_0_0F98_P_0_LEN_0,
    	MOD_VEX_W_1_0F98_P_0_LEN_0, MOD_VEX_W_0_0F98_P_2_LEN_0,
    	MOD_VEX_W_1_0F98_P_2_LEN_0, MOD_VEX_W_0_0F99_P_0_LEN_0,
    	MOD_VEX_W_1_0F99_P_0_LEN_0, MOD_VEX_W_0_0F99_P_2_LEN_0,
    	MOD_VEX_W_1_0F99_P_2_LEN_0, MOD_VEX_W_0_0F3A30_P_2_LEN_0,
    	MOD_VEX_W_1_0F3A30_P_2_LEN_0, MOD_VEX_W_0_0F3A31_P_2_LEN_0,
    	MOD_VEX_W_1_0F3A31_P_2_LEN_0, MOD_VEX_W_0_0F3A32_P_2_LEN_0,
    	MOD_VEX_W_1_0F3A32_P_2_LEN_0, MOD_VEX_W_0_0F3A33_P_2_LEN_0,
    	MOD_VEX_W_1_0F3A33_P_2_LEN_0.
    	(vex_w_table): Replace terminals with MOD_TABLE entries for
    	most of mask instructions.
    
    gas/testsuite
    
    	PR binutils/18257
    	* gas/i386/disassem.s: Add mask instructions with invalid ModR/M byte.
    	* gas/i386/x86-64-disassem.s: Likewise.
    	* gas/i386/disassem.d: Updated.
    	* gas/i386/x86-64-disassem.d: Likewise.

commit 80152258b9dfe033828e5c5b6dc3252be1ba7a84
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Aug 21 10:13:27 2015 +0100

    Add readahead cache to gdb's vFile:pread
    
    This patch almost halves the time it takes to "target remote + run to
    main" on a higher-latency connection.
    
    E.g., I've got a ping time of ~85ms to an x86-64 machine on the gcc
    compile farm (almost 2000km away from me), and I'm behind a ~16Mbit
    ADSL.  When I connect to a gdbserver debugging itself on that machine
    and run to main, it takes almost 55 seconds:
    
     [palves@gcc76] $ ./gdbserver :9999 ./gdbserver
     [palves@home] $ ssh -L 9999:localhost:9999 gcc76.fsffrance.org
     [palves@home] $ time ./gdb -data-directory=data-directory -ex "tar rem :9999" -ex "b main" -ex "c" -ex "set confirm off" -ex "quit"
    
     Pristine gdb 7.10.50.20150820-cvs gets us:
     ...
     Remote debugging using :9999
     Reading symbols from target:/home/palves/gdb/build/gdb/gdbserver/gdbserver...done.
     Reading symbols from target:/lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
     0x00007ffff7ddd190 in ?? () from target:/lib64/ld-linux-x86-64.so.2
     Breakpoint 1 at 0x41200c: file ../../../src/gdb/gdbserver/server.c, line 3635.
     Continuing.
    
     Breakpoint 1, main (argc=1, argv=0x7fffffffe3d8) at ../../../src/gdb/gdbserver/server.c:3635
     3635    ../../../src/gdb/gdbserver/server.c: No such file or directory.
     /home/palves/gdb/build/gdb/gdbserver/gdbserver: No such file or directory.
    
     real    0m54.803s
     user    0m0.329s
     sys     0m0.064s
    
    While with the readahead cache added by this patch, it drops to:
    
     real    0m29.462s
     user    0m0.454s
     sys     0m0.054s
    
    I added a few counters to show cache hit/miss, and got:
    
     readahead cache miss 142
     readahead cache hit 310
    
    Tested on x86_64 Fedora 20.
    
    gdb/ChangeLog:
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	* remote.c (struct readahead_cache): New.
    	(struct remote_state) <readahead_cache>: New field.
    	(remote_open_1): Invalidate the cache.
    	(readahead_cache_invalidate, readahead_cache_invalidate_fd): New
    	functions.
    	(remote_hostio_pwrite): Invalidate the readahead cache.
    	(remote_hostio_pread): Rename to ...
    	(remote_hostio_pread_vFile): ... this.
    	(remote_hostio_pread_from_cache): New function.
    	(remote_hostio_pread): Reimplement.
    	(remote_hostio_close): Invalidate the readahead cache.

commit 88fc5eb7e23af132eacb895e475b31be0f7623e6
Author: Marcin Cieslak <saper@saper.info>
Date:   Wed Aug 19 16:51:31 2015 +0000

    procfs.c: Include "filestuff.h"
    
    Fixes implicit function declaration
    error in gdb/procfs.c:4927 about undeclared
    make_cleanup_close().
    
    gdb/ChangeLog:
    
    	PR build/18843
    	* procfs.c: Include "filestuff.h".

commit 6f1cb6eac2f28c6e1cb49c011f2b916afb90b4ff
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Tue Aug 18 21:08:57 2015 -0400

    Remove fields curch and cur_line from TUI_CMD_WIN
    
    These fields are currently used to track the location of the cursor
    inside the command window.  But their usefulness is questionable because
    ncurses already internally keeps track of the location of the cursor,
    whose coordinates we can query using the functions getyx(), getcurx() or
    getcury().  It is an unnecessary pain to keep these fields in sync with
    ncurses, and their meaning is not well-defined anyway.  For instance, it
    is not clear whether the coordinates held in these fields are
    authoritative, or whether the coordinates reported by ncurses are.
    
    So to keep things simple, this patch removes these fields and replaces
    existing reads of these fields with calls to the appropriate ncurses
    querying functions, and replaces writes to these fields with calls to
    wmove() (when necessary and applicable).
    
    In the function tui_cont_sig(), I removed the call to wmove() entirely
    because moving to (start_line, curch) makes no sense.  The move should
    have been to (cur_line, curch) -- which would now be a no-op.
    
    Tested on x86_64 Fedora 22, no obvious regressions.
    
    gdb/ChangeLog:
    
    	* tui/tui-data.h (tui_command_info): Remove fields cur_line and
    	curch.
    	* tui/tui-data.c (tui_clear_win_detail) [CMD_WIN]: Don't set
    	cur_line or curch, instead call wmove().
    	(init_win_info) [CMD_WIN]: Likewise.
    	* tui/tui-io.c (tui_puts): Likewise. Don't read cur_line,
    	instead call getcury().
    	(tui_redisplay_readline): Don't set cur_line or curch.
    	(tui_mld_erase_entire_line): Don't read cur_line, instead call
    	getcury().
    	(tui_cont_sig): Remove call to wmove.
    	(tui_getc): Don't read cur_line or curch, instead call getcury()
    	or getyx().  Don't set curch.
    	* tui/tui-win.c (make_visible_with_new_height) [CMD_WIN]: Don't
    	set cur_line or curch.  Always move cursor to (0,0).

commit 8e804db96b40c5c88d26b933fb19b6bfcfcb1101
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Fri Aug 21 00:00:07 2015 +0000

    Automatic date update in version.in

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

Summary of changes:
 bfd/version.h                            |    2 +-
 gas/ChangeLog                            |   67 +++++
 gas/NEWS                                 |    4 +
 gas/cond.c                               |    6 +-
 gas/config/obj-aout.c                    |   10 +-
 gas/config/obj-coff-seh.c                |   20 +-
 gas/config/obj-coff.c                    |   31 +--
 gas/config/obj-elf.c                     |   42 ++--
 gas/config/obj-evax.c                    |    5 +-
 gas/config/obj-macho.c                   |   20 +-
 gas/config/obj-som.c                     |    5 +-
 gas/config/tc-alpha.c                    |   90 +++---
 gas/config/tc-arc.c                      |   20 +-
 gas/config/tc-arm.c                      |   15 +-
 gas/config/tc-dlx.c                      |   10 +-
 gas/config/tc-h8300.c                    |    2 +-
 gas/config/tc-hppa.c                     |  193 +++++-------
 gas/config/tc-i370.c                     |    9 +-
 gas/config/tc-i386-intel.c               |   11 +-
 gas/config/tc-i386.c                     |   36 ++-
 gas/config/tc-i960.c                     |    5 +-
 gas/config/tc-ia64.c                     |  105 +++----
 gas/config/tc-iq2000.c                   |    5 +-
 gas/config/tc-m32r.c                     |   12 +-
 gas/config/tc-m68hc11.c                  |    5 +-
 gas/config/tc-m68k.c                     |   13 +-
 gas/config/tc-microblaze.c               |   13 +-
 gas/config/tc-mips.c                     |   51 ++--
 gas/config/tc-mmix.c                     |   26 +-
 gas/config/tc-mn10200.c                  |   37 +--
 gas/config/tc-mn10300.c                  |  103 ++++----
 gas/config/tc-nios2.c                    |    7 +-
 gas/config/tc-ppc.c                      |  126 +++-----
 gas/config/tc-s390.c                     |   29 +--
 gas/config/tc-score.c                    |   10 +-
 gas/config/tc-score7.c                   |   10 +-
 gas/config/tc-sparc.c                    |   21 +-
 gas/config/tc-tic4x.c                    |   51 ++--
 gas/config/tc-tic54x.c                   |   70 ++---
 gas/config/tc-tic6x.c                    |   13 +-
 gas/config/tc-tilegx.c                   |   31 +-
 gas/config/tc-tilepro.c                  |    5 +-
 gas/config/tc-v850.c                     |   68 ++---
 gas/config/tc-xtensa.c                   |    8 +-
 gas/config/tc-z80.c                      |    7 +-
 gas/doc/as.texinfo                       |    7 +-
 gas/dw2gencfi.c                          |   30 +-
 gas/dwarf2dbg.c                          |   13 +-
 gas/ecoff.c                              |   50 ++--
 gas/expr.c                               |   78 ++++--
 gas/expr.h                               |    3 +-
 gas/read.c                               |  160 +++++-----
 gas/read.h                               |   10 +
 gas/stabs.c                              |    5 +-
 gas/testsuite/ChangeLog                  |   17 +
 gas/testsuite/gas/all/byte.d             |    5 +-
 gas/testsuite/gas/all/gas.exp            |    2 +
 gas/testsuite/gas/all/quoted-sym-names.d |    6 +
 gas/testsuite/gas/all/quoted-sym-names.s |    4 +
 gas/testsuite/gas/i386/disassem.d        |  332 +++++++++++++++++++++-
 gas/testsuite/gas/i386/disassem.s        |  166 +++++++++++
 gas/testsuite/gas/i386/x86-64-disassem.d |  332 +++++++++++++++++++++-
 gas/testsuite/gas/i386/x86-64-disassem.s |  166 +++++++++++
 gas/testsuite/gas/ia64/group-1.d         |    2 +-
 gdb/ChangeLog                            |   72 +++++
 gdb/arch/xtensa.h                        |   46 +++
 gdb/gdb_bfd.c                            |   11 +-
 gdb/gdbserver/ChangeLog                  |   52 ++++
 gdb/gdbserver/configure.srv              |    1 +
 gdb/gdbserver/inferiors.c                |    1 +
 gdb/gdbserver/linux-low.c                |   16 +-
 gdb/gdbserver/linux-xtensa-low.c         |   21 ++
 gdb/gdbserver/lynx-low.c                 |    2 +-
 gdb/gdbserver/remote-utils.c             |    2 +-
 gdb/gdbserver/server.c                   |  102 ++++---
 gdb/gdbserver/server.h                   |    3 +
 gdb/gdbserver/spu-low.c                  |    9 +-
 gdb/gdbserver/target.c                   |    8 +-
 gdb/gdbserver/target.h                   |    2 +-
 gdb/inf-child.c                          |    3 +-
 gdb/linux-nat.c                          |    3 +-
 gdb/nat/linux-namespaces.c               |    2 +-
 gdb/procfs.c                             |    1 +
 gdb/remote.c                             |  165 ++++++++++-
 gdb/target.c                             |   38 ++-
 gdb/target.h                             |   17 +-
 gdb/testsuite/ChangeLog                  |    4 +
 gdb/testsuite/gdb.trace/pending.exp      |    8 +-
 gdb/tui/tui-data.c                       |    5 +-
 gdb/tui/tui-data.h                       |    2 -
 gdb/tui/tui-io.c                         |   36 +--
 gdb/tui/tui-win.c                        |    6 +-
 gdb/xtensa-linux-nat.c                   |   22 ++
 gdb/xtensa-linux-tdep.c                  |    4 +
 gdb/xtensa-tdep.c                        |    4 +
 gdb/xtensa-tdep.h                        |   24 +--
 opcodes/ChangeLog                        |   37 +++
 opcodes/i386-dis.c                       |  472 ++++++++++++++++++++++++++----
 98 files changed, 2885 insertions(+), 1133 deletions(-)
 create mode 100644 gas/testsuite/gas/all/quoted-sym-names.d
 create mode 100644 gas/testsuite/gas/all/quoted-sym-names.s
 create mode 100644 gdb/arch/xtensa.h

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index 737b89a..a00b9d7 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20150820
+#define BFD_VERSION_DATE 20150821
 #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/gas/ChangeLog b/gas/ChangeLog
index 5714982..3bcd8e6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,70 @@
+2015-08-21  Nick Clifton  <nickc@redhat.com>
+
+	PR gas/18581
+	* expr.c (get_symbol_end): Rename to get_symbol_name.  Add a
+	return parameter pointing to the start of the symbol.  Allow
+	symbol names enclosed in double quotes.
+	(restore_line_pointer): New function.  Replace the NUL character
+	inserted into the input stream with the given character.  If the
+	character was a double quote, advance the input pointer.
+	* expr.h (get_symbol_end): Delete.
+	(get_symbol_name): Add prototype.
+	(restore_line_pointer): Prototype.
+	* read.h (SKIP_WHITESPACE_AFTER_NAME): New macro.
+	* doc/as.texinfo (Symbol Intro): Document that symbol names can
+	now be enclosed in double quotes.
+	* cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name.
+	Use restore_line_pointer to replace the NUL in the input stream.
+	Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol.
+	Check for the use of double quoted symbol names.
+	* expr.c: Likewise.
+	* config/obj-aout.c: Likewise.
+	* config/obj-coff-seh.c: Likewise.
+	* config/obj-coff.c: Likewise.
+	* config/obj-elf.c: Likewise.
+	* config/obj-evax.c: Likewise.
+	* config/obj-macho.c: Likewise.
+	* config/obj-som.c: Likewise.
+	* config/tc-alpha.c: Likewise.
+	* config/tc-arc.c: Likewise.
+	* config/tc-arm.c: Likewise.
+	* config/tc-dlx.c: Likewise.
+	* config/tc-h8300.c: Likewise.
+	* config/tc-hppa.c: Likewise.
+	* config/tc-i370.c: Likewise.
+	* config/tc-i386-intel.c: Likewise.
+	* config/tc-i386.c: Likewise.
+	* config/tc-i960.c: Likewise.
+	* config/tc-ia64.c: Likewise.
+	* config/tc-iq2000.c: Likewise.
+	* config/tc-m32r.c: Likewise.
+	* config/tc-m68hc11.c: Likewise.
+	* config/tc-m68k.c: Likewise.
+	* config/tc-microblaze.c: Likewise.
+	* config/tc-mips.c: Likewise.
+	* config/tc-mmix.c: Likewise.
+	* config/tc-mn10200.c: Likewise.
+	* config/tc-mn10300.c: Likewise.
+	* config/tc-nios2.c: Likewise.
+	* config/tc-ppc.c: Likewise.
+	* config/tc-s390.c: Likewise.
+	* config/tc-score.c: Likewise.
+	* config/tc-score7.c: Likewise.
+	* config/tc-sparc.c: Likewise.
+	* config/tc-tic4x.c: Likewise.
+	* config/tc-tic54x.c: Likewise.
+	* config/tc-tic6x.c: Likewise.
+	* config/tc-tilegx.c: Likewise.
+	* config/tc-tilepro.c: Likewise.
+	* config/tc-v850.c: Likewise.
+	* config/tc-xtensa.c: Likewise.
+	* config/tc-z80.c: Likewise.
+	* dw2gencfi.c: Likewise.
+	* dwarf2dbgc.: Likewise.
+	* ecoff.c: Likewise.
+	* read.c: Likewise.
+	* stabs.c: Likewise.
+
 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
 
 	* config/tc-aarch64.c (reloc_table): New relocation types support for
diff --git a/gas/NEWS b/gas/NEWS
index 02a8d00..13a1911 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -2,6 +2,10 @@
 
 Changes in 2.26:
 
+* Symbol and label names can now be enclosed in double quotes (") which allows
+  them to contain characters that are not part of valid symbol names in high
+  level languages.
+
 * Added the correctly spelled -march=armv6kz, for ARMv6KZ support.  The
   previous spelling, -march=armv6zk, is still accepted.
 
diff --git a/gas/cond.c b/gas/cond.c
index 2649976..e3b30f0 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -77,7 +77,7 @@ s_ifdef (int test_defined)
   SKIP_WHITESPACE ();
   name = input_line_pointer;
 
-  if (!is_name_beginner (*name))
+  if (!is_name_beginner (*name) && *name != '"')
     {
       as_bad (_("invalid identifier for \".ifdef\""));
       obstack_1grow (&cond_obstack, 0);
@@ -85,9 +85,9 @@ s_ifdef (int test_defined)
       return;
     }
 
-  c = get_symbol_end ();
+  c = get_symbol_name (& name);
   symbolP = symbol_find (name);
-  *input_line_pointer = c;
+  (void) restore_line_pointer (c);
 
   initialize_cframe (&cframe);
 
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c
index 5500ac9..401b3a7 100644
--- a/gas/config/obj-aout.c
+++ b/gas/config/obj-aout.c
@@ -152,10 +152,9 @@ obj_aout_weak (int ignore ATTRIBUTE_UNUSED)
 
   do
     {
-      name = input_line_pointer;
-      c = get_symbol_end ();
+      c = get_symbol_name (&name);
       symbolP = symbol_find_or_make (name);
-      *input_line_pointer = c;
+      (void) restore_line_pointer (c);
       SKIP_WHITESPACE ();
       S_SET_WEAK (symbolP);
       if (c == ',')
@@ -182,10 +181,9 @@ obj_aout_type (int ignore ATTRIBUTE_UNUSED)
   int c;
   symbolS *sym;
 
-  name = input_line_pointer;
-  c = get_symbol_end ();
+  c = get_symbol_name (&name);
   sym = symbol_find_or_make (name);
-  *input_line_pointer = c;
+  (void) restore_line_pointer (c);
   SKIP_WHITESPACE ();
   if (*input_line_pointer == ',')
     {
diff --git a/gas/config/obj-coff-seh.c b/gas/config/obj-coff-seh.c
index 2ffefa8..ec53585 100644
--- a/gas/config/obj-coff-seh.c
+++ b/gas/config/obj-coff-seh.c
@@ -329,8 +329,7 @@ obj_coff_seh_handler (int what ATTRIBUTE_UNUSED)
 
   if (*input_line_pointer == '@')
     {
-      symbol_name = input_line_pointer;
-      name_end = get_symbol_end ();
+      name_end = get_symbol_name (&symbol_name);
 
       seh_ctx_cur->handler.X_op = O_constant;
       seh_ctx_cur->handler.X_add_number = 0;
@@ -343,7 +342,7 @@ obj_coff_seh_handler (int what ATTRIBUTE_UNUSED)
       else
 	as_bad (_("unknown constant value '%s' for handler"), symbol_name);
 
-      *input_line_pointer = name_end;
+      (void) restore_line_pointer (name_end);
     }
   else
     expression (&seh_ctx_cur->handler);
@@ -359,8 +358,7 @@ obj_coff_seh_handler (int what ATTRIBUTE_UNUSED)
     {
       do
 	{
-	  symbol_name = input_line_pointer;
-	  name_end = get_symbol_end ();
+	  name_end = get_symbol_name (&symbol_name);
 
 	  if (strcasecmp (symbol_name, "@unwind") == 0)
 	    seh_ctx_cur->handler_flags |= UNW_FLAG_UHANDLER;
@@ -369,7 +367,7 @@ obj_coff_seh_handler (int what ATTRIBUTE_UNUSED)
 	  else
 	    as_bad (_(".seh_handler constant '%s' unknown"), symbol_name);
 
-	  *input_line_pointer = name_end;
+	  (void) restore_line_pointer (name_end);
 	}
       while (skip_whitespace_and_comma (0));
     }
@@ -454,10 +452,9 @@ obj_coff_seh_proc (int what ATTRIBUTE_UNUSED)
 
   SKIP_WHITESPACE ();
 
-  symbol_name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&symbol_name);
   seh_ctx_cur->func_name = xstrdup (symbol_name);
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   demand_empty_rest_of_line ();
 
@@ -549,14 +546,13 @@ seh_x64_read_reg (const char *directive, int kind)
   SKIP_WHITESPACE ();
   if (*input_line_pointer == '%')
     ++input_line_pointer;
-  symbol_name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (& symbol_name);
 
   for (i = 0; i < 16; i++)
     if (! strcasecmp (regs[i], symbol_name))
       break;
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   /* Error if register not found, or EAX used as a frame pointer.  */
   if (i == 16 || (kind == 0 && i == 0))
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 449cb4f..c0a3f1f 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -603,8 +603,7 @@ obj_coff_def (int what ATTRIBUTE_UNUSED)
 
   SKIP_WHITESPACES ();
 
-  symbol_name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&symbol_name);
   symbol_name_length = strlen (symbol_name);
   symbol_name_copy = xmalloc (symbol_name_length + 1);
   strcpy (symbol_name_copy, symbol_name);
@@ -620,7 +619,7 @@ obj_coff_def (int what ATTRIBUTE_UNUSED)
   if (S_IS_STRING (def_symbol_in_progress))
     SF_SET_STRING (def_symbol_in_progress);
 
-  *input_line_pointer = name_end;
+  (void) restore_line_pointer (name_end);
 
   demand_empty_rest_of_line ();
 }
@@ -973,8 +972,7 @@ obj_coff_tag (int ignore ATTRIBUTE_UNUSED)
     }
 
   S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1);
-  symbol_name = input_line_pointer;
-  name_end = get_symbol_end ();
+  name_end = get_symbol_name (&symbol_name);
 
 #ifdef tc_canonicalize_symbol_name
   symbol_name = tc_canonicalize_symbol_name (symbol_name);
@@ -988,8 +986,8 @@ obj_coff_tag (int ignore ATTRIBUTE_UNUSED)
     as_warn (_("tag not found for .tag %s"), symbol_name);
 
   SF_SET_TAGGED (def_symbol_in_progress);
-  *input_line_pointer = name_end;
 
+  (void) restore_line_pointer (name_end);
   demand_empty_rest_of_line ();
 }
 
@@ -1024,11 +1022,11 @@ obj_coff_val (int ignore ATTRIBUTE_UNUSED)
 
   if (is_name_beginner (*input_line_pointer))
     {
-      char *symbol_name = input_line_pointer;
-      char name_end = get_symbol_end ();
+      char *symbol_name;
+      char name_end = get_symbol_name (&symbol_name);
 
 #ifdef tc_canonicalize_symbol_name
-  symbol_name = tc_canonicalize_symbol_name (symbol_name);
+      symbol_name = tc_canonicalize_symbol_name (symbol_name);
 #endif
       if (streq (symbol_name, "."))
 	{
@@ -1059,7 +1057,7 @@ obj_coff_val (int ignore ATTRIBUTE_UNUSED)
 	}
       /* Otherwise, it is the name of a non debug symbol and its value
          will be calculated later.  */
-      *input_line_pointer = name_end;
+      (void) restore_line_pointer (name_end);
     }
   else
     {
@@ -1170,8 +1168,7 @@ obj_coff_weak (int ignore ATTRIBUTE_UNUSED)
 
   do
     {
-      name = input_line_pointer;
-      c = get_symbol_end ();
+      c = get_symbol_name (&name);
       if (*name == 0)
 	{
 	  as_warn (_("badly formed .weak directive ignored"));
@@ -1181,7 +1178,7 @@ obj_coff_weak (int ignore ATTRIBUTE_UNUSED)
       c = 0;
       symbolP = symbol_find_or_make (name);
       *input_line_pointer = c;
-      SKIP_WHITESPACE ();
+      SKIP_WHITESPACE_AFTER_NAME ();
       S_SET_WEAK (symbolP);
 
       if (c == ',')
@@ -1564,15 +1561,11 @@ obj_coff_section (int ignore ATTRIBUTE_UNUSED)
       return;
     }
 
-  section_name = input_line_pointer;
-  c = get_symbol_end ();
-
+  c = get_symbol_name (&section_name);
   name = xmalloc (input_line_pointer - section_name + 1);
   strcpy (name, section_name);
-
   *input_line_pointer = c;
-
-  SKIP_WHITESPACE ();
+  SKIP_WHITESPACE_AFTER_NAME ();
 
   exp = 0;
   flags = SEC_NO_FLAGS;
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 08ae853..031fafb 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -406,11 +406,10 @@ get_sym_from_input_line_and_check (void)
   char c;
   symbolS *sym;
 
-  name = input_line_pointer;
-  c = get_symbol_end ();
+  c = get_symbol_name (& name);
   sym = symbol_find_or_make (name);
   *input_line_pointer = c;
-  SKIP_WHITESPACE ();
+  SKIP_WHITESPACE_AFTER_NAME ();
 
   /* There is no symbol name if input_line_pointer has not moved.  */
   if (name == input_line_pointer)
@@ -1043,9 +1042,9 @@ obj_elf_section (int push)
 		}
 	      else if (c == '@' || c == '%')
 		{
-		  beg = ++input_line_pointer;
-		  c = get_symbol_end ();
-		  *input_line_pointer = c;
+		  ++input_line_pointer;
+		  c = get_symbol_name (& beg);
+		  (void) restore_line_pointer (c);
 		  type = obj_elf_section_type (beg, input_line_pointer - beg, TRUE);
 		}
 	      else
@@ -1125,9 +1124,9 @@ obj_elf_section (int push)
 		  ignore_rest_of_line ();
 		  return;
 		}
-	      beg = ++input_line_pointer;
-	      c = get_symbol_end ();
-	      *input_line_pointer = c;
+	      ++input_line_pointer;
+	      c = get_symbol_name (& beg);
+	      (void) restore_line_pointer (c);
 
 	      attr |= obj_elf_section_word (beg, input_line_pointer - beg, & type);
 
@@ -1319,19 +1318,18 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED)
 
   ++input_line_pointer;
   SKIP_WHITESPACE ();
-  name = input_line_pointer;
 
   /* Temporarily include '@' in symbol names.  */
   old_lexat = lex_type[(unsigned char) '@'];
   lex_type[(unsigned char) '@'] |= LEX_NAME;
-  c = get_symbol_end ();
+  c = get_symbol_name (& name);
   lex_type[(unsigned char) '@'] = old_lexat;
 
   if (symbol_get_obj (sym)->versioned_name == NULL)
     {
       symbol_get_obj (sym)->versioned_name = xstrdup (name);
 
-      *input_line_pointer = c;
+      (void) restore_line_pointer (c);
 
       if (strchr (symbol_get_obj (sym)->versioned_name,
 		  ELF_VER_CHR) == NULL)
@@ -1354,7 +1352,7 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED)
 	  return;
 	}
 
-      *input_line_pointer = c;
+      (void) restore_line_pointer (c);
     }
 
   demand_empty_rest_of_line ();
@@ -1374,8 +1372,7 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
   if (*input_line_pointer == '#')
     ++input_line_pointer;
 
-  cname = input_line_pointer;
-  c = get_symbol_end ();
+  c = get_symbol_name (& cname);
   csym = symbol_find (cname);
 
   /* GCFIXME: should check that we don't have two .vtable_inherits for
@@ -1391,7 +1388,7 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
 
   *input_line_pointer = c;
 
-  SKIP_WHITESPACE ();
+  SKIP_WHITESPACE_AFTER_NAME ();
   if (*input_line_pointer != ',')
     {
       as_bad (_("expected comma after name in .vtable_inherit"));
@@ -1414,10 +1411,9 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED)
     }
   else
     {
-      pname = input_line_pointer;
-      c = get_symbol_end ();
+      c = get_symbol_name (& pname);
       psym = symbol_find_or_make (pname);
-      *input_line_pointer = c;
+      restore_line_pointer (c);
     }
 
   demand_empty_rest_of_line ();
@@ -1767,15 +1763,15 @@ obj_elf_version (int ignore ATTRIBUTE_UNUSED)
 static void
 obj_elf_size (int ignore ATTRIBUTE_UNUSED)
 {
-  char *name = input_line_pointer;
-  char c = get_symbol_end ();
+  char *name;
+  char c = get_symbol_name (&name);
   char *p;
   expressionS exp;
   symbolS *sym;
 
   p = input_line_pointer;
   *p = c;
-  SKIP_WHITESPACE ();
+  SKIP_WHITESPACE_AFTER_NAME ();
   if (*input_line_pointer != ',')
     {
       *p = 0;
@@ -1847,7 +1843,7 @@ obj_elf_type_name (char *cp)
       *input_line_pointer = '\0';
     }
   else
-    *cp = get_symbol_end ();
+    *cp = get_symbol_name (&p);
 
   return p;
 }
diff --git a/gas/config/obj-evax.c b/gas/config/obj-evax.c
index b3702ef..b712e13 100644
--- a/gas/config/obj-evax.c
+++ b/gas/config/obj-evax.c
@@ -60,10 +60,9 @@ s_evax_weak (int ignore ATTRIBUTE_UNUSED)
 
   do
     {
-      name = input_line_pointer;
-      c = get_symbol_end ();
+      c = get_symbol_name (&name);
       symbolP = symbol_find_or_make (name);
-      *input_line_pointer = c;
+      (void) restore_line_pointer (c);
       SKIP_WHITESPACE ();
       S_SET_WEAK (symbolP);
       if (c == ',')
diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c
index 10e8dbf..d0a4053 100644
--- a/gas/config/obj-macho.c
+++ b/gas/config/obj-macho.c
@@ -475,8 +475,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED)
 
       input_line_pointer++; /* Skip ',' */
       SKIP_WHITESPACE ();
-      name = input_line_pointer;
-      c = get_symbol_end ();
+      c = get_symbol_name (&name);
       /* Just after name is now '\0'.  */
       p = input_line_pointer;
       *p = c;
@@ -488,7 +487,7 @@ obj_mach_o_zerofill (int ignore ATTRIBUTE_UNUSED)
 	  goto done;
 	}


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  jankratochvil/gdbserverbuildid: Support build-id for main executables
@ 2015-08-25 19:07 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2015-08-25 19:07 UTC (permalink / raw)
  To: archer-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 133402 bytes --]

The branch, jankratochvil/gdbserverbuildid has been updated
  discards  9d526416f035a6d567c0a75ad10f61d67b91debf (commit)
  discards  a6d283fe348dbafbccd88da6b7099b31fa4126d5 (commit)
  discards  efb71ced9ef12350e058619d3650c6ab7a1dfef0 (commit)
  discards  7c3dd94e53ba20bc11e098769a141af3f14577df (commit)
  discards  5cf3c5364b0f2cba7ad361249cfd6ff99aa8d53e (commit)
  discards  daae6fc4931db1b4db2594d8e887ad7f7984fe23 (commit)
  discards  5c5d66bbc85470417f3d7ee0090054892ca4f0f0 (commit)
  discards  c35b25ff57933441e00c6addddcf0ef76ec4ae46 (commit)
  discards  a69b2e74ab27ba3afd7295f70a055077b348e43a (commit)
  discards  dd0075e027a00de63a3fcda35d82ebd78b8d7d19 (commit)
  discards  1768eace6960d429a857a2001c7c03434cdb645f (commit)
  discards  c1319b6c65880a7b8e555591c363026e1963f9ab (commit)
  discards  be1f700d55efd36f999ce06c775ae45da58c657c (commit)
  discards  f3631298bda92030bd47a85f64ade40b3c058e80 (commit)
  discards  4edc3608dd24ab35ee638dbf1a2fa60eb5f3d14b (commit)
  discards  df951efc0fcc567655b25f191d42b79fb0a4cd6b (commit)
  discards  2cea39c30f7a8a6e244f4f6c80c8bbeb412a0527 (commit)
  discards  2700a11a5c5abeb4a28e5e98bdf840dafa46262f (commit)
  discards  b84ef18752bbeb8aed01bd1738177c4927e9ffe9 (commit)
  discards  c13173c2eb639887985adbf0a6be994b7fd26781 (commit)
  discards  ec55f3085ced8407ec8a372dfed7f7cf3490a625 (commit)
  discards  154d3aa120e9a2ed255e4ea0f9c0bd0d092c0e77 (commit)
  discards  7e0bdfa3a966e5d1d2388a1ca064a1e9e0713220 (commit)
  discards  b5d2b733dfe3ebf72136400d76bd2c5c4ef72f56 (commit)
  discards  885cf907c1222da14b31c8e36cbaaca4dadfd737 (commit)
  discards  d3de81222038fdc9744a62368cb7d822812f7a61 (commit)
  discards  91ced4b77535b97c67a3eaa1ca52a1622d82a539 (commit)
  discards  3c14f41e452101f2b334e3457e192cdaf6399ab4 (commit)
  discards  4e740c7af8897af2135eccf99b462d66e21944a6 (commit)
  discards  ee82cb85c7a59dc6a5dfcec0871a655e23212dc9 (commit)
  discards  916c08762b5f7b08d55982ed0e8425407a924a67 (commit)
  discards  6061861af8d9249058b90c604068a4f3600cc324 (commit)
       via  d99e54cbaa83585d4bdc557b10d8205f9ee0c2bf (commit)
       via  01da7c01ec1e471365f400750281b4203391ced4 (commit)
       via  adb7552ccb05c06beb2206781096941ed7f82d98 (commit)
       via  6ab2e5bc9724ebe52a3af5e65fe4a3fdcf8322ab (commit)
       via  d8e8defc149923e8681c102859f88148920231fb (commit)
       via  31525e5877ccb83604e971922a2df318a42dac01 (commit)
       via  85f9a15b425c54da58036de2ce14dcfdd9263662 (commit)
       via  fe533db9feb1245389a609bf0d608b598864b97e (commit)
       via  e150dd333417704e098e49e956aa7bad62f90bc5 (commit)
       via  147927668e1af6fe08cd7fd66c1b7067f1127896 (commit)
       via  ef8f40015e7ba2b0121bdf5fb7df22c477878bc2 (commit)
       via  f9b4ab1e97117468ef757d9c2172bf67f6861b4f (commit)
       via  deb941292b4704a55b5716b25db5eb37fdc9decd (commit)
       via  78196e2d0b860fa2fa5e3e12a26966d0d86746e3 (commit)
       via  ee826afa4082d831819e959c78f70f87fbb3887c (commit)
       via  41744ddd2eb4c1c3d739b4ae072ec7555d627b0e (commit)
       via  43ed69c3939b6ddf70f8adeee9b12e7ea7f0bcd4 (commit)
       via  b0ff8fd19664b4accddde8b198ebdf7d4db9479c (commit)
       via  08e8ab00fb10cf2ace96879af72bb505b09abb4e (commit)
       via  ad21a771aef7bc9d3f8384a6535a696a264d3b67 (commit)
       via  e8bc24fccbbecf1de9137d6c3ed09893e67f963c (commit)
       via  184eca8d09fadf7a7f9200a12401346b4cabe313 (commit)
       via  f86c25c91946c70e5ace8256a2ea901c5c292569 (commit)
       via  44c01eb2a9984e94bc25483829e473e37206ada1 (commit)
       via  0ebe17076406a85a35eb0c4f362850ed9efb843e (commit)
       via  7b4dd1456b3c285b1e65dcae65c0ab6c53896991 (commit)
       via  03d470b67389d35a14a122d2c74c982487779d7a (commit)
       via  7b852ff6e5f327a01e6d2ef9f8c3d840f1874373 (commit)
       via  769819ca7bc9c987e4d3ac4c2da81ec5412d6e58 (commit)
       via  585aca87aa8a2f7a30840ad1bc3fce08a877371e (commit)
       via  47c5d88029a42bd629e933da0a61e7bf8e9ccbbe (commit)
       via  fe4882f5dd484d3bb8d9a53d5977ee318ecc1848 (commit)
       via  16ad13eca4a18139cd1dec214ec83fdc7c47ffda (commit)
       via  cdbfb8861732b496b9ee35b130af75b245e2bc02 (commit)
       via  abc56d60aacccb64e146eb7a245b3ca2cea52dd9 (commit)
       via  38074311927d012e4cbd28d825878974c9209f77 (commit)
       via  dfe7f77c4aae3376c175d8af4d477124c8817427 (commit)
       via  63e43d3aedb8b1112899c2d0ad74cbbee687e5d6 (commit)
       via  7c2bea1ad1c779b893eb9cad4c92732583ae0eb5 (commit)
       via  ed8b7b421c98533b9b08995edd7363328b55921e (commit)
       via  db3cb7cb3e51e5eb834412adbf90e81bb76846c6 (commit)
       via  f6011a1c84b1bd616617bfde84dca63f250c950d (commit)
       via  88e2cf7ee25c72bce35ebe59b13c9701abce9fee (commit)
       via  5e35436ed12617494d2a2d190e0faca5613a2e9f (commit)
       via  75e1f0f7a0992835415e9bb924ec21a9aac6d5a1 (commit)
       via  4a8a7965f233f571b78f7992292a31c990c15a5e (commit)
       via  32a271eeaf1b1be1367b6ea181a0f39a3da71d45 (commit)
       via  0d51c8d71c19531bf29a3ba303c040c7c772a4a1 (commit)
       via  5e137137b2ff267fbf33b1e47f0413292ccb40d6 (commit)
       via  31a43dd5e1cfb8bb387885b3f641d6d2c04ac5dd (commit)
       via  8ee525679d030cd2c35eaee3b8d4ac545c5dc8ee (commit)
       via  ff3f0f45c5ff3505d041eba81a999b55c55f4530 (commit)
       via  9a117542138b8fa4a6ca9c7b4cf9935d509b9809 (commit)
       via  3d40fbb53b4478d94b6fa5abad0796cec5d5db49 (commit)
       via  73b8c1fda9f3759874a9a1a7e7402276da057153 (commit)
       via  4a626d0a0f451c3288a461f64a9f8a49790d422b (commit)
       via  438e1e427e8393de73d22617abe4d8eba0270e72 (commit)
       via  a8c6d4fcd6b2a30c2b5b87d656ce035dcf8b0035 (commit)
       via  4422ac93e5d3d23dd441aadaa49c81356aa59b73 (commit)
       via  91dddb86299bba404599551e9e2633b3c0e5c830 (commit)
       via  a48847eea5f39c1f9fbe4255c9e892647f13f995 (commit)
       via  0ebbc52beef41c725f75b22c80a37fee00303bb0 (commit)
       via  bb61542818398aa00f869257c0734ffdc39275b5 (commit)
       via  40e0b27177e747600d3ec186458fe0e482a1cf77 (commit)
       via  5f40e14d768b94f7fdc050aeba5ee62e6a8d5756 (commit)
       via  77c365df78441f7b968ec0f62c7ed9f5de36dc60 (commit)
       via  cfe101c6a8227b6b97ed2da85895db7d6083bfa6 (commit)
       via  b83035f1f61c8749983aef1f51162947a284827d (commit)
       via  5f329d5b1409dfb86e3eb6a22e9f84cc58c254b1 (commit)
       via  d579c450dd97470b0601ceb5d3e3d926e7a1333e (commit)
       via  595bce7595e076391e7147b0c6db57a8edf2e406 (commit)
       via  0d6b12851b08f5f71f7d97d2c832b899d63b5df2 (commit)
       via  99b0bb12cdb22489b403df6afe992b81bebbd9ec (commit)
       via  f8904751117dc8d4d04e5c5286b71b854e6ebba5 (commit)
       via  049412e38f9ac04654940173db63a37ebca9bfc3 (commit)
       via  948578a989f8c666c9b0e92c9a50906724921f14 (commit)
       via  7a8bcb88e77380fe9672b4f10777cc9e48011dd4 (commit)
      from  9d526416f035a6d567c0a75ad10f61d67b91debf (commit)

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

- Log -----------------------------------------------------------------
commit d99e54cbaa83585d4bdc557b10d8205f9ee0c2bf
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:56 2015 +0200

    Support build-id for main executables
    
    Hi,
    
    make all the existing shlibs build-id functionality working also for the main
    executables.
    
    I think target_so_ops::open_symbol_file_object() is already replaced by what
    exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but
    open_symbol_file_object() has been forgotten.
    
    This patch adds target_so_ops::main_build_id() which could be possibly marged
    with open_symbol_file_object() but I made it a separate function as I think it
    is easier to rather remove target_so_ops::open_symbol_file_object().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention also main-build-id.
    	* build-id.c (build_id_verify): Add parameter advice.
    	* build-id.h (build_id_verify): Likewise.
    	* dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller.
    	* exec.c: Include build-id.h.
    	(exec_file_and_symbols_resync): Detect and use build-id by
    	solib_main_build_id.
    	* features/library-list-svr4.dtd: Add main-build-id.
    	* solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields
    	main_build_idsz and main_build_id.
    	(hex2bin_allocate): Generalize messages to binary files.
    	(svr4_library_list_start_list): Parse main-build-id.
    	(svr4_library_list_attributes): Add main-build-id.
    	(svr4_current_sos_direct): Set svr4_info main_build_id*.
    	(svr4_main_build_id): New function.
    	(svr4_clear_solib): Clear svr4_info main_build_id*.
    	(_initialize_svr4_solib): Install svr4_main_build_id.
    	* solib.c (solib_main_build_id): New function.
    	* solist.h (struct target_so_ops): Add method main_build_id.
    	(solib_main_build_id): New prototype.
    	* source.c (file_location_from_filename): Update build_id_verify caller.
    
    gdb/gdbserver/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id.
    
    gdb/doc/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Add 'set validate-build-id'
    	and 'show validate-build-id'.
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/main-mismatch-mod.c: New file.
    	* gdb.base/main-mismatch.c: New file.
    	* gdb.base/main-mismatch.exp: New file.

commit 01da7c01ec1e471365f400750281b4203391ced4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Make only user-specified executable and symbol filenames sticky
    
    Message-ID: <559A7C37.6020501@redhat.com>
    
    On 07/03/2015 04:44 PM, Pedro Alves wrote:
    
    > (I still suspect that if we reverse the sense of the flag, then
    > its management ends up being more centralized, as then the
    > place that sets it is also the place that needs to check it,
    > instead of doing that in multiple places.  But, see below.)
    
    It didn't seem fair to impose a subjective preference, so I tried
    this in order to understand it myself, and I now agree that is really
    doesn't make much difference, as then we'd have to mark
    auto-discovered in a few more places that I wasn't originally
    seeing.  There's at least the execd handling in infrun.c, and
    also spu_symbol_file_add_from_memory.
    
    As I was playing with this already, I poked at the other review
    points I made, and came up with the variant of the patch below.
    
    > This function is called while the passed in PID is not the
    > current inferior.  E.g., the remote_add_inferior path.
    >
    > Therefore seems to me that these symbol_file_add_main / exec_file_attach
    > calls can change the symbols of the wrong inferior.
    
    ...
    
    > I also notice that reread_symbols has an exec_file_attach
    > call which seems to me results in losing the is_user_supplied
    > flag if the executable's timestamp changed, at least here:
    >
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    >
    > I also notice that the clone-inferior command ends up with
    > an exec_file_attach call in clone_program_space.  That one
    > should probably be setting the is_user_supplied flag too,
    > I'd think.  Or at least, copying it from the original.
    >
    > At this point, I'm wondering about adding a parameter to
    > exec_file_attach to force considering (now and in future)
    > the right value to put in the flag in each case.
    
    I tried this too (see patch below).  As this requires touching the user-supplied
    paths anyway, it didn't really matter to tag files user-supplied or
    auto-discovered, so I reverted back to user-supplied.  For symbols,
    we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead
    of a new boolean.
    
    >
    >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
    >>    inferior = current_inferior ();
    >>    inferior->control.stop_soon = NO_STOP_QUIETLY;
    >>
    >> -  /* If no exec file is yet known, try to determine it from the
    >> -     process itself.  */
    >> -  if (get_exec_file (0) == NULL)
    >> -    exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> -  else
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    > It seems to me that we should be able to move these reopen/reread
    > calls inside exec_file_locate_attach.
    
    I did this too.
    
    What do you think of the version below?
    
    I also tweaked the warnings a bit, to explicitly say "mismatch".
    
    This would still need docs/NEWS changes, and a test would be good too.
    
    ----------
    
    - pass user-supplied / auto-discovered as arguments to exec_file_attach and
      symbol_file_add_main
    
    - Change exec_file_locate_attach parameter from pid to inferior
      pointer.
    
    - Flip current program space temporarily to make sure we add/reload
      symbols to/of the right inferior/program space.
    
    - Move reopen_exec_file and reread_symbols calls inside
      exec_file_locate_attach.
    
    - Warning message tweaks.
    
    - Rename exec_file_locate_attach -> exec_file_and_symbols_resync

commit adb7552ccb05c06beb2206781096941ed7f82d98
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Code cleanup: New hex2bin_allocate()
    
    Hi,
    
    make hex->bin parsing standalone, to be reused in later patch.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib-svr4.c (hex2bin_allocate): New function from ...
    	(library_list_start_library): ... here, call it.

commit 6ab2e5bc9724ebe52a3af5e65fe4a3fdcf8322ab
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    testcase: Test also locating shlibs by build-id
    
    Hi,
    
    testcase from the previous patch tests verification of build-id in shared
    libraries found by their name.  This test adds testing that a library can be
    found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY).
    
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them
    	global.
    	(solib_locate_test): New function.

commit d8e8defc149923e8681c102859f88148920231fb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Tests for validate symbol file using build-id
    
    Hi,
    
    new testcase only.
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    
    	Tests for validate symbol file using build-id.
    	* gdb.base/solib-mismatch-lib.c: New file.
    	* gdb.base/solib-mismatch-libmod.c: New file.
    	* gdb.base/solib-mismatch.c: New file.
    	* gdb.base/solib-mismatch.exp: New file.

commit 31525e5877ccb83604e971922a2df318a42dac01
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    build_id_verify: Make it more verbose
    
    Hi,
    
    it was discussed on this list that if build-ids do not match they should be
    printed for troubleshooting.  It is mostly independent from the other patches.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include rsp-low.h.
    	(build_id_verify): Print non-matching build-ids, update the messages.

commit 85f9a15b425c54da58036de2ce14dcfdd9263662
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_bfd_open: Optimize opening twice
    
    Hi,
    
    this is one of the optimizations allowed by file_location that prevents opening
    file twice when target build-id is known and it needs to be verified.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by
    	solib_find_file.

commit fe533db9feb1245389a609bf0d608b598864b97e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Verify the build-id
    
    Hi,
    
    now it is possible to filter-out from openp() search files with non-matching
    build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c: Include build-id.h.
    	(file_location_from_filename): Call build_id_verify for the build-id
    	parameters.

commit e150dd333417704e098e49e956aa7bad62f90bc5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_find: Search also by build-id
    
    Hi,
    
    solib_find() can now try to search also by build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c: Include build-id.h.
    	(solib_find_3): Call build_id_to_file.

commit 147927668e1af6fe08cd7fd66c1b7067f1127896
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    build_id_to_bfd: Make it return file_location
    
    Hi,
    
    refactor build_id_to_bfd so that it returns file_location.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include source.h.
    	(build_id_to_bfd): Rename to ...
    	(build_id_to_file): ... here, return file_location, add parameter opts,
    	make it public.
    	(build_id_to_debug_bfd): Use build_id_to_file.
    	* build-id.h (build_id_to_file): New prototype.

commit ef8f40015e7ba2b0121bdf5fb7df22c477878bc2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Add dummy build-id params to prototypes
    
    Hi,
    
    it is a lot of text with no functionality.  Add build-id parameters where
    needed, pass them where they are already available, otherwise pass 0 in the top
    callers.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Pass zero build-id.
    	* defs.h (openp, openp_file, source_full_path_of): Add build-id
    	parameters.
    	* dwarf2read.c (try_open_dwop_file): Pass zero build-id.
    	* exec.c (exec_file_locate_attach): Likewise.
    	* infrun.c (follow_exec): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass
    	them.
    	* nto-tdep.h (nto_find_and_open_solib): Add build-id parameters.
    	* solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them.
    	* solib-darwin.c (darwin_bfd_open): Likewise.
    	* solib-dsbt.c (enable_break): Pass zero build-id.
    	* solib-frv.c (enable_break2): Likewise.
    	* solib-spu.c (spu_bfd_open): Add build-id parameters, pass them.
    	* solib-svr4.c (enable_break): Pass zero build-id.
    	* solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find)
    	(solib_find_file, solib_find, solib_bfd_open): Add build-id
    	parameters, pass them.
    	(solib_map_sections): Pass so->build-id* to bfd_open.
    	(reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open.
    	* solist.h (struct target_so_ops): Add build-id parameters to bfd_open
    	and find_and_open_solib.
    	(exec_file_find, solib_find, solib_bfd_open): Add build-id parameters.
    	* source.c (file_location_from_filename): Add build-id parameters.
    	(filename_to_bfd): Pass zero build-id.
    	(openp): Add build-id parameters, pass them.
    	(openp_bfd): Pass zero build-id.
    	(openp_file, source_full_path_of): Add build-id parameters, pass them.
    	(find_and_open_source): Pass zero build-id.
    	* source.h (file_location_from_filename): Add build-id parameters.

commit f9b4ab1e97117468ef757d9c2172bf67f6861b4f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    build_id_to_debug_bfd: Make it also non-.debug capable
    
    Hi,
    
    generalize the function by adding 'suffix' parameter.  To be reused later.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_to_debug_bfd): Rename to ...
    	(build_id_to_bfd): ... here, add parameter suffix.
    	(build_id_to_debug_bfd): New function.

commit deb941292b4704a55b5716b25db5eb37fdc9decd
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    symfile_bfd_open: Make it use openp_bfd()
    
    Hi,
    
    another function gets converted to the new API.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and
    	gdb_bfd_open.

commit 78196e2d0b860fa2fa5e3e12a26966d0d86746e3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    solib_find: Make it use file_location
    
    Hi,
    
    refactor the solib*() code to use file_location functions.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* nto-tdep.c: Include source.h.
    	(nto_find_and_open_solib): Return file_location, remove parameter
    	temp_pathname.  Change openp to openp_file.
    	* nto-tdep.h (nto_find_and_open_solib): Update prototype.
    	* solib.c (solib_find_2): Rename to ...
    	(solib_find_3): ... here, return file_location, change parameter fd to
    	opts.  Change gdb_open_cloexec to file_location_from_filename and openp
    	to openp_file calls.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here, return file_location, change parameter fd to
    	opts.
    	(solib_find_1): New function.
    	(solib_find): Rename to ...
    	(solib_find_file) ... here, return file_location, change parameter fd
    	to opts.
    	(solib_find): New function.
    	* solist.h (find_and_open_solib): Return file_location, remove
    	parameter temp_pathname.

commit ee826afa4082d831819e959c78f70f87fbb3887c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Refactor openp() to return file_location
    
    Hi,
    
    openp() remains as a backward compatibility wrapper around renamed
    openp->openp_file().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add
    	OPF_BFD_CANONICAL.
    	(openp_bfd, openp_file): Add prototypes.
    	* exec.c (exec_file_attach): Replace openp by openp_bfd calls.
    	* source.c (file_location_from_filename): Support OPF_BFD_CANONICAL.
    	(openp, openp_bfd): New functions.
    	(openp): Rename to ...
    	(openp_file): ... here, return file_location, remove filename_opened
    	parameter.

commit 41744ddd2eb4c1c3d739b4ae072ec7555d627b0e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Add file_location utility functions
    
    Hi,
    
    build id verification faces a problem current codebase calls openp() and
    similar functions which search many directories and after they find the file
    they return its filename.  Caller then typically opens that file as BFD.
    
    But to search the directories openp() needs to open each file it iterates to
    verify their build-id.  Then it would close the file and caller would reopen it
    again.  This is inefficient (+racy), so a new intermediate representation of
    the found files is created (file_location).
    
    Another possibility would be to depends on bfd cache as being done in
    exec_file_attach.  But then a similar problem is needed for callers which want
    only fd (and not bfd).  Besides that I find depending on pending
    make_cleanup_bfd_unref() from openp() calls would be tricky.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Add OPF_IS_BFD.
    	* gdb_bfd.c (fileio_errno_to_host): Make it public.
    	* gdb_bfd.h (fileio_errno_to_host): Add prototype.
    	* source.c: Include inferior.h and gdb/fileio.h.
    	(file_location_enoent, file_location_free, file_location_cleanup)
    	(file_location_is_valid, file_location_from_filename)
    	(file_location_to_bfd, filename_to_bfd): New functions.
    	* source.h (struct file_location): New definition.
    	(file_location_enoent, file_location_free, file_location_is_valid)
    	(file_location file_location_from_filename, file_location_to_bfd)
    	(filename_to_bfd): New prototypes.

commit 43ed69c3939b6ddf70f8adeee9b12e7ea7f0bcd4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Optionally do not close fd
    
    Hi,
    
    gdb_bfd_open_from_target currently always embedded passed fd into returned BFD
    and closed that fd after closing that BFD.  As one cannot do dup() for target
    fileio FDs one could not use FD after BFD using it has been closed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function.
    	(gdb_bfd_open_from_target): Add parameter do_close.  Optionally pass
    	gdb_bfd_iovec_fileio_close_nop.
    	(gdb_bfd_open): Update caller.
    	* gdb_bfd.h (gdb_bfd_open_from_target): Update prototype.

commit b0ff8fd19664b4accddde8b198ebdf7d4db9479c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Support real fd
    
    Hi,
    
    gdb_bfd_open_from_target is extended so that it can be now passed also some
    non-(-1) fd.  non-(-1) fd was not supported for remote files in mainline.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function.
    	(gdb_bfd_open_from_target): Conditionally use it.

commit 08e8ab00fb10cf2ace96879af72bb505b09abb4e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Provide new gdb_bfd_open_from_target
    
    Hi,
    
    later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more
    special parameters.  So it is refactored out first (and extended later in the
    next patches).
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_open_from_target): New function from ...
    	(gdb_bfd_open): ... here.  Call it.
    	* gdb_bfd.h (gdb_bfd_open_from_target): New prototype.

commit ad21a771aef7bc9d3f8384a6535a696a264d3b67
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Code cleanup: openp parameter filename_opened is never NULL
    
    Hi,
    
    this parameter is never passed as NULL in the codebase so the check can be
    removed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c (openp): Update function comment for filename_opened.
    	Remove NULL check for filename_opened.

commit e8bc24fccbbecf1de9137d6c3ed09893e67f963c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove openp parameter mode
    
    Hi,
    
    simplify the code, make it also suitable for more code refactorings.
    The new flag OPF_OPEN_RW_TMP is removed later in this patch series.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Update openp caller.
    	* defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP.
    	(openp): Remove parameter mode.
    	* dwarf2read.c (try_open_dwop_file): Update openp caller.
    	* exec.c (exec_file_attach): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags,
    	update openp caller.
    	* nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags.
    	* solib.c (solib_find_2): Update openp and find_and_open_solib caller.
    	* solist.h (struct target_so_ops): Remove parameter o_flags from
    	find_and_open_solib method.
    	* source.c (openp): Change parameter mode to a new variable.
    	(source_full_path_of, find_and_open_source): Update openp caller.
    	* symfile.c (symfile_bfd_open): Likewise.

commit 184eca8d09fadf7a7f9200a12401346b4cabe313
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove OPF_RETURN_REALPATH
    
    Hi,
    
    OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned
    values.  That is not useful, code can be simplified if callers that passed
    OPF_RETURN_REALPATH adjust the returned values on their own.  Or at least it
    helps further refactorizations.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree.
    	* defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH.
    	* dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH.  Call
    	gdb_realpath_and_xfree.
    	* nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree and xstrdup.
    	* solib.c (solib_find_2): New variable temp_pathname_is_realpath.
    	Remove OPF_RETURN_REALPATH.  Conditionally call gdb_realpath_and_xfree.
    	* source.c (openp): Remove OPF_RETURN_REALPATH processing.
    	(source_full_path_of, find_and_open_source): Remove
    	OPF_RETURN_REALPATH.  Call gdb_realpath_and_xfree.
    	* symfile.c (symfile_bfd_open): Likewise.
    	* utils.c (gdb_realpath_and_xfree): New function.
    	* utils.h (gdb_realpath_and_xfree): New prototype.

commit f86c25c91946c70e5ace8256a2ea901c5c292569
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Add enum for openp_flags
    
    Hi,
    
    it is for many reasons better, in C++ it could be even type safe.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for
    	search_flags.
    	* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
    	Wrap them to a new ...
    	(enum openp_flags): ... enum.
    	(openp): Update prototype.
    	* dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags.
    	* source.c (openp): Update opts parameter type.  Move out OPF_*
    	comments.

commit 44c01eb2a9984e94bc25483829e473e37206ada1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Change sysroot to ":target:"
    
    Hi,
    
    that is try "" first and "target:" second.
    
    Various performance problems should be fixed by trying to look up the remote
    file first on local filesystem.  Thanks to build-ids it is quick and safe to
    verify both files are the same build.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention sysroot.
    	* main.c (captured_main): Initialize new gdb_sysroot.
    
    gdb/testsuite/ChangeLog
    
    	* gdb.base/attach.exp (do_attach_tests): Update sysroot parsing.
    	* gdb.base/break-probes.exp: Likewise.

commit 0ebe17076406a85a35eb0c4f362850ed9efb843e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Permit multiple sysroot directories
    
    Hi,
    
    the goal is to have both "" and "target:" as the default gdb_sysroot, in this
    order.  Therefore permit multiple directory components of gdb_sysroot.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot.
    	* solib.c: Include source.h.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here and change the sysroot variable to parameter.
    	(solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc.
    	* source.c (dirnames_to_char_ptr_vec_target_exc): New function.
    	* source.h (dirnames_to_char_ptr_vec_target_exc): New declaration.
    
    gdb/doc/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Permit set sysroot and show sysroot to have
    	multiple components.

commit 7b4dd1456b3c285b1e65dcae65c0ab6c53896991
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Code cleanup: Make solib_find_1 variable const
    
    Hi,
    
    it gets used in the next patch.
    
    
    Jan
    
    
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_find_1): Make sysroot variable const.

commit 03d470b67389d35a14a122d2c74c982487779d7a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Validate symbol file using build-id
    
    Consumer part of the "build-id" attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Validate symbol file using build-id.
    	* NEWS (Changes since GDB 7.10): Add 'set validate-build-id'
    	and 'show validate-build-id'.  Add build-id attribute.
    	* build-id.c: Include gdbcmd.h.
    	(validate_build_id, show_validate_build_id, _initialize_build_id): New.
    	* build-id.h (validate_build_id): New declaration.
    	* solib-svr4.c: Include rsp-low.h.
    	(svr4_copy_library_list): Duplicate field build_id.
    	(library_list_start_library): Parse 'build-id' attribute.
    	(svr4_library_attributes): Add 'build-id' attribute.
    	* solib.c (free_so): Free build_id.
    	* solist.h (struct so_list): New fields 'build_idsz' and 'build_id'.

commit 7b852ff6e5f327a01e6d2ef9f8c3d840f1874373
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    gdbserver build-id attribute generator
    
    Producer part of the new "build-id" XML attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* features/library-list-svr4.dtd (library-list-svr4): New
    	'build-id' attribute.
    
    gdb/doc/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* gdb.texinfo (Library List Format for SVR4 Targets): Add
    	'build-id' in description, example, new attribute in dtd.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* linux-low.c (linux-maps.h, search.h, rsp-low.h): Include.
    	(ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
    	(ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
    	(find_phdr): New.
    	(get_dynamic): Use find_pdhr to traverse program headers.
    	(struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
    	(compare_mapping_entry_range, struct find_memory_region_callback_data)
    	(read_build_id, find_memory_region_callback, lrfind_mapping_entry)
    	(get_hex_build_id): New.
    	(linux_qxfer_libraries_svr4): Add optional build-id attribute
    	to reply XML document.

commit 769819ca7bc9c987e4d3ac4c2da81ec5412d6e58
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Move linux_find_memory_regions_full & co.
    
    This should be just a move with no changes.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Move linux_find_memory_regions_full & co.
    	* linux-tdep.c (linux-maps.h): Include.
    	(gdb_regex.h): Remove the include.
    	(enum filterflags, struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Moved to common/linux-maps.c.
    	(linux_find_memory_region_ftype): Moved typedef to common/linux-maps.h.
    	(linux_find_memory_regions_full): Moved definition to
    	common/linux-maps.c.
    	* common/linux-maps.c: Include ctype.h, target/target-utils.h,
    	gdb_regex.h and target/target.h.
    	(struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Move from linux-tdep.c.
    	(linux_find_memory_regions_full): Move from linux-tdep.c.
    	* common/linux-maps.h (read_mapping): New declaration.
    	(linux_find_memory_region_ftype, enum filterflags): Moved from
    	linux-tdep.c.
    	(linux_find_memory_regions_full): New declaration.
    	* target.c (target/target-utils.h): Include.
    	(read_alloc_pread_ftype): Moved typedef to target/target-utils.h.
    	(read_alloc, read_stralloc_func_ftype, read_stralloc): Moved
    	definitions to target/target-utils.c.
    	* target.h (target_fileio_read_stralloc): Move it to target/target.h.
    	* target/target-utils.c (read_alloc, read_stralloc): Move definitions
    	from target.c.
    	* target/target-utils.h (read_alloc_pread_ftype): New typedef.
    	(read_alloc): New declaration.
    	(read_stralloc_func_ftype): New typedef.
    	(read_stralloc): New declaration.
    	* target/target.h (target_fileio_read_stralloc): Move it from target.h.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* target.c: Include target/target-utils.h and fcntl.h.
    	(target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
    	(target_fileio_read_stralloc): New functions.

commit 585aca87aa8a2f7a30840ad1bc3fce08a877371e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:49 2015 +0200

    Prepare linux_find_memory_regions_full & co. for move
    
    Prepare code for move into gdb/common/.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Prepare linux_find_memory_regions_full & co. for move.
    	* linux-tdep.c (linux_find_memory_region_ftype): Comment.
    	(linux_find_memory_regions_full): Change signature and prepare
    	for moving to linux-maps.
    	(linux_find_memory_regions_data): Rename field 'obfd' to 'data'.
    	(linux_find_memory_regions_thunk): New.
    	(linux_find_memory_regions_thunk): Use 'data' field instead of 'obfd'.
    	(linux_find_memory_regions_gdb): New.
    	(linux_find_memory_regions): Rename argument 'obfd' to 'func_data'.
    	(linux_make_mappings_corefile_notes): Use
    	linux_find_memory_regions_gdb.
    	* target.c (read_alloc_pread_ftype): New typedef.
    	(target_fileio_read_alloc_1_pread): New function.
    	(read_alloc): Refactor from target_fileio_read_alloc_1.
    	(read_stralloc_func_ftype): New typedef.
    	(target_fileio_read_alloc_1): New implementation. Use read_alloc.
    	(read_stralloc): Refactored from target_fileio_read_stralloc.
    	(target_fileio_read_stralloc): New implementation, use read_stralloc.

commit 47c5d88029a42bd629e933da0a61e7bf8e9ccbbe
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:49 2015 +0200

    Move gdb_regex* to common/
    
    Later patches need regex support also in gdbserver.
    
    gdb/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (HFILES_NO_SRCDIR): Change gdb_regex.h to
    	common/gdb_regex.h.
    	(COMMON_OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* common/common.m4 (GDB_AC_COMMON): Add gdb_use_included_regex,
    	--without-included-regex and USE_INCLUDED_REGEX.
    	* common/gdb_regex.c: New file from utils.c functions.
    	* common/gdb_regex.h: Move it here from gdb_regex.h, update include
    	file wrapping define name.
    	* configure: Rebuilt.
    	* configure.ac (gdb_use_included_regex, --without-included-regex)
    	(USE_INCLUDED_REGEX): Move them to common/common.m4.
    	* gdb_regex.h: Move it to common/gdb_regex.h.
    	* utils.c: Remove include gdb_regex.h.
    	(do_regfree_cleanup, make_regfree_cleanup, get_regcomp_error)
    	(compile_rx_or_error): Move them to common/gdb_regex.c.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* config.in: Rebuilt.
    	* configure: Rebuilt.

commit fe4882f5dd484d3bb8d9a53d5977ee318ecc1848
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Aug 25 21:02:58 2015 +0200

    Create empty common/linux-maps.[ch] and common/target-utils.[ch]
    
    Prepare new files for later move.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (ALL_TARGET_OBS): Add linux-maps.o.
    	(HFILES_NO_SRCDIR); Add common/linux-maps.h,
    	common/target-utils.h.
    	(COMMON_OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* target/target-utils.c: New file.
    	* target/target-utils.h: New file.
    	* common/linux-maps.c: New file.
    	* common/linux-maps.h: New file.
    	* configure.tgt (aarch64*-*-linux*, alpha*-*-linux*)
    	(am33_2.0*-*-linux*, arm*-*-linux*, bfin-*-*linux*, cris*, frv-*-*)
    	(hppa*-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
    	(m68*-*-linux*, microblaze*-linux-*, microblaze*-*-linux*)
    	(mips*-*-linux*, nios2*-*-linux*, powerpc*-*-linux*, s390*-*-linux*)
    	(sh*-*-linux*, sparc-*-linux*, sparc64-*-linux*, tic6x-*-*linux)
    	(tilegx-*-linux*, x86_64-*-linux*, xtensa*-*-linux*): Add linux-maps.o
    	to gdb_target_obs.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* configure.srv (srv_linux_obj): Add linux-maps.o.

commit 16ad13eca4a18139cd1dec214ec83fdc7c47ffda
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Aug 25 17:48:20 2015 +0100

    Replace assertions with warning messages about ELF binaries containing multiple symbol tables.
    
    	PR binutils/18854
    	* elf.c (bfd_section_from_shdr): Replace assertions with warnings
    	about multiple symbol tables.

commit cdbfb8861732b496b9ee35b130af75b245e2bc02
Author: Simon Dardis <Simon.Dardis@imgtec.com>
Date:   Tue Aug 25 17:04:51 2015 +0100

    Update MIPS tests for test failures on some configurations.
    
    	* gas/mips/micromips32-move.d: Update expected disassembly.
    	* gas/mips/move.d: Likewise.
    	* gas/mips/move.s: Fix for some MIPS configurations.

commit abc56d60aacccb64e146eb7a245b3ca2cea52dd9
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Aug 25 16:12:11 2015 +0100

    remote: allow aborting long operations (e.g., file transfers)
    
    Currently, when remote debugging, if you type Ctrl-C just while the
    target stopped for an internal event, and GDB is busy doing something
    that takes a while (e.g., fetching chunks of a shared library off of
    the target, with vFile, to process ELF headers and debug info), the
    Ctrl-C is lost.
    
    The patch hooks up the QUIT macro to a new target method that lets the
    target react to the double-Ctrl-C before the event loop is reached,
    which allows reacting to a double-Ctrl-C even when GDB is busy doing
    some long operation and not waiting for a stop reply.  That end result
    is:
    
     (gdb) c
     Continuing.
     ^C
     ^C
     Interrupted while waiting for the program.
     Give up waiting? (y or n) y
     Quit
     (gdb) info threads
       Id   Target Id         Frame
     * 1    Thread 11673      0x00007ffff7deb240 in _dl_debug_state () from target:/lib64/ld-linux-x86-64.so.2
     (gdb)
    
    If, however, GDB is waiting for a stop reply (because the target has
    been resumed, with e.g., vCont;c), but the target isn't responding, we
    now get:
    
     (gdb) c
     Continuing.
     ^C
     ^C
     The target is not responding to interrupt requests.
     Stop debugging it? (y or n) y
     Disconnected from target.
     (gdb) info threads
     No threads.
    
    This offers to disconnect, because when we're waiting for a stop
    reply, there's nothing else we can send the target other than an
    interrupt request.  And if that doesn't work, there's nothing else we
    can do.
    
    The Ctrl-C is presently lost because until we get to a user-visible
    stop, the SIGINT handler that is installed is the one that forwards
    the interrupt to the remote side, with the \003 "packet" [1].  But,
    gdbserver ignores an interrupt request if the program is stopped.
    Still, even if it didn't, the server can only report back a
    stop-because-of-SIGINT when the program is next resumed.  And it may
    take a while to actually re-resume the target.
    
    [1] - In the old sync days, the remote target would react to a
    double-Ctrl-C by asking users whether they wanted to give up waiting
    and disconnect.  The code is still there, but it it isn't reacheable
    on most hosts, which support serial connections in async mode
    (probably only DJGPP doesn't).  Even then, in sync mode, remote.c's
    SIGINT handler is only installed while the target is resumed, and is
    removed as soon as the target sends back a stop reply.  That means
    that a Ctrl-C just while GDB is processing an internal event can end
    up with an odd "Quit" at the prompt instead of "Program stopped by
    SIGINT".  In contrast, in async mode, remote.c's SIGINT handler is set
    up as long as target_terminal_inferior or
    target_terminal_ours_for_output are in effect (IOW, until we get a
    user-visible stop and call target_terminal_ours), so the user
    shouldn't get back a spurious Quit.  However, it's still desirable to
    be able to interrupt a long-running GDB operation, if GDB takes a
    while to re-resume the target or get back to the event loop.
    
    Tested on x86_64 Fedora 20.
    
    gdb/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* defs.h (maybe_quit): Declare.
    	(QUIT): Now calls maybe_quit.
    	* event-loop.c (clear_async_signal_handler)
    	(async_signal_handler_is_marked): New functions.
    	* event-loop.h (async_signal_handler_is_marked)
    	(clear_async_signal_handler): New declarations.
    	* remote.c (remote_check_pending_interrupt): New function.
    	(interrupt_query): Use make_cleanup_restore_target_terminal.  No
    	longer check whether the target is async.  If waiting for a stop
    	reply, and a Ctrl-C as been sent to the target, offer to
    	disconnect, and throw TARGET_CLOSE_ERROR instead of a quit.
    	Otherwise do not disconnect and throw a quit.
    	(_initialize_remote): Install remote_check_pending_interrupt as
    	to_check_pending_interrupt.
    	* target.c (target_check_pending_interrupt): New function.
    	* target.h (struct target_ops) <to_check_pending_interrupt>: New
    	field.
    	(target_check_pending_interrupt): New declaration.
    	* utils.c (maybe_quit): New function.
    	* target-delegates.c: Regenerate.

commit 38074311927d012e4cbd28d825878974c9209f77
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Tue Aug 25 17:16:34 2015 +0200

    Support for the sparc %pmcdper privileged register.
    
    opcodes/ChangeLog:
    
    2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* sparc-dis.c (print_insn_sparc): Handle the privileged register
    	%pmcdper.
    
    gas/ChangeLog:
    
    2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* config/tc-sparc.c (priv_reg_table): New privileged register
    	%pmcdper.
    
    gas/testsuite/ChangeLog:
    
    2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* gas/sparc/wrpr.s: Test writing to the privileged %pmcdper
    	register.
    	* gas/sparc/wrpr.d: ...and the expected result.
    	* gas/sparc/rdpr.s: Test reading from the privileged %pmcdper
    	register.
    	* gas/sparc/rdpr.d: ...and the expected result.

commit dfe7f77c4aae3376c175d8af4d477124c8817427
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 14:08:45 2015 +0100

    Print tid in debug output of debug_reg_change_callback
    
    In debug_reg_change_callback, we change debug registers of each LWP.
    It makes more sense to print LWP's pid rather than group leader's pid.
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* nat/aarch64-linux-hw-point.c (debug_reg_change_callback):
    	Rename local variable pid to tid, and get lwpid of lwp.  Update
    	debug output.

commit 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6
Author: Pierre-Marie de Rodat <derodat@adacore.com>
Date:   Thu Feb 5 17:00:06 2015 +0100

    DWARF: handle non-local references in nested functions
    
    GDB's current behavior when dealing with non-local references in the
    context of nested fuctions is approximative:
    
      - code using valops.c:value_of_variable read the first available stack
        frame that holds the corresponding variable (whereas there can be
        multiple candidates for this);
    
      - code directly relying on read_var_value will instead read non-local
        variables in frames where they are not even defined.
    
    This change adds the necessary context to symbol reads (to get the block
    they belong to) and to blocks (the static link property, if any) so that
    GDB can make the proper decisions when dealing with non-local varibale
    references.
    
    gdb/ChangeLog:
    
    	* ada-lang.c (ada_read_var_value): Add a var_block argument
    	and pass it to default_read_var_value.
    	* block.c (block_static_link): New accessor.
    	* block.h (block_static_link): Declare it.
    	* buildsym.c (finish_block_internal): Add a static_link
    	argument.  If there is a static link, associate it to the new
    	block.
    	(finish_block): Add a static link argument and pass it to
    	finish_block_internal.
    	(end_symtab_get_static_block): Update calls to finish_block and
    	to finish_block_internal.
    	(end_symtab_with_blockvector): Update call to
    	finish_block_internal.
    	* buildsym.h: Forward-declare struct dynamic_prop.
    	(struct context_stack): Add a static_link field.
    	(finish_block): Add a static link argument.
    	* c-exp.y: Remove an obsolete comment (evaluation of variables
    	already start from the selected frame, and now they climb *up*
    	the call stack) and propagate the block information to the
    	produced expression.
    	* d-exp.y: Likewise.
    	* f-exp.y: Likewise.
    	* go-exp.y: Likewise.
    	* jv-exp.y: Likewise.
    	* m2-exp.y: Likewise.
    	* p-exp.y: Likewise.
    	* coffread.c (coff_symtab_read): Update calls to finish_block.
    	* dbxread.c (process_one_symbol): Likewise.
    	* xcoffread.c (read_xcoff_symtab): Likewise.
    	* compile/compile-c-symbols.c (convert_one_symbol): Promote the
    	"sym" parameter to struct block_symbol, update its uses and pass
    	its block to calls to read_var_value.
    	(convert_symbol_sym): Update the calls to convert_one_symbol.
    	* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update
    	call to read_var_value.
    	* dwarf2loc.c (block_op_get_frame_base): New.
    	(dwarf2_block_frame_base_locexpr_funcs): Implement the
    	get_frame_base method.
    	(dwarf2_block_frame_base_loclist_funcs): Likewise.
    	(dwarf2locexpr_baton_eval): Add a frame argument and use it
    	instead of the selected frame in order to evaluate the
    	expression.
    	(dwarf2_evaluate_property): Add a frame argument.  Update call
    	to dwarf2_locexpr_baton_eval to provide a frame in available and
    	to handle the absence of address stack.
    	* dwarf2loc.h (dwarf2_evaluate_property): Add a frame argument.
    	* dwarf2read.c (attr_to_dynamic_prop): Add a forward
    	declaration.
    	(read_func_scope): Record any available static link description.
    	Update call to finish_block.
    	(read_lexical_block_scope): Update call to finish_block.
    	* findvar.c (follow_static_link): New.
    	(get_hosting_frame): New.
    	(default_read_var_value): Add a var_block argument.  Use
    	get_hosting_frame to handle non-local references.
    	(read_var_value): Add a var_block argument and pass it to the
    	LA_READ_VAR_VALUE method.
    	* gdbtypes.c (resolve_dynamic_range): Update calls to
    	dwarf2_evaluate_property.
    	(resolve_dynamic_type_internal): Likewise.
    	* guile/scm-frame.c (gdbscm_frame_read_var): Update call to
    	read_var_value, passing it the block coming from symbol lookup.
    	* guile/scm-symbol.c (gdbscm_symbol_value): Update call to
    	read_var_value (TODO).
    	* infcmd.c (finish_command_continuation): Update call to
    	read_var_value, passing it the block coming from symbol lookup.
    	* infrun.c (insert_exception_resume_breakpoint): Likewise.
    	* language.h (struct language_defn): Add a var_block argument to
    	the LA_READ_VAR_VALUE method.
    	* objfiles.c (struct static_link_htab_entry): New.
    	(static_link_htab_entry_hash): New.
    	(static_link_htab_entry_eq): New.
    	(objfile_register_static_link): New.
    	(objfile_lookup_static_link): New.
    	(free_objfile): Free the STATIC_LINKS hashed map if needed.
    	* objfiles.h: Include hashtab.h.
    	(struct objfile): Add a static_links field.
    	(objfile_register_static_link): New.
    	(objfile_lookup_static_link): New.
    	* printcmd.c (print_variable_and_value): Update call to
    	read_var_value.
    	* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
    	* python/py-frame.c (frapy_read_var): Update call to
    	read_var_value, passing it the block coming from symbol lookup.
    	* python/py-framefilter.c (extract_sym): Add a sym_block
    	parameter and set the pointed value to NULL (TODO).
    	(enumerate_args): Update call to extract_sym.
    	(enumerate_locals): Update calls to extract_sym and to
    	read_var_value.
    	* python/py-symbol.c (sympy_value): Update call to
    	read_var_value (TODO).
    	* stack.c (read_frame_local): Update call to read_var_value.
    	(read_frame_arg): Likewise.
    	(return_command): Likewise.
    	* symtab.h (struct symbol_block_ops): Add a get_frame_base
    	method.
    	(struct symbol): Add a block field.
    	(SYMBOL_BLOCK): New accessor.
    	* valops.c (value_of_variable): Remove frame/block handling and
    	pass the block argument to read_var_value, which does this job
    	now.
    	(value_struct_elt_for_reference): Update calls to
    	read_var_value.
    	(value_of_this): Pass the block found to read_var_value.
    	* value.h (read_var_value): Add a var_block argument.
    	(default_read_var_value): Likewise.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.base/nested-subp1.exp: New file.
    	* gdb.base/nested-subp1.c: New file.
    	* gdb.base/nested-subp2.exp: New file.
    	* gdb.base/nested-subp2.c: New file.
    	* gdb.base/nested-subp3.exp: New file.
    	* gdb.base/nested-subp3.c: New file.

commit 7c2bea1ad1c779b893eb9cad4c92732583ae0eb5
Author: Renlin Li <renlin.li@arm.com>
Date:   Tue Aug 25 12:37:21 2015 +0100

    [AArch64] Fix a typo in the comment for BFD_RELOC_AARCH64_LD64_GOT_LO12_NC
    
    2015-08-25  Renlin Li  <renlin.li@arm.com>
    
    bfd/
      * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
      ILP64.
      * bfd-in2.h: Regenerate.

commit ed8b7b421c98533b9b08995edd7363328b55921e
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Move aarch64_linux_new_thread to nat/aarch64-linux.c
    
    This patch moves aarch64_linux_new_thread in GDB and GDBserver to
    nat/aarch64-linux.c.
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (aarch64_linux_new_thread): Move it to ...
    	* nat/aarch64-linux.c (aarch64_linux_new_thread): ... here.
    	* nat/aarch64-linux.h (aarch64_linux_new_thread): Declare.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_linux_new_thread): Remove.

commit db3cb7cb3e51e5eb834412adbf90e81bb76846c6
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Move aarch64_linux_prepare_to_resume to nat/aarch64-linux.c
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* Makefile.in (aarch64-liunx.o): New rule.
    	(HFILES_NO_SRCDIR): Add aarch64-linux.h.
    	* config/aarch64/linux.mh (NAT_FILE): Add aarch64-linux.o.
    	* aarch64-linux-nat.c: Include nat/aarch64-linux.h.
    	* aarch64-linux-nat.c (aarch64_get_debug_reg_state): Make it
    	extern.
    	(aarch64_linux_prepare_to_resume): Move it nat/aarch64-linux.c.
    	* nat/aarch64-linux-hw-point.h (aarch64_debug_reg_state): Declare
    	* nat/aarch64-linux.c: New file.
    	* nat/aarch64-linux.h: New file.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* Makefile.in (aarch64-linux.o): New rule.
    	* configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
    	srv_tgtobj.
    	* linux-aarch64-low.c: Include nat/aarch64-linux.h.
    	(aarch64_init_debug_reg_state): Make it extern.
    	(aarch64_linux_prepare_to_resume): Remove.

commit f6011a1c84b1bd616617bfde84dca63f250c950d
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Make aarch64_linux_prepare_to_resume the same on GDB and GDBserver
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use
    	lwp_arch_private_info and ptid_of_lwp.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
    	lwp_arch_private_info and ptid_of_lwp.

commit 88e2cf7ee25c72bce35ebe59b13c9701abce9fee
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Add pid argument in aarch64_get_debug_reg_state
    
    This patch addes argument pid in aarch64_get_debug_reg_state, so that
    its interface is the same on both GDB and GDBserver.
    
    gdb/gdbserver:
    
    2015-018-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
    	Find proc_info by find_process_pid.  All callers updated.

commit 5e35436ed12617494d2a2d190e0faca5613a2e9f
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Move debug_reg_change_callback and aarch64_notify_debug_reg_change to nat/aarch64-linux-hw-point.c
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (struct arch64_dr_update_callback_param):
    	Move it to nat/aarch64-linux-hw-point.c.
    	(debug_reg_change_callback): Likewise.
    	(aarch64_notify_debug_reg_change): :Likewise.
    	* nat/aarch64-linux-hw-point.c: Include nat/linux-nat.h.
    	(aarch64_dr_update_callback_param): New.
    	(debug_reg_change_callback): New function.
    	(aarch64_notify_debug_reg_change): Likewise.
    	* nat/aarch64-linux-hw-point.h (aarch64_notify_debug_reg_change):
    	Remove the declaration.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (struct arch64_dr_update_callback_param):
    	Remove.
    	(debug_reg_change_callback): Remove.
    	(aarch64_notify_debug_reg_change): Remove.

commit 75e1f0f7a0992835415e9bb924ec21a9aac6d5a1
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Make debug_reg_change_callback the same on GDB and GDBserver
    
    This patch makes function debug_reg_change_callback in GDB and GDBserver
    look the same, so that the following patch can move them to
    nat/aarch64-linux-hw-point.c.
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (debug_reg_change_callback): Use
    	ptid_of_lwp to get ptid of lwp.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (debug_reg_change_callback): Use
    	ptid_of_lwp to get ptid of lwp.

commit 4a8a7965f233f571b78f7992292a31c990c15a5e
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Make aarch64_notify_debug_reg_change the same on GDB and GDBserver
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (aarch64_notify_debug_reg_change):
    	Call current_lwp_ptid.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_notify_debug_reg_change):
    	Call current_lwp_ptid.

commit 32a271eeaf1b1be1367b6ea181a0f39a3da71d45
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:29 2015 +0100

    Use debug_printf in debug_reg_change_callback
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (debug_reg_change_callback): Use
    	debug_printf.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (debug_reg_change_callback): Use
    	debug_printf.

commit 0d51c8d71c19531bf29a3ba303c040c7c772a4a1
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:28 2015 +0100

    Use phex debug_reg_change_callback
    
    This patch is to use phex in debug_reg_change_callback to make it
    identical in GDB and GDBserver.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (debug_reg_change_callback): Use phex.

commit 5e137137b2ff267fbf33b1e47f0413292ccb40d6
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:28 2015 +0100

    Get pid rather than lwpid
    
    We print PID rather than LWPID in the debug output, so we need call
    ptid_get_pid in debug_reg_change_callback.
    
    gdb:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (debug_reg_change_callback): Call
    	ptid_get_pid rather than ptid_get_lwp.

commit 31a43dd5e1cfb8bb387885b3f641d6d2c04ac5dd
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:28 2015 +0100

    Remove some comments in debug_reg_change_callback
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (debug_reg_change_callback): Remove comments.

commit 8ee525679d030cd2c35eaee3b8d4ac545c5dc8ee
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:28 2015 +0100

    Re-indent the code
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (debug_reg_change_callback): Re-indent
    	the code.

commit ff3f0f45c5ff3505d041eba81a999b55c55f4530
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Aug 25 11:38:28 2015 +0100

    [gdbserver] Use iterate_over_lwps in aarch64_notify_debug_reg_change
    
    This patch makes more bits on aarch64 watchpoint between GDB and GDBserver
    look similar.
    
    gdb/gdbserver:
    
    2015-08-25  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
    	Remove.
    	(debug_reg_change_callback): Remove argument entry and add argument
    	lwp.  Remove local variable thread.  Don't print thread id in the
    	debugging output.  Don't check whether pid of thread equals to pid.
    	(aarch64_notify_debug_reg_change): Don't set param.pid.  Call
    	iterate_over_lwps instead find_inferior.

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

    Automatic date update in version.in

commit 3d40fbb53b4478d94b6fa5abad0796cec5d5db49
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 19:58:31 2015 +0100

    gdbserver crashes when multiprocess extensions aren't supported
    
    Ref: https://sourceware.org/ml/gdb-patches/2015-08/msg00675.html
    
    If multiprocess extensions are off (because specific gdbserver port
    doesn't support them), then when gdbserver doesn't have a thread
    selected yet, and GDB sends Hg packet to select one, gdbserver
    crashes.  That's because extracting the desired thread id out of the
    packet that GDB sent depends on the current thread to fill in the
    missing process id ...  Fix this by getting the process id from the
    first (and only) process in the processes list instead.
    
    The GNU/Linux port doesn't trip on this because it always runs with
    multiprocess extensions enabled.  To make it easier to catch such
    regressions going forward, this commit also adds a new smoke test that
    spawns gdbserver, connects to it and runs to main with the
    multiprocess extensions force-disabled.
    
    gdb/gdbserver/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* inferiors.c (get_first_process): New function.
    	* inferiors.h (get_first_process): New declaration.
    	* remote-utils.c (read_ptid): Default to the first process in the
    	list, instead of to the current thread's process.
    
    gdb/testsuite/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* gdb.server/connect-without-multi-process.c: New file.
    	* gdb.server/connect-without-multi-process.exp: New file.

commit 73b8c1fda9f3759874a9a1a7e7402276da057153
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 19:58:31 2015 +0100

    Add "set remote multiprocess-extensions-packet" command
    
    Being able to force-disable the RSP multiprocess extensions is useful
    for testing.
    
    gdb/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* NEWS (New commands): Mention set/show remote
    	multiprocess-extensions-packet.
    	* remote.c (remote_query_supported): Only tell the server to use
    	the multiprocess extensions if the user hasn't force-disabled them
    	with "set remote multiprocess-extensions-packet off".
    
    gdb/doc/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* gdb.texinfo (Remote Configuration): Document the "set/show
    	remote multiprocess-extensions-packet" commands.

commit 4a626d0a0f451c3288a461f64a9f8a49790d422b
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 18:50:00 2015 +0100

    Update gnulib to current upstream master
    
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
    	1029a8112290f6eee9d7878a391c49db42c999bd.
    	* gnulib/configure, gnulib/config.in, gnulib/aclocal.m4:
    	Regenerate.
    	* gnulib/import/Makefile.am: Update.
    	* gnulib/import/Makefile.in: Update.
    	* gnulib/import/alloca.in.h: Update.
    	* gnulib/import/basename-lgpl.c: Update.
    	* gnulib/import/canonicalize-lgpl.c: Update.
    	* gnulib/import/config.charset: Update.
    	* gnulib/import/dirent.in.h: Update.
    	* gnulib/import/dirfd.c: Update.
    	* gnulib/import/dirname-lgpl.c: Update.
    	* gnulib/import/dirname.h: Update.
    	* gnulib/import/dosname.h: Update.
    	* gnulib/import/errno.in.h: Update.
    	* gnulib/import/extra/snippet/arg-nonnull.h: Update.
    	* gnulib/import/extra/snippet/c++defs.h: Update.
    	* gnulib/import/extra/snippet/warn-on-use.h: Update.
    	* gnulib/import/extra/update-copyright: Update.
    	* gnulib/import/float+.h: Update.
    	* gnulib/import/float.c: Update.
    	* gnulib/import/float.in.h: Update.
    	* gnulib/import/fnmatch.c: Update.
    	* gnulib/import/fnmatch.in.h: Update.
    	* gnulib/import/fnmatch_loop.c: Update.
    	* gnulib/import/fpucw.h: Update.
    	* gnulib/import/frexp.c: Update.
    	* gnulib/import/frexpl.c: Update.
    	* gnulib/import/gettimeofday.c: Update.
    	* gnulib/import/inttypes.in.h: Update.
    	* gnulib/import/isnan.c: Update.
    	* gnulib/import/isnand-nolibm.h: Update.
    	* gnulib/import/isnand.c: Update.
    	* gnulib/import/isnanl-nolibm.h: Update.
    	* gnulib/import/isnanl.c: Update.
    	* gnulib/import/itold.c: Update.
    	* gnulib/import/localcharset.c: Update.
    	* gnulib/import/localcharset.h: Update.
    	* gnulib/import/lstat.c: Update.
    	* gnulib/import/m4/00gnulib.m4: Update.
    	* gnulib/import/m4/absolute-header.m4: Update.
    	* gnulib/import/m4/alloca.m4: Update.
    	* gnulib/import/m4/canonicalize.m4: Update.
    	* gnulib/import/m4/codeset.m4: Update.
    	* gnulib/import/m4/configmake.m4: Update.
    	* gnulib/import/m4/dirent_h.m4: Update.
    	* gnulib/import/m4/dirfd.m4: Update.
    	* gnulib/import/m4/dirname.m4: Update.
    	* gnulib/import/m4/double-slash-root.m4: Update.
    	* gnulib/import/m4/eealloc.m4: Update.
    	* gnulib/import/m4/errno_h.m4: Update.
    	* gnulib/import/m4/exponentd.m4: Update.
    	* gnulib/import/m4/exponentl.m4: Update.
    	* gnulib/import/m4/extensions.m4: Update.
    	* gnulib/import/m4/extern-inline.m4: Update.
    	* gnulib/import/m4/fcntl-o.m4: Update.
    	* gnulib/import/m4/float_h.m4: Update.
    	* gnulib/import/m4/fnmatch.m4: Update.
    	* gnulib/import/m4/fpieee.m4: Update.
    	* gnulib/import/m4/frexp.m4: Update.
    	* gnulib/import/m4/frexpl.m4: Update.
    	* gnulib/import/m4/gettimeofday.m4: Update.
    	* gnulib/import/m4/glibc21.m4: Update.
    	* gnulib/import/m4/gnulib-cache.m4: Update.
    	* gnulib/import/m4/gnulib-common.m4: Update.
    	* gnulib/import/m4/gnulib-comp.m4: Update.
    	* gnulib/import/m4/gnulib-tool.m4: Update.
    	* gnulib/import/m4/include_next.m4: Update.
    	* gnulib/import/m4/inttypes-pri.m4: Update.
    	* gnulib/import/m4/inttypes.m4: Update.
    	* gnulib/import/m4/isnand.m4: Update.
    	* gnulib/import/m4/isnanl.m4: Update.
    	* gnulib/import/m4/largefile.m4: Update.
    	* gnulib/import/m4/localcharset.m4: Update.
    	* gnulib/import/m4/locale-fr.m4: Update.
    	* gnulib/import/m4/locale-ja.m4: Update.
    	* gnulib/import/m4/locale-zh.m4: Update.
    	* gnulib/import/m4/longlong.m4: Update.
    	* gnulib/import/m4/lstat.m4: Update.
    	* gnulib/import/m4/malloc.m4: Update.
    	* gnulib/import/m4/malloca.m4: Update.
    	* gnulib/import/m4/math_h.m4: Update.
    	* gnulib/import/m4/mbrtowc.m4: Update.
    	* gnulib/import/m4/mbsinit.m4: Update.
    	* gnulib/import/m4/mbsrtowcs.m4: Update.
    	* gnulib/import/m4/mbstate_t.m4: Update.
    	* gnulib/import/m4/memchr.m4: Update.
    	* gnulib/import/m4/memmem.m4: Update.
    	* gnulib/import/m4/mmap-anon.m4: Update.
    	* gnulib/import/m4/multiarch.m4: Update.
    	* gnulib/import/m4/nocrash.m4: Update.
    	* gnulib/import/m4/off_t.m4: Update.
    	* gnulib/import/m4/pathmax.m4: Update.
    	* gnulib/import/m4/readlink.m4: Update.
    	* gnulib/import/m4/rename.m4: Update.
    	* gnulib/import/m4/rmdir.m4: Update.
    	* gnulib/import/m4/ssize_t.m4: Update.
    	* gnulib/import/m4/stat.m4: Update.
    	* gnulib/import/m4/stdbool.m4: Update.
    	* gnulib/import/m4/stddef_h.m4: Update.
    	* gnulib/import/m4/stdint.m4: Update.
    	* gnulib/import/m4/stdio_h.m4: Update.
    	* gnulib/import/m4/stdlib_h.m4: Update.
    	* gnulib/import/m4/string_h.m4: Update.
    	* gnulib/import/m4/strstr.m4: Update.
    	* gnulib/import/m4/strtok_r.m4: Update.
    	* gnulib/import/m4/sys_socket_h.m4: Update.
    	* gnulib/import/m4/sys_stat_h.m4: Update.
    	* gnulib/import/m4/sys_time_h.m4: Update.
    	* gnulib/import/m4/sys_types_h.m4: Update.
    	* gnulib/import/m4/time_h.m4: Update.
    	* gnulib/import/m4/unistd_h.m4: Update.
    	* gnulib/import/m4/warn-on-use.m4: Update.
    	* gnulib/import/m4/wchar_h.m4: Update.
    	* gnulib/import/m4/wchar_t.m4: Update.
    	* gnulib/import/m4/wctype_h.m4: Update.
    	* gnulib/import/m4/wint_t.m4: Update.
    	* gnulib/import/malloc.c: Update.
    	* gnulib/import/malloca.c: Update.
    	* gnulib/import/malloca.h: Update.
    	* gnulib/import/math.in.h: Update.
    	* gnulib/import/mbrtowc.c: Update.
    	* gnulib/import/mbsinit.c: Update.
    	* gnulib/import/mbsrtowcs-impl.h: Update.
    	* gnulib/import/mbsrtowcs-state.c: Update.
    	* gnulib/import/mbsrtowcs.c: Update.
    	* gnulib/import/memchr.c: Update.
    	* gnulib/import/memmem.c: Update.
    	* gnulib/import/pathmax.h: Update.
    	* gnulib/import/readlink.c: Update.
    	* gnulib/import/ref-add.sin: Update.
    	* gnulib/import/ref-del.sin: Update.
    	* gnulib/import/rename.c: Update.
    	* gnulib/import/rmdir.c: Update.
    	* gnulib/import/same-inode.h: Update.
    	* gnulib/import/stat.c: Update.
    	* gnulib/import/stdbool.in.h: Update.
    	* gnulib/import/stddef.in.h: Update.
    	* gnulib/import/stdint.in.h: Update.
    	* gnulib/import/stdio.c: Update.
    	* gnulib/import/stdio.in.h: Update.
    	* gnulib/import/stdlib.in.h: Update.
    	* gnulib/import/str-two-way.h: Update.
    	* gnulib/import/streq.h: Update.
    	* gnulib/import/string.in.h: Update.
    	* gnulib/import/stripslash.c: Update.
    	* gnulib/import/strnlen1.c: Update.
    	* gnulib/import/strnlen1.h: Update.
    	* gnulib/import/strstr.c: Update.
    	* gnulib/import/strtok_r.c: Update.
    	* gnulib/import/sys_stat.in.h: Update.
    	* gnulib/import/sys_time.in.h: Update.
    	* gnulib/import/sys_types.in.h: Update.
    	* gnulib/import/time.in.h: Update.
    	* gnulib/import/unistd.in.h: Update.
    	* gnulib/import/verify.h: Update.
    	* gnulib/import/wchar.in.h: Update.
    	* gnulib/import/wctype.in.h: Update.
    	* gnulib/import/gettimeofday.c: New file.
    	* gnulib/import/m4/absolute-header.m4: New file.
    	* gnulib/import/m4/gettimeofday.m4: New file.
    	* gnulib/import/m4/sys_socket_h.m4: New file.
    	* gnulib/import/m4/sys_time_h.m4: New file.
    	* gnulib/import/stdio.c: Delete file.
    	* gnulib/import/sys_time.in.h: New file.

commit 438e1e427e8393de73d22617abe4d8eba0270e72
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 18:50:55 2015 +0100

    Prepare for gnulib update
    
    After the last gnulib import (Dec 2012), gnulib upstream started
    replacing mingw's 'struct timeval' with a version with 64-bit time_t,
    for POSIX compliance:
    
     commit f8e84098084b3b53bc6943a5542af1f607ffd477
     Author: Bruno Haible <bruno@clisp.org>
     Date:   Sat Jan 28 18:12:10 2012 +0100
         sys_time: Override 'struct timeval' on some native Windows platforms.
    
    See:
    
     https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00372.html
    
    However, that results in conflicts with native Winsock2's 'select':
    
    select()'s argument
    	http://sourceforge.net/p/mingw-w64/mailman/message/29610438/
    
    ... and libiberty's timeval-utils.h timeval_add/timeval_sub, at the
    least.
    
    We don't really need the POSIX compliance, so this patch prepares us
    to simply not use gnulib's 'struct timeval' replacement once a more
    recent gnulib is imported, thus preserving the current behavior, by
    adding a sys/time.h wrapper header that undefs gnulib's replacements,
    and including that everywhere instead.
    
    The SIZE -> OSIZE change is necessary because newer gnulib's
    sys/time.h also includes windows.h/winsock2.h, which defines a
    conflicting SIZE symbol.
    
    Cross build-tested mingw-w64 32-bit and 64-bit.
    Regtested on x86_64 Fedora 20.
    
    gdb/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_sys_time.h.
    	* common/gdb_sys_time.h: New file.
    	* event-loop.c: Include gdb_sys_time.h instead of sys/time.h.
    	* gdb_select.h: Likewise.
    	* gdb_usleep.c: Likewise.
    	* maint.c: Likewise.
    	* mi/mi-main.c: Likewise.
    	* mi/mi-parse.h: Likewise.
    	* remote-fileio.c: Likewise.
    	* remote-m32r-sdi.c: Likewise.
    	* remote.c: Likewise.
    	* ser-base.c: Likewise.
    	* ser-pipe.c: Likewise.
    	* ser-tcp.c: Likewise.
    	* ser-unix.c: Likewise.
    	* symfile.c: Likewise.
    	* symfile.c: Likewise.  Rename OSIZE to SIZE throughout.
    	* target-memory.c: Include gdb_sys_time.h instead of sys/time.h.
    	* utils.c: Likewise.
    
    gdb/gdbserver/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* debug.c: Include gdb_sys_time.h instead of sys/time.h.
    	* event-loop.c: Likewise.
    	* remote-utils.c: Likewise.
    	* tracepoint.c: Likewise.

commit a8c6d4fcd6b2a30c2b5b87d656ce035dcf8b0035
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 17:58:22 2015 +0100

    Fix gdbserver SPU build
    
    Ref: https://sourceware.org/ml/gdb-patches/2015-08/msg00675.html
    
     gdbserver/spu-low.c: In function 'spu_request_interrupt':
     gdbserver/spu-low.c:639: error: incompatible type for argument 1 of 'ptid_get_lwp'
    
    gdb/gdbserver/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* spu-low.c (spu_request_interrupt): Use lwpid_of instead of
    	ptid_get_lwp.

commit 4422ac93e5d3d23dd441aadaa49c81356aa59b73
Author: Luis Machado <lgustavo@codesourcery.com>
Date:   Mon Aug 24 13:08:20 2015 -0300

    Make z int
    
    This makes z an int for gdb/testsuite/gdb.opt/inline-markers.c.
    
    gdb/testsuite/ChangeLog:
    
    2015-08-24  Luis Machado  <lgustavo@codesourcery.com>
    
    	* gdb.opt/inline-markers.c: Make z int.

commit 91dddb86299bba404599551e9e2633b3c0e5c830
Author: Luis Machado <lgustavo@codesourcery.com>
Date:   Mon Aug 24 12:56:15 2015 -0300

    Make z volatile.
    
    This fixes a typo in gdb/testsuite/gdb.opt/inline-markers.c, making
    z a volatile variable.
    
    gdb/testsuite/ChangeLog:
    
    2015-08-24  Luis Machado  <lgustavo@codesourcery.com>
    
    	* gdb.opt/inline-markers.c: Make z volatile.

commit a48847eea5f39c1f9fbe4255c9e892647f13f995
Author: Luis Machado <lgustavo@codesourcery.com>
Date:   Mon Aug 24 12:33:21 2015 -0300

    Prevent GCC from folding inline test functions
    
    While doing some powerpc Linux tests on a ppc 476 board using GCC 5.2, i
    noticed inline-bt.exp, inline-cmds.exp and inline-locals.exp failing.
    
    FAIL: gdb.opt/inline-bt.exp: continue to bar (1)
    FAIL: gdb.opt/inline-bt.exp: backtrace from bar (1)
    FAIL: gdb.opt/inline-bt.exp: continue to bar (2)
    FAIL: gdb.opt/inline-bt.exp: backtrace from bar (2)
    FAIL: gdb.opt/inline-bt.exp: continue to bar (3)
    FAIL: gdb.opt/inline-bt.exp: backtrace from bar (3)
    FAIL: gdb.opt/inline-cmds.exp: continue to bar (1)
    FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (1)
    FAIL: gdb.opt/inline-cmds.exp: continue to bar (2)
    FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (2)
    FAIL: gdb.opt/inline-cmds.exp: continue to marker
    FAIL: gdb.opt/inline-cmds.exp: backtrace from marker
    FAIL: gdb.opt/inline-cmds.exp: step into finish marker
    FAIL: gdb.opt/inline-locals.exp: continue to bar (1)
    FAIL: gdb.opt/inline-locals.exp: continue to bar (2)
    FAIL: gdb.opt/inline-locals.exp: backtrace from bar (2)
    FAIL: gdb.opt/inline-locals.exp: continue to bar (3)
    FAIL: gdb.opt/inline-locals.exp: backtrace from bar (3)
    
    They failed because the breakpoint supposedly inserted at bar was actually
    inserted at noinline.
    
    (gdb) break inline-markers.c:20^M
    Breakpoint 2 at 0x1000079c: file gdb/testsuite/gdb.opt/inline-markers.c, line 20.^M
    (gdb) continue^M
    Continuing.^M
    ^M
    Breakpoint 2, noinline () at gdb/testsuite/gdb.opt/inline-markers.c:35^M
    35        inlined_fn (); /* inlined */^M
    
    As we can see, line 20 is really inside bar, not noinline:
    
    18 void bar(void)
    19 {
    20   x += y; /* set breakpoint 1 here */
    21 }
    
    Further investigation shows that this is really due to GCC 5's new
    ICF pass (-fipa-icf), now enabled by default at -O2, which folds bar
    and marker into noinline, where the call to inlined_fn was inlined.
    
    This breaks the testcase since it expects to stop at specific spots.
    
    I thought about two possible fixes for this issue.
    
    - Disable the ICF pass manually when building the binary (-fno-ipa-icf).
    
    This has the advantage of not having to touch the testcase sources themselves,
    but the disadvantage of having to add conditional blocks to test the GCC
    version. If we ever change GCC's default, we will have to adjust the
    conditional block again to match GCC's behavior.
    
    - Modify the testcase sources to make the identical functions unique.
    
    This solution doesn't touch the testcase itself, but changes the source
    code slightly in order to make bar, marker and inlined_fn unique. This
    causes GCC's ICF pass to ignore these functions and not fold them into
    a common identical function.
    
    I'm good with either of them, but i'm more inclined to go with the second
    one.
    
    The attached patch implements this by adding the new global variable z, set
    to 0, that gets added in different ways to marker and inlined_fn. Since it
    is 0, it doesn't affect any possible value checks that we may wish to do
    in the future (we currently only check for values changed by bar).
    
    Ok?
    
    ps: I also noticed GDB doesn't do a great job at stating that the breakpoint
    was actually inserted at a different source line than previously requested,
    so this sounds like a bug that should be fixed, if it is not just wrong
    DWARF information (did not investigate it further).
    
    gdb/testsuite/ChangeLog:
    
    2015-08-24  Luis Machado  <lgustavo@codesourcery.com>
    
    	* gdb.opt/inline-bt.c: New volatile global z.
    	* gdb.opt/inline-cmds.c: Likewise.
    	* gdb.opt/inline-locals.c: Likewise.
    	* gdb.opt/inline-markers.c: New extern global z.
    	(marker): Use z.
    	(inline_fn): Likewise.

commit 0ebbc52beef41c725f75b22c80a37fee00303bb0
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 15:29:49 2015 +0100

    gdb/testsuite/: garbage collect a few references to dead targets
    
    gdb/testsuite/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* config/m32r-stub.exp: Remove file.
    	* gdb.base/call-ar-st.exp: Remove reference to sparclet.
    	* gdb.base/call-rt-st.exp: Likewise.
    	* gdb.base/call-strs.exp: Likewise.
    	* gdb.base/default.exp: Remove references to h8300-*-hms and
    	*-*-udi*.
    	* gdb.base/funcargs.exp: Remove reference to sparclet-*-*.

commit bb61542818398aa00f869257c0734ffdc39275b5
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 15:40:26 2015 +0100

    gdb manual: Remove references to deleted targets
    
    Support for target dbug/picobug/dink32/m32r/mon2000/ppcbug was just
    removed, but support for ARM RDI, Sparclet, Sparclite, Z8000, target
    r3900, target array, target sds, target op50n and target w89k had
    already been removed many years ago.  Drop it all in one go.
    
    gdb/doc/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* gdb.texinfo (Embedded Processors) <ARM>: Remove references to RDI.
    	<M32R>: Remove references to M32R/D.
    	<M68K>: Remove references to target dbug.
    	<MIPS Embedded>: Remove references to target r3900 and target
    	array.
    	<PowerPC Embedded>: Remove references to target dink32 and target
    	ppcbug, target sds
    	<PA, Sparclet, Sparclite, Z8000>: Delete nodes.

commit 40e0b27177e747600d3ec186458fe0e482a1cf77
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Aug 24 15:40:26 2015 +0100

    Delete the remaining ROM monitor targets
    
    Ref: https://sourceware.org/ml/gdb/2015-07/msg00011.html
    
    All of these targets use gdb/monitor.c, which has bit rotted
    years ago (I'd guess around ~6), and nobody seems to
    have noticed:
    
     | target         | source               |
     |----------------+----------------------|
     | target dbug    | gdb/dbug-rom.c       |
     | target picobug | gdb/microblaze-rom.c |
     | target dink32  | gdb/dink32-rom.c     |
     | target m32r    | gdb/m32r-rom.c       |
     | target mon2000 | gdb/m32r-rom.c       |
     | target ppcbug  | gdb/ppcbug-rom.c     |
    
    This deletes them, along with finally removing monitor.c.
    
    A manual update will be done separately.
    
    gdb/ChangeLog:
    2015-08-24  Pedro Alves  <palves@redhat.com>
    
    	* NEWS: Mention removed support for the various ROM monitors.
    	* Makefile.in (ALL_TARGET_OBS): Remove dbug-rom.o, dink32-rom.o,
    	ppcbug-rom.o, m32r-rom.o, dsrec.o and monitor.o from gdb_target_obs.
    	* configure.tgt (h8300-*-*): Remove monitor.o and m32r-rom.o from
    	gdb_target_obs.
    	(m68*-*-*): Remove monitor.o dbug-rom.o and dsrec.o from
    	gdb_target_obs.
    	(microblaze*-linux-*): Remove microblaze-rom.o, monitor.o and
    	dsrec.o from gdb_target_obs.
    	(microblaze*-*-*): Remove microblaze-rom.o, monitor.o and dsrec.o
    	from gdb_target_obs.
    	(powerpc-*-lynx*178): Remove monitor.o and dsrec.o from
    	gdb_target_obs.
    	(powerpc*-*-*): Remove monitor.o, dsrec.o, ppcbug-rom.o and
    	dink32-rom.o from gdb_target_obs.
    	(sh*-*-linux*): Remove monitor.o and dsrec.o from gdb_target_obs.
    	(sh*): Remove monitor.o and dsrec.o from gdb_target_obs.
    	* dbug-rom.c, dink32-rom.c, dsrec.c, m32r-rom.c, microblaze-rom.c,
    	monitor.c, monitor.h, ppcbug-rom.c, srec.h: Delete files.

commit 5f40e14d768b94f7fdc050aeba5ee62e6a8d5756
Author: Jan Stancek <jstancek@redhat.com>
Date:   Mon Aug 24 14:50:15 2015 +0100

    Fix the partial disassembly of a broken three byte instruction at the end of a function.
    
    opcodes	* i386-dis.c (print_insn): Fix decoding of three byte operands.
    
    tests	* gas/i386/intel.s: Add test of disassembly of a potential
    	three byte instuction at the end of a function.
    	* gas/i386/intel.d: Update expected disassembly.

commit 77c365df78441f7b968ec0f62c7ed9f5de36dc60
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Mon Aug 24 15:37:40 2015 +0200

    gnu_vector.exp: Avoid some more known FAILs
    
    This avoids two more types of FAILs with the gnu_vector test case.
    
    First, for POWER targets newer GCCs emit an ABI note when invoked with
    "-mcpu=native".  Then the test case fell back to non-native compile,
    producing code for a non-vector ABI.  But that is not supported by GDB.
    Thus the compiler note is now suppressed with "-Wno-psabi".
    
    Second, on s390 the test case produced FAILs after falling back to a
    non-vector ABI when using "finish" or "return" in a vector-valued
    function.  This was due to a long-standing known bug (Bug 8549).  This
    case is now detected, and KFAILs are emitted instead.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native
    	-Wno-psabi" if "-mcpu=native" fails.  For the tests with "finish"
    	and "return" use KFAIL when GDB can not read/write the vector
    	return value.

commit cfe101c6a8227b6b97ed2da85895db7d6083bfa6
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date:   Mon Aug 24 10:57:03 2015 +0100

    Missing parts of fixes for in-tree libiconv
    
    (Commit d23d1dff missed pushing the config/iconv.m4 change, and to
    regenerate binutils' configure.)
    
    Original description:
    
    This is the second in a series of patches to make a build with an
    in-tree GNU libiconv work as designed.
    
    Currently GDB is the only toolchain component which actually uses an
    in-tree libiconv.  This patch modifies the common AM_ICONV to use an
    in-tree libiconv when present and not already provided by libc.
    (GDB's workaround uses an in-tree libiconv even when libc provides
    iconv(3); I'm not sure when or why that would be desirable.)
    
    config/ChangeLog:
    2015-08-24  Yaakov Selkowitz  <yselkowi@redhat.com>
    
    	* iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present.
    
    binutils/ChangeLog:
    2015-08-24  Yaakov Selkowitz  <yselkowi@redhat.com>
    
    	* configure: Regenerate.

commit b83035f1f61c8749983aef1f51162947a284827d
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Mon Aug 24 00:00:07 2015 +0000

    Automatic date update in version.in

commit 5f329d5b1409dfb86e3eb6a22e9f84cc58c254b1
Author: Alan Modra <amodra@gmail.com>
Date:   Sun Aug 23 20:54:45 2015 +0930

    Reorder enum output_type for better code generation
    
    Works around a gcc bug #67328 for the most commonly used of bfd_link_pic
    and bfd_link_executable.
    
    	* bfdlink.h (enum output_type): Reorder enum.

commit d579c450dd97470b0601ceb5d3e3d926e7a1333e
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Sun Aug 23 00:00:07 2015 +0000

    Automatic date update in version.in

commit 595bce7595e076391e7147b0c6db57a8edf2e406
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Aug 22 13:24:34 2015 +0930

    Uninitialized vd_nodename
    
    Belt and braces fix.  Either of the changes here is sufficient to
    ensure vd_nodename is initialized properly.
    
    	* elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
    	Don't copy fields not set by _bfd_elf_swap_verdef_in.

commit 0d6b12851b08f5f71f7d97d2c832b899d63b5df2
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Sat Aug 22 00:00:09 2015 +0000

    Automatic date update in version.in

commit 99b0bb12cdb22489b403df6afe992b81bebbd9ec
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Aug 21 23:59:33 2015 +0100

    Fix ax.c:gdb_eval_agent_expr
    
    In C++ mode:
    
     src/gdb/gdbserver/ax.c: In function ‘eval_result_type gdb_eval_agent_expr(eval_agent_expr_context*, agent_expr*, ULONGEST*)’:
     src/gdb/gdbserver/ax.c:1335:11: error: invalid conversion from ‘int’ to ‘eval_result_type’ [-fpermissive]
         return 1;
    	    ^
    
    "1" as an enum eval_result_type is expr_eval_empty_expression, but
    clearly this wants to return expr_eval_unhandled_opcode.
    
    gdb/gdbserver/ChangeLog:
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	* ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
    	instead of literal 1.

commit f8904751117dc8d4d04e5c5286b71b854e6ebba5
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Aug 21 23:49:37 2015 +0100

    C++: Initialize a couple const globals
    
    In C++ mode, we get:
    
     src/gdb/gdbserver/tdesc.c:43:33: error: uninitialized const ‘default_description’ [-fpermissive]
      static const struct target_desc default_description;
    				  ^
     In file included from src/gdb/gdbserver/tdesc.c:19:0:
     src/gdb/gdbserver/tdesc.h:26:8: note: ‘const struct target_desc’ has no user-provided default constructor
      struct target_desc
    	 ^
    
    gdb/ChangeLog:
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	* frame.c (null_frame_id): Explicitly zero-initialize.
    
    gdb/gdbserver/ChangeLog:
    2015-08-21  Pedro Alves  <palves@redhat.com>
    
    	* tdesc.c (default_description): Explicitly zero-initialize.

commit 049412e38f9ac04654940173db63a37ebca9bfc3
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Aug 21 23:45:50 2015 +0100

    gdb/dwarf2read.c: rename a field for c++
    
    Fixes:
    
     ../../src/gdb/dwarf2read.c:127:15: error: declaration of ‘asection* dwarf2_section_info::<anonymous union>::asection’ [-fpermissive]
          asection *asection;
    		^
     In file included from ../../src/gdb/common/common-types.h:35:0,
    		  from ../../src/gdb/common/common-defs.h:44,
    		  from ../../src/gdb/defs.h:28,
    		  from ../../src/gdb/dwarf2read.c:31:
     ../bfd/bfd.h:1596:3: error: changes meaning of ‘asection’ from ‘typedef struct bfd_section asection’ [-fpermissive]
      } asection;
        ^
    
    gdb/ChangeLog:
    2015-08-21  Tom Tromey  <tromey@redhat.com>
    
    	* dwarf2read.c (struct dwarf2_section_info): Rename field
    	'asection' to 'section'.
    	(dwarf2_has_info, get_section_bfd_owner, get_section_bfd_section)
    	(dwarf2_locate_sections, dwarf2_locate_sections)
    	(locate_dwz_sections, locate_v1_virtual_dwo_sections)
    	(dwarf2_locate_dwo_sections, dwarf2_locate_dwo_sections)
    	(dwarf2_locate_v2_dwp_sections): Adjust.

commit 948578a989f8c666c9b0e92c9a50906724921f14
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Fri Aug 21 12:28:19 2015 -0400

    tui: don't overwrite a secondary prompt that was given no input
    
    This patch fixes the following bug in TUI:
    
      (gdb) break foo
      No symbol table is loaded.  Use the "file" command.
      Make breakpoint pending on future shared library load? (y or [n]) <ENTER>
    
    By submitting an empty command line to a secondary prompt, the line
    corresponding to the secondary prompt is undesirably cleared and
    overwritten.  Outside of a secondary prompt, clearing the prompt line
    after submitting an empty command line is intended behavior which
    complements GDB's repeat-command shorthand.  But inside a secondary
    prompt, this behavior is undesired since the shorthand is not applicable
    in that case.  We should retain the secondary-prompt line even when it's
    given no input.
    
    This patch makes sure that a prompt that was given an empty command line
    is cleared and overwritten only if it's not a secondary prompt.  To
    acheive this, a new predicate is defined which informs us whether the
    current input handler is a secondary prompt.
    
    gdb/ChangeLog:
    
    	* top.h (gdb_in_secondary_prompt_p): Declare.
    	* top.c (gdb_secondary_prompt_depth): Define.
    	(gdb_in_secondary_prompt_p): Define.
    	(gdb_readline_wrapper_cleanup): Decrement
    	gdb_secondary_prompt_depth.
    	(gdb_readline_wrapper): Increment gdb_secondary_prompt_depth.
    	* tui/tui-io.c (tui_getc): Don't clear the prompt line if we
    	are in a secondary prompt.

commit 7a8bcb88e77380fe9672b4f10777cc9e48011dd4
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Fri Aug 21 12:04:25 2015 -0400

    Use tui_putc to output newline entered by the user
    
    This is necessary to make sure that start_line is updated after a
    command has been entered.  Usually, start_line gets updated anyway
    because most commands output text, and outputting text is done through
    the function tui_puts, which updates start_line.  However if a command
    does not output text, then tui_puts will not get called and start_line
    will not get updated in time for the next prompt to be displayed.
    
    One can observe this bug by executing the command "delete" within TUI.
    After executing, the prompt line
    
      (gdb) delete
    
    gets overwritten by the next prompt.  With this patch, the prompt line
    gets preserved.
    
    gdb/ChangeLog:
    
    	* tui/tui-io.c (tui_getc): Use tui_putc instead of waddch to
    	emit the newline.

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

Summary of changes:
 bfd/ChangeLog                                      |   17 +
 bfd/bfd-in2.h                                      |    2 +-
 bfd/elf.c                                          |   23 +-
 bfd/reloc.c                                        |    2 +-
 bfd/version.h                                      |    2 +-
 binutils/ChangeLog                                 |    4 +
 binutils/configure                                 |   93 +-
 config/ChangeLog                                   |    4 +
 config/iconv.m4                                    |   47 +-
 gas/ChangeLog                                      |    5 +
 gas/config/tc-sparc.c                              |    1 +
 gas/testsuite/ChangeLog                            |   21 +
 gas/testsuite/gas/i386/intel.d                     |    4 +
 gas/testsuite/gas/i386/intel.s                     |   11 +
 gas/testsuite/gas/mips/micromips32-move.d          |   10 +-
 gas/testsuite/gas/mips/move.d                      |   10 +-
 gas/testsuite/gas/mips/move.s                      |    8 +-
 gas/testsuite/gas/sparc/rdpr.d                     |    1 +
 gas/testsuite/gas/sparc/rdpr.s                     |    1 +
 gas/testsuite/gas/sparc/wrpr.d                     |    1 +
 gas/testsuite/gas/sparc/wrpr.s                     |    1 +
 gdb/ChangeLog                                      |  441 ++++
 gdb/Makefile.in                                    |   11 +-
 gdb/NEWS                                           |   13 +
 gdb/aarch64-linux-nat.c                            |  144 +--
 gdb/ada-lang.c                                     |    5 +-
 gdb/block.c                                        |   15 +
 gdb/block.h                                        |   11 +
 gdb/buildsym.c                                     |   19 +-
 gdb/buildsym.h                                     |   15 +-
 gdb/c-exp.y                                        |    5 +-
 gdb/coffread.c                                     |    6 +-
 gdb/common/gdb_sys_time.h                          |   38 +
 gdb/compile/compile-c-symbols.c                    |   74 +-
 gdb/compile/compile-loc2c.c                        |    2 +-
 gdb/config/aarch64/linux.mh                        |    3 +-
 gdb/configure.tgt                                  |   31 +-
 gdb/dbug-rom.c                                     |  176 --
 gdb/dbxread.c                                      |    8 +-
 gdb/defs.h                                         |   20 +-
 gdb/dink32-rom.c                                   |  179 --
 gdb/doc/ChangeLog                                  |   16 +
 gdb/doc/gdb.texinfo                                |  407 +----
 gdb/dsrec.c                                        |  316 ---
 gdb/dwarf2loc.c                                    |   57 +-
 gdb/dwarf2loc.h                                    |   11 +-
 gdb/dwarf2read.c                                   |  138 +-
 gdb/event-loop.c                                   |   18 +-
 gdb/event-loop.h                                   |    9 +
 gdb/exec.c                                         |    7 +-
 gdb/f-exp.y                                        |    5 +-
 gdb/findvar.c                                      |  168 ++-
 gdb/frame.c                                        |    2 +-
 gdb/gdb_select.h                                   |    2 +-
 gdb/gdb_usleep.c                                   |    3 +-
 gdb/gdbserver/ChangeLog                            |   91 +
 gdb/gdbserver/Makefile.in                          |    3 +
 gdb/gdbserver/ax.c                                 |    2 +-
 gdb/gdbserver/configure.srv                        |    1 +
 gdb/gdbserver/debug.c                              |    2 +-
 gdb/gdbserver/event-loop.c                         |    2 +-
 gdb/gdbserver/inferiors.c                          |    8 +
 gdb/gdbserver/inferiors.h                          |    3 +
 gdb/gdbserver/linux-aarch64-low.c                  |  188 +--
 gdb/gdbserver/remote-utils.c                       |    9 +-
 gdb/gdbserver/spu-low.c                            |    2 +-
 gdb/gdbserver/tdesc.c                              |    2 +-
 gdb/gdbserver/tracepoint.c                         |    2 +-
 gdb/gdbtypes.c                                     |    7 +-
 gdb/gnulib/aclocal.m4                              |    4 +
 gdb/gnulib/config.in                               |  205 ++-
 gdb/gnulib/configure                               | 2077 ++++++++++++------
 gdb/gnulib/import/Makefile.am                      |   75 +-
 gdb/gnulib/import/Makefile.in                      |  129 +-
 gdb/gnulib/import/alloca.in.h                      |    2 +-
 gdb/gnulib/import/basename-lgpl.c                  |    2 +-
 gdb/gnulib/import/canonicalize-lgpl.c              |   10 +-
 gdb/gnulib/import/config.charset                   |    6 +-
 gdb/gnulib/import/dirent.in.h                      |    4 +-
 gdb/gnulib/import/dirfd.c                          |    2 +-
 gdb/gnulib/import/dirname-lgpl.c                   |    2 +-
 gdb/gnulib/import/dirname.h                        |   10 +-
 gdb/gnulib/import/dosname.h                        |    2 +-
 gdb/gnulib/import/errno.in.h                       |    2 +-
 gdb/gnulib/import/extra/snippet/arg-nonnull.h      |    2 +-
 gdb/gnulib/import/extra/snippet/c++defs.h          |    2 +-
 gdb/gnulib/import/extra/snippet/warn-on-use.h      |    2 +-
 gdb/gnulib/import/extra/update-copyright           |    8 +-
 gdb/gnulib/import/float+.h                         |    2 +-
 gdb/gnulib/import/float.c                          |    2 +-
 gdb/gnulib/import/float.in.h                       |    2 +-
 gdb/gnulib/import/fnmatch.c                        |    2 +-
 gdb/gnulib/import/fnmatch.in.h                     |    2 +-
 gdb/gnulib/import/fnmatch_loop.c                   |    6 +-
 gdb/gnulib/import/fpucw.h                          |    2 +-
 gdb/gnulib/import/frexp.c                          |    2 +-
 gdb/gnulib/import/frexpl.c                         |    2 +-
 gdb/gnulib/import/gettimeofday.c                   |  154 ++
 gdb/gnulib/import/inttypes.in.h                    |   22 +-
 gdb/gnulib/import/isnan.c                          |   20 +-
 gdb/gnulib/import/isnand-nolibm.h                  |    2 +-
 gdb/gnulib/import/isnand.c                         |    2 +-
 gdb/gnulib/import/isnanl-nolibm.h                  |    2 +-
 gdb/gnulib/import/isnanl.c                         |    2 +-
 gdb/gnulib/import/itold.c                          |    2 +-
 gdb/gnulib/import/localcharset.c                   |   88 +-
 gdb/gnulib/import/localcharset.h                   |    2 +-
 gdb/gnulib/import/lstat.c                          |    2 +-
 gdb/gnulib/import/m4/00gnulib.m4                   |   22 +-
 gdb/gnulib/import/m4/absolute-header.m4            |  102 +
 gdb/gnulib/import/m4/alloca.m4                     |    2 +-
 gdb/gnulib/import/m4/canonicalize.m4               |    2 +-
 gdb/gnulib/import/m4/codeset.m4                    |    2 +-
 gdb/gnulib/import/m4/configmake.m4                 |   13 +-
 gdb/gnulib/import/m4/dirent_h.m4                   |    2 +-
 gdb/gnulib/import/m4/dirfd.m4                      |    2 +-
 gdb/gnulib/import/m4/dirname.m4                    |    2 +-
 gdb/gnulib/import/m4/double-slash-root.m4          |    2 +-
 gdb/gnulib/import/m4/eealloc.m4                    |    2 +-
 gdb/gnulib/import/m4/errno_h.m4                    |    2 +-
 gdb/gnulib/import/m4/exponentd.m4                  |    2 +-
 gdb/gnulib/import/m4/exponentl.m4                  |    2 +-
 gdb/gnulib/import/m4/extensions.m4                 |   56 +-
 gdb/gnulib/import/m4/extern-inline.m4              |   79 +-
 gdb/gnulib/import/m4/fcntl-o.m4                    |    2 +-
 gdb/gnulib/import/m4/float_h.m4                    |    2 +-
 gdb/gnulib/import/m4/fnmatch.m4                    |    2 +-
 gdb/gnulib/import/m4/fpieee.m4                     |    2 +-
 gdb/gnulib/import/m4/frexp.m4                      |   12 +-
 gdb/gnulib/import/m4/frexpl.m4                     |    2 +-
 gdb/gnulib/import/m4/gettimeofday.m4               |  138 ++
 gdb/gnulib/import/m4/glibc21.m4                    |    2 +-
 gdb/gnulib/import/m4/gnulib-cache.m4               |    2 +-
 gdb/gnulib/import/m4/gnulib-common.m4              |  126 +-
 gdb/gnulib/import/m4/gnulib-comp.m4                |   20 +-
 gdb/gnulib/import/m4/gnulib-tool.m4                |    2 +-
 gdb/gnulib/import/m4/include_next.m4               |   55 +-
 gdb/gnulib/import/m4/inttypes-pri.m4               |    2 +-
 gdb/gnulib/import/m4/inttypes.m4                   |    3 +-
 gdb/gnulib/import/m4/isnand.m4                     |    2 +-
 gdb/gnulib/import/m4/isnanl.m4                     |   43 +-
 gdb/gnulib/import/m4/largefile.m4                  |   25 +-
 gdb/gnulib/import/m4/localcharset.m4               |    2 +-
 gdb/gnulib/import/m4/locale-fr.m4                  |    2 +-
 gdb/gnulib/import/m4/locale-ja.m4                  |    2 +-
 gdb/gnulib/import/m4/locale-zh.m4                  |    2 +-
 gdb/gnulib/import/m4/longlong.m4                   |    2 +-
 gdb/gnulib/import/m4/lstat.m4                      |   50 +-
 gdb/gnulib/import/m4/malloc.m4                     |    2 +-
 gdb/gnulib/import/m4/malloca.m4                    |    2 +-
 gdb/gnulib/import/m4/math_h.m4                     |    2 +-
 gdb/gnulib/import/m4/mbrtowc.m4                    |   48 +-
 gdb/gnulib/import/m4/mbsinit.m4                    |    2 +-
 gdb/gnulib/import/m4/mbsrtowcs.m4                  |    2 +-
 gdb/gnulib/import/m4/mbstate_t.m4                  |    2 +-
 gdb/gnulib/import/m4/memchr.m4                     |    2 +-
 gdb/gnulib/import/m4/memmem.m4                     |    2 +-
 gdb/gnulib/import/m4/mmap-anon.m4                  |    2 +-
 gdb/gnulib/import/m4/multiarch.m4                  |    2 +-
 gdb/gnulib/import/m4/nocrash.m4                    |    2 +-
 gdb/gnulib/import/m4/off_t.m4                      |    2 +-
 gdb/gnulib/import/m4/pathmax.m4                    |    2 +-
 gdb/gnulib/import/m4/readlink.m4                   |    2 +-
 gdb/gnulib/import/m4/rename.m4                     |    2 +-
 gdb/gnulib/import/m4/rmdir.m4                      |    2 +-
 gdb/gnulib/import/m4/ssize_t.m4                    |    2 +-
 gdb/gnulib/import/m4/stat.m4                       |    2 +-
 gdb/gnulib/import/m4/stdbool.m4                    |    2 +-
 gdb/gnulib/import/m4/stddef_h.m4                   |   10 +-
 gdb/gnulib/import/m4/stdint.m4                     |    2 +-
 gdb/gnulib/import/m4/stdio_h.m4                    |   31 +-
 gdb/gnulib/import/m4/stdlib_h.m4                   |   10 +-
 gdb/gnulib/import/m4/string_h.m4                   |    2 +-
 gdb/gnulib/import/m4/strstr.m4                     |    2 +-
 gdb/gnulib/import/m4/strtok_r.m4                   |    2 +-
 gdb/gnulib/import/m4/sys_socket_h.m4               |  176 ++
 gdb/gnulib/import/m4/sys_stat_h.m4                 |    2 +-
 gdb/gnulib/import/m4/sys_time_h.m4                 |  111 +
 gdb/gnulib/import/m4/sys_types_h.m4                |    6 +-
 gdb/gnulib/import/m4/time_h.m4                     |   31 +-
 gdb/gnulib/import/m4/unistd_h.m4                   |    7 +-
 gdb/gnulib/import/m4/warn-on-use.m4                |    2 +-
 gdb/gnulib/import/m4/wchar_h.m4                    |    2 +-
 gdb/gnulib/import/m4/wchar_t.m4                    |    2 +-
 gdb/gnulib/import/m4/wctype_h.m4                   |    2 +-
 gdb/gnulib/import/m4/wint_t.m4                     |    2 +-
 gdb/gnulib/import/malloc.c                         |    2 +-
 gdb/gnulib/import/malloca.c                        |   31 +-
 gdb/gnulib/import/malloca.h                        |    4 +-
 gdb/gnulib/import/math.in.h                        |    5 +-
 gdb/gnulib/import/mbrtowc.c                        |    9 +-
 gdb/gnulib/import/mbsinit.c                        |    2 +-
 gdb/gnulib/import/mbsrtowcs-impl.h                 |    2 +-
 gdb/gnulib/import/mbsrtowcs-state.c                |    2 +-
 gdb/gnulib/import/mbsrtowcs.c                      |    2 +-
 gdb/gnulib/import/memchr.c                         |    2 +-
 gdb/gnulib/import/memmem.c                         |    2 +-
 gdb/gnulib/import/pathmax.h                        |    2 +-
 gdb/gnulib/import/readlink.c                       |    2 +-
 gdb/gnulib/import/ref-add.sin                      |    2 +-
 gdb/gnulib/import/ref-del.sin                      |    2 +-
 gdb/gnulib/import/rename.c                         |    8 +-
 gdb/gnulib/import/rmdir.c                          |    2 +-
 gdb/gnulib/import/same-inode.h                     |    2 +-
 gdb/gnulib/import/stat.c                           |    2 +-
 gdb/gnulib/import/stdbool.in.h                     |    2 +-
 gdb/gnulib/import/stddef.in.h                      |   54 +-
 gdb/gnulib/import/stdint.in.h                      |    5 +-
 gdb/gnulib/import/stdio.c                          |    3 -
 gdb/gnulib/import/stdio.in.h                       |   56 +-
 gdb/gnulib/import/stdlib.in.h                      |   46 +-
 gdb/gnulib/import/str-two-way.h                    |    2 +-
 gdb/gnulib/import/streq.h                          |    2 +-
 gdb/gnulib/import/string.in.h                      |   23 +-
 gdb/gnulib/import/stripslash.c                     |    2 +-
 gdb/gnulib/import/strnlen1.c                       |    2 +-
 gdb/gnulib/import/strnlen1.h                       |    2 +-
 gdb/gnulib/import/strstr.c                         |    2 +-
 gdb/gnulib/import/strtok_r.c                       |    2 +-
 gdb/gnulib/import/sys_stat.in.h                    |    6 +-
 gdb/gnulib/import/sys_time.in.h                    |  213 ++
 gdb/gnulib/import/sys_types.in.h                   |    4 +-
 gdb/gnulib/import/time.in.h                        |   75 +-
 gdb/gnulib/import/unistd.in.h                      |   91 +-
 gdb/gnulib/import/verify.h                         |  136 +-
 gdb/gnulib/import/wchar.in.h                       |   11 +-
 gdb/gnulib/import/wctype.in.h                      |   12 +-
 gdb/gnulib/update-gnulib.sh                        |    2 +-
 gdb/go-exp.y                                       |    5 +-
 gdb/guile/scm-frame.c                              |    9 +-
 gdb/guile/scm-symbol.c                             |    6 +-
 gdb/infcmd.c                                       |    2 +-
 gdb/infrun.c                                       |    7 +-
 gdb/jv-exp.y                                       |    4 +-
 gdb/language.h                                     |   12 +-
 gdb/m2-exp.y                                       |    5 +-
 gdb/m32r-rom.c                                     |  634 -----
 gdb/maint.c                                        |    2 +-
 gdb/mi/mi-main.c                                   |    2 +-
 gdb/mi/mi-parse.h                                  |    2 +-
 gdb/microblaze-rom.c                               |  192 --
 gdb/monitor.c                                      | 2417 --------------------
 gdb/monitor.h                                      |  261 ---
 gdb/nat/aarch64-linux-hw-point.c                   |   88 +
 gdb/nat/aarch64-linux-hw-point.h                   |    5 +-
 gdb/nat/aarch64-linux.c                            |   80 +
 gdb/{gdb_usleep.c => nat/aarch64-linux.h}          |   26 +-
 gdb/objfiles.c                                     |   91 +
 gdb/objfiles.h                                     |   22 +
 gdb/p-exp.y                                        |    5 +-
 gdb/ppcbug-rom.c                                   |  224 --
 gdb/printcmd.c                                     |    6 +-
 gdb/python/py-finishbreakpoint.c                   |    2 +-
 gdb/python/py-frame.c                              |    9 +-
 gdb/python/py-framefilter.c                        |   29 +-
 gdb/python/py-symbol.c                             |    6 +-
 gdb/remote-fileio.c                                |    2 +-
 gdb/remote-m32r-sdi.c                              |    2 +-
 gdb/remote.c                                       |   49 +-
 gdb/ser-base.c                                     |    2 +-
 gdb/ser-pipe.c                                     |    2 +-
 gdb/ser-tcp.c                                      |    2 +-
 gdb/ser-unix.c                                     |    2 +-
 gdb/srec.h                                         |   35 -
 gdb/stack.c                                        |    8 +-
 gdb/symfile.c                                      |   14 +-
 gdb/symtab.h                                       |   19 +
 gdb/target-delegates.c                             |   26 +
 gdb/target-memory.c                                |    2 +-
 gdb/target.c                                       |    8 +
 gdb/target.h                                       |   10 +
 gdb/testsuite/ChangeLog                            |   48 +
 gdb/testsuite/config/m32r-stub.exp                 |    1 -
 gdb/testsuite/gdb.base/call-ar-st.exp              |    5 -
 gdb/testsuite/gdb.base/call-rt-st.exp              |    5 -
 gdb/testsuite/gdb.base/call-strs.exp               |    5 -
 gdb/testsuite/gdb.base/default.exp                 |   33 +-
 gdb/testsuite/gdb.base/funcargs.exp                |   22 +-
 gdb/testsuite/gdb.base/gnu_vector.exp              |   66 +-
 .../inline-markers.c => gdb.base/nested-subp1.c}   |   35 +-
 gdb/testsuite/gdb.base/nested-subp1.exp            |   55 +
 .../inline-markers.c => gdb.base/nested-subp2.c}   |   40 +-
 gdb/testsuite/gdb.base/nested-subp2.exp            |   64 +
 gdb/testsuite/gdb.base/nested-subp3.c              |   66 +
 gdb/testsuite/gdb.base/nested-subp3.exp            |   55 +
 gdb/testsuite/gdb.opt/inline-bt.c                  |    1 +
 gdb/testsuite/gdb.opt/inline-cmds.c                |    1 +
 gdb/testsuite/gdb.opt/inline-locals.c              |    1 +
 gdb/testsuite/gdb.opt/inline-markers.c             |    5 +-
 .../gdb.server/connect-without-multi-process.c}    |   15 +-
 .../gdb.server/connect-without-multi-process.exp   |   61 +
 gdb/top.c                                          |   18 +
 gdb/top.h                                          |    4 +
 gdb/tui/tui-io.c                                   |    4 +-
 gdb/utils.c                                        |   14 +-
 gdb/valops.c                                       |   35 +-
 gdb/value.h                                        |    2 +
 gdb/xcoffread.c                                    |    5 +-
 include/ChangeLog                                  |    4 +
 include/bfdlink.h                                  |    2 +-
 opcodes/ChangeLog                                  |    9 +
 opcodes/i386-dis.c                                 |    6 +-
 opcodes/sparc-dis.c                                |    8 +-
 303 files changed, 6081 insertions(+), 6903 deletions(-)
 create mode 100644 gdb/common/gdb_sys_time.h
 delete mode 100644 gdb/dbug-rom.c
 delete mode 100644 gdb/dink32-rom.c
 delete mode 100644 gdb/dsrec.c
 mode change 100644 => 100755 gdb/gnulib/import/extra/update-copyright
 create mode 100644 gdb/gnulib/import/gettimeofday.c
 create mode 100644 gdb/gnulib/import/m4/absolute-header.m4
 create mode 100644 gdb/gnulib/import/m4/gettimeofday.m4
 create mode 100644 gdb/gnulib/import/m4/sys_socket_h.m4
 create mode 100644 gdb/gnulib/import/m4/sys_time_h.m4
 delete mode 100644 gdb/gnulib/import/stdio.c
 create mode 100644 gdb/gnulib/import/sys_time.in.h
 delete mode 100644 gdb/m32r-rom.c
 delete mode 100644 gdb/microblaze-rom.c
 delete mode 100644 gdb/monitor.c
 delete mode 100644 gdb/monitor.h
 create mode 100644 gdb/nat/aarch64-linux.c
 copy gdb/{gdb_usleep.c => nat/aarch64-linux.h} (68%)
 delete mode 100644 gdb/ppcbug-rom.c
 delete mode 100644 gdb/srec.h
 delete mode 100644 gdb/testsuite/config/m32r-stub.exp
 copy gdb/testsuite/{gdb.opt/inline-markers.c => gdb.base/nested-subp1.c} (58%)
 create mode 100644 gdb/testsuite/gdb.base/nested-subp1.exp
 copy gdb/testsuite/{gdb.opt/inline-markers.c => gdb.base/nested-subp2.c} (53%)
 create mode 100644 gdb/testsuite/gdb.base/nested-subp2.exp
 create mode 100644 gdb/testsuite/gdb.base/nested-subp3.c
 create mode 100644 gdb/testsuite/gdb.base/nested-subp3.exp
 copy gdb/{gnulib/import/isnand.c => testsuite/gdb.server/connect-without-multi-process.c} (71%)
 create mode 100644 gdb/testsuite/gdb.server/connect-without-multi-process.exp

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dcd0e88..18a5cd0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,20 @@
+2015-08-25  Nick Clifton  <nickc@redhat.com>
+
+	PR binutils/18854
+	* elf.c (bfd_section_from_shdr): Replace assertions with warnings
+	about multiple symbol tables.
+
+2015-08-25  Renlin Li  <renlin.li@arm.com>
+
+	* reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): Use LP64 instead of
+	ILP64.
+	* bfd-in2.h: Regenerate.
+
+2015-08-22  Alan Modra  <amodra@gmail.com>
+
+	* elf.c (_bfd_elf_slurp_version_tables): Always init vd_nodename.
+	Don't copy fields not set by _bfd_elf_swap_verdef_in.
+
 2015-08-19  Jiong Wang  <jiong.wang@arm.com>
 
 	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 6ba3641..82bf269 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5753,7 +5753,7 @@ BFD_RELOC_AARCH64_ADR_GOTPAGE.  Valid in ILP32 ABI only.  */
   BFD_RELOC_AARCH64_LD32_GOT_LO12_NC,
 
 /* Unsigned 15 bit byte offset for 64 bit load/store from the page of
-the GOT entry for this symbol. Valid in ILP64 ABI only.  */
+the GOT entry for this symbol.  Valid in LP64 ABI only.  */
   BFD_RELOC_AARCH64_LD64_GOTOFF_LO15,
 
 /* Scaled 14 bit byte offset to the page base of the global offset table.  */
diff --git a/bfd/elf.c b/bfd/elf.c
index f20679e..81cc1db 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1833,7 +1833,15 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
 	  goto success;
 	}
 
-      BFD_ASSERT (elf_onesymtab (abfd) == 0);
+      /* PR 18854: A binary might contain more than one symbol table.
+	 Unusual, but possible.  Warn, but continue.  */
+      if (elf_onesymtab (abfd) != 0)
+	{
+	  (*_bfd_error_handler)
+	    (_("%B: warning: multiple symbol tables detected - ignoring the table in section %u"),
+	     abfd, shindex);
+	  goto success;
+	}
       elf_onesymtab (abfd) = shindex;
       elf_tdata (abfd)->symtab_hdr = *hdr;
       elf_elfsections (abfd)[shindex] = hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -1898,7 +1906,15 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
 	  goto success;
 	}
 
-      BFD_ASSERT (elf_dynsymtab (abfd) == 0);
+      /* PR 18854: A binary might contain more than one dynamic symbol table.
+	 Unusual, but possible.  Warn, but continue.  */
+      if (elf_dynsymtab (abfd) != 0)
+	{
+	  (*_bfd_error_handler)
+	    (_("%B: warning: multiple dynamic symbol tables detected - ignoring the table in section %u"),
+	     abfd, shindex);
+	  goto success;
+	}
       elf_dynsymtab (abfd) = shindex;
       elf_tdata (abfd)->dynsymtab_hdr = *hdr;
       elf_elfsections (abfd)[shindex] = hdr = &elf_tdata (abfd)->dynsymtab_hdr;
@@ -7871,7 +7887,7 @@ error_return_verref:
 	    goto error_return_bad_verdef;
 
 	  iverdef = &iverdefarr[(iverdefmem.vd_ndx & VERSYM_VERSION) - 1];
-	  memcpy (iverdef, &iverdefmem, sizeof (Elf_Internal_Verdef));
+	  memcpy (iverdef, &iverdefmem, offsetof (Elf_Internal_Verdef, vd_bfd));
 
 	  iverdef->vd_bfd = abfd;
 
@@ -7920,6 +7936,7 @@ error_return_verref:
 			  ((bfd_byte *) everdaux + iverdaux->vda_next));
 	    }
 
+	  iverdef->vd_nodename = NULL;
 	  if (iverdef->vd_cnt)
 	    iverdef->vd_nodename = iverdef->vd_auxptr->vda_nodename;
 
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 3d329a5..caa6fb4 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -6793,7 +6793,7 @@ ENUM
   BFD_RELOC_AARCH64_LD64_GOTOFF_LO15
 ENUMDOC
   Unsigned 15 bit byte offset for 64 bit load/store from the page of
-  the GOT entry for this symbol. Valid in ILP64 ABI only.
+  the GOT entry for this symbol.  Valid in LP64 ABI only.
 ENUM
   BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
 ENUMDOC
diff --git a/bfd/version.h b/bfd/version.h
index a00b9d7..c770d60 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20150821
+#define BFD_VERSION_DATE 20150825
 #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 caa0829..004d9a3 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-24  Yaakov Selkowitz  <yselkowi@redhat.com>
+
+	* configure: Regenerate.
+
 2015-08-17  Alan Modra  <amodra@gmail.com>
 
 	* configure: Regenerate.
diff --git a/binutils/configure b/binutils/configure
index c47d0f8..82572e8 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -14135,31 +14135,6 @@ fi
 
 
 
-          am_save_CPPFLAGS="$CPPFLAGS"
-
-  for element in $INCICONV; do
-    haveit=
-    for x in $CPPFLAGS; do
-
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
-    fi
-  done
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
 $as_echo_n "checking for iconv... " >&6; }
 if test "${am_cv_func_iconv+set}" = set; then :
@@ -14168,6 +14143,8 @@ else
 
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
+                    am_save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $INCICONV"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
@@ -14187,8 +14164,49 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+    CPPFLAGS="$am_save_CPPFLAGS"
+
+    if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
+      for _libs in .libs _libs; do
+        am_save_CPPFLAGS="$CPPFLAGS"
+        am_save_LIBS="$LIBS"
+        CPPFLAGS="$CPPFLAGS -I../libiconv/include"
+        LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  INCICONV="-I../libiconv/include"
+          LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
+          LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
+          am_cv_lib_iconv=yes
+          am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        CPPFLAGS="$am_save_CPPFLAGS"
+        LIBS="$am_save_LIBS"
+        if test "$am_cv_func_iconv" = "yes"; then
+          break
+        fi
+      done
+    fi
+
     if test "$am_cv_func_iconv" != yes; then
+      am_save_CPPFLAGS="$CPPFLAGS"
       am_save_LIBS="$LIBS"
+      CPPFLAGS="$LIBS $INCICONV"
       LIBS="$LIBS $LIBICONV"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -14210,6 +14228,7 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+      CPPFLAGS="$am_save_CPPFLAGS"
       LIBS="$am_save_LIBS"
     fi
 
@@ -14222,12 +14241,34 @@ $as_echo "#define HAVE_ICONV 1" >>confdefs.h
 
   fi
   if test "$am_cv_lib_iconv" = yes; then
+
+  for element in $INCICONV; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
 $as_echo_n "checking how to link with libiconv... " >&6; }
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
 $as_echo "$LIBICONV" >&6; }
   else
-            CPPFLAGS="$am_save_CPPFLAGS"
     LIBICONV=
     LTLIBICONV=
   fi
diff --git a/config/ChangeLog b/config/ChangeLog
index 102fc47..6847cb9 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-24  Yaakov Selkowitz  <yselkowi@redhat.com>
+
+	* iconv.m4 (AM_ICONV_LINK): Use in-tree libiconv when present.
+
 2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
 
 	Sync with GCC
diff --git a/config/iconv.m4 b/config/iconv.m4
index c5f3579..5f9304a 100644
--- a/config/iconv.m4
+++ b/config/iconv.m4
@@ -7,6 +7,7 @@ dnl that contains a configuration script generated by Autoconf, under
 dnl the same distribution terms as the rest of that program.
 
 dnl From Bruno Haible.
+dnl with modifications to support building with in-tree libiconv
 
 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 [
@@ -28,24 +29,51 @@ AC_DEFUN([AM_ICONV_LINK],
   dnl accordingly.
   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
-  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
-  dnl because if the user has installed libiconv and not disabled its use
-  dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
-  am_save_CPPFLAGS="$CPPFLAGS"
-  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
-
   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
+    dnl Add $INCICONV to CPPFLAGS before performing the first check,
+    dnl because if the user has installed libiconv and not disabled its use
+    dnl via --without-libiconv-prefix, he wants to use it. This first
+    dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+    am_save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $INCICONV"
     AC_TRY_LINK([#include <stdlib.h>
 #include <iconv.h>],
       [iconv_t cd = iconv_open("","");
        iconv(cd,NULL,NULL,NULL,NULL);
        iconv_close(cd);],
       am_cv_func_iconv=yes)
+    CPPFLAGS="$am_save_CPPFLAGS"
+
+    if test "$am_cv_func_iconv" != yes && test -d ../libiconv; then
+      for _libs in .libs _libs; do
+        am_save_CPPFLAGS="$CPPFLAGS"
+        am_save_LIBS="$LIBS"
+        CPPFLAGS="$CPPFLAGS -I../libiconv/include"
+        LIBS="$LIBS ../libiconv/lib/$_libs/libiconv.a"
+        AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+          [iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);],
+          INCICONV="-I../libiconv/include"
+          LIBICONV='${top_builddir}'/../libiconv/lib/$_libs/libiconv.a
+          LTLIBICONV='${top_builddir}'/../libiconv/lib/libiconv.la
+          am_cv_lib_iconv=yes
+          am_cv_func_iconv=yes)
+        CPPFLAGS="$am_save_CPPFLAGS"
+        LIBS="$am_save_LIBS"
+        if test "$am_cv_func_iconv" = "yes"; then
+          break
+        fi
+      done
+    fi
+
     if test "$am_cv_func_iconv" != yes; then
+      am_save_CPPFLAGS="$CPPFLAGS"
       am_save_LIBS="$LIBS"
+      CPPFLAGS="$LIBS $INCICONV"
       LIBS="$LIBS $LIBICONV"
       AC_TRY_LINK([#include <stdlib.h>
 #include <iconv.h>],
@@ -54,6 +82,7 @@ AC_DEFUN([AM_ICONV_LINK],
          iconv_close(cd);],
         am_cv_lib_iconv=yes
         am_cv_func_iconv=yes)
+      CPPFLAGS="$am_save_CPPFLAGS"
       LIBS="$am_save_LIBS"
     fi
   ])
@@ -61,12 +90,10 @@ AC_DEFUN([AM_ICONV_LINK],
     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
   fi
   if test "$am_cv_lib_iconv" = yes; then
+    AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
     AC_MSG_CHECKING([how to link with libiconv])
     AC_MSG_RESULT([$LIBICONV])
   else
-    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
-    dnl either.
-    CPPFLAGS="$am_save_CPPFLAGS"
     LIBICONV=
     LTLIBICONV=
   fi
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3bcd8e6..02d94ad 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+	* config/tc-sparc.c (priv_reg_table): New privileged register
+	%pmcdper.
+
 2015-08-21  Nick Clifton  <nickc@redhat.com>
 
 	PR gas/18581
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 6e7a3ef..28e6ec8 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -805,6 +805,7 @@ struct priv_reg_entry priv_reg_table[] =
   {"wstate", 14},
   {"fq", 15},
   {"gl", 16},
+  {"pmcdper", 23},
   {"ver", 31},
   {"", -1},			/* End marker.  */
 };
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 2951966..f6f8b37 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,24 @@
+2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+	* gas/sparc/wrpr.s: Test writing to the privileged %pmcdper
+	register.
+	* gas/sparc/wrpr.d: ...and the expected result.
+	* gas/sparc/rdpr.s: Test reading from the privileged %pmcdper
+	register.
+	* gas/sparc/rdpr.d: ...and the expected result.
+
+2015-08-25  Simon Dardis  <Simon.Dardis@imgtec.com>
+
+	* gas/mips/micromips32-move.d: Update expected disassembly.
+	* gas/mips/move.d: Likewise.
+	* gas/mips/move.s: Fix for some MIPS configurations.
+
+2015-08-24  Jan Stancek  <jstancek@redhat.com>
+
+	* gas/i386/intel.s: Add test of disassembly of a potential
+	three byte instuction at the end of a function.
+	* gas/i386/intel.d: Update expected disassembly.
+
 2015-08-21  Nick Clifton  <nickc@redhat.com>
 
 	PR gas/18581
diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d
index 45a66a5..d10b4f0 100644
--- a/gas/testsuite/gas/i386/intel.d
+++ b/gas/testsuite/gas/i386/intel.d
@@ -698,4 +698,8 @@ Disassembly of section .text:
 [ 	]*[a-f0-9]+:	0f 4b 90 90 90 90 90 	cmovnp -0x6f6f6f70\(%eax\),%edx
 [ 	]*[a-f0-9]+:	66 0f 4a 90 90 90 90 90 	cmovp  -0x6f6f6f70\(%eax\),%dx
 [ 	]*[a-f0-9]+:	66 0f 4b 90 90 90 90 90 	cmovnp -0x6f6f6f70\(%eax\),%dx
+[ 	]*[a-f0-9]+:	24 2f                	and    \$0x2f,%al
+[ 	]*[a-f0-9]+:	0f                   	\.byte 0xf
+[a-f0-9]+ <barn>:
+[ 	]*[a-f0-9]+:	0f ba e2 03          	bt     \$0x3,%edx
 #pass
diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s
index a3a07b3..045d6ae 100644
--- a/gas/testsuite/gas/i386/intel.s
+++ b/gas/testsuite/gas/i386/intel.s
@@ -698,3 +698,14 @@ fidivr  dword ptr [ebx]
  cmovpo edx, 0x90909090[eax]
  cmovpe  dx, 0x90909090[eax]
  cmovpo dx, 0x90909090[eax]
+
+	# Test that disassembly of a partial instruction shows the partial byte:
+	# https://www.sourceware.org/ml/binutils/2015-08/msg00226.html
+	.byte 0x24
+	.byte 0x2f
+	.byte 0x0f
+barn:
+        .byte 0x0f
+        .byte 0xba
+        .byte 0xe2
+        .byte 0x03
diff --git a/gas/testsuite/gas/mips/micromips32-move.d b/gas/testsuite/gas/mips/micromips32-move.d
index 1a30f06..b13d927 100644
--- a/gas/testsuite/gas/mips/micromips32-move.d
+++ b/gas/testsuite/gas/mips/micromips32-move.d
@@ -1,4 +1,4 @@
-#objdump: -dr -m mips:micromips
+#objdump: -dr -m mips:micromips -M reg-names=numeric
 #name: microMIPS insn32 move test
 #source: micromips32-move.s
 
@@ -8,7 +8,7 @@
 
 Disassembly of section .text:
 0+ <.*>:
-   0:	001f 6a90 	move	t5,ra
-   4:	001f 6950 	move	t5,ra
-   8:	581f 6950 	move	t5,ra
-   c:	001f 6a90 	move	t5,ra
+   0:	001f 6a90 	move	\$13,\$31
+   4:	001f 6950 	move	\$13,\$31
+   8:	581f 6950 	move	\$13,\$31
+   c:	001f 6a90 	move	\$13,\$31
diff --git a/gas/testsuite/gas/mips/move.d b/gas/testsuite/gas/mips/move.d
index aa978ea..28a9673 100644
--- a/gas/testsuite/gas/mips/move.d
+++ b/gas/testsuite/gas/mips/move.d
@@ -1,4 +1,4 @@
-#objdump: -dr
+#objdump: -dr -M reg-names=numeric
 #name: MIPS move disassembly test
 #source: move.s
 
@@ -8,7 +8,7 @@
 
 Disassembly of section .text:
 0+ <.*>:
-   0:	03e06825 	move	t5,ra
-   4:	03e06821 	move	t5,ra
-   8:	03e0682d 	move	t5,ra
-   c:	03e06825 	move	t5,ra
+   0:	03e08025 	move	\$16,\$31
+   4:	03e08021 	move	\$16,\$31


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  jankratochvil/gdbserverbuildid: Support build-id for main executables
@ 2015-08-22 19:25 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2015-08-22 19:25 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid has been updated
  discards  7bce29f38b898ec67253353fcaba5d28b586d5f8 (commit)
  discards  c9d5a399077df5045baee43ac6c49c33bc9e7ea2 (commit)
  discards  64bce16d58873a8e3f5c4e5cf65eceb287bc03ce (commit)
  discards  93abb77b088733ae4d6fce5dd68fdd01636d541e (commit)
  discards  b5345e50374931b0eaf83eb294c7df63c09eb904 (commit)
  discards  a27f039a9b910b5f6bbb6a010d540ebb2c79bc26 (commit)
  discards  9a40139b873ac7dda461d53f73354983bda3f301 (commit)
  discards  5cf75d5606fc6851c8b5a2830670cb0bc7a7950d (commit)
  discards  52b044071251b1bb45471dc892b0f0e1ff5c19c9 (commit)
  discards  90980b9e455cd5a0cbb59b681025ab623240e0d6 (commit)
  discards  c983ce6cb7f311e103e3163f64bce842e2487114 (commit)
  discards  2b1b193832fc3a1183a9a95bd1af962d2ef0bbff (commit)
  discards  6af974ef5b85c275830f3a3d71813c4add8936d2 (commit)
  discards  54342970f11ed58b4839a0c7979d2bb73f5eae15 (commit)
  discards  82d67fa4a55a7b04e43e592e654a7faa973be5df (commit)
  discards  c67f00356d3bbd718307151f3ee3b9b2eaa53701 (commit)
  discards  5e0c4cbdabe0893412a2308396892f02102c7616 (commit)
  discards  cdc59a92f80bc6338783c0a28c72cf983ddbbd0b (commit)
  discards  0715940c746aa9c9ea9f71ef0e30a13580db5528 (commit)
  discards  2f22ecc85185c1109a23d101779813ac6e5abab4 (commit)
  discards  63acab658b6c55bbfa9771505017040bb3ef0a18 (commit)
  discards  779171c3b2bbc7023c1f32615ad6677c1f07c191 (commit)
  discards  51aed3fba80dca8e18424a855ac19c5f19582e12 (commit)
  discards  3d40c116d6b6f65070c2305759be4c76771fc5a2 (commit)
  discards  f7fce11ee9f77c91b69bcf03d97b858e07d97ef4 (commit)
  discards  fbd6de721a7bb03673dc4844b7f4494b285a4dee (commit)
  discards  868c0d04b42a19fd622d99c32465601a148b29c8 (commit)
       via  9d526416f035a6d567c0a75ad10f61d67b91debf (commit)
       via  a6d283fe348dbafbccd88da6b7099b31fa4126d5 (commit)
       via  efb71ced9ef12350e058619d3650c6ab7a1dfef0 (commit)
       via  7c3dd94e53ba20bc11e098769a141af3f14577df (commit)
       via  5cf3c5364b0f2cba7ad361249cfd6ff99aa8d53e (commit)
       via  daae6fc4931db1b4db2594d8e887ad7f7984fe23 (commit)
       via  5c5d66bbc85470417f3d7ee0090054892ca4f0f0 (commit)
       via  c35b25ff57933441e00c6addddcf0ef76ec4ae46 (commit)
       via  a69b2e74ab27ba3afd7295f70a055077b348e43a (commit)
       via  dd0075e027a00de63a3fcda35d82ebd78b8d7d19 (commit)
       via  1768eace6960d429a857a2001c7c03434cdb645f (commit)
       via  c1319b6c65880a7b8e555591c363026e1963f9ab (commit)
       via  be1f700d55efd36f999ce06c775ae45da58c657c (commit)
       via  f3631298bda92030bd47a85f64ade40b3c058e80 (commit)
       via  4edc3608dd24ab35ee638dbf1a2fa60eb5f3d14b (commit)
       via  df951efc0fcc567655b25f191d42b79fb0a4cd6b (commit)
       via  2cea39c30f7a8a6e244f4f6c80c8bbeb412a0527 (commit)
       via  2700a11a5c5abeb4a28e5e98bdf840dafa46262f (commit)
       via  b84ef18752bbeb8aed01bd1738177c4927e9ffe9 (commit)
       via  c13173c2eb639887985adbf0a6be994b7fd26781 (commit)
       via  ec55f3085ced8407ec8a372dfed7f7cf3490a625 (commit)
       via  154d3aa120e9a2ed255e4ea0f9c0bd0d092c0e77 (commit)
       via  7e0bdfa3a966e5d1d2388a1ca064a1e9e0713220 (commit)
       via  b5d2b733dfe3ebf72136400d76bd2c5c4ef72f56 (commit)
       via  885cf907c1222da14b31c8e36cbaaca4dadfd737 (commit)
       via  d3de81222038fdc9744a62368cb7d822812f7a61 (commit)
       via  91ced4b77535b97c67a3eaa1ca52a1622d82a539 (commit)
      from  7bce29f38b898ec67253353fcaba5d28b586d5f8 (commit)

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

- Log -----------------------------------------------------------------
commit 9d526416f035a6d567c0a75ad10f61d67b91debf
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:56 2015 +0200

    Support build-id for main executables
    
    Hi,
    
    make all the existing shlibs build-id functionality working also for the main
    executables.
    
    I think target_so_ops::open_symbol_file_object() is already replaced by what
    exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but
    open_symbol_file_object() has been forgotten.
    
    This patch adds target_so_ops::main_build_id() which could be possibly marged
    with open_symbol_file_object() but I made it a separate function as I think it
    is easier to rather remove target_so_ops::open_symbol_file_object().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention also main-build-id.
    	* build-id.c (build_id_verify): Add parameter advice.
    	* build-id.h (build_id_verify): Likewise.
    	* dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller.
    	* exec.c: Include build-id.h.
    	(exec_file_and_symbols_resync): Detect and use build-id by
    	solib_main_build_id.
    	* features/library-list-svr4.dtd: Add main-build-id.
    	* solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields
    	main_build_idsz and main_build_id.
    	(hex2bin_allocate): Generalize messages to binary files.
    	(svr4_library_list_start_list): Parse main-build-id.
    	(svr4_library_list_attributes): Add main-build-id.
    	(svr4_current_sos_direct): Set svr4_info main_build_id*.
    	(svr4_main_build_id): New function.
    	(svr4_clear_solib): Clear svr4_info main_build_id*.
    	(_initialize_svr4_solib): Install svr4_main_build_id.
    	* solib.c (solib_main_build_id): New function.
    	* solist.h (struct target_so_ops): Add method main_build_id.
    	(solib_main_build_id): New prototype.
    	* source.c (file_location_from_filename): Update build_id_verify caller.
    
    gdb/gdbserver/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id.
    
    gdb/doc/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Add 'set validate-build-id'
    	and 'show validate-build-id'.
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/main-mismatch-mod.c: New file.
    	* gdb.base/main-mismatch.c: New file.
    	* gdb.base/main-mismatch.exp: New file.

commit a6d283fe348dbafbccd88da6b7099b31fa4126d5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Make only user-specified executable and symbol filenames sticky
    
    Message-ID: <559A7C37.6020501@redhat.com>
    
    On 07/03/2015 04:44 PM, Pedro Alves wrote:
    
    > (I still suspect that if we reverse the sense of the flag, then
    > its management ends up being more centralized, as then the
    > place that sets it is also the place that needs to check it,
    > instead of doing that in multiple places.  But, see below.)
    
    It didn't seem fair to impose a subjective preference, so I tried
    this in order to understand it myself, and I now agree that is really
    doesn't make much difference, as then we'd have to mark
    auto-discovered in a few more places that I wasn't originally
    seeing.  There's at least the execd handling in infrun.c, and
    also spu_symbol_file_add_from_memory.
    
    As I was playing with this already, I poked at the other review
    points I made, and came up with the variant of the patch below.
    
    > This function is called while the passed in PID is not the
    > current inferior.  E.g., the remote_add_inferior path.
    >
    > Therefore seems to me that these symbol_file_add_main / exec_file_attach
    > calls can change the symbols of the wrong inferior.
    
    ...
    
    > I also notice that reread_symbols has an exec_file_attach
    > call which seems to me results in losing the is_user_supplied
    > flag if the executable's timestamp changed, at least here:
    >
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    >
    > I also notice that the clone-inferior command ends up with
    > an exec_file_attach call in clone_program_space.  That one
    > should probably be setting the is_user_supplied flag too,
    > I'd think.  Or at least, copying it from the original.
    >
    > At this point, I'm wondering about adding a parameter to
    > exec_file_attach to force considering (now and in future)
    > the right value to put in the flag in each case.
    
    I tried this too (see patch below).  As this requires touching the user-supplied
    paths anyway, it didn't really matter to tag files user-supplied or
    auto-discovered, so I reverted back to user-supplied.  For symbols,
    we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead
    of a new boolean.
    
    >
    >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
    >>    inferior = current_inferior ();
    >>    inferior->control.stop_soon = NO_STOP_QUIETLY;
    >>
    >> -  /* If no exec file is yet known, try to determine it from the
    >> -     process itself.  */
    >> -  if (get_exec_file (0) == NULL)
    >> -    exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> -  else
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    > It seems to me that we should be able to move these reopen/reread
    > calls inside exec_file_locate_attach.
    
    I did this too.
    
    What do you think of the version below?
    
    I also tweaked the warnings a bit, to explicitly say "mismatch".
    
    This would still need docs/NEWS changes, and a test would be good too.
    
    ----------
    
    - pass user-supplied / auto-discovered as arguments to exec_file_attach and
      symbol_file_add_main
    
    - Change exec_file_locate_attach parameter from pid to inferior
      pointer.
    
    - Flip current program space temporarily to make sure we add/reload
      symbols to/of the right inferior/program space.
    
    - Move reopen_exec_file and reread_symbols calls inside
      exec_file_locate_attach.
    
    - Warning message tweaks.
    
    - Rename exec_file_locate_attach -> exec_file_and_symbols_resync

commit efb71ced9ef12350e058619d3650c6ab7a1dfef0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Code cleanup: New hex2bin_allocate()
    
    Hi,
    
    make hex->bin parsing standalone, to be reused in later patch.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib-svr4.c (hex2bin_allocate): New function from ...
    	(library_list_start_library): ... here, call it.

commit 7c3dd94e53ba20bc11e098769a141af3f14577df
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    testcase: Test also locating shlibs by build-id
    
    Hi,
    
    testcase from the previous patch tests verification of build-id in shared
    libraries found by their name.  This test adds testing that a library can be
    found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY).
    
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them
    	global.
    	(solib_locate_test): New function.

commit 5cf3c5364b0f2cba7ad361249cfd6ff99aa8d53e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Tests for validate symbol file using build-id
    
    Hi,
    
    new testcase only.
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    
    	Tests for validate symbol file using build-id.
    	* gdb.base/solib-mismatch-lib.c: New file.
    	* gdb.base/solib-mismatch-libmod.c: New file.
    	* gdb.base/solib-mismatch.c: New file.
    	* gdb.base/solib-mismatch.exp: New file.

commit daae6fc4931db1b4db2594d8e887ad7f7984fe23
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    build_id_verify: Make it more verbose
    
    Hi,
    
    it was discussed on this list that if build-ids do not match they should be
    printed for troubleshooting.  It is mostly independent from the other patches.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include rsp-low.h.
    	(build_id_verify): Print non-matching build-ids, update the messages.

commit 5c5d66bbc85470417f3d7ee0090054892ca4f0f0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_bfd_open: Optimize opening twice
    
    Hi,
    
    this is one of the optimizations allowed by file_location that prevents opening
    file twice when target build-id is known and it needs to be verified.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by
    	solib_find_file.

commit c35b25ff57933441e00c6addddcf0ef76ec4ae46
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Verify the build-id
    
    Hi,
    
    now it is possible to filter-out from openp() search files with non-matching
    build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c: Include build-id.h.
    	(file_location_from_filename): Call build_id_verify for the build-id
    	parameters.

commit a69b2e74ab27ba3afd7295f70a055077b348e43a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_find: Search also by build-id
    
    Hi,
    
    solib_find() can now try to search also by build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c: Include build-id.h.
    	(solib_find_3): Call build_id_to_file.

commit dd0075e027a00de63a3fcda35d82ebd78b8d7d19
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    build_id_to_bfd: Make it return file_location
    
    Hi,
    
    refactor build_id_to_bfd so that it returns file_location.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include source.h.
    	(build_id_to_bfd): Rename to ...
    	(build_id_to_file): ... here, return file_location, add parameter opts,
    	make it public.
    	(build_id_to_debug_bfd): Use build_id_to_file.
    	* build-id.h (build_id_to_file): New prototype.

commit 1768eace6960d429a857a2001c7c03434cdb645f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Add dummy build-id params to prototypes
    
    Hi,
    
    it is a lot of text with no functionality.  Add build-id parameters where
    needed, pass them where they are already available, otherwise pass 0 in the top
    callers.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Pass zero build-id.
    	* defs.h (openp, openp_file, source_full_path_of): Add build-id
    	parameters.
    	* dwarf2read.c (try_open_dwop_file): Pass zero build-id.
    	* exec.c (exec_file_locate_attach): Likewise.
    	* infrun.c (follow_exec): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass
    	them.
    	* nto-tdep.h (nto_find_and_open_solib): Add build-id parameters.
    	* solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them.
    	* solib-darwin.c (darwin_bfd_open): Likewise.
    	* solib-dsbt.c (enable_break): Pass zero build-id.
    	* solib-frv.c (enable_break2): Likewise.
    	* solib-spu.c (spu_bfd_open): Add build-id parameters, pass them.
    	* solib-svr4.c (enable_break): Pass zero build-id.
    	* solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find)
    	(solib_find_file, solib_find, solib_bfd_open): Add build-id
    	parameters, pass them.
    	(solib_map_sections): Pass so->build-id* to bfd_open.
    	(reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open.
    	* solist.h (struct target_so_ops): Add build-id parameters to bfd_open
    	and find_and_open_solib.
    	(exec_file_find, solib_find, solib_bfd_open): Add build-id parameters.
    	* source.c (file_location_from_filename): Add build-id parameters.
    	(filename_to_bfd): Pass zero build-id.
    	(openp): Add build-id parameters, pass them.
    	(openp_bfd): Pass zero build-id.
    	(openp_file, source_full_path_of): Add build-id parameters, pass them.
    	(find_and_open_source): Pass zero build-id.
    	* source.h (file_location_from_filename): Add build-id parameters.

commit c1319b6c65880a7b8e555591c363026e1963f9ab
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    build_id_to_debug_bfd: Make it also non-.debug capable
    
    Hi,
    
    generalize the function by adding 'suffix' parameter.  To be reused later.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_to_debug_bfd): Rename to ...
    	(build_id_to_bfd): ... here, add parameter suffix.
    	(build_id_to_debug_bfd): New function.

commit be1f700d55efd36f999ce06c775ae45da58c657c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    symfile_bfd_open: Make it use openp_bfd()
    
    Hi,
    
    another function gets converted to the new API.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and
    	gdb_bfd_open.

commit f3631298bda92030bd47a85f64ade40b3c058e80
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    solib_find: Make it use file_location
    
    Hi,
    
    refactor the solib*() code to use file_location functions.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* nto-tdep.c: Include source.h.
    	(nto_find_and_open_solib): Return file_location, remove parameter
    	temp_pathname.  Change openp to openp_file.
    	* nto-tdep.h (nto_find_and_open_solib): Update prototype.
    	* solib.c (solib_find_2): Rename to ...
    	(solib_find_3): ... here, return file_location, change parameter fd to
    	opts.  Change gdb_open_cloexec to file_location_from_filename and openp
    	to openp_file calls.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here, return file_location, change parameter fd to
    	opts.
    	(solib_find_1): New function.
    	(solib_find): Rename to ...
    	(solib_find_file) ... here, return file_location, change parameter fd
    	to opts.
    	(solib_find): New function.
    	* solist.h (find_and_open_solib): Return file_location, remove
    	parameter temp_pathname.

commit 4edc3608dd24ab35ee638dbf1a2fa60eb5f3d14b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Refactor openp() to return file_location
    
    Hi,
    
    openp() remains as a backward compatibility wrapper around renamed
    openp->openp_file().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add
    	OPF_BFD_CANONICAL.
    	(openp_bfd, openp_file): Add prototypes.
    	* exec.c (exec_file_attach): Replace openp by openp_bfd calls.
    	* source.c (file_location_from_filename): Support OPF_BFD_CANONICAL.
    	(openp, openp_bfd): New functions.
    	(openp): Rename to ...
    	(openp_file): ... here, return file_location, remove filename_opened
    	parameter.

commit df951efc0fcc567655b25f191d42b79fb0a4cd6b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Add file_location utility functions
    
    Hi,
    
    build id verification faces a problem current codebase calls openp() and
    similar functions which search many directories and after they find the file
    they return its filename.  Caller then typically opens that file as BFD.
    
    But to search the directories openp() needs to open each file it iterates to
    verify their build-id.  Then it would close the file and caller would reopen it
    again.  This is inefficient (+racy), so a new intermediate representation of
    the found files is created (file_location).
    
    Another possibility would be to depends on bfd cache as being done in
    exec_file_attach.  But then a similar problem is needed for callers which want
    only fd (and not bfd).  Besides that I find depending on pending
    make_cleanup_bfd_unref() from openp() calls would be tricky.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Add OPF_IS_BFD.
    	* gdb_bfd.c (fileio_errno_to_host): Make it public.
    	* gdb_bfd.h (fileio_errno_to_host): Add prototype.
    	* source.c: Include inferior.h and gdb/fileio.h.
    	(file_location_enoent, file_location_free, file_location_cleanup)
    	(file_location_is_valid, file_location_from_filename)
    	(file_location_to_bfd, filename_to_bfd): New functions.
    	* source.h (struct file_location): New definition.
    	(file_location_enoent, file_location_free, file_location_is_valid)
    	(file_location file_location_from_filename, file_location_to_bfd)
    	(filename_to_bfd): New prototypes.

commit 2cea39c30f7a8a6e244f4f6c80c8bbeb412a0527
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Optionally do not close fd
    
    Hi,
    
    gdb_bfd_open_from_target currently always embedded passed fd into returned BFD
    and closed that fd after closing that BFD.  As one cannot do dup() for target
    fileio FDs one could not use FD after BFD using it has been closed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function.
    	(gdb_bfd_open_from_target): Add parameter do_close.  Optionally pass
    	gdb_bfd_iovec_fileio_close_nop.
    	(gdb_bfd_open): Update caller.
    	* gdb_bfd.h (gdb_bfd_open_from_target): Update prototype.

commit 2700a11a5c5abeb4a28e5e98bdf840dafa46262f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Support real fd
    
    Hi,
    
    gdb_bfd_open_from_target is extended so that it can be now passed also some
    non-(-1) fd.  non-(-1) fd was not supported for remote files in mainline.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function.
    	(gdb_bfd_open_from_target): Conditionally use it.

commit b84ef18752bbeb8aed01bd1738177c4927e9ffe9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Provide new gdb_bfd_open_from_target
    
    Hi,
    
    later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more
    special parameters.  So it is refactored out first (and extended later in the
    next patches).
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_open_from_target): New function from ...
    	(gdb_bfd_open): ... here.  Call it.
    	* gdb_bfd.h (gdb_bfd_open_from_target): New prototype.

commit c13173c2eb639887985adbf0a6be994b7fd26781
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Code cleanup: openp parameter filename_opened is never NULL
    
    Hi,
    
    this parameter is never passed as NULL in the codebase so the check can be
    removed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c (openp): Update function comment for filename_opened.
    	Remove NULL check for filename_opened.

commit ec55f3085ced8407ec8a372dfed7f7cf3490a625
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove openp parameter mode
    
    Hi,
    
    simplify the code, make it also suitable for more code refactorings.
    The new flag OPF_OPEN_RW_TMP is removed later in this patch series.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Update openp caller.
    	* defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP.
    	(openp): Remove parameter mode.
    	* dwarf2read.c (try_open_dwop_file): Update openp caller.
    	* exec.c (exec_file_attach): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags,
    	update openp caller.
    	* nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags.
    	* solib.c (solib_find_2): Update openp and find_and_open_solib caller.
    	* solist.h (struct target_so_ops): Remove parameter o_flags from
    	find_and_open_solib method.
    	* source.c (openp): Change parameter mode to a new variable.
    	(source_full_path_of, find_and_open_source): Update openp caller.
    	* symfile.c (symfile_bfd_open): Likewise.

commit 154d3aa120e9a2ed255e4ea0f9c0bd0d092c0e77
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove OPF_RETURN_REALPATH
    
    Hi,
    
    OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned
    values.  That is not useful, code can be simplified if callers that passed
    OPF_RETURN_REALPATH adjust the returned values on their own.  Or at least it
    helps further refactorizations.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree.
    	* defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH.
    	* dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH.  Call
    	gdb_realpath_and_xfree.
    	* nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree and xstrdup.
    	* solib.c (solib_find_2): New variable temp_pathname_is_realpath.
    	Remove OPF_RETURN_REALPATH.  Conditionally call gdb_realpath_and_xfree.
    	* source.c (openp): Remove OPF_RETURN_REALPATH processing.
    	(source_full_path_of, find_and_open_source): Remove
    	OPF_RETURN_REALPATH.  Call gdb_realpath_and_xfree.
    	* symfile.c (symfile_bfd_open): Likewise.
    	* utils.c (gdb_realpath_and_xfree): New function.
    	* utils.h (gdb_realpath_and_xfree): New prototype.

commit 7e0bdfa3a966e5d1d2388a1ca064a1e9e0713220
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Add enum for openp_flags
    
    Hi,
    
    it is for many reasons better, in C++ it could be even type safe.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for
    	search_flags.
    	* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
    	Wrap them to a new ...
    	(enum openp_flags): ... enum.
    	(openp): Update prototype.
    	* dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags.
    	* source.c (openp): Update opts parameter type.  Move out OPF_*
    	comments.

commit b5d2b733dfe3ebf72136400d76bd2c5c4ef72f56
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Change sysroot to ":target:"
    
    Hi,
    
    that is try "" first and "target:" second.
    
    Various performance problems should be fixed by trying to look up the remote
    file first on local filesystem.  Thanks to build-ids it is quick and safe to
    verify both files are the same build.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention sysroot.
    	* main.c (captured_main): Initialize new gdb_sysroot.
    
    gdb/testsuite/ChangeLog
    
    	* gdb.base/attach.exp (do_attach_tests): Update sysroot parsing.
    	* gdb.base/break-probes.exp: Likewise.

commit 885cf907c1222da14b31c8e36cbaaca4dadfd737
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Permit multiple sysroot directories
    
    Hi,
    
    the goal is to have both "" and "target:" as the default gdb_sysroot, in this
    order.  Therefore permit multiple directory components of gdb_sysroot.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot.
    	* solib.c: Include source.h.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here and change the sysroot variable to parameter.
    	(solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc.
    	* source.c (dirnames_to_char_ptr_vec_target_exc): New function.
    	* source.h (dirnames_to_char_ptr_vec_target_exc): New declaration.
    
    gdb/doc/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Permit set sysroot and show sysroot to have
    	multiple components.

commit d3de81222038fdc9744a62368cb7d822812f7a61
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Code cleanup: Make solib_find_1 variable const
    
    Hi,
    
    it gets used in the next patch.
    
    
    Jan
    
    
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_find_1): Make sysroot variable const.

commit 91ced4b77535b97c67a3eaa1ca52a1622d82a539
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Validate symbol file using build-id
    
    Consumer part of the "build-id" attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Validate symbol file using build-id.
    	* NEWS (Changes since GDB 7.10): Add 'set validate-build-id'
    	and 'show validate-build-id'.  Add build-id attribute.
    	* build-id.c: Include gdbcmd.h.
    	(validate_build_id, show_validate_build_id, _initialize_build_id): New.
    	* build-id.h (validate_build_id): New declaration.
    	* solib-svr4.c: Include rsp-low.h.
    	(svr4_copy_library_list): Duplicate field build_id.
    	(library_list_start_library): Parse 'build-id' attribute.
    	(svr4_library_attributes): Add 'build-id' attribute.
    	* solib.c (free_so): Free build_id.
    	* solist.h (struct so_list): New fields 'build_idsz' and 'build_id'.

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

Summary of changes:
 gdb/NEWS            |    4 ++--
 gdb/build-id.c      |   12 ++++++------
 gdb/doc/gdb.texinfo |   13 ++++++++-----
 3 files changed, 16 insertions(+), 13 deletions(-)

First 500 lines of diff:
diff --git a/gdb/NEWS b/gdb/NEWS
index 28c319e..b7f9798 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -35,8 +35,8 @@ show debug bfd-cache
   The "/m" option is now considered deprecated: its "source-centric"
   output hasn't proved useful in practice.
 
-* The "set sysroot" (and "show sysroot") commands now permit multiple
-  directory paths.
+* The "set sysroot" (and "show sysroot") commands now accept PATH-style
+  lists of directories.
 
 * Default sysroot has changed to ":target:", that is first host files
   and then target files are tried.
diff --git a/gdb/build-id.c b/gdb/build-id.c
index 289c356..c21b9be 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -39,8 +39,8 @@ static void
 show_validate_build_id (struct ui_file *file, int from_tty,
 			struct cmd_list_element *c, const char *value)
 {
-  fprintf_filtered (file, _("Validation a build-id matches to load a shared "
-			    "library is %s.\n"),
+  fprintf_filtered (file, _("Validation of build-id match when loading "
+			    "a binary is %s.\n"),
 		    value);
 }
 
@@ -222,10 +222,10 @@ _initialize_build_id (void)
 {
   add_setshow_boolean_cmd ("validate-build-id", class_support,
 			   &validate_build_id, _("\
-Set validation a build-id matches to load a shared library."), _("\
-SHow validation a build-id matches to load a shared library."), _("\
-Inferior shared library and symbol file may contain unique build-id.\n\
-If both build-ids are present but they do not match then this setting\n\
+Set whether to validate build-id match when loading a binary."), _("\
+Show whether to validate build-id match when loading a binary."), _("\
+Inferior binary and symbol file may contain unique build-id.\n\
+If both build-ids are present, but they do not match, then this setting\n\
 enables (off) or disables (on) loading of such symbol file.\n\
 Loading non-matching symbol file may confuse debugging including breakage\n\
 of backtrace output."),
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 40f0f14..db305f4 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18189,8 +18189,8 @@ to specify the search directories for target libraries.
 @kindex set solib-absolute-prefix
 @kindex set sysroot
 @item set sysroot @var{path}
-Use @var{path} as the system root (or list of system roots) for the
-program being debugged.  Any
+Use @var{path} as the system root (or a list of system root directories)
+for the program being debugged.  Any
 absolute shared library paths will be prefixed with @var{path}; many
 runtime loaders store the absolute paths to the shared library in the
 target program's memory.  When starting processes remotely, and when
@@ -18202,10 +18202,12 @@ to be laid out in the same way that they are on the target, with
 e.g.@: a @file{/bin}, @file{/lib} and @file{/usr/lib} hierarchy under
 @var{path}.
 
-Multiple entries may be delimited by the host platform path separator in use.
+Multiple sysroot directories can be specified in @var{path},
+separated by the host platform's path separator character (colon
+@samp{:} on Unix, semi-colon @samp{;} on MS-Windows, etc.).
 
 If @var{path} starts with the sequence @file{target:} (even if the host
-platform path separator is character @file{:}) and the target
+platform path separator is @samp{:}) and the target
 system is remote then @value{GDBN} will retrieve the target binaries
 from the remote system.  This is only supported when using a remote
 target that supports the @code{remote get} command (@pxref{File
@@ -18287,7 +18289,8 @@ location.
 
 @kindex show sysroot
 @item show sysroot
-Display the current executable and shared library prefix(es).
+Display the current value of sysroot, which is used to look for
+executable and shared libraries.
 
 @kindex set solib-search-path
 @item set solib-search-path @var{path}


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  jankratochvil/gdbserverbuildid: Support build-id for main executables
@ 2015-08-21 20:56 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2015-08-21 20:56 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid has been updated
  discards  b4e4b4764ce753d336d6b6de12c5ec5296bd4d2b (commit)
  discards  eae34a38b1b6073a6380a670f832abeb31ac8e3e (commit)
  discards  e30bfa019ec125c5c91edae344546a22c82b8fb5 (commit)
  discards  6e63fc41f7eb6f24fe07e39468576d5460816cfd (commit)
  discards  adf6af424c8843a91660a011d23492fd2775bd77 (commit)
  discards  75428cfacf113f24c18c011cd371f1c17d55927a (commit)
  discards  232606b55fd080d61dc80088be4f90273a42152b (commit)
  discards  2f69fd3f00008f55d525365efb264d1411ffe706 (commit)
  discards  157a9ea4235c203ffef98a1d01076b331a9dc7b3 (commit)
  discards  b81b03b2d5a74e42fb3db91683f2e2e21350e384 (commit)
  discards  46116c84f334482a7919c903e70e49302ded3113 (commit)
  discards  57b773b9c32050bf0171feef3890ce59dce04be7 (commit)
  discards  7126338cca73b4c8c626209d5135921be145c2a6 (commit)
  discards  8a46a0bb6d85d35867afff33b23f5141a4d44257 (commit)
  discards  52a72e3685e8d87315f61ab0eeb9abec75649c7e (commit)
  discards  406712ee5ea7c37d0f585ce576e1577135cf72fe (commit)
  discards  fa37623340e12495a724e520fa4c2c2419cc350c (commit)
  discards  08a325927e2c8cacb0c68f18394bb4a4aeea55cb (commit)
  discards  0092a2b7a1b7cb7cc73b9dbc663ffa4aff582738 (commit)
  discards  5c773a41ae721c2260f8bdd440b2352d2f9d8754 (commit)
  discards  1bf9fe0773948520ea46435f5cec76236384f898 (commit)
  discards  405b76a55bd811ecd691e330dc62ded0410a0398 (commit)
  discards  9190ee41e215de2239fb7fdfe1b350379e8fa406 (commit)
  discards  86c34d43e014fdde2a8ead404bccf250515a1c9b (commit)
  discards  0e392b9bb75d77f7b72f4e774c50471c28f86f5d (commit)
  discards  0a26b660f625479dd1b44f9399d8635f59496d25 (commit)
  discards  940be657e23cd76a0ccf1a40bec9b2d2ee3a1fe3 (commit)
       via  7bce29f38b898ec67253353fcaba5d28b586d5f8 (commit)
       via  c9d5a399077df5045baee43ac6c49c33bc9e7ea2 (commit)
       via  64bce16d58873a8e3f5c4e5cf65eceb287bc03ce (commit)
       via  93abb77b088733ae4d6fce5dd68fdd01636d541e (commit)
       via  b5345e50374931b0eaf83eb294c7df63c09eb904 (commit)
       via  a27f039a9b910b5f6bbb6a010d540ebb2c79bc26 (commit)
       via  9a40139b873ac7dda461d53f73354983bda3f301 (commit)
       via  5cf75d5606fc6851c8b5a2830670cb0bc7a7950d (commit)
       via  52b044071251b1bb45471dc892b0f0e1ff5c19c9 (commit)
       via  90980b9e455cd5a0cbb59b681025ab623240e0d6 (commit)
       via  c983ce6cb7f311e103e3163f64bce842e2487114 (commit)
       via  2b1b193832fc3a1183a9a95bd1af962d2ef0bbff (commit)
       via  6af974ef5b85c275830f3a3d71813c4add8936d2 (commit)
       via  54342970f11ed58b4839a0c7979d2bb73f5eae15 (commit)
       via  82d67fa4a55a7b04e43e592e654a7faa973be5df (commit)
       via  c67f00356d3bbd718307151f3ee3b9b2eaa53701 (commit)
       via  5e0c4cbdabe0893412a2308396892f02102c7616 (commit)
       via  cdc59a92f80bc6338783c0a28c72cf983ddbbd0b (commit)
       via  0715940c746aa9c9ea9f71ef0e30a13580db5528 (commit)
       via  2f22ecc85185c1109a23d101779813ac6e5abab4 (commit)
       via  63acab658b6c55bbfa9771505017040bb3ef0a18 (commit)
       via  779171c3b2bbc7023c1f32615ad6677c1f07c191 (commit)
       via  51aed3fba80dca8e18424a855ac19c5f19582e12 (commit)
       via  3d40c116d6b6f65070c2305759be4c76771fc5a2 (commit)
       via  f7fce11ee9f77c91b69bcf03d97b858e07d97ef4 (commit)
       via  fbd6de721a7bb03673dc4844b7f4494b285a4dee (commit)
       via  868c0d04b42a19fd622d99c32465601a148b29c8 (commit)
      from  b4e4b4764ce753d336d6b6de12c5ec5296bd4d2b (commit)

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

- Log -----------------------------------------------------------------
commit 7bce29f38b898ec67253353fcaba5d28b586d5f8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:56 2015 +0200

    Support build-id for main executables
    
    Hi,
    
    make all the existing shlibs build-id functionality working also for the main
    executables.
    
    I think target_so_ops::open_symbol_file_object() is already replaced by what
    exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but
    open_symbol_file_object() has been forgotten.
    
    This patch adds target_so_ops::main_build_id() which could be possibly marged
    with open_symbol_file_object() but I made it a separate function as I think it
    is easier to rather remove target_so_ops::open_symbol_file_object().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention also main-build-id.
    	* build-id.c (build_id_verify): Add parameter advice.
    	* build-id.h (build_id_verify): Likewise.
    	* dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller.
    	* exec.c: Include build-id.h.
    	(exec_file_and_symbols_resync): Detect and use build-id by
    	solib_main_build_id.
    	* features/library-list-svr4.dtd: Add main-build-id.
    	* solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields
    	main_build_idsz and main_build_id.
    	(hex2bin_allocate): Generalize messages to binary files.
    	(svr4_library_list_start_list): Parse main-build-id.
    	(svr4_library_list_attributes): Add main-build-id.
    	(svr4_current_sos_direct): Set svr4_info main_build_id*.
    	(svr4_main_build_id): New function.
    	(svr4_clear_solib): Clear svr4_info main_build_id*.
    	(_initialize_svr4_solib): Install svr4_main_build_id.
    	* solib.c (solib_main_build_id): New function.
    	* solist.h (struct target_so_ops): Add method main_build_id.
    	(solib_main_build_id): New prototype.
    	* source.c (file_location_from_filename): Update build_id_verify caller.
    
    gdb/gdbserver/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id.
    
    gdb/doc/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Add 'set validate-build-id'
    	and 'show validate-build-id'.
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/main-mismatch-mod.c: New file.
    	* gdb.base/main-mismatch.c: New file.
    	* gdb.base/main-mismatch.exp: New file.

commit c9d5a399077df5045baee43ac6c49c33bc9e7ea2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Make only user-specified executable and symbol filenames sticky
    
    Message-ID: <559A7C37.6020501@redhat.com>
    
    On 07/03/2015 04:44 PM, Pedro Alves wrote:
    
    > (I still suspect that if we reverse the sense of the flag, then
    > its management ends up being more centralized, as then the
    > place that sets it is also the place that needs to check it,
    > instead of doing that in multiple places.  But, see below.)
    
    It didn't seem fair to impose a subjective preference, so I tried
    this in order to understand it myself, and I now agree that is really
    doesn't make much difference, as then we'd have to mark
    auto-discovered in a few more places that I wasn't originally
    seeing.  There's at least the execd handling in infrun.c, and
    also spu_symbol_file_add_from_memory.
    
    As I was playing with this already, I poked at the other review
    points I made, and came up with the variant of the patch below.
    
    > This function is called while the passed in PID is not the
    > current inferior.  E.g., the remote_add_inferior path.
    >
    > Therefore seems to me that these symbol_file_add_main / exec_file_attach
    > calls can change the symbols of the wrong inferior.
    
    ...
    
    > I also notice that reread_symbols has an exec_file_attach
    > call which seems to me results in losing the is_user_supplied
    > flag if the executable's timestamp changed, at least here:
    >
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    >
    > I also notice that the clone-inferior command ends up with
    > an exec_file_attach call in clone_program_space.  That one
    > should probably be setting the is_user_supplied flag too,
    > I'd think.  Or at least, copying it from the original.
    >
    > At this point, I'm wondering about adding a parameter to
    > exec_file_attach to force considering (now and in future)
    > the right value to put in the flag in each case.
    
    I tried this too (see patch below).  As this requires touching the user-supplied
    paths anyway, it didn't really matter to tag files user-supplied or
    auto-discovered, so I reverted back to user-supplied.  For symbols,
    we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead
    of a new boolean.
    
    >
    >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
    >>    inferior = current_inferior ();
    >>    inferior->control.stop_soon = NO_STOP_QUIETLY;
    >>
    >> -  /* If no exec file is yet known, try to determine it from the
    >> -     process itself.  */
    >> -  if (get_exec_file (0) == NULL)
    >> -    exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> -  else
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    > It seems to me that we should be able to move these reopen/reread
    > calls inside exec_file_locate_attach.
    
    I did this too.
    
    What do you think of the version below?
    
    I also tweaked the warnings a bit, to explicitly say "mismatch".
    
    This would still need docs/NEWS changes, and a test would be good too.
    
    ----------
    
    - pass user-supplied / auto-discovered as arguments to exec_file_attach and
      symbol_file_add_main
    
    - Change exec_file_locate_attach parameter from pid to inferior
      pointer.
    
    - Flip current program space temporarily to make sure we add/reload
      symbols to/of the right inferior/program space.
    
    - Move reopen_exec_file and reread_symbols calls inside
      exec_file_locate_attach.
    
    - Warning message tweaks.
    
    - Rename exec_file_locate_attach -> exec_file_and_symbols_resync

commit 64bce16d58873a8e3f5c4e5cf65eceb287bc03ce
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Code cleanup: New hex2bin_allocate()
    
    Hi,
    
    make hex->bin parsing standalone, to be reused in later patch.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib-svr4.c (hex2bin_allocate): New function from ...
    	(library_list_start_library): ... here, call it.

commit 93abb77b088733ae4d6fce5dd68fdd01636d541e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    testcase: Test also locating shlibs by build-id
    
    Hi,
    
    testcase from the previous patch tests verification of build-id in shared
    libraries found by their name.  This test adds testing that a library can be
    found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY).
    
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them
    	global.
    	(solib_locate_test): New function.

commit b5345e50374931b0eaf83eb294c7df63c09eb904
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    Tests for validate symbol file using build-id
    
    Hi,
    
    new testcase only.
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    
    	Tests for validate symbol file using build-id.
    	* gdb.base/solib-mismatch-lib.c: New file.
    	* gdb.base/solib-mismatch-libmod.c: New file.
    	* gdb.base/solib-mismatch.c: New file.
    	* gdb.base/solib-mismatch.exp: New file.

commit a27f039a9b910b5f6bbb6a010d540ebb2c79bc26
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:55 2015 +0200

    build_id_verify: Make it more verbose
    
    Hi,
    
    it was discussed on this list that if build-ids do not match they should be
    printed for troubleshooting.  It is mostly independent from the other patches.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include rsp-low.h.
    	(build_id_verify): Print non-matching build-ids, update the messages.

commit 9a40139b873ac7dda461d53f73354983bda3f301
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_bfd_open: Optimize opening twice
    
    Hi,
    
    this is one of the optimizations allowed by file_location that prevents opening
    file twice when target build-id is known and it needs to be verified.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by
    	solib_find_file.

commit 5cf75d5606fc6851c8b5a2830670cb0bc7a7950d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Verify the build-id
    
    Hi,
    
    now it is possible to filter-out from openp() search files with non-matching
    build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c: Include build-id.h.
    	(file_location_from_filename): Call build_id_verify for the build-id
    	parameters.

commit 52b044071251b1bb45471dc892b0f0e1ff5c19c9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    solib_find: Search also by build-id
    
    Hi,
    
    solib_find() can now try to search also by build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c: Include build-id.h.
    	(solib_find_3): Call build_id_to_file.

commit 90980b9e455cd5a0cbb59b681025ab623240e0d6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    build_id_to_bfd: Make it return file_location
    
    Hi,
    
    refactor build_id_to_bfd so that it returns file_location.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include source.h.
    	(build_id_to_bfd): Rename to ...
    	(build_id_to_file): ... here, return file_location, add parameter opts,
    	make it public.
    	(build_id_to_debug_bfd): Use build_id_to_file.
    	* build-id.h (build_id_to_file): New prototype.

commit c983ce6cb7f311e103e3163f64bce842e2487114
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:54 2015 +0200

    Add dummy build-id params to prototypes
    
    Hi,
    
    it is a lot of text with no functionality.  Add build-id parameters where
    needed, pass them where they are already available, otherwise pass 0 in the top
    callers.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Pass zero build-id.
    	* defs.h (openp, openp_file, source_full_path_of): Add build-id
    	parameters.
    	* dwarf2read.c (try_open_dwop_file): Pass zero build-id.
    	* exec.c (exec_file_locate_attach): Likewise.
    	* infrun.c (follow_exec): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass
    	them.
    	* nto-tdep.h (nto_find_and_open_solib): Add build-id parameters.
    	* solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them.
    	* solib-darwin.c (darwin_bfd_open): Likewise.
    	* solib-dsbt.c (enable_break): Pass zero build-id.
    	* solib-frv.c (enable_break2): Likewise.
    	* solib-spu.c (spu_bfd_open): Add build-id parameters, pass them.
    	* solib-svr4.c (enable_break): Pass zero build-id.
    	* solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find)
    	(solib_find_file, solib_find, solib_bfd_open): Add build-id
    	parameters, pass them.
    	(solib_map_sections): Pass so->build-id* to bfd_open.
    	(reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open.
    	* solist.h (struct target_so_ops): Add build-id parameters to bfd_open
    	and find_and_open_solib.
    	(exec_file_find, solib_find, solib_bfd_open): Add build-id parameters.
    	* source.c (file_location_from_filename): Add build-id parameters.
    	(filename_to_bfd): Pass zero build-id.
    	(openp): Add build-id parameters, pass them.
    	(openp_bfd): Pass zero build-id.
    	(openp_file, source_full_path_of): Add build-id parameters, pass them.
    	(find_and_open_source): Pass zero build-id.
    	* source.h (file_location_from_filename): Add build-id parameters.

commit 2b1b193832fc3a1183a9a95bd1af962d2ef0bbff
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    build_id_to_debug_bfd: Make it also non-.debug capable
    
    Hi,
    
    generalize the function by adding 'suffix' parameter.  To be reused later.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_to_debug_bfd): Rename to ...
    	(build_id_to_bfd): ... here, add parameter suffix.
    	(build_id_to_debug_bfd): New function.

commit 6af974ef5b85c275830f3a3d71813c4add8936d2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    symfile_bfd_open: Make it use openp_bfd()
    
    Hi,
    
    another function gets converted to the new API.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and
    	gdb_bfd_open.

commit 54342970f11ed58b4839a0c7979d2bb73f5eae15
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    solib_find: Make it use file_location
    
    Hi,
    
    refactor the solib*() code to use file_location functions.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* nto-tdep.c: Include source.h.
    	(nto_find_and_open_solib): Return file_location, remove parameter
    	temp_pathname.  Change openp to openp_file.
    	* nto-tdep.h (nto_find_and_open_solib): Update prototype.
    	* solib.c (solib_find_2): Rename to ...
    	(solib_find_3): ... here, return file_location, change parameter fd to
    	opts.  Change gdb_open_cloexec to file_location_from_filename and openp
    	to openp_file calls.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here, return file_location, change parameter fd to
    	opts.
    	(solib_find_1): New function.
    	(solib_find): Rename to ...
    	(solib_find_file) ... here, return file_location, change parameter fd
    	to opts.
    	(solib_find): New function.
    	* solist.h (find_and_open_solib): Return file_location, remove
    	parameter temp_pathname.

commit 82d67fa4a55a7b04e43e592e654a7faa973be5df
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Refactor openp() to return file_location
    
    Hi,
    
    openp() remains as a backward compatibility wrapper around renamed
    openp->openp_file().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add
    	OPF_BFD_CANONICAL.
    	(openp_bfd, openp_file): Add prototypes.
    	* exec.c (exec_file_attach): Replace openp by openp_bfd calls.
    	* source.c (file_location_from_filename): Support OPF_BFD_CANONICAL.
    	(openp, openp_bfd): New functions.
    	(openp): Rename to ...
    	(openp_file): ... here, return file_location, remove filename_opened
    	parameter.

commit c67f00356d3bbd718307151f3ee3b9b2eaa53701
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:53 2015 +0200

    Add file_location utility functions
    
    Hi,
    
    build id verification faces a problem current codebase calls openp() and
    similar functions which search many directories and after they find the file
    they return its filename.  Caller then typically opens that file as BFD.
    
    But to search the directories openp() needs to open each file it iterates to
    verify their build-id.  Then it would close the file and caller would reopen it
    again.  This is inefficient (+racy), so a new intermediate representation of
    the found files is created (file_location).
    
    Another possibility would be to depends on bfd cache as being done in
    exec_file_attach.  But then a similar problem is needed for callers which want
    only fd (and not bfd).  Besides that I find depending on pending
    make_cleanup_bfd_unref() from openp() calls would be tricky.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Add OPF_IS_BFD.
    	* gdb_bfd.c (fileio_errno_to_host): Make it public.
    	* gdb_bfd.h (fileio_errno_to_host): Add prototype.
    	* source.c: Include inferior.h and gdb/fileio.h.
    	(file_location_enoent, file_location_free, file_location_cleanup)
    	(file_location_is_valid, file_location_from_filename)
    	(file_location_to_bfd, filename_to_bfd): New functions.
    	* source.h (struct file_location): New definition.
    	(file_location_enoent, file_location_free, file_location_is_valid)
    	(file_location file_location_from_filename, file_location_to_bfd)
    	(filename_to_bfd): New prototypes.

commit 5e0c4cbdabe0893412a2308396892f02102c7616
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Optionally do not close fd
    
    Hi,
    
    gdb_bfd_open_from_target currently always embedded passed fd into returned BFD
    and closed that fd after closing that BFD.  As one cannot do dup() for target
    fileio FDs one could not use FD after BFD using it has been closed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function.
    	(gdb_bfd_open_from_target): Add parameter do_close.  Optionally pass
    	gdb_bfd_iovec_fileio_close_nop.
    	(gdb_bfd_open): Update caller.
    	* gdb_bfd.h (gdb_bfd_open_from_target): Update prototype.

commit cdc59a92f80bc6338783c0a28c72cf983ddbbd0b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    gdb_bfd_open_from_target: Support real fd
    
    Hi,
    
    gdb_bfd_open_from_target is extended so that it can be now passed also some
    non-(-1) fd.  non-(-1) fd was not supported for remote files in mainline.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function.
    	(gdb_bfd_open_from_target): Conditionally use it.

commit 0715940c746aa9c9ea9f71ef0e30a13580db5528
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Provide new gdb_bfd_open_from_target
    
    Hi,
    
    later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more
    special parameters.  So it is refactored out first (and extended later in the
    next patches).
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_open_from_target): New function from ...
    	(gdb_bfd_open): ... here.  Call it.
    	* gdb_bfd.h (gdb_bfd_open_from_target): New prototype.

commit 2f22ecc85185c1109a23d101779813ac6e5abab4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:52 2015 +0200

    Code cleanup: openp parameter filename_opened is never NULL
    
    Hi,
    
    this parameter is never passed as NULL in the codebase so the check can be
    removed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c (openp): Update function comment for filename_opened.
    	Remove NULL check for filename_opened.

commit 63acab658b6c55bbfa9771505017040bb3ef0a18
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove openp parameter mode
    
    Hi,
    
    simplify the code, make it also suitable for more code refactorings.
    The new flag OPF_OPEN_RW_TMP is removed later in this patch series.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Update openp caller.
    	* defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP.
    	(openp): Remove parameter mode.
    	* dwarf2read.c (try_open_dwop_file): Update openp caller.
    	* exec.c (exec_file_attach): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags,
    	update openp caller.
    	* nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags.
    	* solib.c (solib_find_2): Update openp and find_and_open_solib caller.
    	* solist.h (struct target_so_ops): Remove parameter o_flags from
    	find_and_open_solib method.
    	* source.c (openp): Change parameter mode to a new variable.
    	(source_full_path_of, find_and_open_source): Update openp caller.
    	* symfile.c (symfile_bfd_open): Likewise.

commit 779171c3b2bbc7023c1f32615ad6677c1f07c191
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Remove OPF_RETURN_REALPATH
    
    Hi,
    
    OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned
    values.  That is not useful, code can be simplified if callers that passed
    OPF_RETURN_REALPATH adjust the returned values on their own.  Or at least it
    helps further refactorizations.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree.
    	* defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH.
    	* dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH.  Call
    	gdb_realpath_and_xfree.
    	* nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree and xstrdup.
    	* solib.c (solib_find_2): New variable temp_pathname_is_realpath.
    	Remove OPF_RETURN_REALPATH.  Conditionally call gdb_realpath_and_xfree.
    	* source.c (openp): Remove OPF_RETURN_REALPATH processing.
    	(source_full_path_of, find_and_open_source): Remove
    	OPF_RETURN_REALPATH.  Call gdb_realpath_and_xfree.
    	* symfile.c (symfile_bfd_open): Likewise.
    	* utils.c (gdb_realpath_and_xfree): New function.
    	* utils.h (gdb_realpath_and_xfree): New prototype.

commit 51aed3fba80dca8e18424a855ac19c5f19582e12
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Code cleanup: Add enum for openp_flags
    
    Hi,
    
    it is for many reasons better, in C++ it could be even type safe.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for
    	search_flags.
    	* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
    	Wrap them to a new ...
    	(enum openp_flags): ... enum.
    	(openp): Update prototype.
    	* dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags.
    	* source.c (openp): Update opts parameter type.  Move out OPF_*
    	comments.

commit 3d40c116d6b6f65070c2305759be4c76771fc5a2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Change sysroot to ":target:"
    
    Hi,
    
    that is try "" first and "target:" second.
    
    Various performance problems should be fixed by trying to look up the remote
    file first on local filesystem.  Thanks to build-ids it is quick and safe to
    verify both files are the same build.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention sysroot.
    	* main.c (captured_main): Initialize new gdb_sysroot.
    
    gdb/testsuite/ChangeLog
    
    	* gdb.base/attach.exp (do_attach_tests): Update sysroot parsing.
    	* gdb.base/break-probes.exp: Likewise.

commit f7fce11ee9f77c91b69bcf03d97b858e07d97ef4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:51 2015 +0200

    Permit multiple sysroot directories
    
    Hi,
    
    the goal is to have both "" and "target:" as the default gdb_sysroot, in this
    order.  Therefore permit multiple directory components of gdb_sysroot.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot.
    	* solib.c: Include source.h.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here and change the sysroot variable to parameter.
    	(solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc.
    	* source.c (dirnames_to_char_ptr_vec_target_exc): New function.
    	* source.h (dirnames_to_char_ptr_vec_target_exc): New declaration.
    
    gdb/doc/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Permit set sysroot and show sysroot to have
    	multiple components.

commit fbd6de721a7bb03673dc4844b7f4494b285a4dee
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Code cleanup: Make solib_find_1 variable const
    
    Hi,
    
    it gets used in the next patch.
    
    
    Jan
    
    
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_find_1): Make sysroot variable const.

commit 868c0d04b42a19fd622d99c32465601a148b29c8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Aug 21 21:40:50 2015 +0200

    Validate symbol file using build-id
    
    Consumer part of the "build-id" attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Validate symbol file using build-id.
    	* NEWS (Changes since GDB 7.10): Add 'set validate-build-id'
    	and 'show validate-build-id'.  Add build-id attribute.
    	* build-id.c: Include gdbcmd.h.
    	(validate_build_id, show_validate_build_id, _initialize_build_id): New.
    	* build-id.h (validate_build_id): New declaration.
    	* solib-svr4.c: Include rsp-low.h.
    	(svr4_copy_library_list): Duplicate field build_id.
    	(library_list_start_library): Parse 'build-id' attribute.
    	(svr4_library_attributes): Add 'build-id' attribute.
    	* solib.c (free_so): Free build_id.
    	* solist.h (struct so_list): New fields 'build_idsz' and 'build_id'.

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

Summary of changes:
 gdb/NEWS            |    4 ++--
 gdb/build-id.c      |   32 +++++++++++++-------------------
 gdb/doc/gdb.texinfo |   29 ++++++++++++-----------------
 gdb/exec.c          |    8 +++-----
 4 files changed, 30 insertions(+), 43 deletions(-)

First 500 lines of diff:
diff --git a/gdb/NEWS b/gdb/NEWS
index a45aaa6..28c319e 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -52,8 +52,8 @@ show validate-build-id
 * New features in the GDB remote stub, GDBserver
 
   ** library-list-svr4 contains also optional attribute 'build-id' for
-     each library.  GDB does not load library with build-id that
-     does not match such attribute.
+     each library and one optional attribute 'main-build-id'.  GDB does
+     not load binaries with build-id that does not match such attribute.
 
 *** Changes in GDB 7.10
 
diff --git a/gdb/build-id.c b/gdb/build-id.c
index 216d4b5..289c356 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -64,10 +64,15 @@ build_id_bfd_get (bfd *abfd)
 int
 build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check, int advice)
 {
-  const struct bfd_build_id *found = build_id_bfd_get (abfd);
-  char *message, *check_hex = alloca (check_len * 2 + 1);
+  const struct bfd_build_id *found;
+  char *message, *check_hex;
   struct cleanup *back_to;
 
+  if (check_len == 0 || !validate_build_id)
+    return 1;
+
+  found = build_id_bfd_get (abfd);
+  check_hex = alloca (check_len * 2 + 1);
   bin2hex (check, check_hex, check_len);
 
   if (found == NULL)
@@ -89,24 +94,13 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check, int advice)
   back_to = make_cleanup (xfree, message);
 
   if (!advice)
-    {
-      warning ("%s", message);
-      do_cleanups (back_to);
-      return !validate_build_id;
-    }
-  if (validate_build_id)
-    {
-      warning (_("Symbol file \"%s\" could not be validated (%s) and "
-		 "will be ignored; or use 'set validate-build-id off'."),
-	       bfd_get_filename (abfd), message);
-      do_cleanups (back_to);
-      return 0;
-    }
-  warning (_("Symbol file \"%s\" could not be validated (%s) "
-	     "but it is being loaded due to 'set validate-build-id off'."),
-	   bfd_get_filename (abfd), message);
+    warning ("%s", message);
+  else
+    warning (_("Symbol file \"%s\" could not be validated (%s) and "
+	       "will be ignored; or use 'set validate-build-id off'."),
+	     bfd_get_filename (abfd), message);
   do_cleanups (back_to);
-  return 1;
+  return 0;
 }
 
 /* Find and open a BFD given a build-id.  If no BFD can be found,
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index d6e8094..40f0f14 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -18115,25 +18115,20 @@ discarded.
 @item set validate-build-id @var{mode}
 Setting to override @value{GDBN} build-id check.
 
-Inferior shared libraries and symbol files may contain unique build-id.
-@value{GDBN} expects the build-ids of each shared library and its corresponding
-symbol file to be identical.  If they are not identical, then by default
-@value{GDBN} will @value{GDBN} will ignore symbol files with non-matching
-build-id while printing:
+Inferior binaries (shared libraries or main executable) and symbol files
+(for all of those) may contain unique build-id.  @value{GDBN} expects
+the build-ids of each binary and its corresponding symbol file to be
+identical.  If they are not identical, then by default @value{GDBN} will
+@value{GDBN} will ignore symbol files with non-matching build-id while
+printing:
 
 @smallexample
-  warning: Shared object "libfoo.so.1" could not be validated (remote
-  build ID 2bc1745e does not match local build ID a08f8767) and will be
-  ignored; or use 'set validate-build-id off'.
+  warning: Symbol file "libfoo.so.1" could not be validated (inferior
+  build ID 66f87872 is not identical to symbol file "libfoo.so.1" build
+  ID df81e8db) and will be ignored; or use 'set validate-build-id off'.
 @end smallexample
 
-Turning off this setting would load such symbol file while still printing:
-
-@smallexample
-  warning: Shared object "libfoo.so.1" could not be validated (remote
-  build ID 2bc1745e does not match local build ID a08f8767) but it is
-  being loaded due to 'set validate-build-id off'.
-@end smallexample
+Turning off this setting would load such symbol file without any warning.
 
 If remote build-id is present but it does not match local build-id (or local
 build-id is not present) then this setting enables (@var{mode} is @code{off}) or
@@ -39802,8 +39797,8 @@ address the file was prelinked to during the library load.
 @end itemize
 
 Additionally the single @code{main-lm} attribute specifies address of
-@code{struct link_map} used for the main executable.  This parameter is
-used for TLS access and its presence is optional.  Similarly the single
+@code{struct link_map} used for the main executable.  This parameter is used
+for TLS access and its presence is optional.  Similarly the single
 @code{main-build-id} optional attribute specifies hex encoded
 @code{NT_GNU_BUILD_ID} note for the main executable.
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 0ad34f6..dc39ed2 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -184,8 +184,7 @@ exec_file_and_symbols_resync (struct inferior *inf, int from_tty)
 	warning (_("Detected exec-file mismatch on %s.  Running %s; Loaded %s"),
 		 target_pid_to_str (pid_to_ptid (inf->pid)),
 		 full_exec_path, exec_filename);
-      if (build_idsz != 0)
-	build_id_verify (exec_bfd, build_idsz, build_id, 0 /* advice */);
+      build_id_verify (exec_bfd, build_idsz, build_id, 0 /* advice */);
       reopen_exec_file ();
     }
   else if (full_exec_path != NULL)
@@ -202,9 +201,8 @@ exec_file_and_symbols_resync (struct inferior *inf, int from_tty)
 		 target_pid_to_str (pid_to_ptid (inf->pid)),
 		 full_exec_path, symbol_filename);
 
-      if (build_idsz != 0)
-	build_id_verify (symfile_objfile->obfd, build_idsz, build_id,
-			 0 /* advice */);
+      build_id_verify (symfile_objfile->obfd, build_idsz, build_id,
+		       0 /* advice */);
     }
   else if (full_exec_path != NULL)
     symbol_file_add_main (0, full_exec_path, from_tty);


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [SCM]  jankratochvil/gdbserverbuildid: Support build-id for main executables
@ 2015-08-20 21:17 jkratoch
  0 siblings, 0 replies; 5+ messages in thread
From: jkratoch @ 2015-08-20 21:17 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid has been updated
  discards  e5507f8594737d27a2f2fe16f2221e4ca649146d (commit)
  discards  5ff4e589f6fe2bc2a8650f787f9a19b1c5ab2dd2 (commit)
  discards  3751bb587bb5e1646a1fcba1ebffa27f6106dccd (commit)
  discards  5f63a388e55f85724b5d43612cfd50fe61c1d129 (commit)
  discards  5947a0c9cceb88d4a9ce62c67f3f61e363de7ddc (commit)
  discards  4e1494a43a52b384d696e02f2906d80e306a95f6 (commit)
  discards  fbf2026ee8b96565184917aaa92bba3c9e1f14d5 (commit)
  discards  11dadb4d264555fd91ab0ae46a136dc61af990f5 (commit)
  discards  a5f5b8ea74ee76db95178b3d2ce7623ba614007a (commit)
  discards  41492ad8abdaf4cc33c9f70550f45251a080eb23 (commit)
  discards  06333a2a928fc3336ab1bdcc881d6d7437d14086 (commit)
  discards  f3deab52baf3eb5e375a7f336c9de79a9eb90a85 (commit)
  discards  fc02788f47d59ce13086aa0877d62ee422d56c10 (commit)
  discards  28f27b3907e177dd11ee4c9bcc0c802a40ffb44d (commit)
  discards  b13b54a2c120999e08bfca8e4d8ab2148a7745fe (commit)
  discards  3cb111fb4dedceda32b0daaf5c05d9b68751a048 (commit)
  discards  8b26582be65a0db52f849eebfdf60c7678e69779 (commit)
  discards  1042077e6bef94e03fe6371aa5ff02b6c7ecaa0a (commit)
  discards  26b420e6255539de37024a6af1927b886b1b510a (commit)
  discards  2179cd5a95f40a8bcafa2bfc55504c68631254d2 (commit)
  discards  21b5225718b928c4f47bfeb660f3d1af6dd281ed (commit)
  discards  1837127dfa8a55db25a410a5f6b705fc7c66499f (commit)
  discards  530b609f9e975ec38b2e234dfdbd6260f76ecaf6 (commit)
  discards  fa098ccdf9a6eb22c98ec202d4b6ff605c0f785d (commit)
  discards  6e49cd7f3be2d9090b1afbea9ed8475d27a2afba (commit)
  discards  4df97c6d0d18295c788d8bf3f1dd62ccfdaa4810 (commit)
  discards  5f17ab81872a7e316cb83dcb814bd2444783978e (commit)
  discards  e0b27412689ea95cc05d207f6091c70972077fc5 (commit)
  discards  f6cd4980f1bb94b524dca174dcdd381ad2be32da (commit)
  discards  ace8843332eb835e1010275d6ba2d4f2cddbdb5d (commit)
  discards  ec0053bd4301d249eef54d95908e5849ab100724 (commit)
  discards  d24163121891e5c67c2837c266831c5ca99328ee (commit)
  discards  fa5a5a47b32c04b28dc134c9443c3d0d13b93f7b (commit)
  discards  6ebf8fd4c922433ab739998eb8696f3b705d3689 (commit)
       via  ab595d5e41323a5e17d4fa2d73fe534f3f83b08a (commit)
       via  6fb3663ddc5d5a99199833d949942aad7b681380 (commit)
       via  bf911121a5734434aad51b715cc19eb8170eb5ef (commit)
       via  fcda11731bd2c9c40339e82bc80d5e35d6dcdeb8 (commit)
       via  cbeb2450722667ef8d7f1266f3099c3406e150ea (commit)
       via  ae205911e654b6b405807fc7c650ac0e2b2888f2 (commit)
       via  5a62beb82130814843c612d9359ec13f54308202 (commit)
       via  b6717c38a322af00f62a943721db158dbc19f30d (commit)
       via  99f2fd6bfd044c983ded576e832d7887e48c2ebe (commit)
       via  cb74b650510f3b6dd0ae6a03f6ba19ae2d7afc47 (commit)
       via  0f04cc7c1c666445744eea4a3eed119d9bec16b0 (commit)
       via  de7fa43d28da0caea1fcd790d4b4e99b0ba3e2cc (commit)
       via  6015f7902e795eccac05b40bc55712c7f9603bab (commit)
       via  0d912487e5a386df01bc02645a44a9faef7de5d7 (commit)
       via  e99ca88a03cd89a75e036bed16697f80f36a6c18 (commit)
       via  7cff29ba8a59f275ed0611fd71d6ffe00e1dd75f (commit)
       via  50c3d7c8425f78c29dcc6af0e46c0e0ad5456388 (commit)
       via  4824eb06420698e713da82269d23d809e153cd17 (commit)
       via  46eada5a83c042621b96bc61780f55289ef3d101 (commit)
       via  cabfd87f9edbc4f6dcd3b13830788cae270adcff (commit)
       via  730480bb5f5546e854ee8b0bd1ac2675d1c78f6f (commit)
       via  20724d37ccb6523d45cc963f67ab6e39d346d7b8 (commit)
       via  0259aa4b5c8a64eaa5df90af54ed4721e052ad09 (commit)
       via  77fd6bd0e8adafc12638379be6c2f380e60f7c8f (commit)
       via  521bf6f14bd907949c0afe161a291392137f54f9 (commit)
       via  29a2e15387c7b901d3ff724eefc17da1d7c7972b (commit)
       via  98f9d97afa805f97e4d458b16487b3eda72d67f0 (commit)
       via  78902252d958c60f2e8bdc636a8580e685a42214 (commit)
       via  297e4cca9e1ddd859a9409063e6edeb75cc5c164 (commit)
       via  dcf8f42dd92db632477b9d0f803c098951eb771a (commit)
       via  c3ff2fcf809287543c310c40edb5a9fd872177c7 (commit)
       via  7d6a0cf97bf0080bac4686dbeb795f2bfbd7f4d2 (commit)
       via  0e433b32028e65f1f2f13e7c0d26061a37b7d583 (commit)
       via  221e1a37cd14f7c98b4ea1ab24bd721a8b144711 (commit)
       via  40e3ad0ebb0c71008b928d6d350e9258dc1dcf2a (commit)
       via  af39b3270a1385027b2a5d145b9ba7564bd39f7a (commit)
       via  9215b98bb27c071386a277f5578dbb17569a1471 (commit)
       via  9d1f51209437ebee8f0a930b9613d59759ea8dc0 (commit)
       via  7d45c7c3f692d93c3a33a043c347f1386681deb4 (commit)
       via  07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75 (commit)
       via  4c5625238cccb048261d7ce0eb748ee5e0d67cf0 (commit)
       via  6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9 (commit)
       via  49df5539f9070c01128135a7d63f44b2efc4de6a (commit)
       via  753999c1ec8fa76bd5ed5509d1e5909d010e80ee (commit)
       via  13289c10e20281adf480d9822861412a7ade721d (commit)
       via  45face3ba147a4c5f4f7e09cf10c95986b915002 (commit)
       via  64d94ba01a4f56ac10bb277e66bb00d82bd97f10 (commit)
       via  3cbc1e5e68341e53a03fe7e9d38fc02e0d78c418 (commit)
       via  b45e00b3ed40589af75b8a36a67905ae265a20f8 (commit)
       via  e49433d22dae92a56ae15a8b5742cbf1f31d5fd1 (commit)
       via  16d5f64295ccf2a8e9fe3ed350c94c38cee5a481 (commit)
       via  4d6cceb4e40a057dbe4d9ad94b0641d5f4725c09 (commit)
      from  e5507f8594737d27a2f2fe16f2221e4ca649146d (commit)

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

- Log -----------------------------------------------------------------
commit ab595d5e41323a5e17d4fa2d73fe534f3f83b08a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:38 2015 +0200

    Support build-id for main executables
    
    Hi,
    
    make all the existing shlibs build-id functionality working also for the main
    executables.
    
    I think target_so_ops::open_symbol_file_object() is already replaced by what
    exec_file_and_symbols_resync(), target_pid_to_exec_file() etc. does but
    open_symbol_file_object() has been forgotten.
    
    This patch adds target_so_ops::main_build_id() which could be possibly marged
    with open_symbol_file_object() but I made it a separate function as I think it
    is easier to rather remove target_so_ops::open_symbol_file_object().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_verify): Add parameter advice.
    	* build-id.h (build_id_verify): Likewise.
    	* dwarf2read.c (dwarf2_get_dwz_file): Update build_id_verify caller.
    	* exec.c: Include build-id.h.
    	(exec_file_and_symbols_resync): Detect and use build-id by
    	solib_main_build_id.
    	* features/library-list-svr4.dtd: Add main-build-id.
    	* solib-svr4.c (struct svr4_info, struct svr4_library_list): Add fields
    	main_build_idsz and main_build_id.
    	(hex2bin_allocate): Generalize messages to binary files.
    	(svr4_library_list_start_list): Parse main-build-id.
    	(svr4_library_list_attributes): Add main-build-id.
    	(svr4_current_sos_direct): Set svr4_info main_build_id*.
    	(svr4_main_build_id): New function.
    	(svr4_clear_solib): Clear svr4_info main_build_id*.
    	(_initialize_svr4_solib): Install svr4_main_build_id.
    	* solib.c (solib_main_build_id): New function.
    	* solist.h (struct target_so_ops): Add method main_build_id.
    	(solib_main_build_id): New prototype.
    	* source.c (file_location_from_filename): Update build_id_verify caller.
    
    gdb/gdbserver/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-low.c (linux_qxfer_libraries_svr4): Print main-build-id.
    
    gdb/doc/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    FIXME
    	* gdb.texinfo (Files):
    	(address the file was prelinked to during the library load.):
    	(A simple memory map):
    	(The format of an SVR4 library list is described by this DTD):
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/main-mismatch-mod.c: New file.
    	* gdb.base/main-mismatch.c: New file.
    	* gdb.base/main-mismatch.exp: New file.

commit 6fb3663ddc5d5a99199833d949942aad7b681380
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:38 2015 +0200

    Make only user-specified executable and symbol filenames sticky
    
    Message-ID: <559A7C37.6020501@redhat.com>
    
    On 07/03/2015 04:44 PM, Pedro Alves wrote:
    
    > (I still suspect that if we reverse the sense of the flag, then
    > its management ends up being more centralized, as then the
    > place that sets it is also the place that needs to check it,
    > instead of doing that in multiple places.  But, see below.)
    
    It didn't seem fair to impose a subjective preference, so I tried
    this in order to understand it myself, and I now agree that is really
    doesn't make much difference, as then we'd have to mark
    auto-discovered in a few more places that I wasn't originally
    seeing.  There's at least the execd handling in infrun.c, and
    also spu_symbol_file_add_from_memory.
    
    As I was playing with this already, I poked at the other review
    points I made, and came up with the variant of the patch below.
    
    > This function is called while the passed in PID is not the
    > current inferior.  E.g., the remote_add_inferior path.
    >
    > Therefore seems to me that these symbol_file_add_main / exec_file_attach
    > calls can change the symbols of the wrong inferior.
    
    ...
    
    > I also notice that reread_symbols has an exec_file_attach
    > call which seems to me results in losing the is_user_supplied
    > flag if the executable's timestamp changed, at least here:
    >
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    >
    > I also notice that the clone-inferior command ends up with
    > an exec_file_attach call in clone_program_space.  That one
    > should probably be setting the is_user_supplied flag too,
    > I'd think.  Or at least, copying it from the original.
    >
    > At this point, I'm wondering about adding a parameter to
    > exec_file_attach to force considering (now and in future)
    > the right value to put in the flag in each case.
    
    I tried this too (see patch below).  As this requires touching the user-supplied
    paths anyway, it didn't really matter to tag files user-supplied or
    auto-discovered, so I reverted back to user-supplied.  For symbols,
    we already have the add_flags, so I added SYMFILE_USER_SUPPLIED instead
    of a new boolean.
    
    >
    >> @@ -2490,11 +2490,14 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
    >>    inferior = current_inferior ();
    >>    inferior->control.stop_soon = NO_STOP_QUIETLY;
    >>
    >> -  /* If no exec file is yet known, try to determine it from the
    >> -     process itself.  */
    >> -  if (get_exec_file (0) == NULL)
    >> -    exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> -  else
    >> +  /* 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.  */
    >> +  exec_file_locate_attach (ptid_get_pid (inferior_ptid), from_tty);
    >> +
    >> +  if (exec_file_is_user_supplied)
    >>      {
    >>        reopen_exec_file ();
    >>        reread_symbols ();
    >
    > It seems to me that we should be able to move these reopen/reread
    > calls inside exec_file_locate_attach.
    
    I did this too.
    
    What do you think of the version below?
    
    I also tweaked the warnings a bit, to explicitly say "mismatch".
    
    This would still need docs/NEWS changes, and a test would be good too.
    
    ----------
    
    - pass user-supplied / auto-discovered as arguments to exec_file_attach and
      symbol_file_add_main
    
    - Change exec_file_locate_attach parameter from pid to inferior
      pointer.
    
    - Flip current program space temporarily to make sure we add/reload
      symbols to/of the right inferior/program space.
    
    - Move reopen_exec_file and reread_symbols calls inside
      exec_file_locate_attach.
    
    - Warning message tweaks.
    
    - Rename exec_file_locate_attach -> exec_file_and_symbols_resync

commit bf911121a5734434aad51b715cc19eb8170eb5ef
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:38 2015 +0200

    Code cleanup: New hex2bin_allocate()
    
    Hi,
    
    make hex->bin parsing standalone, to be reused in later patch.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib-svr4.c (hex2bin_allocate): New function from ...
    	(library_list_start_library): ... here, call it.

commit fcda11731bd2c9c40339e82bc80d5e35d6dcdeb8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    testcase: Test also locating shlibs by build-id
    
    Hi,
    
    testcase from the previous patch tests verification of build-id in shared
    libraries found by their name.  This test adds testing that a library can be
    found by its build-id (debug-file-directory/.build-id/XX/YYYYY...YYYYY).
    
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.base/solib-mismatch.exp (nocrlf, expected_header): Make them
    	global.
    	(solib_locate_test): New function.

commit cbeb2450722667ef8d7f1266f3099c3406e150ea
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    Tests for validate symbol file using build-id
    
    Hi,
    
    new testcase only.
    
    Jan
    
    
    gdb/testsuite/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    
    	Tests for validate symbol file using build-id.
    	* gdb.base/solib-mismatch-lib.c: New file.
    	* gdb.base/solib-mismatch-libmod.c: New file.
    	* gdb.base/solib-mismatch.c: New file.
    	* gdb.base/solib-mismatch.exp: New file.

commit ae205911e654b6b405807fc7c650ac0e2b2888f2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    build_id_verify: Make it more verbose
    
    Hi,
    
    it was discussed on this list that if build-ids do not match they should be
    printed for troubleshooting.  It is mostly independent from the other patches.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include rsp-low.h.
    	(build_id_verify): Print non-matching build-ids, update the messages.

commit 5a62beb82130814843c612d9359ec13f54308202
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    solib_bfd_open: Optimize opening twice
    
    Hi,
    
    this is one of the optimizations allowed by file_location that prevents opening
    file twice when target build-id is known and it needs to be verified.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_bfd_fopen): Replace solib_find and solib_bfd_fopen by
    	solib_find_file.

commit b6717c38a322af00f62a943721db158dbc19f30d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    Verify the build-id
    
    Hi,
    
    now it is possible to filter-out from openp() search files with non-matching
    build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c: Include build-id.h.
    	(file_location_from_filename): Call build_id_verify for the build-id
    	parameters.

commit 99f2fd6bfd044c983ded576e832d7887e48c2ebe
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    solib_find: Search also by build-id
    
    Hi,
    
    solib_find() can now try to search also by build-id.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c: Include build-id.h.
    	(solib_find_3): Call build_id_to_file.

commit cb74b650510f3b6dd0ae6a03f6ba19ae2d7afc47
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:37 2015 +0200

    build_id_to_bfd: Make it return file_location
    
    Hi,
    
    refactor build_id_to_bfd so that it returns file_location.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c: Include source.h.
    	(build_id_to_bfd): Rename to ...
    	(build_id_to_file): ... here, return file_location, add parameter opts,
    	make it public.
    	(build_id_to_debug_bfd): Use build_id_to_file.
    	* build-id.h (build_id_to_file): New prototype.

commit 0f04cc7c1c666445744eea4a3eed119d9bec16b0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    Add dummy build-id params to prototypes
    
    Hi,
    
    it is a lot of text with no functionality.  Add build-id parameters where
    needed, pass them where they are already available, otherwise pass 0 in the top
    callers.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Pass zero build-id.
    	* defs.h (openp, openp_file, source_full_path_of): Add build-id
    	parameters.
    	* dwarf2read.c (try_open_dwop_file): Pass zero build-id.
    	* exec.c (exec_file_locate_attach): Likewise.
    	* infrun.c (follow_exec): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Add build-id parameters, pass
    	them.
    	* nto-tdep.h (nto_find_and_open_solib): Add build-id parameters.
    	* solib-aix.c (solib_aix_bfd_open): Add build-id parameters, pass them.
    	* solib-darwin.c (darwin_bfd_open): Likewise.
    	* solib-dsbt.c (enable_break): Pass zero build-id.
    	* solib-frv.c (enable_break2): Likewise.
    	* solib-spu.c (spu_bfd_open): Add build-id parameters, pass them.
    	* solib-svr4.c (enable_break): Pass zero build-id.
    	* solib.c (solib_find_3, solib_find_2, solib_find_1, exec_file_find)
    	(solib_find_file, solib_find, solib_bfd_open): Add build-id
    	parameters, pass them.
    	(solib_map_sections): Pass so->build-id* to bfd_open.
    	(reload_shared_libraries_1): Pass so->build-id* to solib_bfd_open.
    	* solist.h (struct target_so_ops): Add build-id parameters to bfd_open
    	and find_and_open_solib.
    	(exec_file_find, solib_find, solib_bfd_open): Add build-id parameters.
    	* source.c (file_location_from_filename): Add build-id parameters.
    	(filename_to_bfd): Pass zero build-id.
    	(openp): Add build-id parameters, pass them.
    	(openp_bfd): Pass zero build-id.
    	(openp_file, source_full_path_of): Add build-id parameters, pass them.
    	(find_and_open_source): Pass zero build-id.
    	* source.h (file_location_from_filename): Add build-id parameters.

commit de7fa43d28da0caea1fcd790d4b4e99b0ba3e2cc
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    build_id_to_debug_bfd: Make it also non-.debug capable
    
    Hi,
    
    generalize the function by adding 'suffix' parameter.  To be reused later.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* build-id.c (build_id_to_debug_bfd): Rename to ...
    	(build_id_to_bfd): ... here, add parameter suffix.
    	(build_id_to_debug_bfd): New function.

commit 6015f7902e795eccac05b40bc55712c7f9603bab
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    symfile_bfd_open: Make it use openp_bfd()
    
    Hi,
    
    another function gets converted to the new API.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* symfile.c (symfile_bfd_open): Use openp_bfd instead of openp and
    	gdb_bfd_open.

commit 0d912487e5a386df01bc02645a44a9faef7de5d7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    solib_find: Make it use file_location
    
    Hi,
    
    refactor the solib*() code to use file_location functions.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* nto-tdep.c: Include source.h.
    	(nto_find_and_open_solib): Return file_location, remove parameter
    	temp_pathname.  Change openp to openp_file.
    	* nto-tdep.h (nto_find_and_open_solib): Update prototype.
    	* solib.c (solib_find_2): Rename to ...
    	(solib_find_3): ... here, return file_location, change parameter fd to
    	opts.  Change gdb_open_cloexec to file_location_from_filename and openp
    	to openp_file calls.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here, return file_location, change parameter fd to
    	opts.
    	(solib_find_1): New function.
    	(solib_find): Rename to ...
    	(solib_find_file) ... here, return file_location, change parameter fd
    	to opts.
    	(solib_find): New function.
    	* solist.h (find_and_open_solib): Return file_location, remove
    	parameter temp_pathname.

commit e99ca88a03cd89a75e036bed16697f80f36a6c18
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    Refactor openp() to return file_location
    
    Hi,
    
    openp() remains as a backward compatibility wrapper around renamed
    openp->openp_file().
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Remove OPF_OPEN_RW_TMP, add
    	OPF_BFD_CANONICAL.
    	(openp_bfd, openp_file): Add prototypes.
    	* exec.c (exec_file_attach): Replace openp by openp_bfd calls.
    	* source.c (file_location_from_filename): Support OPF_BFD_CANONICAL.
    	(openp, openp_bfd): New functions.
    	(openp): Rename to ...
    	(openp_file): ... here, return file_location, remove filename_opened
    	parameter.

commit 7cff29ba8a59f275ed0611fd71d6ffe00e1dd75f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    Add file_location utility functions
    
    Hi,
    
    build id verification faces a problem current codebase calls openp() and
    similar functions which search many directories and after they find the file
    they return its filename.  Caller then typically opens that file as BFD.
    
    But to search the directories openp() needs to open each file it iterates to
    verify their build-id.  Then it would close the file and caller would reopen it
    again.  This is inefficient (+racy), so a new intermediate representation of
    the found files is created (file_location).
    
    Another possibility would be to depends on bfd cache as being done in
    exec_file_attach.  But then a similar problem is needed for callers which want
    only fd (and not bfd).  Besides that I find depending on pending
    make_cleanup_bfd_unref() from openp() calls would be tricky.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* defs.h (enum openp_flags): Add OPF_IS_BFD.
    	* gdb_bfd.c (fileio_errno_to_host): Make it public.
    	* gdb_bfd.h (fileio_errno_to_host): Add prototype.
    	* source.c: Include inferior.h and gdb/fileio.h.
    	(file_location_enoent, file_location_free, file_location_cleanup)
    	(file_location_is_valid, file_location_from_filename)
    	(file_location_to_bfd, filename_to_bfd): New functions.
    	* source.h (struct file_location): New definition.
    	(file_location_enoent, file_location_free, file_location_is_valid)
    	(file_location file_location_from_filename, file_location_to_bfd)
    	(filename_to_bfd): New prototypes.

commit 50c3d7c8425f78c29dcc6af0e46c0e0ad5456388
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:36 2015 +0200

    gdb_bfd_open_from_target: Optionally do not close fd
    
    Hi,
    
    gdb_bfd_open_from_target currently always embedded passed fd into returned BFD
    and closed that fd after closing that BFD.  As one cannot do dup() for target
    fileio FDs one could not use FD after BFD using it has been closed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_close_nop): New function.
    	(gdb_bfd_open_from_target): Add parameter do_close.  Optionally pass
    	gdb_bfd_iovec_fileio_close_nop.
    	(gdb_bfd_open): Update caller.
    	* gdb_bfd.h (gdb_bfd_open_from_target): Update prototype.

commit 4824eb06420698e713da82269d23d809e153cd17
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    gdb_bfd_open_from_target: Support real fd
    
    Hi,
    
    gdb_bfd_open_from_target is extended so that it can be now passed also some
    non-(-1) fd.  non-(-1) fd was not supported for remote files in mainline.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_iovec_fileio_open_fd): New function.
    	(gdb_bfd_open_from_target): Conditionally use it.

commit 46eada5a83c042621b96bc61780f55289ef3d101
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    Provide new gdb_bfd_open_from_target
    
    Hi,
    
    later code needs to call the gdb_bfd_openr_iovec part of gdb_bfd_open with more
    special parameters.  So it is refactored out first (and extended later in the
    next patches).
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb_bfd.c (gdb_bfd_open_from_target): New function from ...
    	(gdb_bfd_open): ... here.  Call it.
    	* gdb_bfd.h (gdb_bfd_open_from_target): New prototype.

commit cabfd87f9edbc4f6dcd3b13830788cae270adcff
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    Code cleanup: openp parameter filename_opened is never NULL
    
    Hi,
    
    this parameter is never passed as NULL in the codebase so the check can be
    removed.
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* source.c (openp): Update function comment for filename_opened.
    	Remove NULL check for filename_opened.

commit 730480bb5f5546e854ee8b0bd1ac2675d1c78f6f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    Code cleanup: Remove openp parameter mode
    
    Hi,
    
    simplify the code, make it also suitable for more code refactorings.
    The new flag OPF_OPEN_RW_TMP is removed later in this patch series.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Update openp caller.
    	* defs.h (enum openp_flags): Add OPF_OPEN_RW_TMP.
    	(openp): Remove parameter mode.
    	* dwarf2read.c (try_open_dwop_file): Update openp caller.
    	* exec.c (exec_file_attach): Likewise.
    	* nto-tdep.c (nto_find_and_open_solib): Remove parameter o_flags,
    	update openp caller.
    	* nto-tdep.h (nto_find_and_open_solib): Remove parameter o_flags.
    	* solib.c (solib_find_2): Update openp and find_and_open_solib caller.
    	* solist.h (struct target_so_ops): Remove parameter o_flags from
    	find_and_open_solib method.
    	* source.c (openp): Change parameter mode to a new variable.
    	(source_full_path_of, find_and_open_source): Update openp caller.
    	* symfile.c (symfile_bfd_open): Likewise.

commit 20724d37ccb6523d45cc963f67ab6e39d346d7b8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    Code cleanup: Remove OPF_RETURN_REALPATH
    
    Hi,
    
    OPF_RETURN_REALPATH is used only at the end of openp() to convert the returned
    values.  That is not useful, code can be simplified if callers that passed
    OPF_RETURN_REALPATH adjust the returned values on their own.  Or at least it
    helps further refactorizations.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree.
    	* defs.h (enum openp_flags): Add OPF_NONE, remove OPF_RETURN_REALPATH.
    	* dwarf2read.c (try_open_dwop_file): Remove OPF_RETURN_REALPATH.  Call
    	gdb_realpath_and_xfree.
    	* nto-tdep.c (nto_find_and_open_solib): Remove OPF_RETURN_REALPATH.
    	Call gdb_realpath_and_xfree and xstrdup.
    	* solib.c (solib_find_2): New variable temp_pathname_is_realpath.
    	Remove OPF_RETURN_REALPATH.  Conditionally call gdb_realpath_and_xfree.
    	* source.c (openp): Remove OPF_RETURN_REALPATH processing.
    	(source_full_path_of, find_and_open_source): Remove
    	OPF_RETURN_REALPATH.  Call gdb_realpath_and_xfree.
    	* symfile.c (symfile_bfd_open): Likewise.
    	* utils.c (gdb_realpath_and_xfree): New function.
    	* utils.h (gdb_realpath_and_xfree): New prototype.

commit 0259aa4b5c8a64eaa5df90af54ed4721e052ad09
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:35 2015 +0200

    Code cleanup: Add enum for openp_flags
    
    Hi,
    
    it is for many reasons better, in C++ it could be even type safe.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* cli/cli-cmds.c (find_and_open_script): Use enum openp_flags for
    	search_flags.
    	* defs.h (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
    	Wrap them to a new ...
    	(enum openp_flags): ... enum.
    	(openp): Update prototype.
    	* dwarf2read.c (try_open_dwop_file): Use enum openp_flags for flags.
    	* source.c (openp): Update opts parameter type.  Move out OPF_*
    	comments.

commit 77fd6bd0e8adafc12638379be6c2f380e60f7c8f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:34 2015 +0200

    Change sysroot to ":target:"
    
    Hi,
    
    that is try "" first and "target:" second.
    
    Various performance problems should be fixed by trying to look up the remote
    file first on local filesystem.  Thanks to build-ids it is quick and safe to
    verify both files are the same build.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention sysroot.
    	* main.c (captured_main): Initialize new gdb_sysroot.
    
    gdb/testsuite/ChangeLog
    
    	* gdb.base/attach.exp (do_attach_tests): Update sysroot parsing.
    	* gdb.base/break-probes.exp: Likewise.

commit 521bf6f14bd907949c0afe161a291392137f54f9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:34 2015 +0200

    Permit multiple sysroot directories
    
    Hi,
    
    the goal is to have both "" and "target:" as the default gdb_sysroot, in this
    order.  Therefore permit multiple directory components of gdb_sysroot.
    
    
    Jan
    
    
    gdb/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* NEWS (Changes since GDB 7.10): Mention set sysroot and show sysroot.
    	* solib.c: Include source.h.
    	(solib_find_1): Rename to ...
    	(solib_find_2): ... here and change the sysroot variable to parameter.
    	(solib_find_1): Call it using dirnames_to_char_ptr_vec_target_exc.
    	* source.c (dirnames_to_char_ptr_vec_target_exc): New function.
    	* source.h (dirnames_to_char_ptr_vec_target_exc): New declaration.
    
    gdb/doc/ChangeLog
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Permit set sysroot and show sysroot to have
    	multiple components.

commit 29a2e15387c7b901d3ff724eefc17da1d7c7972b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:34 2015 +0200

    Code cleanup: Make solib_find_1 variable const
    
    Hi,
    
    it gets used in the next patch.
    
    
    Jan
    
    
    2015-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* solib.c (solib_find_1): Make sysroot variable const.

commit 98f9d97afa805f97e4d458b16487b3eda72d67f0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:34 2015 +0200

    Validate symbol file using build-id
    
    Consumer part of the "build-id" attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Validate symbol file using build-id.
    	* NEWS (Changes since GDB 7.10): Add 'set validate-build-id'
    	and 'show validate-build-id'.  Add build-id attribute.
    	* build-id.c: Include gdbcmd.h.
    	(validate_build_id, show_validate_build_id, _initialize_build_id): New.
    	* build-id.h (validate_build_id): New declaration.
    	* solib-svr4.c: Include rsp-low.h.
    	(svr4_copy_library_list): Duplicate field build_id.
    	(library_list_start_library): Parse 'build-id' attribute.
    	(svr4_library_attributes): Add 'build-id' attribute.
    	* solib.c (free_so): Free build_id.
    	* solist.h (struct so_list): New fields 'build_idsz' and 'build_id'.
    
    gdb/doc/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* gdb.texinfo (Files): Add 'set validate-build-id'
    	and 'show validate-build-id'.

commit 78902252d958c60f2e8bdc636a8580e685a42214
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:34 2015 +0200

    gdbserver build-id attribute generator
    
    Producer part of the new "build-id" XML attribute.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* features/library-list-svr4.dtd (library-list-svr4): New
    	'build-id' attribute.
    
    gdb/doc/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* gdb.texinfo (Library List Format for SVR4 Targets): Add
    	'build-id' in description, example, new attribute in dtd.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	gdbserver build-id attribute generator.
    	* linux-low.c (linux-maps.h, search.h, rsp-low.h): Include.
    	(ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
    	(ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
    	(find_phdr): New.
    	(get_dynamic): Use find_pdhr to traverse program headers.
    	(struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
    	(compare_mapping_entry_range, struct find_memory_region_callback_data)
    	(read_build_id, find_memory_region_callback, lrfind_mapping_entry)
    	(get_hex_build_id): New.
    	(linux_qxfer_libraries_svr4): Add optional build-id attribute
    	to reply XML document.

commit 297e4cca9e1ddd859a9409063e6edeb75cc5c164
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:33 2015 +0200

    Move linux_find_memory_regions_full & co.
    
    This should be just a move with no changes.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Move linux_find_memory_regions_full & co.
    	* linux-tdep.c (linux-maps.h): Include.
    	(gdb_regex.h): Remove the include.
    	(enum filterflags, struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Moved to common/linux-maps.c.
    	(linux_find_memory_region_ftype): Moved typedef to common/linux-maps.h.
    	(linux_find_memory_regions_full): Moved definition to
    	common/linux-maps.c.
    	* common/linux-maps.c: Include ctype.h, target/target-utils.h,
    	gdb_regex.h and target/target.h.
    	(struct smaps_vmflags, read_mapping, decode_vmflags)
    	(mapping_is_anonymous_p, dump_mapping_p): Move from linux-tdep.c.
    	(linux_find_memory_regions_full): Move from linux-tdep.c.
    	* common/linux-maps.h (read_mapping): New declaration.
    	(linux_find_memory_region_ftype, enum filterflags): Moved from
    	linux-tdep.c.
    	(linux_find_memory_regions_full): New declaration.
    	* target.c (target/target-utils.h): Include.
    	(read_alloc_pread_ftype): Moved typedef to target/target-utils.h.
    	(read_alloc, read_stralloc_func_ftype, read_stralloc): Moved
    	definitions to target/target-utils.c.
    	* target.h (target_fileio_read_stralloc): Move it to target/target.h.
    	* target/target-utils.c (read_alloc, read_stralloc): Move definitions
    	from target.c.
    	* target/target-utils.h (read_alloc_pread_ftype): New typedef.
    	(read_alloc): New declaration.
    	(read_stralloc_func_ftype): New typedef.
    	(read_stralloc): New declaration.
    	* target/target.h (target_fileio_read_stralloc): Move it from target.h.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* target.c: Include target/target-utils.h and fcntl.h.
    	(target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
    	(target_fileio_read_stralloc): New functions.

commit dcf8f42dd92db632477b9d0f803c098951eb771a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:33 2015 +0200

    Prepare linux_find_memory_regions_full & co. for move
    
    Prepare code for move into gdb/common/.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Prepare linux_find_memory_regions_full & co. for move.
    	* linux-tdep.c (linux_find_memory_region_ftype): Comment.
    	(linux_find_memory_regions_full): Change signature and prepare
    	for moving to linux-maps.
    	(linux_find_memory_regions_data): Rename field 'obfd' to 'data'.
    	(linux_find_memory_regions_thunk): New.
    	(linux_find_memory_regions_thunk): Use 'data' field instead of 'obfd'.
    	(linux_find_memory_regions_gdb): New.
    	(linux_find_memory_regions): Rename argument 'obfd' to 'func_data'.
    	(linux_make_mappings_corefile_notes): Use
    	linux_find_memory_regions_gdb.
    	* target.c (read_alloc_pread_ftype): New typedef.
    	(target_fileio_read_alloc_1_pread): New function.
    	(read_alloc): Refactor from target_fileio_read_alloc_1.
    	(read_stralloc_func_ftype): New typedef.
    	(target_fileio_read_alloc_1): New implementation. Use read_alloc.
    	(read_stralloc): Refactored from target_fileio_read_stralloc.
    	(target_fileio_read_stralloc): New implementation, use read_stralloc.

commit c3ff2fcf809287543c310c40edb5a9fd872177c7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:33 2015 +0200

    Move gdb_regex* to common/
    
    Later patches need regex support also in gdbserver.
    
    gdb/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (HFILES_NO_SRCDIR): Change gdb_regex.h to
    	common/gdb_regex.h.
    	(COMMON_OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* common/common.m4 (GDB_AC_COMMON): Add gdb_use_included_regex,
    	--without-included-regex and USE_INCLUDED_REGEX.
    	* common/gdb_regex.c: New file from utils.c functions.
    	* common/gdb_regex.h: Move it here from gdb_regex.h, update include
    	file wrapping define name.
    	* configure: Rebuilt.
    	* configure.ac (gdb_use_included_regex, --without-included-regex)
    	(USE_INCLUDED_REGEX): Move them to common/common.m4.
    	* gdb_regex.h: Move it to common/gdb_regex.h.
    	* utils.c: Remove include gdb_regex.h.
    	(do_regfree_cleanup, make_regfree_cleanup, get_regcomp_error)
    	(compile_rx_or_error): Move them to common/gdb_regex.c.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* Makefile.in (OBS): Add gdb_regex.o.
    	(gdb_regex.o): New.
    	* config.in: Rebuilt.
    	* configure: Rebuilt.

commit 7d6a0cf97bf0080bac4686dbeb795f2bfbd7f4d2
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Aug 20 22:32:33 2015 +0200

    Create empty common/linux-maps.[ch] and common/target-utils.[ch]
    
    Prepare new files for later move.
    
    gdb/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (ALL_TARGET_OBS): Add linux-maps.o.
    	(HFILES_NO_SRCDIR); Add common/linux-maps.h,
    	common/target-utils.h.
    	(COMMON_OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* target/target-utils.c: New file.
    	* target/target-utils.h: New file.
    	* common/linux-maps.c: New file.
    	* common/linux-maps.h: New file.
    	* configure.tgt (aarch64*-*-linux*, alpha*-*-linux*)
    	(am33_2.0*-*-linux*, arm*-*-linux*, bfin-*-*linux*, cris*, frv-*-*)
    	(hppa*-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
    	(m68*-*-linux*, microblaze*-linux-*, microblaze*-*-linux*)
    	(mips*-*-linux*, nios2*-*-linux*, powerpc*-*-linux*, s390*-*-linux*)
    	(sh*-*-linux*, sparc-*-linux*, sparc64-*-linux*, tic6x-*-*linux)
    	(tilegx-*-linux*, x86_64-*-linux*, xtensa*-*-linux*): Add linux-maps.o
    	to gdb_target_obs.
    
    gdb/gdbserver/ChangeLog
    2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
    	    Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	Create empty common/linux-maps.[ch] and common/target-utils.[ch].
    	* Makefile.in (OBS): Add target-utils.o.
    	(linux-maps.o, target-utils.o): New.
    	* configure.srv (srv_linux_obj): Add linux-maps.o.

commit 0e433b32028e65f1f2f13e7c0d26061a37b7d583
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Aug 20 20:08:48 2015 +0100

    Fix gdb.server/solib-list.exp native-extended-gdbserver regression
    
    Commit 221e1a37 (remote non-stop: Process initially stopped threads
    before other commands) caused a test regression when testing with the
    native-extended-gdbserver board:
    
      FAIL: gdb.server/solib-list.exp: non-stop 1: non-stop interior stop (timeout)
    
    This "interior stop" now happens before "target remote" prints the
    prompt, so we should no longer explicitly expect it.
    
    gdb/testsuite/ChangeLog:
    2015-08-20  Pedro Alves  <palves@redhat.com>
    
    	* gdb.server/solib-list.exp: No longer expect an interior stop in
    	non-stop mode.

commit 221e1a37cd14f7c98b4ea1ab24bd721a8b144711
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Aug 20 18:27:55 2015 +0100

    remote non-stop: Process initially stopped threads before other commands
    
    The main motivation for this is making non-stop / all-stop behave
    similarly on initial connection, in order to move in the direction of
    reimplementing all-stop mode with the remote target always running in
    non-stop mode.
    
    When we connect to a remote target in non-stop mode, we may find
    threads either running or already stopped.  The act of connecting
    itself does not force threads to stop.  To handle that, the remote
    non-stop connection is currently roughly like this:
    
     #1 - Fetch list of remote threads (qXfer:threads:read, qfThreadInfo,
        etc).  All threads are assumed to be running until the target
        reports an asynchronous stop reply for them.
    
     #2 - Fetch the initial set of threads that were already stopped, with
        the '?'  packet.  (In non-stop, this is coupled with the vStopped
        mechanism to be able to retrieve the status of more than one
        thread.)
    
    The stop replies fetched in #2 are placed in the pending stop reply
    queue, and left for the regular event loop to process.  That is,
    "target remote" finishes and returns _before_ those stops are
    processed.
    
    That means that it's possible to have GDB process further commands
    before the initial set of stopped threads is reported to the user.
    
    E.g., before the patch, note how the prompt is printed before the
    frame:
    
     Remote debugging using :9999
     (gdb)
     [Thread 15296] #1 stopped.
     0x0000003615a011f0 in ?? ()
    
    Even though thread #1 was not running, for a moment, the user can see
    it as such:
    
     $ gdb a.out -ex "set non-stop 1" -ex "tar rem :9999"  -ex "info threads" -ex "info registers"
     Remote debugging using :9999
       Id   Target Id         Frame
     * 1    Thread 4772       (running)
     Target is executing.                 <<<<<<< info registers
     (gdb)
     [Thread 4772] #1 stopped.
     0x0000003615a011f0 in ?? ()
    
    To fix that, this commit makes gdb process all threads found already
    stopped at connection time, before giving the prompt to the user.
    
    The fix takes a cue from fork-child.c:startup_inferior [1], and
    processes the events locally in remote.c, avoiding the whole
    wait_for_inferior/handle_inferior_event path.  I decided to try this
    approach after noticing that:
    
     - several cases in handle_inferior_event miss checking stop_soon.
     - we don't want to fetch the thread list in normal_stop.
    
    and trying to fix them was resulting in sprinkling stop_soon checks in
    many places, and uglifying normal_stop even more.
    
    While with this patch, I'm avoiding changing GDB's output other than
    when the prompt is printed, I think this approach is more flexible if
    we do want to change it.  And also, it's likely easier to get rid of
    the MI *running event that is still sent for threads that are
    initially found stopped, if we want to.
    
    This happens to fix the testsuite too.  All non-stop tests are racy
    against "target remote" / gdbserver testing currently.  That is,
    sometimes the tests run, but other times they're just skipped without
    any indication of PASS/FAIL.  When that happens, the logs show:
    
     target remote localhost:2346
     Remote debugging using localhost:2346
     (gdb)
     [Thread 25418] #1 stopped.
     0x0000003615a011f0 in ?? ()
     ^CQuit
     (gdb) Remote debugging from host 127.0.0.1
     Killing process(es): 25418
     monitor exit
     (gdb) Remote connection closed
     (gdb) testcase /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/multi-create-ns-info-thr.exp completed in 61 seconds
    
    The trouble here is that there's output after the prompt, and the
    regex in question doesn't expect that:
    
       -re "Remote debugging using .*$serialport_re.*$gdb_prompt $" {
    	verbose "Set target to $targetname"
    	return 0
        }
    
    [1] - before startup_inferior was added, we'd go through
    wait_for_inferior/handle_inferior_event while going through the shell,
    and that turned out problematic.
    
    Tested on x86_64 Fedora 20, gdbserver.
    
    gdb/ChangeLog:
    2015-08-20  Pedro Alves  <palves@redhat.com>
    
    	* infrun.c (print_target_wait_results): Make extern.
    	* infrun.h (print_target_wait_results): Declare.
    	* remote.c (set_stop_requested_callback): Delete.
    	(process_initial_stop_replies): New function.
    	(remote_start_remote): Use it.
    	(stop_reply_queue_length): New function.
    
    gdb/testsuite/ChangeLog:
    2015-08-20  Pedro Alves  <palves@redhat.com>
    
    	* gdb.server/connect-stopped-target.c: New file.
    	* gdb.server/connect-stopped-target.exp: New file.

commit 40e3ad0ebb0c71008b928d6d350e9258dc1dcf2a
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Aug 20 12:30:08 2015 +0100

    Fix language of compilation unit with unknown file extension
    
    Here, in dwarfread.c:process_full_comp_unit:
    
          /* Set symtab language to language from DW_AT_language.  If the
    	 compilation is from a C file generated by language preprocessors, do
    	 not set the language if it was already deduced by start_subfile.  */
          if (!(cu->language == language_c
    	    && COMPUNIT_FILETABS (cust)->language != language_c))
    	COMPUNIT_FILETABS (cust)->language = cu->language;
    
    in case start_subfile doesn't manage to deduce a language
    COMPUNIT_FILETABS(cust)->language ends up as language_unknown, not
    language_c.  So the condition above evals false and we never set the
    language from the cu's language.
    
    gdb/ChangeLog:
    2015-08-20  Pedro Alves  <palves@redhat.com>
    
    	* dwarf2read.c (process_full_comp_unit): To tell whether
    	start_subfile managed to deduce a language, test for
    	language_unknown instead of language_c.
    
    gdb/testsuite/ChangeLog:
    2015-08-20  Pedro Alves  <palves@redhat.com>
    
    	* gdb.dwarf2/comp-unit-lang.exp: New file.
    	* gdb.dwarf2/comp-unit-lang.c: New file.

commit af39b3270a1385027b2a5d145b9ba7564bd39f7a
Author: Pierre-Marie de Rodat <derodat@adacore.com>
Date:   Wed Aug 19 17:12:48 2015 +0200

    [Ada] Fix parsing for expressions with attributes and characters
    
    Before this change, trying to evaluate the following Ada expression
    yielded a syntax error, even though it's completely legal:
    
        (gdb) p s'first = 'a'
        Error in expression, near `'.
    
    The problem lies in the lexer (gdb/ada-lex.l): at the point we reach "'a'",
    we're still in the BEFORE_QUAL_QUOTE start condition (the mechanism to
    distinguish character literals from other "tick" usages: qualified
    expressions and attributes), so we consider that this quote is actually a
    separate "tick".
    
    This changes resets the start condition to INITIAL in the
    {TICK}[a-zA-Z][a-zA-Z]+ rule (for attributes): attributes activate this
    BEFORE_QUAL_QUOTE condition and in this case the above rule is always
    executed rather than the <BEFORE_QUAL_QUOTE>"'" one (in flex, it's
    always the longest match that is chosen). We now have instead:
    
        (gdb) p s'first = 'a'
        $1 = true
    
    gdb/ChangeLog:
    
    	* ada-lex.l: Reset the start condition to INITIAL in the rule
    	that matches attributes.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.ada/attr_ref_and_charlit.exp: New testcase.
    	* gdb.ada/attr_ref_and_charlit/foo.adb: New file.
    
    Tested on x86_64-linux, no regression.

commit 9215b98bb27c071386a277f5578dbb17569a1471
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 20 12:02:45 2015 +0930

    gold --emit-relocs
    
    A symbol value in an ELF final linked binary is absolute, in contrast
    to a relocatable object file where the value is section relative.  For
    --emit-relocs it is therefore incorrect to use the value of a section
    symbol as the addend when adjusting relocs against input section
    symbols to output section symbols.
    
    	PR gold/18846
    	* target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
    	Subtract os->address() from addend.
    	* powerpc.cc (relocate_relocs): Likewise.

commit 9d1f51209437ebee8f0a930b9613d59759ea8dc0
Author: GDB Administrator <gdbadmin@sourceware.org>
Date:   Thu Aug 20 00:00:10 2015 +0000

    Automatic date update in version.in

commit 7d45c7c3f692d93c3a33a043c347f1386681deb4
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Mon Aug 3 14:17:17 2015 -0700

    dwarf2read.c: Check type of string valued attributes prior to decoding.
    
    This change introduces a new function, dwarf2_string_attr(), which is
    a wrapper for dwarf2_attr().  dwarf2read.c has been updated to
    call dwarf2_string_attr in most instances where a string-valued
    attribute is decoded to produce a string value.  In most cases, it
    simplifies the code; in some instances, the complexity of the code
    remains unchanged.
    
    I performed this change by looking for instances where the
    result of DW_STRING was used in an assignment.  Many of these
    had a pattern which (roughly) looks something like this:
    
      struct attribute *attr = NULL;
    
      attr = dwarf2_attr (die, name, cu);
      if (attr != NULL && DW_STRING (attr))
        {
          const char *str;
          ...
          str = DW_STRING (attr);
          ... /* Use str in some fashion.  */
        }
    
    Code of this form is transformed to look like this instead:
    
      const char *str;
    
      str = dwarf2_string_attr (die, name, cu)
      if (str != NULL)
        {
           ...
           /* Use str in some fashion.  */
           ...
        }
    
    In addition to invoking dwarf2_attr() and DW_STRING(),
    dwarf2_string_attr() checks to make sure that the attribute's
    `form' field matches one of DW_FORM_strp, DW_FORM_string, or
    DW_FORM_GNU_strp_alt.  If it does not match one of these forms,
    it will return a NULL value in addition to calling complaint().
    
    An earlier version of this patch did this type checking for one
    particular instance where a string attribute was being decoded.
    The situation that I was attempting to handle in that earlier patch is
    this:
    
    The Texas Instruments compiler uses the encoding for
    DW_AT_MIPS_linkage_name for other purposes.  TI uses the encoding,
    0x2007, for TI_AT_TI_end_line which, unlike DW_AT_MIPS_linkage_name,
    does not have a string-typed value.  In this instance, GDB was attempting
    to use an integer value as a string pointer, with predictable results.
    (GDB would die with a segmentation fault.)
    
    I've added a test which reproduces the problem that I was orignally
    wanting to fix.  It uses DW_AT_MIPS_linkage name with an associate
    value which is a string, and again, where the value is a small
    integer.
    
    My test case causes GDB to segfault in an unpatched GDB.  There
    will be two PASSes in a patched GDB.
    
    Unpatched GDB:
    
    (gdb) ptype f
    ERROR: Process no longer exists
    UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
    ERROR: Couldn't send ptype g to GDB.
    UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
    
    Patched GDB:
    
    (gdb) ptype f
    type = bool ()
    (gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
    ptype g
    type = bool ()
    (gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
    
    I see no regressions on an x86_64 native target.
    
    gdb/ChangeLog:
    
    	* dwarf2read.c (dwarf2_string_attr): New function.
    	(lookup_dwo_unit, process_psymtab_comp_unit_reader)
    	(dwarf2_compute_name, dwarf2_physname, find_file_and_directory)
    	(read_call_site_scope, namespace_name, guess_full_die_structure_name)
    	(anonymous_struct_prefix, prepare_one_comp_unit): Use
    	dwarf2_string_attr in place of dwarf2_attr and DW_STRING.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.dwarf2/dw2-bad-mips-linkage-name.c: New file.
    	* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: New file.

commit 07c9aa07cdcf00eff8e186f3ca1779e5e3ffdb75
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 11:26:56 2015 +0100

    [AArch64][6/6] LD support TLSLD load/store relocation types
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
      types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
      (elfNN_aarch64_final_link_relocate): Likewise.
      * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
      (_bfd_aarch64_elf_resolve_relocation): Likewise.
    
    ld/testsuite/
      * ld-aarch64/emit-relocs-531.s: New testcase.
      * ld-aarch64/emit-relocs-531-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-532.s: Likewise.
      * ld-aarch64/emit-relocs-533.s: Likewise.
      * ld-aarch64/emit-relocs-533-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-534.s: Likewise.
      * ld-aarch64/emit-relocs-535.s: Likewise.
      * ld-aarch64/emit-relocs-535-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-536.s: Likewise.
      * ld-aarch64/emit-relocs-537.s: Likewise.
      * ld-aarch64/emit-relocs-537-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-538.s: Likewise.
      * ld-aarch64/emit-relocs-531.d: New expectation file.
      * ld-aarch64/emit-relocs-531-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-532.d: Likewise.
      * ld-aarch64/emit-relocs-533.d: Likewise.
      * ld-aarch64/emit-relocs-533-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-534.d: Likewise.
      * ld-aarch64/emit-relocs-535.d: Likewise.
      * ld-aarch64/emit-relocs-535-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-536.d: Likewise.
      * ld-aarch64/emit-relocs-537.d: Likewise.
      * ld-aarch64/emit-relocs-537-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-538.d: Likewise.
      * ld-aarch64/aarch64-elf.exp: Run new testcases.

commit 4c5625238cccb048261d7ce0eb748ee5e0d67cf0
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 11:22:22 2015 +0100

    [AArch64][5/6] GAS support TLSLD load/store relocation types
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      * reloc.c: New entries, including
      BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
      * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
      * bfd-in2.h: Regenerate.
      * libbfd.h: Regenerate.
    
    gas/
      * config/tc-aarch64.c (reloc_table): New relocation types support for
      dtprel_lo12.
      (ldst_lo12_determine_real_reloc_type): Support
      BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
      BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
      (parse_operands): Likewise.
      (md_apply_fix): Likewise
      (aarch64_force_relocation): Likewise.
      (process_movw_reloc_info): Likewise.
    
    gas/testsuite/
      * gas/aarch64/reloc-dtprel_lo12-ldst8.s: New testcase.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldstc.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst16.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst16.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst32.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst32.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst64.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst64.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst8.d: New expectation file.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst8.d: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst16.d: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst16.d: Likewise.
      * gas/aarch64/reloc-dtprel_lo12-ldst32.d: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst32.d: Likewise.
      * gas/aarch64/reloc-dtprel-lo12-ldst64.d: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc-ldst64.d: Likewise.

commit 6ffe9a1ba36f3a896ae323e35a207b6451e8f7f9
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 11:18:25 2015 +0100

    [AArch64][4/6] LD support TLSLD move/add relocation types
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      PR ld/18276
      * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
      types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
      (elfNN_aarch64_final_link_relocate): Likewise.
      * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
      (_bfd_aarch64_elf_resolve_relocation): Likewise.
    
    ld/testsuite/
      * ld-aarch64/emit-relocs-87.s: New testcase.
      * ld-aarch64/emit-relocs-88.s: Likewise.
      * ld-aarch64/emit-relocs-88-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-89.s: Likewise.
      * ld-aarch64/emit-relocs-90.s: Likewise.
      * ld-aarch64/emit-relocs-90-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-523.s: Likewise.
      * ld-aarch64/emit-relocs-524.s: Likewise.
      * ld-aarch64/emit-relocs-525.s: Likewise.
      * ld-aarch64/emit-relocs-527.s: Likewise.
      * ld-aarch64/emit-relocs-526.s: Likewise.
      * ld-aarch64/emit-relocs-528.s: Likewise.
      * ld-aarch64/emit-relocs-528-overflow.s: Likewise.
      * ld-aarch64/emit-relocs-87.d: New expectation file.
      * ld-aarch64/emit-relocs-88.d: Likewise.
      * ld-aarch64/emit-relocs-88-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-89.d: Likewise.
      * ld-aarch64/emit-relocs-90.d: Likewise.
      * ld-aarch64/emit-relocs-90-overflow.d: Likewise.
      * ld-aarch64/emit-relocs-91.d: Likewise.
      * ld-aarch64/emit-relocs-523.d: Likewise.
      * ld-aarch64/emit-relocs-524.d: Likewise.
      * ld-aarch64/emit-relocs-525.d: Likewise.
      * ld-aarch64/emit-relocs-526.d: Likewise.
      * ld-aarch64/emit-relocs-527.d: Likewise.
      * ld-aarch64/emit-relocs-528.d: Likewise.
      * ld-aarch64/emit-relocs-528-overflow.d: Likewise.
      * ld-aarch64/aarch64-elf.exp: Run new testcases.

commit 49df5539f9070c01128135a7d63f44b2efc4de6a
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 11:02:34 2015 +0100

    [AArch64][3/6] GAS support TLSLD move/add relocation types
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
      BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
      * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
      * bfd-in2.h: Regenerate.
      * libbfd.h: Regenerate.
    
    gas/
      * config/tc-aarch64.c (reloc_table): New relocation modifiers,
      "dtprel_hi12", "dtprel_g0", "dtprel_g0_nc", "dtprel_g1",
      "dtprel_g1_nc", "dtprel_g2".
      (md_apply_fix): Support new relocation types.
      (aarch64_force_relocation): Likewise.
      (process_movw_reloc_info): Likewise.
    
    gas/testsuite/
      * gas/aarch64/reloc-dtprel_g0.s: New testcase.
      * gas/aarch64/reloc-dtprel_g0-ilp32.s: Likewise.
      * gas/aarch64/reloc-dtprel_g0_nc.s: Likewise.
      * gas/aarch64/reloc-dtprel_g0_nc-ilp32.s: Likewise.
      * gas/aarch64/reloc-dtprel_g1.s: Likewise.
      * gas/aarch64/reloc-dtprel_g1-ilp32.s: Likewise.
      * gas/aarch64/reloc-dtprel_g1_nc.s: Likewise.
      * gas/aarch64/reloc-dtprel_g2.s: Likewise.
      * gas/aarch64/reloc-dtprel_hi12.s: Likewise.
      * gas/aarch64/reloc-dtprel_hi12-ilp32.s: Likewise.
      * gas/aarch64/reloc-dtprel_g0.d: New expectation file.
      * gas/aarch64/reloc-dtprel_g0-ilp32.d: Likewise.
      * gas/aarch64/reloc-dtprel_g0_nc.d: Likewise.
      * gas/aarch64/reloc-dtprel_g0_nc-ilp32.d: Likewise.
      * gas/aarch64/reloc-dtprel_g1.d: Likewise.
      * gas/aarch64/reloc-dtprel_g1-ilp32.d: Likewise.
      * gas/aarch64/reloc-dtprel_g1_nc.d: Likewise.
      * gas/aarch64/reloc-dtprel_g2.d: Likewise.
      * gas/aarch64/reloc-dtprel_hi12.d: Likewise.
      * gas/aarch64/reloc-dtprel_hi12-ilp32.d: Likewise.

commit 753999c1ec8fa76bd5ed5509d1e5909d010e80ee
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 10:58:13 2015 +0100

    [AArch64][2/6] LD support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
      BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
      (aarch64_reloc_got_type): Likewise.
      (elfNN_aarch64_final_link_relocate): Likewise.
      (elfNN_aarch64_relocate_section): Likewise.
      * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
      (_bfd_aarch64_elf_resolve_relocation): Likewise.
    
    ld/testsuite/
      * ld-aarch64/emit-relocs-530.s: New testcase.
      * ld-aarch64/emit-relocs-92.s: Likewise.
      * ld-aarch64/emit-relocs-530.d: New expectation file.
      * ld-aarch64/emit-relocs-92.d: Likewise.
      * ld-aarch64/aarch64-elf.exp: Run new testcases.

commit 13289c10e20281adf480d9822861412a7ade721d
Author: Jiong Wang <jiong.wang@arm.com>
Date:   Wed Aug 19 10:57:34 2015 +0100

    [AArch64][1/6] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
    
    2015-08-19  Jiong Wang  <jiong.wang@arm.com>
    
    bfd/
      * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
      * bfd-in2.h: Regenerate.
      * libbfd.h: Regenerate.
      * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
      BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
    
    gas/
      * config/tc-aarch64.c (reloc_table): New relocation modifiers.
      (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
      (aarch64_force_relocation): Likewise.
    
    gas/testsuite/
      * gas/aarch64/reloc-dtprel_lo12_nc.s: New testcase.
      * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s: Likewise.
      * gas/aarch64/reloc-dtprel_lo12_nc.d: New expectation file.
      * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d: Likewise.

commit 45face3ba147a4c5f4f7e09cf10c95986b915002
Author: Gary Benson <gbenson@redhat.com>
Date:   Wed Aug 19 13:53:24 2015 +0100

    Prelimit number of bytes to read in "vFile:pread:"
    
    While handling "vFile:pread:" packets, gdbserver would read the
    number of bytes requested regardless of whether this would fit
    into the reply packet.  gdbserver would then return a packet's
    worth of data and discard the remainder.  When accessing large
    binaries GDB (via BFD) routinely makes large "vFile:pread:"
    requests, resulting in gdbserver allocating large unnecessary
    buffers and reading some portions of the file many times over.
    
    This commit causes gdbserver to limit the number of bytes to be
    read to a sensible maximum prior to allocating buffers and reading
    data.
    
    gdb/gdbserver/ChangeLog:
    
    	* hostio.c (handle_pread): Do not attempt to read more data
    	than hostio_reply_with_data can fit in a packet.

commit 64d94ba01a4f56ac10bb277e66bb00d82bd97f10
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Aug 19 12:32:54 2015 +0930

    Remove link_info.pic
    
    Adding type_pie to output_type allows us to remove link_info.pic and
    with some reordering of the enum, produces better code.
    
    include/
    	* bfdlink.h (enum output_type): Delete type_executable, add type_pde
    	and type_pie.  Reorder.
    	(struct bfd_link_info): Delete pic field.
    	(bfd_link_executable, bfd_link_pde, bfd_link_pie, bfd_link_pic): Adjust.
    ld/
    	* emultempl/aix.em: Don't set link_info.pic.
    	* emultempl/pe.em: Likewise.
    	* emultempl/pep.em: Likewise.
    	* emultempl/sunos.em: Likewise.
    	* lexsup.c (parse_args): Likewise.  Set type_pie for -pie.
    	* plugin.c (set_tv_header <LDPT_LINKER_OUTPUT>): Simplify.

commit 3cbc1e5e68341e53a03fe7e9d38fc02e0d78c418
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Aug 19 11:57:40 2015 +0930

    Add bfd_link_pde, and simplify some tests of link_info.type
    
    include/
    	* bfdlink.h (bfd_link_pde): Define.
    bfd/
    	* elf-s390-common.c: Simplify expressions using
    	bfd_linke_executable, bfd_link_pie and bfd_link_pic.
    	* elf32-arm.c: Likewise.
    	* elf32-bfin.c: Likewise.
    	* elf32-frv.c: Likewise.
    	* elf32-m68k.c: Likewise.
    	* elf32-nios2.c: Likewise.
    	* elf32-ppc.c: Likewise.
    	* elf32-s390.c: Likewise.
    	* elf32-sh.c: Likewise.
    	* elf64-alpha.c: Likewise.
    	* elf64-ppc.c: Likewise.
    	* elf64-s390.c: Likewise.
    	* elflink.c: Likewise.

commit b45e00b3ed40589af75b8a36a67905ae265a20f8
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Mon Jul 27 15:09:08 2015 -0700

    Fix symbol versioning problems in PR 18703.
    
    If a symbol is defined with ".symver foo,foo@VER", the assembler
    creates two symbols in the object: one unversioned, and one with
    the (non-default) version "VER". If foo is listed in a version
    script, gold would then make the first of those symbols the
    default version, and would ignore the second symbol as a
    duplicate, without making it a non-default version. While this is
    arguably reasonable behavior, it doesn't match Gnu ld behavior,
    so this patch fixes that by allowing the second definition to
    override the first by resetting the "default version" indication.
    
    Several test cases from the Gnu ld testsuite also exposed another
    related problem, where a symbol defined with ".symver foo,foo@",
    placed into a shared library, is not handled properly by gold.
    This patch also fixes that case, binding the symbol to the base
    version.
    
    gold/
    	PR gold/18703
    	* dynobj.cc (Versions::record_version): Handle symbol defined with
    	base version.
    	(Versions::symbol_section_contents): Likewise.
    	* symtab.h (Symbol::set_is_not_default): New class method.
    	(Symbol_table::resolve): Add is_default_version parameter.
    	(Symbol_table::should_override): Likewise.
    	* resolve.cc (Symbol_table::resolve): Add is_default_version parameter,
    	and pass to should_override. Adjust all callers and explicit
    	instantiations.
    	(Symbol_table::should_override): Add is_default_value parameter;
    	allow default version in a dynamic object to override existing
    	definition from same object.
    	* symtab.cc (Symbol_table::add_from_object): Handle case where same
    	symbol is defined as unversioned and non-default version in the same
    	object.
    	* testsuite/Makefile.am (ver_test_13): New test case.
    	* testsuite/Makefile.in: Regenerate.
    	* testsuite/ver_test_4.cc: Add test for symbol with base version.
    	* testsuite/ver_test_4.sh: Likewise.
    	* testsuite/ver_test_13.c: New source file.
    	* testsuite/ver_test_13.script: New version script.
    	* testsuite/ver_test_13.sh: New test case.

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

    Automatic date update in version.in

commit 16d5f64295ccf2a8e9fe3ed350c94c38cee5a481
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Tue Aug 11 15:28:19 2015 -0400

    gdbserver/linux-aarch32-low: build failure when NT_ARM_VFP not defined
    
    On some older versions of GNU/Linux, gdbserver now fails to build
    due to an undefined reference to NT_ARM_VFP. Same issue on Android,
    where this macros is undefined until Android API level 21 (Android
    5.0 "Lollipop").
    
    This patch modifies linux-aarch32-low.c to define that macros when
    not already defined.
    
    gdb/gdbserver/ChangeLog:
    
            * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.

commit 4d6cceb4e40a057dbe4d9ad94b0641d5f4725c09
Author: Doug Evans <dje@google.com>
Date:   Tue Aug 18 14:02:03 2015 -0700

    PR mi/18833 gdb.execute ("set param value", to_string=True) will crash gdb if using MI
    
    gdb/ChangeLog:
    
    	* cli/cli-logging.c (pop_output_files): Don't restore redirection
    	if MI-like.
    	* mi/mi-out.c: #include "vec.h".
    	(ui_filep): New type.
    	(DEV_VEC_P (ui_filep)): New type.
    	(struct ui_out_data) <buffer, original_buffer>: Delete.
    	(struct ui_out_data) <streams>: New member.
    	(mi_ui_out_impl): Add data_destroy field.
    	(mi_field_string, mi_field_fmt): Update.
    	(mi_flush, mi_redirect, field_separator): Update.
    	(mi_open, mi_close): Update.
    	(mi_out_buffered, mi_out_rewind, mi_out_put): Update.
    	(mi_out_data_ctor, mi_out_data_dtor): New functions.
    	(mi_out_new): Call mi_out_data_ctor.
    
    testsuite/gdb/ChangeLog:
    
    	* lib/gdb.exp (skip_python_tests_prompt): Renamed from
    	skip_python_tests.  New arg prompt_regexp.
    	(skip_python_tests): New function.
    	* lib/mi-support.exp (mi_skip_python_tests): New function.
    	* gdb.python/py-mi-objfile-gdb.py: New file.
    	* gdb.python/py-mi-objfile.c: New file.
    	* gdb.python/py-mi-objfile.exp: New file.

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

Summary of changes:
 bfd/ChangeLog                                      |   90 +++++++
 bfd/bfd-in2.h                                      |   57 +++++
 bfd/elf-s390-common.c                              |    5 +-
 bfd/elf32-arm.c                                    |    2 +-
 bfd/elf32-bfin.c                                   |   22 +-
 bfd/elf32-frv.c                                    |   24 +-
 bfd/elf32-m68k.c                                   |    2 +-
 bfd/elf32-nios2.c                                  |    2 +-
 bfd/elf32-ppc.c                                    |    3 +-
 bfd/elf32-s390.c                                   |    2 +-
 bfd/elf32-sh.c                                     |    4 +-
 bfd/elf64-alpha.c                                  |   14 +-
 bfd/elf64-ppc.c                                    |    2 +-
 bfd/elf64-s390.c                                   |    2 +-
 bfd/elflink.c                                      |    2 +-
 bfd/elfnn-aarch64.c                                |  255 ++++++++++++++++++++
 bfd/elfxx-aarch64.c                                |   30 +++
 bfd/libbfd.h                                       |   17 ++
 bfd/reloc.c                                        |   75 ++++++-
 bfd/version.h                                      |    2 +-
 gas/ChangeLog                                      |   33 +++
 gas/config/tc-aarch64.c                            |  146 +++++++++++-
 gas/testsuite/ChangeLog                            |   49 ++++
 gas/testsuite/gas/aarch64/reloc-dtprel_g0-ilp32.d  |   10 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g0-ilp32.s  |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g0.d        |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g0.s        |    5 +
 .../gas/aarch64/reloc-dtprel_g0_nc-ilp32.d         |   10 +
 .../gas/aarch64/reloc-dtprel_g0_nc-ilp32.s         |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc.d     |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc.s     |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1-ilp32.d  |   10 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1-ilp32.s  |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1.d        |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1.s        |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1_nc.d     |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g1_nc.s     |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g2.d        |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_g2.s        |    5 +
 .../gas/aarch64/reloc-dtprel_hi12-ilp32.d          |   10 +
 .../gas/aarch64/reloc-dtprel_hi12-ilp32.s          |    5 +
 gas/testsuite/gas/aarch64/reloc-dtprel_hi12.d      |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_hi12.s      |    5 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst16.d         |   10 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst16.s         |    6 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst32.d         |   10 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst32.s         |    6 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst64.d         |   10 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst64.s         |    6 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst8.d          |   10 +
 .../gas/aarch64/reloc-dtprel_lo12-ldst8.s          |    6 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d       |   10 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s       |    5 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst16.d      |   10 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst16.s      |    5 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst32.d      |   10 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst32.s      |    6 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst64.d      |   10 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst64.s      |    6 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst8.d       |   10 +
 .../gas/aarch64/reloc-dtprel_lo12_nc-ldst8.s       |    6 +
 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc.d   |    9 +
 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc.s   |    5 +
 gdb/ChangeLog                                      |   48 ++++
 gdb/ada-lex.l                                      |    2 +-
 gdb/build-id.c                                     |    3 +-
 gdb/build-id.h                                     |    7 +-
 gdb/cli/cli-cmds.c                                 |    3 +-
 gdb/cli/cli-logging.c                              |    4 +-
 gdb/defs.h                                         |    6 +-
 gdb/dwarf2read.c                                   |  139 ++++++-----
 gdb/exec.c                                         |    9 +-
 gdb/gdbserver/ChangeLog                            |    9 +
 gdb/gdbserver/hostio.c                             |   12 +
 gdb/gdbserver/linux-aarch32-low.c                  |    6 +
 gdb/infrun.c                                       |    7 +-
 gdb/infrun.h                                       |    5 +
 gdb/mi/mi-out.c                                    |  107 ++++++---
 gdb/nto-tdep.c                                     |    9 +-
 gdb/nto-tdep.h                                     |    3 +-
 gdb/remote.c                                       |  117 +++++++--
 gdb/solib-svr4.c                                   |    6 +
 gdb/solib.c                                        |   45 +++--
 gdb/solist.h                                       |    7 +-
 gdb/source.c                                       |   34 ++-
 gdb/symfile.c                                      |    4 +-
 gdb/testsuite/ChangeLog                            |   36 +++
 gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp     |   42 ++++
 gdb/testsuite/gdb.ada/attr_ref_and_charlit/foo.adb |   24 ++
 gdb/testsuite/gdb.dwarf2/comp-unit-lang.c          |   34 +++
 gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp        |   80 ++++++
 .../gdb.dwarf2/dw2-bad-mips-linkage-name.c         |   41 +++
 .../gdb.dwarf2/dw2-bad-mips-linkage-name.exp       |   72 ++++++
 gdb/testsuite/gdb.python/py-mi-objfile-gdb.py      |   27 ++
 gdb/testsuite/gdb.python/py-mi-objfile.c           |   22 ++
 gdb/testsuite/gdb.python/py-mi-objfile.exp         |   57 +++++
 gdb/testsuite/gdb.server/connect-stopped-target.c  |   22 ++
 .../gdb.server/connect-stopped-target.exp          |   82 +++++++
 gdb/testsuite/gdb.server/solib-list.exp            |    9 -
 gdb/testsuite/lib/gdb.exp                          |   25 ++-
 gdb/testsuite/lib/mi-support.exp                   |    9 +
 gold/ChangeLog                                     |    7 +
 gold/dynobj.cc                                     |   12 +-
 gold/powerpc.cc                                    |    6 +-
 gold/resolve.cc                                    |   33 ++-
 gold/symtab.cc                                     |   31 +++-
 gold/symtab.h                                      |   10 +-
 gold/target-reloc.h                                |    6 +-
 gold/testsuite/Makefile.am                         |    9 +
 gold/testsuite/Makefile.in                         |   12 +-
 gold/testsuite/ver_test_13.c                       |    7 +
 gold/testsuite/ver_test_13.script                  |    4 +
 gold/testsuite/{ver_test_4.sh => ver_test_13.sh}   |   31 ++-
 gold/testsuite/ver_test_4.cc                       |   10 +
 gold/testsuite/ver_test_4.sh                       |    5 +-
 include/ChangeLog                                  |   11 +
 include/bfdlink.h                                  |   16 +-
 include/elf/aarch64.h                              |    5 +
 ld/ChangeLog                                       |    9 +
 ld/emultempl/aix.em                                |    1 -
 ld/emultempl/pe.em                                 |    5 +-
 ld/emultempl/pep.em                                |    5 +-
 ld/emultempl/sunos.em                              |    1 -
 ld/lexsup.c                                        |    4 +-
 ld/plugin.c                                        |    9 +-
 ld/testsuite/ChangeLog                             |   67 +++++
 ld/testsuite/ld-aarch64/aarch64-elf.exp            |   28 +++
 ld/testsuite/ld-aarch64/emit-relocs-523.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-523.s          |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-524.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-524.s          |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-525.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-525.s          |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-526-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-526-overflow.s |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-526.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-526.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-527.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-527.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-528-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-528-overflow.s |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-528.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-528.s          |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-530.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-530.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-531-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-531-overflow.s |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-531.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-531.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-532.d          |    9 +
 ld/testsuite/ld-aarch64/emit-relocs-532.s          |   17 ++
 ld/testsuite/ld-aarch64/emit-relocs-533-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-533-overflow.s |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-533.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-533.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-534.d          |    9 +
 ld/testsuite/ld-aarch64/emit-relocs-534.s          |   17 ++
 ld/testsuite/ld-aarch64/emit-relocs-535-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-535-overflow.s |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-535.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-535.s          |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-536.d          |    9 +
 ld/testsuite/ld-aarch64/emit-relocs-536.s          |   17 ++
 ld/testsuite/ld-aarch64/emit-relocs-537-overflow.d |    4 +
 ld/testsuite/ld-aarch64/emit-relocs-537-overflow.s |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-537.d          |    7 +
 ld/testsuite/ld-aarch64/emit-relocs-537.s          |   12 +
 ld/testsuite/ld-aarch64/emit-relocs-538.d          |    9 +
 ld/testsuite/ld-aarch64/emit-relocs-538.s          |   19 ++
 ld/testsuite/ld-aarch64/emit-relocs-87.d           |    8 +
 ld/testsuite/ld-aarch64/emit-relocs-87.s           |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-88-overflow.d  |    5 +
 ld/testsuite/ld-aarch64/emit-relocs-88-overflow.s  |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-88.d           |    8 +
 ld/testsuite/ld-aarch64/emit-relocs-88.s           |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-89.d           |    8 +
 ld/testsuite/ld-aarch64/emit-relocs-89.s           |   10 +
 ld/testsuite/ld-aarch64/emit-relocs-90-overflow.d  |    5 +
 ld/testsuite/ld-aarch64/emit-relocs-90-overflow.s  |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-90.d           |    8 +
 ld/testsuite/ld-aarch64/emit-relocs-90.s           |   11 +
 ld/testsuite/ld-aarch64/emit-relocs-92.d           |    8 +
 ld/testsuite/ld-aarch64/emit-relocs-92.s           |   10 +
 183 files changed, 2859 insertions(+), 309 deletions(-)
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0-ilp32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0-ilp32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc-ilp32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc-ilp32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g0_nc.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1-ilp32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1-ilp32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1_nc.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g1_nc.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g2.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_g2.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_hi12-ilp32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_hi12-ilp32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_hi12.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_hi12.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst16.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst16.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst64.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst64.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst8.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12-ldst8.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst16.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst16.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst32.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst32.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst64.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst64.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst8.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc-ldst8.s
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc.d
 create mode 100644 gas/testsuite/gas/aarch64/reloc-dtprel_lo12_nc.s
 create mode 100644 gdb/testsuite/gdb.ada/attr_ref_and_charlit.exp
 create mode 100644 gdb/testsuite/gdb.ada/attr_ref_and_charlit/foo.adb
 create mode 100644 gdb/testsuite/gdb.dwarf2/comp-unit-lang.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
 create mode 100644 gdb/testsuite/gdb.python/py-mi-objfile-gdb.py
 create mode 100644 gdb/testsuite/gdb.python/py-mi-objfile.c
 create mode 100644 gdb/testsuite/gdb.python/py-mi-objfile.exp
 create mode 100644 gdb/testsuite/gdb.server/connect-stopped-target.c
 create mode 100644 gdb/testsuite/gdb.server/connect-stopped-target.exp
 create mode 100644 gold/testsuite/ver_test_13.c
 create mode 100644 gold/testsuite/ver_test_13.script
 copy gold/testsuite/{ver_test_4.sh => ver_test_13.sh} (60%)
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-523.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-523.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-524.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-524.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-525.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-525.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-526-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-526-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-526.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-526.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-527.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-527.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-528-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-528-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-528.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-528.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-530.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-530.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-531-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-531-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-531.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-531.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-532.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-532.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-533-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-533-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-533.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-533.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-534.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-534.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-535-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-535-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-535.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-535.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-536.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-536.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-537-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-537-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-537.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-537.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-538.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-538.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-87.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-87.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-88-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-88-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-88.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-88.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-89.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-89.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-90-overflow.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-90-overflow.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-90.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-90.s
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-92.d
 create mode 100644 ld/testsuite/ld-aarch64/emit-relocs-92.s

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c0fbbe9..dcd0e88 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,93 @@
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
+	types, including BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
+	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
+	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
+	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
+	(elfNN_aarch64_final_link_relocate): Likewise.
+	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+	(_bfd_aarch64_elf_resolve_relocation): Likewise.
+
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	* reloc.c (BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
+	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
+	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
+	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
+	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC): New entries.
+	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	PR ld/18276
+	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation
+	types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2.
+	(elfNN_aarch64_final_link_relocate): Likewise.
+	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+	(_bfd_aarch64_elf_resolve_relocation): Likewise.
+
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
+	BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
+	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	* elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
+	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
+	(aarch64_reloc_got_type): Likewise.
+	(elfNN_aarch64_final_link_relocate): Likewise.
+	(elfNN_aarch64_relocate_section): Likewise.
+	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+	(_bfd_aarch64_elf_resolve_relocation): Likewise.
+
+2015-08-19  Jiong Wang  <jiong.wang@arm.com>
+
+	* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+	* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
+	BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
+
+2015-08-19  Alan Modra  <amodra@gmail.com>
+
+	* elf-s390-common.c: Simplify expressions using
+	bfd_linke_executable, bfd_link_pie and bfd_link_pic.
+	* elf32-arm.c: Likewise.
+	* elf32-bfin.c: Likewise.
+	* elf32-frv.c: Likewise.
+	* elf32-m68k.c: Likewise.
+	* elf32-nios2.c: Likewise.
+	* elf32-ppc.c: Likewise.
+	* elf32-s390.c: Likewise.
+	* elf32-sh.c: Likewise.
+	* elf64-alpha.c: Likewise.
+	* elf64-ppc.c: Likewise.
+	* elf64-s390.c: Likewise.
+	* elflink.c: Likewise.
+
 2015-08-18  Jiong Wang  <jiong.wang@arm.com>
 
 	* elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 3299055..6ba3641 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5794,9 +5794,15 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21.  */
 /* AArch64 TLS INITIAL EXEC relocation.  */
   BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19,
 
+/* bit[23:12] of byte offset to module TLS base address.  */
+  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
+
 /* Unsigned 12 bit byte offset to module TLS base address.  */
   BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
 
+/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.  */
+  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
+
 /* Unsigned 12 bit byte offset to global offset table entry for a symbols
 tls_index structure.  Used in conjunction with
 BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.  */
@@ -5809,6 +5815,49 @@ instruction.  */
 /* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction.  */
   BFD_RELOC_AARCH64_TLSLD_ADR_PREL21,
 
+/* bit[11:1] of byte offset to module TLS base address, encoded in ldst
+instructions.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
+
+/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
+
+/* bit[11:2] of byte offset to module TLS base address, encoded in ldst
+instructions.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
+
+/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
+
+/* bit[11:3] of byte offset to module TLS base address, encoded in ldst
+instructions.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
+
+/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
+
+/* bit[11:0] of byte offset to module TLS base address, encoded in ldst
+instructions.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
+
+/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
+
+/* bit[15:0] of byte offset to module TLS base address.  */
+  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
+
+/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0  */
+  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
+
+/* bit[31:16] of byte offset to module TLS base address.  */
+  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
+
+/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1  */
+  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
+
+/* bit[47:32] of byte offset to module TLS base address.  */
+  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2,
+
 /* AArch64 TLS LOCAL EXEC relocation.  */
   BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2,
 
@@ -5908,6 +5957,14 @@ assembler and not (currently) written to any object files.  */
 address.  Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.  */
   BFD_RELOC_AARCH64_LDST_LO12,
 
+/* AArch64 pseudo relocation code for TLS local dynamic mode.  It's to be
+used internally by the AArch64 assembler and not (currently) written to
+any object files.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12,
+
+/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check.  */
+  BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC,
+
 /* AArch64 pseudo relocation code to be used internally by the AArch64
 assembler and not (currently) written to any object files.  */
   BFD_RELOC_AARCH64_LD_GOT_LO12_NC,
diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c
index 5c36ec8..6b5b17b 100644
--- a/bfd/elf-s390-common.c
+++ b/bfd/elf-s390-common.c
@@ -151,8 +151,7 @@ keep:
      point to the IPLT slot.  That way the referencing shared lib will
      always get the PLT slot address when resolving the respective
      R_390_GLOB_DAT/R_390_64 relocs on that symbol.  */
-  if (bfd_link_executable (info)
-      && !bfd_link_pic (info)
+  if (bfd_link_pde (info)
       && h->def_regular
       && h->ref_dynamic)
     {
@@ -187,7 +186,7 @@ keep:
   if (h->got.refcount <= 0
       || (bfd_link_pic (info)
 	  && (h->dynindx == -1 || h->forced_local))
-      || (bfd_link_executable (info) && bfd_link_pic (info))
+      || bfd_link_pie (info)
       || htab->sgot == NULL)
     {
       /* Use .got.iplt.  */
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index bd4b576..2e7d26d 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -9881,7 +9881,7 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
       }
 
     case R_ARM_TLS_LE32:
-      if (bfd_link_pic (info) && !bfd_link_pie (info))
+      if (bfd_link_dll (info))
 	{
 	  (*_bfd_error_handler)
 	    (_("%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"),
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 49ef360..152134e 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -2215,7 +2215,7 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
       /* If we're linking an executable at a fixed address, we can
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
-      if (bfd_link_executable (info) && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && (entry->symndx != -1
 	      || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
@@ -2270,7 +2270,7 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
 	  if (entry->symndx == -1
 	      && ! BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
 	      && BFINFDPIC_SYM_LOCAL (info, entry->d.h)
-	      && !(bfd_link_executable (info) && !bfd_link_pic (info)))
+	      && !bfd_link_pde (info))
 	    {
 	      reloc = R_BFIN_FUNCDESC;
 	      idx = elf_section_data (entry->d.h->root.u.def.section
@@ -2306,7 +2306,7 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
 	     dynamic symbol entry for the got section, so idx will be
 	     zero, which means we can and should compute the address
 	     of the private descriptor ourselves.  */
-	  if (bfd_link_executable (info) && !bfd_link_pic (info)
+	  if (bfd_link_pde (info)
 	      && (entry->symndx != -1
 		  || BFINFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
 	    {
@@ -2369,7 +2369,7 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
       /* If we're linking an executable at a fixed address, we can
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
-      if (bfd_link_executable (info) && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && (entry->symndx != -1 || BFINFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (sec)
@@ -2417,8 +2417,7 @@ _bfinfdpic_emit_got_relocs_plt_entries (struct bfinfdpic_relocs_info *entry,
 
       /* If we've omitted the dynamic relocation, just emit the fixed
 	 addresses of the symbol and of the local GOT base offset.  */
-      if (bfd_link_executable (info)
-	  && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && sec
 	  && sec->output_section)
 	{
@@ -2834,8 +2833,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 		   section+offset.  */
 		if (h && ! BFINFDPIC_FUNCDESC_LOCAL (info, h)
 		    && BFINFDPIC_SYM_LOCAL (info, h)
-		    && !(bfd_link_executable (info)
-			 && !bfd_link_pic (info)))
+		    && !bfd_link_pde (info))
 		  {
 		    dynindx = elf_section_data (h->root.u.def.section
 						->output_section)->dynindx;
@@ -2872,7 +2870,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 		   dynamic symbol entry for the got section, so idx will
 		   be zero, which means we can and should compute the
 		   address of the private descriptor ourselves.  */
-		if (bfd_link_executable (info) && !bfd_link_pic (info)
+		if (bfd_link_pde (info)
 		    && (!h || BFINFDPIC_FUNCDESC_LOCAL (info, h)))
 		  {
 		    bfd_vma offset;
@@ -2995,7 +2993,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 	       can omit the dynamic relocation as long as the symbol
 	       is defined in the current link unit (which is implied
 	       by its output section not being NULL).  */
-	    if (bfd_link_executable (info) && !bfd_link_pic (info)
+	    if (bfd_link_pde (info)
 		&& (!h || BFINFDPIC_SYM_LOCAL (info, h)))
 	      {
 		if (osec)
@@ -3075,7 +3073,7 @@ bfinfdpic_relocate_section (bfd * output_bfd,
 		/* If we've omitted the dynamic relocation, just emit
 		   the fixed addresses of the symbol and of the local
 		   GOT base offset.  */
-		if (bfd_link_executable (info) && !bfd_link_pic (info)
+		if (bfd_link_pde (info)
 		    && (!h || BFINFDPIC_SYM_LOCAL (info, h)))
 		  bfd_put_32 (output_bfd,
 			      bfinfdpic_got_section (info)->output_section->vma
@@ -3655,7 +3653,7 @@ _bfinfdpic_count_relocs_fixups (struct bfinfdpic_relocs_info *entry,
 {
   bfd_vma relocs = 0, fixups = 0;
 
-  if (!bfd_link_executable (dinfo->info) || bfd_link_pie (dinfo->info))
+  if (!bfd_link_pde (dinfo->info))
     relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv;
   else
     {
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index b55a7ab..fa12528 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -1384,7 +1384,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
       /* If we're linking an executable at a fixed address, we can
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
-      if (bfd_link_executable (info) && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && (entry->symndx != -1
 	      || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
@@ -1439,7 +1439,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
 	  if (entry->symndx == -1
 	      && ! FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
 	      && FRVFDPIC_SYM_LOCAL (info, entry->d.h)
-	      && !(bfd_link_executable (info) && !bfd_link_pic (info)))
+	      && !bfd_link_pde (info))
 	    {
 	      reloc = R_FRV_FUNCDESC;
 	      idx = elf_section_data (entry->d.h->root.u.def.section
@@ -1482,7 +1482,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
 	     dynamic symbol entry for the got section, so idx will be
 	     zero, which means we can and should compute the address
 	     of the private descriptor ourselves.  */
-	  if (bfd_link_executable (info) && !bfd_link_pic (info)
+	  if (bfd_link_pde (info)
 	      && (entry->symndx != -1
 		  || FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
 	    {
@@ -1545,7 +1545,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
       /* If we're linking an executable at a fixed address, we can
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
-      if (bfd_link_executable (info) && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && (entry->symndx != -1 || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (sec)
@@ -1593,8 +1593,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
 
       /* If we've omitted the dynamic relocation, just emit the fixed
 	 addresses of the symbol and of the local GOT base offset.  */
-      if (bfd_link_executable (info)
-	  && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && sec
 	  && sec->output_section)
 	{
@@ -1847,7 +1846,7 @@ _frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
       if (bfd_link_executable (info) && ! entry->tlsoff_entry)
 	entry->tlsoff_entry = entry->tlsdesc_entry + 4;
 
-      if (bfd_link_executable (info) && !bfd_link_pic (info)
+      if (bfd_link_pde (info)
 	  && ((idx == 0
 	       && (bfd_is_abs_section (sec)
 		   || bfd_is_und_section (sec)))
@@ -3523,8 +3522,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 		   section+offset.  */
 		if (h && ! FRVFDPIC_FUNCDESC_LOCAL (info, h)
 		    && FRVFDPIC_SYM_LOCAL (info, h)
-		    && !(bfd_link_executable (info)
-			 && !bfd_link_pic (info)))
+		    && !bfd_link_pde (info))
 		  {
 		    dynindx = elf_section_data (h->root.u.def.section
 						->output_section)->dynindx;
@@ -3562,7 +3560,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 		   dynamic symbol entry for the got section, so idx will
 		   be zero, which means we can and should compute the
 		   address of the private descriptor ourselves.  */
-		if (bfd_link_executable (info) && !bfd_link_pic (info)
+		if (bfd_link_pde (info)
 		    && (!h || FRVFDPIC_FUNCDESC_LOCAL (info, h)))
 		  {
 		    addend += frvfdpic_got_section (info)->output_section->vma;
@@ -3684,7 +3682,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 	       can omit the dynamic relocation as long as the symbol
 	       is defined in the current link unit (which is implied
 	       by its output section not being NULL).  */
-	    if (bfd_link_executable (info) && !bfd_link_pic (info)
+	    if (bfd_link_pde (info)
 		&& (!h || FRVFDPIC_SYM_LOCAL (info, h)))
 	      {
 		if (osec)
@@ -3773,7 +3771,7 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
 		/* If we've omitted the dynamic relocation, just emit
 		   the fixed addresses of the symbol and of the local
 		   GOT base offset.  */
-		if (bfd_link_executable (info) && !bfd_link_pic (info)
+		if (bfd_link_pde (info)
 		    && (!h || FRVFDPIC_SYM_LOCAL (info, h)))
 		  bfd_put_32 (output_bfd,
 			      frvfdpic_got_section (info)->output_section->vma
@@ -4512,7 +4510,7 @@ _frvfdpic_count_relocs_fixups (struct frvfdpic_relocs_info *entry,
 {
   bfd_vma relocs = 0, fixups = 0, tlsrets = 0;
 
-  if (!bfd_link_executable (dinfo->info) || bfd_link_pie (dinfo->info))
+  if (!bfd_link_pde (dinfo->info))
     {
       relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv
 	+ entry->relocstlsd;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 10d2fcb..f807e03 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -3916,7 +3916,7 @@ elf_m68k_relocate_section (bfd *output_bfd,
 	case R_68K_TLS_LE32:
 	case R_68K_TLS_LE16:
 	case R_68K_TLS_LE8:
-	  if (bfd_link_pic (info) && !bfd_link_pie (info))
+	  if (bfd_link_dll (info))
 	    {
 	      (*_bfd_error_handler)
 		(_("%B(%A+0x%lx): R_68K_TLS_LE32 relocation not permitted "
diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index fd70007..6a72f71 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -4352,7 +4352,7 @@ nios2_elf32_relocate_section (bfd *output_bfd,
 
 	      break;
 	    case R_NIOS2_TLS_LE16:
-	      if (bfd_link_pic (info) && !bfd_link_pie (info))
+	      if (bfd_link_dll (info))
 		{
 		  (*_bfd_error_handler)
 		    (_("%B(%A+0x%lx): R_NIOS2_TLS_LE16 relocation not "
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 8415f1e..3f708cb 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -5204,7 +5204,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
   struct ppc_elf_link_hash_table *htab;
   int pass;
 
-  if (bfd_link_relocatable (info) || !bfd_link_executable (info))
+  if (!bfd_link_executable (info))
     return TRUE;
 
   htab = ppc_elf_hash_table (info);
@@ -6947,7 +6947,6 @@ ppc_elf_relax_section (bfd *abfd,
 		 optimise away the call.  We won't be needing a long-
 		 branch stub in that case.  */
 	      if (bfd_link_executable (link_info)
-		  && !bfd_link_relocatable (link_info)
 		  && h == htab->tls_get_addr
 		  && irel != internal_relocs)
 		{
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index de37ca4..96c1531 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -3116,7 +3116,7 @@ elf_s390_relocate_section (bfd *output_bfd,
 	  break;
 
 	case R_390_TLS_LE32:
-	  if (bfd_link_pic (info) && !bfd_link_pie (info))
+	  if (bfd_link_dll (info))
 	    {
 	      /* Linking a shared library with non-fpic code requires
 		 a R_390_TLS_TPOFF relocation.  */
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 012ee4e..7b8d763 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -5440,7 +5440,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 
 	    check_segment[0] = check_segment[1] = -1;
 
-	    if (! bfd_link_pic (info) || bfd_link_pie (info))
+	    if (!bfd_link_dll (info))
 	      {
 		relocation = tpoff (info, relocation);
 		addend = rel->r_addend;
@@ -6542,7 +6542,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
 	  break;
 
 	case R_SH_TLS_LE_32:
-	  if (bfd_link_pic (info) && !bfd_link_pie (info))
+	  if (bfd_link_dll (info))
 	    {


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-25 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21 20:04 [SCM] jankratochvil/gdbserverbuildid: Support build-id for main executables jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2015-08-25 19:07 jkratoch
2015-08-22 19:25 jkratoch
2015-08-21 20:56 jkratoch
2015-08-20 21:17 jkratoch

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).