aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-07-24Fix address violation errors parsing corrupt binary files.Nick Clifton10-24/+118
PR 21813 binutils* rddbg.c (read_symbol_stabs_debugging_info): Check for an empty string whilst concatenating symbol names. bfd * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address of the relocs to the canonicalize_one_reloc routine. * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype for the _bfd_mach_o_canonicalize_one_reloc field. * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add res_base parameter. Use to check for corrupt pair relocs. * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc): Likewise. * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Likewise. * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc): Likewise. * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is enough data in the record before attempting to parse it. (_bfd_vms_slurp_eeom): Likewise. (_bfd_vms_slurp_egsd): Check for an invalid section index. (image_set_ptr): Likewise. (alpha_vms_slurp_relocs): Likewise.
2017-07-24Stop the generation of mapping symbols in the debug sections of ARM and ↵Nick Clifton3-1/+18
AArch64 binaries. PR 21809 * config/tc-aarch64.c (aarch64_init_frag): Do not set a mapping state for frags in debug sections. * config/tc-arm.c (arm_init_frag): Likewise.
2017-07-24Improve "unrecognized relocation" error messages to add the suggestion that ↵Nick Clifton9-51/+69
the linker might be out of date. PR 21803 * reloc.c (_bfd_unrecognized_reloc): New function. Reports an unrecognized reloc and sets the bfd_error value. * libbfd.h: Regenerate. * elf32-arm.c (elf32_arm_final_link_relocate): Use the new function. * elf32-i386.c (elf_i386_relocate_section): Likewise. * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise. * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2017-07-24[ARC] Fix big-endian ld tests errors.claziss4-5/+13
A set of small patches that are fixing big-endian observed errors. ld/ 2017-07-24 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/ld-arc/jli-overflow.d: Force testing for little endian. * testsuite/ld-arc/tls_gd-01.d: Fix string to match bigendian systems. * testsuite/ld-arc/tls_ie-01.d: Fix test for bigendian systems.
2017-07-24Automatic date update in version.inGDB Administrator1-1/+1
2017-07-24* dwarf2dbg.c (dwarf2dbg_final_check): Rename local variable exp from expr.Hans-Peter Nilsson2-5/+10
Trying to build (for mmix-knuth-mmixware but I don't think that matters) yields the following (repeatable on e.g. CompileFarm gcc20 sporting gcc-4.7.2 as default): gcc -DHAVE_CONFIG_H -I. -I/home/hp/binutils/src/gas -I. -I/home/hp/binutils/src/gas -I../bfd -I/home/hp/binutils/src/gas/config -I/home/hp/binutils/src/gas/../include -I/home/hp/binutils/src/gas/.. -I/home/hp/binutils/src/gas/../bfd -DLOCALEDIR="\"/usr/local/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -Wwrite-strings -I/home/hp/binutils/src/gas/../zlib -g -O2 -MT dwarf2dbg.o -MD -MP -MF .deps/dwarf2dbg.Tpo -c -o dwarf2dbg.o /home/hp/binutils/src/gas/dwarf2dbg.c cc1: warnings being treated as errors /home/hp/binutils/src/gas/dwarf2dbg.c: In function 'dwarf2dbg_final_check': /home/hp/binutils/src/gas/dwarf2dbg.c:2246: error: declaration of 'expr' shadows a global declaration /home/hp/binutils/src/gas/expr.h:180: error: shadowed declaration is here make[4]: *** [dwarf2dbg.o] Error 1 IIRC this is a false namespace clash and the warning is not observable with a new-enough gcc. Committed as obvious. brgds, H-P PS. Idea: -Wcompiler; warn about constructs problematic with e.g. old gcc. 1/2 ;-)
2017-07-23Correct eh_frame info for __glink_PLTresolveAlan Modra4-3/+15
My PPC64_OPT_LOCALENTRY patch of June 1, git commit f378ab099d, and the later gold change, git commit 7ee7ff7015, added an insn in __glink_PLTresolve which needs a corresponding adjustment in the eh_frame info for asynchronous exceptions to unwind correctly. It would have been OK for both ABIs to use +5 for the advance before restore of LR, since we can put the DW_CFA_restore_extended on any insn after the actual restore and before the r12/r0 copy is clobbered, but it's slightly better to delay as much as possible. There are then more addresses where fewer CFA program insns are executed. bfd/ * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to restore of LR. gold/ * powerpc.cc (glink_eh_frame_fde_64v2): Correct advance to restore of LR. (glink_eh_frame_fde_64v1): Advance to restore of LR at latest possible insn.
2017-07-23Automatic date update in version.inGDB Administrator1-1/+1
2017-07-22Use std::vector in struct catch_syscall_inferior_dataTom Tromey2-31/+25
This changes struct catch_syscall_inferior_data to use a std::vector rather than a VEC. It also changes it to be allocated with new and destroyed with delete. ChangeLog 2017-07-22 Tom Tromey <tom@tromey.com> * break-catch-syscall.c (struct catch_syscall_inferior_data) <syscalls_counts>: Now a std::vector. (get_catch_syscall_inferior_data): Use "new". (catch_syscall_inferior_data_cleanup): Use "delete". (insert_catch_syscall, remove_catch_syscall) (clear_syscall_counts): Update.
2017-07-22Use std::vector in syscall_catchpointTom Tromey2-79/+50
This changes syscall_catchpoint to use a std::vector rather than a VEC for "syscalls_to_be_caught". This simplifies the code a bit. ChangeLog 2017-07-22 Tom Tromey <tom@tromey.com> * break-catch-syscall.c (syscall_catchpoint) <syscalls_to_be_caught>: Now a std::vector<int> (~syscall_catchpoint): Remove. (insert_catch_syscall, remove_catch_syscall) (breakpoint_hit_catch_syscall, print_one_catch_syscall) (print_mention_catch_syscall, print_recreate_catch_syscall): Update. (create_syscall_event_catchpoint): Change type of "filter" parameter. (catch_syscall_split_args): Return a std::vector. (catch_syscall_command_1, catching_syscall_number_1): Update.
2017-07-22C++-ify break-catch-throwTom Tromey2-27/+23
This changes exception_catchpoint's "exception_rx' member to be a std::string, and updating the users. ChangeLog 2017-07-22 Tom Tromey <tom@tromey.com> * break-catch-throw.c (struct exception_catchpoint) <exception_rx>: Now a std::string. (~exception_catchpoint): Remove. (print_one_detail_exception_catchpoint): Update. (handle_gnu_v3_exceptions): Change type of except_rx. (extract_exception_regexp): Return a std::string. (catch_exception_command_1): Update.
2017-07-22C++-ify break-catch-sigTom Tromey2-104/+74
This changes signal_catchpoint to be more of a C++ class, using std::vector and updating the users. ChangeLog 2017-07-22 Tom Tromey <tom@tromey.com> * break-catch-sig.c (gdb_signal_type): Remove typedef. (struct signal_catchpoint) <signals_to_be_caught>: Now a std::vector. <catch_all>: Now a bool. (~signal_catchpoint): Remove. (signal_catchpoint_insert_location) (signal_catchpoint_remove_location) (signal_catchpoint_breakpoint_hit, signal_catchpoint_print_one) (signal_catchpoint_print_mention) (signal_catchpoint_print_recreate) (signal_catchpoint_explains_signal): Update. (create_signal_catchpoint): Change type of "filter" and "catch_all". (catch_signal_split_args): Return a std::vector. Change type of "catch_all". (catch_signal_command): Update.
2017-07-22Automatic date update in version.inGDB Administrator1-1/+1
2017-07-22gdb.python/py-unwind: Disable stack protectionSimon Marchi2-1/+11
[I made some typo fixes but forgot to amend my commit before sending the patch, hence this v2.] I see the following failure on Ubuntu 16.04's gcc 5.4.0: Running /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.python/py-unwind.exp ... FAIL: gdb.python/py-unwind.exp: continue to breakpoint: break backtrace-broken FAIL: gdb.python/py-unwind.exp: Backtrace restored by unwinder (pattern 1) The problem is that the test expects a very particular stack layout. When stack protection is enabled, it adds a canary value which looks like an additional local variable. This makes the test complain about a bad stack layout and fail. The simple solution is to disable stack protection for that test using -fno-stack-protector. I checked older compilers (gcc 4.4, clang 3.5) and they support that flag, so I don't think it's necessary to probe for whether the compiler supports it. Maybe a better solution would be to change the test to make it cope with different stack layouts (perhaps it could save addresses of stuff in some global variables which GDB/the unwinder would read). I'll go with the simple solution for now though. gdb/testsuite/ChangeLog: * gdb.python/py-unwind.exp: Disable stack protection when building test file.
2017-07-21Updated French translation for the binutils subdirectory.Nick Clifton2-1826/+4102
* po/fr.po: Updated French translation.
2017-07-21Fix typo in warning message.Nick Clifton1-1/+1
PR 21810 * dwarf.c (display_gdb_index): Fix typo in warning message.
2017-07-21Remove unused variables in dwarf parser.Simon Marchi2-8/+6
* dwarf.c (last_pointer_size, warned_about_missing_comp_units): Remove. (load_debug_info): Remove assignments to those two variables.
2017-07-21This patch introduces support for specifing views in .loc directives, so ↵Alexandre Oliva72-140/+1555
that the compiler can use the assembler to generate line number information and have the assembler determine view numbers to multiple views at the same program counter. binutils* dwarf.c (struct State_Machine_Registers): Add view field. (reset_state_machine): Reset view. (process_extended_line_op): Reset view when appropriate. (display_debug_lines_raw): Increment or reset view when appropriate. Print nonzero views. Support print view resets, disabled by default. (display_debug_lines_decoded): Likewise. Disambiguate op_code tests, enabling printing of end_sequence. * testsuite/binutils-all/dw2-1.W: Add nonzero views. * testsuite/binutils-all/dw2-3.W: Likewise. * testsuite/binutils-all/dw2-3gabi.W: Likewise. * testsuite/binutils-all/dw5.W: Add end sequence lines. * testsuite/binutils-all/i386/compressed-1a.d: Add nonzero views. * testsuite/binutils-all/libdw2-compressedgabi.out: Likewise. * testsuite/binutils-all/objdump.W: Likewise. * testsuite/binutils-all/objdump.WL: Add end sequence lines. * testsuite/binutils-all/x86-64/compressed-1a.d: Add nonzero views. gas * doc/as.texinfo (.loc): Document view support. * dwarf2dbg.c (unused): Check offset of next in struct line_entry. (current): Initialize view. (force_reset_view, view_assert_failed): New variables. (reverse_line_entry_list): New function. (set_or_check_view): Likewise. (dwarf2_gen_line_info_1): Call it. (dwarf2_where): Set view to NULL. (dwarf2_emit_insn): Return early when called before first file. (dwarf2_directive_loc): Add view support. Emit insn immediately when view option is given. (process_entries): Avoid set_address to reset view when a known address change already implies the view reset. (dwarf2dbg_final_check): New function. * dwarf2dbg.h (struct dwarf2_line_info): Add view. (dwarf2dbg_final_check): Declare. * read.c (s_leb128): Parse expression as deferred. * testsuite/gas/all/gas.exp: Run sleb128-9. * testsuite/gas/all/sleb128-9.d: New. * testsuite/gas/all/sleb128-9.l: New. * testsuite/gas/all/sleb128-9.s: New. * testsuite/gas/elf/dwarf2-1.d: Add nonzero views. * testsuite/gas/elf/dwarf2-2.d: Likewise. * testsuite/gas/elf/dwarf2-5.d: New. * testsuite/gas/elf/dwarf2-5.s: New. * testsuite/gas/elf/dwarf2-6.d: New. * testsuite/gas/elf/dwarf2-6.s: New. * testsuite/gas/elf/dwarf2-7.d: New. * testsuite/gas/elf/dwarf2-7.s: New. * testsuite/gas/elf/dwarf2-8.d: New. * testsuite/gas/elf/dwarf2-8.l: New. * testsuite/gas/elf/dwarf2-8.s: New. * testsuite/gas/elf/dwarf2-9.d: New. * testsuite/gas/elf/dwarf2-9.l: New. * testsuite/gas/elf/dwarf2-9.s: New. * testsuite/gas/elf/dwarf2-10.d: New. * testsuite/gas/elf/dwarf2-10.l: New. * testsuite/gas/elf/dwarf2-10.s: New. * testsuite/gas/elf/dwarf2-11.d: New. * testsuite/gas/elf/dwarf2-11.s: New. * testsuite/gas/elf/dwarf2-12.d: New. * testsuite/gas/elf/dwarf2-12.s: New. * testsuite/gas/elf/dwarf2-13.d: New. * testsuite/gas/elf/dwarf2-13.s: New. * testsuite/gas/elf/dwarf2-14.d: New. * testsuite/gas/elf/dwarf2-14.s: New. * testsuite/gas/elf/dwarf2-15.d: New. * testsuite/gas/elf/dwarf2-15.s: New. * testsuite/gas/elf/dwarf2-16.d: New. * testsuite/gas/elf/dwarf2-16.s: New. * testsuite/gas/elf/dwarf2-17.d: New. * testsuite/gas/elf/dwarf2-17.s: New. * testsuite/gas/elf/dwarf2-18.d: New. * testsuite/gas/elf/dwarf2-18.s: New. * testsuite/gas/elf/elf.exp: Run dwarf2-5..18 tests. * testsuite/gas/i386/dw2-compress-1.d: Add nonzero views. * testsuite/gas/i386/dw2-compressed-1.d: Likewise. * testsuite/gas/i386/ilp32/lns/lns-duplicate.d: Likewise. * testsuite/gas/lns/lns-big-delta.d: Likewise. * testsuite/gas/lns/lns-duplicate.d: Likewise. * testsuite/gas/mips/loc-swap-2.d: Likewise. * testsuite/gas/mips/loc-swap-3.d: Likewise. * testsuite/gas/mips/loc-swap.d: Likewise. * testsuite/gas/mips/micromips@loc-swap-2.d: Likewise. * testsuite/gas/mips/micromips@loc-swap.d: Likewise. * testsuite/gas/mips/mips16@loc-swap-2.d: Likewise. * testsuite/gas/mips/mips16@loc-swap.d: Likewise. * testsuite/gas/mips/mips16e@loc-swap.d: Likewise. * write.c (write_object_file): Check pending view asserts. (cvt_frag_to_fill): Complain about undefined leb128 operand.
2017-07-21S/390: Support z14 as CPU name.Andreas Krebbel6-4/+17
With IBM z14 officially announced I can add z14 as CPU name. No regressions with that patch on s390x. gas/ChangeLog: 2017-07-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (s390_parse_cpu): Add z14 as alternate CPU name. * doc/as.texinfo: Add z14 to CPU string list. * doc/c-s390.texi: Likewise. opcodes/ChangeLog: 2017-07-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-mkopc.c (main): Enable z14 as CPU string in the opcode table.
2017-07-21Automatic date update in version.inGDB Administrator1-1/+1
2017-07-20Make language_def O(1)Pedro Alves18-226/+184
Profiling GDB with the rest of series applied, I saw calls to language_def showing up high in some runs. The problem is that language_def is O(N) currently, since walk the languages vector each time to find the matching language_defn. IMO, the add_language mechanism is pointless, because "enum language" implies the core of GDB needs to know about all languages anyway. So simply make the languages vector array be an array where each element's index is the corresponding enum language enumerator. Note that "local_language_defn" is gone along the way. It's just a copy of "auto", so the new code simply maps one to the other. One fewer place to update when we need to change the language vector... Also, a while ago the output of "set language" was made out of order as side effect of some other change. While I was at it, I made them sorted again. gdb/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_language_defn): Make extern. (_initialize_ada_language): Remove add_language call. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Make extern. (_initialize_c_language): Delete. * completer.c (compare_cstrings): Delete, moved to utils.h. * d-lang.c (d_language_defn): Make extern. (_initialize_d_language): Remove add_language calls. * defs.h (enum language): Add comment. * f-lang.c (f_language_defn): Make extern. (_initialize_f_language): Remove add_language call. * go-lang.c (go_language_defn): Make extern. (_initialize_go_language): Remove add_language call. * language.c: Include <algorithm>. (languages): Redefine as const array. (languages_size, languages_allocsize, DEFAULT_ALLOCSIZE): Delete. (set_language_command): Handle "local". Use for-range loop. (set_language): Remove loop. (language_enum): Rewrite. (language_def, language_str): Remove loops. (add_language): Delete. (add_set_language_command): New, based on add_languages. (skip_language_trampoline): Adjust. (local_language_defn): Delete. (language_gdbarch_post_init): Adjust. (_initialize_language): Remove add_language calls. Call add_set_language_command. * language.h (add_language): Delete. (auto_language_defn) (unknown_language_defn, minimal_language_defn, ada_language_defn) (asm_language_defn, c_language_defn, cplus_language_defn) (d_language_defn, f_language_defn, go_language_defn) (m2_language_defn, objc_language_defn, opencl_language_defn) (pascal_language_defn, rust_language_defn): Declare. * m2-lang.c (m2_language_defn): Make extern. (_initialize_m2_language): Remove add_language call. * objc-lang.c (objc_language_defn): Make extern. (_initialize_objc_language): Remove add_language call. * opencl-lang.c (opencl_language_defn): Make extern. (_initialize_opencl_language): Remove add_language call. * p-lang.c (pascal_language_defn): Make extern. (_initialize_pascal_language): Delete. * rust-lang.c (rust_language_defn): Make extern. (_initialize_rust_language): Delete. * utils.h (compare_cstrings): New static inline function. gdb/testsuite/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * gdb.base/default.exp (set language): Adjust expected output.
2017-07-20get_int_var_valuePedro Alves4-34/+24
I noticed that get_int_var_value's parameters could use some constification. And then realized that client code would become simpler by changing the interface to return the success/failure indication as actual return value, as it allows getting rid of the local "boolean" variable. gdb/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_to_fixed_type_1): Adjust. (get_var_value): Constify parameters. (get_int_var_value): Change prototype. (to_fixed_range_type): Adjust. * ada-lang.h (get_int_var_value): Change prototype.
2017-07-20Use SYMBOL_MATCHES_SEARCH_NAME some morePedro Alves3-4/+10
gdb/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * dwarf2read.c (dw2_lookup_symbol): Use SYMBOL_MATCHES_SEARCH_NAME. * psymtab.c (psym_lookup_symbol): Use SYMBOL_MATCHES_SEARCH_NAME.
2017-07-20Eliminate block_iter_name_*Pedro Alves5-125/+16
This patch gets rid of block_iter_name_* as being unnecessary. It's the same as calling block_iter_match_*, and passing strcmp_iw as comparison routine. (A later patch will get rid of those new explicit strcmp_iw calls.) gdb/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * block.c (block_iter_name_step, block_iter_name_first) (block_iter_name_next): Delete. (block_lookup_symbol_primary): Adjust to use dict_iter_match_first/dict_iter_match_next. * block.h (block_iter_name_first, block_iter_name_next): Delete declarations. (ALL_BLOCK_SYMBOLS_WITH_NAME): Adjust to use dict_iter_match_first/dict_iter_match_next.
2017-07-20Fix cp_find_first_component_aux bugPedro Alves2-0/+7
Valgrind catches an out-of-bounds read here: $ gdb ./testsuite/outputs/gdb.cp/method2/method2 (gdb) start [...] Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd958) at src/gdb/testsuite/gdb.cp/method2.cc:26 26 return 0; (gdb) b A::operator ==26907== Invalid read of size 1 ==26907== at 0x75C0AE: cp_find_first_component_aux(char const*, int) (cp-support.c:951) ==26907== by 0x75C084: cp_find_first_component(char const*) (cp-support.c:925) ==26907== by 0x75C3DA: cp_entire_prefix_len(char const*) (cp-support.c:1089) ==26907== by 0x758B16: cp_lookup_symbol_in_namespace(char const*, char const*, block const*, domain_enum_tag, int) (cp-namespace.c:314) ==26907== by 0x75972A: lookup_namespace_scope(language_defn const*, char const*, block const*, domain_enum_tag, char const*, int) (cp-namespace.c:739) ==26907== by 0x7597CB: cp_lookup_symbol_nonlocal(language_defn const*, char const*, block const*, domain_enum_tag) (cp-namespace.c:768) ==26907== by 0x8C1137: lookup_symbol_aux(char const*, block const*, domain_enum_tag, language, field_of_this_result*) (symtab.c:2016) ==26907== by 0x8C098A: lookup_symbol_in_language(char const*, block const*, domain_enum_tag, language, field_of_this_result*) (symtab.c:1824) ==26907== by 0x8C0A04: lookup_symbol(char const*, block const*, domain_enum_tag, field_of_this_result*) (symtab.c:1836) ==26907== by 0x82CBE1: find_label_symbols(linespec_state*, VEC_symbolp*, VEC_symbolp**, char const*) (linespec.c:3390) ==26907== by 0x828FB5: linespec_parse_basic(ls_parser*) (linespec.c:1620) ==26907== by 0x82A78F: parse_linespec(ls_parser*, char const*) (linespec.c:2307) ==26907== Address 0x910f97c is 0 bytes after a block of size 12 alloc'd ==26907== at 0x4C28BF6: malloc (vg_replace_malloc.c:299) ==26907== by 0x74E737: xmalloc (common-utils.c:43) ==26907== by 0x74EAF4: savestring(char const*, unsigned long) (common-utils.c:179) ==26907== by 0x826CEF: copy_token_string(ls_token) (linespec.c:488) ==26907== by 0x828EF6: linespec_parse_basic(ls_parser*) (linespec.c:1599) ==26907== by 0x82A78F: parse_linespec(ls_parser*, char const*) (linespec.c:2307) ==26907== by 0x82AE27: event_location_to_sals(ls_parser*, event_location const*) (linespec.c:2469) ==26907== by 0x82B1CE: decode_line_full(event_location const*, int, program_space*, symtab*, int, linespec_result*, char const*, char const*) (linespec.c:2557) ==26907== by 0x720C8A: parse_breakpoint_sals(event_location const*, linespec_result*) (breakpoint.c:9550) ==26907== by 0x72A2F7: create_sals_from_location_default(event_location const*, linespec_result*, bptype) (breakpoint.c:14484) ==26907== by 0x727F86: bkpt_create_sals_from_location(event_location const*, linespec_result*, bptype) (breakpoint.c:13219) ==26907== by 0x72146D: create_breakpoint(gdbarch*, event_location const*, char*, int, char*, int, int, bptype, int, auto_boolean, breakpoint_ops const*, int, int, int, unsigned int) (breakpoint.c:9759) Tests exercising this will be added further down the series. gdb/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * cp-support.c (cp_find_first_component_aux): Add missing case for end of string.
2017-07-20Make gdb.base/dmsym.exp independent of "set language ada"Pedro Alves4-34/+37
This test is using "set language ada" expecting that to cause GDB to do Ada symbol name matching. That won't work when GDB uses the symbol's language to decide which symbol matching algorithm to use, because the test's symbols are C symbols. So generalize the test a bit to not rely on Ada name matching rules. Confirmed that by undoing the original fix the test was written for, the test still fails. gdb/testsuite/ChangeLog: 2017-07-20 Pedro Alves <palves@redhat.com> * gdb.base/dmsym.c (pck__foo__bar__minsym): Rename to ... (test_minsym): ... this, and make static. (get_pck__foo__bar__minsym): Rename to ... (get_test_minsym): ... this. * gdb.base/dmsym.exp (): Remove "set language ada" call. Adjust symbol names and comments. * gdb.base/dmsym_main.c (get_pck__foo__bar__minsym): Rename to ... (get_test_minsym): ... this. (pck__foo__bar__minsym__2): Rename to ... (test_minsym): ... this. (main): Adjust.
2017-07-20Update the German translation for the opcodes library.Nick Clifton2-466/+890
* po/de.po: Updated German translation.
2017-07-20Automatic date update in version.inGDB Administrator1-1/+1
2017-07-20PR ld/16656: Add missing annotation to the relevant ChangeLog entriesMaciej W. Rozycki1-0/+2
Add PR ld/16656 annotation to ChangeLog entries for commit 9a0f1d5099fa ("LD/testsuite: Conditionalize the placement of `.dynamic' in GNU_RELRO") and commit ("LD/testsuite: Conditionalize the placement of `.got' in GNU_RELRO").
2017-07-19[AArch64] Fix PR18841 ifunc relocation orderingSzabolcs Nagy2-0/+37
In order to get the ifunc relocs properly sorted the correct class needs to be returned. The code mimics what has been done for x86. Fixes FAIL: Run pr18841 with libpr18841c.so bfd/ PR ld/18841 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return reloc_class_ifunc for ifunc symbols.
2017-07-19Extend previous fix to coff-rs6000.c to coff64-rs6000.cNick Clifton2-1/+45
PR 21786 * coff64-rs6000.c (_bfd_strntol): New function. (_bfd_strntoll): New function. (GET_VALUE_IN_FIELD): New macro. (xcoff64_slurp_armap): Use new macros.
2017-07-19Fix use-after-free error when parsing a corrupt nested archive.Nick Clifton2-1/+13
PR 21787 * archive.c (bfd_generic_archive_p): If the bfd does not have the correct magic bytes at the start, set the error to wrong format and clear the format selector before returning NULL.
2017-07-19LD/testsuite: Add 2**4 section alignment FILL script statement testMaciej W. Rozycki7-8/+97
Complement commit ffe54b3798db ("Pad sections according to current script FILL.") and add a FILL script statement test for targets that impose the minimum alignment of more than 2**2 for the `.text' section. These targets include IA-64 targets, MIPS targets other than bare-metal ELF and VxWorks, TILE-Gx targets, TILEPro targets and X86-64 PE targets. Use the `notarget' tag for configuration triplets that are incompatible with the new test, but are supported by the existing FILL test, and `xfail' for ones that have issues due to section alignment or padding with both tests. Make a complementary change to the existing FILL test, removing the following test issues: arm-epoc-pe -FAIL: ld-scripts/fill mips-elf -XPASS: ld-scripts/fill mips-img-elf -XPASS: ld-scripts/fill mips-mti-elf -XPASS: ld-scripts/fill mips-sde-elf -XPASS: ld-scripts/fill mips-vxworks -XPASS: ld-scripts/fill mipsel-elf -XPASS: ld-scripts/fill mipsel-img-elf -XPASS: ld-scripts/fill mipsel-mti-elf -XPASS: ld-scripts/fill mipsel-vxworks -XPASS: ld-scripts/fill mipsisa32-elf -XPASS: ld-scripts/fill mipsisa32el-elf -XPASS: ld-scripts/fill mipsisa64-elf -XPASS: ld-scripts/fill mipsisa64el-elf -XPASS: ld-scripts/fill tilegx-linux -FAIL: ld-scripts/fill tilepro-elf -FAIL: ld-scripts/fill tx39-elf -XPASS: ld-scripts/fill ld/ * testsuite/ld-scripts/fill.d: Adjust `xfail' entries. Add `notarget' entries. Update comments. * testsuite/ld-scripts/fill16.d: New test. * testsuite/ld-scripts/fill16_0.s: New test source. * testsuite/ld-scripts/fill16_1.s: New test source. * testsuite/ld-scripts/fill16_2.s: New test source. * testsuite/ld-scripts/data.exp: Run the new test.
2017-07-19Fix address violation when attempting to read a corrupt field in a COFF ↵Nick Clifton2-50/+89
archive header structure. PR 21786 * coff-rs6000.c (_bfd_strntol): New function. (_bfd_strntoll): New function. (GET_VALUE_IN_FIELD): New macro. (EQ_VALUE_IN_FIELD): new macro. (_bfd_xcoff_slurp_armap): Use new macros. (_bfd_xcoff_archive_p): Likewise. (_bfd_xcoff_read_ar_hdr): Likewise. (_bfd_xcoff_openr_next_archived_file): Likewise. (_bfd_xcoff_stat_arch_elt): Likewise.
2017-07-19[ARC] Add SecureShield AUX registersclaziss2-0/+21
Update auxiliary registers with SecureShield ones. opcodes/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> * arc-regs.h (sec_stat): New aux register. (aux_kernel_sp): Likewise. (aux_sec_u_sp): Likewise. (aux_sec_k_sp): Likewise. (sec_vecbase_build): Likewise. (nsc_table_top): Likewise. (nsc_table_base): Likewise. (ersec_stat): Likewise. (aux_sec_except): Likewise.
2017-07-19[ARC] Add SJLI instruction.Claudiu Zissulescu5-1/+32
include/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (SJLI): Add. opcode/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> * arc-opc.c (extract_uimm12_20): New function. (UIMM12_20): New operand. (SIMM3_5_S): Adjust. * arc-tbl.h (sjli): Add new instruction.
2017-07-19[ARC] Add JLI support.John Eric Martin30-6/+1274
The following relocation types were added to GCC/binutils: ARC_JLI_SECTOFF is a relocation type in Metaware that is now used by GCC as well to adjust the index of function calls to functions with attribute jli_call_always. bfd/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-arc.c (JLI): Define. * reloc.c: Add JLI relocations. gas/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/jli-1.d: New file. * testsuite/gas/arc/jli-1.s: Likewise. * testsuite/gas/arc/taux.d: Update for jli_base. include/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * elf/arc-reloc.def: Add JLI relocs howto. * opcode/arc-func.h (replace_jli): New function. ld/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * emulparams/arcelf.sh (JLI_START_TABLE): Define. * scripttempl/elfarc.sc: Handle jlitab section. * scripttempl/elfarcv2.sc: Likewise. * testsuite/ld-arc/arc.exp: Add JLI test. * testsuite/ld-arc/jli-script.ld: New file. * testsuite/ld-arc/jli-simple.dd: Likewise. * testsuite/ld-arc/jli-simple.rd: Likewise. * testsuite/ld-arc/jli-simple.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.d: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.err: Likewise. opcode/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * arc-opc.c (UIMM10_6_S_JLIOFF): Define. (UIMM3_23): Adjust accordingly. * arc-regs.h: Add/correct jli_base register. * arc-tbl.h (jli_s): Likewise.
2017-07-19Remove datasize measurements based on sbrk()Tristan Gingold6-46/+16
binutils/ * nm.c (show_stats): Remove variable. (long_options): Remove --stats option. (main): Remove handling of --stats. ld/ * ldmain.c (main): Remove display of data size. gas/ * as.c (start_sbrk): Remove. (main): Remove assignment. (dump_statistics): Remove display of data size.
2017-07-19Fix gas crash on missing seh_endproc.Tristan Gingold5-4/+22
gas/ * testsuite/gas/pe/seh-x64-err-2.s: New test. * testsuite/gas/pe/seh-x64-err-2.l: New stderr output. * testsuite/gas/pe/pe.exp: Add test. * config/obj-coff-seh.c (obj_coff_seh_do_final): Don't try to end seh part.
2017-07-19Automatic date update in version.inGDB Administrator1-1/+1
2017-07-18LD/testsuite: Conditionalize the placement of `.got' in GNU_RELROMaciej W. Rozycki2-1/+24
Complement commit d345186d0535 ("Check if GNU_RELRO segment is is generated") and exclude the presence of a `.got' section from implying the creation of a GNU_RELRO segment for targets which place the section along with small data, and therefore as it stands cannot have the section assigned to GNU_RELRO. This is because we currently only support a single GNU_RELRO segment and we place it at the beginning of regular data which is then separated from small data by read-write data. Currently the list of such targets consists of Alpha, Linux HPPA, NetBSD HPPA, OpenBSD HPPA, Meta, MIPS, Nios II, OpenRISC 1000, RISC-V, SH and X86-64, as determined by examining default linker scripts produced in a `--enable-targets=all' build for those that have DATA_SEGMENT_RELRO_END set and `.got' placed beyond. These targets do not set NO_SMALL_DATA or DATA_GOT in their respective files in ld/emulparams/*, hovever checking for the absence of these settings on its own is not very feasible due to the structure of these files and the lack of support for GNU_RELRO by some targets in the first place. Add a separate control for `.got.plt' which does get placed in GNU_RELRO on MIPS targets even though `.got' does not. ld/ * testsuite/ld-elf/binutils.exp (binutils_test): Make the expectation for `.got' in GNU_RELRO segment target-specific. Handle `.got.plt' separately.
2017-07-18LD/testsuite: Conditionalize the placement of `.dynamic' in GNU_RELROMaciej W. Rozycki2-1/+11
Complement commit d345186d0535 ("Check if GNU_RELRO segment is is generated") and exclude the presence of a `.dynamic' section from implying the creation of a GNU_RELRO segment for targets which place the section in the (read-only) text segment, and therefore cannot have the section assigned to GNU_RELRO and neither it would make sense. Currently the list of such targets consists of 64-bit HPPA and non-VxWorks MIPS targets, as determined by looking for TEXT_DYNAMIC being set across ld/emulparams/* and then verified by examining default linker scripts produced in a `--enable-targets=all' build. ld/ * testsuite/ld-elf/binutils.exp (binutils_test): Make the expectation for `.dynamic' in GNU_RELRO segment target-specific.
2017-07-18Fix spelling typos.Yuri Chornovian59-222/+307
2017-07-18Fix Fission (broken by my previous patch)David Blaikie2-0/+6
Turns out somewhere along the refactoring of the multiple-CU support for Fission I broke the patch before submitting it (& seems to have broken Fission support generally). Syncing back to the point at which the patch was committed, the previous test results on my machine are: expected passes: 36137 unexpected failures: 416 with the previous (broken) patch committed: expected passes: 36131 unexpected failures: 429 With this one line patch applied on top of the broken commit: expected passes: 36144 unexpected failures: 416 (& all other result counts remained the same in all 3 cases) gdb/ChangeLog: 2017-07-18 David Blaikie <dblaikie@gmail.com> * dwarf2read.c (create_cus_hash_table): Re-add lost initialization of dwo_cu's dwo_file.
2017-07-18Fix runtime failure triggered by a corrupt ecoff input file.Nick Clifton2-1/+13
PR binutils/21781 * coffcode.h (handle_COMDAT): Replace abort with an error message and return.
2017-07-18Remove one line commentYao Qi2-2/+4
This patch is going to remove a line comment, which was added in this commit, commit 55fea07 Author: Jim Kingdon <jkingdon@engr.sgi.com> Date: Tue Sep 14 01:08:22 1993 +0000 * remote.c: Define remote_debug to 0 and #if 0 baud_rate. Temporary hack so this file compiles again. * remote-utils.c (gr_multi_scan): Cast return value from alloca. (gr_multi_scan): #if 0 never-reached return(-1). and at that moment, remote_prepare_to_store does updates some global state, static void remote_prepare_to_store () { /* Make sure the entire registers array is valid. */ read_register_bytes (0, (char *)NULL, REGISTER_BYTES); } However, now, remote_prepare_to_store doesn't do that at all, and rsa->sizeof_g_packet is updated in init_remote_state, so the line of comment is out of date, and this patch removes it. gdb: 2017-07-18 Yao Qi <yao.qi@linaro.org> * remote.c (store_registers_using_G): Remove one line comment.
2017-07-18Simplify regcache_cpy and remove regcache::cpy_no_passthroughYao Qi3-37/+14
Nowadays, regcache_cpy is used where src is read-only and dst is not read-only, so the regcache_cpy can be simplified to handle this case only. As a result, regcache::cpy_no_passthrough, which is about two read-only regcache copy, is no longer used, remove it as well. gdb: 2017-07-18 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache_cpy): Simplify it. (regcache::cpy_no_passthrough): Remove it. * regcache.h (cpy_no_passthrough): Remove it. (regcache_dup, regcache_cpy): Update comments.
2017-07-18Improve doc about "maint print c-tdesc"Yao Qi2-2/+8
In my patch extending command "maint print c-tdesc" (https://sourceware.org/ml/gdb-patches/2017-06/msg00286.html), Eli raised some questions on the existing doc to this command. It is not very clear, so this patch improves it. Eli approved it. gdb/doc: 2017-07-18 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (Maintenance Commands): Improve the doc to command "maint print c-tdesc".
2017-07-18Import updated Ukranian and Swedish translations.Nick Clifton4-347/+250
gas * po/uk.po: Updated Ukranian translation. binutils* po/sv.po: Updated Swedish translation.
2017-07-18Fix GDB builds that include the simulatorPedro Alves2-15/+38
The completer rewrite series missed adjusting target sim to the new completion_tracker interface. src/gdb/remote-sim.c: In function ‘void _initialize_remote_sim()’: src/gdb/remote-sim.c:1350:46: error: invalid conversion from ‘VEC_char_ptr* (*)(cmd_list_element*, const char*, const char*)’ to ‘void (*)(cmd_list_element*, completion_tracker&, const char*, const char*)’ [-fpermissive] set_cmd_completer (c, sim_command_completer); ^ This commit fixes it, and also takes care to be exception safe (the previous code would leak if growing the VEC throws). Tested manually with a --target=arm-none-eabi build. gdb/ChangeLog: 2017-07-18 Pedro Alves <palves@redhat.com> * remote-sim.c (sim_command_completer): Adjust to work with a completion_tracker instead of a VEC.