public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] jankratochvil/gdbserverbuildid: FIXME: locate Date: Mon, 24 Mar 2014 03:33:00 -0000 [thread overview] Message-ID: <20140324033324.9599.qmail@sourceware.org> (raw) The branch, jankratochvil/gdbserverbuildid has been updated discards 4e3ec3ff77577a847700893cf308ba1bc6b32b8a (commit) discards 9914a76a05357603ccdc3a41a399ee125053e66d (commit) discards 55ec4dcef3e4b3a36d010dff32127ffacea743b9 (commit) discards 9ebd029d44030aee8b537108beba069788d68839 (commit) discards 6e94d1ef1cde4ba4e38606c4d0f9a20f90fc8fb5 (commit) discards b007f850d5490d5947663932482cd682f3fea6cd (commit) discards f648db58d39a4ca74a2d88fb29f6a07fb9293ad8 (commit) discards b337babae0bc75fbc5edc6fb5127ab061ffc86ac (commit) discards fe920c7544f49c8cbb3c386bba7dbf697e88f5e1 (commit) via aa7388d4a41ace67fbb765aefb0be6d2ea696287 (commit) via 3f5760079eaa9b26e4cdd857f225c635cb0391b4 (commit) via 67643e85f38259159dfe46de205c506de5342ed1 (commit) via eb7f9e4bfa5d3b382a42a938090f2a001b9ed81b (commit) via d9973c1a673ac4a78bc74364750e71889028ace1 (commit) via 381f2e19e2571d013f33868986d3df8c3da6c05e (commit) via b1f19a1e7e87a9ae39df68c3aa3d4b631a6740bd (commit) via 4c7392a0d13eeac097d1ca47d2b946ecbd86c18d (commit) via 1f575ae335ae3a1b89a415dccb3c87b35048b6f9 (commit) via 3d534729ad4f862c57e08e3e275a8e0cbf46d36f (commit) via d1f21a3bc674d45ab6d1acce592e27fa15c80c97 (commit) via 156c80b2f63a8b8fc08bf03442000c5be6c9d7a3 (commit) via 6339bfc47d2f4f5b681220ee2e735ea7828ae2e0 (commit) via 0a07590bf432ef8d03fcfdc7849a6f03ec05f2b5 (commit) via a4ff09242a4017c6e1a3b4bf5a53d45d305ca61c (commit) via b55fbac484a3057b21532805241d429b6cc23532 (commit) via 9217e74e903fcc21755e7b320ce54a9209f9b5e7 (commit) via 8acf9577e5acd99c23fe8f3fa87a961668de7805 (commit) via 25d743f9e6f23ec5fc1529a56d7178ad9cfe5611 (commit) via 51b8d20cf46627f9e97b90ada6467e69eb6d4439 (commit) via feef67abfaf328082c445b9d25696d44551478d1 (commit) via ecebef6a9acbca2f98e1ed64b986d792c6933ec5 (commit) via ecdf850f8515140a3c15bc8ca55172276bcc914d (commit) via d0e6d77b3fb64561ca66535f8ed6ca523eac923e (commit) via a82c7d9030b67a6a76a5403d0e1641f9e42141ac (commit) via b65dc60b233704405c334bbe16c4fc5689187b7b (commit) via 36cb1214c9f26b4e9b42d146dcf64621b36b91df (commit) via ccdd1909ad5299cf0753aaa113928a41f8f27391 (commit) via b4ab256ded5020a82ff7ce8dc485e7882fc5b6a7 (commit) via a2db7c07510f1f682af586153fa7ca8ad42b56c6 (commit) via 0c315784bf5f5d972dd85f5f621ed9674efc5665 (commit) via deba7593bb5b6e5159f5f0ea0afecd69125057a7 (commit) via d56a8dda6d5a1864b54230b356d92ce60397f0e8 (commit) via 1bff71c3251e2f0836163e49ecd4b55861f4eb83 (commit) via 90e289504f844c162ab2e701f99a309d2b37a62a (commit) via beb460e8d2ddf5327a6ab146055a6e6e9f552a4b (commit) via 5fc35d961bda7f8d40bfad9ca458a6b08de02bcb (commit) via 40acf43aadb4d5348cff0dd554ae97de4dd775af (commit) via 9f5e1e021a843e573b72ee448397a4db139adf2e (commit) via 99619beac6252113fed212fdb9e1ab97bface423 (commit) via 2adfaa28b5ba2fb78ba5113977082c4d04752bd6 (commit) via 31e77af205cf6564c2bf4c18400b4ca16bdf92cd (commit) via b9f437de50bcca478359c4c2ec0da50c29ddc512 (commit) via bcf83b2a66f0d968b51af8357f1543523ef83470 (commit) via 97323ad11305610185a0265392cabcd37510f50e (commit) via e1f8f1b3af798e8af99bffdb695f74c6c916d150 (commit) from 4e3ec3ff77577a847700893cf308ba1bc6b32b8a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit aa7388d4a41ace67fbb765aefb0be6d2ea696287 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:57 2014 +0100 FIXME: locate commit 3f5760079eaa9b26e4cdd857f225c635cb0391b4 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:57 2014 +0100 FIXME: sobfd commit 67643e85f38259159dfe46de205c506de5342ed1 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:57 2014 +0100 Tests for validate symbol file using build-id Hi, new testcase. Jan gdb/testsuite/ 2014-02-26 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 eb7f9e4bfa5d3b382a42a938090f2a001b9ed81b Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:57 2014 +0100 Validate symbol file using build-id Hi, consumer part of the "build-id" attribute. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> Validate symbol file using build-id. * NEWS (Changes since GDB 7.7): Add 'set solib-build-id-force' and 'show solib-build-id-force'. 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-ia64-hpux.c (ia64_hpux_target_so_ops): Ditto. * solib-irix.c (_initialize_irix_solib): Ditto. * solib-osf.c (_initialize_osf_solib): Ditto. * solib-pa64.c (_initialize_pa64_solib): Ditto. * solib-som.c (_initialize_som_solib): Ditto. * solib-spu.c (set_spu_solib_ops): Ditto. * solib-svr4.c: Include rsp-low.h. (svr4_validate): New function. (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 (solib_build_id_force, show_solib_build_id_force): New. (solib_map_sections): Use ops->validate. (free_so): Free build_id. (default_solib_validate): New function. (_initialize_solib): Add "solib-build-id-force". * 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/ 2014-03-02 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Files): Add 'set solib-build-id-force' and 'show solib-build-id-force'. commit d9973c1a673ac4a78bc74364750e71889028ace1 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:56 2014 +0100 gdbserver build-id attribute generator Hi, producer part of the new "build-id" XML attribute. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com gdbserver build-id attribute generator. * features/library-list-svr4.dtd (library-list-svr4): New 'build-id' attribute. gdb/doc/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.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/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.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 381f2e19e2571d013f33868986d3df8c3da6c05e Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:56 2014 +0100 Move linux_find_memory_regions_full & co. Hi, this should be just a move with no changes. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Move linux_find_memory_regions_full & co. * common/target-utils.c (string.h, gdb_assert.h): Include. (read_alloc, read_stralloc): Move definitions from target.c. * common/target-utils.h (read_alloc_pread_ftype): New typedef. (read_alloc): New declaration. (read_stralloc_func_ftype): New typedef. (read_stralloc): New declaration. * common/linux-maps.c (fcntl.h, unistd.h, target.h, gdb_assert.h) (ctype.h, string.h, target-utils.h): Include. (read_mapping): Move from linux-tdep.c. [GDBSERVER] (linux_find_memory_read_stralloc_1_pread): New function. [GDBSERVER] (linux_find_memory_read_stralloc_1): New function. (linux_find_memory_read_stralloc): New function. (linux_find_memory_regions_full): Move from linux-tdep.c. * common/linux-maps.h (read_mapping): New declaration. (linux_find_memory_region_ftype): Moved typedef from linux-tdep.c. (linux_find_memory_regions_full): New declaration. * linux-tdep.c (linux-maps.h): Include. (read_mapping): 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. * target.c (target-utils.h): Include. (read_alloc_pread_ftype): Moved typedef to common/target-utils.h. (read_alloc, read_stralloc): Moved definitions to common/target-utils.c. commit b1f19a1e7e87a9ae39df68c3aa3d4b631a6740bd Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:56 2014 +0100 Prepare linux_find_memory_regions_full & co. for move Hi, prepare code for move into gdb/common/. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.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 4c7392a0d13eeac097d1ca47d2b946ecbd86c18d Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:55 2014 +0100 Create empty common/linux-maps.[ch] and common/target-utils.[ch] Hi, prepare new files for later move. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Create empty common/linux-maps.[ch] and common/target-utils.[ch]. * Makefile.in (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. * common/target-utils.c: New file. * common/target-utils.h: New file. * common/linux-maps.c: New file. * common/linux-maps.h: New file. * config/i386/linux.mh (NATDEPFILES): Add linux-maps.o. * config/i386/linux64.mh (NATDEPFILES): Ditto. gdb/gdbserver/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.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 1f575ae335ae3a1b89a415dccb3c87b35048b6f9 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:55 2014 +0100 Merge multiple hex conversions Hi, here most of the patch has been reimplemented in the meantime and this is only a small remaint. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Merge multiple hex conversions. * monitor.c: Include rsp-low.h. (fromhex): Remove definition. gdb/gdbserver/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Merge multiple hex conversions. * gdbreplay.c (tohex): Rename to 'fromhex'. (logchar): Use fromhex. commit 3d534729ad4f862c57e08e3e275a8e0cbf46d36f Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:55 2014 +0100 Move utility functions to common/ Hi, some parts of the former patch have been reimplemented in the meantime by other patches so this is only a part of the former cleanup. Jan gdb/ 2014-02-26 Aleksandar Ristovski <aristovski@qnx.com Move utility functions to common/. * cli/cli-utils.c (skip_spaces, skip_spaces_const): Move defs to common/common-utils.c. * cli/cli-utils.h (skip_spaces, skip_spaces_const): Move decls to common/common-utils.h. * common/common-utils.c (host-defs.h, ctype.h): Include. (HIGH_BYTE_POSN, is_digit_in_base, digit_to_int, strtoulst): Move from utils.c. (skip_spaces, skip_spaces_const): Move from cli/cli-utils.c. * common/host-defs.h (TARGET_CHAR_BIT, HOST_CHAR_BIT): Moved from defs.h. * common/common-utils.h (strtoulst): Move decl from utils.h. (hex2bin, bin2hex): Move decls from remote.h. (skip_spaces, skip_spaces_const): Move decls from cli/cli-utils.h. * defs.h (TARGET_CHAR_BIT, HOST_CHAR_BIT): Move to common/common-utils.h * utils.c (HIGH_BYTE_POSN, is_digit_in_base, digit_to_int) (strtoulst): Move to common/common-utils.c. * utils.h (strtoulst): Moved decl to common/common-utils.h. commit d1f21a3bc674d45ab6d1acce592e27fa15c80c97 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Mon Mar 24 04:30:55 2014 +0100 +README.archer commit 156c80b2f63a8b8fc08bf03442000c5be6c9d7a3 Author: Alan Modra <amodra@gmail.com> Date: Mon Mar 24 09:30:47 2014 +1030 daily update commit 6339bfc47d2f4f5b681220ee2e735ea7828ae2e0 Author: Doug Evans <xdje42@gmail.com> Date: Sat Mar 22 08:22:29 2014 -0400 * infcmd.c: Whitespace fixes. (interrupt_command): Merge two function comments into one. commit 0a07590bf432ef8d03fcfdc7849a6f03ec05f2b5 Author: Doug Evans <xdje42@gmail.com> Date: Sat Mar 22 07:48:33 2014 -0400 * infcmd.c (interrupt_command): Renamed from interrupt_target_command. commit a4ff09242a4017c6e1a3b4bf5a53d45d305ca61c Author: Alan Modra <amodra@gmail.com> Date: Sun Mar 23 09:30:40 2014 +1030 daily update commit b55fbac484a3057b21532805241d429b6cc23532 Author: Yao Qi <yao@codesourcery.com> Date: Tue Mar 11 11:37:10 2014 +0800 Remove target_read_live_memory As we move code on reading unavailable memory to target side, GDB core side doesn't need the "switching momentarily out of tfind mode" dance. The target remote knows how to read live memory (through remote_ops). Remove set_traceframe_number and make_cleanup_restore_traceframe_number, since they are no longer used. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * remote.c (target_read_live_memory): Remove. (memory_xfer_live_readonly_partial): Rename it to remote_xfer_live_readonly_partial. Remove argument 'object'. All callers updated. Call remote_read_bytes_1 instead of target_read_live_memory. * tracepoint.c (set_traceframe_number): Remove. (make_cleanup_restore_traceframe_number): Likewise . * tracepoint.h (set_traceframe_number): Remove declaration. (make_cleanup_restore_traceframe_number): Likewise. commit 9217e74e903fcc21755e7b320ce54a9209f9b5e7 Author: Yao Qi <yao@codesourcery.com> Date: Tue Mar 11 11:19:12 2014 +0800 Factor remote_read_bytes. This patch moves code in remote_read_bytes on reading from the remote stub to a new function remote_read_bytes_1. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * remote.c (remote_read_bytes): Move code on reading from the remote stub to ... (remote_read_bytes_1): ... here. New function. commit 8acf9577e5acd99c23fe8f3fa87a961668de7805 Author: Yao Qi <yao@codesourcery.com> Date: Tue Mar 11 10:47:48 2014 +0800 Move the traceframe_available_memory code from memory_xfer_partial_1 down to the targets As a follow-up to [PATCH 7/8] Adjust read_value_memory to use to_xfer_partial https://sourceware.org/ml/gdb-patches/2014-02/msg00384.html this patch moves traceframe_available_memory down to the target side. After this patch, the gdb core code is cleaner, and code on handling unavailable memory is moved to remote/tfile/ctf targets. In details, this patch moves traceframe_available_memory code from memory_xfer_partial_1 to remote target only, so remote target still uses traceframe_info mechanism to check unavailable memory, and use remote_ops to read them from read-only sections. We don't use traceframe_info mechanism for tfile and ctf target, because it is fast to iterate all traceframes from trace file, so the summary information got from traceframe_info is not necessary. This patch also moves two functions to remote.c from target.c, because they are only used in remote.c. I'll clean them up in another patch. gdb: 2014-03-22 Yao Qi <yao@codesourcery.com> * ctf.c (ctf_xfer_partial): Check the return value of exec_read_partial_read_only, if it is not TARGET_XFER_OK, return TARGET_XFER_UNAVAILABLE. * tracefile-tfile.c (tfile_xfer_partial): Likewise. * target.c (target_read_live_memory): Move it to remote.c. (memory_xfer_live_readonly_partial): Likewise. (memory_xfer_partial_1): Move some code to remote_read_bytes. * remote.c (target_read_live_memory): Moved from target.c. (memory_xfer_live_readonly_partial): Likewise. (remote_read_bytes): New, factored out from memory_xfer_partial_1. commit 25d743f9e6f23ec5fc1529a56d7178ad9cfe5611 Author: Doug Evans <xdje42@gmail.com> Date: Sat Mar 22 02:59:04 2014 -0400 Fix typo in previous entry. commit 51b8d20cf46627f9e97b90ada6467e69eb6d4439 Author: Doug Evans <xdje42@gmail.com> Date: Sat Mar 22 02:57:08 2014 -0400 * gdb.guile/guile.exp (guile not supported): Verify multi-line guile command issues an error. commit feef67abfaf328082c445b9d25696d44551478d1 Author: Doug Evans <xdje42@gmail.com> Date: Sat Mar 22 02:44:39 2014 -0400 * extension.c (eval_ext_lang_from_control_command): Avoid dereferencing NULL pointer. testsuite/ * gdb.python/python.exp (python not supported): Verify multi-line python command issues an error. commit ecebef6a9acbca2f98e1ed64b986d792c6933ec5 Author: Maciej W. Rozycki <macro@codesourcery.com> Date: Fri Mar 21 23:51:16 2014 +0000 gdb.threads/thread-specific.exp: Fix uninitialized variable references This fixes: FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout) ERROR: tcl error sourcing .../gdb/testsuite/gdb.threads/thread-specific.exp. ERROR: can't read "this_breakpoint": no such variable while executing "gdb_test_multiple "info breakpoint $this_breakpoint" "info on bp" { -re ".*stop only in thread (\[0-9\]*).*$gdb_prompt $" { set this_thread $expe..." (file ".../gdb/testsuite/gdb.threads/thread-specific.exp" line 108) invoked from within "source .../gdb/testsuite/gdb.threads/thread-specific.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source .../gdb/testsuite/gdb.threads/thread-specific.exp" invoked from within "catch "uplevel #0 source $test_file_name"" and then: FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout) UNTESTED: gdb.threads/thread-specific.exp: info on bp ERROR: tcl error sourcing .../gdb/testsuite/gdb.threads/thread-specific.exp. ERROR: can't read "this_thread": no such variable while executing "gdb_test {print $_thread} ".* = $this_thread" "thread var at break"" (file ".../gdb/testsuite/gdb.threads/thread-specific.exp" line 119) invoked from within "source .../gdb/testsuite/gdb.threads/thread-specific.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source .../gdb/testsuite/gdb.threads/thread-specific.exp" invoked from within "catch "uplevel #0 source $test_file_name"" Final results: FAIL: gdb.threads/thread-specific.exp: continue to thread-specific breakpoint (timeout) UNTESTED: gdb.threads/thread-specific.exp: info on bp UNTESTED: gdb.threads/thread-specific.exp: thread var at break Of course the first failure best wasn't there, but failing that the script shouldn't crash. * gdb.threads/thread-specific.exp: Handle the lack of usable $this_breakpoint and $this_thread. commit ecdf850f8515140a3c15bc8ca55172276bcc914d Author: Alan Modra <amodra@gmail.com> Date: Sat Mar 22 09:30:43 2014 +1030 daily update commit d0e6d77b3fb64561ca66535f8ed6ca523eac923e Author: Chris Faylor <me.cygwin2011@cgf.cx> Date: Fri Mar 21 13:33:43 2014 -0400 2014-03-21 Christopher Faylor <me.binutils2014@cgf.cx> * ld.texinfo: Document change in handling of --enable-auto-image-base. * emultempl/pe.em (pe_auto_image_base): Set to default base. (gld_${EMULATION_NAME}_list_options): Change usage message to reflect optional --enable-auto-image-base argument. (gld${EMULATION_NAME}_handle_option): Handle optional --enable-auto-image-base argument. (compute_dll_image_base): Eliminate constant. Use pe_auto_image_base. commit a82c7d9030b67a6a76a5403d0e1641f9e42141ac Author: David Weatherford <weath@cadence.com> Date: Fri Mar 21 11:53:42 2014 +0000 Add support to the Xtensa target for creating trampolines for out-of-range branches. * tc-xtensa.c (xtensa_check_frag_count, xtensa_create_trampoline_frag) (xtensa_maybe_create_trampoline_frag, init_trampoline_frag) (find_trampoline_seg, search_trampolines, get_best_trampoline) (check_and_update_trampolines, add_jump_to_trampoline) (dump_trampolines): New function. (md_parse_option): Add cases for --[no-]trampolines options. (md_assemble, finish_vinsn, xtensa_end): Add call to xtensa_check_frag_count. (xg_assemble_vliw_tokens): Add call to xtensa_maybe_create_trampoline_frag. (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state. (relax_frag_immed): Relax jump instructions that cannot reach its target. * tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New relax state. * as.texinfo: Document --[no-]trampolines command-line options. * c-xtensa.texi: Document trampolines relaxation and command line options. * frags.c (get_frag_count, clear_frag_count): New function. (frag_alloc): Increment totalfrags counter. * frags.h (get_frag_count, clear_frag_count): New function. * all.exp: Add test for trampoline relaxation. * trampoline.d: Trampoline relaxation expected dump. * trampoline.s: Trampoline relaxation test source. commit b65dc60b233704405c334bbe16c4fc5689187b7b Author: Pedro Alves <palves@redhat.com> Date: Fri Mar 21 11:08:44 2014 +0000 normal_stop: Extend and clarify comment. Explain better why we skip saying "Switching to ..." in non-stop mode. gdb/ 2014-03-21 Pedro Alves <palves@redhat.com> * infrun.c (normal_stop): Extend comment. commit 36cb1214c9f26b4e9b42d146dcf64621b36b91df Author: Hui Zhu <teawater@gmail.com> Date: Fri Mar 21 16:46:15 2014 +0800 Remove fixme of packet "k" from doc https://sourceware.org/ml/gdb-patches/2014-03/msg00324.html 2014-03-21 Pedro Alves <palves@redhat.com> Stan Shebs <stan@codesourcery.com> Hui Zhu <hui@codesourcery.com> * gdb.texinfo (Packets): Add anchor to "? packet". Remove fixme and update introduction of "k packet". Add anchor to "vKill packet". commit ccdd1909ad5299cf0753aaa113928a41f8f27391 Author: Hui Zhu <teawater@gmail.com> Date: Fri Mar 21 11:11:51 2014 +0800 Fix internal warning when "gdb -p xxx" The issue that was fixed by b4ab256ded5020a82ff7ce8dc485e7882fc5b6a7 can not be found in regression test. Update attach.exp to test it. https://sourceware.org/ml/gdb-patches/2014-03/msg00438.html 2014-03-21 Hui Zhu <hui@codesourcery.com> * gdb.base/attach.exp (do_command_attach_tests): New. commit b4ab256ded5020a82ff7ce8dc485e7882fc5b6a7 Author: Hui Zhu <teawater@gmail.com> Date: Fri Mar 21 10:25:41 2014 +0800 Fix internal warning when "gdb -p xxx" ps -e | grep a.out 28886 pts/12 00:00:00 a.out gdb -p 28886 Loaded symbols for /lib64/ld-linux-x86-64.so.2 0x0000003b0ccbc970 in __nanosleep_nocancel () from /lib64/libc.so.6 ../../binutils-gdb/gdb/cleanups.c:265: internal-warning: restore_my_cleanups has found a stale cleanup A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) The backtrace of this issue: (gdb) bt file=0x8b0c10 "s' failed.", line=265, fmt=0x8b0c38 "nutils-gdb/gdb/cleanups.c", ap=0x7fff803e3ed8) at ../../binutils-gdb/gdb/utils.c:748 fmt=0x8b0c38 "nutils-gdb/gdb/cleanups.c", ap=0x7fff803e3ed8) at ../../binutils-gdb/gdb/utils.c:799 string=0x8b0c38 "nutils-gdb/gdb/cleanups.c") at ../../binutils-gdb/gdb/utils.c:809 at ../../binutils-gdb/gdb/cleanups.c:265 at ../../binutils-gdb/gdb/cleanups.c:276 at ../../binutils-gdb/gdb/exceptions.c:142 at ../../binutils-gdb/gdb/exceptions.c:203 command=0x5d5fb8 <attach_command_continuation_free_args+18>, arg=0x7fff803e525b "2914", from_tty=1, mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:549 ---Type <return> to continue, or q <return> to quit--- func_args=0x7fff803e4280, errstring=0x8cf2e4 "/local/bin", mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:522 This is a new issue. It is introduced by commit https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=8bc2fe488957946d2cdccda3ce8d4f39e4003ea0 It removed the discard_cleanups (back_to) inside attach_command. Then restore_my_cleanups will throw a internal_warning. https://sourceware.org/ml/gdb-patches/2014-03/msg00374.html 2014-03-21 Hui Zhu <hui@codesourcery.com> Pedro Alves <palves@redhat.com> * darwin-nat.c (darwin_pid_to_exec_file): Change xmalloc to static buffer. * fbsd-nat.c (fbsd_pid_to_exec_file): Ditto. * linux-nat.c (linux_child_pid_to_exec_file): Ditto. * nbsd-nat.c (nbsd_pid_to_exec_file): Ditto. commit a2db7c07510f1f682af586153fa7ca8ad42b56c6 Author: Alan Modra <amodra@gmail.com> Date: Fri Mar 21 09:30:49 2014 +1030 daily update commit 0c315784bf5f5d972dd85f5f621ed9674efc5665 Author: DJ Delorie <dj@redhat.com> Date: Thu Mar 20 17:50:49 2014 -0400 Add opcode relaxation for rl78-elf This patch adds initial in-gas opcode relaxation for the rl78 backend. Specifically, it checks for conditional branches that are too far and replaces them with inverted branches around longer fixed branches. commit deba7593bb5b6e5159f5f0ea0afecd69125057a7 Author: Maciej W. Rozycki <macro@codesourcery.com> Date: Thu Mar 20 21:41:56 2014 +0000 Avoid using the ISO C99 `z' formatted output modifier * mi/mi-interp.c (mi_memory_changed): Avoid using the ISO C99 `z' formatted output modifier. commit d56a8dda6d5a1864b54230b356d92ce60397f0e8 Author: Richard Sandiford <rdsandiford@googlemail.com> Date: Thu Mar 20 21:18:43 2014 +0000 gas/ * config/tc-mips.h (DIFF_EXPR_OK, CFI_DIFF_EXPR_OK): Define. * config/tc-mips.c (md_pcrel_from): Remove error message. (md_apply_fix): Convert PC-relative BFD_RELOC_32s to BFD_RELOC_32_PCREL. Report a specific error message for unhandled PC-relative expressions. Handle BFD_RELOC_8. gas/testsuite/ * gas/all/gas.exp: Remove XFAIL of forward.d for MIPS. * gas/mips/pcrel-1.s, gas/mips/pcrel-1.d, gas/mips/pcrel-2.s, gas/mips/pcrel-2.d, gas/mips/pcrel-3.s, gas/mips/pcrel-3.l, gas/mips/pcrel-4.s, gas/mips/pcrel-4-32.d, gas/mips/pcrel-4-n32.d, gas/mips/pcrel-4-64.d: New tests. * gas/mips/mips.exp: Run them. * gas/mips/lui-2.l: Tweak error message for line 7. ld/testsuite/ * ld-elf/merge.d: Remove MIPS XFAIL. commit 1bff71c3251e2f0836163e49ecd4b55861f4eb83 Author: Sergio Durigan Junior <sergiodj@redhat.com> Date: Thu Mar 20 18:08:31 2014 -0300 Fix probe-related internal error on AIX -- Initial message by Tom Tromey: While testing on AIX, I happened to notice an internal error coming from parse_probes. This happens because there are no probes defined on this platform. This patch fixes the problem by changing an assert into an ordinary error, and then changing the relevant caller to cope. This fixes a few tests on AIX; also regtested on x86-64 Fedora 18. -- Followup by Sergio Durigan Junior: By reading the patch (and the original code), I found it a little bit obscure, so I took the liberty to try to improve it. Here's the patch. Could you please take a look and see if it works on AIX (and also if you like the approach)? gdb/ 2014-03-20 Tom Tromey <tromey@redhat.com> Sergio Durigan Junior <sergiodj@redhat.com> * probe.c (parse_probes): Turn assert into an ordinary error. * break-catch-throw.c (re_set_exception_catchpoint): Ignore exceptions when parsing probes. Rearrange the code for clarity. commit 90e289504f844c162ab2e701f99a309d2b37a62a Author: Tom Tromey <tromey@redhat.com> Date: Tue Mar 4 11:32:52 2014 -0700 Fix py-finish-breakpoint.exp with target async. With target async enabled, py-finish-breakpoint.exp triggers an assertion failure. The failure occurs because execute_command re-enters the event loop in some circumstances, and in this case resets the sync_execution flag. Then later GDB reaches this assertion in normal_stop: gdb_assert (sync_execution || !target_can_async_p ()); In detail: #1 - A synchronous execution command is run. sync_execution is set. #2 - A python breakpoint is hit (TARGET_WAITKIND_STOPPED), and the corresponding Python breakpoint's stop method is executed. When and while python commands are executed, interpreter_async is forced to 0. #3 - The Python stop method happens to execute a not-execution-related gdb command. In this case, "where 1". #4 - Seeing that sync_execution is set, execute_command nests a new event loop (although that wasn't necessary; this is the problem). #5 - The linux-nat target's pipe in the event loop happens to be marked. That's normal, due to this in linux_nat_wait: /* If we requested any event, and something came out, assume there may be more. If we requested a specific lwp or process, also assume there may be more. */ The nested event loop thus immediately wakes up and calls target_wait. No thread is actually executing in the inferior, so the target returns TARGET_WAITKIND_NO_RESUMED. #6 - normal_stop is reached. GDB prints "No unwaited-for children left.", and resets the sync_execution flag (IOW, there are no resumed threads left, so the synchronous command is considered completed.) This is already bogus. We were handling a breakpoint! #7 - the nested event loop unwinds/ends. GDB is now back to handling the python stop method (TARGET_WAITKIND_STOPPED), which decides the breakpoint should stop. normal_stop is called for this event. However, normal_stop actually works with the _last_ reported target status: void normal_stop (void) { struct target_waitstatus last; ptid_t last_ptid; struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); ... get_last_target_status (&last_ptid, &last); ... if (last.kind == TARGET_WAITKIND_NO_RESUMED) { gdb_assert (sync_execution || !target_can_async_p ()); target_terminal_ours_for_output (); printf_filtered (_("No unwaited-for children left.\n")); } And due to the nesting in execute command, the last event is now TARGET_WAITKIND_NO_RESUMED, not the actual breakpoint event being handled. This could be seen to be broken in itself, but we can leave fixing that for another pass. The assertion is reached, and fails. execute_command has a comment explaining when it should synchronously wait for events: /* If the interpreter is in sync mode (we're running a user command's list, running command hooks or similars), and we just ran a synchronous command that started the target, wait for that command to end. */ However, the code did not follow this comment -- it didn't check to see if the command actually started the target, just whether the target was executing a sync command at this point. This patch fixes the problem by noting whether the target was executing in sync_execution mode before running the command, and then augmenting the condition to test this as well. 2014-03-20 Tom Tromey <tromey@redhat.com> PR gdb/14135 * top.c (execute_command): Only dispatch events if the command started the target. commit beb460e8d2ddf5327a6ab146055a6e6e9f552a4b Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 17:03:43 2014 +0000 make dprintf.exp pass in target async mode When target-async is enabled, dprintf.exp fails: Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ... FAIL: gdb.base/dprintf.exp: 1st dprintf, call FAIL: gdb.base/dprintf.exp: 2nd dprintf, call FAIL: gdb.base/dprintf.exp: Set dprintf function FAIL: gdb.base/dprintf.exp: 1st dprintf, fprintf FAIL: gdb.base/dprintf.exp: 2nd dprintf, fprintf Breakpoint 2, main (argc=1, argv=0x7fffffffd3f8) at ../../../src/gdb/testsuite/gdb.base/dprintf.c:33 33 int loc = 1234; (gdb) continue Continuing. kickoff 1234 also to stderr 1234 At foo entry (gdb) FAIL: gdb.base/dprintf.exp: 1st dprintf, call The problem is that GDB gave the prompt back to the user too early. This happens when calling functions while handling an event that doesn't cause a user visible stop. dprintf with "set dprintf-style gdb" is one such case. This patch adds a test case that has a breakpoint with a condition that calls a function that returns false, so that regression testing isn't dependent on the implementation of dprintf. The problem happens because run_inferior_call causes GDB to forget that it is running in sync_execution mode, so any event that runs an inferior call causes fetch_inferior_event to display the prompt, even if the event should not result in a user visible stop (that is, gdb resumes the inferior and waits for the next event). This patch fixes the issue by noticing when GDB was in sync_execution mode in run_inferior_call, and taking care to restore this state afterward. gdb/ 2014-03-20 Tom Tromey <tromey@redhat.com> PR cli/15718 * infcall.c: Include event-top.h. (run_inferior_call): Call async_disable_stdin if needed. gdb/testsuite/ 2014-03-20 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> PR cli/15718 * gdb.base/condbreak-call-false.c: New file. * gdb.base/condbreak-call-false.exp: New file. commit 5fc35d961bda7f8d40bfad9ca458a6b08de02bcb Author: Ilya Tocar <ilya.tocar@intel.com> Date: Thu Mar 20 13:12:16 2014 +0400 Fix memory size for gather/scatter instructions For gathers with indices larger than elements (e. g.) vpgatherqd ymm6{k1}, ZMMWORD PTR [ebp+zmm7*8-123] We currently treat memory size as a size of index register, while it is actually should be size of destination register: vpgatherqd ymm6{k1}, YMMWORD PTR [ebp+zmm7*8-123] This patch fixes it. opcodes/ * i386-opc.tbl: Change memory size for vgatherpf0qps, vgatherpf1qps, vscatterpf0qps, vscatterpf1qps, vgatherqps, vpgatherqd, vpscatterqd, vscatterqps. * i386-tbl.h: Regenerate. gas/testsuite/ * gas/i386/avx512pf-intel.d: Change memory size for vgatherpf0qps, vgatherpf1qps, vscatterpf0qps, vscatterpf1qps. * gas/i386/avx512pf.s: Ditto. * gas/i386/x86-64-avx512pf-intel.d: Ditto. * gas/i386/x86-64-avx512pf.s: Ditto. * gas/i386/avx512f-intel.d: Change memory size for vgatherqps, vpgatherqd, vpscatterqd, vscatterqps. * gas/i386/avx512f.s: Ditto. * gas/i386/x86-64-avx512f-intel.d: Ditto. * gas/i386/x86-64-avx512f.s: Ditto. commit 40acf43aadb4d5348cff0dd554ae97de4dd775af Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 14:09:53 2014 +0000 Further cleanup of signal-while-stepping-over-bp-other-thread.c. This test now uses pthread_kill instead of the host's kill command, so no longer need to block signals, or store the the inferior's PID. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/signal-while-stepping-over-bp-other-thread.c (pid): Delete. (block_signals, unblock_signals): Delete. (child_function_2, main): Remove references to deleted variable and functions. commit 9f5e1e021a843e573b72ee448397a4db139adf2e Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 13:26:33 2014 +0000 Make signal-while-stepping-over-bp-other-thread.exp run against remote targets too. Use pthread_kill instead of the host's "kill". The reason the test wasn't written that way to begin with, is that done this way, before the previous fixes to make GDB step-over all other threads before the stepping thread, the test would fail... Tested on x86_64 Fedora 17, native and gdbserver. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/signal-while-stepping-over-bp-other-thread.c (main): Use pthread_kill to signal thread 2. * gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Adjust to make the test send itself a signal rather than using the host's "kill" command. commit 99619beac6252113fed212fdb9e1ab97bface423 Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 13:26:32 2014 +0000 Handle multiple step-overs. This test fails with current mainline. If the program stopped for a breakpoint in thread 1, and then the user switches to thread 2, and resumes the program, GDB first switches back to thread 1 to step it over the breakpoint, in order to make progress. However, that logic only considers the last reported event, assuming only one thread needs that stepping over dance. That's actually not true when we play with scheduler-locking. The patch adds an example to the testsuite of multiple threads needing a step-over before the stepping thread can be resumed. With current mainline, the program re-traps the same breakpoint it had already trapped before. E.g.: Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint info threads Id Target Id Frame 3 Thread 0x7ffff77c9700 (LWP 4310) "multiple-step-o" 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43 2 Thread 0x7ffff7fca700 (LWP 4309) "multiple-step-o" 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60 * 1 Thread 0x7ffff7fcb740 (LWP 4305) "multiple-step-o" main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: info threads shows all threads set scheduler-locking on (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking on break 44 Breakpoint 3 at 0x4007d3: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 44. (gdb) break 61 Breakpoint 4 at 0x40082d: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 61. (gdb) thread 3 [Switching to thread 3 (Thread 0x7ffff77c9700 (LWP 4310))] #0 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43 43 (*myp) ++; (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 3 continue Continuing. Breakpoint 3, child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:44 44 callme (); /* set breakpoint thread 3 here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 3 p *myp = 0 $1 = 0 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 3 thread 2 [Switching to thread 2 (Thread 0x7ffff7fca700 (LWP 4309))] #0 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60 60 (*myp) ++; (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 2 continue Continuing. Breakpoint 4, child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:61 61 callme (); /* set breakpoint thread 2 here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 2 p *myp = 0 $2 = 0 (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 2 thread 1 [Switching to thread 1 (Thread 0x7ffff7fcb740 (LWP 4305))] #0 main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 1 set scheduler-locking off (gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking off At this point all thread are stopped for a breakpoint that needs stepping over. (gdb) step Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99 99 wait_threads (); /* set wait-threads breakpoint here */ (gdb) FAIL: gdb.threads/multiple-step-overs.exp: step But that "step" retriggers the same breakpoint instead of making progress. The patch teaches GDB to step over all breakpoints of all threads before resuming the stepping thread. Tested on x86_64 Fedora 17, against pristine mainline, and also my branch that implements software single-stepping on x86. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * infrun.c (prepare_to_proceed): Delete. (thread_still_needs_step_over): New function. (find_thread_needs_step_over): New function. (proceed): If the current thread needs a step-over, set its steping_over_breakpoint flag. Adjust to use find_thread_needs_step_over instead of prepare_to_proceed. (process_event_stop_test): For BPSTAT_WHAT_STOP_NOISY and BPSTAT_WHAT_STOP_SILENT, assume the thread stopped for a breakpoint. (switch_back_to_stepped_thread): Step over breakpoints of all threads not the stepping thread, before switching back to the stepping thread. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/multiple-step-overs.c: New file. * gdb.threads/multiple-step-overs.exp: New file. * gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Adjust expected infrun debug output. commit 2adfaa28b5ba2fb78ba5113977082c4d04752bd6 Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 13:26:32 2014 +0000 Fix for even more missed events; eliminate thread-hop code. Even with deferred_step_ptid out of the way, GDB can still lose watchpoints. If a watchpoint triggers and the PC points to an address where a thread-specific breakpoint for another thread is set, the thread-hop code triggers, and we lose the watchpoint: if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP) { int thread_hop_needed = 0; struct address_space *aspace = get_regcache_aspace (get_thread_regcache (ecs->ptid)); /* Check if a regular breakpoint has been hit before checking for a potential single step breakpoint. Otherwise, GDB will not see this breakpoint hit when stepping onto breakpoints. */ if (regular_breakpoint_inserted_here_p (aspace, stop_pc)) { if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid)) thread_hop_needed = 1; ^^^^^^^^^^^^^^^^^^^^^ } And on software single-step targets, even without a thread-specific breakpoint in the way, here in the thread-hop code: else if (singlestep_breakpoints_inserted_p) { ... if (!ptid_equal (singlestep_ptid, ecs->ptid) && in_thread_list (singlestep_ptid)) { /* If the PC of the thread we were trying to single-step has changed, discard this event (which we were going to ignore anyway), and pretend we saw that thread trap. This prevents us continuously moving the single-step breakpoint forward, one instruction at a time. If the PC has changed, then the thread we were trying to single-step has trapped or been signalled, but the event has not been reported to GDB yet. There might be some cases where this loses signal information, if a signal has arrived at exactly the same time that the PC changed, but this is the best we can do with the information available. Perhaps we should arrange to report all events for all threads when they stop, or to re-poll the remote looking for this particular thread (i.e. temporarily enable schedlock). */ CORE_ADDR new_singlestep_pc = regcache_read_pc (get_thread_regcache (singlestep_ptid)); if (new_singlestep_pc != singlestep_pc) { enum gdb_signal stop_signal; if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread," " but expected thread advanced also\n"); /* The current context still belongs to singlestep_ptid. Don't swap here, since that's the context we want to use. Just fudge our state and continue. */ stop_signal = ecs->event_thread->suspend.stop_signal; ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0; ecs->ptid = singlestep_ptid; ecs->event_thread = find_thread_ptid (ecs->ptid); ecs->event_thread->suspend.stop_signal = stop_signal; stop_pc = new_singlestep_pc; } else { if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread\n"); thread_hop_needed = 1; stepping_past_singlestep_breakpoint = 1; saved_singlestep_ptid = singlestep_ptid; } } } we either end up with thread_hop_needed, ignoring the watchpoint SIGTRAP, or switch to the stepping thread, again ignoring that the SIGTRAP could be for some other event. The new test added by this patch exercises both paths. So the fix is similar to the deferred_step_ptid fix -- defer the thread hop to _after_ the SIGTRAP had a change of passing through the regular bpstat handling. If the wrong thread hits a breakpoint, we'll just end up with BPSTAT_WHAT_SINGLE, and if nothing causes a stop, keep_going starts a step-over. Most of the stepping_past_singlestep_breakpoint mechanism is really not necessary -- setting the thread to step over a breakpoint with thread->trap_expected is sufficient to keep all other threads locked. It's best to still keep the flag in some form though, because when we get to keep_going, the software single-step breakpoint we need to step over is already gone -- an optimization done by a follow up patch will check whether a step-over is still be necessary by looking to see whether the breakpoint is still there, and would find the thread no longer needs a step-over, while we still want it. Special care is still needed to handle the case of PC of the thread we were trying to single-step having changed, like in the old code. We can't just keep_going and re-step it, as in that case we can over-step the thread (if it was already done with the step, but hasn't reported it yet, we'd ask it to step even further). That's now handled in switch_back_to_stepped_thread. As bonus, we're now using a technique that doesn't lose signals, unlike the old code -- we now insert a breakpoint at PC, and resume, which either reports the breakpoint immediately, or any pending signal. Tested on x86_64 Fedora 17, against pristine mainline, and against a branch that implements software single-step on x86. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * breakpoint.c (single_step_breakpoint_inserted_here_p): Make extern. * breakpoint.h (single_step_breakpoint_inserted_here_p): Declare. * infrun.c (saved_singlestep_ptid) (stepping_past_singlestep_breakpoint): Delete. (resume): Remove stepping_past_singlestep_breakpoint handling. (proceed): Store the prev_pc of the stepping thread too. (init_wait_for_inferior): Adjust. Clear singlestep_ptid and singlestep_pc. (enum infwait_states): Delete infwait_thread_hop_state. (struct execution_control_state) <hit_singlestep_breakpoint>: New field. (handle_inferior_event): Adjust. (handle_signal_stop): Delete stepping_past_singlestep_breakpoint handling and the thread-hop code. Before removing single-step breakpoints, check whether the thread hit a single-step breakpoint of another thread. If it did, the trap is not a random signal. (switch_back_to_stepped_thread): If the event thread hit a single-step breakpoint, unblock it before switching to the stepping thread. Handle the case of the stepped thread having advanced already. (keep_going): Handle the case of the current thread moving past a single-step breakpoint. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/step-over-trips-on-watchpoint.c: New file. * gdb.threads/step-over-trips-on-watchpoint.exp: New file. commit 31e77af205cf6564c2bf4c18400b4ca16bdf92cd Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 13:26:32 2014 +0000 PR breakpoints/7143 - Watchpoint does not trigger when first set Say the program is stopped at a breakpoint, and the user sets a watchpoint. When the program is next resumed, GDB will first step over the breakpoint, as explained in the manual: @value {GDBN} normally ignores breakpoints when it resumes execution, until at least one instruction has been executed. If it it did not do this, you would be unable to proceed past a breakpoint without first disabling the breakpoint. This rule applies whether or not the breakpoint already existed when your program stopped. However, GDB currently also removes watchpoints, catchpoints, etc., and that means that the first instruction off the breakpoint does not trigger the watchpoint, catchpoint, etc. testsuite/gdb.base/watchpoint.exp has a kfail for this. The PR proposes installing watchpoints only when stepping over a breakpoint, but that misses catchpoints, etc. A better fix would instead work from the opposite direction -- remove only real breakpoints, leaving all other kinds of breakpoints inserted. But, going further, it's really a waste to constantly remove/insert all breakpoints when stepping over a single breakpoint (generating a pair of RSP z/Z packets for each breakpoint), so the fix goes a step further and makes GDB remove _only_ the breakpoint being stepped over, leaving all others installed. This then has the added benefit of reducing breakpoint-related RSP traffic substancialy when there are many breakpoints set. gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> PR breakpoints/7143 * breakpoint.c (should_be_inserted): Don't insert breakpoints that are being stepped over. (breakpoint_address_match): Make extern. * breakpoint.h (breakpoint_address_match): New declaration. * inferior.h (stepping_past_instruction_at): New declaration. * infrun.c (struct step_over_info): New type. (step_over_info): New global. (set_step_over_info, clear_step_over_info) (stepping_past_instruction_at): New functions. (handle_inferior_event): Clear the step-over info when trap_expected is cleared. (resume): Remove now stale comment. (clear_proceed_status): Clear step-over info. (proceed): Adjust step-over handling to set or clear the step-over info instead of removing all breakpoints. (handle_signal_stop): When setting up a thread-hop, don't remove breakpoints here. (stop_stepping): Clear step-over info. (keep_going): Adjust step-over handling to set or clear step-over info and then always inserting breakpoints, instead of removing all breakpoints when stepping over one. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> PR breakpoints/7143 * gdb.base/watchpoint.exp: Mention bugzilla bug number instead of old gnats gdb/38. Remove kfail. Adjust to use gdb_test instead of gdb_test_multiple. * gdb.cp/annota2.exp: Remove kfail for gdb/38. * gdb.cp/annota3.exp: Remove kfail for gdb/38. commit b9f437de50bcca478359c4c2ec0da50c29ddc512 Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 20 13:26:31 2014 +0000 Fix missing breakpoint/watchpoint hits, eliminate deferred_step_ptid. Consider the case of the user doing "step" in thread 2, while thread 1 had previously stopped for a breakpoint. In order to make progress, GDB makes thread 1 step over its breakpoint first (with all other threads stopped), and once that is over, thread 2 then starts stepping (with thread 1 and all others running free, by default). If GDB didn't do that, thread 1 would just trip on the same breakpoint immediately again. This is what the prepare_to_proceed / deferred_step_ptid code is all about. However, deferred_step_ptid code resumes the target with: resume (1, GDB_SIGNAL_0); prepare_to_wait (ecs); return; Recall we were just stepping over a breakpoint when we get here. That means that _nothing_ had installed breakpoints yet! If there's another breakpoint just after the breakpoint that was just stepped, we'll miss it. The fix for that would be to use keep_going instead. However, there are more problems. What if the instruction that was just single-stepped triggers a watchpoint? Currently, GDB just happily resumes the thread, losing that too... Missed watchpoints will need yet further fixes, but we should keep those in mind. So the fix must be to let the trap fall through the regular bpstat handling, and only if no breakpoint, watchpoint, etc. claims the trap, shall we switch back to the stepped thread. Now, nowadays, we have code at the tail end of trap handling that does exactly that -- switch back to the stepped thread (switch_back_to_the_stepped_thread). So the deferred_step_ptid code is just standing in the way, and can simply be eliminated, fixing bugs in the process. Sweet. The comment about spurious "Switching to ..." made me pause, but is actually stale nowadays. That isn't needed anymore. previous_inferior_ptid used to be re-set at each (internal) event, but now it's only touched in proceed and normal stop. The two tests added by this patch fail without the fix. Tested on x86_64 Fedora 17 (also against my software single-stepping on x86 branch). gdb/ 2014-03-20 Pedro Alves <palves@redhat.com> * infrun.c (previous_inferior_ptid): Adjust comment. (deferred_step_ptid): Delete. (infrun_thread_ptid_changed, prepare_to_proceed) (init_wait_for_inferior): Adjust. (handle_signal_stop): Delete deferred_step_ptid handling. gdb/testsuite/ 2014-03-20 Pedro Alves <palves@redhat.com> * gdb.threads/step-over-lands-on-breakpoint.c: New file. * gdb.threads/step-over-lands-on-breakpoint.exp: New file. commit bcf83b2a66f0d968b51af8357f1543523ef83470 Author: Nick Clifton <nickc@redhat.com> Date: Thu Mar 20 13:15:12 2014 +0000 An off-by-one error in the code to catch bogus vn_next fields meant that linker testsuite failures were showing up for the cris target. Fixed by this patch. * readelf.c (process_version_sections): Fix off-by-one error in previous delta. commit 97323ad11305610185a0265392cabcd37510f50e Author: Will Newton <will.newton@linaro.org> Date: Fri Jan 10 14:38:58 2014 +0000 bfd/elf32-arm.c: Set st_value to zero for undefined symbols Unless pointer_equality_needed is set then set st_value to be zero for undefined symbols. bfd/ChangeLog: 2014-03-20 Will Newton <will.newton@linaro.org> PR ld/16715 * elf32-arm.c (elf32_arm_check_relocs): Set pointer_equality_needed for absolute references within executable links. (elf32_arm_finish_dynamic_symbol): Set st_value to zero unless pointer_equality_needed is set. ld/testsuite/ChangeLog: 2014-03-20 Will Newton <will.newton@linaro.org> * ld-arm/ifunc-14.rd: Update symbol values. commit e1f8f1b3af798e8af99bffdb695f74c6c916d150 Author: Alan Modra <amodra@gmail.com> Date: Thu Mar 20 09:32:15 2014 +1030 daily update ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 9 + bfd/elf32-arm.c | 7 +- bfd/version.h | 2 +- binutils/ChangeLog | 5 + binutils/readelf.c | 2 +- gas/ChangeLog | 50 ++ gas/config/rl78-defs.h | 3 + gas/config/rl78-parse.y | 18 +- gas/config/tc-mips.c | 48 +- gas/config/tc-mips.h | 5 + gas/config/tc-rl78.c | 494 ++++++++++++- gas/config/tc-rl78.h | 3 + gas/config/tc-xtensa.c | 558 ++++++++++++++- gas/config/tc-xtensa.h | 5 + gas/doc/as.texinfo | 1 + gas/doc/c-xtensa.texi | 92 +++ gas/frags.c | 15 + gas/frags.h | 3 + gas/testsuite/ChangeLog | 30 + gas/testsuite/gas/all/gas.exp | 2 +- gas/testsuite/gas/i386/avx512f-intel.d | 64 +- gas/testsuite/gas/i386/avx512f.s | 32 +- gas/testsuite/gas/i386/avx512pf-intel.d | 64 +- gas/testsuite/gas/i386/avx512pf.s | 32 +- gas/testsuite/gas/i386/x86-64-avx512f-intel.d | 64 +- gas/testsuite/gas/i386/x86-64-avx512f.s | 32 +- gas/testsuite/gas/i386/x86-64-avx512pf-intel.d | 64 +- gas/testsuite/gas/i386/x86-64-avx512pf.s | 32 +- gas/testsuite/gas/mips/lui-2.l | 2 +- gas/testsuite/gas/mips/mips.exp | 9 + gas/testsuite/gas/mips/pcrel-1.d | 14 + gas/testsuite/gas/mips/pcrel-1.s | 13 + gas/testsuite/gas/mips/pcrel-2.d | 8 + gas/testsuite/gas/mips/pcrel-2.s | 7 + gas/testsuite/gas/mips/pcrel-3.l | 7 + gas/testsuite/gas/mips/pcrel-3.s | 11 + gas/testsuite/gas/mips/pcrel-4-32.d | 18 + gas/testsuite/gas/mips/pcrel-4-64.d | 21 + gas/testsuite/gas/mips/pcrel-4-n32.d | 13 + gas/testsuite/gas/mips/pcrel-4.s | 6 + gas/testsuite/gas/xtensa/all.exp | 1 + gas/testsuite/gas/xtensa/trampoline.d | 26 + gas/testsuite/gas/xtensa/trampoline.s | 21 + gdb/ChangeLog | 158 ++++ gdb/break-catch-throw.c | 37 +- gdb/breakpoint.c | 25 +- gdb/breakpoint.h | 13 + gdb/build-id.c | 137 +++- gdb/build-id.h | 5 + gdb/ctf.c | 16 +- gdb/darwin-nat.c | 5 +- gdb/doc/ChangeLog | 8 + gdb/doc/gdb.texinfo | 60 +- gdb/extension.c | 3 +- gdb/fbsd-nat.c | 18 +- gdb/infcall.c | 10 + gdb/infcmd.c | 15 +- gdb/inferior.h | 6 + gdb/infrun.c | 783 ++++++++++---------- gdb/linux-nat.c | 18 +- gdb/mi/mi-interp.c | 2 +- gdb/nbsd-nat.c | 18 +- gdb/probe.c | 3 +- gdb/remote.c | 132 ++++- gdb/solib-svr4.c | 63 +-- gdb/solib.c | 97 +-- gdb/solib.h | 4 +- gdb/solist.h | 7 +- gdb/target.c | 138 ---- gdb/testsuite/ChangeLog | 65 ++ gdb/testsuite/gdb.base/attach.exp | 49 ++ .../condbreak-call-false.c} | 26 +- gdb/testsuite/gdb.base/condbreak-call-false.exp | 33 + .../{gdb.server => gdb.base}/solib-mismatch-lib.c | 0 .../solib-mismatch-libmod.c | 0 .../{gdb.server => gdb.base}/solib-mismatch.c | 0 .../{gdb.server => gdb.base}/solib-mismatch.exp | 44 +- gdb/testsuite/gdb.base/watchpoint.exp | 13 +- gdb/testsuite/gdb.cp/annota2.exp | 3 - gdb/testsuite/gdb.cp/annota3.exp | 3 - gdb/testsuite/gdb.guile/guile.exp | 7 + gdb/testsuite/gdb.python/python.exp | 7 + ...ver-bp-other-thread.c => multiple-step-overs.c} | 60 +-- gdb/testsuite/gdb.threads/multiple-step-overs.exp | 80 ++ .../signal-while-stepping-over-bp-other-thread.c | 31 +- .../signal-while-stepping-over-bp-other-thread.exp | 16 +- .../step-over-lands-on-breakpoint.c} | 65 +- .../gdb.threads/step-over-lands-on-breakpoint.exp | 62 ++ .../gdb.threads/step-over-trips-on-watchpoint.c | 67 ++ .../gdb.threads/step-over-trips-on-watchpoint.exp | 90 +++ gdb/testsuite/gdb.threads/thread-specific.exp | 20 +- gdb/top.c | 4 +- gdb/tracefile-tfile.c | 16 +- gdb/tracepoint.c | 15 - gdb/tracepoint.h | 9 - ld/ChangeLog | 10 + ld/emultempl/pe.em | 18 +- ld/ld.texinfo | 11 +- ld/testsuite/ChangeLog | 8 + ld/testsuite/ld-arm/ifunc-14.rd | 4 +- ld/testsuite/ld-elf/merge.d | 2 +- opcodes/ChangeLog | 7 + opcodes/i386-dis-evex.h | 16 +- opcodes/i386-dis.c | 32 +- opcodes/i386-opc.tbl | 16 +- opcodes/i386-tbl.h | 16 +- 106 files changed, 3372 insertions(+), 1247 deletions(-) create mode 100644 gas/testsuite/gas/mips/pcrel-1.d create mode 100644 gas/testsuite/gas/mips/pcrel-1.s create mode 100644 gas/testsuite/gas/mips/pcrel-2.d create mode 100644 gas/testsuite/gas/mips/pcrel-2.s create mode 100644 gas/testsuite/gas/mips/pcrel-3.l create mode 100644 gas/testsuite/gas/mips/pcrel-3.s create mode 100644 gas/testsuite/gas/mips/pcrel-4-32.d create mode 100644 gas/testsuite/gas/mips/pcrel-4-64.d create mode 100644 gas/testsuite/gas/mips/pcrel-4-n32.d create mode 100644 gas/testsuite/gas/mips/pcrel-4.s create mode 100644 gas/testsuite/gas/xtensa/trampoline.d create mode 100644 gas/testsuite/gas/xtensa/trampoline.s copy gdb/testsuite/{gdb.server/solib-mismatch-lib.c => gdb.base/condbreak-call-false.c} (78%) create mode 100644 gdb/testsuite/gdb.base/condbreak-call-false.exp rename gdb/testsuite/{gdb.server => gdb.base}/solib-mismatch-lib.c (100%) rename gdb/testsuite/{gdb.server => gdb.base}/solib-mismatch-libmod.c (100%) copy gdb/testsuite/{gdb.server => gdb.base}/solib-mismatch.c (100%) rename gdb/testsuite/{gdb.server => gdb.base}/solib-mismatch.exp (76%) copy gdb/testsuite/gdb.threads/{signal-while-stepping-over-bp-other-thread.c => multiple-step-overs.c} (69%) create mode 100644 gdb/testsuite/gdb.threads/multiple-step-overs.exp rename gdb/testsuite/{gdb.server/solib-mismatch.c => gdb.threads/step-over-lands-on-breakpoint.c} (50%) create mode 100644 gdb/testsuite/gdb.threads/step-over-lands-on-breakpoint.exp create mode 100644 gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.c create mode 100644 gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 40f3bed..c60d19d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2014-03-20 Will Newton <will.newton@linaro.org> + + PR ld/16715 + * elf32-arm.c (elf32_arm_check_relocs): Set + pointer_equality_needed for absolute references within + executable links. + (elf32_arm_finish_dynamic_symbol): Set st_value to zero + unless pointer_equality_needed is set. + 2014-03-19 Nick Clifton <nickc@redhat.com> * peXXigen.c (rsrc_process_section): Add code to scan input diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 1aae31b..81be93f 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -12800,6 +12800,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, /* Fall through. */ case R_ARM_ABS32: case R_ARM_ABS32_NOI: + if (h != NULL && info->executable) + { + h->pointer_equality_needed = 1; + } + /* Fall through. */ case R_ARM_REL32: case R_ARM_REL32_NOI: case R_ARM_MOVW_PREL_NC: @@ -14165,7 +14170,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, Otherwise, the PLT entry would provide a definition for the symbol even if the symbol wasn't defined anywhere, and so the symbol would never be NULL. */ - if (!h->ref_regular_nonweak) + if (!h->ref_regular_nonweak || !h->pointer_equality_needed) sym->st_value = 0; } else if (eh->is_iplt && eh->plt.noncall_refcount != 0) diff --git a/bfd/version.h b/bfd/version.h index 7c2bc25..3306660 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20140319 +#define BFD_VERSION_DATE 20140324 #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 03a1e18..0f2707b 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2014-03-20 Nick Clifton <nickc@redhat.com> + + * readelf.c (process_version_sections): Fix off-by-one error in + previous delta. + 2014-03-19 Nick Clifton <nickc@redhat.com> PR binutils/16723 diff --git a/binutils/readelf.c b/binutils/readelf.c index 79137e3..c757a63 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -8971,7 +8971,7 @@ process_version_sections (FILE * file) if (j < ent.vn_cnt) warn (_("Missing Version Needs auxillary information\n")); - if (ent.vn_next == 0 && cnt < section->sh_info) + if (ent.vn_next == 0 && cnt < section->sh_info - 1) { warn (_("Corrupt Version Needs structure - offset to next structure is zero with entries still left to be processed\n")); cnt = section->sh_info; diff --git a/gas/ChangeLog b/gas/ChangeLog index f232916..ef4b686 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,53 @@ +2014-03-21 David Weatherford <weath@cadence.com> + Max Filippov <jcmvbkbc@gmail.com> + + * config/tc-xtensa.c (xtensa_check_frag_count) + xtensa_create_trampoline_frag, + xtensa_maybe_create_trampoline_frag, init_trampoline_frag, + find_trampoline_seg, search_trampolines, get_best_trampoline, + check_and_update_trampolines, add_jump_to_trampoline, + dump_trampolines): New functions. + (md_parse_option): Add cases for --[no-]trampolines options. + (md_assemble, finish_vinsn, xtensa_end): Add call to + xtensa_check_frag_count. + (xg_assemble_vliw_tokens): Add call to + xtensa_maybe_create_trampoline_frag. + (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state. + (relax_frag_immed): Relax jump instructions that cannot reach its + target. + * config/tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New + relax state. + * doc/as.texinfo: Document --[no-]trampolines command-line options. + * doc/c-xtensa.texi: Document trampolines relaxation and command + line options. + * frags.c (get_frag_count, clear_frag_count): New function. + (frag_alloc): Increment totalfrags counter. + * frags.h (get_frag_count, clear_frag_count): New function. + +2014-03-20 DJ Delorie <dj@redhat.com> + + * config/rl78-defs.h (RL78_RELAX_NONE, RL78_RELAX_BRANCH): Add. + * config/rl78-parse.y (BC, BNC, BZ, BNZ, BH, BHZ, bt_bf): Call + rl78_relax(). + * config/tc-rl78.h (md_relax_frag): Define. + (rl78_relax_frag): Declare. + * config/tc-rl78.c (rl78_relax): Add. + (md_assemble): Set up the variable frags also when relaxing. + (op_type_T): New. + (rl78_opcode_type): New. + (rl78_frag_fix_value): New. + (md_estimate_size_before_relax): New-ish. + (rl78_relax_frag): New. + (md_convert_frag): New-ish. + +2014-03-20 Richard Sandiford <rdsandiford@googlemail.com> + + * config/tc-mips.h (DIFF_EXPR_OK, CFI_DIFF_EXPR_OK): Define. + * config/tc-mips.c (md_pcrel_from): Remove error message. + (md_apply_fix): Convert PC-relative BFD_RELOC_32s to + BFD_RELOC_32_PCREL. Report a specific error message for unhandled + PC-relative expressions. Handle BFD_RELOC_8. + 2014-03-19 Jose E. Marchesi <jose.marchesi@oracle.com> * config/tc-sparc.c (hpriv_reg_table): Added entries for diff --git a/gas/config/rl78-defs.h b/gas/config/rl78-defs.h index e416706..0af8874 100644 --- a/gas/config/rl78-defs.h +++ b/gas/config/rl78-defs.h @@ -25,6 +25,9 @@ #define RL78REL_DATA 0 #define RL78REL_PCREL 1 +#define RL78_RELAX_NONE 0 +#define RL78_RELAX_BRANCH 1 + extern int rl78_error (const char *); extern void rl78_lex_init (char *, char *); extern void rl78_prefix (int); diff --git a/gas/config/rl78-parse.y b/gas/config/rl78-parse.y index 1ef3c8d..e358a27 100644 --- a/gas/config/rl78-parse.y +++ b/gas/config/rl78-parse.y @@ -290,22 +290,22 @@ statement : /* ---------------------------------------------------------------------- */ | BC '$' EXPR - { B1 (0xdc); PC1 ($3); } + { B1 (0xdc); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } | BNC '$' EXPR - { B1 (0xde); PC1 ($3); } + { B1 (0xde); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } | BZ '$' EXPR - { B1 (0xdd); PC1 ($3); } + { B1 (0xdd); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } | BNZ '$' EXPR - { B1 (0xdf); PC1 ($3); } + { B1 (0xdf); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } | BH '$' EXPR - { B2 (0x61, 0xc3); PC1 ($3); } + { B2 (0x61, 0xc3); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } | BNH '$' EXPR - { B2 (0x61, 0xd3); PC1 ($3); } + { B2 (0x61, 0xd3); PC1 ($3); rl78_relax (RL78_RELAX_BRANCH, 0); } /* ---------------------------------------------------------------------- */ @@ -1153,12 +1153,12 @@ addsubw : ADDW { $$ = 0x00; } ; andor1 : AND1 { $$ = 0x05; rl78_bit_insn = 1; } - | OR1 { $$ = 0x06; rl78_bit_insn = 1;} + | OR1 { $$ = 0x06; rl78_bit_insn = 1; } | XOR1 { $$ = 0x07; rl78_bit_insn = 1; } ; -bt_bf : BT { $$ = 0x02; rl78_bit_insn = 1;} - | BF { $$ = 0x04; rl78_bit_insn = 1; } +bt_bf : BT { $$ = 0x02; rl78_bit_insn = 1; rl78_relax (RL78_RELAX_BRANCH, 0); } + | BF { $$ = 0x04; rl78_bit_insn = 1; rl78_relax (RL78_RELAX_BRANCH, 0); } | BTCLR { $$ = 0x00; rl78_bit_insn = 1; } ; diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 74c7a10..318b0b5 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -14057,15 +14057,7 @@ md_pcrel_from (fixS *fixP) /* Return the address of the delay slot. */ return addr + 4; - case BFD_RELOC_32_PCREL: - return addr; - default: - /* We have no relocation type for PC relative MIPS16 instructions. */ - if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != now_seg) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("PC relative MIPS16 instruction references" - " a different section")); return addr; } } @@ -14262,13 +14254,38 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) unsigned long insn; reloc_howto_type *howto; - /* We ignore generic BFD relocations we don't know about. */ - howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); - if (! howto) - return; + if (fixP->fx_pcrel) + switch (fixP->fx_r_type) + { + case BFD_RELOC_16_PCREL_S2: + case BFD_RELOC_MICROMIPS_7_PCREL_S1: + case BFD_RELOC_MICROMIPS_10_PCREL_S1: + case BFD_RELOC_MICROMIPS_16_PCREL_S1: + case BFD_RELOC_32_PCREL: + break; + + case BFD_RELOC_32: + fixP->fx_r_type = BFD_RELOC_32_PCREL; + break; + + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("PC-relative reference to a different section")); + break; + } + + /* Handle BFD_RELOC_8, since it's easy. Punt on other bfd relocations + that have no MIPS ELF equivalent. */ + if (fixP->fx_r_type != BFD_RELOC_8) + { + howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); + if (!howto) + return; + } gas_assert (fixP->fx_size == 2 || fixP->fx_size == 4 + || fixP->fx_r_type == BFD_RELOC_8 || fixP->fx_r_type == BFD_RELOC_16 || fixP->fx_r_type == BFD_RELOC_64 || fixP->fx_r_type == BFD_RELOC_CTOR @@ -14280,12 +14297,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) buf = fixP->fx_frag->fr_literal + fixP->fx_where; - gas_assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2 - || fixP->fx_r_type == BFD_RELOC_MICROMIPS_7_PCREL_S1 - || fixP->fx_r_type == BFD_RELOC_MICROMIPS_10_PCREL_S1 - || fixP->fx_r_type == BFD_RELOC_MICROMIPS_16_PCREL_S1 - || fixP->fx_r_type == BFD_RELOC_32_PCREL); - /* Don't treat parts of a composite relocation as done. There are two reasons for this: @@ -14435,6 +14446,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_32: case BFD_RELOC_32_PCREL: case BFD_RELOC_16: + case BFD_RELOC_8: /* If we are deleting this reloc entry, we must fill in the value now. This can happen if we have a .word which is not resolved when it appears but is later defined. */ diff --git a/gas/config/tc-mips.h b/gas/config/tc-mips.h index 97627df..510e811 100644 --- a/gas/config/tc-mips.h +++ b/gas/config/tc-mips.h @@ -189,4 +189,9 @@ extern int tc_mips_regname_to_dw2regnum (char *regname); #define DWARF2_DEFAULT_RETURN_COLUMN 31 #define DWARF2_CIE_DATA_ALIGNMENT (-4) +#define DIFF_EXPR_OK +/* We define DIFF_EXPR_OK because of R_MIPS_PC32, but we have no + 64-bit form for n64 CFIs. */ +#define CFI_DIFF_EXPR_OK 0 + #endif /* TC_MIPS */ diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c index 04c9b2c..962a0b0 100644 --- a/gas/config/tc-rl78.c +++ b/gas/config/tc-rl78.c @@ -86,6 +86,15 @@ typedef struct rl78_bytesT static rl78_bytesT rl78_bytes; void +rl78_relax (int type, int pos) +{ + rl78_bytes.relax[rl78_bytes.n_relax].type = type; + rl78_bytes.relax[rl78_bytes.n_relax].field_pos = pos; + rl78_bytes.relax[rl78_bytes.n_relax].val_ofs = rl78_bytes.n_base + rl78_bytes.n_ops; + rl78_bytes.n_relax ++; +} + +void rl78_linkrelax_addr16 (void) { rl78_bytes.link_relax |= RL78_RELAXA_ADDR16; @@ -486,12 +495,13 @@ md_assemble (char * str) rl78_parse (); /* This simplifies the relaxation code. */ - if (rl78_bytes.link_relax) + if (rl78_bytes.n_relax || rl78_bytes.link_relax) { int olen = rl78_bytes.n_prefix + rl78_bytes.n_base + rl78_bytes.n_ops; /* We do it this way because we want the frag to have the - rl78_bytes in it, which we initialize above. */ - bytes = frag_more (olen); + rl78_bytes in it, which we initialize above. The extra bytes + are for relaxing. */ + bytes = frag_more (olen + 3); frag_then = frag_now; frag_variant (rs_machine_dependent, olen /* max_chars */, @@ -638,13 +648,478 @@ rl78_cons_fix_new (fragS * frag, } } -/* No relaxation just yet */ +\f +/*----------------------------------------------------------------------*/ +/* To recap: we estimate everything based on md_estimate_size, then + adjust based on rl78_relax_frag. When it all settles, we call + md_convert frag to update the bytes. The relaxation types and + relocations are in fragP->tc_frag_data, which is a copy of that + rl78_bytes. + + Our scheme is as follows: fr_fix has the size of the smallest + opcode (like BRA.S). We store the number of total bytes we need in + fr_subtype. When we're done relaxing, we use fr_subtype and the + existing opcode bytes to figure out what actual opcode we need to + put in there. If the fixup isn't resolvable now, we use the + maximal size. */ + +#define TRACE_RELAX 0 +#define tprintf if (TRACE_RELAX) printf + + +typedef enum +{ + OT_other, + OT_bt, + OT_bt_sfr, + OT_bt_es, + OT_bc, + OT_bh +} op_type_T; + +/* We're looking for these types of relaxations: + + BT 00110001 sbit0cc1 addr---- (cc is 10 (BF) or 01 (BT)) + B~T 00110001 sbit0cc1 00000011 11101110 pcrel16- -------- (BR $!pcrel20) + + BT sfr 00110001 sbit0cc0 sfr----- addr---- + BT ES: 00010001 00101110 sbit0cc1 addr---- + + BC 110111cc addr---- + B~C 110111cc 00000011 11101110 pcrel16- -------- (BR $!pcrel20) + + BH 01100001 110c0011 00000011 11101110 pcrel16- -------- (BR $!pcrel20) + B~H 01100001 110c0011 00000011 11101110 pcrel16- -------- (BR $!pcrel20) +*/ + +/* Given the opcode bytes at OP, figure out which opcode it is and + return the type of opcode. We use this to re-encode the opcode as + a different size later. */ + +static op_type_T +rl78_opcode_type (char * op) +{ + if (op[0] == 0x31 + && ((op[1] & 0x0f) == 0x05 + || (op[1] & 0x0f) == 0x03)) + return OT_bt; + + if (op[0] == 0x31 + && ((op[1] & 0x0f) == 0x04 + || (op[1] & 0x0f) == 0x02)) + return OT_bt_sfr; + + if (op[0] == 0x11 + && op[1] == 0x31 + && ((op[2] & 0x0f) == 0x05 + || (op[2] & 0x0f) == 0x03)) + return OT_bt_es; + + if ((op[0] & 0xfc) == 0xdc) + return OT_bc; + + if (op[0] == 0x61 + && (op[1] & 0xef) == 0xc3) + return OT_bh; + + return OT_other; +} + +/* Returns zero if *addrP has the target address. Else returns nonzero + if we cannot compute the target address yet. */ + +static int +rl78_frag_fix_value (fragS * fragP, + segT segment, + int which, + addressT * addrP, + int need_diff, + addressT * sym_addr) +{ + addressT addr = 0; + rl78_bytesT * b = fragP->tc_frag_data; + expressionS * exp = & b->fixups[which].exp; + + if (need_diff && exp->X_op != O_subtract) + return 1; + + if (exp->X_add_symbol) + { + if (S_FORCE_RELOC (exp->X_add_symbol, 1)) + return 1; + if (S_GET_SEGMENT (exp->X_add_symbol) != segment) + return 1; + addr += S_GET_VALUE (exp->X_add_symbol); + } + + if (exp->X_op_symbol) + { + if (exp->X_op != O_subtract) + return 1; + if (S_FORCE_RELOC (exp->X_op_symbol, 1)) + return 1; + if (S_GET_SEGMENT (exp->X_op_symbol) != segment) + return 1; + addr -= S_GET_VALUE (exp->X_op_symbol); + } + if (sym_addr) + * sym_addr = addr; + addr += exp->X_add_number; + * addrP = addr; + return 0; +} + +/* Estimate how big the opcode is after this relax pass. The return + value is the difference between fr_fix and the actual size. We + compute the total size in rl78_relax_frag and store it in fr_subtype, + sowe only need to subtract fx_fix and return it. */ + int md_estimate_size_before_relax (fragS * fragP ATTRIBUTE_UNUSED, segT segment ATTRIBUTE_UNUSED) { - return 0; + int opfixsize; + int delta; + + /* This is the size of the opcode that's accounted for in fr_fix. */ + opfixsize = fragP->fr_fix - (fragP->fr_opcode - fragP->fr_literal); + /* This is the size of the opcode that isn't. */ + delta = (fragP->fr_subtype - opfixsize); + + tprintf (" -> opfixsize %d delta %d\n", opfixsize, delta); + return delta; +} + +/* Given the new addresses for this relax pass, figure out how big + each opcode must be. We store the total number of bytes needed in + fr_subtype. The return value is the difference between the size + after the last pass and the size after this pass, so we use the old + fr_subtype to calculate the difference. */ + +int +rl78_relax_frag (segT segment ATTRIBUTE_UNUSED, fragS * fragP, long stretch) +{ + addressT addr0, sym_addr; + addressT mypc; + int disp; + int oldsize = fragP->fr_subtype; + int newsize = oldsize; + op_type_T optype; + int ri; + + mypc = fragP->fr_address + (fragP->fr_opcode - fragP->fr_literal); + hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2014-03-24 3:33 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20140324033324.9599.qmail@sourceware.org \ --to=jkratoch@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).