aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-04-10Add a testcase for PR ld/18223H.J. Lu4-0/+21
PR ld/18223 * ld-gc/gc.exp: Run pr18223. * ld-gc/pr18223.d: New file. * ld-gc/pr18223.s: Likewise.
2015-04-10Use bfd_alloc for compressed section contentsH.J. Lu2-3/+12
Compressed section contents should be bfd_alloced to avoid memory leak. This patch replaces bfd_malloc and free with bfd_alloc and bfd_release on compressed buffer in bfd_compress_section_contents. There is still a very small memory leak when compressed section isn't smaller. * compress.c (bfd_compress_section_contents): Replace bfd_malloc and free with bfd_alloc and bfd_release on compressed buffer. Release buffer if compressed section isn't smaller.
2015-04-10Fix gdb.base/sigstep.exp with displaced stepping on software single-step targetsPedro Alves4-28/+114
TL;DR: When stepping over a breakpoint with displaced stepping, the core must be notified of all signals, otherwise the displaced step fixup code confuses a breakpoint trap in the signal handler for the expected trap indicating the displaced instruction was single-stepped normally/successfully. Detailed version: Running sigstep.exp with displaced stepping on, against my x86 software single-step branch, I got: FAIL: gdb.base/sigstep.exp: step on breakpoint, to handler: performing step FAIL: gdb.base/sigstep.exp: next on breakpoint, to handler: performing next FAIL: gdb.base/sigstep.exp: continue on breakpoint, to handler: performing continue Turning on debug logs, we see: (gdb) step infrun: clear_proceed_status_thread (process 32147) infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT) infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [process 32147] at 0x400842 displaced: stepping process 32147 now displaced: saved 0x400622: 49 89 d1 5e 48 89 e2 48 83 e4 f0 50 54 49 c7 c0 displaced: %rip-relative addressing used. displaced: using temp reg 2, old value 0x3615eafd37, new value 0x40084c displaced: copy 0x400842->0x400622: c7 81 1c 08 20 00 00 00 00 00 displaced: displaced pc to 0x400622 displaced: run 0x400622: c7 81 1c 08 LLR: Preparing to resume process 32147, 0, inferior_ptid process 32147 LLR: PTRACE_CONT process 32147, 0 (resume event thread) linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 32147, No child processes LLW: waitpid 32147 received Alarm clock (stopped) LLW: PTRACE_CONT process 32147, Alarm clock (preempt 'handle') LNW: waitpid(-1, ...) returned 0, No child processes LLW: exit (ignore) sigchld infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 32147, No child processes LLW: waitpid 32147 received Trace/breakpoint trap (stopped) CSBB: process 32147 stopped by software breakpoint LNW: waitpid(-1, ...) returned 0, No child processes LLW: trap ptid is process 32147. LLW: exit infrun: target_wait (-1.0.0, status) = infrun: 32147.32147.0 [process 32147], infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: TARGET_WAITKIND_STOPPED displaced: restored process 32147 0x400622 displaced: fixup (0x400842, 0x400622), insn = 0xc7 0x81 ... displaced: restoring reg 2 to 0x3615eafd37 displaced: relocated %rip from 0x400717 to 0x400937 infrun: stop_pc = 0x400937 infrun: delayed software breakpoint trap, ignoring infrun: no line number info infrun: stop_waiting 0x0000000000400937 in __dso_handle () 1: x/i $pc => 0x400937: and %ah,0xa0d64(%rip) # 0x4a16a1 (gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: performing step What should have happened is that the breakpoint hit in the signal handler should have been presented to the user. But note that "preempt 'handle'" -- what happened instead is that displaced_step_fixup confused the breakpoint in the signal handler for the expected SIGTRAP indicating the displaced instruction was single-stepped normally/successfully. This should be affecting all software single-step targets in the same way. The fix is to make sure the core sees all signals when displaced stepping, just like we already must see all signals when doing an stepping over a breakpoint in-line. We now get: infrun: target_wait (-1.0.0, status) = infrun: 570.570.0 [process 570], infrun: status->kind = stopped, signal = GDB_SIGNAL_ALRM infrun: TARGET_WAITKIND_STOPPED displaced: restored process 570 0x400622 infrun: stop_pc = 0x400842 infrun: random signal (GDB_SIGNAL_ALRM) infrun: signal arrived while stepping over breakpoint infrun: inserting step-resume breakpoint at 0x400842 infrun: resume (step=0, signal=GDB_SIGNAL_ALRM), trap_expected=0, current thread [process 570] at 0x400842 LLR: Preparing to resume process 570, Alarm clock, inferior_ptid process 570 LLR: PTRACE_CONT process 570, Alarm clock (resume event thread) infrun: prepare_to_wait linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 0, No child processes LLW: exit (ignore) infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore sigchld infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait linux_nat_wait: [process -1], [TARGET_WNOHANG] LLW: enter LNW: waitpid(-1, ...) returned 570, No child processes LLW: waitpid 570 received Trace/breakpoint trap (stopped) CSBB: process 570 stopped by software breakpoint LNW: waitpid(-1, ...) returned 0, No child processes LLW: trap ptid is process 570. LLW: exit infrun: target_wait (-1.0.0, status) = infrun: 570.570.0 [process 570], infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x400717 infrun: BPSTAT_WHAT_STOP_NOISY infrun: stop_waiting Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35 35 done = 1; Hardware single-step targets already behave this way, because the Linux backends (both native and gdbserver) always report signals to the core if the thread was single-stepping. As mentioned in the new comment in do_target_resume, we can't fix this by instead making the displaced_step_fixup phase skip fixing up the PC if the single step stopped somewhere we didn't expect. Here's what the backtrace would look like if we did that: Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35 35 done = 1; 1: x/i $pc => 0x400717 <handler+7>: movl $0x1,0x200943(%rip) # 0x601064 <done> (gdb) bt #0 handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35 #1 <signal handler called> #2 0x0000000000400622 in _start () (gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: backtrace gdb/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> * infrun.c (displaced_step_in_progress): New function. (do_target_resume): Advise target to report all signals if displaced stepping. gdb/testsuite/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> * gdb.base/sigstep.exp (breakpoint_to_handler) (breakpoint_to_handler_entry): New parameter 'displaced'. Use it. Test "backtrace" in handler. (breakpoint_over_handler): New parameter 'displaced'. Use it. (top level): Add new "displaced" test axis to breakpoint_to_handler, breakpoint_to_handler_entry and breakpoint_over_handler.
2015-04-10Downgrade linker error on protected symbols in .dynbss to a warningAlan Modra2-7/+9
PR ld/18222 * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error on adding a protected visibility variable to .dynbss.
2015-04-10Revert "Add extern_protected_data and set it for x86"Alan Modra21-75/+42
This reverts commit ca3fe95e469b9daec153caa2c90665f5daaec2b5.
2015-04-10gdb/18216: displaced step+deliver signal, a thread needs step-over, crashPedro Alves4-8/+13
The problem is that with hardware step targets and displaced stepping, "signal FOO" when stopped at a breakpoint steps the breakpoint instruction at the same time it delivers a signal. This results in tp->stepped_breakpoint set, but no step-resume breakpoint set. When the next stop event arrives, GDB crashes. Irrespective of whether we should do something more/different to step past the breakpoint in this scenario (e.g., PR 18225), it's just wrong to assume there'll be a step-resume breakpoint set (and was not the original intention). gdb/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/18216 * infrun.c (process_event_stop_test): Don't assume a step-resume is set if tp->stepped_breakpoint is true. gdb/testsuite/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/18216 * gdb.threads/multiple-step-overs.exp: Remove expected eof.
2015-04-10[arm] Fix displaced stepping for thumb alu reg instructionYao Qi5-10/+83
Recent patch series "V2 All-stop on top of non-stop" causes a SIGSEGV in the test case, > -PASS: gdb.base/info-shared.exp: continue to breakpoint: library function #4 > +FAIL: gdb.base/info-shared.exp: continue to breakpoint: library function #4 > > continue^M > Continuing.^M > ^M > Program received signal SIGSEGV, Segmentation fault.^M > 0x40021564 in ?? () gdb/testsuite/gdb.base/info-shared-solib1.so^M > (gdb) FAIL: gdb.base/info-shared.exp: continue to breakpoint: library function #4 and an ARM displaced stepping bug is exposed. It can be reproduced by the modified gdb.arch/arm-disp-step.exp as below, continue^M Continuing.^M ^M Program received signal SIGSEGV, Segmentation fault.^M 0xa713cfcc in ?? ()^M (gdb) FAIL: gdb.arch/arm-disp-step.exp: continue to breakpoint: continue to test_add_rn_pc_end This patch is to fix it. gdb: 2015-04-10 Yao Qi <yao.qi@linaro.org> * arm-tdep.c (install_alu_reg): Update comment. (thumb_copy_alu_reg): Remove local variable rn. Update debugging message. Use r2 instead of r1 in the modified instruction. gdb/testsuite: 2015-04-10 Yao Qi <yao.qi@linaro.org> * gdb.arch/arm-disp-step.S (main): Call test_add_rn_pc. (test_add_rn_pc): New function. * gdb.arch/arm-disp-step.exp (test_add_rn_pc): New proc. (top level): Invoke test_add_rn_pc.
2015-04-10PR13858 - Can't do displaced stepping with no symbolsPedro Alves10-54/+162
Running break-interp.exp with the target always in non-stop mode trips on PR13858, as enabling non-stop also enables displaced stepping. The problem is that when GDB doesn't know where the entry point is, it doesn't know where to put the displaced stepping scratch pad. The test added by this commit exercises this. Without the fix, we get: (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: break *$pc set displaced-stepping on (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: set displaced-stepping on stepi 0x00000000004005be in ?? () Entry point address is not known. (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: stepi p /x $pc $2 = 0x4005be (gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: get after PC FAIL: gdb.base/step-over-no-symbols.exp: displaced=on: advanced The fix switches all GNU/Linux ports to get the entry point from AT_ENTRY in the target auxiliary vector instead of from symbols. This is currently only done by PPC when Cell debugging is enabled, but I think all archs should be able to do the same. Note that ppc_linux_displaced_step_location cached the result, I'm guessing to avoid constantly re-fetching the auxv out of remote targets, but that's no longer necessary nowadays, as the auxv blob is itself cached in the inferior object. The ppc_linux_entry_point_addr global is obviously bad for multi-process too nowadays. Tested on x86-64 (-m64/-m32), PPC64 (-m64/-m32) and S/390 GNU/Linux. Yao tested the new test on ARM as well. gdb/ChangeLog: 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * linux-tdep.c (linux_displaced_step_location): New function, based on ppc_linux_displaced_step_location. * linux-tdep.h (linux_displaced_step_location): New declaration. * ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete. (ppc_linux_inferior_created, ppc_linux_displaced_step_location): Delete. (ppc_linux_init_abi): Install linux_displaced_step_location as gdbarch_displaced_step_location hook, even without Cell/B.E.. (_initialize_ppc_linux_tdep): Don't install ppc_linux_inferior_created as inferior_created observer. * s390-linux-tdep.c (s390_gdbarch_init): Install linux_displaced_step_location as gdbarch_displaced_step_location hook. gdb/testsuite/ 2015-04-10 Pedro Alves <palves@redhat.com> PR gdb/13858 * gdb.base/step-over-no-symbols.exp: New file.
2015-04-10Correct setting of elf_list_optionsAlan Modra3-14/+17
* configure.ac: Set elf_list_options etc. in proper case. * configure: Regenerate.
2015-04-10doc patch: compile: missing bitsJan Kratochvil2-0/+86
gdb/doc/ChangeLog 2015-04-10 Jan Kratochvil <jan.kratochvil@redhat.com> Eli Zaretskii <eliz@gnu.org> * gdb.texinfo (Compiling and Injecting Code): Describe set debug compile, show debug compile. New subsection Compilation options for the compile command. New subsection Compiler search for the compile command.
2015-04-10Add documentation about the interation of the ARM assembler's -EB option and ↵Nick Clifton4-2/+22
the linker's --be8 option. PR binutils/18198 * ld.texinfo (--be8): Add a note about the interaction of this option with the assembler's -EB option. * doc/c-arm.texi (ARM Options): Add a note about the interaction of the -EB option with the linker's --be8 option.
2015-04-10Mark _init and _fini for --gc-sectionsAlan Modra2-0/+21
gold marks _init and _fini via symbol, ld marks them via section (default scripts set .init and .fini section KEEP). This makes it possible for people to write their own _init and not bother to put the function into the right section. PR ld/18223 * ldlang.c (lang_process): Add _init and _fini to gc_sym_list.
2015-04-10Automatic date update in version.inGDB Administrator1-1/+1
2015-04-09Allow gold to resolve defined TLS symbols in a PIE link.Cary Coutant5-148/+378
This patch fixes Symbol::final_value_is_known so that a defined TLS symbol in a PIE link is treated as having a known final value, thus allowing GD->LE TLS optimization, eliminating an unnecessary GOT entry and dynamic relocation. gold/ * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol in a PIE link. * testsuite/Makefile.am (tls_pie_test.sh): New test. * testsuite/Makefile.in: Regenerate. * testsuite/tls_pie_test.sh: New.
2015-04-09Update comments in compress.cH.J. Lu2-6/+9
* compress.c (bfd_compress_section_contents): Update comments. (bfd_init_section_decompress_status): Likewise. (bfd_init_section_compress_status): Likewise.
2015-04-09doc/c-rx.texi: Fix markup typos in last change.Hans-Peter Nilsson2-2/+6
2015-04-09Improve ODR checking in gold.Cary Coutant5-17/+57
gold/ * debug.h (DEBUG_LOCATION): New. (DEBUG_ALL): Include DEBUG_LOCATION. (debug_string_to_enum): Add DEBUG_LOCATION. * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug output to print correct context. (Sized_dwarf_line_info::do_addr2line): Add debug output. Return up to 4 more locations at the beginning of the function. * symtab.cc (Symbol_table::detect_odr_violations): Get canonical result before sorting list of line numbers. * testsuite/debug_msg.sh: Allow range of line numbers for canonical results on optimized code.
2015-04-09Properly check --compress-debug-sections=XXXH.J. Lu4-16/+36
We can't check if input is ELF in copy_file since some targets may only set xvec after bfd_check_format_matches is called. This patch moves this check to copy_object. bfd/ * elfxx-target.h (TARGET_BIG_SYM): Add BFD_COMPRESS_GABI to object_flags. (TARGET_LITTLE_SYM): Likewise. binutils/ * objcopy.c (do_debug_sections): Use bit patterns. (copy_object): Return FALSE for compress_zlib, compress_gnu_zlib and compress_gabi_zlib on non-ELF input. (copy_file): Don't check non-ELF input here.
2015-04-09xtensa: update bfd/ChangelogMax Filippov1-0/+75
2015-04-09xtensa: replace action list with splay treeMax Filippov1-206/+282
text_action_add uses linear list search to order text actions list by action VMA. The list is used at the first relaxation pass, when it's not fixed yet. Replace the list with splay tree from libiberty. Original profile: % time self children called name ----------------------------------------- 0.00 0.00 14/158225 compute_text_actions 3.62 0.00 25211/158225 remove_dead_literal 8.42 0.00 58645/158225 coalesce_shared_literal 10.68 0.00 74355/158225 text_action_add_proposed 38.8 22.73 0.00 158225 text_action_add 0.00 0.00 144527/293246 bfd_zmalloc ----------------------------------------- Same data, after optimization: % time self children called name ----------------------------------------- 0.00 0.00 14/158225 compute_text_actions 0.00 0.00 25211/158225 remove_dead_literal 0.00 0.01 58645/158225 coalesce_shared_literal 0.00 0.01 74355/158225 text_action_add_proposed 0.1 0.00 0.02 158225 text_action_add 0.01 0.00 144527/144527 splay_tree_insert 0.00 0.00 144527/195130 splay_tree_lookup 0.00 0.00 144527/293246 bfd_zmalloc ----------------------------------------- 2015-04-03 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (splay-tree.h): include header. (text_action_struct): drop next pointer. (text_action_list_struct): drop head pointer, add count and tree fields. (find_fill_action): instead of linear search in text_action_list search in the tree. (text_action_compare, action_first, action_next): new functions. (text_action_add, text_action_add_literal): instead of linear search and insertion insert new node into the tree. (removed_by_actions): pass additional parameter: action_list, use it to traverse the tree. (offset_with_removed_text): pass additional action_list parameter to removed_by_actions. (map_action_fn_context): new typedef. (map_action_fn_context_struct): new structure. (map_action_fn): new function. (map_removal_by_action): use splay_tree_foreach to build map. (find_insn_action): replace linear search in text_action_list with series of splay_tree_lookups. (print_action, print_action_list_fn): new functions. (print_action_list): use splay_tree_foreach. (init_xtensa_relax_info): drop action_list.head initialization. Initialize the tree. (compute_text_actions): use non-zero action_list_count instead of non-NULL action list. (xlate_map_context): new typedef. (xlate_map_context_struct): new structure. (xlate_map_fn): new function. (build_xlate_map): use splay_tree_foreach to build map. (action_remove_bytes_fn): new function. (relax_section): use zero action_list_count instead of NULL action list. Use splay_tree_foreach to count final section size. Drop unused variable 'removed'.
2015-04-09xtensa: optimize find_removed_literalMax Filippov1-6/+58
find_removed_literal uses linear search to find removed literal by its VMA. The list of literals is fixed at that point, build an ordered index array and use binary search instead. Original profile: % time self children called name ----------------------------------------- 56.72 0.00 297578/669392 translate_reloc 70.86 0.00 371814/669392 relax_section 67.9 127.58 0.00 669392 find_removed_literal ----------------------------------------- Same data, after optimization: % time self children called name ----------------------------------------- 0.00 0.00 297578/669392 translate_reloc 0.00 0.00 371814/669392 relax_section 0.0 0.00 0.00 669392 find_removed_literal 0.00 0.00 23838/23838 map_removed_literal ----------------------------------------- 2015-04-03 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (removed_literal_map_entry): new typedef. (removed_literal_map_entry_struct): new structure. (removed_literal_list_struct): add new fields: n_map and map. (map_removed_literal, removed_literal_compare): new functions. (find_removed_literal): build index array for literals ordered by VMA, use binary search to find removed literal.
2015-04-09xtensa: optimize removed_by_actionsMax Filippov1-25/+156
The function removed_by_actions iterates through text actions to calculate an offset applied by text actions to a given VMA. Although it has a parameter p_start_action that allows for incremental offset calculation, in many places it's used with p_start_action explicitly set to the first action. After the first relaxation pass when the list of text actions is finalized, an array of offsets sorted by VMA may be used to speed up this function. Original profile: % time self children called name ----------------------------------------- 0.35 0.00 33872/4808961 relax_section_symbols 3.32 0.00 326022/4808961 relax_property_section 12.83 0.00 1259379/4808961 offset_with_removed_text 32.50 0.00 3189688/4808961 translate_reloc 71.5 49.00 0.00 4808961 removed_by_actions ----------------------------------------- Same data, after optimization: % time self children called name ----------------------------------------- 0.00 0.00 33872/4808537 relax_section_symbols 0.01 0.00 326022/4808537 relax_property_section 0.05 0.00 1258955/4808537 offset_with_removed_text_map 0.13 0.00 3189688/4808537 translate_reloc 1.0 0.20 0.00 4808537 removed_by_actions_map 0.00 0.00 120/120 map_removal_by_action ----------------------------------------- 2015-04-01 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (removal_by_action_entry_struct, removal_by_action_map_struct): new structures. (removal_by_action_entry, removal_by_action_map): new typedefs. (text_action_list_struct): add new field: map. (map_removal_by_action, removed_by_actions_map, offset_with_removed_text_map): new functions. (relax_section): replace offset_with_removed_text with offset_with_removed_text_map. (translate_reloc, relax_property_section, relax_section_symbols): replace removed_by_actions with removed_by_actions_map.
2015-04-09xtensa: optimize check_section_ebb_pcrels_fitMax Filippov1-23/+298
The original check_section_ebb_pcrels_fit algorithm checks that text actions proposed for current EBB are OK for every relocation in a section. There's no need to check every relocation, because text actions for EBB can only change size of that EBB, thus only affecting relocations that in any way cross that EBB. In addition EBBs are iterated in ascending order of their VMA, making it easier to track relevant relocations. Introduce a structure that can track relocations that cross the range of VMAs of EBB and use it to only check relocations relevant to current EBB in check_section_ebb_pcrels_fit. It takes O(N log N) operations to build it and O(N) operations to move current EBB VMA window through its entire range, where N is the number of relocations in a section. The resulting complexity of compute_text_actions is thus reduced from O(N^2) to O(N log N + N * M), where M is the average number of relocations crossing each EBB. Original profile: % time self children called name ----------------------------------------- 44.26 71.53 6429/6429 compute_text_actions 50.2 44.26 71.53 6429 check_section_ebb_pcrels_fit 1.16 20.12 347506666/347576152 pcrel_reloc_fits 2.95 16.52 347506666/348104944 get_relocation_opnd 2.01 9.74 347575100/361252208 r_reloc_init 0.55 7.53 347575100/363381467 r_reloc_get_section 5.76 0.02 695013332/695013332 xlate_offset_with_removed_text 0.68 3.89 347575100/363483827 bfd_octets_per_byte 0.32 0.00 347506666/349910253 is_alt_relocation 0.18 0.11 6391/6391 build_xlate_map 0.00 0.00 6429/19417168 get_xtensa_relax_info 0.00 0.00 6391/6391 free_xlate_map ----------------------------------------- Same data, after optimization: % time self children called name ----------------------------------------- 2.56 3.08 6429/6429 compute_text_actions 8.2 2.56 3.08 6429 check_section_ebb_pcrels_fit 0.08 0.91 17721075/17790561 pcrel_reloc_fits 0.17 0.47 17721075/31685977 r_reloc_init 0.43 0.00 35442150/35442150 xlate_offset_with_removed_text 0.02 0.37 17721075/33815236 r_reloc_get_section 0.22 0.11 6391/6391 build_xlate_map 0.05 0.22 17721075/33917596 bfd_octets_per_byte 0.03 0.00 17721075/20405299 is_alt_relocation 0.01 0.00 6429/6429 reloc_range_list_update_range 0.00 0.00 6429/19417168 get_xtensa_relax_info 0.00 0.00 6391/6391 free_xlate_map ----------------------------------------- 2015-04-01 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry, reloc_range): new typedef. (reloc_range_list_struct, reloc_range_list_entry_struct, reloc_range_struct): new structures. (reloc_range_compare, build_reloc_ranges, reloc_range_list_append, reloc_range_list_remove, reloc_range_list_update_range, free_reloc_range_list): new functions. (compute_text_actions): precompute relocation opcodes before the loop. Add relevant_relocs variable, initialize it before the loop, pass it to the check_section_ebb_pcrels_fit. (check_section_ebb_pcrels_fit): add new parameter: relevant_relocs. Update address range in the relevant_relocs if it's non-NULL and iterate only over relevant relocations.
2015-04-09Remove BNDPLT and add PARSE_AND_LIST_ARGS_CASE_ZH.J. Lu3-16/+24
* emulparams/elf_x86_64.sh (BNDPLT): Removed. (PARSE_AND_LIST_OPTIONS): New. (PARSE_AND_LIST_ARGS_CASE_Z): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Remove BNDPLT check. Handle PARSE_AND_LIST_ARGS_CASE_Z. (gld${EMULATION_NAME}_list_options): Remove BNDPLT check.
2015-04-09Rename common-remote-fileio.[ch] as fileio.[ch]Gary Benson10-73/+98
This commit renames common-remote-fileio.[ch] as fileio.[ch] and renames all functions in these files. gdb/ChangeLog: * common/common-remote-fileio.h: Rename to... * common/fileio.h: ...this. Update all references. (remote_fileio_to_fio_error): Rename to... (host_to_fileio_error): ...this. (remote_fileio_to_be): Rename to... (host_to_bigendian): ...this. Update all callers. (remote_fileio_to_fio_uint): Rename to... (host_to_fileio_uint): ...this. Update all callers. (remote_fileio_to_fio_time): Rename to... (host_to_fileio_time): ...this. Update all callers. (remote_fileio_to_fio_stat): Rename to... (host_to_fileio_stat): ...this. Update all references. * common/common-remote-fileio.c: Rename to... * common/fileio.c: ...this. Update all references. (remote_fileio_to_fio_error): Rename to... (host_to_fileio_error): ...this. Update all callers. (remote_fileio_mode_to_target): Rename to... (fileio_mode_pack): ...this. Update all callers. (remote_fileio_to_fio_mode): Rename to... (host_to_fileio_mode): ...this. Update all callers. (remote_fileio_to_fio_ulong): Rename to... (host_to_fileio_ulong): ...this. Update all callers. (remote_fileio_to_fio_stat): Rename to... (host_to_fileio_stat): ...this. Update all callers.
2015-04-09Update French translation of ld strings.Nick Clifton2-889/+822
* po/fr.po: Updated French translation.
2015-04-09Add Guile frame-read-register commandAndy Wingo7-0/+103
gdb/ChangeLog: * guile/scm-frame.c (gdbscm_frame_read_register): New function. (frame_functions): Bind gdbscm_frame_read_register to frame-read-register. * guile/lib/gdb.scm (frame-read-register): Export. gdb/doc/ChangeLog: * guile.texi (Frames In Guile): Describe frame-read-register. gdb/testsuite/ChangeLog: * gdb.guile/scm-frame.exp: Add frame-read-register tests, modelled after the Python tests.
2015-04-09Introduce new shared function remote_fileio_to_fio_errorGary Benson7-165/+86
This commit introduces a new shared function to replace three identical functions in various places in the codebase. gdb/ChangeLog: * common/common-remote-fileio.h (remote_fileio_to_fio_error): New declaration. * common/common-remote-fileio.c (remote_fileio_to_fio_error): New function, factored out the named functions below. * inf-child.c (gdb/fileio.h): Remove include. (common-remote-fileio.h): New include. (inf_child_errno_to_fileio_error): Remove function. Update all callers to use remote_fileio_to_fio_error. * remote-fileio.c (remote_fileio_errno_to_target): Likewise. gdb/gdbserver/ChangeLog: * hostio-errno.c (errno_to_fileio_error): Remove function. Update caller to use remote_fileio_to_fio_error.
2015-04-09Add myself to Write After Approval list.Andy Wingo2-0/+5
gdb/ChangeLog: * MAINTAINERS (Write After Approval): Add Andy Wingo.
2015-04-09Add support to the RX toolchain to restrict the use of string instructions.Nick Clifton11-9/+96
bfd * elf32-rx.c (describe_flags): Report the settings of the string insn using bits. (rx_elf_merge_private_bfd_data): Handle merging of the string insn using bits. bin * readelf.c (get_machine_flags): Report the setting of the string insn using bits. gas * config/tc-rx.c (enum options): Add OPTION_DISALLOW_STRING_INSNS. (md_longopts): Add -mno-allow-string-insns. (md_parse_option): Handle -mno-allow-string-insns. (md_show_usage): Mention -mno-allow-string-insns. (rx_note_string_insn_use): New function. Produces an error message if a string insn is used when it is not allowed. * config/rx-parse.y (SCMPU): Call rx_note_string_insn_use. (SMOVU, SMOVB, SMOVF, SUNTIL, SWHILE, RMPA): Likewise. * config/rx-defs.h (rx_note_string_insn_use): Prototype. * doc/c-rx.texi: Document -mno-allow-string-insns. elf * rx.h (E_FLAG_RX_SINSNS_SET): New bit in e_flags field. (E_FLAG_RX_SINSNS_YES): Likewise. (E_FLAG_RX_SINSNS_MASK): New define.
2015-04-09Replace $zlibdir with $ZLIBDIR in LDFLAGSH.J. Lu3-3/+12
* acinclude.m4: (GDB_AC_CHECK_BFD): Set ZLIBDIR with $zlibdir. Replace $zlibdir with $ZLIBDIR in LDFLAGS. * configure: Regenerated.
2015-04-09Import strtok_r gnulib modulePedro Alves12-6/+327
gdb/linux-tdep.c recently gained a strtok_r use. That broke --enable-targets=all with some versions of mingw64, which don't have strtok_r: https://sourceware.org/ml/gdb-patches/2015-04/msg00266.html Fix that by importing the strtok_r gnulib module. gdb/ChangeLog: 2015-04-09 Pedro Alves <palves@redhat.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add strtok_r. * gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/strtok_r.m4. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: Regenerate. * gnulib/import/Makefile.am: Update. * gnulib/import/Makefile.in: Update. * gnulib/import/m4/gnulib-cache.m4: Update. * gnulib/import/m4/gnulib-comp.m4: Update. * gnulib/import/m4/strtok_r.m4: New file. * gnulib/import/strtok_r.c: New file.
2015-04-09update-gnulib.sh: work around aclocal warning with Perl >= 5.16Pedro Alves2-1/+22
gdb/ChangeLog: 2015-04-09 Pedro Alves <palves@redhat.com> * gnulib/update-gnulib.sh (aclocal version check): Filter out "called too early to check prototype".
2015-04-09gdbserver gnu/linux: stepping over breakpointYao Qi3-8/+16
Hi, I see the following error on arm linux gdbserver, continue^M Continuing.^M ../../../binutils-gdb/gdb/gdbserver/linux-arm-low.c:458: A problem internal to GDBserver has been detected.^M raw_bkpt_type_to_arm_hwbp_type: unhandled raw type^M Remote connection closed^M (gdb) FAIL: gdb.base/cond-eval-mode.exp: hbreak: continue After we make GDBserver handling Zx/zx packet idempotent, [PATCH 3/3] [GDBserver] Make Zx/zx packet handling idempotent. https://sourceware.org/ml/gdb-patches/2014-04/msg00480.html > Now removal/insertion of all kinds of breakpoints/watchpoints, either > internal, or from GDB, always go through the target methods. GDBserver handles all kinds of breakpoints/watchpoints through target methods. However, some target backends, such as arm, don't support Z0 packet but need software breakpoint to do breakpoint stepping over in linux-low.c:start_step_over, if (can_hardware_single_step ()) { step = 1; } else { CORE_ADDR raddr = (*the_low_target.breakpoint_reinsert_addr) (); set_reinsert_breakpoint (raddr); step = 0; } a software breakpoint is requested to the backend, and the error is triggered. This problem should affect targets having breakpoint_reinsert_addr hooked. Instead of handling memory breakpoint in these affected linux backend, this patch handles memory breakpoint in linux_{insert,remove}_point, that, if memory breakpoint is requested, call {insert,remove}_memory_breakpoint respectively. Then, it becomes unnecessary to handle memory breakpoint for linux x86 backend, so this patch removes the code there. This patch is tested with GDBserver on x86_64-linux and arm-linux (-marm, -mthumb). Note that there are still some fails in gdb.base/cond-eval-mode.exp with -mthumb, because GDBserver doesn't know how to select the correct breakpoint instruction according to the arm-or-thumb-mode of requested address. This is a separate issue, anyway. gdb/gdbserver: 2015-04-09 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_insert_point): Call insert_memory_breakpoint if TYPE is raw_bkpt_type_sw. (linux_remove_point): Call remove_memory_breakpoint if type is raw_bkpt_type_sw. * linux-x86-low.c (x86_insert_point): Don't call insert_memory_breakpoint. (x86_remove_point): Don't call remove_memory_breakpoint.
2015-04-08Enable ELF ld_list_options for --enable-targets=allH.J. Lu3-0/+14
When --enable-targets=all is used with non-ELF target, we should enable ELF ld_list_options. * configure.ac (elf_list_options): Set to TRUE for --enable-targets=all. (elf_shlib_list_options): Likewise. (elf_plt_unwind_list_options): Likewise. * configure: Regenerated.
2015-04-09Automatic date update in version.inGDB Administrator1-1/+1
2015-04-08Fix Python completion when using the "complete" commandSergio Durigan Junior5-69/+226
This patch is related to PR python/16699, and is an improvement over the patch posted here: <https://sourceware.org/ml/gdb-patches/2014-03/msg00301.html> Keith noticed that, when using the "complete" command on GDB to complete a Python command, some strange things could happen. In order to understand what can go wrong, I need to explain how the Python completion mechanism works. When the user requests a completion of a Python command by using TAB, GDB will first try to determine the right set of "brkchars" that will be used when doing the completion. This is done by actually calling the "complete" method of the Python class. Then, when we already know the "brkchars" that will be used, we call the "complete" method again, for the same values. If you read the thread mentioned above, you will see that one of the design decisions was to make the "cmdpy_completer_helper" (which is the function the does the actual calling of the "complete" method) cache the first result of the completion, since this result will be used in the second call, to do the actual completion. The problem is that the "complete" command does not process the brkchars, and the current Python completion mechanism (improved by the patch mentioned above) relies on GDB trying to determine the brkchars, and then doing the completion itself. Therefore, when we use the "complete" command instead of doing a TAB-completion on GDB, there is a scenario where we can use the invalid cache of a previous Python command that was completed before. For example: (gdb) A <TAB> (gdb) complete B B value1 B value10 B value2 B value3 B value4 B value5 B value6 B value7 B value8 B value9 (gdb) B <TAB> comp1 comp2 comp4 comp6 comp8 comp10 comp3 comp5 comp7 comp9 Here, we see that "complete B " gave a different result than "B <TAB>". The reason for that is because "A <TAB>" was called before, and its completion results were "value*", so when GDB tried to "complete B " it wrongly answered with the results for A. The problem here is using a wrong cache (A's cache) for completing B. We tried to come up with a solution that would preserve the caching mechanism, but it wasn't really possible. So I decided to completely remove the cache, and doing the method calling twice for every completion. This is not optimal, but I do not think it will impact users noticeably. It is worth mentioning another small issue that I found. The code was doing: wordobj = PyUnicode_Decode (word, sizeof (word), host_charset (), NULL); which is totally wrong, because using "sizeof" here will lead to always the same result. So I changed this to use "strlen". The testcase also catches this problem. Keith kindly expanded the existing testcase to cover the problem described above, and everything is passing. gdb/ChangeLog: 2015-04-08 Sergio Durigan Junior <sergiodj@redhat.com> PR python/16699 * python/py-cmd.c (cmdpy_completer_helper): Adjust function to not use a caching mechanism. Adjust comments and code to reflect that. Replace 'sizeof' by 'strlen' when fetching 'wordobj'. (cmdpy_completer_handle_brkchars): Adjust call to cmdpy_completer_helper. Call Py_XDECREF for 'resultobj'. (cmdpy_completer): Likewise. gdb/testsuite/ChangeLog: 2015-04-08 Keith Seitz <keiths@redhat.com> PR python/16699 * gdb.python/py-completion.exp: New tests for completion. * gdb.python/py-completion.py (CompleteLimit1): New class. (CompleteLimit2): Likewise. (CompleteLimit3): Likewise. (CompleteLimit4): Likewise. (CompleteLimit5): Likewise. (CompleteLimit6): Likewise. (CompleteLimit7): Likewise.
2015-04-08Add test for PR18214 and PR18216 - multiple step-overs with queued signalsPedro Alves3-14/+88
Both PRs are triggered by the same use case. PR18214 is about software single-step targets. On those, the 'resume' code that detects that we're stepping over a breakpoint and delivering a signal at the same time: /* Currently, our software single-step implementation leads to different results than hardware single-stepping in one situation: when stepping into delivering a signal which has an associated signal handler, hardware single-step will stop at the first instruction of the handler, while software single-step will simply skip execution of the handler. ... Fortunately, we can at least fix this particular issue. We detect here the case where we are about to deliver a signal while software single-stepping with breakpoints removed. In this situation, we revert the decisions to remove all breakpoints and insert single- step breakpoints, and instead we install a step-resume breakpoint at the current address, deliver the signal without stepping, and once we arrive back at the step-resume breakpoint, actually step over the breakpoint we originally wanted to step over. */ doesn't handle the case of _another_ thread also needing to step over a breakpoint. Because the other thread is just resumed at the PC where it had stopped and a breakpoint is still inserted there, the thread immediately re-traps the same breakpoint. This test exercises that. On software single-step targets, it fails like this: KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr3: continue to sigusr1_handler KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr2: continue to sigusr1_handler gdb.log (simplified): (gdb) continue Continuing. Breakpoint 4, child_function_2 (arg=0x0) at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:66 66 callme (); /* set breakpoint thread 2 here */ (gdb) thread 3 (gdb) queue-signal SIGUSR1 (gdb) thread 1 [Switching to thread 1 (Thread 0x7ffff7fc1740 (LWP 24824))] #0 main () at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:106 106 wait_threads (); /* set wait-threads breakpoint here */ (gdb) break sigusr1_handler Breakpoint 5 at 0x400837: file src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 31. (gdb) continue Continuing. [Switching to Thread 0x7ffff7fc0700 (LWP 24828)] Breakpoint 4, child_function_2 (arg=0x0) at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:66 66 callme (); /* set breakpoint thread 2 here */ (gdb) KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr3: continue to sigusr1_handler For good measure, I made the test try displaced stepping too. And then I found it crashes GDB on x86-64 (a hardware step target), but only when displaced stepping... : KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr1: continue to sigusr1_handler (PRMS: gdb/18216) KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr2: continue to sigusr1_handler (PRMS: gdb/18216) KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr3: continue to sigusr1_handler (PRMS: gdb/18216) Program terminated with signal SIGSEGV, Segmentation fault. #0 0x000000000062a83a in process_event_stop_test (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4964 4964 if (sr_bp->loc->permanent Setting up the environment for debugging gdb. Breakpoint 1 at 0x79fcfc: file src/gdb/common/errors.c, line 54. Breakpoint 2 at 0x50a26c: file src/gdb/cli/cli-cmds.c, line 217. (top-gdb) p sr_bp $1 = (struct breakpoint *) 0x0 (top-gdb) bt #0 0x000000000062a83a in process_event_stop_test (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4964 #1 0x000000000062a1af in handle_signal_stop (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4715 #2 0x0000000000629097 in handle_inferior_event (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4165 #3 0x0000000000627482 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:3298 #4 0x000000000064ad7b in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:56 #5 0x00000000004c375f in handle_target_event (error=0, client_data=0x0) at src/gdb/linux-nat.c:4658 #6 0x0000000000648c47 in handle_file_event (file_ptr=0x2e0eaa0, ready_mask=1) at src/gdb/event-loop.c:658 The all-stop-non-stop series fixes this, but meanwhile, this augments the multiple-step-overs.exp test to cover this, KFAILed. gdb/testsuite/ChangeLog: 2015-04-08 Pedro Alves <palves@redhat.com> PR gdb/18214 PR gdb/18216 * gdb.threads/multiple-step-overs.c (sigusr1_handler): New function. (main): Install it as SIGUSR1 handler. * gdb.threads/multiple-step-overs.exp (setup): Remove 'prefix' parameter. Always use "setup" as prefix. Toggle "set displaced-stepping" off/on depending on global. Don't switch to thread 1 here. (top level): Add displaced stepping "off/on" test axis. Update "setup" calls. Wrap each subtest with with_test_prefix. Test continuing with a queued signal in each thread.
2015-04-08Add chdr_size, Chdr, Chdr_write and Chdr_dataH.J. Lu3-0/+78
* elfcpp.h (Elf_sizes): Add chdr_size. (Chdr): New. (Chdr_write): Likewise. * elfcpp_internal.h (Chdr_data): Likewise.
2015-04-08Add SHF_COMPRESSED and ELFCOMPRESS_XXX to elfcpp.hH.J. Lu2-0/+21
* elfcpp.h (SHF): Add SHF_COMPRESSED. (ELFCOMPRESS_ZLIB): New. (ELFCOMPRESS_LOOS): Likewise. (ELFCOMPRESS_HIOS): Likewise. (ELFCOMPRESS_LOPROC): Likewise. (ELFCOMPRESS_HIPROC): Likewise.
2015-04-08Skip empty EMULATION_NAMEH.J. Lu2-3/+8
* emulparams/elf32bmipn32-defs.sh: Skip empty EMULATION_NAME.
2015-04-08Work around a GCC uninitialized warning bugH.J. Lu2-0/+10
* compress.c (bfd_compress_section_contents): Work around a GCC uninitialized warning bug fixed in GCC 4.7.
2015-04-08[spu] Don't call set_gdbarch_cannot_step_breakpoint in spu_gdbarch_initYao Qi2-1/+5
Nowadays, in infrun.c:resume, the setting to 'step' variable is like: if (use_displaced_stepping (gdbarch) && tp->control.trap_expected && sig == GDB_SIGNAL_0 && !current_inferior ()->waiting_for_vfork_done) { } /* Do we need to do it the hard way, w/temp breakpoints? */ else if (step) step = maybe_software_singlestep (gdbarch, pc); <-- [1] ... if (execution_direction != EXEC_REVERSE && step && breakpoint_inserted_here_p (aspace, pc)) { ... if (gdbarch_cannot_step_breakpoint (gdbarch)) <-- [2] step = 0; } spu doesn't have displaced stepping and uses software single step, so 'step' is set to zero in [1], and [2] becomes unreachable as a result. So don't have to call set_gdbarch_cannot_step_breakpoint in spu_gdbarch_init. gdb: 2015-04-08 Yao Qi <yao.qi@linaro.org> * spu-tdep.c (spu_gdbarch_init): Don't call set_gdbarch_cannot_step_breakpoint.
2015-04-08Add SHF_COMPRESSED support to gas and objcopyH.J. Lu31-120/+1292
This patch adds --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi} options to gas and objcopy for ELF files. They control how DWARF debug sections are compressed. --compress-debug-sections=none is equivalent to --nocompress-debug-sections. --compress-debug-sections=zlib and --compress-debug-sections=zlib-gnu are equivalent to --compress-debug-sections. --compress-debug-sections=zlib-gabi compresses DWARF debug sections with SHF_COMPRESSED from the ELF ABI. No linker changes are required to support SHF_COMPRESSED. bfd/ * archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI bit. * bfd.c (bfd::flags): Increase size to 18 bits. (BFD_COMPRESS_GABI): New. (BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI. (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise. (bfd_update_compression_header): New fuction. (bfd_check_compression_header): Likewise. (bfd_get_compression_header_size): Likewise. (bfd_is_section_compressed_with_header): Likewise. * compress.c (MAX_COMPRESSION_HEADER_SIZE): New. (bfd_compress_section_contents): Return the uncompressed size if the full section contents is compressed successfully. Support converting from/to .zdebug* sections. (bfd_get_full_section_contents): Call bfd_get_compression_header_size to get compression header size. (bfd_is_section_compressed): Renamed to ... (bfd_is_section_compressed_with_header): This. Add a pointer argument to return compression header size. (bfd_is_section_compressed): Use it. (bfd_init_section_decompress_status): Call bfd_get_compression_header_size to get compression header size. Return FALSE if uncompressed section size is 0. * elf.c (_bfd_elf_make_section_from_shdr): Support converting from/to .zdebug* sections. * bfd-in2.h: Regenerated. binutils/ * objcopy.c (do_debug_sections): Add compress_zlib, compress_gnu_zlib and compress_gabi_zlib. (copy_options): Use optional_argument on compress-debug-sections. (copy_usage): Update --compress-debug-sections. (copy_file): Handle compress_zlib, compress_gnu_zlib and compress_gabi_zlib. (copy_main): Handle --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. * doc/binutils.texi: Document --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. binutils/testsuite/ * compress.exp: Add tests for --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. * binutils-all/dw2-3.rS: New file. * binutils-all/dw2-3.rt: Likewise. * binutils-all/libdw2-compressedgabi.out: Likewise. gas/ * as.c (show_usage): Update --compress-debug-sections. (std_longopts): Use optional_argument on compress-debug-sections. (parse_args): Handle --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. * as.h (compressed_debug_section_type): New. (flag_compress_debug): Change type to compressed_debug_section_type. --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. * write.c (compress_debug): Set BFD_COMPRESS_GABI for --compress-debug-sections=zlib-gabi. Call bfd_get_compression_header_size to get compression header size. Don't rename section name for --compress-debug-sections=zlib-gabi. * config/tc-i386.c (compressed_debug_section_type): Set to COMPRESS_DEBUG_ZLIB. * doc/as.texinfo: Document --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}. gas/testsuite/ * gas/i386/dw2-compressed-1.d: New file. * gas/i386/dw2-compressed-2.d: Likewise. * gas/i386/dw2-compressed-3.d: Likewise. * gas/i386/x86-64-dw2-compressed-2.d: Likewise. * gas/i386/i386.exp: Run dw2-compressed-2, dw2-compressed-1, dw2-compressed-3 and x86-64-dw2-compressed-2. ld/testsuite/ * ld-elf/compress.exp: Add a test for --compress-debug-sections=zlib-gabi. (build_tests): Add 2 tests for --compress-debug-sections=zlib-gabi. (run_tests): Likewise. Verify linker output with zlib-gabi compressed debug input. * ld-elf/compressed1a.d: New file. * ld-elf/compressed1b.d: Likewise. * ld-elf/compressed1c.d: Likewise.
2015-04-08Display --interleave[=<number>]H.J. Lu2-1/+6
Optional argument of a command line option must start with "=". * objcopy.c (copy_usage): Replace "--interleave [<number>]" with --interleave[=<number>].
2015-04-08Add ld_list_optionsH.J. Lu8-119/+195
This patch adds ld_list_options for ELF targets to avoid duplicated outputs from ld --help. * Makefile.am (ELF_CLFAGS): New. (AM_CFLAGS): Add $(ELF_CLFAGS). * configure.ac (elf_list_options): New. AC_SUBST. (elf_shlib_list_options): Likewise. (elf_plt_unwind_list_options): Likewise. * lexsup.c (elf_shlib_list_options): New. (elf_static_list_options): Likewise. (elf_plt_unwind_list_options): Likewise. (ld_list_options): Likewise. (help): Call ld_list_options. * Makefile.in: Regenerated. * configure: Likewise. * emulparams/plt_unwind.sh (PLT_UNWIND): New. (PARSE_AND_LIST_OPTIONS): Removed. * emultempl/elf32.em (gld_list_options): New. (gld${EMULATION_NAME}_list_options): Define only if BNDPLT or PARSE_AND_LIST_OPTIONS is defined. (ld_${EMULATION_NAME}_emulation): Replace gld${EMULATION_NAME}_list_options with ${gld_list_options.
2015-04-08Fix gdb.trace/{actions,infotrace,while-stepping}.exp with extended-remotePedro Alves4-3/+33
The recent actions.exp change to check gdb_run_cmd succeeded caught further problems. The test now fails like this with --target_board=native-extended-gdbserver: FAIL: gdb.trace/actions.exp: Can't run to main gdb.log shows: (gdb) run Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.trace/actions Running the default executable on the remote target failed; try "set remote exec-file"? (gdb) FAIL: gdb.trace/actions.exp: Can't run to main The problem is that a gdb_load call is missing. Grepping around for similar problems in other tests, I found that infotrace.exp and while-stepping.exp should be likewise affected. And indeed this is what we get today: FAIL: gdb.trace/infotrace.exp: tstart FAIL: gdb.trace/infotrace.exp: continue to end (the program is no longer running) FAIL: gdb.trace/infotrace.exp: tstop FAIL: gdb.trace/infotrace.exp: 2.6: info tracepoints (trace buffer usage) FAIL: gdb.trace/while-stepping.exp: tstart FAIL: gdb.trace/while-stepping.exp: tstop FAIL: gdb.trace/while-stepping.exp: tfile: info tracepoints FAIL: gdb.trace/while-stepping.exp: ctf: info tracepoints while-stepping.exp even has the same race bug actions.exp had. After this, {actions,infotrace,while-stepping}.exp all pass cleanly with the native-extended-gdbserver board. gdb/testsuite/ChangeLog: 2015-04-08 Pedro Alves <palves@redhat.com> * gdb.trace/actions.exp: Use gdb_load before gdb_run_cmd. * gdb.trace/infotrace.exp: Use gdb_load before gdb_run_cmd. Use gdb_breakpoint instead of gdb_test that doesn't expect anything. Return early if running to main fails. * gdb.trace/while-stepping.exp: Likewise.
2015-04-07Add AArch32 support for arm gold linker.Han Shen4-2/+34
2015-04-08Automatic date update in version.inGDB Administrator1-1/+1
2015-04-07Initialize variable on gdb/linux-tdep.c:decode_vmflagsSergio Durigan Junior2-1/+5
This obvious commit initializes the 'saveptr' variable on gdb/linux-tdep.c:decode_vmflags. This was causing a build failure on Fedora 21 x86_64, caught by the BuildBot here: <https://sourceware.org/ml/gdb-testers/2015-q2/msg00450.html>