GDB Administrator [Mon, 12 Dec 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 11 Dec 2016 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 10 Dec 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Fri, 9 Dec 2016 23:11:40 +0000 (23:11 +0000)]
MIPS16: Remove unused `>' operand code
This code has never been used throughout the repository history, and
likely not before either, as due to the assymetry of MIPS16 instruction
set encoding there are no 32-bit shift operations having their immediate
shift count placed in the position of the usual `rx' instruction field.
gas/
* config/tc-mips.c (mips16_macro_build) <'>'>: Remove case.
include/
* opcode/mips.h: Remove references to `>' operand code.
opcodes/
* mips16-opc.c (decode_mips16_operand) <'>'>: Remove cases.
Maciej W. Rozycki [Fri, 9 Dec 2016 22:50:07 +0000 (22:50 +0000)]
MIPS16/opcodes: Use hexadecimal interpretation for the `e' operand code
Make the `e' operand code used with raw EXTEND instructions use the
hexadecimal rather than decimal format, for consistency with what is
actually produced by code in `print_insn_mips16' dedicated to EXTEND
disassembly. Due to that special handling the operand code is only
interpreted for assembly however, which accepts either format either
way, so there is no functional change here.
opcodes/
* mips16-opc.c (decode_mips16_operand) <'e'>: Use HINT rather
than UINT.
gas/
* testsuite/gas/mips/mips16-extend.d: New test.
* testsuite/gas/mips/mips16-extend.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new test.
Maciej W. Rozycki [Fri, 9 Dec 2016 22:27:00 +0000 (22:27 +0000)]
MIPS16/opcodes: Reformat raw EXTEND and undecoded output
Use a tab rather than a space to separate `extend' and its uninterpreted
argument output, like with regular instructions. Separate hexadecimal
halves of undecoded extended instructions output with a space instead of
presenting them concatenated.
opcodes/
* mips-dis.c (print_insn_mips16): Use a tab rather than a space
to separate `extend' and its uninterpreted argument output.
Separate hexadecimal halves of undecoded extended instructions
output.
binutils/
* testsuite/binutils-all/mips/mips16-extend-noinsn.d: New test.
* testsuite/binutils-all/mips/mips16-extend-noinsn.s: New test
source.
* testsuite/binutils-all/mips/mips.exp: Run the new test.
Pedro Alves [Fri, 9 Dec 2016 16:08:49 +0000 (16:08 +0000)]
gdb: Remove support for obsolete OSABIs and a.out
gdb/ChangeLog:
2016-12-09 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_TARGET_OBS): Remove vax-obsd-tdep.o.
* alpha-fbsd-tdep.c (_initialize_alphafbsd_tdep): Adjust.
* alpha-nbsd-tdep.c: Move comment to _initialize_alphanbsd_tdep.
(alphanbsd_core_osabi_sniffer): Delete.
(_initialize_alphanbsd_tdep): No longer handle a.out.
* alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Adjust.
* amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Adjust.
* amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Adjust.
* amd64-obsd-tdep.c (amd64obsd_supply_regset)
(amd64obsd_combined_regset)
(amd64obsd_iterate_over_regset_sections, amd64obsd_core_init_abi):
Delete.
(_initialize_amd64obsd_tdep): Don't handle a.out.
* arm-nbsd-nat.c (struct md_core, fetch_core_registers)
(arm_netbsd_core_fns): Delete.
(_initialize_arm_netbsd_nat): Don't register arm_netbsd_core_fns.
* arm-nbsd-tdep.c (arm_netbsd_aout_init_abi)
(arm_netbsd_aout_osabi_sniffer): Delete.
(_initialize_arm_netbsd_tdep): Don't handle a.out.
* arm-obsd-tdep.c (armobsd_core_osabi_sniffer): Delete.
(_initialize_armobsd_tdep): Don't handle a.out.
* arm-tdep.c (arm_gdbarch_init): Remove bfd_target_aout_flavour
case.
* breakpoint.c (disable_breakpoints_in_unloaded_shlib): Remove
SunOS a.out handling.
* configure.tgt (vax-*-netbsd* | vax-*-knetbsd*-gnu): Remove
vax-obsd-tdep.o from gdb_target_objs.
(vax-*-openbsd*): Likewise.
(*-*-freebsd*): Adjust default gdb_osabi.
(*-*-openbsd*): Likewise.
* dbxread.c (block_address_function_relative): Delete.
(dbx_symfile_read): Remove reference to
block_address_function_relative.
(dbx_symfile_read): Don't call read_dbx_dynamic_symtab.
(read_dbx_dynamic_symtab): Delete.
(process_one_symbol): Remove references to
block_address_function_relative.
* defs.h (GDB_OSABI_FREEBSD_AOUT, GDB_OSABI_NETBSD_AOUT): Remove.
(GDB_OSABI_FREEBSD_ELF): Rename to ...
(GDB_OSABI_FREEBSD): ... this.
(GDB_OSABI_NETBSD_ELF): Rename to ...
(GDB_OSABI_NETBSD): ... this.
(GDB_OSABI_OPENBSD_ELF): Rename to ...
(GDB_OSABI_OPENBSD): ... this.
(GDB_OSABI_HPUX_ELF, GDB_OSABI_HPUX_SOM): Remove.
* fbsd-tdep.c: Adjust comment.
* hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Adjust.
* hppa-obsd-tdep.c (GDB_OSABI_NETBSD_CORE): Delete.
(hppaobsd_core_osabi_sniffer): Delete.
(_initialize_hppabsd_tdep): Don't handle a.out.
* hppa-tdep.c (hppa_stub_frame_unwind_cache): Don't handle
GDB_OSABI_HPUX_SOM.
(hppa_gdbarch_init): Likewise.
* i386-bsd-tdep.c (i386bsd_aout_osabi_sniffer)
(i386bsd_core_osabi_sniffer, _initialize_i386bsd_tdep): Delete.
* i386-fbsd-tdep.c (i386fbsdaout_init_abi): Delete. Merge bits
with ...
(i386fbsd_init_abi): ... this.
(_initialize_i386fbsd_tdep): Don't handle a.out.
* i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Adjust.
* i386-obsd-tdep.c (i386obsd_aout_supply_regset)
(i386obsd_aout_gregset)
(i386obsd_aout_iterate_over_regset_sections): Delete.
(i386obsd_init_abi): Merge with i386obsd_elf_init_abi.
(i386obsd_aout_init_abi): Delete.
(_initialize_i386obsd_tdep): Don't handle a.out.
* m68k-bsd-tdep.c (m68kobsd_sigtramp_cache_init)
(m68kobsd_sigtramp): Delete.
(m68kbsd_init_abi): Merge with ...
(m68kbsd_elf_init_abi): ... this, and delete it.
(m68kbsd_aout_init_abi): Delete.
(m68kbsd_aout_osabi_sniffer, m68kbsd_core_osabi_sniffer): Delete.
(_initialize_m68kbsd_tdep): Don't handle a.out.
* mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Adjust.
* mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Adjust.
* osabi.c (gdb_osabi_names): Remove "a.out" entries. Drop "ELF"
suffixes. Remove "HP-UX" entries.
(generic_elf_osabi_sniff_abi_tag_sections): Adjust.
(generic_elf_osabi_sniffer): No longer handle GDB_OSABI_HPUX_ELF.
Adjust.
(_initialize_ppcfbsd_tdep): Adjust.
* ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Adjust.
* ppc-obsd-tdep.c (GDB_OSABI_NETBSD_CORE)
(ppcobsd_core_osabi_sniffer): Delete.
(_initialize_ppcobsd_tdep): Don't handle a.out.
* rs6000-tdep.c (rs6000_gdbarch_init): Adjust.
* sh-nbsd-tdep.c (GDB_OSABI_NETBSD_CORE)
(shnbsd_core_osabi_sniffer): Delete.
(_initialize_shnbsd_tdep): Don't handle a.out.
* solib.c (clear_solib): Don't handle SunOS/a.out.
* sparc-nbsd-tdep.c (sparc32nbsd_init_abi): Make extern.
(sparc32nbsd_aout_init_abi): Delete.
(sparc32nbsd_elf_init_abi): Merged into sparc32nbsd_init_abi.
(sparcnbsd_aout_osabi_sniffer): Delete.
(GDB_OSABI_NETBSD_CORE, sparcnbsd_core_osabi_sniffer): Delete.
(_initialize_sparcnbsd_tdep): No longer handle a.out.
* sparc-obsd-tdep.c (sparc32obsd_init_abi)
(_initialize_sparc32obsd_tdep): Adjust.
* sparc-tdep.h (sparc32nbsd_elf_init_abi): Rename to ...
(sparc32nbsd_init_abi): ... this.
* sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Adjust.
* sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Adjust.
* sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Adjust.
* stabsread.c: Update comment.
* symmisc.c (print_objfile_statistics): Don't mention "a.out" in
output.
* vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Adjust.
* vax-obsd-tdep.c: Delete file.
Yao Qi [Fri, 9 Dec 2016 15:44:48 +0000 (15:44 +0000)]
Add ChangeLog entries
ChangeLog entries are missed in my two previous commits.
Yao Qi [Fri, 9 Dec 2016 15:27:43 +0000 (15:27 +0000)]
Create tdep->rx_psw_type and tdep->rx_fpsw_type lazily
I build GDB with all targets enabled, and "set architecture rx",
GDB crashes,
(gdb) set architecture rx
Program received signal SIGSEGV, Segmentation fault.
append_flags_type_flag (type=0x20cc360, bitpos=bitpos@entry=0, name=name@entry=0xd27529 "C") at ../../binutils-gdb/gdb/gdbtypes.c:4926
4926 name);
(gdb) bt 10
#0 append_flags_type_flag (type=0x20cc360, bitpos=bitpos@entry=0, name=name@entry=0xd27529 "C") at ../../binutils-gdb/gdb/gdbtypes.c:4926
#1 0x00000000004ce725 in rx_gdbarch_init (info=..., arches=<optimized out>) at ../../binutils-gdb/gdb/rx-tdep.c:1051
#2 0x00000000006b05a4 in gdbarch_find_by_info (info=...) at ../../binutils-gdb/gdb/gdbarch.c:5269
#3 0x000000000060eee4 in gdbarch_update_p (info=...) at ../../binutils-gdb/gdb/arch-utils.c:557
#4 0x000000000060f8a8 in set_architecture (ignore_args=<optimized out>, from_tty=1, c=<optimized out>) at ../../binutils-gdb/gdb/arch-utils.c:531
#5 0x0000000000593d0b in do_set_command (arg=<optimized out>, arg@entry=0x20bee81 "rx ", from_tty=from_tty@entry=1, c=c@entry=0x20b1540)
at ../../binutils-gdb/gdb/cli/cli-setshow.c:455
#6 0x00000000007665c3 in execute_command (p=<optimized out>, p@entry=0x20bee70 "set architecture rx ", from_tty=1) at ../../binutils-gdb/gdb/top.c:666
#7 0x00000000006935f4 in command_handler (command=0x20bee70 "set architecture rx ") at ../../binutils-gdb/gdb/event-top.c:577
#8 0x00000000006938d8 in command_line_handler (rl=<optimized out>) at ../../binutils-gdb/gdb/event-top.c:767
#9 0x0000000000692c2c in gdb_rl_callback_handler (rl=0x20be7f0 "") at ../../binutils-gdb/gdb/event-top.c:200
The cause is that we want to access some builtin types in gdbarch init, but
it is not initialized yet. I fix it by creating the type when it is to be
used. We've already done this in sparc, sparc64 and m68k.
gdb:
2016-12-09 Yao Qi <yao.qi@linaro.org>
PR tdep/20954
* rx-tdep.c (rx_psw_type): New function.
(rx_fpsw_type): New function.
(rx_register_type): Call rx_psw_type and rx_fpsw_type.
(rx_gdbarch_init): Move code to rx_psw_type and
rx_fpsw_type.
gdb/testsuite:
2016-12-09 Yao Qi <yao.qi@linaro.org>
* gdb.base/all-architectures.exp.in: Remove kfail for "rx".
Yao Qi [Fri, 9 Dec 2016 15:27:43 +0000 (15:27 +0000)]
Create tdep->rl78_psw_type lazily
I build GDB for all targets enabled. When I "set architecture rl78",
GDB crashes,
(gdb) set architecture rl78
Program received signal SIGSEGV, Segmentation fault.
append_flags_type_flag (type=0x20cc0e0, bitpos=bitpos@entry=0, name=name@entry=0x11dba3f "CY") at ../../binutils-gdb/gdb/gdbtypes.c:4926
4926 name);
(gdb) bt 10
#0 append_flags_type_flag (type=0x20cc0e0, bitpos=bitpos@entry=0, name=name@entry=0x11dba3f "CY") at ../../binutils-gdb/gdb/gdbtypes.c:4926
#1 0x00000000004aaca8 in rl78_gdbarch_init (info=..., arches=<optimized out>) at ../../binutils-gdb/gdb/rl78-tdep.c:1410
#2 0x00000000006b05a4 in gdbarch_find_by_info (info=...) at ../../binutils-gdb/gdb/gdbarch.c:5269
#3 0x000000000060eee4 in gdbarch_update_p (info=...) at ../../binutils-gdb/gdb/arch-utils.c:557
#4 0x000000000060f8a8 in set_architecture (ignore_args=<optimized out>, from_tty=1, c=<optimized out>) at ../../binutils-gdb/gdb/arch-utils.c:531
#5 0x0000000000593d0b in do_set_command (arg=<optimized out>, arg@entry=0x20be851 "rl78", from_tty=from_tty@entry=1, c=c@entry=0x20b1540)
at ../../binutils-gdb/gdb/cli/cli-setshow.c:455
#6 0x00000000007665c3 in execute_command (p=<optimized out>, p@entry=0x20be840 "set architecture rl78", from_tty=1) at ../../binutils-gdb/gdb/top.c:666
#7 0x00000000006935f4 in command_handler (command=0x20be840 "set architecture rl78") at ../../binutils-gdb/gdb/event-top.c:577
#8 0x00000000006938d8 in command_line_handler (rl=<optimized out>) at ../../binutils-gdb/gdb/event-top.c:767
#9 0x0000000000692c2c in gdb_rl_callback_handler (rl=0x20be890 "") at ../../binutils-gdb/gdb/event-top.c:200
The cause is that we want to access some builtin types in gdbarch init, but
it is not initialized yet. I fix it by creating the type when it is to be
used. We've already done this in sparc, sparc64 and m68k.
gdb:
2016-12-09 Yao Qi <yao.qi@linaro.org>
PR tdep/20953
* rl78-tdep.c (rl78_psw_type): New function.
(rl78_register_type): Call rl78_psw_type.
(rl78_gdbarch_init): Move code to rl78_psw_type.
gdb/testsuite:
2016-12-09 Yao Qi <yao.qi@linaro.org>
* gdb.base/all-architectures.exp.in: Remove kfail for rl78.
Pedro Alves [Fri, 9 Dec 2016 14:59:09 +0000 (14:59 +0000)]
Add test that exercises all bfd architecture, osabi, endian, etc. combinations
This adds a test that exposes several problems fixed by earlier
patches:
#1 - Buffer overrun when host/target formats match, but sizes don't.
https://sourceware.org/ml/gdb-patches/2016-03/msg00125.html
#2 - Missing handling for FR-V FR300.
https://sourceware.org/ml/gdb-patches/2016-03/msg00117.html
#3 - BFD architectures with spaces in their names (v850).
https://sourceware.org/ml/binutils/2016-03/msg00108.html
#4 - The OS ABI names with spaces issue.
https://sourceware.org/ml/gdb-patches/2016-03/msg00116.html
#5 - Bogus HP/PA long double format.
https://sourceware.org/ml/gdb-patches/2016-03/msg00122.html
#6 - Cris big endian internal error.
https://sourceware.org/ml/gdb-patches/2016-03/msg00126.html
#7 - Several PowerPC bfd archs/machines not handled by gdb.
https://sourceware.org/bugzilla/show_bug.cgi?id=19797
And hopefully helps catch others in the future.
This started out as a test that simply did,
gdb -ex "print 1.0L"
to exercise #1 above.
Then to cover both 32-bit target / 64-bit host and the converse, I
thought of having the testcase print the floats twice, once with the
architecture set to "i386" and then to "i386:x86-64". This way it
wouldn't matter whether gdb was built as 32-bit or a 64-bit program.
Then I thought that other archs might have similar host/target
floatformat conversion issues as well. Instead of hardcoding some
architectures in the test file, I thought we could just iterate over
all bfd architectures and OS ABIs supported by the gdb build being
tested. This is what then exposed all the other problems listed
above...
With an --enable-targets=all, this exercises over 14 thousand
combinations. If left in a single test file, it all consistenly runs
in under a minute on my machine (An Intel i7-4810MQ @ 2.8 MHZ running
Fedora 23). Split in 8 chunks, as in this commit, it runs in around
25 seconds, with make -j8.
To avoid flooding the gdb.sum file, it avoids calling "pass" on each
tested combination/iteration. I'm explicitly not implementing that by
passing an empty message to gdb_test / gdb_test_multiple, because I
still want a FAIL to be logged in gdb.sum. So instead this puts the
internal passes in the gdb.log file, only, prefixed "IPASS:", for
internal pass. TBC, if some iteration fails, it'll still show up as
FAIL in gdb.sum. If this is an approach that takes on, I can see us
extending the common bits to support it for all testcases.
gdb/testsuite/ChangeLog:
2016-12-09 Pedro Alves <palves@redhat.com>
* gdb.base/all-architectures-0.exp: New file.
* gdb.base/all-architectures-1.exp: New file.
* gdb.base/all-architectures-2.exp: New file.
* gdb.base/all-architectures-3.exp: New file.
* gdb.base/all-architectures-4.exp: New file.
* gdb.base/all-architectures-5.exp: New file.
* gdb.base/all-architectures-6.exp: New file.
* gdb.base/all-architectures-7.exp: New file.
* gdb.base/all-architectures.exp.in: New file.
Yao Qi [Fri, 9 Dec 2016 09:51:20 +0000 (09:51 +0000)]
Use code cache in aarch64 prologue analyzer
This patch change aarch prologue analyzer using code cache, in order
to improve the performance of remote debugging.
gdb.perf/skip-prologue.exp (measured by wall-time) is improved when
the program is compiled without debug information.
Original Patched Original Patched
without dbg without dbg with dbg with dbg
/ 11.
1635239124 9.
99472999573 9.
65339517593 9.
66648793221
-fstack-protector-all 11.
2560930252 9.338118 9.
63896489143 9.
59474396706
gdb:
2016-12-9 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (instruction_reader::read): Call
read_code_unsigned_integer instead of
read_memory_unsigned_integer.
Yao Qi [Fri, 9 Dec 2016 09:51:20 +0000 (09:51 +0000)]
Use code cache in arm prologue analyzer
This patch change arm prologue analyzer using code cache, in order
to improve the performance of remote debugging.
gdb.perf/skip-prologue.exp (measured by wall-time) is improved a lot,
Original Patched Original Patched
without dbg without dbg with dbg with dbg
-marm 14.
166741848 9.
32852292061 11.
4908499718 9.
16302204132
-marm 14.
6705040932 9.
34849786758 18.
2788009644 9.
14823913574
\-fstack-protector-all
-mthumb 34.
4391930103 10.
6062178612 13.
7886838913 10.
3094120026
-mthumb
\-fstack-protector-all 34.
9310460091 10.
6413481236 25.
3875930309 10.
6294929981
gdb:
2016-12-09 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (skip_prologue_function): Call
read_code_unsigned_integer instead of
read_memory_unsigned_integer.
(thumb_analyze_prologue): Likewise.
(arm_analyze_load_stack_chk_guard): Likewise.
(arm_skip_stack_protector): Likewise.
(arm_analyze_prologue):Likewise.
(extend_buffer_earlier): Call target_read_code instead
of target_read_memory.
(arm_adjust_breakpoint_address): Likewise.
Yao Qi [Fri, 9 Dec 2016 09:51:20 +0000 (09:51 +0000)]
Compile gdb.perf/skip-prologue.c with and without debug info
gdb.perf/skip-prologue.exp is intended to measure the performance of
skipping prologue with prologue analysis by setting breakpoints.
However, if program is compiled with debug info, GDB is smart to
skip prologue by line table from debug info, so prologue analysis
is not exercised at all.
This patch adds a parameter COMPILE to specify compiling with
debug information, otherwise, it is compiled without debug
information.
gdb/testsuite:
2016-12-09 Yao Qi <yao.qi@linaro.org>
* gdb.perf/skip-prologue.exp: Add parameter COMPILE.
Thomas Schwinge [Wed, 25 May 2016 16:54:40 +0000 (18:54 +0200)]
Hurd: Adjust to changes to "push pruning old threads down to the target"
For "info threads", we currently run into:
$ gdb/gdb -q -nw -nx --batch -ex start -ex info\ threads bfd/doc/chew
Temporary breakpoint 1 at 0x80486e0: file ../../../W._C._Handy/bfd/doc/chew.c, line 1535.
[New Thread 10656.5]
Thread 4 hit Temporary breakpoint 1, main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
1535 {
Id Target Id Frame
1 bogus thread id 1 Can't fetch registers from thread bogus thread id 1: No such thread
Before commit
e8032dde10b743253125d7defb5f5503b21c1d26,
gdb/thread.c:update_thread_list used to call prune_threads, after that change
it doesn't anymore, and we don't implement the to_update_thread_list target
method where the prune_threads call got moved. For now, apply a fix, related
to commit
c82f56d9d760a9b4034eeaac44f2f0fa5779ff69 "Hurd: Adjust to
startup-with-shell changes", which restores the previous behavior:
Id Target Id Frame
* 4 Thread 10688.4 main (ac=1, av=0x102cd84) at ../../../W._C._Handy/bfd/doc/chew.c:1535
5 Thread 10688.5 0x0106096c in ?? () from /lib/i386-gnu/libc.so.0.3
Not perfect, but at least better.
gdb/
* gnu-nat.c (gnu_create_inferior): After startup_inferior, call
prune_threads.
Thomas Schwinge [Thu, 8 Dec 2016 17:42:03 +0000 (18:42 +0100)]
Avoid PATH_MAX usage
On GNU/Hurd, there is no "#define PATH_MAX", so this failed to build.
gdb/
* inferior.c (print_selected_inferior): Avoid PATH_MAX usage.
GDB Administrator [Fri, 9 Dec 2016 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Thu, 8 Dec 2016 23:29:37 +0000 (23:29 +0000)]
MIPS16/opcodes: Fix off-by-one indentation in `print_mips16_insn_arg'
opcodes/
* mips-dis.c (print_mips16_insn_arg): Remove extraneous
indentation space across.
Maciej W. Rozycki [Thu, 8 Dec 2016 23:29:01 +0000 (23:29 +0000)]
MIPS16/opcodes: Fix PC-relative operation delay-slot adjustment
Complement commit
dd8b7c222e0e ("MIPS: mips16e jalrc/jrc opcodes"),
<https://sourceware.org/ml/binutils/2005-07/msg00349.html>, and stop the
disassembler making a delay-slot adjustment for PC-relative operations
following either MIPS16e compact jumps, or undefined RR/J(AL)R(C)
encodings that have the `l' (link) and `ra' (source register is `ra')
bits set both at a time. Adjust code description for accuracy. Add a
suitable test case.
opcodes/
* mips-dis.c (print_mips16_insn_arg): Avoid delay-slot
adjustment for PC-relative operations following MIPS16e compact
jumps or undefined RR/J(AL)R(C) encodings.
binutils/
* testsuite/binutils-all/mips/mips16-pcrel.d: New test.
* testsuite/binutils-all/mips/mips16-pcrel.s: New test source.
* testsuite/binutils-all/mips/mips.exp: Run the new test.
Maciej W. Rozycki [Thu, 8 Dec 2016 22:55:42 +0000 (22:55 +0000)]
ARC/GAS: Correct a `spaces' global shadowing error
Fix a commit
a9752fdf8398 ("[ARC] Sync cpu names with the ones accepted
by GCC.") build regression:
cc1: warnings being treated as errors
.../gas/config/tc-arc.c: In function 'arc_show_cpu_list':
.../gas/config/tc-arc.c:3452: error: declaration of 'spaces' shadows a global declaration
.../gas/../include/libiberty.h:248: error: shadowed declaration is here
make[4]: *** [tc-arc.o] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
gas/
* config/tc-arc.c (arc_show_cpu_list): Rename `spaces' local
variable to `space_buf'.
Maciej W. Rozycki [Thu, 8 Dec 2016 22:53:39 +0000 (22:53 +0000)]
ARM/GAS: Correct an `index' global shadowing error
Fix a commit
008a97eff0ca ("[GAS][ARM]Generate unpredictable warning for
pc used in data processing instructions with register-shifted register
operand.") build regression:
cc1: warnings being treated as errors
.../gas/config/tc-arm.c: In function 'encode_arm_shift':
.../gas/config/tc-arm.c:7439: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:303: error: shadowed declaration is here
make[4]: *** [tc-arm.o] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
gas/
* config/tc-arm.c (encode_arm_shift): Rename `index' local
variable to `op_index'.
Maciej W. Rozycki [Thu, 8 Dec 2016 22:51:44 +0000 (22:51 +0000)]
AArch64/opcodes: Correct another `index' global shadowing error
Fix a commit
c2c4ff8d52a2 ("[AArch64] Add ARMv8.3 FCMLA and FCADD
instructions") build regression:
cc1: warnings being treated as errors
.../opcodes/aarch64-dis.c: In function 'aarch64_ext_sve_addr_rr_lsl':
.../opcodes/aarch64-dis.c:1324: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:303: error: shadowed declaration is here
make[4]: *** [aarch64-asm.lo] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
opcodes/
* aarch64-asm.c (aarch64_ins_reglane): Rename `index' local
variable to `reglane_index'.
Luis Machado [Thu, 8 Dec 2016 13:25:09 +0000 (07:25 -0600)]
Fix crash when disassembling invalid range on powerpc vle
I got a report of a gdb crash for vle and further investigation showed an
attempt to disassemble an invalid memory range. I tracked the crash down
to the code in get_powerpc_dialect, where we fail to make sure we have a
valid section pointer before dereferencing it.
There is no such problem for rs6000-based disassembling.
opcodes/ChangeLog:
2016-12-08 Luis Machado <lgustavo@codesourcery.com>
* ppc-dis.c (get_powerpc_dialect): Check NULL info->section.
Etienne Buira [Thu, 8 Dec 2016 12:52:21 +0000 (12:52 +0000)]
Always use a hex prefix when displaying the alignment of program headers.
* readelf.c (process_program_headers): Always use hex prefix when
displaying the segment alignment.
Alan Modra [Thu, 8 Dec 2016 05:38:29 +0000 (16:08 +1030)]
[GOLD] Don't assert in powerpc stub_table
A branch in a non-exec section that needs a stub can lead to this
assertion.
* powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
then asserting.
Alan Modra [Thu, 8 Dec 2016 00:19:28 +0000 (10:49 +1030)]
[GOLD] fix typo in --stub-group-multi help
* options.h (--stub-group-multi): Fix typo.
Alan Modra [Wed, 7 Dec 2016 23:20:17 +0000 (09:50 +1030)]
sync binutils config/ with gcc
config/
* acx.m4: Import from gcc.
* bootstrap-asan.mk: Likewise.
* multi.m4: Likewise.
/
* configure: Regnerate.
gas/
* configure: Regnerate.
ld/
* configure: Regnerate.
libiberty/
* configure: Regnerate.
zlib/
* configure: Regnerate.
Alan Modra [Wed, 7 Dec 2016 23:21:00 +0000 (09:51 +1030)]
PR20932, Internal error during record link assignment
PR ld/20932
* elflink.c (bfd_elf_record_link_assignment): Handle warning symbols.
Simon Marchi [Thu, 8 Dec 2016 08:45:59 +0000 (09:45 +0100)]
Hurd: In the CLI, use parse_thread_id instead of global_thread_id_to_ptid
Follow-up to commit
14f6890677849172a4b13779acd9089c9baa3a81.
global_thread_id_to_ptid expects global thread numbers, which are nowadays only
used in MI, never presented to the user in the CLI. Since this is a CLI
command, it should accept the inferior-qualified format instead.
gdb/
* gnu-nat.c (set_sig_thread_cmd): Use parse_thread_id instead of
global_thread_id_to_ptid.
Thomas Schwinge [Mon, 5 Dec 2016 10:59:03 +0000 (11:59 +0100)]
Hurd, C++: Mach/Hurd headers and MIG stubs are not yet fit for C++
..., so handle these in "C" mode still:
gdb/
* config/i386/i386gnu.mh (%_S.o %_U.o): Add "-x c" to
"COMPILE.post".
* gnu-nat.c: #include Mach/Hurd headers before all others. Wrap
Mach/Hurd headers and MIG stubs' prototypes in 'extern "C"'.
* i386-gnu-nat.c: Likewise.
Thomas Schwinge [Fri, 25 Nov 2016 10:02:17 +0000 (11:02 +0100)]
Hurd, C++: kern_return_t vs. error_t
GNU/Hurd uses its own "typedef enum __error_t_codes error_t;"
([glibc]/sysdeps/mach/hurd/bits/errno.h), contrary to the default
"typedef int error_t;" ([glibc]/stdlib/errno.h).
The Mach/Hurd RPCs return kern_return_t values, for which, upon assigning them
to an error_t variable, GCC in C++ mode tells us "error: invalid conversion
from 'kern_return_t {aka int}' to 'error_t {aka __error_t_codes}'". Instead of
casting all these RPC return values to "error_t", just use "kern_return_t"
variables:
gdb/
* gnu-nat.c (proc_get_exception_port, proc_set_exception_port)
(INF_RESUME_MSGPORT_RPC, proc_get_state, _proc_get_exc_port)
(proc_steal_exc_port, proc_restore_exc_port, make_proc)
(inf_startup, inf_set_pid, inf_validate_procinfo)
(inf_validate_task_sc, inf_set_traced, inf_validate_procs)
(inf_signal, inf_continue, gnu_wait, S_exception_raise_request)
(do_mach_notify_dead_name, S_proc_wait_reply)
(S_msg_sig_post_untraced_reply, S_msg_sig_post_reply)
(port_msgs_queued, gnu_read_inferior, gnu_write_inferior)
(gnu_find_memory_regions, steal_exc_port, thread_takeover_sc_cmd)
(flush_inferior_icache): Instead of "error_t" use "kern_return_t".
* i386-gnu-nat.c (fetch_fpregs, store_fpregs, i386_gnu_dr_get)
(i386_gnu_dr_set): Likewise.
Thomas Schwinge [Fri, 25 Nov 2016 14:16:13 +0000 (15:16 +0100)]
Hurd, C++: Avoid "const char *" to "char *" casts
... by a bit of code refactoring:
gdb/
* gnu-nat.c (set_task_pause_cmd, set_signals_cmd)
(set_exceptions_cmd): Add variants taking an "int arg" instead of
a "char *". Make the "char *" variants use the former.
(set_noninvasive_cmd): Also use the "int arg" variants.
Thomas Schwinge [Fri, 25 Nov 2016 13:56:01 +0000 (14:56 +0100)]
Hurd, C++: Avoid GNU C nested functions
..., which C++ doesn't allow, so...
gdb/
* gnu-nat.c (gnu_create_inferior): Move nested "trace_me"
function...
(gnu_ptrace_me): ... here.
Thomas Schwinge [Fri, 25 Nov 2016 10:01:39 +0000 (11:01 +0100)]
Hurd, C++: Explicitly cast "void *"
C++ doesn't do implicit type conversions from "void *", so we have to...
gdb/
* i386-gnu-nat.c (i386_gnu_dr_set_control_one)
(i386_gnu_dr_set_addr_one): Explicitly cast "void *".
GDB Administrator [Thu, 8 Dec 2016 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in
Thomas Schwinge [Tue, 24 May 2016 17:36:57 +0000 (19:36 +0200)]
Hurd: Adjust to "Per-inferior/Inferior-qualified thread IDs" changes
[...]/gdb/gnu-nat.c: In function 'set_sig_thread_cmd':
[...]/gdb/gnu-nat.c:2973:7: warning: implicit declaration of function 'thread_id_to_pid' [-Wimplicit-function-declaration]
ptid_t ptid = thread_id_to_pid (atoi (args));
^
[...]/gdb/gnu-nat.c:2973:7: error: invalid initializer
That's commit
5d5658a1d3c3eb2a09c03f2f0662a1c01963c869, which renamed
`thread_id_to_pid` to `global_thread_id_to_ptid`.
gdb/
* gnu-nat.c (set_sig_thread_cmd): Call global_thread_id_to_ptid
instead of thread_id_to_pid.
Maciej W. Rozycki [Wed, 7 Dec 2016 03:12:50 +0000 (03:12 +0000)]
MIPS/include: opcode/mips.h: Correct INSN_CHIP_MASK
Complement commit
e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation
2)"), <https://sourceware.org/ml/binutils/2012-12/msg00240.html>, and
commit
2c62985659da ("MIPS: Add Octeon 3 support") and update the chip
mask accordingly.
include/
* opcode/mips.h (INSN_CHIP_MASK): Update according to bit use.
Maciej W. Rozycki [Wed, 7 Dec 2016 02:55:27 +0000 (02:55 +0000)]
MIPS/opcodes: Correct an `interaction' comment typo
opcodes/
* mips-dis.c (print_mips16_insn_arg): Fix comment typo.
Maciej W. Rozycki [Wed, 7 Dec 2016 02:53:03 +0000 (02:53 +0000)]
MIPS16/opcodes: Update opcode table comment
opcodes/
* mips16-opc.c (mips16_opcodes): Update comment naming structure
members.
Maciej W. Rozycki [Wed, 7 Dec 2016 02:35:33 +0000 (02:35 +0000)]
MIPS/opcodes: Reformat `-M' disassembler option's help text
Align output produced consistently and fix other formatting issues.
opcodes/
* mips-dis.c (print_mips_disassembler_options): Reformat output.
Maciej W. Rozycki [Wed, 7 Dec 2016 02:27:57 +0000 (02:27 +0000)]
MIPS/include: opcode/mips.h: Add a comment for ASE_DSPR3
Complement commit
8f4f9071ad5f ("Add MIPS32 DSPr3 support.").
include/
* opcode/mips.h (ASE_DSPR3): Add a comment.
Maciej W. Rozycki [Wed, 7 Dec 2016 02:24:18 +0000 (02:24 +0000)]
MIPS/GAS: Use local `isa' consistently in `is_opcode_valid'
Replace a global `mips_opts.isa' reference in `is_opcode_valid' and use
a local copy just made in `isa'. No functional change.
gas/
* config/tc-mips.c (is_opcode_valid): Use local `isa'
consistently.
Nick Clifton [Wed, 7 Dec 2016 10:19:42 +0000 (10:19 +0000)]
Fix internal error in the linker by replacing a call to abort with an error message.
PR ld/20932
* elflink.c (bfd_elf_record_link_assignment): Replace call to
abort with an error message and error return value.
Alan Modra [Wed, 7 Dec 2016 03:45:59 +0000 (14:15 +1030)]
[GOLD] PowerPC --stub-group-multi
Adds a new option, defaulting to off, that allows a group of stubs to
serve multiple output sections. Prior to this patch powerpc gold
allowed this unconditionally, which is a little unsafe with clever
code that discards/reuses sections at runtime.
* options.h (--stub-group-multi): New PowerPC option.
* powerpc.cc (Stub_control): Add multi_os_ var and param
to constructor. Sort start_ var later. Comment State.
(Stub_control::can_add_to_stub_group): Heed multi_os_.
(Target_powerpc::group_sections): Update.
Alan Modra [Wed, 7 Dec 2016 03:42:26 +0000 (14:12 +1030)]
[GOLD] powerpc64le-linux fails to link large Linux kernel
Gold attaches stubs to an existing section in contrast to ld.bfd which
inserts a new section for stubs. If we want stubs before branches,
then the stubs must be added to the previous section. Adding to the
previous section is a disaster if there is a large gap between the
previous section and the group.
PR gold/20878
* powerpc.cc (Stub_control): Replace stubs_always_before_branch_
with stubs_always_after_branch_, group_end_addr_ with
group_start_addr_.
(Stub_control::can_add_to_stub_group): Rewrite to suit scanning
sections by increasing address.
(Target_powerpc::group_sections): Scan that way. Delete corner
case.
* options.h (--stub-group-size): Update help string.
Alan Modra [Wed, 7 Dec 2016 03:41:57 +0000 (14:11 +1030)]
[GOLD] PowerPC stub debug
Some more debug output, and a little hardening.
* powerpc.cc (Stub_table_owner): Provide constructor.
(Powerpc_relobj::set_stub_table): Resize fill with -1.
(Target_powerpc::Branch_info::make_stub): Provide target debug
output on returning false.
GDB Administrator [Wed, 7 Dec 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Tue, 6 Dec 2016 21:19:33 +0000 (16:19 -0500)]
Remove unnecessary inferior lookup in inferior_command
In the case where we switch to a non-running inferior, we do a
"find_inferior_id (num)", although we did the same call right before.
gdb/ChangeLog:
* inferior.c (inferior_command): Remove duplicate
find_inferior_id call.
Nick Clifton [Tue, 6 Dec 2016 16:53:57 +0000 (16:53 +0000)]
Fix seg-fault in strip when copying a corrupt binary.
PR binutils/20931
* elf.c (copy_special_section_fields): Check for an invalid
sh_link field before attempting to follow it.
Nick Clifton [Tue, 6 Dec 2016 16:26:42 +0000 (16:26 +0000)]
Fix seg-fault running strip on a corrupt binary.
PR binutils/20930
* objcopy.c (mark_symbols_used_in_relocations): Check for a null
symbol pointer pointer before attempting to mark the symbol as
kept.
Nick Clifton [Tue, 6 Dec 2016 15:58:15 +0000 (15:58 +0000)]
Fix seg-fault running strip on a corrupt binary.
PR binutils/20929
* aoutx.h (squirt_out_relocs): Check for relocs without an
associated symbol.
Nick Clifton [Tue, 6 Dec 2016 15:34:33 +0000 (15:34 +0000)]
fix typo
Nick Clifton [Tue, 6 Dec 2016 15:31:14 +0000 (15:31 +0000)]
Stop the assembler from running out of memory when asked to generate a huge number of spaces.
PR gas/20901
* read.c (s_space): Place an upper limit on the number of spaces
generated.
Yao Qi [Tue, 6 Dec 2016 14:25:51 +0000 (14:25 +0000)]
Assert on lval_register
This patch adds asserts where the value's lval must be lval_register.
This triggers an error in frame_register_unwind because VALUE_REGNUM
is used but value's lval is not lval_register.
This also reveals a design issue in frame_register_unwind, that is
arguments addrp and realnump are mutually exclusive, we either use
addrp (for lval_memory), or use realnump (for lval_register). This
can be done in a separate patch.
gdb:
2016-12-06 Yao Qi <yao.qi@linaro.org>
* frame.c (frame_register_unwind): Set *realnump if *lvalp is
lval_register.
* value.c (deprecated_value_next_frame_id_hack): Assert
value->lval is lval_register.
(deprecated_value_regnum_hack): Likewise.
Nick Clifton [Tue, 6 Dec 2016 14:13:57 +0000 (14:13 +0000)]
Fix mmix assembler test to account for changes in the error messages produced by the assembler.
PR gas/20896
* testsuite/gas/mmix/err-byte1.s: Adjust expected warning messages
to account for patch to next_char_of_string.
Alan Modra [Tue, 6 Dec 2016 05:36:14 +0000 (16:06 +1030)]
PowerPC64 toc optimisation for power9
Recognize power9 and a few other insns from older machines. Fixes
linker complaints like "toc optimization is not supported for
0xf4090002 instruction". 0xf4090002 is stxsd v0,0(r9)
bfd/
* elf64-ppc.c (ok_lo_toc_insn): Add r_type param. Recognize
lq,lfq,lxv,lxsd,lxssp,lfdp,stq,stfq,stxv,stxsd,stxssp,stfdp.
Don't match lmd and stmd.
ld/
* testsuite/ld-powerpc/tocopt7.s,
* testsuite/ld-powerpc/tocopt7.out,
* testsuite/ld-powerpc/tocopt7.d: New test.
* testsuite/ld-powerpc/tocopt8.s,
* testsuite/ld-powerpc/tocopt8.d: New test.
* testsuite/ld-powerpc/powerpc.exp: Run them.
DJ Delorie [Tue, 6 Dec 2016 06:40:44 +0000 (01:40 -0500)]
argv.c (expandargv): Check for directories passed as @-files.
gcc pr 78584
GDB Administrator [Tue, 6 Dec 2016 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Mon, 5 Dec 2016 21:23:51 +0000 (07:53 +1030)]
Fix gold/testsuite/file_in_many_sections_test.sh file mode
chmod a+x
Cary Coutant [Mon, 5 Dec 2016 18:41:09 +0000 (10:41 -0800)]
Fix problem where absolute local symbols are omitted when output has many sections.
2016-12-05 Cary Coutant <ccoutant@gmail.com>
Tristan Gingold <gingold@adacore.com>
gold/
* object.cc (Sized_relobj_file::do_count_local_symbols): Check
is_ordinary before using shndx.
* testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
* testsuite/Makefile.in: Regenerate.
* testsuite/file_in_many_sections.c: New source file.
* testsuite/file_in_many_sections_test.sh: New script.
Nick Clifton [Mon, 5 Dec 2016 17:36:45 +0000 (17:36 +0000)]
Fix fault in assembler when passed a bogus input file.
PR gas/20902
* read.c (next_char_of_string): Do end advance past the end of the
buffer.
Nick Clifton [Mon, 5 Dec 2016 16:54:59 +0000 (16:54 +0000)]
Fix ICE in assembler when passed a bogus input file.
PR gas/20904
* as.h (SKIP_ALL_WHITESPACE): New macro.
* expr.c (operand): Use it.
Nick Clifton [Mon, 5 Dec 2016 16:34:45 +0000 (16:34 +0000)]
Fix seg-fault in the binutils utilities when reading a corrupt input file.
PR binutils/20905
* peicode.h (pe_ILF_object_p): Use strnlen to avoid running over
the end of the string buffer.
Nick Clifton [Mon, 5 Dec 2016 16:00:43 +0000 (16:00 +0000)]
Fix seg-fault in linker when passed a bogus input script.
PR ld/20906
* ldlex.l: Check for bogus strings in linker scripts.
Jose E. Marchesi [Mon, 5 Dec 2016 15:57:53 +0000 (16:57 +0100)]
binutils: add myself to MAINTAINERS
2016-12-05 Jose E. Marchesi <jose.marchesi@oracle.com>
* MAINTAINERS: Add myself as maintainer for the SPARC targets.
Nick Clifton [Mon, 5 Dec 2016 14:59:02 +0000 (14:59 +0000)]
Fix abort when running tools on a bogus binary.
PR binutils/20907
* peicode.h (pe_ILF_build_a_bfd): Replace abort with error return.
Nick Clifton [Mon, 5 Dec 2016 14:32:30 +0000 (14:32 +0000)]
Fix seg-fault running strip on a corrupt binary.
PR binutils/20921
* aoutx.h (squirt_out_relocs): Check for and report any relocs
that could not be recognised.
Szabolcs Nagy [Mon, 5 Dec 2016 14:24:17 +0000 (14:24 +0000)]
[ARM] Add ARMv8.3 VCMLA and VCADD instructions
Add support for VCMLA and VCADD advanced SIMD complex number instructions.
The command line option is -march=armv8.3-a+fp16+simd for enabling all
instructions.
In arm-dis.c the formatting syntax was abused a bit to select between
0 vs 90 or 180 vs 270 or 90 vs 270 based on a bit value instead of
duplicating entries in the opcode table.
gas/
* config/tc-arm.c (do_vcmla, do_vcadd): Define.
(neon_scalar_for_vcmla): Define.
(enum operand_parse_code): Add OP_IROT1 and OP_IROT2.
(NEON_ENC_TAB): Add DDSI and QQSI variants.
(insns): Add vcmla and vcadd.
* testsuite/gas/arm/armv8_3-a-simd.d: New.
* testsuite/gas/arm/armv8_3-a-simd.s: New.
* testsuite/gas/arm/armv8_3-a-simd-bad.d: New.
* testsuite/gas/arm/armv8_3-a-simd-bad.l: New.
* testsuite/gas/arm/armv8_3-a-simd-bad.s: New.
opcodes/
* arm-dis.c (coprocessor_opcodes): Add vcmla and vcadd.
(print_insn_coprocessor): Add 'V' format for neon D or Q regs.
Claudiu Zissulescu [Mon, 5 Dec 2016 14:09:48 +0000 (15:09 +0100)]
[ARC] Don't check extAuxRegister second argument for sign.
gas/
2016-12-05 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gas/arc/textauxregister-1.d: New file.
* testsuite/gas/arc/textauxregister-1.s: Likewise.
* testsuite/gas/arc/textcondcode-err.s: Likewise.
* testsuite/gas/arc/textcoreregister-err.s: Likewise.
* config/tc-arc.c (tokenize_extregister): Return bfd_boolean,
don't check second argument of extension auxiliary register for
signess.
(arc_extcorereg): Consider the return of tokenize_extregister
function call.
Szabolcs Nagy [Mon, 5 Dec 2016 14:13:27 +0000 (14:13 +0000)]
[ARM] Add ARMv8.3 VJCVT instruction
Add support for VJCVT javascript conversion instruction.
gas/
* config/tc-arm.c (arm_ext_v8_3, do_vjcvt): Define.
(insns): Add vjcvt.
* testsuite/gas/aarch64/armv8_3-a-fp.s: New.
* testsuite/gas/aarch64/armv8_3-a-fp.d: New.
* testsuite/gas/aarch64/armv8_3-a-fp-bad.s: New.
* testsuite/gas/aarch64/armv8_3-a-fp-bad.d: New.
* testsuite/gas/aarch64/armv8_3-a-fp-bad.l: New.
opcodes/
* arm-dis.c (coprocessor_opcodes): Add vjcvt.
Szabolcs Nagy [Mon, 5 Dec 2016 14:07:25 +0000 (14:07 +0000)]
[ARM] Add ARMv8.3 command line option and feature flag
ARMv8.3 is an architectural extension of ARMv8. Add the
feature macro and -march=armv8.3-a gas command line option
for the ARM target.
https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions
gas/
* config/tc-arm.c (arm_archs): Add "armv8.3-a".
* doc/c-arm.texi (-march): Add "armv8.3-a".
include/
* opcode/arm.h (ARM_EXT2_V8_3A, ARM_AEXT2_V8_3A): New.
(ARM_ARCH_V8_3A): New.
Alyssa Milburn [Mon, 5 Dec 2016 06:59:18 +0000 (22:59 -0800)]
bfd,ld: Continue after partially-successful relaxed call relocations in sparc.
bfd/ChangeLog:
2016-12-05 Alyssa Milburn <amilburn@zall.org>
* elfxx-sparc.c: Do not stop processing relocations after
partially relaxing a call with WDISP30.
ld/ChangeLog:
2016-12-05 Alyssa Milburn <amilburn@zall.org>
* testsuite/ld-sparc/wdispcall.s: New file.
* testsuite/ld-sparc/wdispcall.dd: Likewise.
* testsuite/ld-sparc/sparc.exp: Run new test.
Nick Clifton [Mon, 5 Dec 2016 13:35:50 +0000 (13:35 +0000)]
Fix seg-fault attempting to strip a corrupt binary.
PR binutils/20922
* elf.c (find_link): Check for null headers before attempting to
match them.
Nick Clifton [Mon, 5 Dec 2016 13:11:01 +0000 (13:11 +0000)]
Fix seg-fault running strip on a corrupt binary.
PR ld/20923
* objcopy.c (mark_symbols_used_in_relocations): Check for a null
symbol pointer before attempting to mark the symbol as kept.
Nick Clifton [Mon, 5 Dec 2016 12:25:34 +0000 (12:25 +0000)]
Fix seg-fault in linker parsing a corrupt input file.
PR ld/20924
(aout_link_add_symbols): Fix off by one error checking for
overflow of string offset.
Nick Clifton [Mon, 5 Dec 2016 12:14:22 +0000 (12:14 +0000)]
Fix assertion failure in linker triggered by corrupt input file.
PR ld/20925
* aoutx.h (aout_link_add_symbols): Replace BFD_ASSERT with return
FALSE.
Nick Clifton [Mon, 5 Dec 2016 11:25:26 +0000 (11:25 +0000)]
fix typo
GDB Administrator [Mon, 5 Dec 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Jim Wilson [Sun, 4 Dec 2016 01:29:44 +0000 (17:29 -0800)]
Fix bugs with tbnz/tbz instructions.
sim/aarch64
* simulator.c (tbnz, tbz): Cast 1 to uint64_t before shifting.
(dexTestBranchImmediate): Shift high bit of pos by 5 not 4.
GDB Administrator [Sun, 4 Dec 2016 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Sat, 3 Dec 2016 10:30:01 +0000 (21:00 +1030)]
PowerPC64 dot-symbol compatibility bugfixes
Lots of fixes for the compatibility code that handles linking of
-mcall-aixdesc code (or that generated by 12 year old gcc) with
current ELFv1 ABI code.
1) A reference to a dot-symbol in an object file wasn't satisfied by a
function descriptor in later object files.
2) The as-needed code had bit-rotted; Shared libs now need a strong
reference to be counted as needed.
3) --gc-sections involving dot-symbols was broken, needing
func_desc_adjust to be run early and lots of other fixes.
bfd/
* elf64-ppc.c (struct ppc_link_hash_entry): Delete "was_undefined".
(struct ppc_link_hash_table): Delete "twiddled_syms". Add
"need_func_desc_adj".
(lookup_fdh): Link direct fdh sym via oh field and set flags.
(make_fdh): Make strong and weak undefined function descriptor
symbols.
(ppc64_elf_merge_symbol): New function.
(elf_backend_merge_symbol): Define.
(ppc64_elf_archive_symbol_lookup): Don't test undefweak for fake
function descriptors.
(add_symbol_adjust): Don't twiddle symbols to undefweak.
Propagate more ref flags to function descriptor symbol. Make
some function descriptor symbols dynamic.
(ppc64_elf_before_check_relocs): Only run add_symbol_adjust for
ELFv1. Set need_func_desc_adj. Don't fix undefs list.
(ppc64_elf_check_relocs): Set non_ir_ref for descriptors.
Don't call lookup_fdh here.
(ppc64_elf_gc_sections): New function.
(bfd_elf64_bfd_gc_sections): Define.
(ppc64_elf_gc_mark_hook): Mark descriptor.
(func_desc_adjust): Don't make fake function descriptor syms strong
here. Exit earlier on non-dotsyms. Take note of elf.dynamic
flag when deciding whether a dynamic function descriptor might
be needed. Transfer elf.dynamic and set elf.needs_plt. Move
plt regardless of visibility. Make descriptor dynamic if
entry sym is dynamic, not for other cases.
(ppc64_elf_func_desc_adjust): Don't run func_desc_adjust if
already done.
(ppc64_elf_edit_opd): Use oh field rather than lookup_fdh.
(ppc64_elf_size_stubs): Likewise.
(ppc_build_one_stub): Don't clear was_undefined. Only set sym
undefweak if stub symbol is defined.
(undo_symbol_twiddle, ppc64_elf_restore_symbols): Delete.
* elf64-ppc.h (ppc64_elf_restore_symbols): Don't declare.
ld/
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't call
ppc64_elf_restore_symbols.
* testsuite/ld-powerpc/dotsym1.d: New.
* testsuite/ld-powerpc/dotsym2.d: New.
* testsuite/ld-powerpc/dotsym3.d: New.
* testsuite/ld-powerpc/dotsym4.d: New.
* testsuite/ld-powerpc/dotsymref.s: New.
* testsuite/ld-powerpc/nodotsym.s: New.
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
Alan Modra [Sat, 3 Dec 2016 10:29:43 +0000 (20:59 +1030)]
PowerPC64 dot-sym testsuite fixes
This illustrates quite well why dot-symbols had to go. PowerPC64 gcc
for Linux stopped producing them 12 years ago, but the Linux kernel
still persists in using them so it's necessary to keep and
regression test ld support.
* testsuite/ld-elf/indirect1b.c: Give dot-symbol a version too.
* testsuite/ld-elf/indirect2.c: Likewise.
* testsuite/ld-elf/indirect3b.c: Likewise.
* testsuite/ld-elf/indirect4b.c: Likewise.
* testsuite/ld-elf/pr18718.c: Likewise.
* testsuite/ld-elf/pr18720b.c: Likewise.
* testsuite/ld-elf/pr19553c.c: Likewise.
* testsuite/ld-elfvers/vers.h (FUNC_SYMVER): Define.
* testsuite/ld-elfvers/vers1.c: Use FUNC_SYMVER for functions.
* testsuite/ld-elfvers/vers4.c: Likewise.
* testsuite/ld-elfvers/vers5.c: Likewise.
* testsuite/ld-elfvers/vers6.c: Likewise.
* testsuite/ld-elfvers/vers7a.c: Likewise.
* testsuite/ld-elfvers/vers9.c: Likewise.
* testsuite/ld-elfvers/vers15.c: Likewise.
* testsuite/ld-elfvers/vers18.c: Likewise.
* testsuite/ld-elfvers/vers22a.c: Likewise.
* testsuite/ld-elfvers/vers23a.c: Likewise.
* testsuite/ld-elfvers/vers27d1.c: Likewise.
* testsuite/ld-elfvers/vers21.c: Likewise.
(_old_bar): Use attribute weak rather than asm weak.
* testsuite/ld-ifunc/pr16467b.c: Give dot-symbol a version.
* testsuite/ld-plugin/pr12760b.c: Define warning on .bar rather than
bar for ppc64 -mcall-aixdesc.
* testsuite/ld-plugin/pr16746a.c: Similarly for foobar.
* testsuite/ld-plugin/pr16746b.c: Likewise.
* testsuite/ld-elf/shared.exp: Allow dot-symbol in warnings and errors.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-plugin/plugin-6.d: Likewise.
* testsuite/ld-plugin/plugin-7.d: Likewise.
* testsuite/ld-plugin/plugin-8.d: Likewise.
* testsuite/ld-plugin/plugin-13.d: Likewise.
* testsuite/ld-plugin/plugin-14.d: Likewise.
* testsuite/ld-plugin/plugin-15.d: Likewise.
* testsuite/ld-plugin/plugin-16.d: Likewise.
* testsuite/ld-plugin/plugin-20.d: Likewise.
* testsuite/ld-plugin/plugin-21.d: Likewise.
* testsuite/ld-plugin/plugin-22.d: Likewise.
* testsuite/ld-plugin/plugin-23.d: Likewise.
* testsuite/ld-plugin/plugin.exp: Define .main and .puts for ppc64
-mcall-aixdesc.
* testsuite/ld-elfvers/vers.exp (test_ar): Trim dot-symbols.
(objdump_dynsymstuff): Likewise.
(objdump_symstuff): Likewise. Pack flags to keep column count
consistent.
* testsuite/ld-elfweak/elfweak.exp (objdump_dynsymstuff,
objdump_symstuff): As for vers.exp.
* testsuite/ld-elfvers/vers6.sym: Allow dot-symbols.
* testsuite/ld-elfvers/vers1.sym: Allow missing F flag for
-mcall-aixdesc .opd syms and adjust for flag packing.
* testsuite/ld-elfvers/vers4.sym: Likewise.
* testsuite/ld-elfvers/vers4a.sym: Likewise.
* testsuite/ld-elfvers/vers7a.sym: Likewise.
* testsuite/ld-elfvers/vers9.sym: Likewise.
* testsuite/ld-elfvers/vers15.sym: Likewise.
* testsuite/ld-elfvers/vers18.sym: Likewise.
* testsuite/ld-elfvers/vers21.sym: Likewise.
* testsuite/ld-elfvers/vers22a.sym: Likewise.
* testsuite/ld-elfvers/vers23a.sym: Likewise.
* testsuite/ld-elfvers/vers27d.sym: Likewise.
* testsuite/ld-elfweak/strong.sym: Likewise.
* testsuite/ld-elfweak/strongcomm.sym: Likewise.
* testsuite/ld-elfweak/strongdata.sym: Likewise.
Alan Modra [Sat, 3 Dec 2016 10:29:19 +0000 (20:59 +1030)]
ld-elfvers don't fail on non-empty results
* testsuite/ld-elfvers/vers.exp (objdump_dynsymstuff): Don't abort
on non-empty results with empty expected.
Alan Modra [Sat, 3 Dec 2016 10:28:55 +0000 (20:58 +1030)]
Correct cdtest g++ version test
Fixes declaration conflict with built-in strncpy.
* testsuite/ld-cdtest/cdtest-foo.cc: Test for __GNUG__ >= 2.
Alan Modra [Sat, 3 Dec 2016 10:28:15 +0000 (20:58 +1030)]
Tidy ppc64_elf_hide_symbol
* elf64-ppc.c (ppc64_elf_hide_symbol): Access hash table as
elf_link_hash_table rather than ppc_link_hash_table.
Alan Modra [Sat, 3 Dec 2016 10:27:50 +0000 (20:57 +1030)]
PowerPC64 add_symbol_adjust
* elf64-ppc.c (add_symbol_adjust): Delete dead code.
Alan Modra [Sat, 3 Dec 2016 10:27:27 +0000 (20:57 +1030)]
Indirect and warning symbols
It's possible but unlikely that an indirect symbol points at a warning
symbol.
* elf64-ppc.c (add_symbol_adjust): Correct order of tests for
warning and indirect symbols.
Alan Modra [Sat, 3 Dec 2016 10:25:25 +0000 (20:55 +1030)]
ppc64_elf_copy_indirect_symbol versioned_hidden fix
As per _bfd_elf_link_hash_copy_indirect.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy dynamic
flags when direct symbol is versioned_hidden.
Alan Modra [Sat, 3 Dec 2016 10:24:57 +0000 (20:54 +1030)]
try_copy_symbol_type node_class check
* ldexp.c (try_copy_symbol_type): Remove unnecessary check.
GDB Administrator [Sat, 3 Dec 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Fri, 2 Dec 2016 22:12:37 +0000 (17:12 -0500)]
Introduce enum_flag type for ui_out flags
This patch changes the ui_out flags to be an enum flag.
gdb/ChangeLog:
* ui-out.h: Include "common/enum-flags.h".
(enum ui_flags): Rename to ...
(enum ui_out_flag): ... this.
(ui_out_flags): Define enum flag type.
(ui_out_test_flags): Change type of parameter to ui_out_flags.
(ui_out_new): Likewise.
* ui-out.c (ui_out_test_flags): Likewise.
(ui_out_new): Likewise.
* cli-out.c (cli_out_new): Update variable type.
* mi/mi-out.c (mi_out_new): Likewise.
* tui/tui-out.c (tui_out_new): Likewise.
Luis Machado [Fri, 2 Dec 2016 19:36:15 +0000 (13:36 -0600)]
Remove unneeded pattern matching in gdb.base/maint.exp
This gets rid of more useless pattern matching cases in gdb.base/maint.exp.
gdb/testsuite/ChangeLog:
2016-12-02 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/maint.exp: Use gdb_test instead of gdb_test_multiple when
possible.
Remove useless pattern-matching code.
Pedro Alves [Fri, 2 Dec 2016 19:17:14 +0000 (19:17 +0000)]
Support an "unlimited" number of user-defined arguments
New in v2:
- A few adjustments / simplifications were possible now that we
require C++11:
. Use std::unique_ptr to make the user_args_stack std::vector own
its elements:
static std::vector<std::unique_ptr<user_args>> user_args_stack;
. use vector::emplace_back to construct elements directly in the
corresponding vectors.
. use std::to_string instead of adding a gdb::to_string
replacement.
- Now includes a test.
Docs/NEWS are unchanged from v1 and have already been approved.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I recently wrote a user-defined command that could benefit from
supporting an unlimited number of arguments:
http://palves.net/list-active-signal-handlers-with-gdb/
E.g., 'info signal-dispositions 1 2 3 4 5 6 7 8 9 10 11'
However, we currently only support up to 10 arguments passed to
user-defined commands ($arg0..$arg9).
I can't find a good reason for that, other than "old code with hard
coded limits". This patch removes that limit and modernizes the code
along the way:
- Makes the user_args struct a real C++ class that uses std::vector
for storage.
- Removes the "next" pointer from within user_args and uses a
std::vector to maintain a stack instead.
- Adds a new RAII-based scoped_user_args_level class to help
push/pop user args in the stack instead of using a cleanup.
gdb/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
* NEWS: Mention that user commands now accept an unlimited number
of arguments.
* cli/cli-script.c: Include <vector>.
(struct string_view): New type.
(MAXUSERARGS): Delete.
(struct user_args): Now a C++ class.
(user_args_stack): New.
(struct scoped_user_args_level): New type.
(execute_user_command): Use scoped_user_args_level.
(arg_cleanup): Delete.
(setup_user_args): Deleted, and refactored as ...
(user_args::user_args): ... this new constructor. Limit of number
of arguments removed.
(insert_user_defined_cmd_args): Defer to user_args_stack.
(user_args::insert_args): New, bits based on old
insert_user_defined_cmd_args with limit of number of arguments
eliminated.
gdb/doc/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
* gdb.texinfo (User-defined Commands): Limit on number of
arguments passed to user-defined commands removed; update.
gdb/testsuite/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
* gdb.base/commands.exp (user_defined_command_manyargs_test): New
procedure.
(top level): Call it.
Pedro Alves [Fri, 2 Dec 2016 19:17:13 +0000 (19:17 +0000)]
Test user-defined gdb commands and arguments stack
We're missing a test that makes sure that arguments to user-defined
commands are handled correctly when a user-defined command calls
another user-defined command / recurses.
The following patch changes that code, so add such a test first so we
can be confident won't be breaking this use case.
gdb/testsuite/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
* gdb.base/commands.exp (user_defined_command_args_stack_test):
New procedure.
(top level): Call it.
Pedro Alves [Fri, 2 Dec 2016 19:17:13 +0000 (19:17 +0000)]
Fix PR 20559 - "eval" command and $arg0...$arg9/$argc substitution
It'd be handy to be able to iterate over command arguments in
user-defined commands, in order to support optional arguments
($arg0..$argN).
I thought I could make it work with "eval", but alas, it doesn't work
currently. E.g., with:
define test
set $i = 0
while $i < $argc
eval "print $arg%d", $i
set $i = $i + 1
end
end
we get:
(gdb) test 1
$1 = void
(gdb) test 1 2 3
$2 = void
$3 = void
$4 = void
(gdb)
The problem is that "eval" doesn't do user-defined command arguments
substitution after expanding its own argument. This patch fixes that,
which makes the example above work:
(gdb) test 1
$1 = 1
(gdb) test 1 2 3
$2 = 1
$3 = 2
$4 = 3
(gdb)
New test included, similar the above, but also exercises expanding
$argc.
I think this is likely to simplify many scripts out there, so I'm
adding an example to the manual and mentioning it in NEWS as well.
gdb/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
PR cli/20559
* NEWS: Mention "eval" expands user-defined command arguments.
* cli/cli-script.c (execute_control_command): Adjust to rename.
(insert_args): Rename to ...
(insert_user_defined_cmd_args): ... this, and make extern.
* cli/cli-script.h (insert_user_defined_cmd_args): New
declaration.
* printcmd.c: Include "cli/cli-script.h".
(eval_command): Call insert_user_defined_cmd_args.
gdb/doc/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
PR cli/20559
* gdb.texinfo (Define): Add example of using "eval" to process a
variable number of arguments.
(Output) <eval>: Add anchor.
gdb/testsuite/ChangeLog:
2016-12-02 Pedro Alves <palves@redhat.com>
PR cli/20559
* gdb.base/commands.exp (user_defined_command_args_eval): New
procedure.
(top level): Call it.
Nick Clifton [Fri, 2 Dec 2016 17:53:42 +0000 (17:53 +0000)]
Fix typo in changelog entry
Nick Clifton [Fri, 2 Dec 2016 17:46:26 +0000 (17:46 +0000)]
Fix seg-fault in linker when passed a corrupt binary input file.
PR lf/20908
* elflink.c (bfd_elf_final_link): Check for ELF flavour binaries
when following indirect links.
Luis Machado [Fri, 2 Dec 2016 17:37:57 +0000 (11:37 -0600)]
Revert change to gdb.cp/ovldbreak.exp
This reverts the timeout handling (removed by
018572b88885ae67d22612937fa1e4fd98d5f5ad) for gdb.cp/ovldbreak.exp until we
decide what to do about this particular function.
gdb/testsuite/ChangeLog:
2016-12-02 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/ovldbreak.exp (take_gdb_out_of_choice_menu): Restore
timeout handling.
Nick Clifton [Fri, 2 Dec 2016 16:41:14 +0000 (16:41 +0000)]
Fix seg-fault in the linker when examining a corrupt binary.
PR ld/20909
* aoutx.h (aout_link_add_symbols): Fix off-by-one error in check
for an illegal string offset.
Tom Tromey [Mon, 14 Nov 2016 03:56:34 +0000 (20:56 -0700)]
PR symtab/16264 - support DW_AT_main_subprogram
This patch adds support for DW_AT_main_subprogram.
This is PR symtab/16264.
DW_AT_main_subprogram is used to mark a program's entry point. GCC
can emit this, and I hope to change the Rust compiler to emit it as
well.
GDB already supports an older, pre-DWARF 4 convention adopted by
FORTRAN compilers, namely to emit DW_AT_calling_convention for the
"main" function. However, I think this support in GDB had a small
bug, in that it seems to rely on the DW_AT_name being read before
DW_AT_calling_convention. This patch fixes this as well.
Built and regtested on x86-64 Fedora 24 and the buildbot. New test
case included.
2016-12-02 Tom Tromey <tom@tromey.com>
PR symtab/16264:
* dwarf2read.c (struct partial_die_info) <main_subprogram>: New
member.
(add_partial_symbol): Call set_objfile_main_name.
(read_partial_die): Handle DW_AT_main_subprogram.
<DW_AT_calling_convention>: don't call set_objfile_main_name, but
set main_subprogram flag.
2016-12-02 Tom Tromey <tom@tromey.com>
* gdb.dwarf2/main-subprogram.c: New file.
* gdb.dwarf2/main-subprogram.exp: New file.