The branch, users/jkratoch/indexcxx has been updated via 590d37ae8d079e541cf184782899ef84b2b3f569 (commit) via e3dd10552e7c9e09bb49edc72f141aeefcf72bf3 (commit) via fecb9c46659c576e9e2c790eff2a25df8203a97f (commit) via 858f82bf7e6531f4ad821285359c759c835f9dce (commit) via 8fa5b777488105287e56937365523d01e51c2eb3 (commit) via efdf7a02db60e7371ba6372e47b510aadecbae28 (commit) via dc1e4d6dedcb8ee3bb195f0db711f6aa164b8ab4 (commit) via 938ec663b8ec03336bd0387ee8f8d6f18f199025 (commit) via f96bd6c2d7a3801fabbf9d834f7a29b752aa7532 (commit) via 662659a1a582af14aa45a458005e2a4df514b6d7 (commit) via a62b75569b0e8038cf7c61350bf6fd5d0d6b64f8 (commit) via 72626a106545009c1054d6fdf7625fcc3e9b3dff (commit) via ec13808ef07550f8a5f87fad1945739da1f10c81 (commit) via f7c514a3784384215692c43d66f013d7640db277 (commit) via 1231656410996d2cc271486adc743a0fafe2ab4d (commit) via 52be03fd13a26ecda4f27c451a434f19eded0ca6 (commit) via e643cb45bf85fa5c8c49a89ff177de246af4212e (commit) via 7cc0cd2903612a0730de6ba00181b9016e77ea3d (commit) via 086554e8e6b222518f12acab34e6cc7b5af7fde7 (commit) via fe5f7374bef8f23ffa0fe0dee0f9b05e0a218a29 (commit) via eea787570f708e51048f812808e6cbd76fde6919 (commit) via 3be78afdeddd3ebf57eb0df8b029cf596f468c7a (commit) via 296ec4fa2afb14abc400fa0109d7288eb958c544 (commit) via 081c108e3688d67f257d4b98c9012ef2677b3b18 (commit) via a12e714b775ce025444af15dcfbd5a420363ad53 (commit) via f74f865e5030057deb8a6a56af4a9e003d82cdcd (commit) via 0d0bf81a6729478563c3851ccfca435222ddfa25 (commit) via 1a09b50a463ad005946849540da136b5cbe6237b (commit) via 0ce4291e3ffd90d2b94e02b4557d716c043bf02e (commit) via c56054f9a80e157e3d2d5109821abd191b68f0ea (commit) via a43986283d61ffd4d7dc9b20c0ecb73cd345206c (commit) via 8c43009f48a0d4be497cf7c1285784aa70fc5abd (commit) via a7e80b9e21eb907ac5c90de7452588c059db0cec (commit) via b1a42fdfa31937d7e05df34afee970ac0ad239e1 (commit) via a6be053897be3786ceda9a59d17befe11454f6d2 (commit) via 210477268d4ac5cad937e811888a5c932206794c (commit) via 9b7539374617a94c2d646f49e1bbfc954b11891d (commit) via d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa (commit) via 79b1d3cb362385c38af9cfb44c0c87b939711fbc (commit) via 8fb740dd3032543b833b141011aa2005c035d024 (commit) via c0c31e91adc6aabe7c96f02dd51a0f6200a982da (commit) via cf31b44f3c4d839db0dcce10e0c4cc47d3be4ff1 (commit) via f124168208a5927e9f1b9843094ec2bf2aad2edf (commit) via 7ed687b257a4182771079c582887498d0a98810c (commit) via 275c67ffb452f21f5c002cd0c7bbfd244848111d (commit) via ed771251e16c8c66cbdd03738135e76caef6937e (commit) via 568c1b9f503649d19ed1d17e6970f212e6b6317d (commit) via 62785b09987359ede74a98fac11343827f7181af (commit) via c72cea5aec39df2d7a105755691a61460ee64f59 (commit) via cad1105d6a28e1199e82653619fbd63c2b9d4fa6 (commit) via 3e00d44febb8093d8dc0e6842b975afb194c4fd1 (commit) via 077ae656a69fcf144f68848a3f6f2cb559b62987 (commit) via 1e2b521d987a34898ca959a33972be8912511ba0 (commit) via 338771252e913f82df8a445cb3e748a791b1cba8 (commit) via a0eef9404b0fcfc8b0fbe7511d094a419ac631e9 (commit) via 1a5e158b68d0fb3b1ba3d038e87c841239572a35 (commit) via 3f2a3564b1c3872e4a380f2484d40ce2495a4835 (commit) via ad36c6ce7c176a0bade3b3f09b801e65ab5ef93f (commit) via 19683c0408d66d9e48085fd5af009ad7d83aa3cd (commit) from 025edc48851da0e21aea57628f5fb8cd305a281f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 590d37ae8d079e541cf184782899ef84b2b3f569 Author: Jan Kratochvil Date: Fri Mar 31 22:45:48 2017 +0200 . commit e3dd10552e7c9e09bb49edc72f141aeefcf72bf3 Merge: 72626a1 fecb9c4 Author: Jan Kratochvil Date: Fri Mar 31 19:06:38 2017 +0200 Merge remote-tracking branch 'gdb/master' into indexcxx commit fecb9c46659c576e9e2c790eff2a25df8203a97f Author: Palmer Dabbelt Date: Wed Mar 29 16:05:40 2017 -0700 RISC-V: Allow ISA subsets to be disabled Without this patch, passing "-march=rv64ic -march=rv64i" results in you getting a "RV64IC" toolchain, which isn't expected. gas/ChangeLog: 2017-03-30 Palmer Dabbelt * config/tc-riscv.c (riscv_clear_subsets): New function. (riscv_add_subset): Call riscv_clear_subsets and riscv_set_rvc to clear RVC when it's been previously set. commit 858f82bf7e6531f4ad821285359c759c835f9dce Author: Andrew Waterman Date: Wed Mar 22 02:09:56 2017 -0700 RISC-V: Add physical memory protection CSRs 2017-03-27 Andrew Waterman * opcode/riscv-opc.h (CSR_PMPCFG0): New define. (CSR_PMPCFG1): Likewise. (CSR_PMPCFG2): Likewise. (CSR_PMPCFG3): Likewise. (CSR_PMPADDR0): Likewise. (CSR_PMPADDR1): Likewise. (CSR_PMPADDR2): Likewise. (CSR_PMPADDR3): Likewise. (CSR_PMPADDR4): Likewise. (CSR_PMPADDR5): Likewise. (CSR_PMPADDR6): Likewise. (CSR_PMPADDR7): Likewise. (CSR_PMPADDR8): Likewise. (CSR_PMPADDR9): Likewise. (CSR_PMPADDR10): Likewise. (CSR_PMPADDR11): Likewise. (CSR_PMPADDR12): Likewise. (CSR_PMPADDR13): Likewise. (CSR_PMPADDR14): Likewise. (CSR_PMPADDR15): Likewise. (pmpcfg0): Declare register. (pmpcfg1): Likewise. (pmpcfg2): Likewise. (pmpcfg3): Likewise. (pmpaddr0): Likewise. (pmpaddr1): Likewise. (pmpaddr2): Likewise. (pmpaddr3): Likewise. (pmpaddr4): Likewise. (pmpaddr5): Likewise. (pmpaddr6): Likewise. (pmpaddr7): Likewise. (pmpaddr8): Likewise. (pmpaddr9): Likewise. (pmpaddr10): Likewise. (pmpaddr11): Likewise. (pmpaddr12): Likewise. (pmpaddr13): Likewise. (pmpaddr14): Likewise. (pmpaddr15): Likewise. commit 8fa5b777488105287e56937365523d01e51c2eb3 Author: Simon Marchi Date: Fri Mar 31 11:19:44 2017 -0400 gdbserver: Suffix generated C files with -generated I noticed that there were some missing files in gdbserver's gitignore (some generated register format .c files). Of course the easy fix would be to add those files to .gitignore, but I think we can do a better job, so that we don't have to worry about adding generated files to .gitignore or the clean Makefile target. I suggest naming all generated source files -generated.c. This way, we can use a single rule in .gitignore and do a "rm -f *-generated.c" to clean them up. New in v2: - Don't rename version.o and xml-builtin.o gdb/gdbserver/ChangeLog: * .gitignore: Remove generated files, replace with wildcard. * (clean): Replace removal of generated files with wildcard. (version.c): Replace with... (version-generated.c): ...this. (xml-builtin.c): Replace with... (xml-builtin-generated.c): ...this. (%-ipa.o: %-generated.c, %.o: %-generated.c): New rules. (%.c: *regformats*): Replace with... (%-generated.c: *regformats*): ...this. commit efdf7a02db60e7371ba6372e47b510aadecbae28 Author: Pip Cet Date: Fri Mar 31 13:07:01 2017 +0100 Fix minor problems with previous wasm32 binutils commit. binutils * NEWS: Use "WebAssembly" consistently. * testsuite/binutils-all/wasm32/wasm32.exp: Fix copyright notice. commit dc1e4d6dedcb8ee3bb195f0db711f6aa164b8ab4 Author: Nick Clifton Date: Fri Mar 31 12:54:38 2017 +0100 Reduce the size of s390 symbol tables by allowing relocations in mergeable string sections (eg .debug_str) to be made section relative rather than symbol relative. PR gas/21333 * config/tc-s390.c (tc_s390_fix_adjustable): Allow non pc-relative fixups in mergeable sections to be adjusted. commit 938ec663b8ec03336bd0387ee8f8d6f18f199025 Author: GDB Administrator Date: Fri Mar 31 00:00:31 2017 +0000 Automatic date update in version.in commit f96bd6c2d7a3801fabbf9d834f7a29b752aa7532 Author: Pip Cet Date: Thu Mar 30 10:57:21 2017 +0100 Add support for the WebAssembly file format and the wasm32 ELF conversion to gas and the binutils. binutils * readelf.c: Add support for wasm32 ELF format WebAssembly files. (guess_is_rela): Likewise. (dump_relocations): Likewise. (is_32bit_abs_reloc): Likewise. (is_none_reloc_): Likewise. * NEWS: Mention the new support. * testsuite/lib/binutils-common.exp (is_elf_format): Mark wasm32 as ELF target. (supports_gnu_unique): Mark wasm32 as supporting STB_GNU_UNIQUE. * testsuite/binutils-all/nm.exp: Mark wasm32 as requiring .size annotations. * testsuite/binutils-all/wasm32: New directory. * testsuite/binutils-all/wasm32/create-wasm.d: New file. * testsuite/binutils-all/wasm32/create-wasm.s: Likewise. * testsuite/binutils-all/wasm32/custom-section.d: Likewise. * testsuite/binutils-all/wasm32/custom-section.s: Likewise. * testsuite/binutils-all/wasm32/invalid-wasm-1.d: Likewise. * testsuite/binutils-all/wasm32/invalid-wasm-1.s: Likewise. * testsuite/binutils-all/wasm32/long-sections.d: Likewise. * testsuite/binutils-all/wasm32/long-sections.s: Likewise. * testsuite/binutils-all/wasm32/parse-wasm.d: Likewise. * testsuite/binutils-all/wasm32/parse-wasm.s: Likewise. * testsuite/binutils-all/wasm32/parse-wasm-2.d: Likewise. * testsuite/binutils-all/wasm32/parse-wasm-2.s: Likewise. * testsuite/binutils-all/wasm32/prepared-section.d: Likewise. * testsuite/binutils-all/wasm32/prepared-section.s: Likewise. * testsuite/binutils-all/wasm32/wasm32.exp: New file, run tests. gas * config/tc-wasm32.h: New file: Add WebAssembly assembler target. * config/tc-wasm32.c: New file: Add WebAssembly assembler target. * Makefile.am: Add WebAssembly assembler target. * configure.tgt: Add WebAssembly assembler target. * doc/c-wasm32.texi: New file: Start documenting WebAssembly assembler. * doc/all.texi: Define WASM32. * doc/as.texinfo: Add WebAssembly entries. * NEWS: Mention the new support. * Makefile.in: Regenerate. * po/gas.pot: Regenerate. * po/POTFILES.in: Regenerate. * testsuite/gas/wasm32: New directory. * testsuite/gas/wasm32/allinsn.d: New file. * testsuite/gas/wasm32/allinsn.s: New file. * testsuite/gas/wasm32/illegal.l: New file. * testsuite/gas/wasm32/illegal.s: New file. * testsuite/gas/wasm32/illegal-2.l: New file. * testsuite/gas/wasm32/illegal-2.s: New file. * testsuite/gas/wasm32/illegal-3.l: New file. * testsuite/gas/wasm32/illegal-3.s: New file. * testsuite/gas/wasm32/illegal-4.l: New file. * testsuite/gas/wasm32/illegal-4.s: New file. * testsuite/gas/wasm32/illegal-5.l: New file. * testsuite/gas/wasm32/illegal-5.s: New file. * testsuite/gas/wasm32/illegal-6.l: New file. * testsuite/gas/wasm32/illegal-6.s: New file. * testsuite/gas/wasm32/illegal-7.l: New file. * testsuite/gas/wasm32/illegal-7.s: New file. * testsuite/gas/wasm32/illegal-8.l: New file. * testsuite/gas/wasm32/illegal-8.s: New file. * testsuite/gas/wasm32/illegal-9.l: New file. * testsuite/gas/wasm32/illegal-9.s: New file. * testsuite/gas/wasm32/illegal-10.l: New file. * testsuite/gas/wasm32/illegal-10.s: New file. * testsuite/gas/wasm32/illegal-11.l: New file. * testsuite/gas/wasm32/illegal-11.s: New file. * testsuite/gas/wasm32/illegal-12.l: New file. * testsuite/gas/wasm32/illegal-12.s: New file. * testsuite/gas/wasm32/illegal-13.l: New file. * testsuite/gas/wasm32/illegal-13.s: New file. * testsuite/gas/wasm32/illegal-14.l: New file. * testsuite/gas/wasm32/illegal-14.s: New file. * testsuite/gas/wasm32/illegal-15.l: New file. * testsuite/gas/wasm32/illegal-15.s: New file. * testsuite/gas/wasm32/illegal-16.l: New file. * testsuite/gas/wasm32/illegal-16.s: New file. * testsuite/gas/wasm32/illegal-17.l: New file. * testsuite/gas/wasm32/illegal-17.s: New file. * testsuite/gas/wasm32/illegal-18.l: New file. * testsuite/gas/wasm32/illegal-18.s: New file. * testsuite/gas/wasm32/illegal-19.l: New file. * testsuite/gas/wasm32/illegal-19.s: New file. * testsuite/gas/wasm32/illegal-20.l: New file. * testsuite/gas/wasm32/illegal-20.s: New file. * testsuite/gas/wasm32/illegal-21.l: New file. * testsuite/gas/wasm32/illegal-21.s: New file. * testsuite/gas/wasm32/illegal-22.l: New file. * testsuite/gas/wasm32/illegal-22.s: New file. * testsuite/gas/wasm32/illegal-24.l: New file. * testsuite/gas/wasm32/illegal-24.s: New file. * testsuite/gas/wasm32/illegal-25.l: New file. * testsuite/gas/wasm32/illegal-25.s: New file. * testsuite/gas/wasm32/reloc.d: New file. * testsuite/gas/wasm32/reloc.s: New file. * testsuite/gas/wasm32/wasm32.exp: New tests for WebAssembly architecture. opcodes * configure.ac: Add (empty) bfd_wasm32_arch target. * configure: Regenerate * po/opcodes.pot: Regenerate. include * opcode/wasm.h: New file to support wasm32 architecture. * elf/wasm32.h: Add R_WASM32_32 relocation. bfd * elf32-wasm32.c: Add relocation code, two relocs. * reloc.c: Add wasm32 relocations. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * bfd/po/bfd.pot: Regenerate. commit 662659a1a582af14aa45a458005e2a4df514b6d7 Author: Iain Buclaw Date: Thu Mar 30 10:43:03 2017 +0200 Fix classification of `module.type' in D lexer. The two-tier lexer in gdb/d-exp.y, which resolves fully qualified names missed a case where `module.type' was not being classified as one token. And so when the grammar takes over, it matched the remaining tokens against the rule `TypeExp . IdentifierExp', where we were expecting to instead match cast expression `( TypeExp ) UnaryExpression'. Adding a case for TYPE_CODE_MODULE in type_aggregate_p means that classify_inner_name will get a chance to lookup the symbol. This was noticed when using `watch -l', and got the rather confusing response: A syntax error in expression, near `) 0x0add4e55'. So it's been included in the testsuite, along with another test that does effectively the same expression, but explicitly. gdb/ChangeLog: * d-exp.y (type_aggregate_p): Treat TYPE_CODE_MODULE as being aggregate-like. gdb/testsuite/ChangeLog: * gdb.dlang/watch-loc.c: New file. * gdb.dlang/watch-loc.exp: New file. commit a62b75569b0e8038cf7c61350bf6fd5d0d6b64f8 Author: GDB Administrator Date: Thu Mar 30 00:00:41 2017 +0000 Automatic date update in version.in commit 72626a106545009c1054d6fdf7625fcc3e9b3dff Merge: 025edc4 ec13808 Author: Jan Kratochvil Date: Wed Mar 29 22:51:59 2017 +0200 Merge remote-tracking branch 'gdb/master' into indexcxx commit ec13808ef07550f8a5f87fad1945739da1f10c81 Author: Jan Kratochvil Date: Wed Mar 29 21:53:43 2017 +0200 Fix warning: Invalid entry in .debug_gdb_scripts section $ gdb rustc Reading symbols from rustc...Reading symbols from /usr/lib/debug/usr/bin/rustc.debug...done. done. warning: Invalid entry in .debug_gdb_scripts section /usr/bin/rustc Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts PROGBITS 00000000000008ed 0008ed 000022 00 AMS 0 0 1 /usr/lib/debug/usr/bin/rustc.debug Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts NOBITS 00000000000008ed 000280 000022 00 AMS 0 0 1 There remains questionable whether bfd_get_section_by_name() should not return an error for !SEC_LOAD but I haven't investigated that. gdb/ChangeLog 2017-03-29 Jan Kratochvil * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS. gdb/testsuite/ChangeLog 2017-03-29 Jan Kratochvil * gdb.python/py-section-script.exp (sepdebug): New testcases. commit f7c514a3784384215692c43d66f013d7640db277 Author: Jose E. Marchesi Date: Wed Mar 29 21:20:23 2017 +0200 opcodes: sparc: support missing SPARC ASIs from UA2005, UA2007, OSA2011, & OSA2015 commit 1231656410996d2cc271486adc743a0fafe2ab4d Author: Yao Qi Date: Wed Mar 29 16:56:31 2017 +0100 Add constructor and destructor to thread_info This patch adds constructor and destructor to thread_info. gdb: 2017-03-29 Yao Qi * gdbthread.h (struct thread_info): Declare constructor and destructor. Add some in-class member initializers. * thread.c (free_thread): Remove. (init_thread_list): Call delete instead of free_thread. (new_thread): Call thread_info constructor. (thread_info::thread_info): New function. (thread_info::~thread_info): New function. (delete_thread_1): Call delete instead of free_thread. (make_cleanup_restore_current_thread): Move tp and frame to inner block. commit 52be03fd13a26ecda4f27c451a434f19eded0ca6 Author: Alan Modra Date: Wed Mar 29 13:43:06 2017 +1030 PowerPC -Mraw disassembly This adds -Mraw for PowerPC objdump, a disassembler option to display the underlying machine instruction rather than aliases. For example, "rlwinm" always rather than "rotlwi" when the instruction is performing a simple rotate. binutils/ * doc/binutils.texi (objdump): Document PowerPC -M options. gas/ * config/tc-ppc.c (md_parse_option): Reject -mraw. include/ * opcode/ppc.h (PPC_OPCODE_RAW): Define. (PPC_OPCODE_*): Make them all unsigned long long constants. opcodes/ * ppc-dis.c (ppc_opts): Set PPC_OPCODE_PPC for "any" flags. Add "raw" option. (lookup_powerpc): Don't special case -1 dialect. Handle PPC_OPCODE_RAW. (print_insn_powerpc): Mask out PPC_OPCODE_ANY on first lookup_powerpc call, pass it on second. commit e643cb45bf85fa5c8c49a89ff177de246af4212e Author: Nick Clifton Date: Wed Mar 29 12:27:44 2017 +0100 Improve the speed of scanning PE binaries for line number information. PR binutils/18025 * coff-bfd.h (struct coff_section_data): Add new fields: saved_bias and bias. * coffgen.c (coff_find_nearest_line_with_names): Cache the bias computed for PE binaries. * dwarf2.c (scan_unit_for_symbols): Only warn once about each missing abbrev. commit 7cc0cd2903612a0730de6ba00181b9016e77ea3d Author: GDB Administrator Date: Wed Mar 29 00:00:28 2017 +0000 Automatic date update in version.in commit 086554e8e6b222518f12acab34e6cc7b5af7fde7 Author: Hans-Peter Nilsson Date: Tue Mar 28 23:43:09 2017 +0200 Fix for PR ld/16044: elf32-cris.c h->plt.refcount inconsistency commit fe5f7374bef8f23ffa0fe0dee0f9b05e0a218a29 Author: Anton Kolesov Date: Fri Feb 10 14:12:09 2017 +0300 arc: Add prologue analysis Add a prologue analysis that recognizes all instructions that may happen in compiler-generated prologue, including various stores, core register moves, subtraction and ENTER_S instruction that does a lot of prologue actions through microcode. Testcases cover various prologue scenarios, including instructions that are spread across multiple 16-bit encodings (for example there are 7 encodings of store instruction). gdb/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-tdep.c (arc_frame_cache): Add support for prologue analysis. (arc_skip_prologue): Likewise. (arc_make_frame_cache): Likewise. (arc_pv_get_operand): New function. (arc_is_in_prologue): Likewise. (arc_analyze_prologue): Likewise. (arc_print_frame_cache): Likewise. (MAX_PROLOGUE_LENGTH): New constant. gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov * gdb.texinfo (Synopsys ARC): Document "set debug arc 2". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov * gdb.arch/arc-analyze-prologue.S: New file. * gdb.arch/arc-analyze-prologue.exp: Likewise. commit eea787570f708e51048f812808e6cbd76fde6919 Author: Anton Kolesov Date: Fri Feb 10 14:12:06 2017 +0300 arc: Add disassembler helper Add disassembler helper for GDB, that uses opcodes structure arc_instruction and adds convenience functions to handle instruction operands. This interface solves at least those problems with arc_instruction: * Some instructions, like "push_s", have implicit operands which are not directly present in arc_instruction. * Operands of particular meaning, like branch/jump targets, have various locations and meaning depending on type of branch/target. * Access to operand value is abstracted into a separate function, so callee code shouldn't bother if operand value is an immediate value or in a register. Testcases included in this commit are fairly limited - they test exclusively branch instructions, something that will be used in software single stepping. Most of the other parts of this disassembler helper are tested during prologue analysis testing. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov * configure.tgt: Add arc-insn.o. * arc-tdep.c (arc_delayed_print_insn): Make non-static. (dump_arc_instruction_command): New function. (arc_fprintf_disasm): Likewise. (arc_disassemble_info): Likewise. (arc_insn_get_operand_value): Likewise. (arc_insn_get_operand_value_signed): Likewise. (arc_insn_get_memory_base_reg): Likewise. (arc_insn_get_memory_offset): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_dump): Likewise. (arc_insn_get_linear_next_pc): Likewise. * arc-tdep.h (arc_delayed_print_insn): Add function declaration. (arc_disassemble_info): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_get_linear_next_pc): Likewise. * NEWS: Mention new "maint print arc arc-instruction". gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov * gdb.texinfo (Synopsys ARC): Add "maint print arc arc-instruction". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov * gdb.arch/arc-decode-insn.S: New file. * gdb.arch/arc-decode-insn.exp: Likewise. commit 3be78afdeddd3ebf57eb0df8b029cf596f468c7a Author: Anton Kolesov Date: Fri Feb 10 14:12:01 2017 +0300 arc: Add "maintenance print arc" command prefix Add an "arc" sublist to "maintenance print" command list. The list is empty for now, its purpose is to contain commands that print internal state of some ARC-specific structures. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-tdep (maintenance_print_arc_list): New variable. (maintenance_print_arc_command): New function. commit 296ec4fa2afb14abc400fa0109d7288eb958c544 Author: Anton Kolesov Date: Fri Feb 10 14:11:46 2017 +0300 arc: Align internal regnums with architectural regnums Add ARC_LIMM_REGNUM to arc_regnum enumeration and assign a number 62 to it. This ensures that for core registers internal register numbers in this enum are the same as architectural numbers. This allows to use internal register numbers in the contexts where architectural number is implied, for example when disassembling instruction during prologue analysis. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-tdep.c (core_v2_register_names, core_arcompact_register_names) Add "limm" and "reserved". (arc_cannot_fetch_register, arc_cannot_store_register): Add ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM. * arc-tdep.h (arc_regnum): Likewise. commit 081c108e3688d67f257d4b98c9012ef2677b3b18 Author: GDB Administrator Date: Tue Mar 28 00:00:37 2017 +0000 Automatic date update in version.in commit a12e714b775ce025444af15dcfbd5a420363ad53 Author: Max Filippov Date: Fri Nov 18 16:08:48 2016 -0800 gdbserver: xtensa: support THREADPTR register Provide aceess to the THREADPTR register to remote gdb. gdb/gdbserver/ 2017-03-27 Max Filippov * linux-xtensa-low.c (regnum::R_THREADPTR): New enum member. (xtensa_fill_gregset): Call collect_register_by_name for threadptr register. (xtensa_store_gregset): Call supply_register_by_name for threadptr register. commit f74f865e5030057deb8a6a56af4a9e003d82cdcd Author: Max Filippov Date: Fri Nov 18 11:39:47 2016 -0800 gdb: xtensa-linux: support THREADPTR register Make THREADPTR user register accessible. gdb/ 2017-03-27 Max Filippov * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect for THREADPTR register. (supply_gregset_reg): Call regcache_raw_supply for THREADPTR register. * xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition. (xtensa_derive_tdep): Initialize tdep->threadptr_regnum. * xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field. commit 0d0bf81a6729478563c3851ccfca435222ddfa25 Author: Max Filippov Date: Tue Feb 21 15:41:31 2017 -0800 gdb: xtensa: fix test for privileged register number There are no a0-a15 pseudoregisters at the top of the register set in call0 registers layout. All registers above gdbarch_num_regs (gdbarch) are privileged. Treat them as such. This fixes the following gdb assertion seen when 'finish' command is invoked: regcache.c:649: internal-error: register_status regcache_raw_read(regcache*, int, gdb_byte*): Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed. gdb/ 2017-03-27 Max Filippov * xtensa-tdep.c (xtensa_pseudo_register_read): Treat all registers above gdbarch_num_regs (gdbarch) as privileged in call0 ABI. commit 1a09b50a463ad005946849540da136b5cbe6237b Author: Max Filippov Date: Fri Nov 18 08:58:21 2016 -0800 gdbserver: xtensa: add call0 support Correctly handle a0- registers on requests from remote gdb. This fixes 'Register 1 is not available' and subsequent assertion in the remote gdb connecting to the gdbserver: 'findvar.c:291: internal-error: value_of_register_lazy: Assertion `frame_id_p(get_frame_id (frame))' failed.' The register structure is the same for windowed and call0 ABIs because currently linux kernel internally requires windowed registers, so they are always present. gdb/gdbserver/ 2017-03-27 Max Filippov * linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register for all registers in a0_regnum..a0_regnum + C0_NREGS range. (xtensa_store_gregset): Call supply_register for all registers in a0_regnum..a0_regnum + C0_NREGS range. commit 0ce4291e3ffd90d2b94e02b4557d716c043bf02e Author: Max Filippov Date: Fri Nov 18 09:48:01 2016 -0800 gdb: xtensa-linux: add call0 support Correctly handle a0- registers. This allows debugging call0 code in linux natively. The register structure is the same for windowed and call0 ABIs because currently linux kernel internally requires windowed registers, so they are always present. gdb/ 2017-03-27 Max Filippov * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range. (supply_gregset_reg): Call regcache_raw_supply for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range. commit c56054f9a80e157e3d2d5109821abd191b68f0ea Author: Max Filippov Date: Tue Feb 21 17:14:37 2017 -0800 gdb: gdbserver: xtensa: make C0_NREGS available Both gdb and gdbserver need this definition to properly work with call0 ABI. Make it available to both. gdb/ 2017-03-27 Max Filippov * arch/xtensa.h (C0_NREGS): Add definition. * xtensa-tdep.c (C0_NREGS): Remove definition. commit a43986283d61ffd4d7dc9b20c0ecb73cd345206c Author: Max Filippov Date: Fri Nov 18 09:39:41 2016 -0800 gdb: xtensa: clean up xtensa_default_isa initialization This fixes segfault in native gdb because isa is not initialized at the point of call to xtensa_isa_maxlength. gdb/ 2017-03-27 Max Filippov * xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue): Drop xtensa_default_isa initialization. (xtensa_gdbarch_init): Initialize xtensa_default_isa. commit 8c43009f48a0d4be497cf7c1285784aa70fc5abd Author: Pedro Alves Date: Mon Mar 27 15:57:19 2017 +0100 dwarf2read.c: Clean up out of bounds handling Multiple places in dwarf2read.c open code 1-based to 0-based index conversion and check for out of bounds accesses to lh->include_dirs and lh->file_names. This commit factors those out to a couple methods and uses them throughout. gdb/ChangeLog: 2017-03-27 Pedro Alves * dwarf2read.c (file_entry) : Add comment. (file_entry::include_dir): New method. (line_header::include_dir_at, line_header::file_name_at): New methods. (setup_type_unit_groups, setup_type_unit_groups) (psymtab_include_file_name): Simplify using the new methods. (lnp_state_machine) : New field. : Add comment. (lnp_state_machine::current_file): New method. (dwarf_record_line): Simplify using the new methods. (init_lnp_state_machine): Initialize the "the_line_header" field. (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name): Simplify using the new methods. commit a7e80b9e21eb907ac5c90de7452588c059db0cec Author: Pedro Alves Date: Mon Mar 27 13:56:49 2017 +0100 gdb/cp-name-parser.y: Eliminate make_empty, use cplus_demangle_fill_component The demangler exports the cplus_demangle_fill_component function that clients should use to initialize demangle_component components that use the "s_binary" union member. cp-name-parser.y uses it in some places, via the fill_comp wrapper, but not all. Several places instead use a GDB-specific "make_empty" function. Because this function does not call any of the demangler "fill" functions, we had to patch it recently to clear the allocated demangle_component's "d_printing" field, which is supposedly a "private" demangler field. To avoid such problems in the future, this commit switches those places to use "fill_comp" instead, and eliminates the "make_empty" function. gdb/ChangeLog: 2017-03-27 Pedro Alves * cp-name-parser.y (make_empty): Delete. (demangler_special, nested_name, ptr_operator, array_indicator) (direct_declarator, declarator_1): Use fill_comp instead of make_empty. commit b1a42fdfa31937d7e05df34afee970ac0ad239e1 Author: Pedro Alves Date: Mon Mar 27 13:56:49 2017 +0100 cplus_demangle_fill_component: Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE This patch almost a decade ago: ... 2007-08-31 Douglas Gregor * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. (d_make_comp): Ditto. ... ... missed doing the same change to cplus_demangle_fill_component that was done to d_make_comp. I.e., teach it to only validate that we're not passing in a "right" subtree. GDB has recently (finally) learned about rvalue references, and a change to make it use cplus_demangle_fill_component more ran into an assertion because of this. (GDB is the only user of cplus_demangle_fill_component in both the gcc and binutils-gdb trees.) libiberty/ChangeLog: 2017-03-27 Pedro Alves * cp-demint.c (cplus_demangle_fill_component): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. commit a6be053897be3786ceda9a59d17befe11454f6d2 Author: Pip Cet Date: Mon Mar 27 13:41:39 2017 +0100 Add support for the WebAssembly backend to the BFD library. * wasm-module.c: New file to support WebAssembly modules. * wasm-module.h: New file to support WebAssembly modules. * doc/webassembly.texi: Start documenting wasm-module.c. * config.bfd: Add wasm_vec. * targets.c: Likewise. * configure.ac: Likewise. * Makefile.am: Add entries for wasm-module.c. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. commit 210477268d4ac5cad937e811888a5c932206794c Author: Pedro Alves Date: Mon Mar 27 12:28:03 2017 +0100 Fix gdb_xml_debug/gdb_xml_error ATTRIBUTE_PRINTF use The declarations of gdb_xml_debug and gdb_xml_error are passing "0" as "first-to-check" argument to ATTRIBUTE_PRINTF, as if they were va_args functions. Consequently, the arguments to gdb_xml_debug / gdb_xml_error aren't being checked against the format strings. With that fixed, a couple obvious bugs are exposed, both fixed by this commit. gdb/ChangeLog: 2017-03-27 Pedro Alves * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument to ATTRIBUTE_PRINTF. * solib-target.c (library_list_start_list): Print "string" not "version". * xml-tdesc.c (tdesc_start_field): Pass "field_name" to gdb_xml_error call. commit 9b7539374617a94c2d646f49e1bbfc954b11891d Author: Alan Modra Date: Mon Mar 27 08:19:48 2017 +1030 PR21303, objdump doesn't show e200z4 insns PR 21303 opcodes/ * ppc-dis.c (struct ppc_mopt): Comment. (ppc_opts ): Move PPC_OPCODE_VLE from .sticky to .cpu. gas/ * testsuite/gas/ppc/pr21303.d, * testsuite/gas/ppc/pr21303.s: New test * testsuite/gas/ppc/ppc.exp: Run it. commit d721ba37d8995b9c11a0b8eef0f4d2dc022f85aa Author: Pedro Alves Date: Mon Mar 27 11:56:28 2017 +0100 gdb: Make ldirname return a std::string Eliminates several uses of cleanups. Tested on x86_64 Fedora 23 with Python 2 and 3. gdb/ChangeLog 2017-03-27 Pedro Alves * dwarf2read.c (struct file_and_directory): New. (dwarf2_get_dwz_file): Adjust to use std::string. (dw2_get_file_names_reader): Adjust to use file_and_directory. (find_file_and_directory): Adjust to return a file_and_directory object. (read_file_scope): Adjust to use file_and_directory. Remove make_cleanup/do_cleanups calls. (open_and_init_dwp_file): Adjust to use std::string. Remove make_cleanup/do_cleanups calls. * python/python.c (do_start_initialization): Adjust to ldirname returning a std::string. * utils.c (ldirname): Now returns a std::string. * utils.h (ldirname): Change return type to std::string. * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname returning a std::string. * xml-tdesc.c (file_read_description_xml): Likewise. commit 79b1d3cb362385c38af9cfb44c0c87b939711fbc Author: Pip Cet Date: Mon Mar 27 11:45:24 2017 +0100 oops - forgot to add the bfd/ChangeLog entry... commit 8fb740dd3032543b833b141011aa2005c035d024 Author: Pip Cet Date: Mon Mar 27 11:39:50 2017 +0100 Add minimal support for WebAssembly backend to the BFD library. include * elf/wasm32.h: New file to support wasm32 architecture. bfd * cpu-wasm32.c: New file to support wasm32 architecture. * elf32-wasm32.c: New file to support wasm32 architecture. * Makefile.am: Add wasm32 architecture. * archures.c: Likewise. * config.bfd: Likewise. * configure.ac: Likewise. * targets.c: Likewise. commit c0c31e91adc6aabe7c96f02dd51a0f6200a982da Author: Rinat Zelig Date: Mon Mar 27 11:14:30 2017 +0100 Implement ARC NPS-400 Ultra Ip and Miscellaneous instructions. opcodes * arc-nps400-tbl.h: Add Ultra Ip and Miscellaneous instructions format. * arc-opc.c: Add defines. e.g. F_NJ, F_NM , F_NO_T, F_NPS_SR, F_NPS_M, F_NPS_CORE, F_NPS_ALL. (insert_nps_misc_imm_offset): New function. (extract_nps_misc imm_offset): New function. (arc_num_flag_operands): Add F_NJ, F_NM, F_NO_T. (arc_flag_special_cases): Add F_NJ, F_NM, F_NO_T. include * opcode/arc.h (insn_class_t): Add ULTRAIP and MISC class. gas * testsuite/gas/arc/nps400-12.s: New file. * testsuite/gas/arc/nps400-12.d: New file. commit cf31b44f3c4d839db0dcce10e0c4cc47d3be4ff1 Author: GDB Administrator Date: Mon Mar 27 00:00:35 2017 +0000 Automatic date update in version.in commit f124168208a5927e9f1b9843094ec2bf2aad2edf Author: Jim Wilson Date: Sat Mar 25 20:32:02 2017 -0700 Fix bug with cmn/adds where C flag was incorrectly set. sim/aarch64/ * simulator.c (set_flags_for_add32): Cast result to uint32_t in carry flag check. sim/testsuite/sim/aarch64/ * adds.s: Add checks for values -2 and 1, where C is not set. commit 7ed687b257a4182771079c582887498d0a98810c Author: GDB Administrator Date: Sun Mar 26 00:00:20 2017 +0000 Automatic date update in version.in commit 275c67ffb452f21f5c002cd0c7bbfd244848111d Author: GDB Administrator Date: Sat Mar 25 00:00:12 2017 +0000 Automatic date update in version.in commit ed771251e16c8c66cbdd03738135e76caef6937e Author: Alan Hayward Date: Fri Mar 24 16:53:05 2017 +0000 Remove MAX_REGISTER_SIZE from target.c gdb/ * regcache.c (regcache_debug_print_register): New function. * regcache.h (regcache_debug_print_register): New declaration. * target.c (debug_print_register): Remove. (target_fetch_registers): Call regcache_debug_print_register. (target_store_registers): Likewise. commit 568c1b9f503649d19ed1d17e6970f212e6b6317d Author: Pádraig Brady Date: Fri Mar 24 15:12:53 2017 +0000 Avoid segfault on invalid directory table gdb was segfaulting during backtrace on a binary here, where fe->dir_index parsed from the DWARF info was seen to access beyond the provided include_dirs array. This commit bounds the access to entries actually written to the array, and was verified to output the backtrace correctly. gdb/ChangeLog: * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't reference beyond the 'lh->include_dirs' array before accessing to it. (psymtab_include_file_name): Likewise. (dwarf_decode_lines_1): Likewise. (dwarf_decode_lines): Likewise. (file_file_name): Likewise. commit 62785b09987359ede74a98fac11343827f7181af Author: Thomas Preud'homme Date: Fri Mar 24 13:22:16 2017 +0000 [GAS/ARM] Fix selected_cpu with default CPU and -mcpu When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or -march option, selected_cpu will be set to the default CPU. This means the -mcpu is ignored which is surprising behavior. This commit instead sets selected_cpu from the value passed to -mcpu/-march. 2017-03-24 Thomas preud'homme gas/ * config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when CPU_DEFAULT is defined. commit c72cea5aec39df2d7a105755691a61460ee64f59 Author: Maciej W. Rozycki Date: Fri Mar 24 12:25:49 2017 +0000 readelf: Fix incorrect "Version definition past end of section" message (ChangeLog) Correct ChangeLog entry for commit c9f02c3e2949 ("readelf: Fix incorrect "Version definition past end of section" message"). commit cad1105d6a28e1199e82653619fbd63c2b9d4fa6 Author: GDB Administrator Date: Fri Mar 24 00:00:33 2017 +0000 Automatic date update in version.in commit 3e00d44febb8093d8dc0e6842b975afb194c4fd1 Author: Simon Marchi Date: Thu Mar 23 13:37:06 2017 -0400 Remove some unnecessary inferior_ptid setting/restoring when fetching/storing registers Now that the to_fetch_registers, to_store_registers and to_prepare_to_store target methods don't rely on the value of inferior_ptid anymore, we can remove a bunch of now unnecessary setting and restoring of inferior_ptid. The asserts added recently in target_fetch_registers and target_store_registers, which validate that inferior_ptid matches the regcache's ptid, must go away. It's the whole point of this effort, to not require inferior_ptid to have a particular value when calling these functions. One thing that I noticed is how sol-thread.c's ps_lgetregs and friends use the current value of inferior_ptid instead of what's passed as argument (ph->ptid), unlike proc-service.c's versions of the same functions. Is it expected? I left it like this in the current patch, but unless there's a good reason for it to be that way, I guess we should make it use the parameter. gdb/ChangeLog: * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore inferior_ptid. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * regcache.c (regcache_raw_update, regcache_raw_write): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * target.c (target_fetch_registers, target_store_registers): Remove asserts. commit 077ae656a69fcf144f68848a3f6f2cb559b62987 Author: Alan Hayward Date: Thu Mar 23 14:40:58 2017 +0000 Remove MAX_REGISTER_SIZE from sol-thread.c gdb/ * sol-thread.c (sol_thread_store_registers): Remove regcache calls. commit 1e2b521d987a34898ca959a33972be8912511ba0 Author: Yao Qi Date: Thu Mar 23 14:11:04 2017 +0000 Handle PRFM in AArch64 process record This patch fixes the bug of handling PRFM instruction. PRFM is documented in a table with other load and store instructions, but it doesn't do any load or store. This patch also adds a unit test to PRFM instruction. gdb: 2017-03-23 Yao Qi * aarch64-tdep.c (aarch64_process_record_test): Declare. (_initialize_aarch64_tdep): Register it. (aarch64_record_load_store): Handle PRFM instruction. (aarch64_process_record_test): New function. commit 338771252e913f82df8a445cb3e748a791b1cba8 Author: Yao Qi Date: Thu Mar 23 14:11:04 2017 +0000 Fix code indentation gdb: 2017-03-23 Yao Qi * aarch64-tdep.c (aarch64_record_load_store): Fix code indentation. commit a0eef9404b0fcfc8b0fbe7511d094a419ac631e9 Author: Yao Qi Date: Thu Mar 23 14:11:04 2017 +0000 Remove AARCH64_RECORD_FAILURE It is not used at all. gdb: 2017-03-23 Yao Qi * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE. commit 1a5e158b68d0fb3b1ba3d038e87c841239572a35 Author: Andreas Arnez Date: Thu Mar 23 12:51:14 2017 +0100 Remove constness of libdir in do_start_initialization The patch "Fix memory leak in python.c:do_start_initialization" (https://sourceware.org/ml/gdb-patches/2017-03/msg00407.html) introduced a compilation error on some platforms: ../../binutils-gdb/gdb/python/python.c: In function bool do_start_initialization(): ../../binutils-gdb/gdb/python/python.c:1556:16: error: invalid conversion from const void* to void* [-fpermissive] xfree (libdir); ^ This is fixed by removing the constness of libdir's data type. gdb/ChangeLog: * python/python.c (do_start_initialization): Remove 'const' from data type of libdir. commit 3f2a3564b1c3872e4a380f2484d40ce2495a4835 Author: Philipp Rudo Date: Thu Mar 23 12:22:11 2017 +0100 Fix memory leak in python.c:do_start_initialization When intializing Python the path to the python binary is build the following way progname = concat (ldirname (python_libdir), SLASH_STRING, "bin", SLASH_STRING, "python", (char *) NULL); This is problematic as both concat and ldirname allocate memory for the string they return. Thus the memory allocated by ldirname cannot be accessed afterwards causing a memory leak. Fix it by temporarily storing libdir in a variable and xfree it after concat. gdb/ChangeLog: python/python.c (do_start_initialization): Fix memory leak. commit ad36c6ce7c176a0bade3b3f09b801e65ab5ef93f Author: GDB Administrator Date: Thu Mar 23 00:00:42 2017 +0000 Automatic date update in version.in commit 19683c0408d66d9e48085fd5af009ad7d83aa3cd Author: Palmer Dabbelt Date: Tue Mar 21 08:36:44 2017 -0700 Sanitize RISC-V GAS help text, documentation It looks like I missed the GAS help text when going through all the documentation last time, so it printed some of the old-format (never upstream) arguments. I fixed this, and when I went to check doc/ I noticed it was missing the '-fpic'/'-fno-pic' options. ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 54 + bfd/Makefile.am | 6 + bfd/Makefile.in | 9 + bfd/archures.c | 4 + bfd/bfd-in2.h | 14 + bfd/coff-bfd.h | 2 + bfd/coffgen.c | 40 +- bfd/config.bfd | 6 + bfd/configure | 2 + bfd/configure.ac | 2 + bfd/cpu-wasm32.c | 36 + bfd/doc/webassembly.texi | 33 + bfd/dwarf2.c | 20 +- bfd/elf32-cris.c | 9 +- bfd/elf32-wasm32.c | 155 + bfd/libbfd.h | 10 + bfd/po/SRC-POTFILES.in | 3 + bfd/po/bfd.pot | 1348 ++++---- bfd/reloc.c | 23 + bfd/targets.c | 5 + bfd/version.h | 2 +- bfd/wasm-module.c | 839 +++++ bfd/wasm-module.h | 52 + binutils/ChangeLog | 38 + binutils/NEWS | 2 + binutils/doc/binutils.texi | 34 +- binutils/readelf.c | 9 + binutils/testsuite/binutils-all/nm.exp | 3 +- .../testsuite/binutils-all/wasm32/create-wasm.d | 10 + .../testsuite/binutils-all/wasm32/create-wasm.s | 6 + .../testsuite/binutils-all/wasm32/custom-section.d | 11 + .../testsuite/binutils-all/wasm32/custom-section.s | 4 + .../testsuite/binutils-all/wasm32/invalid-wasm-1.d | 6 + .../testsuite/binutils-all/wasm32/invalid-wasm-1.s | 7 + .../testsuite/binutils-all/wasm32/invalid-wasm-2.d | 6 + .../testsuite/binutils-all/wasm32/invalid-wasm-2.s | 7 + .../testsuite/binutils-all/wasm32/long-sections.d | 13 + .../testsuite/binutils-all/wasm32/long-sections.s | 9 + .../testsuite/binutils-all/wasm32/parse-wasm-2.d | 15 + .../testsuite/binutils-all/wasm32/parse-wasm-2.s | 43 + .../testsuite/binutils-all/wasm32/parse-wasm.d | 8 + .../testsuite/binutils-all/wasm32/parse-wasm.s | 7 + .../binutils-all/wasm32/prepared-section.d | 10 + .../binutils-all/wasm32/prepared-section.s | 6 + binutils/testsuite/binutils-all/wasm32/wasm32.exp | 29 + binutils/testsuite/lib/binutils-common.exp | 4 + gas/ChangeLog | 110 + gas/Makefile.am | 2 + gas/Makefile.in | 17 + gas/NEWS | 2 + gas/config/tc-arm.c | 4 +- gas/config/tc-ppc.c | 3 +- gas/config/tc-riscv.c | 24 +- gas/config/tc-s390.c | 6 +- gas/config/tc-wasm32.c | 821 +++++ gas/config/tc-wasm32.h | 89 + gas/configure.tgt | 3 + gas/doc/all.texi | 1 + gas/doc/as.texinfo | 9 +- gas/doc/c-riscv.texi | 8 + gas/doc/c-wasm32.texi | 119 + gas/po/POTFILES.in | 2 + gas/po/gas.pot | 3486 ++++++++++---------- gas/testsuite/gas/arc/nps400-12.d | 59 + gas/testsuite/gas/arc/nps400-12.s | 71 + gas/testsuite/gas/ppc/ppc.exp | 1 + gas/testsuite/gas/ppc/pr21303.d | 12 + gas/testsuite/gas/ppc/pr21303.s | 5 + gas/testsuite/gas/wasm32/allinsn.d | 198 ++ gas/testsuite/gas/wasm32/allinsn.s | 171 + gas/testsuite/gas/wasm32/illegal-10.l | 3 + gas/testsuite/gas/wasm32/illegal-10.s | 1 + gas/testsuite/gas/wasm32/illegal-11.l | 3 + gas/testsuite/gas/wasm32/illegal-11.s | 1 + gas/testsuite/gas/wasm32/illegal-12.l | 3 + gas/testsuite/gas/wasm32/illegal-12.s | 1 + gas/testsuite/gas/wasm32/illegal-13.l | 3 + gas/testsuite/gas/wasm32/illegal-13.s | 1 + gas/testsuite/gas/wasm32/illegal-14.l | 3 + gas/testsuite/gas/wasm32/illegal-14.s | 1 + gas/testsuite/gas/wasm32/illegal-15.l | 3 + gas/testsuite/gas/wasm32/illegal-15.s | 1 + gas/testsuite/gas/wasm32/illegal-16.l | 3 + gas/testsuite/gas/wasm32/illegal-16.s | 1 + gas/testsuite/gas/wasm32/illegal-17.l | 3 + gas/testsuite/gas/wasm32/illegal-17.s | 1 + gas/testsuite/gas/wasm32/illegal-18.l | 3 + gas/testsuite/gas/wasm32/illegal-18.s | 1 + gas/testsuite/gas/wasm32/illegal-19.l | 3 + gas/testsuite/gas/wasm32/illegal-19.s | 1 + gas/testsuite/gas/wasm32/illegal-2.l | 3 + gas/testsuite/gas/wasm32/illegal-2.s | 1 + gas/testsuite/gas/wasm32/illegal-20.l | 3 + gas/testsuite/gas/wasm32/illegal-20.s | 1 + gas/testsuite/gas/wasm32/illegal-21.l | 3 + gas/testsuite/gas/wasm32/illegal-21.s | 1 + gas/testsuite/gas/wasm32/illegal-22.l | 3 + gas/testsuite/gas/wasm32/illegal-24.l | 3 + gas/testsuite/gas/wasm32/illegal-24.s | 1 + gas/testsuite/gas/wasm32/illegal-25.l | 3 + gas/testsuite/gas/wasm32/illegal-25.s | 1 + gas/testsuite/gas/wasm32/illegal-3.l | 3 + gas/testsuite/gas/wasm32/illegal-3.s | 1 + gas/testsuite/gas/wasm32/illegal-4.l | 3 + gas/testsuite/gas/wasm32/illegal-4.s | 1 + gas/testsuite/gas/wasm32/illegal-5.l | 3 + gas/testsuite/gas/wasm32/illegal-5.s | 1 + gas/testsuite/gas/wasm32/illegal-6.l | 3 + gas/testsuite/gas/wasm32/illegal-6.s | 1 + gas/testsuite/gas/wasm32/illegal-7.l | 3 + gas/testsuite/gas/wasm32/illegal-7.s | 1 + gas/testsuite/gas/wasm32/illegal-8.l | 3 + gas/testsuite/gas/wasm32/illegal-8.s | 1 + gas/testsuite/gas/wasm32/illegal-9.l | 3 + gas/testsuite/gas/wasm32/illegal-9.s | 1 + gas/testsuite/gas/wasm32/illegal.l | 3 + gas/testsuite/gas/wasm32/illegal.s | 1 + gas/testsuite/gas/wasm32/reloc.d | 18 + gas/testsuite/gas/wasm32/reloc.s | 3 + gas/testsuite/gas/wasm32/wasm32.exp | 58 + gdb/ChangeLog | 202 ++ gdb/NEWS | 3 + gdb/aarch64-tdep.c | 75 +- gdb/arc-tdep.c | 852 +++++- gdb/arc-tdep.h | 41 + gdb/arch/xtensa.h | 2 + gdb/auto-load.c | 3 +- gdb/common/common-defs.h | 14 + gdb/cp-name-parser.y | 60 +- gdb/d-exp.y | 1 + gdb/doc/ChangeLog | 8 + gdb/doc/gdb.texinfo | 7 +- gdb/dwarf2read.c | 415 ++-- gdb/fbsd-tdep.c | 4 - gdb/gdbserver/.gitignore | 18 +- gdb/gdbserver/ChangeLog | 27 + gdb/gdbserver/Makefile.in | 68 +- gdb/gdbserver/linux-xtensa-low.c | 39 + gdb/gdbthread.h | 54 +- gdb/proc-service.c | 36 +- gdb/python/python.c | 2 +- gdb/regcache.c | 52 +- gdb/regcache.h | 6 + gdb/sol-thread.c | 57 +- gdb/solib-target.c | 2 +- gdb/target.c | 46 +- gdb/testsuite/ChangeLog | 14 + gdb/testsuite/gdb.arch/arc-analyze-prologue.S | 903 +++++ gdb/testsuite/gdb.arch/arc-analyze-prologue.exp | 201 ++ gdb/testsuite/gdb.arch/arc-decode-insn.S | 1002 ++++++ gdb/testsuite/gdb.arch/arc-decode-insn.exp | 132 + gdb/testsuite/gdb.dlang/watch-loc.c | 36 + gdb/testsuite/gdb.dlang/watch-loc.exp | 83 + gdb/testsuite/gdb.python/py-section-script.exp | 38 + gdb/thread.c | 69 +- gdb/utils.c | 10 +- gdb/utils.h | 2 +- gdb/xml-support.h | 4 +- gdb/xml-syscall.c | 8 +- gdb/xml-tdesc.c | 12 +- gdb/xtensa-linux-nat.c | 36 + gdb/xtensa-tdep.c | 15 +- gdb/xtensa-tdep.h | 1 + include/ChangeLog | 61 + include/elf/wasm32.h | 30 + include/opcode/arc.h | 14 +- include/opcode/ppc.h | 80 +- include/opcode/riscv-opc.h | 40 + include/opcode/wasm.h | 226 ++ ld/ChangeLog | 9 +- ld/testsuite/ld-cris/dso-1c.s | 2 + ld/testsuite/ld-cris/dso-2b.s | 2 + ld/testsuite/ld-cris/dso-4.s | 6 + ld/testsuite/ld-cris/pr16044.d | 43 + libiberty/ChangeLog | 5 + libiberty/cp-demint.c | 1 + opcodes/ChangeLog | 37 + opcodes/arc-nps400-tbl.h | 72 + opcodes/arc-opc.c | 880 +++-- opcodes/configure | 1 + opcodes/configure.ac | 1 + opcodes/po/opcodes.pot | 339 +- opcodes/ppc-dis.c | 42 +- opcodes/sparc-opc.c | 28 + sim/aarch64/ChangeLog | 5 + sim/aarch64/simulator.c | 2 +- sim/testsuite/sim/aarch64/ChangeLog | 4 + sim/testsuite/sim/aarch64/adds.s | 17 + 188 files changed, 11484 insertions(+), 3481 deletions(-) create mode 100644 bfd/cpu-wasm32.c create mode 100644 bfd/doc/webassembly.texi create mode 100644 bfd/elf32-wasm32.c create mode 100644 bfd/wasm-module.c create mode 100644 bfd/wasm-module.h create mode 100644 binutils/testsuite/binutils-all/wasm32/create-wasm.d create mode 100644 binutils/testsuite/binutils-all/wasm32/create-wasm.s create mode 100644 binutils/testsuite/binutils-all/wasm32/custom-section.d create mode 100644 binutils/testsuite/binutils-all/wasm32/custom-section.s create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.d create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-1.s create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.d create mode 100644 binutils/testsuite/binutils-all/wasm32/invalid-wasm-2.s create mode 100644 binutils/testsuite/binutils-all/wasm32/long-sections.d create mode 100644 binutils/testsuite/binutils-all/wasm32/long-sections.s create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm-2.d create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm-2.s create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm.d create mode 100644 binutils/testsuite/binutils-all/wasm32/parse-wasm.s create mode 100644 binutils/testsuite/binutils-all/wasm32/prepared-section.d create mode 100644 binutils/testsuite/binutils-all/wasm32/prepared-section.s create mode 100644 binutils/testsuite/binutils-all/wasm32/wasm32.exp create mode 100644 gas/config/tc-wasm32.c create mode 100644 gas/config/tc-wasm32.h create mode 100644 gas/doc/c-wasm32.texi create mode 100644 gas/testsuite/gas/arc/nps400-12.d create mode 100644 gas/testsuite/gas/arc/nps400-12.s create mode 100644 gas/testsuite/gas/ppc/pr21303.d create mode 100644 gas/testsuite/gas/ppc/pr21303.s create mode 100644 gas/testsuite/gas/wasm32/allinsn.d create mode 100644 gas/testsuite/gas/wasm32/allinsn.s create mode 100644 gas/testsuite/gas/wasm32/illegal-10.l create mode 100644 gas/testsuite/gas/wasm32/illegal-10.s create mode 100644 gas/testsuite/gas/wasm32/illegal-11.l create mode 100644 gas/testsuite/gas/wasm32/illegal-11.s create mode 100644 gas/testsuite/gas/wasm32/illegal-12.l create mode 100644 gas/testsuite/gas/wasm32/illegal-12.s create mode 100644 gas/testsuite/gas/wasm32/illegal-13.l create mode 100644 gas/testsuite/gas/wasm32/illegal-13.s create mode 100644 gas/testsuite/gas/wasm32/illegal-14.l create mode 100644 gas/testsuite/gas/wasm32/illegal-14.s create mode 100644 gas/testsuite/gas/wasm32/illegal-15.l create mode 100644 gas/testsuite/gas/wasm32/illegal-15.s create mode 100644 gas/testsuite/gas/wasm32/illegal-16.l create mode 100644 gas/testsuite/gas/wasm32/illegal-16.s create mode 100644 gas/testsuite/gas/wasm32/illegal-17.l create mode 100644 gas/testsuite/gas/wasm32/illegal-17.s create mode 100644 gas/testsuite/gas/wasm32/illegal-18.l create mode 100644 gas/testsuite/gas/wasm32/illegal-18.s create mode 100644 gas/testsuite/gas/wasm32/illegal-19.l create mode 100644 gas/testsuite/gas/wasm32/illegal-19.s create mode 100644 gas/testsuite/gas/wasm32/illegal-2.l create mode 100644 gas/testsuite/gas/wasm32/illegal-2.s create mode 100644 gas/testsuite/gas/wasm32/illegal-20.l create mode 100644 gas/testsuite/gas/wasm32/illegal-20.s create mode 100644 gas/testsuite/gas/wasm32/illegal-21.l create mode 100644 gas/testsuite/gas/wasm32/illegal-21.s create mode 100644 gas/testsuite/gas/wasm32/illegal-22.l create mode 100644 gas/testsuite/gas/wasm32/illegal-24.l create mode 100644 gas/testsuite/gas/wasm32/illegal-24.s create mode 100644 gas/testsuite/gas/wasm32/illegal-25.l create mode 100644 gas/testsuite/gas/wasm32/illegal-25.s create mode 100644 gas/testsuite/gas/wasm32/illegal-3.l create mode 100644 gas/testsuite/gas/wasm32/illegal-3.s create mode 100644 gas/testsuite/gas/wasm32/illegal-4.l create mode 100644 gas/testsuite/gas/wasm32/illegal-4.s create mode 100644 gas/testsuite/gas/wasm32/illegal-5.l create mode 100644 gas/testsuite/gas/wasm32/illegal-5.s create mode 100644 gas/testsuite/gas/wasm32/illegal-6.l create mode 100644 gas/testsuite/gas/wasm32/illegal-6.s create mode 100644 gas/testsuite/gas/wasm32/illegal-7.l create mode 100644 gas/testsuite/gas/wasm32/illegal-7.s create mode 100644 gas/testsuite/gas/wasm32/illegal-8.l create mode 100644 gas/testsuite/gas/wasm32/illegal-8.s create mode 100644 gas/testsuite/gas/wasm32/illegal-9.l create mode 100644 gas/testsuite/gas/wasm32/illegal-9.s create mode 100644 gas/testsuite/gas/wasm32/illegal.l create mode 100644 gas/testsuite/gas/wasm32/illegal.s create mode 100644 gas/testsuite/gas/wasm32/reloc.d create mode 100644 gas/testsuite/gas/wasm32/reloc.s create mode 100644 gas/testsuite/gas/wasm32/wasm32.exp create mode 100644 gdb/testsuite/gdb.arch/arc-analyze-prologue.S create mode 100644 gdb/testsuite/gdb.arch/arc-analyze-prologue.exp create mode 100644 gdb/testsuite/gdb.arch/arc-decode-insn.S create mode 100644 gdb/testsuite/gdb.arch/arc-decode-insn.exp create mode 100644 gdb/testsuite/gdb.dlang/watch-loc.c create mode 100644 gdb/testsuite/gdb.dlang/watch-loc.exp create mode 100644 include/elf/wasm32.h create mode 100644 include/opcode/wasm.h create mode 100644 ld/testsuite/ld-cris/dso-1c.s create mode 100644 ld/testsuite/ld-cris/dso-2b.s create mode 100644 ld/testsuite/ld-cris/dso-4.s create mode 100644 ld/testsuite/ld-cris/pr16044.d First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 50e76c2..bb851c7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,57 @@ +2017-03-30 Pip Cet + + * elf32-wasm32.c: Add relocation code, two relocs. + * reloc.c: Add wasm32 relocations. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * bfd/po/bfd.pot: Regenerate. + +2017-03-29 Nick Clifton + + PR binutils/18025 + * coff-bfd.h (struct coff_section_data): Add new fields: + saved_bias and bias. + * coffgen.c (coff_find_nearest_line_with_names): Cache the bias + computed for PE binaries. + * dwarf2.c (scan_unit_for_symbols): Only warn once about each + missing abbrev. + +2017-03-28 Hans-Peter Nilsson + + PR ld/16044 + * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT + to handle a local symbol with a hash-symbol-entry; without PLT. + Add BFD_ASSERT for an incidental case with GOT entry present. + (cris_elf_check_relocs): Increment PLT refcount only if the symbol + isn't forced-or-set local. + +2017-03-27 Pip Cet + + * wasm-module.c: New file to support WebAssembly modules. + * wasm-module.h: New file to support WebAssembly modules. + * doc/webassembly.texi: Start documenting wasm-module.c. + * config.bfd: Add wasm_vec. + * targets.c: Likewise. + * configure.ac: Likewise. + * Makefile.am: Add entries for wasm-module.c. + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2017-03-27 Pip Cet + + * cpu-wasm32.c: New file to support wasm32 architecture. + * elf32-wasm32.c: New file to support wasm32 architecture. + * Makefile.am: Add wasm32 architecture. + * archures.c: Likewise. + * config.bfd: Likewise. + * configure.ac: Likewise. + * targets.c: Likewise. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + 2017-03-20 Alan Modra PR 21266 diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 0b02263..49ab092 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -169,6 +169,7 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-visium.lo \ cpu-w65.lo \ + cpu-wasm32.lo \ cpu-we32k.lo \ cpu-xc16x.lo \ cpu-xgate.lo \ @@ -257,6 +258,7 @@ ALL_MACHINES_CFILES = \ cpu-v850_rh850.c \ cpu-vax.c \ cpu-visium.c \ + cpu-wasm32.c \ cpu-w65.c \ cpu-we32k.c \ cpu-xc16x.c \ @@ -383,6 +385,7 @@ BFD32_BACKENDS = \ elf32-v850.lo \ elf32-vax.lo \ elf32-visium.lo \ + elf32-wasm32.lo \ elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ @@ -456,6 +459,7 @@ BFD32_BACKENDS = \ versados.lo \ vms-lib.lo \ vms-misc.lo \ + wasm-module.lo \ xcofflink.lo \ xsym.lo \ xtensa-isa.lo \ @@ -576,6 +580,7 @@ BFD32_BACKENDS_CFILES = \ elf32-v850.c \ elf32-vax.c \ elf32-visium.c \ + elf32-wasm32.c \ elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ @@ -648,6 +653,7 @@ BFD32_BACKENDS_CFILES = \ versados.c \ vms-lib.c \ vms-misc.c \ + wasm-module.c \ xcofflink.c \ xsym.c \ xtensa-isa.c \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 096c7ef..fed5117 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -502,6 +502,7 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-visium.lo \ cpu-w65.lo \ + cpu-wasm32.lo \ cpu-we32k.lo \ cpu-xc16x.lo \ cpu-xgate.lo \ @@ -590,6 +591,7 @@ ALL_MACHINES_CFILES = \ cpu-v850_rh850.c \ cpu-vax.c \ cpu-visium.c \ + cpu-wasm32.c \ cpu-w65.c \ cpu-we32k.c \ cpu-xc16x.c \ @@ -717,6 +719,7 @@ BFD32_BACKENDS = \ elf32-v850.lo \ elf32-vax.lo \ elf32-visium.lo \ + elf32-wasm32.lo \ elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ @@ -790,6 +793,7 @@ BFD32_BACKENDS = \ versados.lo \ vms-lib.lo \ vms-misc.lo \ + wasm-module.lo \ xcofflink.lo \ xsym.lo \ xtensa-isa.lo \ @@ -910,6 +914,7 @@ BFD32_BACKENDS_CFILES = \ elf32-v850.c \ elf32-vax.c \ elf32-visium.c \ + elf32-wasm32.c \ elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ @@ -982,6 +987,7 @@ BFD32_BACKENDS_CFILES = \ versados.c \ vms-lib.c \ vms-misc.c \ + wasm-module.c \ xcofflink.c \ xsym.c \ xtensa-isa.c \ @@ -1446,6 +1452,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-vax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-visium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-w65.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-wasm32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-we32k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xgate.Plo@am__quote@ @@ -1534,6 +1541,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-v850.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-vax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-visium.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-wasm32.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xgate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xstormy16.Plo@am__quote@ @@ -1665,6 +1673,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-alpha.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-lib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vms-misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wasm-module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcofflink.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsym.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtensa-isa.Plo@am__quote@ diff --git a/bfd/archures.c b/bfd/archures.c index c909db0..c6e7152 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -528,6 +528,8 @@ DESCRIPTION .#define bfd_mach_nios2r2 2 . bfd_arch_visium, {* Visium *} .#define bfd_mach_visium 1 +. bfd_arch_wasm32, {* WebAssembly *} +.#define bfd_mach_wasm32 1 . bfd_arch_pru, {* PRU *} .#define bfd_mach_pru 0 . bfd_arch_last @@ -654,6 +656,7 @@ extern const bfd_arch_info_type bfd_v850_arch; extern const bfd_arch_info_type bfd_v850_rh850_arch; extern const bfd_arch_info_type bfd_vax_arch; extern const bfd_arch_info_type bfd_visium_arch; +extern const bfd_arch_info_type bfd_wasm32_arch; extern const bfd_arch_info_type bfd_w65_arch; extern const bfd_arch_info_type bfd_we32k_arch; extern const bfd_arch_info_type bfd_xstormy16_arch; @@ -746,6 +749,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_vax_arch, &bfd_visium_arch, &bfd_w65_arch, + &bfd_wasm32_arch, &bfd_we32k_arch, &bfd_xstormy16_arch, &bfd_xtensa_arch, diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 59403af..fbd379f 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2372,6 +2372,8 @@ enum bfd_architecture #define bfd_mach_nios2r2 2 bfd_arch_visium, /* Visium */ #define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly */ +#define bfd_mach_wasm32 1 bfd_arch_pru, /* PRU */ #define bfd_mach_pru 0 bfd_arch_last @@ -6462,6 +6464,18 @@ assembler and not (currently) written to any object files. */ BFD_RELOC_VISIUM_HI16_PCREL, BFD_RELOC_VISIUM_LO16_PCREL, BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; diff --git a/bfd/coff-bfd.h b/bfd/coff-bfd.h index c76bf3a..97117b3 100644 --- a/bfd/coff-bfd.h +++ b/bfd/coff-bfd.h @@ -50,6 +50,8 @@ struct coff_section_tdata /* If this is TRUE, the contents entry may not be freed. */ bfd_boolean keep_contents; /* Information cached by coff_find_nearest_line. */ + bfd_boolean saved_bias; + bfd_signed_vma bias; bfd_vma offset; unsigned int i; const char *function; diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 5a61f6d..3c60ed4 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -2259,6 +2259,8 @@ coff_find_nearest_line_with_names (bfd *abfd, &coff_data(abfd)->dwarf2_find_line_info)) return TRUE; + sec_data = coff_section_data (abfd, section); + /* If the DWARF lookup failed, but there is DWARF information available then the problem might be that the file has been rebased. This tool changes the VMAs of all the sections, but it does not update the DWARF @@ -2267,8 +2269,26 @@ coff_find_nearest_line_with_names (bfd *abfd, { bfd_signed_vma bias; - bias = _bfd_dwarf2_find_symbol_bias (symbols, - & coff_data (abfd)->dwarf2_find_line_info); + /* Create a cache of the result for the next call. */ + if (sec_data == NULL && section->owner == abfd) + { + amt = sizeof (struct coff_section_tdata); + section->used_by_bfd = bfd_zalloc (abfd, amt); + sec_data = (struct coff_section_tdata *) section->used_by_bfd; + } + + if (sec_data != NULL && sec_data->saved_bias) + bias = sec_data->saved_bias; + else + { + bias = _bfd_dwarf2_find_symbol_bias (symbols, + & coff_data (abfd)->dwarf2_find_line_info); + if (sec_data) + { + sec_data->saved_bias = TRUE; + sec_data->bias = bias; + } + } if (bias && _bfd_dwarf2_find_nearest_line (abfd, symbols, NULL, section, @@ -2363,10 +2383,16 @@ coff_find_nearest_line_with_names (bfd *abfd, } } - /* Now wander though the raw linenumbers of the section. */ - /* If we have been called on this section before, and the offset we - want is further down then we can prime the lookup loop. */ - sec_data = coff_section_data (abfd, section); + if (section->lineno_count == 0) + { + *functionname_ptr = NULL; + *line_ptr = 0; + return TRUE; + } + + /* Now wander though the raw linenumbers of the section. + If we have been called on this section before, and the offset + we want is further down then we can prime the lookup loop. */ if (sec_data != NULL && sec_data->i > 0 && offset >= sec_data->offset) @@ -2395,6 +2421,7 @@ coff_find_nearest_line_with_names (bfd *abfd, coff_symbol_type *coff = (coff_symbol_type *) (l->u.sym); if (coff->symbol.value > offset) break; + *functionname_ptr = coff->symbol.name; last_value = coff->symbol.value; if (coff->native) @@ -2451,6 +2478,7 @@ coff_find_nearest_line_with_names (bfd *abfd, section->used_by_bfd = bfd_zalloc (abfd, amt); sec_data = (struct coff_section_tdata *) section->used_by_bfd; } + if (sec_data != NULL) { sec_data->offset = offset; diff --git a/bfd/config.bfd b/bfd/config.bfd index 52db9a4..1235c2c 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -197,6 +197,7 @@ tilegx*) targ_archs=bfd_tilegx_arch ;; tilepro*) targ_archs=bfd_tilepro_arch ;; v850*) targ_archs="bfd_v850_arch bfd_v850_rh850_arch" ;; visium*) targ_archs=bfd_visium_arch ;; +wasm32) targ_archs=bfd_wasm32_arch ;; x86_64*) targ_archs=bfd_i386_arch ;; xtensa*) targ_archs=bfd_xtensa_arch ;; xgate) targ_archs=bfd_xgate_arch ;; @@ -1793,6 +1794,11 @@ case "${targ}" in targ_defvec=visium_elf32_vec ;; + wasm32-*-*) + targ_defvec=wasm32_elf32_vec + targ_selvecs="wasm_vec" + ;; + we32k-*-*) targ_defvec=we32k_coff_vec ;; diff --git a/bfd/configure b/bfd/configure index 83256d2..7cae4ae 100755 --- a/bfd/configure +++ b/bfd/configure @@ -14569,6 +14569,8 @@ do ft32_elf32_vec) tb="$tb elf32-ft32.lo elf32.lo $elf" ;; visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; + wasm_vec) tb="$tb wasm-module.lo" ;; + wasm32_elf32_vec) tb="$tb elf32-wasm32.lo elf32.lo $elf" ;; we32k_coff_vec) tb="$tb coff-we32k.lo $coffgen" ;; x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; diff --git a/bfd/configure.ac b/bfd/configure.ac index ee0c537..feb1231 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -700,6 +700,8 @@ do ft32_elf32_vec) tb="$tb elf32-ft32.lo elf32.lo $elf" ;; visium_elf32_vec) tb="$tb elf32-visium.lo elf32.lo $elf" ;; w65_coff_vec) tb="$tb coff-w65.lo reloc16.lo $coffgen" ;; + wasm_vec) tb="$tb wasm-module.lo" ;; + wasm32_elf32_vec) tb="$tb elf32-wasm32.lo elf32.lo $elf" ;; we32k_coff_vec) tb="$tb coff-we32k.lo $coffgen" ;; x86_64_coff_vec) tb="$tb coff-x86_64.lo $coff"; target_size=64 ;; x86_64_elf32_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf32.lo $elf"; target_size=64 ;; diff --git a/bfd/cpu-wasm32.c b/bfd/cpu-wasm32.c new file mode 100644 index 0000000..19d4cb9 --- /dev/null +++ b/bfd/cpu-wasm32.c @@ -0,0 +1,36 @@ +/* BFD support for the WebAssembly target + Copyright (C) 2017 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "sysdep.h" +#include "bfd.h" +#include "libbfd.h" +#include "libiberty.h" + +#define N(number, print, default, next) \ +{ 32, 32, 8, bfd_arch_wasm32, number, "wasm32", "wasm32", 4, default, bfd_default_compatible, \ + bfd_default_scan, bfd_arch_default_fill, next } + +static const bfd_arch_info_type arch_info_struct[] = +{ + N (bfd_mach_wasm32, "wasm32", TRUE, NULL) +}; + +const bfd_arch_info_type bfd_wasm32_arch = + N (bfd_mach_wasm32, "wasm32", TRUE, & arch_info_struct[0]); diff --git a/bfd/doc/webassembly.texi b/bfd/doc/webassembly.texi new file mode 100644 index 0000000..ad65094 --- /dev/null +++ b/bfd/doc/webassembly.texi @@ -0,0 +1,33 @@ +@section WebAssembly backend +The WebAssembly module file format, at present, is a very simple +object file format with up to 11 numbered sections plus named +``custom'' sections. At present, there is no standard for relocations +or symbols, though a @code{"name"} subsection can assign names to +function indices and local variables. + +As such, it offers no real advantages over ELF, and intermediate ELF +files can be used to produce WebAssembly modules. The WebAssembly +backend aims to enable the opposite: reading a WebAssembly module and +producing an ELF file containing the same information, which can then +be manipulated and inspected with standard tools. + +When writing WebAssembly modules, the WebAssembly backend attempts to +determine based on the section name whether to use a numeric section +id, a named section header, or to include the section verbatim, +assuming it already contains any necessary header. + +Function names are supported as symbols; local names and WebAssembly +relocation sections are currently unsupported. + +There are slight differences in the LEB128 integer implementations +between the WebAssembly specification and the BFD code; these result +in some malformed WebAssembly modules being treated as valid. + +@menu +* File layout:: +@end menu + +@node File layout, WebAssembly +@subsection File layout +For a description of the WebAssembly file format, see +@url{https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md}. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 722ee0d..132a674 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -2738,12 +2738,19 @@ scan_unit_for_symbols (struct comp_unit *unit) continue; } - abbrev = lookup_abbrev (abbrev_number,unit->abbrevs); + abbrev = lookup_abbrev (abbrev_number, unit->abbrevs); if (! abbrev) { - _bfd_error_handler - (_("Dwarf Error: Could not find abbrev number %u."), - abbrev_number); + static unsigned int previous_failed_abbrev = -1U; + + /* Avoid multiple reports of the same missing abbrev. */ + if (abbrev_number != previous_failed_abbrev) + { + _bfd_error_handler + (_("Dwarf Error: Could not find abbrev number %u."), + abbrev_number); + previous_failed_abbrev = abbrev_number; + } bfd_set_error (bfd_error_bad_value); hooks/post-receive -- Repository for Project Archer.