aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-30Nios II CALL26 linker relaxationSandra Loosemore45-50/+2022
2014-01-30 Sandra Loosemore <sandra@codesourcery.com> bfd/ * bfd-in2.h: Update from reloc.c. * elf32-nios2.c: Include elf32-nios2.h. (elf_nios2_howto_table_rel): Add entry for R_NIOS2_CALL26_NOAT. (nios2_reloc_map): Likewise. (enum elf32_nios2_stub_type): Declare. (struct elf32_nios2_stub_hash_entry): Declare. (nios2_stub_hash_entry, nios2_stub_hash_lookup): New macros. (struct elf32_nios2_link_hash_entry): Add hsh_cache field. (struct elf32_nios2_link_hash_table): Add new fields bstab, stub_bfd, add_stub_section, layout_sections_again, stub_group, bfd_count, top_index, input_list, all_local_syms. (nios2_call26_stub_entry): New. (nios2_elf32_install_imm16): Move up in file. (nios2_elf32_install_data): Move up in file. (hiadj): Move up in file. (stub_hash_newfunc): New. (link_hash_newfunc): Initialize hsh_cache field. (STUB_SUFFIX): New. (nios2_stub_name): New. (nios2_get_stub_entry): New. (nios2_add_stub): New. (nios2_elf32_setup_section_lists): New. (nios2_elf32_next_input_section): New. (CALL26_SEGMENT): New. (MAX_STUB_SECTION_SIZE): New. (group_sections): New. (nios2_type_of_stub): New. (nios2_build_one_stub): New. (nios2_size_one_stub): New. (get_local_syms): New. (nios2_elf32_size_stubs): New. (nios2_elf32_build_stubs): New. (nios2_elf32_do_call26_relocate): Correct CALL26 overflow test. (nios2_elf32_relocate_section): Handle R_NIOS2_CALL26_NOAT. Add trampolines for R_NIOS2_CALL26 stubs. (nios2_elf32_check_relocs): Handle R_NIOS2_CALL26_NOAT. (nios2_elf32_gc_sweep_hook): Likewise. (nios2_elf32_link_hash_table_create): Initialize the stub hash table. (nios2_elf32_link_hash_table_free): New. (bfd_elf32_bfd_link_hash_table_free): Define. * elf32-nios2.h: New file. * libbfd.h: Update from reloc.c. * reloc.c (BFD_RELOC_NIOS2_CALL26_NOAT): New. gas/ * config/tc-nios2.c (md_apply_fix): Handle BFD_RELOC_NIOS2_CALL26_NOAT. (nios2_assemble_args_m): Likewise. (md_assemble): Likewise. gas/testsuite/ * gas/nios2/call26_noat.d: New. * gas/nios2/call26_noat.s: New. * gas/nios2/call_noat.d: New. * gas/nios2/call_noat.s: New. include/elf/ * nios2.h (elf_nios2_reloc_type): Add R_NIOS2_CALL26_NOAT. ld/ * Makefile.am (enios2elf.c, enios2linux.c): Update dependencies. * Makefile.in: Regenerated. * emulparams/nios2elf.sh (EXTRA_EM_FILE): Set. * emulparams/nios2linux.sh (EXTRA_EM_FILE): Set. * emultempl/nios2elf.em: New file. * gen-doc.texi (NIOSII): Set. * ld.texinfo (NIOSII): Set. ld/testsuite/ * ld-nios2/relax_call26.s: New. * ld-nios2/relax_call26_boundary.ld: New. * ld-nios2/relax_call26_boundary.s: New. * ld-nios2/relax_call26_boundary_c8.d: New. * ld-nios2/relax_call26_boundary_cc.d: New. * ld-nios2/relax_call26_boundary_d0.d: New. * ld-nios2/relax_call26_boundary_d4.d: New. * ld-nios2/relax_call26_boundary_d8.d: New. * ld-nios2/relax_call26_boundary_dc.d: New. * ld-nios2/relax_call26_boundary_f0.d: New. * ld-nios2/relax_call26_boundary_f4.d: New. * ld-nios2/relax_call26_boundary_f8.d: New. * ld-nios2/relax_call26_boundary_fc.d: New. * ld-nios2/relax_call26_cache.d: New. * ld-nios2/relax_call26_cache.ld: New. * ld-nios2/relax_call26_cache.s: New. * ld-nios2/relax_call26_multi.d: New. * ld-nios2/relax_call26_multi.ld: New. * ld-nios2/relax_call26_norelax.d: New. * ld-nios2/relax_call26_shared.d: New. * ld-nios2/relax_call26_shared.ld: New.
2014-01-31daily updateAlan Modra1-1/+1
2014-01-30Add support for AT_HWCAP2 auxv entryUlrich Weigand4-0/+10
Recent ppc64 Linux kernels provide a new auxv entry AT_HWCAP2, which is currently not recognized by GDB, causing every use of "info auxv" to show an error. This commit adds the AT_HWCAP2 define to include/elf/common.h and handles it in GDB. include/elf/ChangeLog: * common.h (AT_HWCAP2): Define. gdb/ChangeLog: * auxv.c (fprint_target_auxv): Handle AT_HWCAP2.
2014-01-30Fix shift for AVX512F gather/scatter instructionsMichael Zolotukhin7-35/+49
opcodes/ 2014-01-30 Michael Zolotukhin <michael.v.zolotukhin@gmail.com> Jan Beulich <jbeulich@suse.com> PR binutils/16490 * i386-dis.c (OP_E_memory): Fix shift computation for vex_vsib_q_w_dq_mode. gas/testsuite/ 2014-01-30 Michael Zolotukhin <michael.v.zolotukhin@gmail.com> Jan Beulich <jbeulich@suse.com> PR binutils/16490 * gas/i386/avx512f.d: Fix test output. * gas/i386/avx512f-intel.d: Likewise. * gas/i386/x86-64-avx512f.d: Likewise. * gas/i386/x86-64-avx512f-intel.d: Likewise.
2014-01-30daily updateAlan Modra1-1/+1
2014-01-29Add rdynamic-1 testH.J. Lu4-0/+25
It is added for commit 409ff343a402799563f71f938138b29f8baf7a1c Author: Alan Modra <amodra@gmail.com> Date: Tue Nov 8 13:49:11 2011 +0000 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in executables when export_dynamic. * ld-elf/rdynamic-1.c: New file. * ld-elf/rdynamic-1.rd: Likewise. * ld-elf/shared.exp (build_tests): Add rdynamic-1.
2014-01-29This changeset makes sparc64_linux_step_trap to return 0 when aJose E. Marchesi6-2/+101
breakpoint is set in a `ta 0x6d´ which is not a sigreturn syscall. In these cases no rt_frame exists in the stack and thus the read PC is wrong. ChangeLog 2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * sparc64-linux-tdep.c (sparc64_linux_step_trap): Get PC from the sigreturn register save area only if the syscall is sigreturn. testsuite/ChangeLog 2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.arch/sparc-sysstep.exp: New file. * gdb.arch/sparc-sysstep.c: Likewise. * gdb.arch/Makefile.in (EXECUTABLES): Add sparc-sysstep.
2014-01-29My patch to the binutils strip-10.d test was wrong. The osabi field should ↵Nick Clifton6-5/+21
always be set to ELFOSABI_GNU for binaries containing unique symbols. So I am reverting that patch and instead applying the patch below to fix up the targets that were triggering the test failure. bfd/ChangeLog 2014-01-29 Nick Clifton <nickc@redhat.com> * elf32-metag.c (elf_metag_post_process_headers): Call _bfd_elf_post_process_headers. * elf32-sh64.c (sh64_elf_copy_private_data): Call _bfd_elf_copy_private_data. * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise. binutils/testsuite/ChangeLog 2014-01-29 Nick Clifton <nickc@redhat.com> * binutils-all/strip-10.d: Revert previous delta.
2014-01-29Following up on Tom's suggestion I am checking in a patch to replace the variousNick Clifton5-11/+81
bfd_xxx_set macros with static inline functions, so that we can avoid compile time warnings about comma expressions with unused values. * bfd-in.h (bfd_set_section_vma): Delete. (bfd_set_section_alignment): Delete. (bfd_set_section_userdata): Delete. (bfd_set_cacheable): Delete. * bfd.c (bfd_set_cacheable): New static inline function. * section.c (bfd_set_section_userdata): Likewise. (bfd_set_section_vma): Likewise. (bfd_set_section_alignment): Likewise. * bfd-in2.h: Regenerate.
2014-01-29Minor reformatting in valops.c::value_sliceJoel Brobecker2-21/+26
I noticed that a small lexical block was over indented by 2 characters. So this patch starts by reducing the indentation. While looking at this area of the code, I also noticed a couple of lines that had trailing spaces, so this patch also removes them. And finally, it fixes one tiny to put the assignment operator at the start of the next line, rather than at the end of the first line. gdb/ChangeLog: * valops.c (value_slice): Minor reformatting.
2014-01-28Add .gdb_index version 7 support.Cary Coutant7-35/+111
This patch adds support for .gdb_index version 7, which adds several flag bits to the symbol index. It also fixes a problem where it did not handle compressed debug sections correctly. Tested with a google/gcc-4_8 branch compiler, which supports the -ggnu-pubnames option to generate .debug_gnu_pubnames/pubtypes tables. (We will submit that patch to GCC when stage 1 reopens.) 2014-01-28 Cary Coutant <ccoutant@google.com> * gold/dwarf_reader.cc: include <utility> (for make_pair). (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed debug sections. (Dwarf_ranges_table::read_ranges_table): Likewise. (Dwarf_pubnames_table::read_section): Check for GNU-style sections, and for compressed debug sections. (Dwarf_pubnames_table::read_header): Compute end address of table. (Dwarf_pubnames_table::next_name): Return flag_byte. Check for end of list by offset, not by offset == 0. (Dwarf_info_reader::do_read_string_table): Check for compressed debug sections. * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table): Initialize new data members. (Dwarf_pubnames_table::next_name): return flag_byte. (Dwarf_pubnames_table::end_of_table_): New data member. (Dwarf_pubnames_table::is_gnu_style_): New data member. * gold/gdb-index.cc (gdb_index_version): Update to version 7. (Gdb_index_info_reader::read_pubtable): Read flag_byte. (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't read skeleton type unit DIEs. (Gdb_index::add_symbol): Add flag_byte; adjust all callers. (Gdb_index::do_write): Write flag_byte. * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter. (Gdb_index::Cu_vector): Store flags along with cu indexes. * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7. * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2014-01-28Fix info-shared.exp testcase to expect the leading `.' found on ppc64's symbols.Edjunior Barbosa Machado2-10/+14
gdb/testsuite/ 2014-01-28 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * gdb.base/info-shared.exp: Expect leading `.' on ppc64's symbols.
2014-01-28Fix typo in ppc64_standard_linkage7Ulrich Weigand2-1/+5
The ppc64_standard_linkage7 pattern added by Alan's recent patch: https://sourceware.org/ml/gdb-patches/2013-11/msg00274.html contains a typo: the ELFv2 TOC slot offset is 24, not 40. This was correct in the comment, but not the actual code. ChangeLog: * ppc64-tdep.c (ppc64_standard_linkage7): Fix typo.
2014-01-28When parsing a DW_FORM_ref_addr attribute the CU containing theNick Clifton2-0/+30
abbreviation may not be the current CU. Thus we need to make sure that when we read the abbreviation we use the correct CU. * dwarf2.c (find_abstract_instance_name): For DW_FORM_ref_addr attributes select the CU containing the abbreviation, which may not be the current CU.
2014-01-28A recent change to the BFD library has meant that the osabi field inNick Clifton2-1/+6
ELF headers will be copied from input files. This in turn has broken the strip-10 test in the binutils testsuite, so this patch updates the expected output. PR binutils/16318 * binutils-all/strip-10.d: Allow "System V" in the osabi field.
2014-01-28The MSP430 linker contains emulations for old and obsolete MCU types.Nick Clifton5-1183/+21
Since all MCUs now have their own specific linker script (courtesy of TI) there is no need for these emulations and so this patch removes them. * Makefile.am: Remove obsolete MSP430 emulations. * configure.tgt: Likewise. * emulparams/msp430all.sh: Likewise. * Makefile.in: Regenerate.
2014-01-28A recent update to the binutils means that RELA sections now have theNick Clifton3-2/+8
SHF_INFO_LINK bit set, which shows up in readelf section dumps. This has broken a couple of IA64 testcases in the gas testsuite, which are fixed by this patch. PR binutils/16317 * gas/ia64/group-2.d: Expect I attribute with RELA sections. * gas/ia64/xdata.d: Likewise.
2014-01-28Update the tic6x linker tests to match the current behaviour of the linker ↵Nick Clifton15-40/+58
and readelf. PR binutils/16317 * ld-tic6x/shlib-1.rd: Expect I attribute with RELA sections. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-app-1rd: Likewise. * ld-tic6x/shlib-app-1b.rd: Likewise. * ld-tic6x/shlib-app-1r.rd: Likewise. * ld-tic6x/shlib-app-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise. * ld-tic6x/static-app-1.rd: Likewise. * ld-tic6x/static-app-1b.rd: Likewise. * ld-tic6x/static-app-1r.rd: Likewise. * ld-tic6x/static-app-1rb.rd: Likewise. PR binutils/16318 * ld-tic6x/tic6x.exp: Expect C6000 osabi value in relocatable objects.
2014-01-28New Ada maintenance command to ignore descriptive types (DWARF).Joel Brobecker5-0/+108
Currently, Ada debugging requires the use of certain GNAT-specific encodings, which are generated by the compiler. These encodings were created a long time ago to work around the fairly limited capabilities of the stabs debugging format. With DWARF, the vast majority of the encodings could be abandoned in favor of a pure DWARF approach. In order to make it easier to evaluate the quality of the DWARF debugging information generated by the compiler, and how the debugger handles it, we are introducing a small Ada-specific maintenance setting which changes the debugger's behavior to ignore descriptive types. Descriptive types are artificial types generated by the compiler purely to give the debugger hints as to how to properly decode certain properties of a type. For instance, for array types, it generates a parallel type whose name is the name of the array suffixed with ___XA, whose contents tells us what the array's index type is, and possibly its bounds. See GCC's gcc/ada/exp_dbug.ads for the full description of all encodings. This is only a first step, as this setting does not deactivate all encodings; More settings dedicated to each type of encoding will likely be implemented in the future, as we make progress. gdb/ChangeLog: * ada-lang.c (maint_set_ada_cmdlist, maint_show_ada_cmdlist): New static globals. (maint_set_ada_cmd, maint_show_ada_cmd): New functions. (ada_ignore_descriptive_types_p): New static global. (find_parallel_type_by_descriptive_type): Return immediately if ada_ignore_descriptive_types_p is set. (_initialize_ada_language): Register new commands "maintenance set ada", "maintenance show ada", "maintenance set ada ignore-descriptive-types" and "maintenance show ada ignore-descriptive-types". * NEWS: Add entry for new "maint ada set/show ignore-descriptive-types" commands. gdb/doc/ChangeLog: * gdb.texinfo (Ada Glitches): Document the new "maint ada set/show ignore-descriptive-types". commands.
2014-01-28daily updateAlan Modra1-1/+1
2014-01-27btrace: initiate teardown when closing record btrace targetMarkus Metzger2-1/+11
The to_teardown_btrace target method is used to free btrace resources during shutdown when target record has already been unpushed and we can't reliably talk to a remote target to disable branch tracing. Tracing resources are freed for each thread when the thread is removed; both on the GDB side and on the gdbserver side. In the remote case, the remote target that provides to_teardown_btrace to free the GDB side resources has already been unpushed when threads are destroyed. This results in a complaint "You can't do this ..." and in a few bytes of memory leaked for each thread. Initiate btrace teardown in record_btrace_close, so the remote target is still in place. 2014-01-27 Markus Metzger <markus.t.metzger@intel.com> * record-btrace.c (record_btrace_close): Call btrace_teardown for all threads.
2014-01-27ada-lang.c: Really include "ui-out.h".Joel Brobecker2-2/+5
Currently, ada-lang.c pretends to include "ui-out.h" as follow: #ifdef UI_OUT #include "ui-out.h" #endif However, UI_OUT is never defined as far as I can tell. This is confirmed by rebuilding with a #error pragma inside the #ifdef UI_OUT block, which never triggers. Since this unit makes references to declarations from ui-out.h, this patch simply removes the #ifdef/#endif condition. This has not been an error so far because "ui-out.h" indirectly gets included, via one of the other .h files being included. gdb/ChangeLog: * ada-lang.c: Remove "#ifdef UI_OUT" condition for including "ui-out.h".
2014-01-27Try printing array range using the name of its index typeJoel Brobecker7-9/+172
type Char_Table is array (Character range Character'First .. Character'Last) of Natural; Trying to print the type description of this type currently yields: (gdb) ptype char_table type = array ('["00"]' .. '["ff"]') of natural Although technically correct, it seemed more useful to print the array range as: (gdb) ptype char_table type = array (character) of natural This patch implements this suggestion. gdb/ChangeLog: * ada-typeprint (type_is_full_subrange_of_target_type): New function. (print_range): Add parameter bounds_prefered_p. If not set, try printing range types using the name of their base type. (print_range_type): Add parameter bounds_prefered_p. Use it in call to print_range. (print_array_type, ada_print_type): Update calls to print_range and print_range_type. gdb/testsuite/ChangeLog: * gdb.ada/array_char_idx: New testcase.
2014-01-27Remove unncessary function declarations in ada-typeprint.c.Joel Brobecker2-18/+7
These declarations are unncessary, and make it extra work when trying to change the profile of one of these functions. This patch just removes them. Note that one of them (print_dynamic_range_bound), was improperly indented. gdb/ChangeLog: * ada-typeprint.c (print_array_type, print_choices, print_range) (print_range_bound, print_dynamic_range_bound, print_range_type): Remove declaration.
2014-01-27Add missing empty line after declaration in ada-typeprint.c:print_range.Joel Brobecker2-0/+6
gdb/ChangeLog: * ada-typeprint.c (print_range): Add missing empty line after local declaration.
2014-01-27[Ada] Array bound incorrectly printed for array indexed by enum subrangeJoel Brobecker2-1/+6
Consider the following declarations: type Range_Type is (One, Two, Three); type Array_Type is array (Range_Type range One .. Two) of Integer; A : Array_Type := (1, 2); Trying to print A can yield: (gdb) print a $1 = (one => 1, 2) The bound of the first element should not have been printed, since "one" is the first enumerate of type Range_Type. Similarly, with the following declarations: type Array2_Type is array (Range_Type range Two .. Three) of Integer; A2 : Array2_Type := (2, 3); GDB is failing to print the bound of the first element of "A2": (gdb) print a2 $2 = (2, 3) This is because the index type for both types Array_Type and Array2_Type are subranges (by DWARF definition for arrays), of an anonymous subrange type. When deciding whether to print the bound of the first element, we handle subranges, but only up to one level. This patch enhanced the code to handle any number of subrange levels. gdb/ChangeLog: * ada-valprint.c (print_optional_low_bound): Get index_type's target type for as long as it is a TYPE_CODE_RANGE. No testcase with this patch, but this will be tested via the testcase of another patch, which uses the DWARF assembler to generate debugging info for an array indexed by an enum.
2014-01-27Remove assert in procfs.c::procfs_make_note_section (x86-solaris)Joel Brobecker2-3/+5
On x86-solaris, the gcore command sometimes triggers the following internal error: (gdb) gcore /[...]/procfs.c:5523: internal-error: procfs_make_note_section: Assertion `thread_args.note_data != note_data' failed. The problem is extremely elusive, for reasons that will become clearer as I explain what is going on. The program used to produce this issue was really simple: | void break_me (void) { } | | int | main (void) | { | break_me (); | return 0; | } The procfs_make_note_section builds a buffer incrementally with the contents of the core's notes section. The interesting bits are: char *note_data = NULL; [...] note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, note_size, fname, psargs); This is the first call to bfd's elfcore which initializes note_data. After that, we have a few more calls, which keep updating notes_data and note_size, but our interest lies in the following part of the function: thread_args.note_data = note_data; [...] proc_iterate_over_threads (pi, procfs_corefile_thread_callback, &thread_args); /* There should be always at least one thread. */ gdb_assert (thread_args.note_data != note_data); The comment implies that the assert is to verify that our loop iterated over at least one thread. The check is relying on the fact that the notes_data returned by the elfcore module changes at each iteration, via (in procfs_corefile_thread_callback): args->note_data = procfs_do_thread_registers (args->obfd, ptid, args->note_data, args->note_size, args->stop_signal); (which calls elfcore_write_lwpstatus). But, while it happens most of the time, thanks to a call to realloc in elfcore_write_note (the function that actually appends the data at the end of the notes buffer),... buf = (char *) realloc (buf, *bufsiz + newspace); ... this is by no means guarantied. In fact, under the right circumstances, the buffer was grown twice without changing addresses. Unfortunately, the circumstances are very sensitive, thus making this bug very elusive. This patch fixes the problem by simply removing the assert. This means we're losing the assertion that there is at least one thread, but I think that's OK. If we still want to keep the assertion, we have the option of either checking the buffer size, or else adding a boolean flag in the context structure that we'd set to true as soon as we have a thread. gdb/ChangeLog: * procfs.c (procfs_make_note_section): Remove assertion and associated comment.
2014-01-27daily updateAlan Modra1-1/+1
2014-01-26daily updateAlan Modra1-1/+1
2014-01-25daily updateAlan Modra1-1/+1
2014-01-24Add .data and .bss refsym symbolsDJ Delorie3-4/+68
For each object, if it has a nonempty .data or .bss section, emit a symbol that could cause the startup code to selectively link in the code to initialize those sections. * config/tc-msp430.c (msp430_section): Always flag data sections, regardless of -md. (msp430_frob_section): New. Make sure all sections are noticed if they have content. (msp430_lcomm): New. Flag bss if .lcomm is seen. (msp430_comm): New. Likewise. (md_pseudo_table): Add them. * config/tc-msp430.h (msp430_frob_section): Declare. (tc_frob_section): Define.
2014-01-24Replace .align with .p2alignH.J. Lu2-3/+7
* ld-elf/pr16498a.s: Replace .align with .p2align.
2014-01-24Add another testcase for PR ld/16498H.J. Lu3-0/+22
PR ld/16498 * ld-elf/pr16498b.d: New file. * ld-elf/pr16498b.t: Likewise.
2014-01-24Improve orphaned TLS section handlingH.J. Lu6-0/+57
ld/ PR ld/16498 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Improve orphaned TLS section handling. ld/testsuite/ PR ld/16498 * ld-elf/pr16498a.d: New file. * ld-elf/pr16498a.s: Likewise. * ld-elf/pr16498a.t: Likewise.
2014-01-24Change len's type to ULONGEST: remote_read_bytes and get_core_siginfoYao Qi3-3/+8
Functions remote_read_bytes and get_core_siginfo are the callees of target to_xfer_partial interface, so argument 'len' should be changed to type ULONGEST. gdb: 2014-01-24 Yao Qi <yao@codesourcery.com> * remote.c (remote_read_bytes): Change type of len to ULONGEST. * corelow.c (get_core_siginfo): Likewise.
2014-01-24Change len's type to ULONGEST: remote_write_bytes_auxYao Qi2-3/+9
Hi, This patch changes the type of 'len' from ssize_t to ULONGEST. At the beginning Siddhesh Poyarekar proposed this patch [PATCH] Memory reads and writes should have size_t length https://sourceware.org/ml/gdb-patches/2012-05/msg01073.html to change type of 'len' to size_t. However, after Jan's review, we decide to change it to ssize_t, because callers of these functions may pass signed type to them. AFAICS, the target layer is a boundary. In one side, we pass size_t or ssize_t to target related APIs, and in the other side, the implementation side, we used LONGEST (ULONGEST in latest code) because of to_xfer_partial. Since remote_write_bytes_aux and remote_write_bytes belong to the implementation of remote target, we should use ULONGEST for len, IMO. Regression tested on x86_64-linux. Is it OK? gdb: 2014-01-24 Yao Qi <yao@codesourcery.com> * remote.c (remote_write_bytes_aux): Change type of 'len' to ULONGEST. Don't check 'len' is negative. (remote_write_bytes): Change type of 'len' to ULONGEST.
2014-01-24TLS orphan section placementAlan Modra2-52/+89
Ensures TLS orphans are placed adjacent to existing TLS sections, and fixes places where the output_section_statement flags (which might not be set) were tested when bfd_section flags were available. * ldlang.c (lang_output_section_find_by_flags): Be careful to test look->bfd_section->flags if available rather than look->flags. Separate SEC_THREAD_LOCAL handling from SEC_READONLY loop, and rewrite.
2014-01-24Fixes powerpc64le ld segfaults when --emit-relocs is used.Alan Modra2-5/+11
ELFv2 needs fewer relocs to annotate plt call stubs. I correctly allocated a smaller buffer and wrote the proper relocs, but stupidly bumped the reloc count as for ELFv1. * elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed to get_relocs for ELFv2.
2014-01-24daily updateAlan Modra1-1/+1
2014-01-23Remove the display of known MCU names from the MSP430 port of GAS.Nick Clifton2-36/+23
New MSP430 MCU parts are being created by TI all the time and the list is basically always out of date. Instead any name will be accepted by the -mmcu= command line option. ISA selection is now based upon the -mcpu= command line option, just as is done for GCC. gas/ChangeLog * config/tc-msp430.c (show_mcu_list): Delete. (md_parse_option): Accept any MCU name. Accept several more variants for the -mcpu option. (md_show_usage): Do not call show_mcu_list.
2014-01-23Issue a linker error if TLS sections are not adjacentH.J. Lu2-3/+29
Bad linker script may lead to TLS sections separated by non-TLS sections in output. This patch changes linker assert to a linker error to provide better linker diagnosis. PR ld/16498 * elf.c (_bfd_elf_map_sections_to_segments): Issue a linker error if TLS sections are not adjacent.
2014-01-23avoid python exception in FrameDecorator.pyTom Tromey2-2/+17
This fixes a bug in FrameDecorator.py. FrameVars seems to assume that Frame.block can return None if there is no block. However, it actually throws an exception. I saw this bug while developing a frame filter, but unfortunately I don't know how to reproduce it. It seems to me that the SAL tests in _is_limited_frame should exclude the bad cases; and in my attempts to write a test they do. Nevertheless I think the fix is reasonably obvious and ought to go in. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16485: * python/lib/gdb/FrameDecorator.py: (FrameVars.fetch_frame_args): Handle exception from frame.block. (FrameVars.fetch_frame_locals): Likewise.
2014-01-23fix erroneous error-handling in frame filter codeTom Tromey5-3/+47
This fixes PR python/16487. The bug here is that the function-name-handling code in py_print_frame had a small logic error (really a misplaced closing brace). This error could lead to a Py_DECREF(NULL), which crashes. This patch fixes the bug in the obvious way. Built and regtested on x86-64 Fedora 18. New test case included. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16487: * python/py-framefilter.c (py_print_frame): Don't call Py_DECREF on a NULL pointer. Move "goto error" to correct place. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16487: * gdb.python/py-framefilter.exp: Add test using "Error" filter. * gdb.python/py-framefilter.py (ErrorInName, ErrorFilter): New classes.
2014-01-23fix crash in frame filtersTom Tromey5-7/+23
apply_frame_filter calls ensure_python_env before computing the gdbarch to use. This means that python_gdbarch can be NULL while in Python code, and if a frame filter depends on this somehow (easy to do), gdb will crash. The fix is to compute the gdbarch first. Built and regtested on x86-64 Fedora 18. New test case included. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16491: * python/py-framefilter.c (apply_frame_filter): Call ensure_python_env after computing gdbarch. 2014-01-23 Tom Tromey <tromey@redhat.com> PR python/16491: * gdb.python/py-framefilter.py (Reverse_Function.function): Read a string from an inferior frame. * gdb.python/py-framefilter-mi.exp: Update.
2014-01-23Use gdb_byte * instead of void *Yao Qi2-4/+10
This patch changes the argument type to gdb_byte * in order to align with the to_xfer_partial interface. gdb: 2014-01-23 Yao Qi <yao@codesourcery.com> * target.c (raw_memory_xfer_partial): Change argument type from void * to gdb_byte *. (memory_xfer_partial_1, memory_xfer_partial): Likewise.
2014-01-22 * gdbthread.h (gdb_id_to_thread): Delete, unused.Doug Evans2-1/+5
2014-01-23daily updateAlan Modra1-1/+1
2014-01-22 New gdbserver option --debug-format=timestamp.Doug Evans27-381/+792
* NEWS: Mention it. gdbserver/ * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday. * configure: Regenerate. * config.in: Regenerate. * Makefile.in (SFILES): Add debug.c. (OBS): Add debug.o. * debug.c: New file. * debug.h: New file. * linux-aarch64-low.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * linux-arm-low.c (*): Ditto. * linux-cris-low.c (*): Ditto. * linux-crisv32-low.c (*): Ditto. * linux-m32r-low.c (*): Ditto. * linux-sparc-low.c (*): Ditto. * linux-x86.c (*): Ditto. * linux-low.c (*): Ditto. (linux_wait_1): Add calls to debug_enter, debug_exit. (linux_wait): Remove redundant debugging printf. (stop_all_lwps): Add calls to debug_enter, debug_exit. (linux_resume, unstop_all_lwps): Ditto. * mem-break.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * remote-utils.c (*): Ditto. * thread-db.c (*): Ditto. * server.c #include <ctype.h>, "gdb_vecs.h". (debug_threads): Moved to debug.c. (*): Update all debugging printfs to use debug_printf instead of fprintf. (start_inferior): Replace call to fflush with call to debug_flush. (monitor_show_help): Mention set debug-format. (parse_debug_format_options): New function. (handle_monitor_command): Handle "monitor set debug-format". (gdbserver_usage): Mention --debug-format. (main): Parse --debug-format. * server.h (debug_threads): Declaration moved to debug.h. #include "debug.h". * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of trace_debug_1 that uses debug_printf. (tracepoint_look_up_symbols): Update all debugging printfs to use debug_printf instead of fprintf. doc/ * gdb.texinfo (Server): Mention --debug-format=all|none|timestamp. (gdbserver man): Ditto. testsuite/ * gdb.server/server-mon.exp: Add tests for "set debug-format".
2014-01-22Add .refsym to msp430 backendDJ Delorie3-0/+24
* config/tc-msp430.c (msp430_refsym): New: ".refsym <symbol>" * doc/c-msp430.texi (MSP430 Directives): Document it. The purpose of this patch is to provide a way for one object file to require the inclusion of another object, without having to allocate space for a .word address reference.
2014-01-22Remove regzmm from AVX2 gather assertMichael Zolotukhin2-4/+7
Since regzmm can't be used in AVX2 gather instructions, there is no need to check regzmm in AVX2 gather assert. 2014-01-22 Michael Zolotukhin <michael.v.zolotukhin@gmail.com> * config/tc-i386.c (check_VecOperands): Remove regzmm from AVX2 gather assert.