From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62598 invoked by alias); 13 Aug 2015 14:22:15 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 62575 invoked by uid 9674); 13 Aug 2015 14:22:15 -0000 Date: Thu, 13 Aug 2015 14:22:00 -0000 Message-ID: <20150813142214.62464.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: sticky X-Git-Refname: refs/heads/jankratochvil/gdbserverbuildid X-Git-Reftype: branch X-Git-Oldrev: f975d18d3004c9e94572ae7ffd4f999f87f80789 X-Git-Newrev: 909dd6affb55d8b542927f5b100dbc07e4d44600 X-SW-Source: 2015-q3/txt/msg00029.txt.bz2 List-Id: The branch, jankratochvil/gdbserverbuildid has been updated discards f975d18d3004c9e94572ae7ffd4f999f87f80789 (commit) discards 5d9fe80e2f8fa1f5be7ebac7fbc949ecf9ef5bff (commit) discards 7c5f60122e4d26c473e20e6fdfe359afeaefb47d (commit) discards 56b758842d2db86be20e6a5ca38b523dd26d548f (commit) discards c94619a21113490af5ec998d7f1d24e371fa9640 (commit) discards 49969d8c4672a677f52fe60457969cd897dd53df (commit) discards 77a40858ba8b6554da1090ffdd0d20cf0c70f6a1 (commit) discards a0e710b8adadb856bf39f5c5a9f275f84dd9a3ba (commit) discards 045fcf62670e30bdc5d8af524046d3bb3f9221eb (commit) discards 1ea2fe5053ab1113dfb672c680ccff1be2f290b9 (commit) discards 5fd3c99615b2ab8c9aa8abc21337be115fcd37cd (commit) discards 7ac5e9d57bc417c75c97f51f7c44fa55ee9c169b (commit) discards c4e403dfad6c919454ef5d2663712853b6bcbae8 (commit) discards d0d477a45c5d4ecdc2820d4d0414056d3023ae13 (commit) discards ca83807584ebd8716a66f7088dd05271002e99d9 (commit) discards 4f5d6aa4fce87c00f74b0f205535ebcec7302e27 (commit) discards 12e1597a9084f5d4f122d00a011870ef00c92334 (commit) discards 6e55ed2607f6efdc058a5b6605914e6f92193189 (commit) discards fef843202f56678b4089b285d14133969f56c7e6 (commit) discards 1d63ae5cb294f9d8f0a059c49b1cf0c877b42cb5 (commit) discards 7b46b23c4bb32e7d2171ef4c19c20bf51c06d6f4 (commit) discards 524206e9a325be3684efd7af59676c307d3d150f (commit) discards bef667c7aff50753dd43712be95afab66fa94767 (commit) discards e20832687edce5b65e90fa338d42aa821207e5af (commit) discards 7a867eeefa6d8a282a119afd5cc43697bb938266 (commit) discards 4791222f9fc2a35a62078243a53409f26799f34a (commit) discards 92b2194c5c92566d5d05de65a49fba3f5a86df32 (commit) discards 90082c6c1c4a9386e008f8ca470cc8fe14032ebe (commit) discards a0df657b49186335025cde8aa62a1eadc7274ef5 (commit) discards 8c1b24620df4b7bf532fe4ecbf2bfd4c3adc1ef9 (commit) discards 45aa3a918c168453a915fa10b376f0642009584d (commit) discards 12f6dcb9318784724efe2e38d5c44a8f7af0a360 (commit) discards 105d76cc897ee03ba97c6048089b0b6d1b8ef69b (commit) discards 05a4e248b9e2d1b387235cd2d8cb577757fb6b52 (commit) via 909dd6affb55d8b542927f5b100dbc07e4d44600 (commit) via dd1f9111db27e548ba5ee806cf5bf973d9186462 (commit) via 49a92823038b0c4d2045324cfd1cffef7ba9208f (commit) via 22fc794dee30a61629efb52ab01128794838d9cd (commit) via 3c4181a65e97fb1b06f2b79943b8164831526352 (commit) via 85e797c9c96085b1185ef56960aeb78152104929 (commit) via 6f6952ad4d8a960c4dff7227c17da8e847dd934f (commit) via a9e8f9276e9e885514976e32b2fc35eb948a06a3 (commit) via 891ddd140494720c0d377e93dbdf7d38ae9e87eb (commit) via cde2f3a7d920f20b13bb61829802634d3aceaca9 (commit) via 52ae466c4eae8e2e57d9dc59fce60ca6c6795693 (commit) via 8359c2e7189922a91d9621e297189f3cbf3295aa (commit) via 46b1c839077b938af4ee1c22b10fc5609700324a (commit) via 05cdf191ff60a5c977b14e2d338bf005e89ff104 (commit) via 64cf1545812f341132c7bb4faad5f2938f4c931d (commit) via 439ef35c5653d3a9724502ec1ad6662b1273fdb7 (commit) via 6bc4d3b31dbfa2996a329a350664a9eef4e2fe15 (commit) via bfde840e829396b99837812d568e945632ab49ff (commit) via ae70d8fa734033d1e197a8ce21bc82c393e9bfdd (commit) via 8f6abda46262ef44b8f448be3643ea502288f3ee (commit) via 3eaf8395d993ffd039863c5d61f77c59b27cdd4b (commit) via 629f7538f1c705deefe237b87153597e8bf6b4b1 (commit) via fb1352c863ab57bef975d9826efb4de0a7a49e63 (commit) via e655914ce35a288d78848a6126b911e874d0f23e (commit) via 02f3bfabeb4b3d8aefc23c5e0a7e9229c2da0c1a (commit) via 90721dfec76d65d29ac5fbf49c5718bd850abe41 (commit) via ce4a423657022eb9dca3552b287e8db3a8bae5de (commit) via 208dacff86eca30c3f5990905f66f18e19ffbb57 (commit) via b5d50914f4202b1f15df5e6c1b4868726dc5f43c (commit) via bce282542cdcc386678a05f66a3aae1cac40f39d (commit) via 88e1a37952d639ba05a92032e3a0d94ab466bed4 (commit) via f8688948e2ef7e8ccc1899ab34a824d9904ef469 (commit) via 257ed7ddfe7b6eeccc1782ed3b6c5a8e1a10e951 (commit) via 7a460e688c25393f8bde0d9ee51be0475e40b169 (commit) via 8efa2874ab298f3923f4127340da119435f87c39 (commit) via 4ab90a7a90ccf8a671f139c1c6387ba8028e6011 (commit) via e5a764c49c138d9409a807698d853225a4c8351f (commit) via 5d8c3ed327fff9993d89ab8b35e2cbae67e2a51e (commit) via 22cee43f9af76fc4c10c3d4018a9ada6d7c5c1a5 (commit) via 19c2883a9b92e2be695368e19788fd0210d732d4 (commit) via c14c7a8a619ce03a7c8f41d1cfac3af728df453b (commit) via 9791c250490d7c3c961860419e4436c758a91a21 (commit) via ea8812bceab054cab438bb51916f1d81118811b3 (commit) via c74e78b36ce4904b733e6fa7e295fd4b15ac0596 (commit) via 13a2df29c930eda49837741902b67021ab004990 (commit) via 4dafcdeb1341c4dd1a4641373bc17aab3ef2e788 (commit) via 59ecaff36145add82c315ba7a008c4a5db4a6f51 (commit) via b46824bd49648c575372e6d9bc6a6defeabd6ed5 (commit) via 5ba325978c354b9f0e238864e3afb4f9b528c04e (commit) via 40fc1451c63d21a1448bb21e39a7b70ecb959213 (commit) from f975d18d3004c9e94572ae7ffd4f999f87f80789 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 909dd6affb55d8b542927f5b100dbc07e4d44600 Author: Jan Kratochvil Date: Thu Aug 13 16:17:20 2015 +0200 sticky Message-Id: <1433754079-10395-1-git-send-email-gbenson@redhat.com> Philippe Waroquiers wrote: > On Fri, 2015-06-05 at 12:22 +0100, Gary Benson wrote: > > Built and regtested on RHEL6.6 x86_64. > I tested with the last SVN version of the Valgrind gdbserver (that > supports qXfer:exec-file:read+). > > The patch introduces a regression: > with the patch, GDB does not anymore automatically load the > exec-file. > > I bypassed this problem by ignoring fake_pid_p in remote.c: > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -1624,9 +1624,13 @@ remote_add_inferior (int fake_pid_p, int pid, int > attached, > inf->attach_flag = attached; > inf->fake_pid_p = fake_pid_p; > > - /* If no main executable is currently open then attempt to > - open the file that was executed to create this inferior. */ > - if (try_open_exec && get_exec_file (0) == NULL) > + /* Attempt to open the file that was executed to create this > + inferior. If the user has explicitly specified executable > + and/or symbol files then warn the user if their choices do > + not match. Otherwise, set exec_file and symfile_objfile to > + the new file. */ > + printf("fake_pid_p %d\n", fake_pid_p); > + if (try_open_exec)// && !fake_pid_p) > exec_file_locate_attach (pid, 1); > > Effectively, the printf shows that with Valgrind gdbsrv, > fake_pid_p value is 1. > > When ignoring fake_pid_p, GDB can properly attach > to different Valgrind gdbsrv, and changes of executable > as expected. Ah, it seems I mailed a bad patch, my apologies! I was working on two fixes that touched the same line, and it looks like I rebased them in the wrong order. This updated patch has been created against the latest gdb/master (80fb91378c91a8239817a5ab2b1c3e346109db25). Could you please try your tests again? Thanks, Gary --- On attach, GDB will only attempt to determine the main executable's filename if one is not already set. This causes problems if you attach to one process and then attach to another: GDB will not attempt to discover the main executable on the second attach. If the two processes have different main executable files then the symbols will now be wrong. This is PR gdb/17626. In GDB some filenames are supplied by the user (e.g. using the "file" or "symbol-file" commands) and some are determined by GDB (e.g. while processing an "attach" command). This commit updates GDB to track which filenames were supplied by the user. When GDB might attempt to determine an executable filename and one is already set, filenames determined by GDB may be overridden but user-supplied filenames will not. gdb/ChangeLog: PR gdb/17626 * progspace.h (struct program_space) : New field. : Likewise. (symfile_objfile_is_user_supplied): New macro. * exec.h (exec_file_is_user_supplied): Likewise. * exec.c (exec_close): Clear exec_file_is_user_supplied. (exec_file_locate_attach): Remove get_exec_file check. Do not replace user-supplied executable or symbol files. Warn if user-supplied executable or symbol files do not match discovered file. (exec_file_command): Set exec_file_is_user_supplied. * symfile.c (symbol_file_clear): Clear symfile_objfile_is_user_supplied. (symbol_file_command): Set symfile_objfile_is_user_supplied. * inferior.c (add_inferior_command): Set exec_file_is_user_supplied and symfile_objfile_is_user_supplied. * main.c (captured_main): Likewise. * infcmd.c (attach_command_post_wait): Always call exec_file_locate_attach. Only call reopen_exec_file and reread_symbols if exec_file_is_user_supplied. * remote.c (remote_add_inferior): Remove get_exec_file check around exec_file_locate_attach. commit dd1f9111db27e548ba5ee806cf5bf973d9186462 Author: Jan Kratochvil Date: Thu Aug 13 16:17:19 2015 +0200 mainbuildid commit 49a92823038b0c4d2045324cfd1cffef7ba9208f Author: Jan Kratochvil Date: Thu Aug 13 16:17:19 2015 +0200 hexallocate commit 22fc794dee30a61629efb52ab01128794838d9cd Author: Jan Kratochvil Date: Thu Aug 13 16:17:19 2015 +0200 locatetest commit 3c4181a65e97fb1b06f2b79943b8164831526352 Author: Jan Kratochvil Date: Thu Aug 13 16:17:19 2015 +0200 Tests for validate symbol file using build-id New testcase. gdb/testsuite/ChangeLog 2015-07-15 Aleksandar Ristovski Date: Thu Aug 13 16:17:18 2015 +0200 buildidwarn commit 6f6952ad4d8a960c4dff7227c17da8e847dd934f Author: Jan Kratochvil Date: Thu Aug 13 16:17:18 2015 +0200 buildidsolibbfdopen commit a9e8f9276e9e885514976e32b2fc35eb948a06a3 Author: Jan Kratochvil Date: Thu Aug 13 16:17:18 2015 +0200 buildidverify commit 891ddd140494720c0d377e93dbdf7d38ae9e87eb Author: Jan Kratochvil Date: Thu Aug 13 16:17:18 2015 +0200 buildidsolibsearch commit cde2f3a7d920f20b13bb61829802634d3aceaca9 Author: Jan Kratochvil Date: Thu Aug 13 16:17:18 2015 +0200 buildidtofile commit 52ae466c4eae8e2e57d9dc59fce60ca6c6795693 Author: Jan Kratochvil Date: Thu Aug 13 16:17:17 2015 +0200 buildidproto commit 8359c2e7189922a91d9621e297189f3cbf3295aa Author: Jan Kratochvil Date: Thu Aug 13 16:17:17 2015 +0200 buildidtobfd commit 46b1c839077b938af4ee1c22b10fc5609700324a Author: Jan Kratochvil Date: Thu Aug 13 16:17:17 2015 +0200 buildidforcemove commit 05cdf191ff60a5c977b14e2d338bf005e89ff104 Author: Jan Kratochvil Date: Thu Aug 13 16:17:17 2015 +0200 buildidfreefix commit 64cf1545812f341132c7bb4faad5f2938f4c931d Author: Jan Kratochvil Date: Thu Aug 13 16:17:16 2015 +0200 openpsymfile commit 439ef35c5653d3a9724502ec1ad6662b1273fdb7 Author: Jan Kratochvil Date: Thu Aug 13 16:17:16 2015 +0200 openpsolib commit 6bc4d3b31dbfa2996a329a350664a9eef4e2fe15 Author: Jan Kratochvil Date: Thu Aug 13 16:17:16 2015 +0200 openp commit bfde840e829396b99837812d568e945632ab49ff Author: Jan Kratochvil Date: Thu Aug 13 16:17:16 2015 +0200 filelib commit ae70d8fa734033d1e197a8ce21bc82c393e9bfdd Author: Jan Kratochvil Date: Thu Aug 13 16:17:15 2015 +0200 openfromtargetdoclose commit 8f6abda46262ef44b8f448be3643ea502288f3ee Author: Jan Kratochvil Date: Thu Aug 13 16:17:15 2015 +0200 openfromtargetfd commit 3eaf8395d993ffd039863c5d61f77c59b27cdd4b Author: Jan Kratochvil Date: Thu Aug 13 16:17:15 2015 +0200 openfromtarget commit 629f7538f1c705deefe237b87153597e8bf6b4b1 Author: Jan Kratochvil Date: Thu Aug 13 16:17:14 2015 +0200 openpnullpathname commit fb1352c863ab57bef975d9826efb4de0a7a49e63 Author: Jan Kratochvil Date: Thu Aug 13 16:17:14 2015 +0200 openpmode commit e655914ce35a288d78848a6126b911e874d0f23e Author: Jan Kratochvil Date: Thu Aug 13 16:17:14 2015 +0200 openppath commit 02f3bfabeb4b3d8aefc23c5e0a7e9229c2da0c1a Author: Jan Kratochvil Date: Thu Aug 13 16:17:13 2015 +0200 openpenum commit 90721dfec76d65d29ac5fbf49c5718bd850abe41 Author: Jan Kratochvil Date: Thu Aug 13 16:17:13 2015 +0200 sysrootdefault commit ce4a423657022eb9dca3552b287e8db3a8bae5de Author: Jan Kratochvil Date: Thu Aug 13 16:17:13 2015 +0200 sysrootdelim commit 208dacff86eca30c3f5990905f66f18e19ffbb57 Author: Jan Kratochvil Date: Thu Aug 13 16:17:12 2015 +0200 sysrootconst commit b5d50914f4202b1f15df5e6c1b4868726dc5f43c Author: Jan Kratochvil Date: Thu Aug 13 16:17:12 2015 +0200 Validate symbol file using build-id Consumer part of the "build-id" attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski 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. * solib-darwin.c (_initialize_darwin_solib): Assign validate value. * solib-dsbt.c (_initialize_dsbt_solib): Ditto. * solib-frv.c (_initialize_frv_solib): Ditto. * solib-spu.c (set_spu_solib_ops): Ditto. * solib-svr4.c: Include rsp-low.h. (NOTE_GNU_BUILD_ID_NAME): New define. (svr4_validate): New function. (svr4_copy_library_list): Duplicate field build_id. (library_list_start_library): Parse 'build-id' attribute. (svr4_library_attributes): Add 'build-id' attribute. (_initialize_svr4_solib): Assign validate value. * solib-target.c (solib.h): Include. (_initialize_solib_target): Assign validate value. * solib.c (validate_build_id, show_validate_build_id): New. (solib_map_sections): Use ops->validate. (clear_so): Free build_id. (default_solib_validate): New function. (_initialize_solib): Add "validate-build-id". * solib.h (default_solib_validate): New declaration. * solist.h (struct so_list): New fields 'build_idsz' and 'build_id'. (target_so_ops): New field 'validate'. gdb/doc/ChangeLog 2015-07-15 Jan Kratochvil * gdb.texinfo (Files): Add 'set validate-build-id' and 'show validate-build-id'. commit bce282542cdcc386678a05f66a3aae1cac40f39d Author: Jan Kratochvil Date: Thu Aug 13 16:17:12 2015 +0200 gdbserver build-id attribute generator Producer part of the new "build-id" XML attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski 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 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 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 88e1a37952d639ba05a92032e3a0d94ab466bed4 Author: Jan Kratochvil Date: Thu Aug 13 16:17:11 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 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 * 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 f8688948e2ef7e8ccc1899ab34a824d9904ef469 Author: Jan Kratochvil Date: Thu Aug 13 16:17:11 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 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 257ed7ddfe7b6eeccc1782ed3b6c5a8e1a10e951 Author: Jan Kratochvil Date: Thu Aug 13 16:17:11 2015 +0200 Move gdb_regex* to common/ Later patches need regex support also in gdbserver. gdb/ChangeLog 2015-07-15 Jan Kratochvil * 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 * Makefile.in (OBS): Add gdb_regex.o. (gdb_regex.o): New. * config.in: Rebuilt. * configure: Rebuilt. commit 7a460e688c25393f8bde0d9ee51be0475e40b169 Author: Jan Kratochvil Date: Thu Aug 13 16:17:10 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 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 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 8efa2874ab298f3923f4127340da119435f87c39 Author: H.J. Lu Date: Thu Aug 13 04:31:38 2015 -0700 Issue an error for read-only segment with dynamic IFUNC relocations To load an ELF binary with DT_TEXTREL tag, the dynamic linker calls __mprotect on the read-only segment with PROT_READ|PROT_WRITE before applying dynamic relocation. It leads to segfault when performing IFUNC relocations since the read-only segment has no execute permission. This patch changes x86 linker to issue an error for read-only segment with dynamic IFUNC relocations. Other backends with IFUNC support may need a similar change. bfd/ PR ld/18801 * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error for read-only segment with dynamic IFUNC relocations. * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise. ld/testsuite/ PR ld/18801 * ld-i386/i386.exp: Run pr18801. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr18801.d: New file. * ld-i386/pr18801.s: Likewise. * ld-x86-64/pr18801.d: Likewise. * ld-x86-64/pr18801.s: Likewise. commit 4ab90a7a90ccf8a671f139c1c6387ba8028e6011 Author: Andre Vieira Date: Thu Aug 13 11:39:08 2015 +0100 Fixes for unpredictable nops and 26-bit versions of teq,tst,cmn,cmp. opcodes * arm-dis.c (print_insn_arm): Disassembling for all targets V6 and higher with ARM instruction set will now mark the 26-bit versions of teq,tst,cmn and cmp as UNPREDICTABLE. (arm_opcodes): Fix for unpredictable nop being recognized as a teq. test * gas/arm/nops.d: New. * gas/arm/nops.s: New. * gas/arm/inst.d: Changed expectation file for 26-bit teq, tst, cmn and cmp. commit e5a764c49c138d9409a807698d853225a4c8351f Author: H.J. Lu Date: Thu Aug 13 02:48:55 2015 -0700 Add ChangeLog for check_ifunc_attribute_available commit 5d8c3ed327fff9993d89ab8b35e2cbae67e2a51e Author: Pierre-Marie de Rodat Date: Thu Aug 13 09:54:09 2015 +0200 Add ChangeLog entries for the previous commit commit 22cee43f9af76fc4c10c3d4018a9ada6d7c5c1a5 Author: Pierre-Marie de Rodat Date: Wed Jul 22 15:30:57 2015 +0200 [Ada] Add support for subprogram renamings Consider the following declaration: function Foo (I : Integer) return Integer renames Pack.Bar; As Foo is not materialized as a routine whose name is derived from Foo, GDB currently cannot use it: (gdb) print foo(0) No definition of "foo" in current context. However, compilers can emit DW_TAG_imported_declaration in order to materialize the fact that Foo is actually another name for Pack.Bar. This commit enhances the DWARF reader to record global renamings (it used to put global ones in a static block) and enhances the Ada engine to leverage this information during symbol lookup. gdb/ChangeLog: * ada-lang.c: Include namespace.h (aux_add_nonlocal_symbols): Fix a function name in comment. (ada_add_block_renamings): New. (add_nonlocal_symbols): Add global renamings handling. (ada_lookup_symbol_list_worker): Move the symbol lookup part to... (ada_add_all_symbols): ... this new function. (ada_add_block_symbols): Try to match the input name against the "using directives list", perform a recursive symbol lookup on the matched declarations. * block.h (struct block): Move the_namespace to top-level as namespace_info. Remove the language_specific field. (BLOCK_NAMESPACE): Update access to the namespace_info field. * buildsym.h (using_directives): Rename into... (local_using_directives): ... this. (global_using_directives): New. (struct context_stack): Rename the using_directives field into local_using_directives. * buildsym.c (finish_block_internal): Deal with the proper using directives repository (local or global). (prepare_for_building): Reset local_using_directives. Assert that there is no pending global using directive. (reset_symtab_globals): Reset global_using_directives and local_using_directives. (end_symtab_get_static_block): Don't ignore symtabs that have only using directives. (push_context): Update references to local_using_directives. (buildsym_init): Do not reset using_directives. * cp-support.c: Include namespace.h. * cp-support.h (struct using_direct): Move to namespace.h. (cp_add_using_directives): Move to namespace.h. * cp-namespace.c: Include namespace.h (cp_add_using_directive): Move to namespace.c, rename it to add_using_directive, add a "using_directives" argument and use it as the pending using directives repository. All callers updated. * dwarf2read.c (using_directives): New. (read_import_statement): Call using_directives. (read_func_scope): Update references to local_using_directives. (read_lexical_block_scope): Likewise. (read_namespace): Update the heading comment, call using_directives. * namespace.h: New file. * namespace.c: New file. * Makefile.in (SFILES): Add namespace.c. (COMMON_OBS): Add namespace.o gdb/testsuite/ChangeLog: * gdb.ada/fun_renaming.exp: New testcase. * gdb.ada/fun_renaming/fun_renaming.adb: New file. * gdb.ada/fun_renaming/pack.adb: New file. * gdb.ada/fun_renaming/pack.ads: New file. Tested on x86_64-linux. Support for this in GCC is in the pipeline: see . commit 19c2883a9b92e2be695368e19788fd0210d732d4 Author: Alan Modra Date: Thu Aug 13 15:57:15 2015 +0930 gas 0f handling _start: .byte 0f-_start 0: Fixes ..:2: Error: floating point number invalid ..:2: Error: junk at end of line, first unrecognized character is `_' * expr.c (operand): Rewrite handling of operands starting with "0f". If atof_generic only parses "-" or "+", treat as expression. commit c14c7a8a619ce03a7c8f41d1cfac3af728df453b Author: Alan Modra Date: Thu Aug 13 15:55:31 2015 +0930 gas 0b vs 0b0 vs 00b * expr.c (integer_constant): Return O_absent expression if eol. (operand): For targets with both LOCAL_LABELS_FB and NUMBERS_WITH_SUFFIX set, treat "0b" not followed by binary digits as a local label reference. Correct handling of 0b prefix. If a suffix is not allowed, error on 0B. commit 9791c250490d7c3c961860419e4436c758a91a21 Author: Alan Modra Date: Thu Aug 13 15:51:51 2015 +0930 Correct local label doc * doc/as.texinfo (Local Labels): Allowed range of N in local labels is non-negative integers, not positive integers. commit ea8812bceab054cab438bb51916f1d81118811b3 Author: Keith Seitz Date: Wed Aug 12 18:31:11 2015 -0700 gdb.base/dso2dso.exp sometimes broken Keith reported that gdb.base/dso2dso.exp is broken, with the following error: | $ make check RUNTESTFLAGS=dso2dso.exp | [snip] | Running ../../../src/gdb/testsuite/gdb.base/dso2dso.exp ... | ERROR: tcl error sourcing ../../../src/gdb/testsuite/gdb.base/dso2dso.exp. | ERROR: couldn't open | "../../../src/gdb/testsuite/gdb.base/../../../src/gdb/testsuite/gdb.base/dso2dso-dso1.c": | no such file or directory | while executing | "error "$message"" | (procedure "gdb_get_line_number" line 14) | invoked from within | "gdb_get_line_number "STOP HERE" $srcfile_libdso1" | (file "../../../src/gdb/testsuite/gdb.base/dso2dso.exp" line 60) | invoked from within | "source ../../../src/gdb/testsuite/gdb.base/dso2dso.exp" | ("uplevel" body line 1) | invoked from within | "uplevel #0 source ../../../src/gdb/testsuite/gdb.base/dso2dso.exp" | invoked from within | "catch "uplevel #0 source $test_file_name"" This happens because gdb_get_line_number will prepend $srcdir/$subdir if the given filename does not start with "/", and this happens when GDB was configured using a relative path to the configure script. When using an absolute path like I do, we avoid the pre-pending that Keith is seeing. gdb/testsuite/ChangeLog: Keith Seitz : * gdb.base/dso2dso.exp: Pass basename of source file in call to gdb_get_line_number. Tested on x86_64-linux with both scenarios. commit c74e78b36ce4904b733e6fa7e295fd4b15ac0596 Author: GDB Administrator Date: Thu Aug 13 00:00:08 2015 +0000 Automatic date update in version.in commit 13a2df29c930eda49837741902b67021ab004990 Author: H.J. Lu Date: Wed Aug 12 13:31:29 2015 -0700 Set EI_OSABI to ELFOSABI_GNU for local IFUNC symbols Since the backend elf_add_symbol_hook isn't called on local symbols, the EI_OSABI field isn't to ELFOSABI_GNU where are local IFUNC symbols. This patch changes the x86 backends to set has_gnu_symbols if there are relocations against IFUNC symbols. Other backends with IFUNC support may need a similar change. This patch also changes the type of has_gnu_symbols from bfd_boolean to enum elf_gnu_symbols. bfd/ PR ld/18815 * elf-bfd.h (elf_gnu_symbols): New enum. (elf_obj_tdata): Use elf_gnu_symbols on has_gnu_symbols. * elf-s390-common.c (elf_s390_add_symbol_hook): Set has_gnu_symbols to elf_gnu_symbol_any. * elf32-arm.c (elf32_arm_add_symbol_hook): Likewise. * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * lfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise. * elf32-i386.c (elf_i386_check_relocs): Update has_gnu_symbols if there are relocations against IFUNC symbols. (elf_i386_add_symbol_hook): Don't check STT_GNU_IFUNC here. * elf64-x86-64. (elf_x86_64_check_relocs): Update has_gnu_symbols if there are relocations against IFUNC symbols. (elf_x86_64_add_symbol_hook): Don't check STT_GNU_IFUNC here. ld/testsuite/ PR ld/18815 * ld-i386/i386.exp: Run pr18815. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr18815.d: New file. * ld-i386/pr18815.s: Likewise. * ld-x86-64/pr18815.d: Likewise. * ld-x86-64/pr18815.s: Likewise. commit 4dafcdeb1341c4dd1a4641373bc17aab3ef2e788 Author: Joel Brobecker Date: Wed Aug 12 09:33:19 2015 -0700 [amd64] Invalid return address after displaced stepping Making all-stop run on top of non-stop caused a small regression in behavior. This was observed on x86_64-linux. The attached testcase is in C whereas the investigation was done with an Ada program, but it's the same scenario, and using a C testcase allows wider testing. Basically: I am debugging a single-threaded program, and currently stopped inside a function provided by a shared-library, at a line calling a subprogram provided by a second shared library, and trying to "next" over that function call. Before we changed the default all-stop behavior, we had: 7 Impl_Initialize; -- Stop here and try "next" over this line (gdb) n 8 return 5; <<-- OK But now, "next" just stops much earlier: (gdb) n 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so What happens is that next stops at a call instruction, which calls the function's PLT, and GDB fails to notice that the inferior stepped into a subroutine, and so decides that we're done. We can see another symptom of the same issue by looking at the backtrace at the point GDB stopped: (gdb) bt #0 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so #1 0x00000000f7bd86f9 in ?? () #2 0x00007fffffffdf50 in ?? () #3 0x0000000000401893 in a () at /[...]/a.adb:7 Backtrace stopped: frame did not save the PC With a functioning GDB, the backtrace looks like the following instead: #0 0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so #1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7 #2 0x0000000000401893 in a () at /[...]/a.adb:7 Note how, for frame #1, the address looks quite similar, except for the high-order bits not being set: #1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7 <<<-- OK #1 0x00000000f7bd86f9 in ?? () <<<-- WRONG ^^^^ |||| Wrong Investigating this further led me to displaced stepping. As we are "next"-ing from a location where a breakpoint is inserted, we need to step out of it, and since we're on non-stop mode, we need to do it using displaced stepping. And looking at amd64-tdep.c:amd64_displaced_step_fixup, I found the code that handles the return address: regcache_cooked_read_unsigned (regs, AMD64_RSP_REGNUM, &rsp); retaddr = read_memory_unsigned_integer (rsp, retaddr_len, byte_order); retaddr = (retaddr - insn_offset) & 0xffffffffUL; The mask used to compute retaddr looks wrong to me, keeping only 4 bytes instead of 8, and explains why the high order bits of the backtrace are unset. What happens is that, after the displaced stepping has completed, GDB restores that return address at the location where the program expects it. But because the top half bits of the address have been masked out, the return address is now invalid. The incorrect behavior of the "next" command and the backtrace at that location are the first symptoms of that. Another symptom is that this actually alters the behavior of the program, where a "cont" from there soon leads to a SEGV when the inferior tries to jump back to that incorrect return address: (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x00000000f7bd86f9 in ?? () ^^^^^^^^^^^^^^^^^^ This patch fixes the issue by using a mask that seems more appropriate for this architecture. gdb/ChangeLog: * amd64-tdep.c (amd64_displaced_step_fixup): Fix the mask used to compute RETADDR. gdb/testsuite/ChangeLog: * gdb.base/dso2dso-dso2.c, gdb.base/dso2dso-dso2.h, gdb.base/dso2dso-dso1.c, gdb.base/dso2dso-dso1.h, gdb.base/dso2dso.c, gdb.base/dso2dso.exp: New files. Tested on x86_64-linux, no regression. commit 59ecaff36145add82c315ba7a008c4a5db4a6f51 Author: Keith Seitz Date: Wed Aug 12 11:31:24 2015 -0700 Initialize `location' in gdbpy_decode_line BuildBot flagged an uninitialized variable coming from one of the patches in my recently committed locations/explicit patchset. The following patch fixes this. gdb/ChangeLog * python/python.c (gdbpy_decode_line): Initialize `location' to NULL and only call decode_line_1 when it is non-NULL. diff --git a/gdb/python/python.c b/gdb/python/python.c index c28f98b..14da62c 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -730,7 +730,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) PyObject *result = NULL; PyObject *return_result = NULL; PyObject *unparsed = NULL; - struct event_location *location; + struct event_location *location = NULL; if (! PyArg_ParseTuple (args, "|s", &arg)) return NULL; @@ -747,7 +747,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) TRY { - if (arg) + if (location != NULL) sals = decode_line_1 (location, 0, 0, 0); else { commit b46824bd49648c575372e6d9bc6a6defeabd6ed5 Author: Max Filippov Date: Wed Jul 29 17:42:54 2015 +0300 xtensa: add --auto-litpools option Auto-litpools is the automated version of text-section-literals: literal pool candidate frags are planted every N frags and during relaxation they are turned into actual literal pools where literals are moved to become reachable for their first reference by L32R instruction. 2015-08-12 David Weatherford gas/ * config/tc-xtensa.c (struct litpool_frag, struct litpool_seg): New structures. (xtensa_maybe_create_literal_pool_frag): New function. (litpool_seg_list, auto_litpools, auto_litpool_limit) (litpool_buf, litpool_slotbuf): New static variables. (option_auto_litpools, option_no_auto_litpools) (option_auto_litpool_limit): New enum identifiers. (md_longopts): Add entries for auto-litpools, no-auto-litpools and auto-litpool-limit. (md_parse_option): Handle option_auto_litpools, option_no_auto_litpools and option_auto_litpool_limit. (md_show_usage): Add help for --[no-]auto-litpools and --auto-litpool-limit. (xtensa_mark_literal_pool_location): Record a place for literal pool with a call to xtensa_maybe_create_literal_pool_frag. (get_literal_pool_location): Find highest priority literal pool or convert candidate to literal pool when auto-litpools are used. (xg_assemble_vliw_tokens): Create literal pool after jump instruction. (xtensa_check_frag_count): Create candidate literal pool every auto_litpool_limit frags. (xtensa_relax_frag): Add jump around literals to non-empty literal pool. (xtensa_move_literals): Estimate literal pool addresses and move unreachable literals closer to their users, converting candidate to literal pool if needed. (xtensa_switch_to_non_abs_literal_fragment): Only emit error about missing .literal_position in case auto-litpools are not used. * config/tc-xtensa.h (xtensa_relax_statesE): New relaxation state: RELAX_LITERAL_POOL_CANDIDATE_BEGIN. * doc/as.texinfo (Xtensa options): Document --auto-litpools and --no-auto-litpools options. * doc/c-xtensa.texi (Xtensa options): Likewise. 2015-08-12 Max Filippov gas/testsuite/ * gas/xtensa/all.exp: Add auto-litpools to the list of xtensa tests. * gas/xtensa/auto-litpools.s: New file: auto-litpools test. * gas/xtensa/auto-litpools.s: New file: auto-litpools test result pattern. commit 5ba325978c354b9f0e238864e3afb4f9b528c04e Author: Sergio Durigan Junior Date: Wed Aug 12 12:32:16 2015 -0400 Guarantee save-and-restore of GDBFLAGS on gdb.base/checkpoint-ns.exp Keith found out that several tests were failing when testing the native-gdbserver board on Fedora (x86_64). Strangely, these failures had not been reported by our BuildBot. Later, he found that the reason for this was because the failures only happened when running the testsuite without FORCE_PARALLEL (i.e., on serial mode; maybe it would be worth having a builder testing things on serial...). Then, he decided to start bisecting the changes to see which one introduced the failure (it was not trivial to know this only by looking at gdb.log). After a lot of time, he found that Pedro's commit e1316e60d4d1fe406efc6e7536b2bdb43733e9d2 was the culprit. There was nothing wrong in the code, but the new gdb.base/checkpoint-ns.exp testcase did something that left the GDBFLAGS variable in an inconsistent state. This test works by modifying this variable to set non-stop on, sourcing gdb.base/checkpoint.exp (which does the hard work), and then restoring the old value on GDBFLAGS. However, this was not working because gdb.base/checkpoint.exp bails out if it is being tested on gdbserver, and when it calls "continue" the control goes back to the function calling the tests, and not to gdb.base/checkpoint-ns.exp. The fix is simple: just wrap the "source" call, and make gdb.base/checkpoint-ns.exp aware of the "continue"/"return" calls made by gdb.base/checkpoint.exp. gdb/testsuite/ChangeLog: 2015-08-12 Sergio Durigan Junior Pedro Alves Keith Seitz * gdb.base/checkpoint-ns.exp: Use save_vars to save and restore GDBFLAGS. commit 40fc1451c63d21a1448bb21e39a7b70ecb959213 Author: Simon Dardis Date: Wed Aug 12 17:06:35 2015 +0100 [MIPS] Map 'move' to 'or'. The MIPS assembly idiom 'move' now maps to the 'or' machine instruction. This change affects microMIPS, MIPS32, MIPS64. 2015-08-12 Simon Dardis opcodes/ * micromips-opc.c (micromips_opcodes): Re-order table so that move based on 'or' is first. * mips-opc.c (mips_builtin_opcodes): Ditto. bfd/ * elfxx-mips.c (STUB_MOVE): Change to use 'or' only. (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry, mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry): Update to use 'or' instead of 'addu/daddu'. (_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE. (move_insns_32): Reorder table. gas/ * config/tc-mips.c (move_register): Change to use 'or' only. (s_cpload, s_cpsetup, s_cprestore, s_cpreturn): Update to use or for move. gas/testsuite/ * gas/mips/elf-rel23.d: Update test. * gas/mips/elf-rel23.d: Ditto. * gas/mips/elf-rel23a.d: Ditto. * gas/mips/elf-rel23b.d: Ditto. * gas/mips/elf_e_flags1.d: Ditto. * gas/mips/elf_e_flags2.d: Ditto. * gas/mips/elf_e_flags3.d: Ditto. * gas/mips/elf_e_flags4.d: Ditto. * gas/mips/loc-swap-dis.d: Ditto. * gas/mips/micromips-insn32.d: Ditto. * gas/mips/micromips-noinsn32.d: Ditto. * gas/mips/micromips-trap.d: Ditto. * gas/mips/micromips.d: Ditto. * gas/mips/mips-abi32-pic.d: Ditto. * gas/mips/mips-abi32.d: Ditto. * gas/mips/mips-gp32-fp32-pic.d: Ditto. * gas/mips/mips-gp32-fp32.d: Ditto. * gas/mips/mips-gp32-fp64-pic.d: Ditto. * gas/mips/mips-gp32-fp64.d: Ditto. * gas/mips/mips-gp64-fp32-pic.d: Ditto. * gas/mips/mips-gp64-fp32.d: Ditto. * gas/mips/mips-gp64-fp64-pic.d: Ditto. * gas/mips/mips-gp64-fp64.d: Ditto. * gas/mips/mipsr6@loc-swap-dis.d: Ditto. * gas/mips/tls-o32.d: Ditto. * gas/mips/uld2-eb.d: Ditto. * gas/mips/uld2-el.d: Ditto. * gas/mips/ulw2-eb-ilocks.d: Ditto. * gas/mips/ulw2-eb.d: Ditto. * gas/mips/ulw2-el-ilocks.d: Ditto. * gas/mips/ulw2-el.d: Ditto. * gas/mips/move.d: New test. * gas/mips/move.s: Ditto. * gas/mips/micromips32-move.d: Ditto. * gas/mips/micromips32-move.s: Ditto. * gas/mips/mips.exp: Run the new tests. gold/ * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64, lazy_stub_normal_1, lazy_stub_normal_1_n64, lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big, lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64, lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big, lazy_stub_micromips32_big_n64): Update to use 'or' for move instead of 'addu/daddu'. ld/testsuite/ * ld-mips-elf/compressed-plt-1-n32-mips16.od: Update test. * ld-mips-elf/compressed-plt-1-n32-umips.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-mips16-got.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-mips16-only.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-mips16-word.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-mips16.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-se.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-umips-got.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-umips-word.od: Ditto. * ld-mips-elf/compressed-plt-1-o32-umips.od: Ditto. * ld-mips-elf/jalx-2.dd: Ditto. * ld-mips-elf/mips16-pic-3.dd: Ditto. * ld-mips-elf/pic-and-nonpic-3a.dd: Ditto. * ld-mips-elf/pic-and-nonpic-3b.dd: Ditto. * ld-mips-elf/pic-and-nonpic-5b.dd: Ditto. * ld-mips-elf/pic-and-nonpic-6-n32.dd: Ditto. * ld-mips-elf/pic-and-nonpic-6-o32.dd: Ditto. * ld-mips-elf/stub-dynsym-1-10000.d: Ditto. * ld-mips-elf/stub-dynsym-1-2fe80.d: Ditto. * ld-mips-elf/stub-dynsym-1-7fff.d: Ditto. * ld-mips-elf/stub-dynsym-1-8000.d: Ditto. * ld-mips-elf/stub-dynsym-1-fff0.d: Ditto. * ld-mips-elf/tlsbin-o32.d: Ditto. * ld-mips-elf/tlsdyn-o32-1.d: Ditto. * ld-mips-elf/tlsdyn-o32-2.d: Ditto. * ld-mips-elf/tlsdyn-o32-3.d: Ditto. * ld-mips-elf/tlsdyn-o32.d: Ditto. * ld-mips-elf/tlslib-o32.d: Ditto. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 16 + bfd/elf-bfd.h | 17 +- bfd/elf-s390-common.c | 2 +- bfd/elf32-arm.c | 2 +- bfd/elf32-i386.c | 19 +- bfd/elf32-m68k.c | 2 +- bfd/elf32-ppc.c | 2 +- bfd/elf32-sparc.c | 2 +- bfd/elf64-ppc.c | 2 +- bfd/elf64-sparc.c | 2 +- bfd/elf64-x86-64.c | 19 +- bfd/elfxx-aarch64.c | 2 +- bfd/elfxx-mips.c | 25 +- bfd/version.h | 2 +- gas/ChangeLog | 62 +++ gas/config/tc-mips.c | 14 +- gas/config/tc-xtensa.c | 432 +++++++++++++++++++- gas/config/tc-xtensa.h | 1 + gas/doc/as.texinfo | 13 +- gas/doc/c-xtensa.texi | 23 +- gas/expr.c | 107 +++--- gas/testsuite/ChangeLog | 54 +++ gas/testsuite/gas/arm/inst.d | 32 +- gas/testsuite/gas/arm/nops.d | 12 + gas/testsuite/gas/arm/nops.s | 4 + gas/testsuite/gas/mips/elf-rel23.d | 2 +- gas/testsuite/gas/mips/elf-rel23a.d | 2 +- gas/testsuite/gas/mips/elf-rel23b.d | 2 +- gas/testsuite/gas/mips/elf_e_flags1.d | 2 +- gas/testsuite/gas/mips/elf_e_flags2.d | 2 +- gas/testsuite/gas/mips/elf_e_flags3.d | 2 +- gas/testsuite/gas/mips/elf_e_flags4.d | 2 +- gas/testsuite/gas/mips/loc-swap-dis.d | 16 +- gas/testsuite/gas/mips/micromips-insn32.d | 172 ++++---- gas/testsuite/gas/mips/micromips-noinsn32.d | 4 +- gas/testsuite/gas/mips/micromips-trap.d | 4 +- gas/testsuite/gas/mips/micromips.d | 4 +- gas/testsuite/gas/mips/micromips32-move.d | 14 + gas/testsuite/gas/mips/micromips32-move.s | 6 + gas/testsuite/gas/mips/mips-abi32-pic.d | 4 +- gas/testsuite/gas/mips/mips-abi32.d | 4 +- gas/testsuite/gas/mips/mips-gp32-fp32-pic.d | 4 +- gas/testsuite/gas/mips/mips-gp32-fp32.d | 4 +- gas/testsuite/gas/mips/mips-gp32-fp64-pic.d | 4 +- gas/testsuite/gas/mips/mips-gp32-fp64.d | 4 +- gas/testsuite/gas/mips/mips-gp64-fp32-pic.d | 2 +- gas/testsuite/gas/mips/mips-gp64-fp32.d | 2 +- gas/testsuite/gas/mips/mips-gp64-fp64-pic.d | 2 +- gas/testsuite/gas/mips/mips-gp64-fp64.d | 2 +- gas/testsuite/gas/mips/mips.exp | 4 + gas/testsuite/gas/mips/mipsr6@loc-swap-dis.d | 16 +- gas/testsuite/gas/mips/move.d | 14 + gas/testsuite/gas/mips/move.s | 4 + gas/testsuite/gas/mips/tls-o32.d | 6 +- gas/testsuite/gas/mips/uld2-eb.d | 8 +- gas/testsuite/gas/mips/uld2-el.d | 8 +- gas/testsuite/gas/mips/ulw2-eb-ilocks.d | 8 +- gas/testsuite/gas/mips/ulw2-eb.d | 8 +- gas/testsuite/gas/mips/ulw2-el-ilocks.d | 8 +- gas/testsuite/gas/mips/ulw2-el.d | 9 +- gas/testsuite/gas/xtensa/all.exp | 1 + gas/testsuite/gas/xtensa/auto-litpools.d | 12 + gas/testsuite/gas/xtensa/auto-litpools.s | 13 + gdb/ChangeLog | 59 +++ gdb/Makefile.in | 3 +- gdb/ada-lang.c | 199 +++++++--- gdb/amd64-tdep.c | 2 +- gdb/block.h | 21 +- gdb/build-id.c | 6 +- gdb/build-id.h | 2 +- gdb/buildsym.c | 24 +- gdb/buildsym.h | 8 +- gdb/cp-namespace.c | 102 +----- gdb/cp-support.c | 1 + gdb/cp-support.h | 92 +---- gdb/dwarf2read.c | 49 ++- gdb/namespace.c | 117 ++++++ gdb/namespace.h | 118 ++++++ gdb/python/python.c | 4 +- gdb/solib.c | 2 +- gdb/symfile.c | 8 +- gdb/testsuite/ChangeLog | 25 ++ gdb/testsuite/gdb.ada/fun_renaming.exp | 83 ++++ .../gdb.ada/fun_renaming/fun_renaming.adb | 23 + gdb/testsuite/gdb.ada/fun_renaming/pack.adb | 26 ++ gdb/testsuite/gdb.ada/fun_renaming/pack.ads | 22 + gdb/testsuite/gdb.base/checkpoint-ns.exp | 9 +- gdb/testsuite/gdb.base/dso2dso-dso1.c | 26 ++ gdb/testsuite/gdb.base/dso2dso-dso1.h | 23 + gdb/testsuite/gdb.base/dso2dso-dso2.c | 24 ++ gdb/testsuite/gdb.base/dso2dso-dso2.h | 23 + gdb/testsuite/gdb.base/dso2dso.c | 25 ++ gdb/testsuite/gdb.base/dso2dso.exp | 68 +++ gold/ChangeLog | 10 + gold/mips.cc | 32 +- ld/testsuite/ChangeLog | 42 ++ ld/testsuite/ld-i386/i386.exp | 2 + ld/testsuite/ld-i386/pr18801.d | 3 + ld/testsuite/ld-i386/pr18801.s | 15 + ld/testsuite/ld-i386/pr18815.d | 9 + ld/testsuite/ld-i386/pr18815.s | 15 + .../ld-mips-elf/compressed-plt-1-n32-mips16.od | 8 +- .../ld-mips-elf/compressed-plt-1-n32-umips.od | 2 +- .../ld-mips-elf/compressed-plt-1-o32-mips16-got.od | 2 +- .../compressed-plt-1-o32-mips16-only.od | 4 +- .../compressed-plt-1-o32-mips16-word.od | 2 +- .../ld-mips-elf/compressed-plt-1-o32-mips16.od | 8 +- .../ld-mips-elf/compressed-plt-1-o32-se.od | 4 +- .../ld-mips-elf/compressed-plt-1-o32-umips-got.od | 2 +- .../ld-mips-elf/compressed-plt-1-o32-umips-word.od | 2 +- .../ld-mips-elf/compressed-plt-1-o32-umips.od | 2 +- ld/testsuite/ld-mips-elf/jalx-2.dd | 4 +- ld/testsuite/ld-mips-elf/mips16-pic-3.dd | 16 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.dd | 2 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.dd | 4 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.dd | 2 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.dd | 4 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.dd | 4 +- ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.dd | 4 +- ld/testsuite/ld-mips-elf/stub-dynsym-1-10000.d | 2 +- ld/testsuite/ld-mips-elf/stub-dynsym-1-2fe80.d | 2 +- ld/testsuite/ld-mips-elf/stub-dynsym-1-7fff.d | 2 +- ld/testsuite/ld-mips-elf/stub-dynsym-1-8000.d | 2 +- ld/testsuite/ld-mips-elf/stub-dynsym-1-fff0.d | 2 +- ld/testsuite/ld-mips-elf/tlsbin-o32.d | 6 +- ld/testsuite/ld-mips-elf/tlsdyn-o32-1.d | 12 +- ld/testsuite/ld-mips-elf/tlsdyn-o32-2.d | 12 +- ld/testsuite/ld-mips-elf/tlsdyn-o32-3.d | 12 +- ld/testsuite/ld-mips-elf/tlsdyn-o32.d | 6 +- ld/testsuite/ld-mips-elf/tlslib-o32.d | 8 +- ld/testsuite/ld-x86-64/pr18801.d | 3 + ld/testsuite/ld-x86-64/pr18801.s | 15 + ld/testsuite/ld-x86-64/pr18815.d | 9 + ld/testsuite/ld-x86-64/pr18815.s | 15 + ld/testsuite/ld-x86-64/x86-64.exp | 2 + opcodes/ChangeLog | 14 + opcodes/arm-dis.c | 14 +- opcodes/micromips-opc.c | 3 +- opcodes/mips-opc.c | 2 +- 139 files changed, 2103 insertions(+), 691 deletions(-) create mode 100644 gas/testsuite/gas/arm/nops.d create mode 100644 gas/testsuite/gas/arm/nops.s create mode 100644 gas/testsuite/gas/mips/micromips32-move.d create mode 100644 gas/testsuite/gas/mips/micromips32-move.s create mode 100644 gas/testsuite/gas/mips/move.d create mode 100644 gas/testsuite/gas/mips/move.s create mode 100644 gas/testsuite/gas/xtensa/auto-litpools.d create mode 100644 gas/testsuite/gas/xtensa/auto-litpools.s create mode 100644 gdb/namespace.c create mode 100644 gdb/namespace.h create mode 100644 gdb/testsuite/gdb.ada/fun_renaming.exp create mode 100644 gdb/testsuite/gdb.ada/fun_renaming/fun_renaming.adb create mode 100644 gdb/testsuite/gdb.ada/fun_renaming/pack.adb create mode 100644 gdb/testsuite/gdb.ada/fun_renaming/pack.ads create mode 100644 gdb/testsuite/gdb.base/dso2dso-dso1.c create mode 100644 gdb/testsuite/gdb.base/dso2dso-dso1.h create mode 100644 gdb/testsuite/gdb.base/dso2dso-dso2.c create mode 100644 gdb/testsuite/gdb.base/dso2dso-dso2.h create mode 100644 gdb/testsuite/gdb.base/dso2dso.c create mode 100644 gdb/testsuite/gdb.base/dso2dso.exp create mode 100644 ld/testsuite/ld-i386/pr18801.d create mode 100644 ld/testsuite/ld-i386/pr18801.s create mode 100644 ld/testsuite/ld-i386/pr18815.d create mode 100644 ld/testsuite/ld-i386/pr18815.s create mode 100644 ld/testsuite/ld-x86-64/pr18801.d create mode 100644 ld/testsuite/ld-x86-64/pr18801.s create mode 100644 ld/testsuite/ld-x86-64/pr18815.d create mode 100644 ld/testsuite/ld-x86-64/pr18815.s First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2f850e7..9ba5902 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,19 @@ +2015-08-13 H.J. Lu + + PR ld/18801 + * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error + for read-only segment with dynamic IFUNC relocations. + * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise. + +2015-08-12 Simon Dardis + + * elfxx-mips.c (STUB_MOVE): Change to use 'or' only. + (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry, + mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry): + Update to use 'or' instead of 'addu/daddu'. + (_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE. + (move_insns_32): Reorder table. + 2015-08-11 H.J. Lu * elf32-i386.c (elf_i386_relocate_section): Properly skip IFUNC diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index c92671a..d8d11b7 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1641,6 +1641,18 @@ struct output_elf_obj_tdata bfd_boolean flags_init; }; +/* Indicate if the bfd contains symbols that have the STT_GNU_IFUNC + symbol type or STB_GNU_UNIQUE binding. Used to set the osabi + field in the ELF header structure. */ +enum elf_gnu_symbols + { + elf_gnu_symbol_none = 0, + elf_gnu_symbol_any = 1 << 0, + elf_gnu_symbol_ifunc = (elf_gnu_symbol_any | 1 << 1), + elf_gnu_symbol_unique = (elf_gnu_symbol_any | 1 << 2), + elf_gnu_symbol_all = (elf_gnu_symbol_ifunc | elf_gnu_symbol_unique) + }; + /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1751,10 +1763,7 @@ struct elf_obj_tdata symbols. */ bfd_boolean bad_symtab; - /* True if the bfd contains symbols that have the STT_GNU_IFUNC - symbol type or STB_GNU_UNIQUE binding. Used to set the osabi - field in the ELF header structure. */ - bfd_boolean has_gnu_symbols; + enum elf_gnu_symbols has_gnu_symbols; /* Information grabbed from an elf core file. */ struct core_elf_obj_tdata *core; diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c index dc6f55b..09d4e5c 100644 --- a/bfd/elf-s390-common.c +++ b/bfd/elf-s390-common.c @@ -238,7 +238,7 @@ elf_s390_add_symbol_hook (bfd *abfd, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; return TRUE; } diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index ff69728..d313de4 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -15928,7 +15928,7 @@ elf32_arm_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; if (elf32_arm_hash_table (info) == NULL) return FALSE; diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 98902ac..1e4c3f4 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1576,6 +1576,10 @@ elf_i386_check_relocs (bfd *abfd, /* It is referenced by a non-shared object. */ h->ref_regular = 1; h->root.non_ir_ref = 1; + + if (h->type == STT_GNU_IFUNC) + elf_tdata (info->output_bfd)->has_gnu_symbols + |= elf_gnu_symbol_ifunc; } if (! elf_i386_tls_transition (info, abfd, sec, NULL, @@ -3148,6 +3152,15 @@ elf_i386_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) if ((info->flags & DF_TEXTREL) != 0) { + if ((elf_tdata (output_bfd)->has_gnu_symbols + & elf_gnu_symbol_ifunc) == elf_gnu_symbol_ifunc) + { + info->callbacks->einfo + (_("%P%X: read-only segment has dynamic IFUNC relocations; recompile with -fPIC\n")); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + if (!add_dynamic_entry (DT_TEXTREL, 0)) return FALSE; } @@ -5330,11 +5343,11 @@ elf_i386_add_symbol_hook (bfd * abfd, asection ** secp ATTRIBUTE_UNUSED, bfd_vma * valp ATTRIBUTE_UNUSED) { - if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + if (ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols + |= elf_gnu_symbol_unique; return TRUE; } diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index db0d0da..07211b5 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -4846,7 +4846,7 @@ elf_m68k_add_symbol_hook (bfd *abfd, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; return TRUE; } diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index fc1a854..91942ec 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3653,7 +3653,7 @@ ppc_elf_add_symbol_hook (bfd *abfd, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; return TRUE; } diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 88efe9e..8b8b601 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -184,7 +184,7 @@ elf32_sparc_add_symbol_hook (bfd * abfd, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; return TRUE; } diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index ef08164..e153ee4 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -4821,7 +4821,7 @@ ppc64_elf_add_symbol_hook (bfd *ibfd, || ELF_ST_BIND (isym->st_info) == STB_GNU_UNIQUE) && (ibfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; if (*sec != NULL && strcmp ((*sec)->name, ".opd") == 0) diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 26e664e..5413891 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -430,7 +430,7 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; if (ELF_ST_TYPE (sym->st_info) == STT_REGISTER) { diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index b3c8522..348b297 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1723,6 +1723,10 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, /* It is referenced by a non-shared object. */ h->ref_regular = 1; h->root.non_ir_ref = 1; + + if (h->type == STT_GNU_IFUNC) + elf_tdata (info->output_bfd)->has_gnu_symbols + |= elf_gnu_symbol_ifunc; } if (! elf_x86_64_tls_transition (info, abfd, sec, NULL, @@ -3509,6 +3513,15 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd, if ((info->flags & DF_TEXTREL) != 0) { + if ((elf_tdata (output_bfd)->has_gnu_symbols + & elf_gnu_symbol_ifunc) == elf_gnu_symbol_ifunc) + { + info->callbacks->einfo + (_("%P%X: read-only segment has dynamic IFUNC relocations; recompile with -fPIC\n")); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + if (!add_dynamic_entry (DT_TEXTREL, 0)) return FALSE; } @@ -5873,11 +5886,11 @@ elf_x86_64_add_symbol_hook (bfd *abfd, return TRUE; } - if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) + if (ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols + |= elf_gnu_symbol_unique; return TRUE; } diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index a861773..69dac6d 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -494,7 +494,7 @@ _bfd_aarch64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE) && (abfd->flags & DYNAMIC) == 0 && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour) - elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE; + elf_tdata (info->output_bfd)->has_gnu_symbols = elf_gnu_symbol_any; return TRUE; } diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 06e8158..eb7593a 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -911,10 +911,7 @@ static bfd *reldyn_sorting_bfd; ((ABI_64_P (abfd) \ ? 0xdf998010 /* ld t9,0x8010(gp) */ \ : 0x8f998010)) /* lw t9,0x8010(gp) */ -#define STUB_MOVE(abfd) \ - ((ABI_64_P (abfd) \ - ? 0x03e0782d /* daddu t7,ra */ \ - : 0x03e07821)) /* addu t7,ra */ +#define STUB_MOVE 0x03e07825 /* or t7,ra,zero */ #define STUB_LUI(VAL) (0x3c180000 + (VAL)) /* lui t8,VAL */ #define STUB_JALR 0x0320f809 /* jalr t9,ra */ #define STUB_ORI(VAL) (0x37180000 + (VAL)) /* ori t8,t8,VAL */ @@ -930,10 +927,7 @@ static bfd *reldyn_sorting_bfd; ? 0xdf3c8010 /* ld t9,0x8010(gp) */ \ : 0xff3c8010) /* lw t9,0x8010(gp) */ #define STUB_MOVE_MICROMIPS 0x0dff /* move t7,ra */ -#define STUB_MOVE32_MICROMIPS(abfd) \ - (ABI_64_P (abfd) \ - ? 0x581f7950 /* daddu t7,ra,zero */ \ - : 0x001f7950) /* addu t7,ra,zero */ +#define STUB_MOVE32_MICROMIPS 0x001f7a90 /* or t7,ra,zero */ #define STUB_LUI_MICROMIPS(VAL) \ (0x41b80000 + (VAL)) /* lui t8,VAL */ #define STUB_JALR_MICROMIPS 0x45d9 /* jalr t9 */ @@ -1030,7 +1024,7 @@ static const bfd_vma mips_o32_exec_plt0_entry[] = 0x8f990000, /* lw $25, %lo(&GOTPLT[0])($28) */ 0x279c0000, /* addiu $28, $28, %lo(&GOTPLT[0]) */ 0x031cc023, /* subu $24, $24, $28 */ - 0x03e07821, /* move $15, $31 # 32-bit move (addu) */ + 0x03e07825, /* or t7, ra, zero */ 0x0018c082, /* srl $24, $24, 2 */ 0x0320f809, /* jalr $25 */ 0x2718fffe /* subu $24, $24, 2 */ @@ -1044,7 +1038,7 @@ static const bfd_vma mips_n32_exec_plt0_entry[] = 0x8dd90000, /* lw $25, %lo(&GOTPLT[0])($14) */ 0x25ce0000, /* addiu $14, $14, %lo(&GOTPLT[0]) */ 0x030ec023, /* subu $24, $24, $14 */ - 0x03e07821, /* move $15, $31 # 32-bit move (addu) */ + 0x03e07825, /* or t7, ra, zero */ 0x0018c082, /* srl $24, $24, 2 */ 0x0320f809, /* jalr $25 */ 0x2718fffe /* subu $24, $24, 2 */ @@ -1058,7 +1052,7 @@ static const bfd_vma mips_n64_exec_plt0_entry[] = 0xddd90000, /* ld $25, %lo(&GOTPLT[0])($14) */ 0x25ce0000, /* addiu $14, $14, %lo(&GOTPLT[0]) */ 0x030ec023, /* subu $24, $24, $14 */ - 0x03e0782d, /* move $15, $31 # 64-bit move (daddu) */ + 0x03e07825, /* or t7, ra, zero */ 0x0018c0c2, /* srl $24, $24, 3 */ 0x0320f809, /* jalr $25 */ 0x2718fffe /* subu $24, $24, 2 */ @@ -1091,7 +1085,7 @@ static const bfd_vma micromips_insn32_o32_exec_plt0_entry[] = 0xff3c, 0x0000, /* lw $25, %lo(&GOTPLT[0])($28) */ 0x339c, 0x0000, /* addiu $28, $28, %lo(&GOTPLT[0]) */ 0x0398, 0xc1d0, /* subu $24, $24, $28 */ - 0x001f, 0x7950, /* move $15, $31 */ + 0x001f, 0x7a90, /* or $15, $31, zero */ 0x0318, 0x1040, /* srl $24, $24, 2 */ 0x03f9, 0x0f3c, /* jalr $25 */ 0x3318, 0xfffe /* subu $24, $24, 2 */ @@ -10714,8 +10708,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd, if (htab->insn32) { bfd_put_micromips_32 (output_bfd, - STUB_MOVE32_MICROMIPS (output_bfd), - stub + idx); + STUB_MOVE32_MICROMIPS, stub + idx); idx += 4; } else @@ -10765,7 +10758,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd, idx = 0; bfd_put_32 (output_bfd, STUB_LW (output_bfd), stub + idx); idx += 4; - bfd_put_32 (output_bfd, STUB_MOVE (output_bfd), stub + idx); + bfd_put_32 (output_bfd, STUB_MOVE, stub + idx); idx += 4; if (stub_size == stub_big_size) { @@ -13224,8 +13217,8 @@ static const struct opcode_descriptor addiupc_insn = #define MOVE16_RS_FIELD(r) (((r) & 0x1f) ) static const struct opcode_descriptor move_insns_32[] = { - { /* "move", "d,s", */ 0x00000150, 0xffe007ff }, /* addu d,s,$0 */ { /* "move", "d,s", */ 0x00000290, 0xffe007ff }, /* or d,s,$0 */ + { /* "move", "d,s", */ 0x00000150, 0xffe007ff }, /* addu d,s,$0 */ { 0, 0 } /* End marker for find_match(). */ }; diff --git a/bfd/version.h b/bfd/version.h index 7de1581..68b79ad 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20150812 +#define BFD_VERSION_DATE 20150813 #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 e483f4f..ecf77fb 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,65 @@ +2015-08-13 Alan Modra + + * expr.c (operand): Rewrite handling of operands starting with "0f". + If atof_generic only parses "-" or "+", treat as expression. + +2015-08-13 Alan Modra + DJ Delorie + + * expr.c (integer_constant): Return O_absent expression if eol. + (operand): For targets with both LOCAL_LABELS_FB and + NUMBERS_WITH_SUFFIX set, treat "0b" not followed by binary + digits as a local label reference. Correct handling of 0b prefix. + If a suffix is not allowed, error on 0B. + +2015-08-13 Alan Modra + + * doc/as.texinfo (Local Labels): Allowed range of N in local + labels is non-negative integers, not positive integers. + +2015-08-12 David Weatherford + + * config/tc-xtensa.c (struct litpool_frag, struct litpool_seg): + New structures. + (xtensa_maybe_create_literal_pool_frag): New function. + (litpool_seg_list, auto_litpools, auto_litpool_limit) + (litpool_buf, litpool_slotbuf): New static variables. + (option_auto_litpools, option_no_auto_litpools) + (option_auto_litpool_limit): New enum identifiers. + (md_longopts): Add entries for auto-litpools, no-auto-litpools + and auto-litpool-limit. + (md_parse_option): Handle option_auto_litpools, + option_no_auto_litpools and option_auto_litpool_limit. + (md_show_usage): Add help for --[no-]auto-litpools and + --auto-litpool-limit. + (xtensa_mark_literal_pool_location): Record a place for literal + pool with a call to xtensa_maybe_create_literal_pool_frag. + (get_literal_pool_location): Find highest priority literal pool + or convert candidate to literal pool when auto-litpools are used. + (xg_assemble_vliw_tokens): Create literal pool after jump + instruction. + (xtensa_check_frag_count): Create candidate literal pool every + auto_litpool_limit frags. + (xtensa_relax_frag): Add jump around literals to non-empty + literal pool. + (xtensa_move_literals): Estimate literal pool addresses and move + unreachable literals closer to their users, converting candidate + to literal pool if needed. + (xtensa_switch_to_non_abs_literal_fragment): Only emit error + about missing .literal_position in case auto-litpools are not + used. + * config/tc-xtensa.h (xtensa_relax_statesE): New relaxation + state: RELAX_LITERAL_POOL_CANDIDATE_BEGIN. + * doc/as.texinfo (Xtensa options): Document --auto-litpools and + --no-auto-litpools options. + * doc/c-xtensa.texi (Xtensa options): Likewise. + +2015-08-12 Simon Dardis + + * config/tc-mips.c (move_register): Change to use 'or' only. + (s_cpload, s_cpsetup, s_cprestore, s_cpreturn): Update to + use or for move. + 2015-08-11 Jiong Wang * config/tc-aarch64.c (reloc_table): New relocation modifiers diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index ecff88b..74b7fb4 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -9325,8 +9325,7 @@ move_register (int dest, int source) && !(history[0].insn_mo->pinfo2 & INSN2_BRANCH_DELAY_32BIT)) macro_build (NULL, "move", "mp,mj", dest, source); else - macro_build (NULL, GPR_SIZE == 32 ? "addu" : "daddu", "d,v,t", - dest, source, 0); + macro_build (NULL, "or", "d,v,t", dest, source, 0); } /* Emit an SVR4 PIC sequence to load address LOCAL into DEST, where @@ -15886,7 +15885,7 @@ s_cpload (int ignore ATTRIBUTE_UNUSED) daddu $gp, $gp, $reg1 If $reg2 is given, this results in: - daddu $reg2, $gp, $0 + or $reg2, $gp, $0 lui $gp, %hi(%neg(%gp_rel(label))) addiu $gp, $gp, %lo(%neg(%gp_rel(label))) daddu $gp, $gp, $reg1 @@ -15966,8 +15965,7 @@ s_cpsetup (int ignore ATTRIBUTE_UNUSED) BFD_RELOC_LO16, SP); } else - macro_build (NULL, "daddu", "d,v,t", mips_cpreturn_register, - mips_gp_register, 0); + move_register (mips_cpreturn_register, mips_gp_register); if (mips_in_shared || HAVE_64BIT_SYMBOLS) { @@ -16080,7 +16078,7 @@ s_cprestore (int ignore ATTRIBUTE_UNUSED) ld $gp, offset($sp) If a register $reg2 was given there, it results in: - daddu $gp, $reg2, $0 */ + or $gp, $reg2, $0 */ static void s_cpreturn (int ignore ATTRIBUTE_UNUSED) @@ -16118,8 +16116,8 @@ s_cpreturn (int ignore ATTRIBUTE_UNUSED) macro_build (&ex, "ld", "t,o(b)", mips_gp_register, BFD_RELOC_LO16, SP); } else - macro_build (NULL, "daddu", "d,v,t", mips_gp_register, - mips_cpreturn_register, 0); + move_register (mips_gp_register, mips_cpreturn_register); + macro_end (); mips_assembling_insn = FALSE; diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 7311a05..b8b1e7d 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -440,6 +440,29 @@ bfd_boolean directive_state[] = #endif }; +/* A circular list of all potential and actual literal pool locations + in a segment. */ +struct litpool_frag +{ + struct litpool_frag *next; + struct litpool_frag *prev; + fragS *fragP; + addressT addr; + short priority; /* 1, 2, or 3 -- 1 is highest */ + short original_priority; +}; hooks/post-receive -- Repository for Project Archer.