aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-03-02Speedup mmo and pe orphan placement for relocatable linkH.J. Lu4-36/+68
Since there is no need to place output sections in specific order for relocatable link, we can skip merging flags of other input sections. PR ld/19739 * emultempl/mmo.em (mmo_place_orphan): Don't merge flags of other input sections for relocatable link. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2016-03-02Regenerate rl78 opcodes fileAlan Modra2-2/+3
For newer comments. * rl78-decode.c: Regenerate.
2016-03-02Regenerate bfd files.Alan Modra3-0/+7
* Makefile.in: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2016-03-02Fix shift left warning at sourceAlan Modra4-2/+10
cpu/ * fr30.cpu (f-m4): Replace -1 << 4 with -16. opcodes/ * fr30-ibld.c: Regenerate.
2016-03-02Automatic date update in version.inGDB Administrator1-1/+1
2016-03-01Update PR ld/12365 test for GCC 6H.J. Lu2-1/+16
PR ld/12365 test is to verify that linker catches the reference to undefined symbol error caused by a GCC bug. Since the GCC bug has been fixed in GCC 6, update the test to verify that there is no reference to undefined symbol in executable * testsuite/ld-plugin/lto.exp: Update PR ld/12365 test for GCC 6.
2016-03-01Fix gdb.trace/ftrace-lock.c compilationPedro Alves2-0/+5
Fixes, on F23: .../src/gdb/testsuite/gdb.trace/ftrace-lock.c: In function 'gdb_agent_gdb_collect': .../src/gdb/testsuite/gdb.trace/ftrace-lock.c:50:3: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration] sleep (1); ^ gdb/testsuite/ChangeLog: 2016-03-01 Pedro Alves <palves@redhat.com> * gdb.trace/ftrace-lock.c: Include <unistd.h>.
2016-03-01Fix gdb.threads/watchpoint-fork*.c compilationPedro Alves5-9/+19
This testcase currently fails to compile on Fedora 23: .../src/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c: In function 'start': .../src/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c:70:11: warning: implicit declaration of function 'pthread_yield' [-Wimplicit-function-declaration] i = pthread_yield (); ^ .../src/gdb/testsuite/gdb.threads/watchpoint-fork-child.c: In function 'forkoff': .../src/gdb/testsuite/gdb.threads/watchpoint-fork-child.c:114:8: warning: implicit declaration of function 'pthread_yield' [-Wimplicit-function-declaratio n] i = pthread_yield (); ^ /tmp/ccUkNIsI.o: In function `start': .../src/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c:70: undefined reference to `pthread_yield' (...) collect2: error: ld returned 1 exit status UNSUPPORTED: gdb.threads/watchpoint-fork.exp: child: multithreaded: Couldn't compile watchpoint-fork-child.c: unrecognized error UNTESTED: gdb.threads/watchpoint-fork.exp: child: multithreaded: watchpoint-fork.exp testcase .../src/gdb/testsuite/gdb.threads/watchpoint-fork.exp completed i The glibc manual says, on _GNU_SOURCE: "You should define these macros by using ‘#define’ preprocessor directives at the top of your source code files. These directives must come before any #include of a system header file." I instead put it in the header all the .c files of the testcase must include anyway. gdb/testsuite/ChangeLog: 2016-03-01 Pedro Alves <palves@redhat.com> * gdb.threads/watchpoint-fork-child.c: Include "watchpoint-fork.h" before anything else. * gdb.threads/watchpoint-fork-mt.c: Likewise. Don't define _GNU_SOURCE here. * gdb.threads/watchpoint-fork-st.c: Include "watchpoint-fork.h" before anything else. * gdb.threads/watchpoint-fork.h: Define _GNU_SOURCE.
2016-03-01Fix gdb.base/catch-fork-kill.c compilationPedro Alves2-0/+5
Fixes: Running .../src/gdb/testsuite/gdb.base/catch-fork-kill.exp ... gdb compile failed, .../src/gdb/testsuite/gdb.base/catch-fork-kill.c: In function 'main': .../src/gdb/testsuite/gdb.base/catch-fork-kill.c:81:4: warning: implicit declaration of function 'wait' [-Wimplicit-function-declaration] wait (NULL); ^ gdb/testsuite/ChangeLog: 2016-03-01 Pedro Alves <palves@redhat.com> * gdb.base/catch-fork-kill.c: Include <sys/wait.h>.
2016-03-01Skip ld-elf/pr19162.d for arc targetH.J. Lu2-0/+6
* testsuite/ld-elf/pr19162.d: Skip arc target.
2016-03-01Fix output path for arm-disp-step.expYao Qi2-9/+7
This patch fixes the following error, ERROR: (/scratch/yao/gdb/build-git/arm-linux-gnueabihf/gdb/testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step) No such file or directory FAIL: gdb.arch/arm-disp-step.exp: Can't run to main gdb/testsuite: 2016-03-01 Yao Qi <yao.qi@linaro.org> * gdb.arch/arm-disp-step.exp: Use standard_testfile and prepare_for_testing.
2016-03-01Compile gdb.arch/arm-neon.c with "quiet"Yao Qi2-1/+5
When we compile gdb.arch/arm-neon.c with options that don't enable NEON, there are many error/warnings emitted into gdb.sum, which is annoying. This patch fixes it by passing quiet to prepare_for_testing. gdb/testsuite: 2016-03-01 Yao Qi <yao.qi@linaro.org> * gdb.arch/arm-neon.exp: Pass quiet to prepare_for_testing.
2016-03-01Speedup ELF orphan placement for relocatable linkH.J. Lu1-13/+20
Since there is no need to place output sections in specific order for relocatable link, we can skip merging flags of other input sections. PR ld/19739 * ld/emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't merge flags of other input sections for relocatable link.
2016-03-01S390: Fix output path for s390-tdbregs test caseAndreas Arnez2-15/+7
Since test artifacts are always organized in a directory hierarchy, the s390-tdbregs test case is not executed correctly any more. This is because it uses an obsolete way of constructing the executable's path. This change invokes prepare_for_testing instead. gdb/testsuite/ChangeLog: * gdb.arch/s390-tdbregs.exp: Use prepare_for_testing instead of manually constructing the output path.
2016-03-01S390: Fix internal error with stackless inferiorAndreas Arnez5-2/+86
This fixes a GDB internal error that may occur when the inferior has no valid stack pointer in r15. gdb/testsuite/ChangeLog: * gdb.arch/s390-stackless.S: New. * gdb.arch/s390-stackless.exp: New. gdb/ChangeLog: * s390-linux-tdep.c (s390_backchain_frame_unwind_cache): Avoid exception when attempting to access the inferior's backchain.
2016-03-01Fix typo in print_insn_rl78_common function.Nick Clifton2-1/+7
PR target/19747 * rl78-dis.c (print_insn_rl78_common): Fix typo.
2016-03-01Automatic date update in version.inGDB Administrator1-1/+1
2016-02-29Add a testcase for PR ld/19162H.J. Lu4-0/+20
PR ld/19162 * testsuite/ld-elf/pr19162.d: New file. * testsuite/ld-elf/pr19162a.s: Likwise. * testsuite/ld-elf/pr19162b.s: Likwise.
2016-02-29aarch64-linux process record: more syscallsYao Qi2-9/+13
The last patch supports several syscalls in linux-record.c, so now GDB aarch64-linux backend can return these canonicalized syscall numbers per aarch64 syscall number. This patch fixes the following fails, Process record and replay target doesn't support syscall number 59^M Process record: failed to record execution log.^M ^M Program stopped.^M 0x00000020000eab28 in pipe () from /lib/aarch64-linux-gnu/libc.so.6^M (gdb) FAIL: gdb.reverse/pipe-reverse.exp: continue to breakpoint: marker2 Process record and replay target doesn't support syscall number 59^M Process record: failed to record execution log.^M ^M Program stopped.^M 0x00000020000eab28 in pipe () from /lib/aarch64-linux-gnu/libc.so.6^M (gdb) FAIL: gdb.reverse/readv-reverse.exp: continue to breakpoint: marker2 gdb: 2016-02-29 Yao Qi <yao.qi@linaro.org> * aarch64-linux-tdep.c (aarch64_canonicalize_syscall): Support eventfd2, eventfd2, dup3, inotify_init1, fallocate and pipe2. Return gdb_sys_epoll_create1 instead of gdb_sys_epoll_create for aarch64_sys_epoll_create1.
2016-02-29Support more syscalls in linux-record: pipe2 epoll_create1 eventfd2 ↵Yao Qi3-0/+28
fallocate dup3 and inotify_init1 This patch adds more syscalls in linux-record. gdb: 2016-02-29 Yao Qi <yao.qi@linaro.org> * linux-record.h (enum gdb_syscall) <gdb_sys_fallocate>: New. <gdb_sys_eventfd2, gdb_sys_epoll_create1, gdb_sys_dup3>: New. <gdb_sys_pipe2, gdb_sys_inotify_init1>: New. * linux-record.c (record_linux_system_call): Handle them.
2016-02-29[ARC] Local symbols relocation cleanupClaudiu Zissulescu12-40/+96
bfd/ 2016-02-29 Cupertino Miranda <cmiranda@synopsys.com> * elf32-arc.c (elf_arc_relocate_section): Added rules to fix the relocation addend when sections get merged. gas/ 2016-02-29 Cupertino Miranda <cmiranda@synopsys.com> Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> * config/tc-arc.c (arc_extra_reloc): Change size to 0. (tc_arc_fix_adjustable): Changed default return value to 1. * testsuite/gas/arc/j.d: Updated expected symbol * testsuite/gas/arc/jl.d: Likewise * testsuite/gas/arc/relax-avoid1.d: Likewise * testsuite/gas/arc/st.d: Likewise ld/ 2016-02-29 Cupertino Miranda <cmiranda@synopsys.com> * testsuite/ld-elf/merge.d: Removed xfail for ARC. * testsuite/ld-elf/merge2.d: Likewise. * testsuite/ld-elf/merge3.d: Likewise.
2016-02-29[ARC] General fixes.Claudiu Zissulescu6-9/+41
bfd/ 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com> * elf32-arc.c (arc_elf_final_write_processing): Add condition to the flag change. (elf_arc_relocate_section): Fixes and conditions to support PIE. Assert for code sections dynamic relocs. gas/ 2016-02-29 Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> * config/tc-arc.c: Enable code density instructions for ARC EM. ld/ 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com> * scripttempl/arclinux.sc: Force .tdata and .tbss to always be generated.
2016-02-29Automatic date update in version.inGDB Administrator1-1/+1
2016-02-28Don't recursively look for a symbol in all imports of imported modules.Iain Buclaw5-5/+197
Given two or more modules that import each other's scope, the current symbol lookup routines would go round in circles looking through each import from each module, possibly checking the same module twice or more until all possible paths are marked as "searched". Given enough modules, this causes an exponential slowdown in time taken to find symbols that do exist, and infinite recursion when they don't. gdb/ChangeLog: * d-namespace.c (d_lookup_symbol_imports): Avoid recursive lookups from cyclic imports. gdb/testsuite/ChangeLog: * gdb.dlang/circular.c: New file. * gdb.dlang/circular.exp: New file.
2016-02-28Automatic date update in version.inGDB Administrator1-1/+1
2016-02-27Automatic date update in version.inGDB Administrator1-1/+1
2016-02-26Fix CXX invalid cast from void *.Keith Seitz2-1/+6
This is an obvious patch to fix the following build error seen with --enable-build-with-cxx: ../../src/gdb/rs6000-tdep.c: In function ‘rs6000_frame_cache* rs6000_frame_cache(frame_info*, void**)’: ../../src/gdb/rs6000-tdep.c:3242:15: error: invalid conversion from ‘void*’ to ‘rs6000_frame_cache*’ [-fpermissive] return (*this_cache); ~^~~~~~~~~~~~ gdb/ChangeLog * rs6000-tdep.c (rs6000_frame_cache): Explicitly cast return result to avoid invalid conversion from void *.
2016-02-26Add aarch64-*-rtems* targetJoel Sherrill4-4/+5
2016-02-26Add x86_64-*-rtems* targetJoel Sherrill3-2/+6
ld/configure.tgt: Also add stanza for x86_64-*-elf.
2016-02-26[BFD][AARCH64]Fix MOVW_SABS_G(0,1,2) relocation overflow check.Renlin Li13-29/+79
For these three relocations, 17 bit signed value should be used, instead of 16 bit. The bitsize field is changed from 16 to 17, this field in aarch64 backend is used for overflow check only. bfd/ 2016-02-26 Renlin Li <renlin.li@arm.com> * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix signed overflow check for MOVW_SABS_G0, MOVW_SABS_G1, MOVW_SABS_G2. ld/ 2016-02-26 Renlin Li <renlin.li@arm.com> * testsuite/ld-aarch64/aarch64-elf.exp: Run new testcases. * testsuite/ld-aarch64/emit-relocs-270.d: Update to use new boundary. * testsuite/ld-aarch64/emit-relocs-271.d: Likewise. * testsuite/ld-aarch64/emit-relocs-272.d: Likewise. * testsuite/ld-aarch64/emit-relocs-270-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-270-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-271-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-271-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-272-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-272-overflow.s: New.
2016-02-26Optimize x86 GOT32X/GOTPCRELX relocationsH.J. Lu92-122/+1320
R_386_GOT32X, R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX relocations retrieve the symbol address via its GOT slot. If the symbol address is known at the link-time, we can use it directly by changing instruction encoding. Indirect branch can only be converted to PC relative direct branch. MOV can be changed to LEA or encoded differently with signed address. The subset of binary operations can be encoded only with signed address. If undefined weak symbol is resolved to zero link-time, we can use it as address. Zero addresss can't used with PC relative direct branch when PIC is true since the current PC is unknown. In 64-bit, 32-bit relocation for PC relatiave direct branch to zero may also overflow. If this optimization causes relocation overflow, --no-relax can be used to work around it. bfd/ PR ld/19609 * elf32-i386.c (elf_i386_convert_load): Convert to R_386_32 for load with locally bound symbols if PIC is false or there is no base register. Optimize branch to 0 if PIC is false. (elf_i386_relocate_section): Don't generate dynamic relocations against undefined weak symbols if PIC is false. * elf64-x86-64.c (elf_x86_64_convert_load): Disable optimization if we can't estimate relocation overflow with --no-relax. Convert to R_X86_64_32S/R_X86_64_32 for load with locally bound symbols if PIC is false. Optimize branch to 0 if PIC is false. (elf_x86_64_relocate_section): Don't generate dynamic relocations against undefined weak symbols if PIC is false. ld/ PR ld/19609 * testsuite/ld-i386/got1.dd: Updated. * testsuite/ld-i386/lea1c.d: Likewise. * testsuite/ld-i386/load1-nacl.d: Likewise. * testsuite/ld-i386/load1.d: Likewise. * testsuite/ld-i386/load4b.d: Likewise. * testsuite/ld-i386/load5b.d: Likewise. * testsuite/ld-i386/mov1b.d: Likewise. * testsuite/ld-x86-64/mov1b.d: Likewise. * testsuite/ld-x86-64/mov1d.d: Likewise. * testsuite/ld-ifunc/ifunc-21-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise. * testsuite/ld-ifunc/ifunc-22-i386.d: Likewise. * testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise. * testsuite/ld-x86-64/gotpcrel1.dd: Likewise. * testsuite/ld-x86-64/lea1a.d: Likewise. * testsuite/ld-x86-64/lea1b.d: Likewise. * testsuite/ld-x86-64/lea1c.d: Likewise. * testsuite/ld-x86-64/lea1d.d: Likewise. * testsuite/ld-x86-64/lea1e.d: Likewise. * testsuite/ld-x86-64/lea1f.d: Likewise. * testsuite/ld-x86-64/mov1b.d: Likewise. * testsuite/ld-x86-64/mov1d.d: Likewise. * testsuite/ld-x86-64/pr13082-3b.d: Likewise. * testsuite/ld-x86-64/pr13082-4b.d: Likewise. * testsuite/ld-x86-64/lea1.s: Add tests for 32-bit registers. * testsuite/ld-i386/pr19609-1.s: New file. * testsuite/ld-i386/pr19609-1a.d: Likewise. * testsuite/ld-i386/pr19609-1b.d: Likewise. * testsuite/ld-i386/pr19609-1c.d: Likewise. * testsuite/ld-i386/pr19609-1d.d: Likewise. * testsuite/ld-i386/pr19609-1e.d: Likewise. * testsuite/ld-i386/pr19609-1f.d: Likewise. * testsuite/ld-i386/pr19609-1g.d: Likewise. * testsuite/ld-i386/pr19609-1h.d: Likewise. * testsuite/ld-i386/pr19609-1i.d: Likewise. * testsuite/ld-i386/pr19609-2.s: Likewise. * testsuite/ld-i386/pr19609-2a.d: Likewise. * testsuite/ld-i386/pr19609-2b.d: Likewise. * testsuite/ld-i386/pr19609-2c.d: Likewise. * testsuite/ld-i386/undefweak.s: Likewise. * testsuite/ld-i386/undefweaka.d: Likewise. * testsuite/ld-i386/undefweakb.d: Likewise. * testsuite/ld-x86-64/pr13082-3c.d: Likewise. * testsuite/ld-x86-64/pr13082-3d.d: Likewise. * testsuite/ld-x86-64/pr19609-1.s: Likewise. * testsuite/ld-x86-64/pr19609-1a.d: Likewise. * testsuite/ld-x86-64/pr19609-1b.d: Likewise. * testsuite/ld-x86-64/pr19609-1c.d: Likewise. * testsuite/ld-x86-64/pr19609-1d.d: Likewise. * testsuite/ld-x86-64/pr19609-1e.d: Likewise. * testsuite/ld-x86-64/pr19609-1f.d: Likewise. * testsuite/ld-x86-64/pr19609-1g.d: Likewise. * testsuite/ld-x86-64/pr19609-1h.d: Likewise. * testsuite/ld-x86-64/pr19609-1i.d: Likewise. * testsuite/ld-x86-64/pr19609-1j.d: Likewise. * testsuite/ld-x86-64/pr19609-1k.d: Likewise. * testsuite/ld-x86-64/pr19609-1l.d: Likewise. * testsuite/ld-x86-64/pr19609-1m.d: Likewise. * testsuite/ld-x86-64/pr19609-2.s: Likewise. * testsuite/ld-x86-64/pr19609-2a.d: Likewise. * testsuite/ld-x86-64/pr19609-2b.d: Likewise. * testsuite/ld-x86-64/pr19609-2c.d: Likewise. * testsuite/ld-x86-64/pr19609-2d.d: Likewise. * testsuite/ld-x86-64/pr19609-3.s: Likewise. * testsuite/ld-x86-64/pr19609-3a.d: Likewise. * testsuite/ld-x86-64/pr19609-3b.d: Likewise. * testsuite/ld-x86-64/pr19609-4.s: Likewise. * testsuite/ld-x86-64/pr19609-4a.d: Likewise. * testsuite/ld-x86-64/pr19609-4b.d: Likewise. * testsuite/ld-x86-64/pr19609-4c.d: Likewise. * testsuite/ld-x86-64/pr19609-4d.d: Likewise. * testsuite/ld-x86-64/pr19609-4e.d: Likewise. * testsuite/ld-x86-64/pr19609-5.s: Likewise. * testsuite/ld-x86-64/pr19609-5a.d: Likewise. * testsuite/ld-x86-64/pr19609-5b.d: Likewise. * testsuite/ld-x86-64/pr19609-5c.d: Likewise. * testsuite/ld-x86-64/pr19609-5d.d: Likewise. * testsuite/ld-x86-64/pr19609-5e.d: Likewise. * testsuite/ld-x86-64/pr19609-6.s: Likewise. * testsuite/ld-x86-64/pr19609-6a.d: Likewise. * testsuite/ld-x86-64/pr19609-6b.d: Likewise. * testsuite/ld-x86-64/pr19609-6c.d: Likewise. * testsuite/ld-x86-64/pr19609-6d.d: Likewise. * testsuite/ld-x86-64/pr19609-7.s: Likewise. * testsuite/ld-x86-64/pr19609-7a.d: Likewise. * testsuite/ld-x86-64/pr19609-7b.d: Likewise. * testsuite/ld-x86-64/pr19609-7c.d: Likewise. * testsuite/ld-x86-64/pr19609-7d.d: Likewise. * testsuite/ld-i386/i386.exp: Run undefweak tests and tests for PR ld/19609. * testsuite/ld-x86-64/x86-64.exp: Run pr13082-3c, pr13082-3d and tests for PR ld/19609.
2016-02-26Discard FDEs for zero-length address ranges.Cary Coutant3-5/+47
2016-02-26 Egor Kochetov <egor.kochetov@intel.com> Cary Coutant <ccoutant@gmail.com> gold/ PR gold/19735 * ehframe.h (Cie::fde_encoding): New method. * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length address ranges.
2016-02-26Fix various bugs in arm_record_exreg_ld_st_insnYao Qi4-35/+115
This patch fixes various bugs in arm_record_exreg_ld_st_insn, and use gdb.reverse/insn-reverse.c to test more arm instructions. - Set flag SINGLE_REG correctly. In the arch reference manual, SING_REG is true when the bit 8 of instruction is zero. - Record the right D registers for instructions changing S registers. - Fix the order of length and address in record_buf_mem array. - Shift the offset by 2 instead of by 24. This patch also fixes one internal error, (gdb) PASS: gdb.reverse/finish-precsave.exp: BP at end of main continue^M Continuing.^M ../../binutils-gdb/gdb/utils.c:1072: internal-error: virtual memory exhausted.^M A problem internal to GDB has been detected,FAIL: gdb.reverse/finish-precsave.exp: run to end of main (GDB internal error) gdb: 2016-02-26 Yao Qi <yao.qi@linaro.org> * arm-tdep.c (arm_record_exreg_ld_st_insn): Set 'single_reg' per bit 8. Check bit 20 instead of bit 4 for VMOV instruction. Record D registers for instructions changing S registers. Change of the order of length and address in record_buf_mem array. gdb/testsuite: 2016-02-26 Yao Qi <yao.qi@linaro.org> * gdb.reverse/insn-reverse.c [__arm__] (ext_reg_load): New. [__arm__] (ext_reg_mov, ext_reg_push_pop): New. (testcases): Update.
2016-02-26Record right reg num of thumb special data instructionsYao Qi2-4/+9
When GDB decodes these thumb special data instructions, such as 'mov sp, r7' the Rd is got incorrectly. According to the arch reference manual, the Rd is DN:Rdn, in which DN is bit 7 and Rdn is bits 0 to 2. This patch fixes it. gdb: 2016-02-26 Yao Qi <yao.qi@linaro.org> * arm-tdep.c (thumb_record_ld_st_reg_offset): Fix the register number of Rd.
2016-02-26Rename gdb.reverse/aarch64.{exp,c} to gdb.reverse/insn-reverse.{exp,c}Yao Qi3-0/+7
gdb/testsuite: 2016-02-26 Yao Qi <yao.qi@linaro.org> * gdb.reverse/aarch64.c: Rename to ... * gdb.reverse/insn-reverse.c: ... it. * gdb.reverse/aarch64.exp: Rename to ... * gdb.reverse/insn-reverse.exp: ... it.
2016-02-26Generalize gdb.reverse/aarch64.expYao Qi3-19/+67
I said we can generialize gdb.reverse/aarch64.exp for other architectures https://sourceware.org/ml/gdb-patches/2015-05/msg00482.html and here is the patch to change aarch64.exp so that it can be used to test for other architectures as well. gdb/testsuite: 2016-02-26 Yao Qi <yao.qi@linaro.org> * gdb.reverse/aarch64.c: [__aarch64__] Include arm_neon.h. (testcase_ftype): New. (testcases): New array. (n_testcases): New. (main): Call each element in testcases. * gdb.reverse/aarch64.exp: Remove is_aarch64_target check. (read_testcase): New. Do the tests in a loop.
2016-02-26Add ChangeLog entries for PR ld/19645H.J. Lu5-0/+151
2016-02-26Properly implement STT_COMMONH.J. Lu87-138/+1001
The BFD configure option, --enable-elf-stt-common, can't be to used to verify STT_COMMON implementation with the normal binutils build. Instead, this patch removes it from BFD. It adds --elf-stt-common=[no|yes] to ELF assembler/objcopy and adds -z common/-z nocommon to ld. A configure option, --enable-elf-stt-common, is added to gas to specify whether ELF assembler should generate common symbols with the STT_COMMON type by default. Since BSF_KEEP_G is never used, it is renamed to BSF_ELF_COMMON for ELF common symbols. bfd/ PR ld/19645 * bfd.c (bfd): Change flags to 20 bits. (BFD_CONVERT_ELF_COMMON): New. (BFD_USE_ELF_STT_COMMON): Likewise. (BFD_FLAGS_SAVED): Add BFD_CONVERT_ELF_COMMON and BFD_USE_ELF_STT_COMMON. (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise. * configure.ac: Remove --enable-elf-stt-common. * elf.c (swap_out_syms): Choose STT_COMMON or STT_OBJECT for common symbol depending on BFD_CONVERT_ELF_COMMON and BFD_USE_ELF_STT_COMMON. * elfcode.h (elf_slurp_symbol_table): Set BSF_ELF_COMMON for STT_COMMON. * elflink.c (bfd_elf_link_mark_dynamic_symbol): Also check STT_COMMON. (elf_link_convert_common_type): New function. (elf_link_output_extsym): Choose STT_COMMON or STT_OBJECT for common symbol depending on BFD_CONVERT_ELF_COMMON and BFD_USE_ELF_STT_COMMON. Set sym.st_info after sym.st_shndx. * elfxx-target.h (TARGET_BIG_SYM): Add BFD_CONVERT_ELF_COMMON and BFD_USE_ELF_STT_COMMON to object_flags. (TARGET_LITTLE_SYM): Likewise. * syms.c (BSF_KEEP_G): Renamed to ... (BSF_ELF_COMMON): This. * bfd-in2.h: Regenerated. * config.in: Likewise. * configure: Likewise. binutils/ PR ld/19645 * NEWS: Mention --elf-stt-common= for objcopy. * doc/binutils.texi: Document --elf-stt-common= for objcopy. * objcopy.c (do_elf_stt_common): New. (command_line_switch): Add OPTION_ELF_STT_COMMON. (copy_options): Add --elf-stt-common=. (copy_usage): Add --elf-stt-common=. (copy_object): Also check do_elf_stt_common for ELF targets. (copy_file): Handle do_elf_stt_common. (copy_main): Handle OPTION_ELF_STT_COMMON. * readelf.c (apply_relocations): Support STT_COMMON. * testsuite/binutils-all/common-1.s: New file. * testsuite/binutils-all/common-1a.d: Likewise. * testsuite/binutils-all/common-1b.d: Likewise. * testsuite/binutils-all/common-1c.d: Likewise. * testsuite/binutils-all/common-1d.d: Likewise. * testsuite/binutils-all/common-1e.d: Likewise. * testsuite/binutils-all/common-1f.d: Likewise. * testsuite/binutils-all/common-2.s: Likewise. * testsuite/binutils-all/common-2a.d: Likewise. * testsuite/binutils-all/common-2b.d: Likewise. * testsuite/binutils-all/common-2c.d: Likewise. * testsuite/binutils-all/common-2d.d: Likewise. * testsuite/binutils-all/common-2e.d: Likewise. * testsuite/binutils-all/common-2f.d: Likewise. * testsuite/binutils-all/objcopy.exp (objcopy_test_elf_common_symbols): New proc. Run objcopy_test_elf_common_symbols for ELF targets gas/ PR ld/19645 * NEWS: Mention --enable-elf-stt-common and --elf-stt-common= for ELF assemblers. * as.c (flag_use_elf_stt_common): New. (show_usage): Add --elf-stt-common=. (option_values): Add OPTION_ELF_STT_COMMON. (std_longopts): Add --elf-stt-common=. (parse_args): Handle --elf-stt-common=. * as.h (flag_use_elf_stt_common): New. * config.in: Regenerated. * configure: Likewise. * configure.ac: Add --enable-elf-stt-common and define DEFAULT_GENERATE_ELF_STT_COMMON. * gas/write.c (write_object_file): Set BFD_CONVERT_ELF_COMMON and BFD_USE_ELF_STT_COMMON if flag_use_elf_stt_common is set. * doc/as.texinfo: Document --elf-stt-common=. * testsuite/gas/elf/common3.s: New file. * testsuite/gas/elf/common3a.d: Likewise. * testsuite/gas/elf/common3b.d: Likewise. * testsuite/gas/elf/common4.s: Likewise. * testsuite/gas/elf/common4a.d: Likewise. * testsuite/gas/elf/common4b.d: Likewise. * testsuite/gas/i386/dw2-compress-3b.d: Likewise. * testsuite/gas/i386/dw2-compressed-3b.d: Likewise. * testsuite/gas/elf/elf.exp: Run common3a, common3b, common4a and common4b. * testsuite/gas/i386/dw2-compress-3.d: Renamed to ... * testsuite/gas/i386/dw2-compress-3a.d: This. Pass --elf-stt-common=no to as. * testsuite/gas/i386/dw2-compressed-3.d: Renamed to ... * testsuite/gas/i386/dw2-compressed-3a.d: This. Pass --elf-stt-common=no to as. * testsuite/gas/i386/i386.exp: Run dw2-compress-3a, dw2-compress-3b, dw2-compressed-3a and dw2-compressed-3b instead of dw2-compress-3 and dw2-compressed-3. include/ PR ld/19645 * bfdlink.h (bfd_link_elf_stt_common): New enum. (bfd_link_info): Add elf_stt_common. ld/ PR ld/19645 * NEWS: Mention -z common/-z nocommon for ELF targets. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z common and -z nocommon. * ld.texinfo: Document -z common/-z nocommon. * lexsup.c (elf_shlib_list_options): Add -z common/-z nocommon. * testsuite/ld-elf/tls_common.exp: Test --elf-stt-common=no and --elf-stt-common=yes with assembler. * testsuite/ld-elfcomm/common-1.s: New file. * testsuite/ld-elfcomm/common-1a.d: Likewise. * testsuite/ld-elfcomm/common-1b.d: Likewise. * testsuite/ld-elfcomm/common-1c.d: Likewise. * testsuite/ld-elfcomm/common-1d.d: Likewise. * testsuite/ld-elfcomm/common-1e.d: Likewise. * testsuite/ld-elfcomm/common-1f.d: Likewise. * testsuite/ld-elfcomm/common-2.s: Likewise. * testsuite/ld-elfcomm/common-2a.d: Likewise. * testsuite/ld-elfcomm/common-2b.d: Likewise. * testsuite/ld-elfcomm/common-2c.d: Likewise. * testsuite/ld-elfcomm/common-2d.d: Likewise. * testsuite/ld-elfcomm/common-2e.d: Likewise. * testsuite/ld-elfcomm/common-2f.d: Likewise. * testsuite/ld-elfcomm/common-3a.rd: Likewise. * testsuite/ld-elfcomm/common-3b.rd: Likewise. * testsuite/ld-i386/pr19645.d: Likewise. * testsuite/ld-i386/pr19645.s: Likewise. * testsuite/ld-x86-64/largecomm-1.s: Likewise. * testsuite/ld-x86-64/largecomm-1a.d: Likewise. * testsuite/ld-x86-64/largecomm-1b.d: Likewise. * testsuite/ld-x86-64/largecomm-1c.d: Likewise. * testsuite/ld-x86-64/largecomm-1d.d: Likewise. * testsuite/ld-x86-64/largecomm-1e.d: Likewise. * testsuite/ld-x86-64/largecomm-1f.d: Likewise. * testsuite/ld-x86-64/pr19645.d: Likewise. * testsuite/ld-x86-64/pr19645.s: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Test --elf-stt-common=yes with assembler. (assembler_generates_commons): Removed. Run -z common/-z nocommon tests. Run *.d tests. * testsuite/ld-i386/i386.exp: Run pr19645. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-x86-64/dwarfreloc.exp: Test --elf-stt-common with assembler. Test STT_COMMON with readelf.
2016-02-26[x86] Resolve non-PIC undefweak symbols in executableH.J. Lu95-165/+1970
For i386 and x86-64, non-PIC references to undefined weak symbols are resolved without dynamic relocation when creating executable. Resolved undefined weak symbols are removed from the dynamic symbol table in executable. One exception is on i386, we need resolved undefined weak symbols in the dynamic symbol table in PIE if input relocatable files contain branchs without PLT so that we can branch to 0 with dynamic relocation in text section. This makes behaviors of dynamic executable and position independent executable predictable with mixed PIC and non-PIC references to undefined weak symbols. If all references to undefined weak symbols are PIC, dynamic relocations against undefined weak symbols will be generated in executable unless -z nodynamic-undefined-weak is passed to linker. bfd/ PR ld/19636 PR ld/19704 PR ld/19719 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New. (elf_i386_link_hash_entry): Add has_got_reloc and has_non_got_reloc. (elf_i386_link_hash_table): Add interp. (elf_i386_link_hash_newfunc): Initialize has_got_reloc and has_non_got_reloc. (elf_i386_copy_indirect_symbol): Copy has_got_reloc and has_non_got_reloc. (elf_i386_check_relocs): Set has_got_reloc and has_non_got_reloc. (elf_i386_fixup_symbol): New function. (elf_i386_pie_finish_undefweak_symbol): Likewise. (elf_i386_allocate_dynrelocs): Don't allocate space for dynamic relocations and discard relocations against resolved undefined weak symbols in executable. Don't make resolved undefined weak symbols in executable dynamic. Keep dynamic non-GOT/non-PLT relocation against undefined weak symbols in PIE. (elf_i386_size_dynamic_sections): Set interp to .interp section. (elf_i386_relocate_section): Don't generate dynamic relocations against resolved undefined weak symbols in PIE, except for R_386_PC32. (elf_i386_finish_dynamic_symbol): Keep PLT/GOT entries without dynamic PLT/GOT relocations for resolved undefined weak symbols. Don't generate dynamic relocation against resolved undefined weak symbol in executable. (elf_i386_finish_dynamic_sections): Call elf_i386_pie_finish_undefweak_symbol on all symbols in PIE. (elf_backend_fixup_symbol): New. * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New. (elf_x86_64_link_hash_entry): Add has_got_reloc and has_non_got_reloc. (elf_x86_64_link_hash_table): Add interp. (elf_x86_64_link_hash_newfunc): Initialize has_got_reloc and has_non_got_reloc. (elf_x86_64_copy_indirect_symbol): Copy has_got_reloc and has_non_got_reloc. (elf_x86_64_check_relocs): Set has_got_reloc and has_non_got_reloc. (elf_x86_64_fixup_symbol): New function. (elf_x86_64_pie_finish_undefweak_symbol): Likewise. (elf_x86_64_allocate_dynrelocs): Don't allocate space for dynamic relocations and discard relocations against resolved undefined weak symbols in executable. Don't make resolved undefined weak symbols in executable dynamic. (elf_x86_64_size_dynamic_sections): Set interp to .interp section. (elf_x86_64_relocate_section): Check relocation overflow for dynamic relocations against unresolved weak undefined symbols. Don't generate dynamic relocations against resolved weak undefined symbols in PIE. (elf_x86_64_finish_dynamic_symbol): Keep PLT/GOT entries without dynamic PLT/GOT relocations for resolved undefined weak symbols. Don't generate dynamic relocation against resolved undefined weak symbol in executable. (elf_x86_64_finish_dynamic_sections): Call elf_x86_64_pie_finish_undefweak_symbol on all symbols in PIE. (elf_backend_fixup_symbol): New. include/ PR ld/19636 PR ld/19704 PR ld/19719 * bfdlink.h (bfd_link_info): Add dynamic_undefined_weak. ld/ PR ld/19636 PR ld/19704 PR ld/19719 * Makefile.am (ELF_X86_DEPS): Add dynamic_undefined_weak.sh. * Makefile.in: Regenerated. * NEWS: Mention -z nodynamic-undefined-weak. * ld.texinfo: Document -z nodynamic-undefined-weak. * ldmain.c (main): Initialize dynamic_undefined_weak to -1. * emulparams/dynamic_undefined_weak.sh: New file. * emulparams/elf32_x86_64.sh: Source dynamic_undefined_weak.sh. * emulparams/elf_i386.sh: Likewise. * emulparams/elf_i386_be.sh: Likewise. * emulparams/elf_i386_chaos.sh: Likewise. * emulparams/elf_i386_ldso.sh: Likewise. * emulparams/elf_i386_vxworks.sh: Likewise. * emulparams/elf_iamcu.sh: Likewise. * emulparams/elf_k1om.sh: Likewise. * emulparams/elf_l1om.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/extern_protected_data.sh (PARSE_AND_LIST_OPTIONS): Append. (PARSE_AND_LIST_ARGS_CASE_Z): Likewise. * testsuite/ld-elf/pr19719a.c: New file. * testsuite/ld-elf/pr19719b.c: Likewise. * testsuite/ld-elf/pr19719c.c: Likewise. * testsuite/ld-elf/pr19719d.c: Likewise. * testsuite/ld-i386/pr19636-1.s: Likewise. * testsuite/ld-i386/pr19636-1a.d: Likewise. * testsuite/ld-i386/pr19636-1b.d: Likewise. * testsuite/ld-i386/pr19636-1c.d: Likewise. * testsuite/ld-i386/pr19636-1d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-1d.d: Likewise. * testsuite/ld-i386/pr19636-1e.d: Likewise. * testsuite/ld-i386/pr19636-1f.d: Likewise. * testsuite/ld-i386/pr19636-1g.d: Likewise. * testsuite/ld-i386/pr19636-1h.d: Likewise. * testsuite/ld-i386/pr19636-1i.d: Likewise. * testsuite/ld-i386/pr19636-2.s: Likewise. * testsuite/ld-i386/pr19636-2a.d: Likewise. * testsuite/ld-i386/pr19636-2b.d: Likewise. * testsuite/ld-i386/pr19636-2c-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2c.d: Likewise. * testsuite/ld-i386/pr19636-2d-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2d.d: Likewise. * testsuite/ld-i386/pr19636-2e-nacl.d: Likewise. * testsuite/ld-i386/pr19636-2e.d: Likewise. * testsuite/ld-i386/pr19636-3.s: Likewise. * testsuite/ld-i386/pr19636-3a.d: Likewise. * testsuite/ld-i386/pr19636-3b.d: Likewise. * testsuite/ld-i386/pr19636-3c.d: Likewise. * testsuite/ld-i386/pr19636-3d.d: Likewise. * testsuite/ld-i386/pr19636-3e.d: Likewise. * testsuite/ld-i386/pr19636-3f.d: Likewise. * testsuite/ld-i386/pr19636-3g.d: Likewise. * testsuite/ld-i386/pr19636-4.s: Likewise. * testsuite/ld-i386/pr19636-4a.d: Likewise. * testsuite/ld-i386/pr19636-4b.d: Likewise. * testsuite/ld-i386/pr19636-4c.d: Likewise. * testsuite/ld-i386/pr19636-4d.d: Likewise. * testsuite/ld-i386/pr19704.out: Likewise. * testsuite/ld-i386/pr19704a.c: Likewise. * testsuite/ld-i386/pr19704b.c: Likewise. * testsuite/ld-x86-64/pr19636-1.s: Likewise. * testsuite/ld-x86-64/pr19636-1a.d: Likewise. * testsuite/ld-x86-64/pr19636-1b.d: Likewise. * testsuite/ld-x86-64/pr19636-1c.d: Likewise. * testsuite/ld-x86-64/pr19636-1d.d: Likewise. * testsuite/ld-x86-64/pr19636-1e.d: Likewise. * testsuite/ld-x86-64/pr19636-1f.d: Likewise. * testsuite/ld-x86-64/pr19636-1g.d: Likewise. * testsuite/ld-x86-64/pr19636-2.s: Likewise. * testsuite/ld-x86-64/pr19636-2a.d: Likewise. * testsuite/ld-x86-64/pr19636-2b.d: Likewise. * testsuite/ld-x86-64/pr19636-2c.d: Likewise. * testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise. * testsuite/ld-x86-64/pr19636-2d.d: Likewise. * testsuite/ld-x86-64/pr19636-2e.d: Likewise. * testsuite/ld-x86-64/pr19636-2f.d: Likewise. * testsuite/ld-x86-64/pr19636-2g.d: Likewise. * testsuite/ld-x86-64/pr19636-2h.d: Likewise. * testsuite/ld-x86-64/pr19636-2i.d: Likewise. * testsuite/ld-x86-64/pr19636-3.s: Likewise. * testsuite/ld-x86-64/pr19636-3a.d: Likewise. * testsuite/ld-x86-64/pr19636-3b.d: Likewise. * testsuite/ld-x86-64/pr19636-3c.d: Likewise. * testsuite/ld-x86-64/pr19636-3d.d: Likewise. * testsuite/ld-x86-64/pr19704.out: Likewise. * testsuite/ld-x86-64/pr19704a.c: Likewise. * testsuite/ld-x86-64/pr19704b.c: Likewise. * testsuite/ld-elf/shared.exp (mix_pic_and_non_pic): New. Run mix_pic_and_non_pic. * testsuite/ld-i386/i386.exp (undefined_weak): New. Run undefined_weak and PR ld/19636 tests. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-x86-64/pr13082-3b.d: Updated. * testsuite/ld-x86-64/pr13082-4b.d: Likewise.
2016-02-26Fix powerpc64 -r --save-restore-funcsAlan Modra2-27/+40
* elf64-ppc.c (create_linkage_sections): Create sfpr when save_restore_funcs, rest of sections when not relocatable. (ppc64_elf_init_stub_bfd): Always call create_linkage_sections. (sfpr_define): Define all symbols on emitted code. (ppc64_elf_func_desc_adjust): Adjust for sfpr now being created when relocatable. Move sfpr_define loop earlier.
2016-02-26Automatic date update in version.inGDB Administrator1-1/+1
2016-02-25gdbserver/s390: Enable high GPRs, VX, TDB with 31-bit gdbserver.Marcin Kościelnicki2-26/+96
Currently, 31-bit gdbserver doesn't support collecting/supplying high GPRs, VX registers, and TDB data. This is not much of a problem now, since machines that have them usually have a 64-bit gdbserver that can be used to debug 31-bit targets just fine. However, with fast tracepoints, it's not possible to use a 64-bit gdbserver with a 31-bit IPA (and thus a 31-bit target), so 31-bit gdbserver has to be used for 31-bit targets. Thus, this patch is needed to allow collecting high GPRs and VX registers on 31-bit targets via fast tracepoints. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_num_regs_3264): Define on 31-bit too. (s390_regmap_3264) [!__s390x__]: New global. (s390_collect_ptrace_register): Skip map entries containing -1. (s390_supply_ptrace_register): Ditto. (s390_fill_gprs_high): New function. (s390_store_gprs_high): New function. (s390_regsets): Add NT_S390_HIGH_GPRS. (s390_get_hwcap): Enable on 31-bit. (have_hwcap_s390_high_gprs): Enable on 31-bit. (s390_arch_setup): Enable detection of high GPRs, TDB, VX on 31-bit. Detect NT_S390_HIGH_GPRS. (s390_usrregs_info_3264): Enable on 31-bit. (s390_regs_info): Enable regs_info_3264 on 31-bit. (initialize_low_arch): Initialize s390_regsets_info_3264 on 31-bit.
2016-02-25avoid compiler warnings in remote-m32r-sdi.cDoug Evans2-2/+8
gdb/ChangeLog: * remote-m32r-sdi.c (recv_char_data): Initialize val to avoid compiler warning. (recv_long_data): Ditto.
2016-02-25Remove gdb.base/branches.cYao Qi2-113/+4
This patch removes gdb.base/branches.c which was added by the following commit, but it is not used at all. commit ea8122af1432abdeb256b2c669eb3d0cf8cb97bf Author: John Metzler <jmetzler@cygnus> Date: Thu Apr 16 17:56:11 1998 +0000 Thu Apr 16 10:52:34 1998 John Metzler <jmetzler@cygnus.com> * gdb.base/branches.c: Code with lots of loops and subroutines. Used to test gdbs ability to single step through PC changes, especially to test mips-tdep.c:mips_next_pc gdb/testsuite: 2016-02-25 Yao Qi <yao.qi@linaro.org> * gdb.base/branches.c: Remove.
2016-02-25[PR gdb/13808] gdb.trace: Pass tdesc selected in gdbserver to IPA.Marcin Kościelnicki15-70/+298
If gdbserver and IPA are using different tdesc, they will disagree about 'R' trace packet size. This results in mangled traces. To make sure they pick the same tdesc, gdbserver pokes the tdesc (specified as an index in a target-specific list) into a global variable in IPA. In theory, IPA could find out the tdesc on its own, but that may be complex (in particular, I don't know how to tell whether we have LAST_BREAK on s390 without messing with ptrace), and we'd have to duplicate the logic. Tested on i386 and x86_64. On i386, it fixes two FAILs in ftrace.exp. On x86_64, these failures have been KFAILed - one of them works now, but the other now fails due to an unrelated reason (ugh). gdb/gdbserver/ChangeLog: PR gdb/13808 * Makefile.in: Add i386-*-linux-ipa.o and amd64-*-linux-ipa.o. * configure.srv: Ditto. * linux-aarch64-ipa.c (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment. * linux-amd64-ipa.c: Add "linux-x86-tdesc.h" include. (init_registers_amd64_linux): Remove prototype. (tdesc_amd64_linux): Remove declaration. (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment, initialize remaining tdescs. * linux-i386-ipa.c: Add "linux-x86-tdesc.h" include. (init_registers_i386_linux): Remove prototype. (tdesc_i386_linux): Remove declaration. (get_ipa_tdesc): New function. (initialize_low_tracepoint): Remove ipa_tdesc assignment, initialize remaining tdescs. * linux-low.c (linux_get_ipa_tdesc_idx): New function. (linux_target_ops): wire in linux_get_ipa_tdesc_idx. * linux-low.h (struct linux_target_ops): Add get_ipa_tdesc_idx. * linux-x86-low.c: Move tdesc declarations to linux-x86-tdesc.h. (x86_get_ipa_tdesc_idx): New function. (the_low_target): Wire in x86_get_ipa_tdesc_idx. * linux-x86-tdesc.h: New file. * target.h (struct target_ops): Add get_ipa_tdesc_idx. (target_get_ipa_tdesc_idx): New macro. * tracepoint.c (ipa_tdesc_idx): New macro. (struct ipa_sym_addresses): Add addr_ipa_tdesc_idx. (symbol_list): Add ipa_tdesc_idx. (cmd_qtstart): Write ipa_tdesc_idx in the target. (ipa_tdesc): Remove. (ipa_tdesc_idx): New variable. (get_context_regcache): Use get_ipa_tdesc. (gdb_collect): Ditto. (gdb_probe): Ditto. * tracepoint.h (get_ipa_tdesc): New prototype. (ipa_tdesc): Remove. gdb/testsuite/ChangeLog: PR gdb/13808 * gdb.trace/ftrace.exp (test_fast_tracepoints): Remove kfail.
2016-02-25Convert more variables to a constant form.Trevor Saunders42-135/+205
* as.c (select_emulation_mode): Add const qualifiers. * as.h: Likewise. * config/bfin-defs.h: Likewise. * config/bfin-parse.y: Likewise. * config/rx-parse.y: Likewise. * config/tc-aarch64.c (struct aarch64_option_table): Likewise. (struct aarch64_cpu_option_table): Likewise. (struct aarch64_arch_option_table): Likewise. (struct aarch64_option_cpu_value_table): Likewise. (struct aarch64_long_option_table): Likewise. (struct aarch64_option_abi_value_table): Likewise. * config/tc-arm.c (struct reloc_entry): Likewise. (tc_gen_reloc): Likewise. (struct arm_option_table): Likewise. (struct arm_legacy_option_table): Likewise. (struct arm_cpu_option_table): Likewise. (struct arm_arch_option_table): Likewise. (struct arm_option_extension_value_table): Likewise. (struct arm_option_fpu_value_table): Likewise. (struct arm_option_value_table): Likewise. (struct arm_long_option_table): Likewise. * config/tc-avr.c (struct avr_opcodes_s): Likewise. (struct mcu_type_s): Likewise. (struct exp_mod_s): Likewise. (avr_operand): Likewise. (avr_operands): Likewise. * config/tc-d10v.c (md_begin): Likewise. * config/tc-dlx.c: Likewise. * config/tc-fr30.c (fr30_is_colon_insn): Likewise. * config/tc-ft32.c (parse_condition): Likewise. * config/tc-h8300.c (do_a_fix_imm): Likewise. * config/tc-hppa.c (pa_ip): Likewise. (hppa_regname_to_dw2regnum): Likewise. * config/tc-i370.c (i370_elf_suffix): Likewise. * config/tc-i960.c (struct tabentry): Likewise. * config/tc-m32r.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-m68k.h: Likewise. * config/tc-mcore.c (parse_psrmod): Likewise. * config/tc-metag.c (struct metag_core_option): Likewise. (struct metag_long_option): Likewise. * config/tc-microblaze.c: Likewise. * config/tc-mips.c (macro): Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-msp430.c (struct rcodes_s): Likewise. (struct hcodes_s): Likewise. (md_parse_option): Likewise. * config/tc-ns32k.c (struct ns32k_option): Likewise. (optlist): Likewise. * config/tc-ppc.c (ppc_elf_suffix): Likewise. (tc_ppc_regname_to_dw2regnum): Likewise. * config/tc-ppc.h: Likewise. * config/tc-rl78.c: Likewise. * config/tc-rx.c (struct cpu_type): Likewise. * config/tc-sh.c (sh_regname_to_dw2regnum): Likewise. * config/tc-sparc.c (struct priv_reg_entry): Likewise. (sparc_ip): Likewise. * config/tc-spu.c (insn_fmt_string): Likewise. * config/tc-tic54x.c (tic54x_set_default_include): Likewise. * config/tc-v850.c: Likewise. * config/tc-visium.c (struct visium_arch_option_table): Likewise. (struct visium_long_option_table): Likewise. * config/tc-xgate.c: Likewise. * config/tc-z8k.c: Likewise. * read.c (add_include_dir): Likewise. * read.h: Likewise.
2016-02-25Initialize variables in i386_linux_handle_segmentation_faultSimon Marchi2-1/+7
We see this error when building with gcc 4.3. ../../gdb/i386-linux-tdep.c: In function ‘i386_linux_handle_segmentation_fault’: ../../gdb/i386-linux-tdep.c:399: error: ‘access’ may be used uninitialized in this function ../../gdb/i386-linux-tdep.c:399: error: ‘upper_bound’ may be used uninitialized in this function ../../gdb/i386-linux-tdep.c:399: error: ‘lower_bound’ may be used uninitialized in this function It's a false positive, since the variables will always get initialized in the TRY clause, and the CATCH returns. gdb/ChangeLog: * i386-linux-tdep.c (i386_linux_handle_segmentation_fault): Initialize variables.
2016-02-25gdb.trace: Remove unnecessary target check from ftrace.exp.Marcin Kościelnicki2-69/+70
The check used hardcoded targets and wasn't doing anything useful anyway, since unsupported architectures blow up on link due to missing the IPA library before they ever get to that check. gdb/testsuite/ChangeLog: * gdb.trace/ftrace.exp: Remove unnecessary target check.
2016-02-25gdb.trace: Surround $call_insn with \y in entry-values.expMarcin Kościelnicki2-1/+8
The PPC64 tracepoint patch added \y at the end of the call_insn pattern - without that, it embarassed itself and matched the 'bl' in "Dump of assem*bl*er code for function" as the powerpc call opcode. Since that sounds like a generally good idea, I've added \y before and after call_insn for every target. As a result, I had to change x86_64's mnemonic to 'callq'. gdb/testsuite/ChangeLog: * gdb.trace/entry-values.exp: Surround $call_insn with '\y', change x86_64 call_insn to 'callq'.
2016-02-25Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operationAntoine Tremblay2-1/+13
When encoding the agent expression operation ax_reg or ax_reg_mask, the register number used is internal to GDB. However GDBServer expects a tdesc based number. This usually does not cause a problem since at the moment, for raw registers GDBServer R trace action ignores the register mask and just collects all registers. It can be a problem, however with pseudo registers on some platforms if the tdesc number doesn't match the GDB internal register number. This is the case with ARM, the upcoming ARM tracepoint support, fails these test cases without this patch: gdb.trace/collection.exp: collect register locals collectively:* GDBSever would exit with: unhandled register size Since the register number is not mapped. This patch fixes these issues by calling gdbarch_remote_register_number before encoding the register number in the ax_reg or ax_reg_mask operation. Tested on x86 native-gdbserver no regressions observed. gdb/ChangeLog: * ax-general.c (ax_reg): Call gdbarch_remote_register_number. (ax_reg_mask): Likewise.