From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34879 invoked by alias); 1 Jul 2017 15:25:04 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 34853 invoked by uid 9674); 1 Jul 2017 15:25:04 -0000 Date: Sat, 01 Jul 2017 15:25:00 -0000 Message-ID: <20170701152503.34781.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] users/jkratoch/index: addons X-Git-Refname: refs/heads/users/jkratoch/index X-Git-Reftype: branch X-Git-Oldrev: 2e95764753977d499d61d925a0886c0b4f19102f X-Git-Newrev: e1fd680ae2861d484d0747145d5bcc5cbb706e63 X-SW-Source: 2017-q3/txt/msg00000.txt.bz2 List-Id: The branch, users/jkratoch/index has been updated discards 2e95764753977d499d61d925a0886c0b4f19102f (commit) discards d60714a3a1e2329fab05042bd3be248ddaf20d98 (commit) discards 6d34e133d6c5081761aea128791fe8c11a654fa5 (commit) discards 0cece0b84e139eefe775579aa194bacea9bc0f10 (commit) discards 17b528bc016dd508ebc7baf01808c33c7610d575 (commit) discards 53c0ab91b7e4b657b9d43be08dfcd323adec5c48 (commit) discards 4cca419b6d63715cf03067abcc7de1cdc01882a6 (commit) via e1fd680ae2861d484d0747145d5bcc5cbb706e63 (commit) via f721e806396f0ff007be23413a21ac4c8522590d (commit) via 04f63cd7971a2bad4f510c3c2d3edd0a549c8348 (commit) via 0c0bc5c2d282a9da9c0550a13070b01f17defc52 (commit) via 0aec2cadcd390a01247a2901857522b3981ddc7f (commit) via 3ea411627f2af02d42d0558b941388ec525593a3 (commit) via b09b8eacd79aa18470e561a03ceabbb06f166143 (commit) via 7e2a2c42cc2ac9329d59b7b02c8b9baffa94ae6a (commit) via 6ec52fc4a70b6a211f5d6f566ead3dddedcc306a (commit) via 3c465ea0ffd372bfc7f07eccef4c0b1bd22efc71 (commit) via 834a65aadfda9755d8bd6ec76ba8b3a6d20a1beb (commit) via bbd27b7684baf424bdaa7f0a1d39a2cd5b0d6134 (commit) via 9f00292e69635d48623372c7a3e390dc5d159a8f (commit) via 32f76c677333510350f21a40db062a8d17995c53 (commit) via 33f466961ce01a7db6dbec6b39aafb7af1855645 (commit) via b1d3c886aa30083236bf60c50d519bcc978139fb (commit) via dc4bde35d16df749e529229657b3468417937cfc (commit) via 51ed89aa0dce3db46561235efdc4bbc0661bcf37 (commit) via 60a02042bacf8d25814430080adda61ed086bca6 (commit) via 4151f6842850876e93c8e5d870d7c9147065788d (commit) via 909b4e3d5fb8579b3721651c9e64a11e7ec27e5f (commit) via f5b2fd523f8f180e11f77b84a107279c562672cd (commit) via 9785fc2a4d220322ce6cd1d79e768345ea5234d2 (commit) via 8d011e87dfa4e1719bd909b9adcbd1a0f5a75228 (commit) via 60804c53a0c365f0802e90c12dfcbe6696b861fe (commit) via 92cebb3dbea282bbf7357ed2f3f03bc92fee8c7b (commit) via 3df5cd139455a1448de00e1e173f3ce566a25a48 (commit) via eb17d4137dc83a373b8968cd20b256fa8073a4ca (commit) via 195bcdd5183f2c137399db23a68a26a4e4193f8f (commit) via 2e74f9dd8ae79ddfe7f0f84b890c962016fc8f15 (commit) via e1e94c4994151ebe0e3a103fd0d27f60bd806bbe (commit) via adc764e7d217d3e56af988ce20cedc98d8c4cc73 (commit) via ec1acaba1381d0196c45965a7db9942b67fbd88d (commit) via ff07562f1e369b6e37eafb2a888dc48fa2453e86 (commit) via 2aff25ba76035d2f1f48ea8a6c4b7e498ee31790 (commit) via 88ab90e860a46a1123fcfd13bfe51cd360e9c3f7 (commit) via 1b19ec971047a074486e6b775dc1969aa13f30fb (commit) from 2e95764753977d499d61d925a0886c0b4f19102f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit e1fd680ae2861d484d0747145d5bcc5cbb706e63 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 addons commit f721e806396f0ff007be23413a21ac4c8522590d Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 bfd5 commit 04f63cd7971a2bad4f510c3c2d3edd0a549c8348 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 DWARF-5: .debug_names index consumer Hi, it is not regression-free against no-index but it is regression-free against .gdb_index. That is because .gdb_index is not regression-free against no-index. Some testcases needed to be updated as they were missing .debug_aranges. While that does not matter for no-index (as GDB builds the mapping internally during dwarf2_build_psymtabs_hard) and neither for .gdb_index (as GDB uses that internally built mapping which it stores into .gdb_index) it does matter for .debug_names as that simply assumes existing .debug_aranges from GCC. I tried some performance checking but the index handling speed is negligible compared to the CU expansion associated with it. .debug_names looked even as a bit faster to me than .gdb_index which rather surprised me but I did not investigate it more. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * defs.h (elf_sym_fns_debug_names): New declaration. * dwarf2read.c (mapped_debug_names): New. (struct dwarf2_per_objfile): Add debug_names, debug_aranges and debug_names_table. (dwarf2_elf_names): Add debug_names and debug_aranges. (struct dwz_file): Add debug_names. (dwarf2_locate_sections): Add debug_names and debug_aranges. (locate_dwz_sections): Add debug_names. (create_signatured_type_table_from_debug_names) (create_addrmap_from_aranges): New. (dwarf2_read_index): Update function comment. (read_debug_names_from_section, create_cus_from_debug_names_list) (create_cus_from_debug_names, dwarf2_read_debug_names): New. (dwarf5_djb_hash): Function renamed from DebugNamesNameTable::djb_hash. (dw2_debug_names_iterator): New. (read_indirect_string_at_offset): New declaration. (mapped_debug_names::namei_to_name) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::find_vec_in_debug_names) (dw2_debug_names_iterator::next, dw2_debug_names_lookup_symbol) (dw2_debug_names_dump, dw2_debug_names_expand_symtabs_for_function) (dw2_debug_names_expand_symtabs_matching, dwarf2_debug_names_functions): New. (dwarf2_initialize_objfile): Return also elf_sym_fns_debug_names. (dwarf2_free_objfile): Delete also debug_names_table; (debug_names::djb_hash): Rename it to dwarf5_djb_hash. (debug_names::build): Update djb_hash caller. * elfread.c (elf_sym_fns_debug_names): New. * psymtab.h (dwarf2_debug_names_functions): New declaration. * symfile.h (struct dwarf2_debug_sections): Add debug_names and debug_aranges. * xcoffread.c (dwarf2_xcoff_names): Add debug_names and debug_aranges. gdb/testsuite/ChangeLog 2017-05-26 Jan Kratochvil * gdb.base/maint.exp (check for .gdb_index): Check also for .debug_names. * gdb.dlang/watch-loc.c (.debug_aranges): New. * gdb.dwarf2/dw2-case-insensitive-debug.S: Likewise. * gdb.dwarf2/gdb-index.exp (check if index present, .gdb_index used) (.gdb_index used after symbol reloading): Support also .debug_names. * gdb.mi/dw2-ref-missing-frame-func.c (.debug_aranges): New. commit 0c0bc5c2d282a9da9c0550a13070b01f17defc52 Author: Jan Kratochvil Date: Sat Jul 1 17:24:41 2017 +0200 Refactor: Move some generic code out of .gdb_index code Hi, just for the next patch. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * dwarf2read.c (create_cu_from_index_list): New from ... (create_cus_from_index_list): ... this function, use it. (dw_expand_symtabs_matching_file_matcher) (dw2_expand_symtabs_matching_one): New from ... (dw2_expand_symtabs_matching): ... this function, use them. commit 0aec2cadcd390a01247a2901857522b3981ddc7f Author: Jan Kratochvil Date: Sat Jul 1 17:24:40 2017 +0200 Code cleanup: dwarf2_initialize_objfile return value Hi, dwarf2_initialize_objfile was returning boolean whether it is psymtabs or .gdb_index while now it needs to return also whether it is .debug_names. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * defs.h (elf_sym_fns_lazy_psyms, elf_sym_fns_gdb_index): Move here declarations from elfread.c. (dwarf2_initialize_objfile): Change return value. * elfread.c (elf_sym_fns_lazy_psyms, elf_sym_fns_gdb_index): Move these declarations to defs.h. (elf_symfile_read): Adjust dwarf2_initialize_objfile caller. * symfile.h (dwarf2_initialize_objfile): Change return type. commit 3ea411627f2af02d42d0558b941388ec525593a3 Author: Jan Kratochvil Date: Sat Jul 1 17:24:40 2017 +0200 DWARF-5: .debug_names index producer Hi, there are two FIXME lines I do not have a real answer for. Also I am not sure if the -dwarf-4 option for former .gdb_index should be named that way. And contrib/gdb-add-index.sh (incl. cc-with-tweaks.sh) has no commandline option for that -dwarf-4 GDB option. Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * contrib/gdb-add-index.sh (index): Rename to ... (index4): ... here. (index5, debugstr, debugstrmerge, debugstrerr): New variables. Support also .debug_names and .debug_str. * dwarf2read.c: Include cmath, locale, set, list. (INDEX_SUFFIX): Rename to ... (INDEX4_SUFFIX): ... here. (INDEX5_SUFFIX, DEBUG_STR_SUFFIX): New. (file_write, file_write, file_write): New. (data_buf::append_unsigned_leb128, data_buf::empty): New. (data_buf::file_write): Use ::file_write. (data_buf::operator const char *, debug_names, check_dwarf64_offsets): New. (psyms_seen_size, write_gdbindex): New from write_psymtabs_to_index code. (write_debug_names): New. (write_psymtabs_to_index): New parameter is_dwarf5. Support filename_str and out_file_str. Move code to write_gdbindex, possibly call write_debug_names. (save_gdb_index_command): New parameter -dwarf-4. (_initialize_dwarf2_read): Document the new parameter -dwarf-4. gdb/doc/ChangeLog 2017-05-26 Jan Kratochvil * gdb.texinfo (Index Files): Document .debug_names and -dwarf-4. (Index Section Format): Mention .debug_names. commit b09b8eacd79aa18470e561a03ceabbb06f166143 Author: Jan Kratochvil Date: Sat Jul 1 17:24:40 2017 +0200 cc-with-tweaks.sh: Use gdb-add-index.sh Hi, currently contrib/cc-with-tweaks.sh is calling for its -i option objcopy itself instead of using contrib/gdb-add-index.sh which does the same. With DWARF-5 .debug_names the commands are more complicated (as now also .debug_str needs to be modified) and so I have decided to rather reuse contrib/gdb-add-index.sh instead of duplicating its code in contrib/cc-with-tweaks.sh. The problem is when no index is produced whether contrib/cc-with-tweaks.sh should fail or not. As originally contrib/cc-with-tweaks.sh was more quiet (=successful) than contrib/gdb-add-index.sh and so after this patch the testsuite runs with an index would "regress". I have tried to keep the behavior unchanged. Some cases still error with: Ada is not currently supported by the index But some cases (such as some trivial gdb.dwarf2/ testcases with no DWARF data to index) produce no index while the testcases still PASS now instead of: -PASS: gdb.arch/i386-bp_permanent.exp: stack pointer value matches +gdb compile failed, gdb-add-index.sh: No index was created for /quadgdb/testsuite.unix.-m64/outputs/gdb.arch/i386-bp_permanent/i386-bp_permanent +gdb-add-index.sh: [Was there no debuginfo? Was there already an index?] +UNTESTED: gdb.arch/i386-bp_permanent.exp: failed to compile Jan gdb/ChangeLog 2017-05-26 Jan Kratochvil * contrib/cc-with-tweaks.sh: Change interpreter to bash, incl. initial comment. (t, GDB_ADD_INDEX): New variables. <$want_index>: Call $GDB_ADD_INDEX. commit 7e2a2c42cc2ac9329d59b7b02c8b9baffa94ae6a Author: Jan Kratochvil Date: Sat Jul 1 17:24:39 2017 +0200 binutils commit 6ec52fc4a70b6a211f5d6f566ead3dddedcc306a Author: Jan Kratochvil Date: Sat Jul 1 17:24:39 2017 +0200 gccidx commit 3c465ea0ffd372bfc7f07eccef4c0b1bd22efc71 Author: GDB Administrator Date: Sat Jul 1 00:00:41 2017 +0000 Automatic date update in version.in commit 834a65aadfda9755d8bd6ec76ba8b3a6d20a1beb Author: Maciej W. Rozycki Date: Sat Jul 1 00:42:19 2017 +0100 MIPS/GAS: Use a switch on relaxation type in microMIPS fixup creation Use a switch on the relaxation type rather than a chain of conditionals in microMIPS fixup creation, improving source code structure and aiding the compiler with code generation. gas/ * config/tc-mips.c (md_convert_frag): Use a switch on the microMIPS relaxation type rather than a chain of conditionals. commit bbd27b7684baf424bdaa7f0a1d39a2cd5b0d6134 Author: Maciej W. Rozycki Date: Sat Jul 1 00:42:19 2017 +0100 MIPS/GAS: Use frag symbol/offset directly in fixup creation There is no need to use a helper expression in the creation of fixups made from a frag's symbol and offset, because a simple `symbol+offset' expression can be handled directly, with the use of a `fix_new' rather than a `fix_new_exp' call. Rewrite `md_convert_frag' using `fix_new' then and remove all the unneeded helper expressions, simplifying code. gas/ * config/tc-mips.c (md_convert_frag): Rewrite `fix_new_exp' calls in terms of `fix_new'. commit 9f00292e69635d48623372c7a3e390dc5d159a8f Author: Maciej W. Rozycki Date: Sat Jul 1 00:42:19 2017 +0100 MIPS/GAS: Use non-zero frag offset directly in PIC branch relaxation Use frag symbols with a non-zero offset directly in `fix_new_exp' calls made in PIC branch relaxation. There is no need here to make a helper symbol to hold the result of a `symbol+offset' calculation requested as only branches to local symbols are relaxed and in this case the LO16 part of the PIC address load sequence will have the offset accounted for in calculation against the local GOT entry retrieved as the GOT16 high part. Consequently actual code produed is identical whether a helper symbol is used or the original `symbol+offset' expression used directly. Verify that this is indeed the case with GAS and LD tests. gas/ * config/tc-mips.c (md_convert_frag): Don't make a helper expression symbol for `fix_new_exp' called with a non-zero offset. * testsuite/gas/mips/relax-offset.d: New test. * testsuite/gas/mips/mips1@relax-offset.d: New test. * testsuite/gas/mips/r3000@relax-offset.d: New test. * testsuite/gas/mips/r3900@relax-offset.d: New test. * testsuite/gas/mips/micromips@relax-offset.d: New test. * testsuite/gas/mips/relax-offset.l: New stderr output. * testsuite/gas/mips/relax-offset.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/relax-offset.dd: New test. * testsuite/ld-mips-elf/relax-offset.gd: New test. * testsuite/ld-mips-elf/relax-offset-umips.dd: New test. * testsuite/ld-mips-elf/relax-offset-umips.gd: New test. * testsuite/ld-mips-elf/relax-offset.ld: New test linker script. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests. (prune_warnings): New temporary procedure. commit 32f76c677333510350f21a40db062a8d17995c53 Author: Georg-Johann Lay Date: Fri Jun 30 16:37:39 2017 +0100 Add support for a __gcc_isr pseudo isntruction to the AVR assembler. PR gas/21683 include * opcode/avr.h (AVR_INSN): Add one for __gcc_isr. gas * doc/c-avr.texi (AVR Options) <-mgcc-isr>: Document it. (AVR Pseudo Instructions): New node. * config/tc-avr.h (md_pre_output_hook): Define to avr_pre_output_hook. (md_undefined_symbol): Define to avr_undefined_symbol. (avr_pre_output_hook, avr_undefined_symbol): New protos. * config/tc-avr.c (struc-symbol.h): Include it. (ISR_CHUNK_Done, ISR_CHUNK_Prologue, ISR_CHUNK_Epilogue): New enums. (avr_isr, avr_gccisr_opcode) (avr_no_sreg_hash, avr_no_sreg): New static variables. (avr_opt_s) : Add field. (avr_opt): Add initializer for have_gccisr. (enum options) : Add enum. (md_longopts) <"mgcc-isr">: Add entry. (md_show_usage): Document -mgcc-isr. (md_parse_option) [OPTION_HAVE_GCCISR]: Handle it. (md_undefined_symbol): Remove. (avr_undefined_symbol, avr_pre_output_hook): New fuctions. (md_begin) : Initialize them. (avr_operand) : Add argument and set *pregno if function is called for a register constraint. [N]: Handle constraint. (avr_operands) : Pass 5th parameter to calls. [avr_opt.have_gccisr]: Call avr_update_gccisr. Call avr_gccisr_operands instead of avr_operands. (avr_update_gccisr, avr_emit_insn, avr_patch_gccisr_frag) (avr_gccisr_operands, avr_check_gccisr_done): New static functions. * testsuite/gas/avr/gccisr-01.d: New test. * testsuite/gas/avr/gccisr-01.s: New test. * testsuite/gas/avr/gccisr-02.d: New test. * testsuite/gas/avr/gccisr-02.s: New test. * testsuite/gas/avr/gccisr-03.d: New test. * testsuite/gas/avr/gccisr-03.s: New test. commit 33f466961ce01a7db6dbec6b39aafb7af1855645 Author: Maciej W. Rozycki Date: Fri Jun 30 15:39:26 2017 +0100 MIPS/GAS: Update `match_float_constant' and `match_operand' descriptions Complement commit a92713e60ef4 ("Preparse MIPS instructions into tokens"), , and update `match_float_constant' and `match_operand' function descriptions according to semantics changes. gas/ * config/tc-mips.c (match_float_constant): Update description. (match_operand): Likewise. commit b1d3c886aa30083236bf60c50d519bcc978139fb Author: Maciej W. Rozycki Date: Fri Jun 30 15:27:18 2017 +0100 MIPS/opcodes: Reorder LSA and DLSA instructions Correct an issue introduced with commit 7361da2c952e ("Add support for MIPS R6.") and move the LSA and DLSA instructions back to the MSA ASE instruction block in the regular MIPS opcode table. Adjust formatting around the "MIPS r6" heading. opcodes/ * mips-opc.c (mips_builtin_opcodes): Move "lsa" and "dlsa" entries to the MSA ASE instruction block. commit dc4bde35d16df749e529229657b3468417937cfc Author: Sergio Durigan Junior Date: Fri Jun 30 08:27:29 2017 -0400 PR cli/21688: Detect aliases when issuing python/compile/guile commands (and fix last commit) My last commit fixed a regression that happened when using inline/multi-line commands for Python/Compile/Guile, but introduced another regression: it is now not possible to use aliases for the commands mentioned above. The fix is to almost revert the change I've made and go back to using the 'struct cmd_list_element *', but at the same time make sure that we advance the 'cmd_name' variable past all the whitespace characters after the command name. If, after skipping the whitespace, we encounter a '\0', it means that the command is not inline. Otherwise, it is. This patch also expands the testcase in order to check for aliases and for trailing whitespace after the command name. gdb/ChangeLog: 2017-06-30 Sergio Durigan Junior Pedro Alves PR cli/21688 * cli/cli-script.c (command_name_equals_not_inline): Remove function. (process_next_line): New variable 'inline_cmd'. Adjust 'if' clauses for "python", "compile" and "guile" to use 'command_name_equals' and check for '!inline_cmd'. gdb/testsuite/ChangeLog: 2017-06-30 Sergio Durigan Junior PR cli/21688 * gdb.python/py-cmd.exp (test_python_inline_or_multiline): Add new tests for alias commands and trailing whitespace. commit 51ed89aa0dce3db46561235efdc4bbc0661bcf37 Author: Sergio Durigan Junior Date: Wed Jun 28 21:55:03 2017 -0400 PR cli/21688: Fix multi-line/inline command differentiation This bug is a regression caused by the following commit: 604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4 is the first bad commit commit 604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4 Author: Jerome Guitton Date: Tue Jan 10 15:15:53 2017 +0100 The problem happens because, on cli/cli-script.c:process_next_line, GDB is not using the command line string to identify which command to run, but it instead using the 'struct cmd_list_element *' that is obtained by using the mentioned string. The problem with that is that the 'struct cmd_list_element *' doesn't have any information on whether the command issued by the user is a multi-line or inline one. A multi-line command is a command that will necessarily be composed of more than 1 line. For example: (gdb) if 1 >python >print ('hello') >end >end As can be seen in the example above, the 'python' command actually "opens" a new command line (represented by the change in the indentation) that will then be used to enter Python code. OTOH, an inline command is a command that is "self-contained" in a single line, for example: (gdb) if 1 >python print ('hello') >end This Python command is a one-liner, and therefore there is no other Python code that can be entered for this same block. There is also no change in the indentation. So, the fix is somewhat simple: we have to revert the change and use the full command line string passed to process_next_line in order to identify whether we're dealing with a multi-line or an inline command. This commit does just that. As can be seen, this regression also affects other languages, like guile or the compile framework. To make things clearer, I decided to create a new helper function responsible for identifying a non-inline command. Testcase is attached. gdb/ChangeLog: 2017-06-30 Sergio Durigan Junior PR cli/21688 * cli/cli-script.c (command_name_equals_not_inline): New function. (process_next_line): Adjust 'if' clauses for "python", "compile" and "guile" to use command_name_equals_not_inline. gdb/testsuite/ChangeLog: 2017-06-30 Sergio Durigan Junior PR cli/21688 * gdb.python/py-cmd.exp (test_python_inline_or_multiline): New procedure. Call it. commit 60a02042bacf8d25814430080adda61ed086bca6 Author: Nick Clifton Date: Fri Jun 30 11:03:37 2017 +0100 Fix failures in MMIX linker tests introduced by fix for PR 21665. PR binutils/21665 * objdump.c (disassemble_section): Move check for an overlarge section to just before the allocation of memory. Do not check section size against file size, but instead use an arbitrary 2Gb limit. Issue a warning message if the section is too big. commit 4151f6842850876e93c8e5d870d7c9147065788d Author: Maciej W. Rozycki Date: Fri Jun 30 07:21:56 2017 +0100 MIPS: Add Imagination interAptiv MR2 MIPS32r3 processor support (ChangeLog) Correct ChangeLog entry for commit 38bf472a1521 ("MIPS: Add Imagination interAptiv MR2 MIPS32r3 processor support"). commit 909b4e3d5fb8579b3721651c9e64a11e7ec27e5f Author: Maciej W. Rozycki Date: Fri Jun 30 07:21:56 2017 +0100 MIPS: Add microMIPS XPA support Add support for the base and Virtualization ASE microMIPS instructions as per the architecture specifications[1][2][3][4]. Most of this change by Andrew Bennett. [1] "MIPS Architecture for Programmers Volume II-B: The microMIPS32 Instruction Set", MIPS Technologies, Inc., Document Number: MD00582, Revision 5.04, January 15, 2014, Section 5.5 "Recoded 32-Bit Instructions", p. 340 [2] "microMIPS32 Architecture for Programmers Volume IV-i: Virtualization Module of the microMIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00848, Revision 1.06, December 10, 2013, Section 6.1 "Overview", pp. 133, 136 [3] "MIPS Architecture for Programmers Volume II-B: The microMIPS64 Instruction Set", MIPS Technologies, Inc., Document Number: MD00594, Revision 5.04, January 15, 2014, Section 5.5 "Recoded 32-Bit Instructions", pp. 415, 444 [4] "microMIPS64 Architecture for Programmers Volume IV-i: Virtualization Module of the microMIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00849, Revision 1.06, December 10, 2013, Section 6.1 "Overview", pp. 134-135, 139-140 binutils/ * NEWS: Mention microMIPS XPA support. opcodes/ * micromips-opc.c (XPA, XPAVZ): New macros. (micromips_opcodes): Add "mfhc0", "mfhgc0", "mthc0" and "mthgc0". gas/ * config/tc-mips.c (mips_ases): Add microMIPS XPA support. * testsuite/gas/mips/micromips@xpa.d: New test. * testsuite/gas/mips/mips.exp: Run the new test. Enable `xpa-virt-err' test for `micromips'. commit f5b2fd523f8f180e11f77b84a107279c562672cd Author: Maciej W. Rozycki Date: Fri Jun 30 07:21:56 2017 +0100 MIPS: Add microMIPS R5 support Add base microMIPS Release 5 ISA support and the ERETNC instruction in particular, as per the architecture specifications[1][2]. Most of this change by Andrew Bennett. References: [1] "MIPS Architecture for Programmers Volume II-B: The microMIPS32 Instruction Set", MIPS Technologies, Inc., Document Number: MD00582, Revision 5.04, January 15, 2014, Section 5.5 "Recoded 32-Bit Instructions", pp. 266-267 [2] "MIPS Architecture for Programmers Volume II-B: The microMIPS64 Instruction Set", MIPS Technologies, Inc., Document Number: MD00594, Revision 5.04, January 15, 2014, Section 5.5 "Recoded 32-Bit Instructions", pp. 326-327 binutils/ * NEWS: Mention microMIPS Release 5 ISA support. opcodes/ * micromips-opc.c (I36): New macro. (micromips_opcodes): Add "eretnc". gas/ * testsuite/gas/mips/micromips@r5.d: New test. * testsuite/gas/mips/mips.exp: Run the new test. commit 9785fc2a4d220322ce6cd1d79e768345ea5234d2 Author: Maciej W. Rozycki Date: Fri Jun 30 07:21:55 2017 +0100 MIPS: Fix XPA base and Virtualization ASE instruction handling Correct a commit 7d64c587c15f ("Add support for the MIPS eXtended Physical Address (XPA) ASE.") bug, causing XPA base and Virtualization ASE instructions to be wrongly always enabled with the selection of the MIPS32r2 or higher ISA. For example this source assembles successfully as shown below: $ cat xpa.s mfhc0 $2, $1 $ as -32 -mips32 -o xpa.o xpa.s xpa.s: Assembler messages: xpa.s:1: Error: opcode not supported on this processor: mips32 (mips32) `mfhc0 $2,$1' $ as -32 -mips32r2 -o xpa.o xpa.s $ objdump -d xpa.o xpa.o: file format elf32-tradbigmips Disassembly of section .text: 00000000 <.text>: 0: 40420800 mfhc0 v0,c0_random ... $ To address this issue remove the I33 (INSN_ISA32R2) marking from all XPA instructions in the opcode table. Additionally, for XPA Virtualization ASE instructions implement an XPAVZ (ASE_XPA_VIRT) combination ASE flag and use it in place of IVIRT|XPA (ASE_VIRT|ASE_XPA). Now the same source is correctly rejected unless the `-mxpa' option is also used: $ as -32 -mips32r2 -o xpa.o xpa.s xpa.s: Assembler messages: xpa.s:1: Error: opcode not supported on this processor: mips32r2 (mips32r2) `mfhc0 $2,$1' $ as -32 -mips32r2 -mxpa -o xpa.o xpa.s $ Add test cases for XPA base and XPA Virtualization ASE instructions. Parts of this change by Andrew Bennett. include/ * opcode/mips.h (ASE_XPA_VIRT): New macro. opcodes/ * mips-dis.c (mips_calculate_combination_ases): Handle the ASE_XPA_VIRT flag. (parse_mips_ase_option): New function. (parse_mips_dis_option): Factor out ASE option handling to the new function. Call `mips_calculate_combination_ases'. * mips-opc.c (XPAVZ): New macro. (mips_builtin_opcodes): Correct ISA and ASE flags for "mfhc0", "mfhgc0", "mthc0" and "mthgc0". gas/ * config/tc-mips.c (mips_set_ase): Handle the ASE_XPA_VIRT flag. * testsuite/gas/mips/xpa.d: Remove `xpa' from `-M' in `objdump' flags. Add `-mvirt' to `as' flags. * testsuite/gas/mips/xpa-err.d: New test. * testsuite/gas/mips/xpa-virt-err.d: New test. * testsuite/gas/mips/xpa-err.l: New stderr output. * testsuite/gas/mips/xpa-virt-err.l: New stderr output. * testsuite/gas/mips/xpa-err.s: New test source. * testsuite/gas/mips/xpa-virt-err.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. binutils/ * testsuite/binutils-all/mips/mips-xpa-virt-1.d: New test. * testsuite/binutils-all/mips/mips-xpa-virt-2.d: New test. * testsuite/binutils-all/mips/mips-xpa-virt-3.d: New test. * testsuite/binutils-all/mips/mips-xpa-virt-4.d: New test. * testsuite/binutils-all/mips/mips-xpa-virt.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new tests. commit 8d011e87dfa4e1719bd909b9adcbd1a0f5a75228 Author: GDB Administrator Date: Fri Jun 30 00:00:30 2017 +0000 Automatic date update in version.in commit 60804c53a0c365f0802e90c12dfcbe6696b861fe Author: Maciej W. Rozycki Date: Fri Jun 30 00:55:07 2017 +0100 MIPS/opcodes: Correctly combine ASE flags for ASE_MIPS16E2_MT calculation Correct a commit 25499ac7ee92 ("MIPS16e2: Add MIPS16e2 ASE support") disassembler bug with the handling of the ASE_MIPS16E2_MT combination ASE flag, where the calculation uses MIPS ABI Flags directly rather than calculated internal ASE flags. Consequently code does not correctly set the ASE_MIPS16E2_MT flag when the MIPS16e2 ASE flag and the MT ASE flag come from different sources, i.e. one from the BFD chosen and the other one from MIPS ABI Flags. Fix this by using internal ASE_MT and ASE_MIPS16E2 flags in a separate subsequent step, factored out to a dedicated function for use with future combination ASE flags. Adjust the `mips16e2@mips16e2-mt-sub.d' test case accordingly, where the MT flag comes from the BFD selected for the disassembler and the MIPS16e2 flag comes from the ELF binary itself. opcodes/ * mips-dis.c (mips_calculate_combination_ases): New function. (mips_convert_abiflags_ases): Factor out ASE_MIPS16E2_MT calculation to the new function. (set_default_mips_dis_options): Call the new function. gas/ * testsuite/gas/mips/mips16e2@mips16e2-mt-sub.d: Adjust for the ASE_MIPS16E2_MT flag disassembler fix. * testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e2-mt-sub.d: Likewise. commit 92cebb3dbea282bbf7357ed2f3f03bc92fee8c7b Author: Maciej W. Rozycki Date: Fri Jun 30 00:55:07 2017 +0100 MIPS/GAS: Clear the ASE_MIPS16E2_MT flag for recalculation Correct a commit 25499ac7ee92 ("MIPS16e2: Add MIPS16e2 ASE support") GAS bug with the handling of the ASE_MIPS16E2_MT combination ASE flag, which is not correctly calculated as `.set nomips16e2' and `.set nomt' pseudo-ops are processed. This leads to code like: $ cat foo.s .set nomt evpe .align 4, 0 $ cat bar.s .set nomips16e2 dvpe .align 4, 0 $ to successfully assemble where it should not: $ as -32 -mips32r3 -mmt -mips16 -mmips16e2 -o foo.o foo.s $ as -32 -mips32r3 -mmt -mips16 -mmips16e2 -o bar.o bar.s $ objdump -m mips:16 -d foo.o foo.o: file format elf32-tradbigmips Disassembly of section .text: 00000000 <.text>: 0: f027 6700 evpe ... bar.o: file format elf32-tradbigmips Disassembly of section .text: 00000000 <.text>: 0: f026 6700 dvpe ... $ This happens because ASE_MIPS16E2_MT once set in `mips_set_ase' is never cleared. Fix the problem by clearing it there before it is calculated based on the ASE_MT and ASE_MIPS16E2 flags, making assembly fail as expected: $ as -32 -mips32r3 -mmt -mips16 -mmips16e2 -o foo.o foo.s foo.s: Assembler messages: foo.s:2: Error: opcode not supported on this processor: mips32r3 (mips32r3) `evpe' $ as -32 -mips32r3 -mmt -mips16 -mmips16e2 -o bar.o bar.s bar.s: Assembler messages: bar.s:2: Error: opcode not supported on this processor: mips32r3 (mips32r3) `dvpe' $ gas/ * config/tc-mips.c (mips_set_ase): Clear the ASE_MIPS16E2_MT flag before recalculating. * testsuite/gas/mips/mips16e2-mt-err.d: New test. * testsuite/gas/mips/mips16e2-mt-err.l: New stderr output. * testsuite/gas/mips/mips16e2-mt-err.s: New test source. * testsuite/gas/mips/mips.exp: Run the new test. commit 3df5cd139455a1448de00e1e173f3ce566a25a48 Author: Andrew Waterman Date: Tue Jun 27 22:44:24 2017 -0700 RISC-V: Fix TLS copy relocs The dynrelro introduction wasn't implemented quite right for RISC-V, as it didn't consider TLS copy relocs. bfd/ChangeLog 2017-06-29 Andrew Waterman * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy relocs. commit eb17d4137dc83a373b8968cd20b256fa8073a4ca Author: Pedro Alves Date: Thu Jun 29 15:52:38 2017 +0100 Expression completer should not match explicit location options This commit fixes a mismatch between what "print" command completer thinks the command understands, and what the command actually understands. The explicit location options are understood by commands that take (linespecs and) explicit locations as argument. I.e, breakpoint commands, and "list". For example: (gdb) b -source file.c -function my_func So for those commands, it makes sense that the completer completes: "b -sour[TAB]" -> "b -source " "b -functi[TAB]" -> "b -function " etc. However, completion for commands that take expressions (not linespecs/locations) as arguments, such as the "print" command, also completes the explicit location options, even though those switches aren't really understood by these commands. Instead, "-foo" is understood as an expression applying unary minus on a symbol named "foo" (think "print -1"): (gdb) p -func[TAB] (gdb) p -function [RET] No symbol "function" in current context. The patch fixes this by having the expression_completer function bypass the function that completes explicit locations. New regression tests included. gdb/ChangeLog: 2017-06-29 Pedro Alves * completer.c (expression_completer): Call linespec_location_completer instead of location_completer. gdb/testsuite/ChangeLog: 2017-06-29 Pedro Alves * gdb.base/printcmds.exp: Add tests. commit 195bcdd5183f2c137399db23a68a26a4e4193f8f Author: Pedro Alves Date: Thu Jun 29 15:52:37 2017 +0100 Remove old stale expression_completer hack The code in question was introduced by: https://sourceware.com/ml/gdb-patches/2008-06/msg00143.html "The fix is to make sure that the entire expression is passed to expression_completer, then duplicate some logic there in the case where location_completer is called." The logic that was duplicated was much later on removed by the original explicit locations patch: commit 87f0e7204722a986f79f245eee716f0870832d47 Author: Keith Seitz AuthorDate: Tue Aug 11 17:09:36 2015 -0700 Commit: Keith Seitz CommitDate: Tue Aug 11 17:09:36 2015 -0700 Explicit locations: add UI features for CLI @@ -688,16 +880,6 @@ complete_line_internal (const char *text, rl_completer_word_break_characters = gdb_completer_file_name_break_characters; } - else if (c->completer == location_completer) - { - /* Commands which complete on locations want to - see the entire argument. */ - for (p = word; - p > tmp_command - && p[-1] != ' ' && p[-1] != '\t'; - p--) - ; - } However this case in expression_completer was left behind. I couldn't come up with a test where this currently makes any difference. gdb/ChangeLog: 2017-06-29 Pedro Alves * completer.c (expression_completer): Remove code that recomputes 'text' from 'word'. commit 2e74f9dd8ae79ddfe7f0f84b890c962016fc8f15 Author: Anton Kolesov Date: Mon Jun 19 13:27:52 2017 +0300 [ARC] Use FOR_EACH_DISASSEMBLER_OPTION to iterate over options This patch updates arc-dis.c:parse_disassembler_options to use a macro FOR_EACH_DISASSEMBLER_OPTION, which has been introduced in [1], instead of a homegrown solution to split option string. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=65b48a81 opcodes/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-dis.c (parse_disassembler_options): Use FOR_EACH_DISASSEMBLER_OPTION. commit e1e94c4994151ebe0e3a103fd0d27f60bd806bbe Author: Anton Kolesov Date: Thu Jun 15 15:58:32 2017 +0300 [ARC] Fix handling of cpu=... disassembler option value There is a bug in handling of cpu=... disassembler option in case there are other options after it, for example, `cpu=EM,dsp'. In this case `EM,dsp' is treated as an option value, and strcasecmp reports is as non-equal to "EM". This is fixed by using disassembler_options_cmp function, which compares string treating `,' the same way as `\0'. This function also solves a problem with option order in parse_option. Previously, if several option had same prefix (e.g. fpud, fpuda), then the longer one should have been compared first, otherwise when longer option is passed it would be treated as a short one, because CONST_STRNEQ ("fpud", "fpuda") would be true. The order of options was correct for ARC, so there were no bugs per se, but with disassembler_option_cmp there is no risk of such a bug being introduced in the future. opcodes/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-dis.c (parse_option): Use disassembler_options_cmp to compare disassembler option strings. (parse_cpu_option): Likewise. binutils/ChangeLog yyyy-mm-dd Anton Kolesov * testsuite/binutils-all/arc/double_store.s: New file. * testsuite/binutils-all/arc/objdump.exp: Tests for disassembler options. (do_objfile): New function. (check_assembly): Likewise. commit adc764e7d217d3e56af988ce20cedc98d8c4cc73 Author: Yao Qi Date: Thu Jun 29 12:41:50 2017 +0100 Use target_desc fields expedite_regs and xmltarget ifndef IN_PROCESS_AGENT struct target_desc is used by both GDBserver and IPA, but fields expedite_regs and xmltarget are only used in GDBserver, so this patch wraps these two fields by ifndef IN_PROCESS_AGENT. This patch also changes regformats/regdat.sh to generate .c files in this way too. gdb/gdbserver: 2017-06-29 Yao Qi * tdesc.h (struct target_desc) [IN_PROCESS_AGENT] : Remove. [IN_PROCESS_AGENT] : Likewise. gdb: 2017-06-29 Yao Qi * regformats/regdat.sh: Generate code with "ifndef IN_PROCESS_AGENT". commit ec1acaba1381d0196c45965a7db9942b67fbd88d Author: Egeyar Bagcioglu Date: Thu Jun 29 04:28:27 2017 -0700 bfd: prevent all but undef weak syms from becoming dynamic in sparc. Prevent sparc backend making symbols dynamic unless they are undefined weak. Use R_SPARC_RELATIVE for the symbols which are not dynamic in PIC. This patch is tested on sparc64-unknown-linux-gnu, no regressions are found. bfd/ChangeLog: 2017-06-29 Egeyar Bagcioglu * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic unless it is undefined weak. * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE relocation. * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol is not dynamic in PIC, abort. commit ff07562f1e369b6e37eafb2a888dc48fa2453e86 Author: Jiong Wang Date: Thu Jun 29 11:47:43 2017 +0100 [AArch64] Only override the symbol dynamic decision on undefined weak symbol This fix is an adaption of the x86-64 PR ld/21402 fix to AArch64. After the generic code deciding one symbol is not dynamic, AArch64 backend only overrides the decision on undefined weak symbols. bfd/ PR ld/21402 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make undefined weak symbols into dynamic. (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE relocation for non-dynamic symbols. (elfNN_aarch64_finish_dynamic_symbol): Add sanity check. commit 2aff25ba76035d2f1f48ea8a6c4b7e498ee31790 Author: Jiong Wang Date: Thu Jun 29 11:45:24 2017 +0100 [AArch64] Remove duplicated code when handling some GOT relocations types There are quite a few duplicated code supporting several GP based relocation types. They are: BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC BFD_RELOC_AARCH64_MOVW_GOTOFF_G1 These relocation types are supposed to be used for large memory model PIC/pic mode under which we will have an initialized GP register points to the base of GOT table, then these relocations are supposed to put the distance between GOT entry and GOT table base address into the related instructions. So, the parameters required to calculate the relocation should be the same as BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15 etc, all of them are require the GOT entry address and GOT table base address to perform the relocation. This patch has removed those duplicated code when handling above listed relocation types, grouped them with others as relocation types that are require GOT table base address during performing relocation, reused the existed GOT handling code. The relocation calculation for these types before and after this patch should be identical. bfd/ * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function. (elfNN_aarch64_final_link_relocate): Delete duplicated code for BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, BFD_RELOC_AARCH64_MOVW_GOTOFF_G1. * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the support for them. commit 88ab90e860a46a1123fcfd13bfe51cd360e9c3f7 Author: Andreas Arnez Date: Thu Jun 29 10:30:09 2017 +0200 S390: Support guarded-storage core note sections Newer Linux kernel versions offer two new register sets in support of the z/Architecture's guarded storage facility: NT_S390_GS_CB, the "guarded-storage registers", and NT_S390_GS_BC, the "guarded-storage broadcast control block". This patch adds support for the respective core notes sections to binutils. bfd/ChangeLog: * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype. (elfcore_write_s390_gs_bc): Likewise. * elf.c (elfcore_grok_s390_gs_cb): New function. (elfcore_grok_s390_gs_bc): New function. (elfcore_grok_note): Call them. (elfcore_write_s390_gs_cb): New function. (elfcore_write_s390_gs_bc): New function. (elfcore_write_register_note): Call them. binutils/ChangeLog: * readelf.c (get_note_type): Add NT_S390_GS_CB and NT_S390_GS_BC. include/ChangeLog: * elf/common.h (NT_S390_GS_CB): New macro. (NT_S390_GS_BC): Likewise. commit 1b19ec971047a074486e6b775dc1969aa13f30fb Author: GDB Administrator Date: Thu Jun 29 00:01:02 2017 +0000 Automatic date update in version.in ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 44 ++ bfd/dwarf2.c | 451 +++++++++++++--- bfd/elf-bfd.h | 4 + bfd/elf.c | 56 ++ bfd/elfnn-aarch64.c | 177 +++---- bfd/elfnn-riscv.c | 10 +- bfd/elfxx-aarch64.c | 12 +- bfd/elfxx-sparc.c | 67 ++- bfd/version.h | 2 +- binutils/ChangeLog | 37 ++ binutils/NEWS | 6 + binutils/objdump.c | 25 +- binutils/readelf.c | 4 + binutils/testsuite/binutils-all/arc/double_store.s | 6 + binutils/testsuite/binutils-all/arc/objdump.exp | 73 ++- .../testsuite/binutils-all/mips/mips-xpa-virt-1.d | 13 + .../testsuite/binutils-all/mips/mips-xpa-virt-2.d | 13 + .../testsuite/binutils-all/mips/mips-xpa-virt-3.d | 13 + .../testsuite/binutils-all/mips/mips-xpa-virt-4.d | 13 + .../testsuite/binutils-all/mips/mips-xpa-virt.s | 14 + binutils/testsuite/binutils-all/mips/mips.exp | 4 + gas/ChangeLog | 109 ++++ gas/config/tc-avr.c | 594 +++++++++++++++++++- gas/config/tc-avr.h | 6 + gas/config/tc-mips.c | 127 ++--- gas/doc/c-avr.texi | 62 ++ gas/testsuite/gas/avr/gccisr-01.d | 141 +++++ gas/testsuite/gas/avr/gccisr-01.s | 127 +++++ gas/testsuite/gas/avr/gccisr-02.d | 43 ++ gas/testsuite/gas/avr/gccisr-02.s | 38 ++ gas/testsuite/gas/avr/gccisr-03.d | 4 + gas/testsuite/gas/avr/gccisr-03.s | 6 + gas/testsuite/gas/mips/micromips@r5.d | 9 + gas/testsuite/gas/mips/micromips@relax-offset.d | 26 + gas/testsuite/gas/mips/micromips@xpa.d | 25 + gas/testsuite/gas/mips/mips.exp | 9 +- .../mips/mips16e2-interaptiv-mr2@mips16e2-mt-sub.d | 19 +- gas/testsuite/gas/mips/mips16e2-mt-err.d | 3 + gas/testsuite/gas/mips/mips16e2-mt-err.l | 3 + gas/testsuite/gas/mips/mips16e2-mt-err.s | 14 + gas/testsuite/gas/mips/mips16e2@mips16e2-mt-sub.d | 36 +- gas/testsuite/gas/mips/mips1@relax-offset.d | 30 + gas/testsuite/gas/mips/r3000@relax-offset.d | 6 + gas/testsuite/gas/mips/r3900@relax-offset.d | 6 + gas/testsuite/gas/mips/relax-offset.d | 28 + gas/testsuite/gas/mips/relax-offset.l | 2 + gas/testsuite/gas/mips/relax-offset.s | 23 + gas/testsuite/gas/mips/xpa-err.d | 3 + gas/testsuite/gas/mips/xpa-err.l | 2 + gas/testsuite/gas/mips/xpa-err.s | 8 + gas/testsuite/gas/mips/xpa-virt-err.d | 3 + gas/testsuite/gas/mips/xpa-virt-err.l | 3 + gas/testsuite/gas/mips/xpa-virt-err.s | 15 + gas/testsuite/gas/mips/xpa.d | 4 +- gdb/ChangeLog | 31 + gdb/cli/cli-script.c | 9 +- gdb/completer.c | 10 +- gdb/contrib/cc-with-tweaks.sh | 41 +- gdb/dwarf2read.c | 58 ++- gdb/gdbserver/ChangeLog | 6 + gdb/gdbserver/tdesc.h | 2 + gdb/regformats/regdat.sh | 3 + gdb/testsuite/ChangeLog | 16 + gdb/testsuite/gdb.base/printcmds.exp | 6 + gdb/testsuite/gdb.python/py-cmd.exp | 65 +++ include/ChangeLog | 15 + include/elf/common.h | 4 + include/opcode/avr.h | 5 + include/opcode/mips.h | 3 + ld/ChangeLog | 10 + ld/testsuite/ld-mips-elf/mips-elf.exp | 34 ++ ld/testsuite/ld-mips-elf/relax-offset-umips.dd | 15 + ld/testsuite/ld-mips-elf/relax-offset-umips.gd | 11 + ld/testsuite/ld-mips-elf/relax-offset.dd | 19 + ld/testsuite/ld-mips-elf/relax-offset.gd | 11 + ld/testsuite/ld-mips-elf/relax-offset.ld | 16 + opcodes/ChangeLog | 50 ++- opcodes/arc-dis.c | 36 +- opcodes/micromips-opc.c | 14 + opcodes/mips-dis.c | 64 ++- opcodes/mips-opc.c | 23 +- 81 files changed, 2710 insertions(+), 445 deletions(-) create mode 100644 binutils/testsuite/binutils-all/arc/double_store.s create mode 100644 binutils/testsuite/binutils-all/mips/mips-xpa-virt-1.d create mode 100644 binutils/testsuite/binutils-all/mips/mips-xpa-virt-2.d create mode 100644 binutils/testsuite/binutils-all/mips/mips-xpa-virt-3.d create mode 100644 binutils/testsuite/binutils-all/mips/mips-xpa-virt-4.d create mode 100644 binutils/testsuite/binutils-all/mips/mips-xpa-virt.s create mode 100644 gas/testsuite/gas/avr/gccisr-01.d create mode 100644 gas/testsuite/gas/avr/gccisr-01.s create mode 100644 gas/testsuite/gas/avr/gccisr-02.d create mode 100644 gas/testsuite/gas/avr/gccisr-02.s create mode 100644 gas/testsuite/gas/avr/gccisr-03.d create mode 100644 gas/testsuite/gas/avr/gccisr-03.s create mode 100644 gas/testsuite/gas/mips/micromips@r5.d create mode 100644 gas/testsuite/gas/mips/micromips@relax-offset.d create mode 100644 gas/testsuite/gas/mips/micromips@xpa.d create mode 100644 gas/testsuite/gas/mips/mips16e2-mt-err.d create mode 100644 gas/testsuite/gas/mips/mips16e2-mt-err.l create mode 100644 gas/testsuite/gas/mips/mips16e2-mt-err.s create mode 100644 gas/testsuite/gas/mips/mips1@relax-offset.d create mode 100644 gas/testsuite/gas/mips/r3000@relax-offset.d create mode 100644 gas/testsuite/gas/mips/r3900@relax-offset.d create mode 100644 gas/testsuite/gas/mips/relax-offset.d create mode 100644 gas/testsuite/gas/mips/relax-offset.l create mode 100644 gas/testsuite/gas/mips/relax-offset.s create mode 100644 gas/testsuite/gas/mips/xpa-err.d create mode 100644 gas/testsuite/gas/mips/xpa-err.l create mode 100644 gas/testsuite/gas/mips/xpa-err.s create mode 100644 gas/testsuite/gas/mips/xpa-virt-err.d create mode 100644 gas/testsuite/gas/mips/xpa-virt-err.l create mode 100644 gas/testsuite/gas/mips/xpa-virt-err.s create mode 100644 ld/testsuite/ld-mips-elf/relax-offset-umips.dd create mode 100644 ld/testsuite/ld-mips-elf/relax-offset-umips.gd create mode 100644 ld/testsuite/ld-mips-elf/relax-offset.dd create mode 100644 ld/testsuite/ld-mips-elf/relax-offset.gd create mode 100644 ld/testsuite/ld-mips-elf/relax-offset.ld First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ad9eecb..c384a0f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,47 @@ +2017-06-29 Andrew Waterman + + * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy + relocs. + +2017-06-29 Egeyar Bagcioglu + + * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic + unless it is undefined weak. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag + relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE + relocation. + * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol + is not dynamic in PIC, abort. + +2017-06-29 Jiong Wang + + PR ld/21402 + * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make + undefined weak symbols into dynamic. + (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE + relocation for non-dynamic symbols. + (elfNN_aarch64_finish_dynamic_symbol): Add sanity check. + +2017-06-29 Jiong Wang + + * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function. + (elfNN_aarch64_final_link_relocate): Delete duplicated code for + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1. + * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the + support for them. + +2017-06-29 Andreas Arnez + + * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype. + (elfcore_write_s390_gs_bc): Likewise. + * elf.c (elfcore_grok_s390_gs_cb): New function. + (elfcore_grok_s390_gs_bc): New function. + (elfcore_grok_note): Call them. + (elfcore_write_s390_gs_cb): New function. + (elfcore_write_s390_gs_bc): New function. + (elfcore_write_register_note): Call them. + 2017-06-28 H.J. Lu * libbfd.c (_bfd_generic_get_section_contents): Don't call diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 0ef3e1f..5e674d4 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -150,6 +150,12 @@ struct dwarf2_debug /* Length of the loaded .debug_str section. */ bfd_size_type dwarf_str_size; + /* Pointer to the .debug_line_str section loaded into memory. */ + bfd_byte *dwarf_line_str_buffer; + + /* Length of the loaded .debug_line_str section. */ + bfd_size_type dwarf_line_str_size; + /* Pointer to the .debug_ranges section loaded into memory. */ bfd_byte *dwarf_ranges_buffer; @@ -306,6 +312,7 @@ struct attr_abbrev { enum dwarf_attribute name; enum dwarf_form form; + bfd_vma implicit_const; }; /* Map of uncompressed DWARF debug section name to compressed one. It @@ -329,6 +336,7 @@ const struct dwarf_debug_section dwarf_debug_sections[] = { ".debug_static_vars", ".zdebug_static_vars" }, { ".debug_str", ".zdebug_str", }, { ".debug_str", ".zdebug_str", }, + { ".debug_line_str", ".zdebug_line_str", }, { ".debug_types", ".zdebug_types" }, /* GNU DWARF 1 extensions */ { ".debug_sfnames", ".zdebug_sfnames" }, @@ -361,15 +369,21 @@ enum dwarf_debug_section_enum debug_static_vars, debug_str, debug_str_alt, + debug_line_str, debug_types, debug_sfnames, debug_srcinfo, debug_funcnames, debug_typenames, debug_varnames, - debug_weaknames + debug_weaknames, + debug_max }; +/* A static assertion. */ +extern int dwarf_debug_section_assert[ARRAY_SIZE (dwarf_debug_sections) + == debug_max + 1 ? 1 : -1]; + #ifndef ABBREV_HASH_SIZE #define ABBREV_HASH_SIZE 121 #endif @@ -703,6 +717,45 @@ read_indirect_string (struct comp_unit * unit, return str; } +/* Like read_indirect_string but from .debug_line_str section. */ + +static char * +read_indirect_line_string (struct comp_unit * unit, + bfd_byte * buf, + bfd_byte * buf_end, + unsigned int * bytes_read_ptr) +{ + bfd_uint64_t offset; + struct dwarf2_debug *stash = unit->stash; + char *str; + + if (buf + unit->offset_size > buf_end) + { + * bytes_read_ptr = 0; + return NULL; + } + + if (unit->offset_size == 4) + offset = read_4_bytes (unit->abfd, buf, buf_end); + else + offset = read_8_bytes (unit->abfd, buf, buf_end); + + *bytes_read_ptr = unit->offset_size; + + if (! read_section (unit->abfd, &stash->debug_sections[debug_line_str], + stash->syms, offset, + &stash->dwarf_line_str_buffer, + &stash->dwarf_line_str_size)) + return NULL; + + if (offset >= stash->dwarf_line_str_size) + return NULL; + str = (char *) stash->dwarf_line_str_buffer + offset; + if (*str == '\0') + return NULL; + return str; +} + /* Like read_indirect_string but uses a .debug_str located in an alternate file pointed to by the .gnu_debugaltlink section. Used to impement DW_FORM_GNU_strp_alt. */ @@ -928,15 +981,28 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash) abbrev_ptr += 1; /* Now read in declarations. */ - abbrev_name = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, - FALSE, abbrev_end); - abbrev_ptr += bytes_read; - abbrev_form = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, - FALSE, abbrev_end); - abbrev_ptr += bytes_read; - - while (abbrev_name) + for (;;) { + /* Initialize it just to avoid a GCC false warning. */ + bfd_vma implicit_const = -1; + + abbrev_name = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, + FALSE, abbrev_end); + abbrev_ptr += bytes_read; + abbrev_form = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, + FALSE, abbrev_end); + abbrev_ptr += bytes_read; + if (abbrev_form == DW_FORM_implicit_const) + { + implicit_const = _bfd_safe_read_leb128 (abfd, abbrev_ptr, + &bytes_read, TRUE, + abbrev_end); + abbrev_ptr += bytes_read; + } + + if (abbrev_name == 0) + break; + if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0) { struct attr_abbrev *tmp; @@ -965,14 +1031,11 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash) cur_abbrev->attrs[cur_abbrev->num_attrs].name = (enum dwarf_attribute) abbrev_name; - cur_abbrev->attrs[cur_abbrev->num_attrs++].form + cur_abbrev->attrs[cur_abbrev->num_attrs].form = (enum dwarf_form) abbrev_form; - abbrev_name = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, - FALSE, abbrev_end); - abbrev_ptr += bytes_read; - abbrev_form = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, - FALSE, abbrev_end); - abbrev_ptr += bytes_read; + cur_abbrev->attrs[cur_abbrev->num_attrs].implicit_const + = implicit_const; + ++cur_abbrev->num_attrs; } hash_number = abbrev_number % ABBREV_HASH_SIZE; @@ -1004,7 +1067,8 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash) static inline bfd_boolean is_str_attr (enum dwarf_form form) { - return form == DW_FORM_string || form == DW_FORM_strp || form == DW_FORM_GNU_strp_alt; + return (form == DW_FORM_string || form == DW_FORM_strp + || form == DW_FORM_line_strp || form == DW_FORM_GNU_strp_alt); } /* Read and fill in the value of attribute ATTR as described by FORM. @@ -1014,6 +1078,7 @@ is_str_attr (enum dwarf_form form) static bfd_byte * read_attribute_value (struct attribute * attr, unsigned form, + bfd_vma implicit_const, struct comp_unit * unit, bfd_byte * info_ptr, bfd_byte * info_ptr_end) @@ -1101,6 +1166,10 @@ read_attribute_value (struct attribute * attr, attr->u.str = read_indirect_string (unit, info_ptr, info_ptr_end, &bytes_read); info_ptr += bytes_read; break; + case DW_FORM_line_strp: + attr->u.str = read_indirect_line_string (unit, info_ptr, info_ptr_end, &bytes_read); + info_ptr += bytes_read; + break; case DW_FORM_GNU_strp_alt: attr->u.str = read_alt_indirect_string (unit, info_ptr, info_ptr_end, &bytes_read); info_ptr += bytes_read; @@ -1179,7 +1248,18 @@ read_attribute_value (struct attribute * attr, form = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read, FALSE, info_ptr_end); info_ptr += bytes_read; - info_ptr = read_attribute_value (attr, form, unit, info_ptr, info_ptr_end); + if (form == DW_FORM_implicit_const) + { + implicit_const = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read, + TRUE, info_ptr_end); + info_ptr += bytes_read; + } + info_ptr = read_attribute_value (attr, form, implicit_const, unit, + info_ptr, info_ptr_end); + break; + case DW_FORM_implicit_const: + attr->form = DW_FORM_sdata; + attr->u.sval = implicit_const; break; default: _bfd_error_handler (_("Dwarf Error: Invalid or unhandled FORM value: %#x."), @@ -1200,7 +1280,8 @@ read_attribute (struct attribute * attr, bfd_byte * info_ptr_end) { attr->name = abbrev->name; - info_ptr = read_attribute_value (attr, abbrev->form, unit, info_ptr, info_ptr_end); + info_ptr = read_attribute_value (attr, abbrev->form, abbrev->implicit_const, + unit, info_ptr, info_ptr_end); return info_ptr; } @@ -1734,6 +1815,195 @@ sort_line_sequences (struct line_info_table* table) return TRUE; } +/* Add directory to TABLE. CUR_DIR memory ownership is taken by TABLE. */ + +static bfd_boolean +line_info_add_include_dir (struct line_info_table *table, char *cur_dir) +{ + if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0) + { + char **tmp; + bfd_size_type amt; + + amt = table->num_dirs + DIR_ALLOC_CHUNK; + amt *= sizeof (char *); + + tmp = (char **) bfd_realloc (table->dirs, amt); + if (tmp == NULL) + return FALSE; + table->dirs = tmp; + } + + table->dirs[table->num_dirs++] = cur_dir; + return TRUE; +} + +static bfd_boolean +line_info_add_include_dir_stub (struct line_info_table *table, char *cur_dir, + unsigned int dir ATTRIBUTE_UNUSED, + unsigned int time ATTRIBUTE_UNUSED, + unsigned int size ATTRIBUTE_UNUSED) +{ + return line_info_add_include_dir (table, cur_dir); +} + +/* Add file to TABLE. CUR_FILE memory ownership is taken by TABLE. */ + +static bfd_boolean +line_info_add_file_name (struct line_info_table *table, char *cur_file, + unsigned int dir, unsigned int time, unsigned int size) +{ + if ((table->num_files % FILE_ALLOC_CHUNK) == 0) + { + struct fileinfo *tmp; + bfd_size_type amt; + + amt = table->num_files + FILE_ALLOC_CHUNK; + amt *= sizeof (struct fileinfo); + + tmp = (struct fileinfo *) bfd_realloc (table->files, amt); + if (tmp == NULL) + return FALSE; + table->files = tmp; + } + + table->files[table->num_files].name = cur_file; + table->files[table->num_files].dir = dir; + table->files[table->num_files].time = time; + table->files[table->num_files].size = size; + table->num_files++; + return TRUE; +} + +/* Read directory or file name entry format, starting with byte of + format count entries, ULEB128 pairs of entry formats, ULEB128 of + entries count and the entries themselves in the described entry + format. */ + +static bfd_boolean +read_formatted_entries (struct comp_unit *unit, bfd_byte **bufp, + bfd_byte *buf_end, struct line_info_table *table, + bfd_boolean (*callback) (struct line_info_table *table, + char *cur_file, + unsigned int dir, + unsigned int time, + unsigned int size)) +{ + bfd *abfd = unit->abfd; + bfd_byte format_count, formati; + bfd_vma data_count, datai; + bfd_byte *buf = *bufp; + bfd_byte *format_header_data; + unsigned int bytes_read; + + format_count = read_1_byte (abfd, buf, buf_end); + buf += 1; + format_header_data = buf; + for (formati = 0; formati < format_count; formati++) + { + _bfd_safe_read_leb128 (abfd, buf, &bytes_read, FALSE, buf_end); + buf += bytes_read; + _bfd_safe_read_leb128 (abfd, buf, &bytes_read, FALSE, buf_end); + buf += bytes_read; + } + + data_count = _bfd_safe_read_leb128 (abfd, buf, &bytes_read, FALSE, buf_end); + buf += bytes_read; + for (datai = 0; datai < data_count; datai++) + { + bfd_byte *format = format_header_data; + struct fileinfo fe; + + for (formati = 0; formati < format_count; formati++) + { + bfd_vma content_type, form; + char *string_trash; + char **stringp = &string_trash; + unsigned int uint_trash, *uintp = &uint_trash; + + content_type = _bfd_safe_read_leb128 (abfd, format, &bytes_read, + FALSE, buf_end); + format += bytes_read; + switch (content_type) + { + case DW_LNCT_path: + stringp = &fe.name; + break; + case DW_LNCT_directory_index: + uintp = &fe.dir; + break; + case DW_LNCT_timestamp: + uintp = &fe.time; + break; + case DW_LNCT_size: + uintp = &fe.size; + break; + case DW_LNCT_MD5: + break; + default: + _bfd_error_handler + (_("Dwarf Error: Unknown format content type %lu."), + (unsigned long) content_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + form = _bfd_safe_read_leb128 (abfd, format, &bytes_read, FALSE, + buf_end); + format += bytes_read; + switch (form) + { + case DW_FORM_string: + *stringp = read_string (abfd, buf, buf_end, &bytes_read); + buf += bytes_read; + break; + + case DW_FORM_line_strp: + *stringp = read_indirect_line_string (unit, buf, buf_end, &bytes_read); + buf += bytes_read; + break; + + case DW_FORM_data1: + *uintp = read_1_byte (abfd, buf, buf_end); + buf += 1; + break; + + case DW_FORM_data2: + *uintp = read_2_bytes (abfd, buf, buf_end); + buf += 2; + break; + + case DW_FORM_data4: + *uintp = read_4_bytes (abfd, buf, buf_end); + buf += 4; + break; + + case DW_FORM_data8: + *uintp = read_8_bytes (abfd, buf, buf_end); + buf += 8; + break; + + case DW_FORM_udata: + *uintp = _bfd_safe_read_leb128 (abfd, buf, &bytes_read, FALSE, + buf_end); + buf += bytes_read; + break; + + case DW_FORM_block: + /* It is valid only for DW_LNCT_timestamp which is ignored by + current GDB. */ + break; + } + } + + if (!callback (table, fe.name, fe.dir, fe.time, fe.size)) + return FALSE; + } + + *bufp = buf; + return TRUE; +} + /* Decode the line number information for UNIT. */ static struct line_info_table* @@ -1815,7 +2085,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) line_end = line_ptr + lh.total_length; lh.version = read_2_bytes (abfd, line_ptr, line_end); - if (lh.version < 2 || lh.version > 4) + if (lh.version < 2 || lh.version > 5) { _bfd_error_handler (_("Dwarf Error: Unhandled .debug_line version %d."), lh.version); @@ -1824,7 +2094,8 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) } line_ptr += 2; - if (line_ptr + offset_size + (lh.version >=4 ? 6 : 5) >= line_end) + if (line_ptr + offset_size + (lh.version >= 5 ? 8 : (lh.version >= 4 ? 6 : 5)) + >= line_end) { _bfd_error_handler (_("Dwarf Error: Ran out of room reading prologue")); @@ -1832,6 +2103,26 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) return NULL; } + if (lh.version >= 5) + { + unsigned int segment_selector_size; + + /* Skip address size. */ + read_1_byte (abfd, line_ptr, line_end); + line_ptr += 1; + + segment_selector_size = read_1_byte (abfd, line_ptr, line_end); + line_ptr += 1; + if (segment_selector_size != 0) + { hooks/post-receive -- Repository for Project Archer.