H.J. Lu [Fri, 1 May 2015 15:33:55 +0000 (08:33 -0700)]
Configure zlib with --enable-host-shared for shared bfd
When bfd is configured as a shared library, we need to configure zlib
with --enable-host-shared since zlib is used by bfd.
PR ld/18355
* Makefile.def: Add extra_configure_flags to host zlib.
* configure.ac (extra_host_zlib_configure_flags): New. Set
to --enable-host-shared When bfd is to be built as shared
library. AC_SUBST.
* Makefile.in: Regenerated.
* configure: Likewise.
H.J. Lu [Fri, 1 May 2015 15:29:16 +0000 (08:29 -0700)]
Remove i386_elf_emit_arch_note
This x86 assembler patch:
https://sourceware.org/ml/binutils/2001-11/msg00344.html
generates a .note section for .arch directive so that GDB can tell which
architecture an i386 binary belongs:
https://sourceware.org/ml/binutils/2001-11/msg00271.html
However, x86 assembly code can have any instructions. A .note section
doesn't help. This patch removes it.
gas/
* config/tc-i386.c (i386_elf_emit_arch_note): Removed.
* config/tc-i386.h (md_end): Likewise.
(i386_elf_emit_arch_note): Likewise.
gas/testsuite/
* gas/i386/i386.exp: Run note.
* gas/i386/note.d: New file.
* gas/i386/note.s: Likewise.
H.J. Lu [Fri, 1 May 2015 12:02:30 +0000 (05:02 -0700)]
Support ix86-*-elf*
bfd/
* config.bfd: Support i[3-7]86-*-elf*.
gas/
* configure.tgt: Support i386-*-elf*.
GDB Administrator [Fri, 1 May 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
DJ Delorie [Thu, 30 Apr 2015 19:25:49 +0000 (15:25 -0400)]
Make RL78 disassembler and simulator respect ISA for mul/div
[gas]
* config/rl78-defs.h (rl78_isa_g10): New.
(rl78_isa_g13): New.
(rl78_isa_g14): New.
* config/rl78-parse.y (ISA_G10): New.
(ISA_G13): New.
(ISA_G14): New.
(MULHU, MULH, MULU, DIVHU, DIVWU, MACHU, MACH): Use them.
* config/tc-rl78.c (rl78_isa_g10): New.
(rl78_isa_g13): New.
(rl78_isa_g14): New.
[gdb]
* rl78-tdep.c (rl78_analyze_prologue): Pass RL78_ISA_DEFAULT to
rl78_decode_opcode
[include]
* dis-asm.h (print_insn_rl78_g10): New.
(print_insn_rl78_g13): New.
(print_insn_rl78_g14): New.
(rl78_get_disassembler): New.
* opcode/rl78.h (RL78_Dis_Isa): New.
(rl78_decode_opcode): Add ISA parameter.
[opcodes]
* disassemble.c (disassembler): Choose suitable disassembler based
on E_ABI.
* rl78-decode.opc (rl78_decode_opcode): Take ISA parameter. Use
it to decode mul/div insns.
* rl78-decode.c: Regenerate.
* rl78-dis.c (print_insn_rl78): Rename to...
(print_insn_rl78_common): ...this, take ISA parameter.
(print_insn_rl78): New.
(print_insn_rl78_g10): New.
(print_insn_rl78_g13): New.
(print_insn_rl78_g14): New.
(rl78_get_disassembler): New.
[sim]
* rl78/cpu.c (g14_multiply): New.
* rl78/cpu.h (g14_multiply): New.
* rl78/load.c (rl78_load): Decode ISA completely.
* rl78/main.c (main): Expand -M to include other ISAs.
* rl78/rl78.c (decode_opcode): Decode based on ISA.
* rl78/trace.c (rl78_disasm_fn): New.
(sim_disasm_init): Reset it.
(sim_disasm_one): Get correct disassembler for ISA.
H.J. Lu [Thu, 30 Apr 2015 15:36:17 +0000 (08:36 -0700)]
Use "else if" on cpu_arch_isa
* config/tc-i386.c (i386_target_format): Use "else if" on
cpu_arch_isa.
Nick Clifton [Thu, 30 Apr 2015 14:57:41 +0000 (15:57 +0100)]
Fix handling of relocs for the MeP target.
bfd PR 18317
* elf32-mep.c (MEPREL): Use bfd_elf_generic_reloc instead of
mep_reloc.
(mep_reloc): Delete unused function.
bin * readelf.c (get_machine_flags): Add description of MeP flags.
tests * binutils-all/objdump.exp (cpus_expected): Add MeP CPU names.
H.J. Lu [Thu, 30 Apr 2015 13:52:34 +0000 (06:52 -0700)]
Undef elf_backend_post_process_headers for Solaris
* elf32-i386.c (elf_backend_post_process_headers): Undef for
Solaris 2.
Nick Clifton [Thu, 30 Apr 2015 10:17:55 +0000 (11:17 +0100)]
GAS ARM: Warn if the user creates a symbol with the same name as an instruction.
PR gas/18347
gas * config/tc-arm.c (md_undefined_symbol): Issue a warning message
(if enabled) when the user creates a symbol with the same name as
an ARM instruction.
(flag_warn_syms): New static variable.
(arm_opts): Add mwarn-syms and mno-warn-syms.
* doc/c-arm.texi (ARM Options): Document the -m[no-]warn-syms
options.
tests * gas/arm/pr18347.s: New file: Test case.
* gas/arm/pr18347.l: New file: Expected assembler output.
* gas/arm/pr18347.d: New file: Test driver.
Nick Clifton [Thu, 30 Apr 2015 09:13:53 +0000 (10:13 +0100)]
Adds documentation of GAS's .zero directive.
PR gas/18353
* doc/as.texinfo (Zero): Add documentation of the .zero pseudo-op.
Yao Qi [Thu, 30 Apr 2015 09:08:10 +0000 (10:08 +0100)]
Skip setting HW watchpoint if skip_hw_watchpoint_multi_tests in gdb.base/break-idempotent.exp
Hi,
I see this fails below on arm linux native testing and remote testing
with "set remote hardware-watchpoint-limit 1",
rwatch global^M
There are not enough available hardware resources for this watchpoint.^M
(gdb) FAIL: gdb.base/break-idempotent.exp: always-inserted off: rwatch: twice: rwatch global
gdb.base/break-idempotent.exp sets two breakpoints/watchpoints on the
same address. GDB isn't smart enough calculate these two HW
watchpoints can fit in one HW debug register, so the error message
above isn't necessary (there is one HW watchpoint register on arm).
Because target_ops interface can_use_hardware_watchpoint doesn't
pass enough information to the target backend.
Note that if I don't "set remote hardware-watchpoint-limit 1" in
remote testing, this test passes without fails. However without
"set remote hardware-watchpoint-limit 1", many other watchpoint
tests fail.
This patch is to add a check to skip_hw_watchpoint_multi_tests
for rwatch and awatch. We can add such check for watch as well,
but GDB is able to switch to software watchpoint if HW resource
isn't available, it doesn't cause any fail, I decide not to skip.
gdb/testsuite:
2015-04-30 Yao Qi <yao.qi@linaro.org>
* gdb.base/break-idempotent.exp: If
skip_hw_watchpoint_multi_tests returns true, skip the tests
on "rwatch" and "awatch".
Yao Qi [Thu, 30 Apr 2015 08:55:06 +0000 (09:55 +0100)]
Skip gdb.base/relativedebug.exp if libc doesn't have debug info
Hi,
I see the fail in gdb.base/relativedebug.exp on aarch64 box on which
glibc doesn't have debug info,
bt^M
#0 0x0000002000061a88 in raise () from /lib/aarch64-linux-gnu/libc.so.6^M
#1 0x0000002000064efc in abort () from /lib/aarch64-linux-gnu/libc.so.6^M
#2 0x0000000000400640 in handler (signo=14) at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:25^M
#3 <signal handler called>^M
#4 0x00000020000cc478 in ?? () from /lib/aarch64-linux-gnu/libc.so.6^M
#5 0x0000000000400664 in main () at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:32^M
(gdb) FAIL: gdb.base/relativedebug.exp: pause found in backtrace
if glibc has debug info, this test doesn't fail.
In sysdeps/unix/sysv/linux/generic/pause.c, __libc_pause calls
__syscall_pause,
static int
__syscall_pause (void)
{
sigset_t set;
int rc =
INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, _NSIG / 8);
if (rc == 0)
rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8);
return rc;
}
int
__libc_pause (void)
{
if (SINGLE_THREAD_P)
return __syscall_pause (); <--- tail call
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __syscall_pause ();
LIBC_CANCEL_RESET (oldtype);
return result;
}
and GDB unwinder is confused by the GCC optimized code,
(gdb) disassemble pause
Dump of assembler code for function pause:
0x0000007fb7f274c4 <+0>: stp x29, x30, [sp,#-32]!
0x0000007fb7f274c8 <+4>: mov x29, sp
0x0000007fb7f274cc <+8>: adrp x0, 0x7fb7fd2000
0x0000007fb7f274d0 <+12>: ldr w0, [x0,#364]
0x0000007fb7f274d4 <+16>: stp x19, x20, [sp,#16]
0x0000007fb7f274d8 <+20>: cbnz w0, 0x7fb7f274e8 <pause+36>
0x0000007fb7f274dc <+24>: ldp x19, x20, [sp,#16]
0x0000007fb7f274e0 <+28>: ldp x29, x30, [sp],#32
0x0000007fb7f274e4 <+32>: b 0x7fb7f27434 <---- __syscall_pause
0x0000007fb7f274e8 <+36>: bl 0x7fb7f5e080
Note that the program stops in __syscall_pause, but its symbol is
stripped in glibc, so GDB doesn't know where the program stops.
__syscall_pause is a tail call in __libc_pause, so it returns to main
instead of __libc_pause. As a result, the backtrace is like,
#0 0x0000007fb7ebca88 in raise () from /lib/aarch64-linux-gnu/libc.so.6
#1 0x0000007fb7ebfefc in abort () from /lib/aarch64-linux-gnu/libc.so.6
#2 0x0000000000400640 in handler (signo=14) at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:25
#3 <signal handler called>
#4 0x0000007fb7f27478 in ?? () from /lib/aarch64-linux-gnu/libc.so.6 <-- [in __syscall_pause]
#5 0x0000000000400664 in main () at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:32
looks GDB does nothing wrong here. I looked back at the test case
gdb.base/relativedebug.exp, which was added
https://sourceware.org/ml/gdb-patches/2006-10/msg00305.html
This test was indented to test the problem that "backtraces no longer
display some libc functions" after separate debug info is installed.
IOW, it makes few sense to test against libc which doesn't have debug
info at all, such as my case.
This patch is to tweak the test case to catch the output of
"info shared", if "(*)" is found for libc.so, which means libc doesn't
have debug info, then skip the test.
gdb/testsuite:
2015-04-30 Yao Qi <yao.qi@linaro.org>
* gdb.base/relativedebug.exp: Invoke gdb command
"info sharedlibrary", and if libc.so doesn't have debug info,
skip the test.
GDB Administrator [Thu, 30 Apr 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Doug Evans [Wed, 29 Apr 2015 20:24:21 +0000 (13:24 -0700)]
PR python/18285
gdb/ChangeLog:
PR python/18285
* NEWS: Document new gdb.XMethodWorker.get_result_type method.
* eval.c (evaluate_subexp_standard) <OP_FUNCALL>: Handle
EVAL_AVOID_SIDE_EFFECTS for xmethods.
* extension-priv.h (struct extension_language_ops)
<get_xmethod_result_type>: New member.
* extension.c (get_xmethod_result_type): New function.
* extension.h (get_xmethod_result_type): Declare.
* python/py-xmethods.c (get_result_type_method_name): New static
global.
(py_get_result_type_method_name): Ditto.
(gdbpy_get_xmethod_result_type): New function.
(gdbpy_initialize_xmethods): Initialize py_get_result_type_method_name.
* python/python-internal.h (gdbpy_get_xmethod_result_type): Declare.
* python/python.c (python_extension_ops): Add
gdbpy_get_xmethod_result_type.
* python/lib/gdb/xmethod.py (XMethodWorker): Add get_result_type.
* valarith.c (value_x_binop): Handle EVAL_AVOID_SIDE_EFFECTS for
xmethods.
(value_x_unop): Ditto.
* value.c (result_type_of_xmethod): New function.
* value.h (result_type_of_xmethod): Declare.
gdb/testsuite/ChangeLog:
* gdb.python/py-xmethods.exp: Add ptype tests.
* gdb.python/py-xmethods.py (E_method_char_worker): Add
get_result_type method.
gdb/doc/ChangeLog:
* python.texi (Xmethod API) <gdb.XMethodWorker.get_result_type>:
Document.
(Writing an Xmethod): Add get_result_type to example.
Nick Clifton [Wed, 29 Apr 2015 16:09:05 +0000 (17:09 +0100)]
Fix an internal error in GAS when assembling a bogus piece of source code.
gas PR 18256
* config/tc-arm.c (encode_arm_cp_address): Issue an error message
if the operand is neither a register nor a vector.
tests * gas/arm/pr18256.s: New file: Test case.
* gas/arm/pr18256.l: New file: Expected assembler output.
* gas/arm/pr18256.d: New file: Test driver.
H.J. Lu [Wed, 29 Apr 2015 15:43:22 +0000 (08:43 -0700)]
Link the last *normal against libfoozlib.so
Link the last zlibnormal gnunormal and gabinormal against libfoozlib.so
so that their only differences are DWARF debug sections.
PR ld/18354
* ld-elf/compress.exp (run_tests): Link the last zlibnormal,
gnunormal and gabinormal against libfoozlib.so.
H.J. Lu [Wed, 29 Apr 2015 15:04:53 +0000 (08:04 -0700)]
Fix 18354
Nick Clifton [Wed, 29 Apr 2015 15:24:52 +0000 (16:24 +0100)]
Updated translations for various binutils components.
gold * po/fi.po: Updated Finnish translation.
opcodes * po/fr.po: Updated French translation.
gprof * po/da.po: Update Danish translation.
Luis Machado [Wed, 29 Apr 2015 15:22:24 +0000 (12:22 -0300)]
Use software watchpoints if hardware watchpoints are not available when testing gdb.base/watch-bitfields.exp
There are targets GDB thinks support hardware watchpoints, but in reality they
don't. Though it may seem that hardware watchpoint creation was successful,
the actual insertion of such watchpoint will fail when GDB moves the inferior.
(gdb) watch -location q.a^M
Hardware watchpoint 2: -location q.a^M
(gdb) PASS: gdb.base/watch-bitfields.exp: -location watch against bitfields: watch -location q.a
watch -location q.e^M
Hardware watchpoint 3: -location q.e^M
(gdb) PASS: gdb.base/watch-bitfields.exp: -location watch against bitfields: watch -location q.e
print q.a^M
$1 = 0^M
(gdb) PASS: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 0->1: print expression before
continue^M
Continuing.^M
Warning:^M
Could not insert hardware watchpoint 2.^M
Could not insert hardware watchpoint 3.^M
Could not insert hardware breakpoints:^M
You may have requested too many hardware breakpoints/watchpoints.^M
^M
(gdb) FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 0->1: continue
This leads to a number of FAILs:
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 0->1: continue
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 0->1: print expression after
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 0->5: continue
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 0->5: print expression after
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 1->0: print expression before
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.a: 1->0: continue
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 5->4: print expression before
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 5->4: continue
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q.e: 5->4: print expression after
FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: continue until exit
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 0->4: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 0->4: print expression after
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 4->10: print expression before
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 4->10: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 4->10: print expression after
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 10->3: print expression before
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 10->3: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 10->3: print expression after
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 3->2: print expression before
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 3->2: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 3->2: print expression after
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 2->1: print expression before
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 2->1: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 2->1: print expression after
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 1->0: print expression before
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: q.d + q.f + q.g: 1->0: continue
FAIL: gdb.base/watch-bitfields.exp: regular watch against bitfields: continue until exit
We can avoid these errors/FAILs by checking the board data and switching to
software watchpoints if the board does not support hardware watchpoints.
gdb/testsuite/ChangeLog:
2015-04-29 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/watch-bitfields.exp: Switch to software watchpoints if
the target does not support hardware watchpoints.
Luis Machado [Wed, 29 Apr 2015 15:09:40 +0000 (12:09 -0300)]
Handle memory write errors on gdb.base/break-always.exp
This is another case of the testcase not handling memory write errors that
happen on some targets (QEMU) when GDB attempts to modify an address that
should contain a breakpoint, for example.
The following patch handles this and prevents spurious failures from
happening. It also adds a foreach loop to avoid duplication of code
and hardcoded patterns.
gdb/testsuite/ChangeLog:
2015-04-29 Luis Machado <lgustavo@codesourcery.com>
* gdb.base/break-always.exp: Abort testing if writing to memory
causes an error.
Nick Clifton [Wed, 29 Apr 2015 15:02:02 +0000 (16:02 +0100)]
Fix problems in the sim sources discovered by running the cppcheck static analysis tool.
erc32 PR 18273
* sis.c (main): Remove unreachable code.
m68hc11 * gencode.c (gen_fetch_operands): Remove unreachable code.
ppc * hw_htab.c (htab_map_binary): Fix overlap check.
common * sim-fpu.c (INLINE_SIM_FPU): Fix static analysis warning by
increasing parenthesis around casts to signed values.
Gary Benson [Wed, 29 Apr 2015 14:20:22 +0000 (15:20 +0100)]
Allow passing fd == NULL to exec_file_find and solib_find
This commit allows NULL to be passed as the int *fd argument
to exec_file_find and solib_find to simplify use cases where
the caller does not require the file to be opened.
gdb/ChangeLog:
* solib.c (solib_find_1): Allow fd argument to be NULL.
(exec_file_find): Update comment.
(solib_find): Likewise.
* exec.c (exec_file_locate_attach): Use NULL as fd
argument to exec_file_find to avoid having to close
the opened file.
* infrun.c (follow_exec): Likewise.
Nick Clifton [Wed, 29 Apr 2015 11:26:46 +0000 (12:26 +0100)]
Add support for absolute PE/x86 relocations.
PR 17099
* coff-i386.c (coff_i386_rtype_to_howto): Allow absolute PCRLONG
relocs.
Nick Clifton [Wed, 29 Apr 2015 10:10:45 +0000 (11:10 +0100)]
Updates the description of GAS's .set directive, to note that for some targets a symbolic value can only be set once.
* doc/as.texinfo (Set): Note that a symbol cannot be set multiple
times if the expression is not constant and the target uses linker
relaxation.
Jiong Wang [Wed, 29 Apr 2015 10:04:17 +0000 (11:04 +0100)]
[ARM] Update ld testcases
2015-04-29 Renlin Li <renlin.li@arm.com>
ld/testsuite/
* ld-arm/ifunc-10.dd: Adjust expected output.
* ld-arm/ifunc-2.dd: Likewise.
Doug Evans [Wed, 29 Apr 2015 05:14:23 +0000 (22:14 -0700)]
PR python/18299
gdb/ChangeLog:
PR python/18299
* python/lib/gdb/printing.py (register_pretty_printer): Handle
name or __name__ attributes. Handle gdb module as first argument.
gdb/testsuite/ChangeLog:
* gdb.python/py-pp-maint.py: Move "replace" testing to ...
* gdb.python/py-pp-registration.exp: ... here. New file.
* gdb.python/py-pp-registration.c: New file.
* gdb.python/py-pp-registration.py: New file.
Doug Evans [Wed, 29 Apr 2015 04:53:54 +0000 (21:53 -0700)]
PR python/18089
gdb/ChangeLog:
PR python/18089
* python/py-prettyprint.c (print_children): Verify result of children
iterator. Provide better error message.
* python/python-internal..h (gdbpy_print_python_errors_p): Declare.
* python/python.c (gdbpy_print_python_errors_p): New function.
gdb/testsuite/ChangeLog:
* gdb.python/py-bad-printers.c: New file.
* gdb.python/py-bad-printers.py: New file.
* gdb.python/py-bad-printers.exp: New file.
Doug Evans [Wed, 29 Apr 2015 04:23:24 +0000 (21:23 -0700)]
* gdbtypes.h (struct cplus_struct_type) <n_baseclasses>: Fix comment.
gdb/ChangeLog:
* gdbtypes.h (struct cplus_struct_type) <n_baseclasses>: Fix comment.
Sasha Smundak [Wed, 29 Apr 2015 00:41:09 +0000 (17:41 -0700)]
Add gdb.Type.optimized_out method.
gdb/ChangeLog:
* NEWS: Mention gdb.Type.optimized_out method.
* python/py-type.c (typy_optimized_out): New function.
gdb/doc/ChangeLog:
* python.texi: New method documented.
gdb/testsuite/ChangeLog:
* gdb.python/py-type.exp: New test.
GDB Administrator [Wed, 29 Apr 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Andreas Schwab [Tue, 28 Apr 2015 18:32:06 +0000 (20:32 +0200)]
Eat newlines inside INPUT statements in linker scripts
ld/
PR ld/18344
* ldlex.l (INPUTLIST): Increment lineno on newline.
John Baldwin [Tue, 28 Apr 2015 15:30:23 +0000 (11:30 -0400)]
Use "gdb_wait.h" instead of <sys/wait.h>.
gdb/ChangeLog:
* fbsd-nat.c: Include "gdb_wait.h" instead of <sys/wait.h>.
Renlin Li [Tue, 28 Apr 2015 16:10:26 +0000 (17:10 +0100)]
[ARM]Positively emit symbols for alignment
2015-04-28 Renlin Li <renlin.li@arm.com>
gas/
* config/tc-arm.c (arm_init_frag): Always emit mapping symbols.
gas/testsuite/
* gas/arm/thumb2_vpool_be.d: Adjust the desired output.
* gas/arm/vldconst_be.d: Ditto.
Patrick Palka [Thu, 23 Apr 2015 23:28:32 +0000 (19:28 -0400)]
Disable readline's SIGWINCH handler
We no longer need it as we handle SIGWINCH ourselves. Also move the
call to init_page_info() from initialize_utils() to the latter
function's only caller, gdb_init().
gdb/ChangeLog:
* utils.c (init_page_info): Set rl_catch_sigwinch to zero.
(initialize_utils): Move call of init_page_info() to ...
* top.c (gdb_init): ... here.
Patrick Palka [Thu, 23 Apr 2015 22:36:58 +0000 (18:36 -0400)]
Update our idea of our terminal's dimensions even outside of TUI
When in the CLI, GDB's "width" and "height" variables are not kept in sync
when the underlying terminal gets resized.
This patch fixes this issue by making sure sure to update GDB's "width"
and "height" variables in the !tui_active case of our SIGWINCH handler.
gdb/ChangeLog:
* tui/tui-win.c (tui_sigwinch_handler): Remove now-stale comment.
(tui_sigwinch_handler): Still update our idea of
the terminal's width and height even when TUI is not active.
Patrick Palka [Thu, 23 Apr 2015 22:31:38 +0000 (18:31 -0400)]
Introduce function for directly updating GDB's screen dimensions
... to replace the roundabout pattern of
execute_command ("set width %d");
execute_command ("set height %d");
for doing the same thing.
gdb/ChangeLog:
* utils.h (set_screen_width_and_height): Declare.
* utils.c (set_screen_width_and_height): Define.
* tui/tui-win.c (tui_update_gdb_sizes): Use it.
Gary Benson [Tue, 28 Apr 2015 11:21:32 +0000 (12:21 +0100)]
Use exec_file_find to prepend gdb_sysroot in follow_exec
This commit updates follow_exec to use exec_file_find to prefix
the new executable's filename with gdb_sysroot rather than doing
it longhand.
gdb/ChangeLog:
* infrun.c (solist.h): New include.
(follow_exec): Use exec_file_find to prefix execd_pathname
with gdb_sysroot.
Nick Clifton [Tue, 28 Apr 2015 10:22:57 +0000 (11:22 +0100)]
Fix compile time warnings about a local variable being used before it is set.
PR 18313
* cond.c (s_if): Stop compile time warning about stopc being used
before it is set.
(s_ifc): Likewise.
Andy Wingo [Tue, 28 Apr 2015 09:15:47 +0000 (11:15 +0200)]
Fix py-parameter.exp and scm-parameter.exp path matching
gdb/testsuite/ChangeLog:
* gdb.python/py-parameter.exp:
* gdb.guile/scm-parameter.exp: Escape the path that we are
matching against, as it might contain characters that are special
to regular expressions.
Alan Modra [Tue, 28 Apr 2015 07:15:34 +0000 (16:45 +0930)]
Tidy PowerPC gold find_global_entry uses
Completely removing the assert probably wasn't the best idea, so
reinstate it for allocated sections. Also cope with debug info
potentially referring to a missing plt call stub.
And a tidy. find_global_entry now returns an Address, so make temps
holding the return value of type Address, and compare against
invalid_address.
* powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
than unsigned int for find_global_entry result temp. Compare
against invalid_address.
(Target_powerpc::do_plt_address_for_global): Likewise.
(Target_powerpc::Relocate::relocate): Likewise. Don't assert
on plt call stub existence for debug info. Do assert for plt
and global entry stub existence if an alloc section.
Alan Modra [Tue, 28 Apr 2015 03:58:29 +0000 (13:28 +0930)]
PowerPC gold assertion on missing global entry stub
Global entry stubs are used on ELFv2 to provide addresses for
functions not defined in a non-PIC executable but whose address is
taken, in much the same way as PLT stub code is used on other
targets to provide function addresses. We don't want to insert a
global entry stub just because (bogus) debug info refers to the
address of a non-local function, but we also don't want gold to die.
* powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
on missing global entry stub due to bogus debug info.
Patrick Palka [Sat, 25 Apr 2015 14:29:29 +0000 (10:29 -0400)]
TUI: avoid calling strcpy() on identical string objects
In tui_set_source_content(), when offset == 0 the source and destination
pointers of the call to strcpy() are actually the same. In this case
not only is strcpy() unnecessary but it is also UB when the two strings
overlap.
gdb/ChangeLog:
* tui/tui-source.c (tui_set_source_content): Avoid calling
strcpy() when offset is 0.
Patrick Palka [Sun, 26 Apr 2015 01:59:02 +0000 (21:59 -0400)]
Fix PR gdb/18155
For no good reason the function tui_free_window() is freeing the locator
window when we pass it an SRC_WIN or a DISASSEM_WIN. This behavior
doesn't make much sense because the locator window is always visible and
its contents do not change when the main window changes.
This behavior triggers the above PR because when we switch from one TUI
window to another (in the PR, from the src window to the asm window) we
call tui_free_window() on the previously active window (in the PR, the
src window). The function then frees the src window along with the
locator window and later we segfault when the now-active asm window
tries to query the locator window about the inferior's PC.
This patch fixes this apparently wrong behavior by changing
tui_free_window() to not free the locator window when we pass it an
SRC_WIN or a DISASSEM_WIN.
gdb/ChangeLog:
PR gdb/18155
* tui/tui-data.c (tui_free_window): Don't free the locator
window when passed an SRC_WIN or a DISASSEM_WIN.
Patrick Palka [Fri, 24 Apr 2015 12:26:50 +0000 (08:26 -0400)]
Make type-safe the 'content' field of struct tui_gen_win_info
The 'content' field of struct tui_gen_win_info currently has type
void ** but the field always stores an object of type tui_win_content.
Instead of unnecessarily casting to and from void ** we should just give
the field the type tui_win_content in the first place.
This patch does this and also eliminates all now-redundant casts
involving the 'content' struct field that I could find.
gdb/ChangeLog:
* tui/tui-data.h (struct tui_win_element): Forward-declare.
(tui_win_content): Move declaration.
(struct tui_gen_win_info): Give 'content' field the
type tui_win_content.
* tui/tui-data.c (init_content_element): Remove redundant and
erroneous casts.
(tui_add_content_elements): Remove erroneous cast.
* tui/tui-disasm.c (tui_set_disassem_content): Remove redundant
casts.
(tui_get_begin_asm_address): Likewise.
* tui/tui-regs.c (tui_show_registers): Likewise.
(tui_show_register_group): Likewise.
(tui_display_registers_from): Likewise.
(tui_check_register_values): Likewise.
* tui/tui-source.c (tui_set_source_content): Likewise.
(tui_set_source_content_nil): Likewise.
(tui_source_is_displayed): Likewise.
* tui/tui-stack.c (tui_show_locator_content): Likewise.
(tui_set_locator_fullname): Likewise.
(tui_set_locator_info): Likewise.
(tui_show_frame_info): Likewise.
* tui/tui-winsource.c (tui_clear_source_content): Likewise.
(tui_show_source_line): Likewise.
(tui_horizontal_source_scroll): Likewise.
(tui_update_breakpoint_info): Likewise.
(tui_set_exec_info_content): Likewise.
(tui_show_exec_info_content): Likewise.
(tui_alloc_source_buffer): Likewise.
(tui_line_is_displayed): Likewise.
(tui_addr_is_displayed): Likewise.
GDB Administrator [Tue, 28 Apr 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
John Baldwin [Sat, 18 Apr 2015 05:00:06 +0000 (01:00 -0400)]
Add support for catching exec events on FreeBSD.
FreeBSD kernels that support fork tracing always stop a process to
report events for exec. Such a process will have the PL_FLAG_EXEC
flag set in the pl_flags field of the ptrace_lwpinfo struct returned
by PT_LWPINFO. The structure does not include the pathname passed to
exec, so use fbsd_pid_to_exec_file to query the pathname of the
process' executable.
gdb/ChangeLog:
* fbsd-nat.c: (fbsd_wait) [PL_FLAG_EXEC]: Report TARGET_WAITKIND_EXECD
event if PL_FLAG_EXEC is set.
[PL_FLAG_EXEC] (fbsd_insert_exec_catchpoint): New function.
[PL_FLAG_EXEC] (fbsd_remove_exec_catchpoint): New function.
(fbsd_nat_add_target) [PL_FLAG_EXEC]: Set
"to_insert_exec_catchpoint" to "fbsd_insert_exec_catchpoint".
Set "to_remove_exec_catchpoint" to "fbsd_remove_exec_catchpoint".
John Baldwin [Fri, 17 Apr 2015 20:20:47 +0000 (16:20 -0400)]
Enable fork tracing for native FreeBSD targets.
Enable PT_FOLLOW_FORK on all processes. When this is enabled, both
the parent and child process stop when a fork or vfork occurs.
A target operation for wait uses PT_LWPINFO to fetch more detailed
information about the state of a stopped process. A parent process
sets the PL_FLAG_FORKED flag in the pl_flags field of the structure
returned by PT_LWPINFO as well as the pid of the new child process.
The child process sets the PL_FLAG_CHILD flag in the pl_flags field.
When a fork is detected, the wait hook waits for both processes to
report their respective events. It then reports the fork to GDB as
a single TARGET_WAITKIND_FORKED or TARGET_WAITKIND_VFORKED event.
The kernel does not guarantee the order the events are reported in.
If the parent process' event is reported first, then the wait hook
explicitly waits for the child process. If the child process' event
is reported first, the event is recorded on an internal list of
pending child events and the wait hook waits for another event.
Later when the parent process' event is reported, the parent will
use the previously-recorded child process event instead of explicitly
waiting on the child process.
To distinguish vfork events from fork events, the external process
structure for the child process is extracted from the kernel. The
P_PPWAIT flag is set in the ki_flags field of this structure if the
process was created via vfork, but it is not set for a regular fork.
gdb/ChangeLog:
* fbsd-nat.c: [PT_LWPINFO] New variable super_wait.
[TDP_RFPPWAIT] New variable fbsd_pending_children.
[TDP_RFPPWAIT] (fbsd_remember_child): New function.
[TDP_RFPPWAIT] (fbsd_is_child_pending): New function.
[TDP_RFPPWAIT] (fbsd_fetch_kinfo_proc): New function.
[PT_LWPINFO] (fbsd_wait): New function.
[TDP_RFPPWAIT] (fbsd_follow_fork): New function.
[TDP_RFPPWAIT] (fbsd_insert_fork_catchpoint): New function.
[TDP_RFPPWAIT] (fbsd_remove_fork_catchpoint): New function.
[TDP_RFPPWAIT] (fbsd_insert_vfork_catchpoint): New function.
[TDP_RFPPWAIT] (fbsd_remove_vfork_catchpoint): New function.
[TDP_RFPPWAIT] (fbsd_enable_follow_fork): New function.
[TDP_RFPPWAIT] (fbsd_post_startup_inferior): New function.
[TDP_RFPPWAIT] (fbsd_post_attach): New function.
(fbsd_nat_add_target) [PT_LWPINFO] Set "to_wait" to
"fbsd_wait".
[TDP_RFPPWAIT] Set "to_follow_fork" to "fbsd_follow_fork".
Set "to_insert_fork_catchpoint" to "fbsd_insert_fork_catchpoint".
Set "to_remove_fork_catchpoint" to "fbsd_remove_fork_catchpoint".
Set "to_insert_vfork_catchpoint" to "fbsd_insert_vfork_catchpoint".
Set "to_remove_vfork_catchpoint" to "fbsd_remove_vfork_catchpoint".
Set "to_post_startup_inferior" to "fbsd_post_startup_inferior".
Set "to_post_attach" to "fbsd_post_attach".
John Baldwin [Fri, 17 Apr 2015 18:02:03 +0000 (14:02 -0400)]
Add fbsd_nat_add_target.
Add a wrapper for add_target in fbsd-nat.c to override target operations
common to all native FreeBSD targets.
gdb/ChangeLog:
* fbsd-nat.c (fbsd_pid_to_exec_file): Mark static.
(fbsd_find_memory_regions): Mark static.
(fbsd_nat_add_target): New function.
* fbsd-nat.h: Export fbsd_nat_add_target and remove prototypes for
fbsd_pid_to_exec_file and fbsd_find_memory_regions.
* amd64fbsd-nat.c (_initialize_amd64fbsd_nat): Use fbsd_nat_add_target.
* i386fbsd-nat.c (_initialize_i386fbsd_nat): Likewise.
* ppcfbsd-nat.c (_initialize_ppcfbsd_nat): Likewise.
* sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Likewise.
Han Shen [Mon, 27 Apr 2015 22:01:44 +0000 (15:01 -0700)]
[gold] Rename '--fix-cortex-a53' to '--fix-cortex-a53-843419'.
Keep gold consistent with bfd erratum-fixing option names, so as to
ease life in Makefile/scripts.
gold/
* options.h (--fix-cortex-a53-843419): Rename option.
* aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
option.
(AArch64_relobj::scan_sections_for_stubs): Use renamed option.
Rafael Ávila de Espíndola [Mon, 27 Apr 2015 18:33:02 +0000 (14:33 -0400)]
If a range is missing, assume the input address is mapped.
When Output_section::is_input_address_mapped is called we have entries for
all dropped ranges, but not for all ranges.
Peter Bergner [Mon, 27 Apr 2015 16:06:54 +0000 (11:06 -0500)]
opcodes/
* ppc-opc.c (DCBT_EO): New define.
(powerpc_opcodes) <lbarx>: Enable for POWER8 and later.
<lharx>: Likewise.
<stbcx.>: Likewise.
<sthcx.>: Likewise.
<waitrsv>: Do not enable for POWER7 and later.
<waitimpl>: Likewise.
<dcbt>: Default to the two operand form of the instruction for all
"old" cpus. For "new" cpus, use the operand ordering that matches
whether the cpu is server or embedded.
<dcbtst>: Likewise.
gas/testsuite/
* gas/ppc/a2.s: Fixup test case due to dcbt/dcbtst embedded operand
ordering change.
* gas/ppc/a2.d: Likewise.
* gas/ppc/476.d: Likewise.
* gas/ppc/booke.s: Remove invalid 3 operand dcbt tests.
* gas/ppc/booke.d: Likewise.
* gas/ppc/power7.s: Remove lbarx, lharx, stbcx., sthcx., waitrsv
and waitimpl tests.
* gas/ppc/power7.d: Likewise.
Gary Benson [Mon, 27 Apr 2015 10:46:13 +0000 (11:46 +0100)]
Do not manipulate "target:" filenames as local paths
This commit alters two places that manipulate object file filenames
to detect "target:" filenames and to not attempt to manipulate them
as paths on the local filesystem:
- allocate_objfile is updated to not attempt to expand "target:"
filenames with gdb_abspath.
- load_auto_scripts_for_objfile is updated to not attempt to load
auto-load scripts for object files with "target:" filenames.
gdb/ChangeLog:
* objfiles.c (allocate_objfile): Do not attempt to expand name
if name is a "target:" filename.
* auto-load.c (load_auto_scripts_for_objfile): Do not attempt
to load auto-load scripts for objfiles with "target:" filenames.
Senthil Kumar Selvaraj [Mon, 27 Apr 2015 08:56:04 +0000 (14:26 +0530)]
sim: avr: Fix 'multiple definition of sim_{read,write}'
This patch does whatever was done in
https://sourceware.org/ml/gdb-patches/2015-04/msg00437.html to fix
broken gdb build for the AVR target.
Renlin Li [Mon, 27 Apr 2015 10:36:12 +0000 (11:36 +0100)]
[AArch64] Don't try to align insn in non-executale section
2015-04-27 Renlin Li <renlin.li@arm.com>
gas/
* config/tc-aarch64.c (s_aarch64_inst): Don't align code for non-text
section.
(md_assemble): Likewise, move the align code outside the loop.
Andreas Arnez [Mon, 27 Apr 2015 09:38:47 +0000 (11:38 +0200)]
S390: Vector ABI support
With the S390 vector ABI, vector registers are used for passing vector
arguments and for returning a vector. Support this ABI in inferior
function calls and when setting or retrieving a function's return
value.
gdb/ChangeLog:
* s390-linux-tdep.c: Include "elf/s390.h" and "elf-bfd.h".
(enum s390_vector_abi_kind): New enum.
(struct gdbarch_tdep)<vector_abi>: New field.
(s390_effective_inner_type): Add parameter min_size. Stop
unwrapping if the inner type is smaller than min_size.
(s390_function_arg_float): Adjust call to
s390_effective_inner_type.
(s390_function_arg_vector): New function.
(s390_function_arg_integer): Adjust comment.
(struct s390_arg_state)<vr>: New field.
(s390_handle_arg): Add parameter 'is_unnamed'. Pass vector
arguments according to vector ABI when appropriate.
(s390_push_dummy_call): Initialize the argument state's field
'vr'. Adjust calls to s390_handle_arg.
(s390_register_return_value): Handle vector return values.
(s390_return_value): Apply the "register" return value convention
to a vector when appropriate.
(s390_gdbarch_init): Initialize tdep->vector_abi.
* NEWS: Announce S390 vector ABI support.
Andreas Arnez [Mon, 27 Apr 2015 09:38:47 +0000 (11:38 +0200)]
S390: Re-arrange implementation of s390_return_value
Move related logic in the implementation of s390_return_value closer
together. This makes it easier to read and extend.
gdb/ChangeLog:
* s390-linux-tdep.c (s390_return_value_convention): Remove
function. Inline its logic...
(s390_return_value): ...here. Instead, move the handling of the
"register" return value convention...
(s390_register_return_value): ...here. New function.
Andreas Arnez [Mon, 27 Apr 2015 09:38:46 +0000 (11:38 +0200)]
S390: Restructure s390_push_dummy_call
Simplify the structure of s390_push_dummy_call and its various helper
functions. This reduces the code and makes it easier to extend. The
new code should be functionally equivalent to the old one, except that
copies created by the caller are now always aligned on an 8-byte
boundary.
gdb/ChangeLog:
* s390-linux-tdep.c
(is_float_singleton): Remove function. Move the "singleton" part
of the logic...
(s390_effective_inner_type): ...here. New function.
(is_float_like): Remove function. Inline its logic...
(s390_function_arg_float): ...here.
(is_pointer_like, is_integer_like, is_struct_like): Remove
functions. Inline their logic...
(s390_function_arg_integer): ...here.
(s390_function_arg_pass_by_reference): Remove function.
(extend_simple_arg): Remove function.
(alignment_of): Remove function.
(struct s390_arg_state): New structure.
(s390_handle_arg): New function.
(s390_push_dummy_call): Move parameter placement logic to the new
function s390_handle_arg. Call it for calculating the stack area
sizes first, and again for actually writing the parameters.
Andreas Arnez [Mon, 27 Apr 2015 09:38:46 +0000 (11:38 +0200)]
S390: For zero, let is_power_of_two() return false
This fixes a minor issue with the helper function is_power_of_two(),
which returned non-zero ("true") if the argument was zero. This led
to a wrong decision when passing a zero-sized struct in an inferior
function call.
gdb/ChangeLog:
* s390-linux-tdep.c (is_power_of_two): Add comment. Return
false if the argument is zero.
Pierre-Marie de Rodat [Mon, 27 Apr 2015 09:06:07 +0000 (11:06 +0200)]
[Ada] Cache all static structures and reset cache during resolution
Currently, ada-lang.c:template_to_static_fixed_type (working on
structure types only) caches its result into the unused TYPE_TARGET_TYPE
field. This introduces inconsistencies when the input type is
specialized, for instance during type resolution: the cached static
fixed type is copied along with the original type, but it's no longer
adapted to the copy once the copy is modified:
template_to_static_fixed_type has to compute another static fixed type
for it.
This change first introduces a cache reset during type resolution for
structure types so that this inconsistency does not happen anymore. It
also makes template_to_static_fixed_type smarter with respect to types
that do not need static fixed copies so that less computations is done
in general.
This inconsistency was spotted thanks to code reading, not because of
any sort of failure and we did not manage to exhibit a failure yet, so
no testcase for this.
gdb/ChangeLog:
* ada-lang.c (template_to_static_fixed_type): Return input type
when it is already fixed. Cache the input type itself when not
creating a static fixed copy. Make it explicit that we never
molestate the input type.
* gdbtypes.c (resolve_dynamic_struct): Reset the
TYPE_TARGET_TYPE field for resolved copies.
Joel Brobecker [Mon, 27 Apr 2015 09:04:47 +0000 (11:04 +0200)]
[Ada] Preserve typedef layer when getting struct element
Consider the following declarations:
type Int_Access is access Integer;
type Record_Type is record
IA : Int_Access;
end record;
R : Record_Type;
Printing the type name of "R.IA" yields:
(gdb) whatis r.ia
type = access integer
It should be:
(gdb) whatis r.ia
type = bar.int_access
Looking at the debugging info, field "r.ia" is defined as
a typedef which has the name of the field type:
.uleb128 0x3 # (DIE (0x4e) DW_TAG_typedef)
.long .LASF4 # DW_AT_name: "bar__int_access"
.long 0x8b # DW_AT_type
... with the typedef's target type being an anonymous pointer
type:
.uleb128 0x7 # (DIE (0x8b) DW_TAG_pointer_type)
.byte 0x8 # DW_AT_byte_size
.long 0x91 # DW_AT_type
What happens here is that a couple of function in ada-lang.c
always start by stripping all typedef layers when handling
struct fields, with the effect of making us lose the type name
in this case.
We did not understand this at the time the code was written,
but typedefs should be stripped only when we know we do not
need them. So this patch, adjust the code to avoid the stripping
while handling the fields, and adds it back in the lone place
which handles the result of processing and didn't know how to
handle typedefs struct fields yet.
gdb/ChangeLog:
* ada-lang.c (ada_is_tagged_type): Add call to ada_check_typedef.
(ada_lookup_struct_elt_type): Remove calls to ada_check_typedef.
(template_to_static_fixed_type): Call ada_check_typedef only
when necessary.
gdb/testsuite/ChangeLog:
* gdb.ada/rec_comp: New testcase.
Andreas Krebbel [Mon, 27 Apr 2015 08:32:23 +0000 (10:32 +0200)]
S/390: z13 use GNU attribute to indicate vector ABI
bfd/
* elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
* elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
elf_s390_merge_obj_attributes.
* elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.
binutils/
* readelf.c (display_s390_gnu_attribute): New function.
(process_s390_specific): New function.
(process_arch_specific): Call process_s390_specific.
gas/
* doc/as.texinfo: Document Tag_GNU_S390_ABI_Vector.
include/elf/
* s390.h: Define Tag_GNU_S390_ABI_Vector.
Andreas Krebbel [Mon, 27 Apr 2015 08:29:16 +0000 (10:29 +0200)]
S/390: Fixes for z13 instructions.
opcodes/
* s390-opc.c: New instruction type VV0UU2.
* s390-opc.txt: Fix instruction types for VFCE, VLDE, VFSQ, WFK,
and WFC.
gas/testsuite/
* gas/s390/zarch-z13.d: Fix tests for VFCE, VLDE, VFSQ, WFK, and
WFC.
* gas/s390/zarch-z13.s: Likewise.
Andreas Krebbel [Mon, 27 Apr 2015 08:24:24 +0000 (10:24 +0200)]
S/390: Fix gotreloc_31-1 testcase.
Since we changed the default arch for objdump to zarch the following
testcase needs to check for the real instruction mnemonics instead of
just bytes.
This fixes the following testsuite fail on s390x:
FAIL: GOT: symbol address load from got to larl
GDB Administrator [Mon, 27 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Sergio Durigan Junior [Sun, 26 Apr 2015 19:34:29 +0000 (15:34 -0400)]
Clear variable "coredump_var_addr" before using it on gdb.base/coredump-filter.exp
This commit is a continuation of the fix committed on:
commit
8cd8f2f8ac49276437b7da37f275706ea1c1c925
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date: Mon Apr 13 02:40:08 2015 -0400
Rename variable "addr" to "coredump_var_addr" in gdb.base/coredump-filter.exp
Pedro pointed out that this fix was not complete, because the
testsuite could be run several times in a row (for example), which
means that it is not enough to just make the variable name unique: it
also needs to be cleared out if it is global.
This commit does that. It is actually just a commit made to make
things totally correct; this specific test does not fail if you run it
several times in a row.
gdb/testsuite/ChangeLog:
2015-04-26 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/coredump-filter.exp: Clear variable "coredump_var_addr"
before using it.
GDB Administrator [Sun, 26 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 25 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Fri, 24 Apr 2015 09:49:37 +0000 (19:19 +0930)]
Non-alloc sections don't belong in PT_LOAD segments
Taking them out showed a bug in the powerpc64 backend with .branch_lt
being removed from output_bfd but not from previously set up segment
section maps. Removing the bfd sections meant their sh_flags (and
practically everything else) remaining zero, ie. not SHF_ALLOC,
triggering complaints about "`.branch_lt' can't be allocated in
segment".
include/elf/
* internal.h (ELF_SECTION_IN_SEGMENT_1): Ensure PT_LOAD and
similar segments only contain alloc sections.
ld/
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation):
Call gld${EMULATION_NAME}_map_segments regardless of need_laying_out.
ld/testsuite/
* ld-powerpc/tocnovar.d: Revert last change.
Jiong Wang [Fri, 24 Apr 2015 22:25:28 +0000 (23:25 +0100)]
[AArch64] PR18270, fix handling of GOT entry for local symbol
2015-04-24 Jiong. Wang <jiong.wang@arm.com>
bfd/
PR ld/18270
* elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
GOT_NORMAL for both sgot/srelgot section.
(elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
and generate necessary runtime relocation for GOT entry.
H.J. Lu [Fri, 24 Apr 2015 22:02:56 +0000 (15:02 -0700)]
Copy is_linker_input to archive member
We must copy is_linker_input to archive member.
PR binutils/18209
* archive.c (_bfd_get_elt_at_filepos): Also copy is_linker_input.
Andrew Burgess [Thu, 23 Apr 2015 21:18:55 +0000 (22:18 +0100)]
gdb: Add internationalization support to a few strings.
Spotted a few strings that were missing internationalization support.
gdb/ChangeLog:
* cli/cli-dump.c (srec_dump_command): Add internationalization
mark ups.
(ihex_dump_command): Likewise.
(tekhex_dump_command): Likewise.
(binary_dump_command): Likewise.
(binary_append_command): Likewise.
Andrew Burgess [Wed, 22 Apr 2015 21:52:36 +0000 (22:52 +0100)]
gdb: Add support for dumping to verilog hex format.
Extend the gdb 'dump' command to allow creating output in verilog hex
format. Add some tests to cover new functionality. As bfd does not
currently support reading in verilog hex formats the tests only cover
the 'dump' command, not the 'restore' command.
gdb/ChangeLog:
* cli/cli-dump.c (verilog_cmdlist): New variable.
(dump_verilog_memory): New function.
(dump_verilog_value): New function.
(verilog_dump_command): New function.
(_initialize_cli_dump): Add new commands to support verilog dump
format.
* NEWS: Add entry for "dump verilog".
gdb/doc/ChangeLog:
* gdb.texinfo (Dump/Restore Files): Add detail about verilog dump
format.
gdb/testsuite/ChangeLog:
* gdb.base/dump.exp: Add *.verilog files to all_files list. Add
new tests for verilog output.
Jiong Wang [Fri, 24 Apr 2015 21:35:04 +0000 (22:35 +0100)]
[AArch64] Improve PC-relative relocation check for shared library
2015-04-24 Jiong. Wang <jiong.wang@arm.com>
bfd/
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
PC-relative relocation for external symbol.
ld/testsuite/
* ld-aarch64/pcrel.s: New testcase.
* ld-aarch64/pcrel_pic_defiend_local.d: New expect file.
* ld-aarch64/pcrel_pic_undefined.d: Ditto.
* ld-aarch64/aarch64-elf.exp: Run them.
DJ Delorie [Fri, 24 Apr 2015 21:17:02 +0000 (17:17 -0400)]
Fix typo
DJ Delorie [Fri, 24 Apr 2015 21:05:13 +0000 (17:05 -0400)]
Change msp430 emulation to msp430elf
* Makefile.am (msp430): Rename primary emulation to msp430elf.
(emsp430.c): Rename to emsp430elf.c, update dependencies
(emsp430X.c): Update dependencies.
* Makefile.in: Likewise.
* configure.tgt (msp430-*-*): Rename primary emulation to msp430elf.
* emulparame/msp430.sh: Rename to msp430elf.sh.
* emulparams/msp430X.sh: Update.
Jim Wilson [Fri, 24 Apr 2015 20:38:25 +0000 (13:38 -0700)]
gas thunderx support
gas/
* config/tc-aarch64.c (aarch64_cpus): Add CRC and CRYPTO features
for thunderx.
Doug Evans [Fri, 24 Apr 2015 18:16:12 +0000 (11:16 -0700)]
* python.texi (Xmethods In Python): Fix name of method to call the xmethod.
gdb/doc/ChangeLog:
* python.texi (Xmethods In Python): Fix name of method to call the
xmethod.
Nick Clifton [Fri, 24 Apr 2015 16:13:22 +0000 (17:13 +0100)]
Fix compile time warning messages about variables being used before they are initialised.
PR 18313
bin * ieee.c (ieee_read_cxx_class): Initialise the varargs variable.
* readelf.c (uncompress_section_contents): Zero initialise the
zstream structure.
bfd * compress.c (decompress_contents): Zero initialse the z_stream
structure.
Richard Earnshaw [Fri, 24 Apr 2015 14:51:49 +0000 (15:51 +0100)]
[ARM]: Don't tail-pad over-aligned functions to the alignment boundary.
2015-04/24 Richard Earnshaw <rearnsha@arm.com>
gas/
* config/tc-arm.h (arm_min): New function.
(SUB_SEGMENT_ALIGN): Define.
gas/testsuite/
* gas/arm/align64.d: Delete trailing padding NOPs.
ld/testsuite/
* ld-arm/armthumb-lib.d: Regenerate expected output.
* ld-arm/armthumb-lib.d: Likewise.
* ld-arm/armthumb-lib.sym: Likewise.
* ld-arm/cortex-a8-fix-b-rel-arm.d: Likewise.
* ld-arm/cortex-a8-fix-b-rel-thumb.d: Likewise.
* ld-arm/cortex-a8-fix-b.d: Likewise.
* ld-arm/cortex-a8-fix-bcc-rel-thumb.d: Likewise.
* ld-arm/cortex-a8-fix-bcc.d: Likewise.
* ld-arm/cortex-a8-fix-bl-rel-arm.d: Likewise.
* ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bl-rel-thumb.d: Likewise.
* ld-arm/cortex-a8-fix-bl.d: Likewise.
* ld-arm/cortex-a8-fix-blx-bcond.d: Likewise.
* ld-arm/cortex-a8-fix-blx-rel-arm.d: Likewise.
* ld-arm/cortex-a8-fix-blx-rel-thumb.d: Likewise.
* ld-arm/cortex-a8-fix-blx.d: Likewise.
* ld-arm/cortex-a8-fix-hdr.d: Likewise.
* ld-arm/farcall-mixed-app-v5.d: Likewise.
* ld-arm/farcall-mixed-app.d: Likewise.
* ld-arm/farcall-mixed-lib-v4t.d: Likewise.
* ld-arm/farcall-mixed-lib.d: Likewise.
* ld-arm/mixed-app-v5.d: Likewise.
* ld-arm/mixed-app.d: Likewise.
* ld-arm/mixed-lib.d: Likewise.
Nick Clifton [Fri, 24 Apr 2015 14:43:21 +0000 (15:43 +0100)]
Fix typos in sim sources exposed by static analysis.
bfin PR 18273
* bfin-sim.c (decode_dsp32alu_0): Remove spurious check for
s == 1.
erc32 PR 18273
* exec.c (add32): Fix typo in check for overflow.
igen PR 18273
* misc.c (a2i): Fix typos checking for uppercase letters.
Nick Clifton [Fri, 24 Apr 2015 14:31:36 +0000 (15:31 +0100)]
Fix typo in check for valid register number in RX sim.
PR sim/18273
* reg.c (put_reg): Fix check for valid register number.
Nick Clifton [Fri, 24 Apr 2015 14:17:13 +0000 (15:17 +0100)]
Extend test for local labels to include fake symbols and local labels with a numeric suffix.
* elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
local labels to include local labels with a numeric suffix and
fake symbols.
Pierre-Marie de Rodat [Fri, 24 Apr 2015 14:13:19 +0000 (16:13 +0200)]
Fix printing for GNAT stuff for types that do not have descr. types
gdb/ChangeLog:
2015-04-24 Pierre-Marie de Rodat <derodat@adacore.com>
* gdbtypes.c (print_gnat_stuff): Do not recurse on the
descriptive type when there is none.
H.J. Lu [Fri, 24 Apr 2015 12:40:23 +0000 (05:40 -0700)]
Define SEC_MEP_VLIW in bfd/section.c
Bits in section flags should only be defined in bfd/section.c. This
patch moves SEC_MEP_VLIW to bfd/section.c.
bfd/
PR binutils/18316
* section.c (SEC_MEP_VLIW): New.
* bfd-in2.h: Regenerated.
include/elf/
PR binutils/18316
* mep.h (SEC_MEP_VLIW): Removed.
Yao Qi [Fri, 24 Apr 2015 10:00:14 +0000 (11:00 +0100)]
A new board file remote-gdbserver-on-localhost.exp
This patch is to add a new board file that does real remote gdbserver
testing on localhost. This board file can be used to reproduce PR 18208.
gdb/testsuite
2015-04-24 Yao Qi <yao.qi@linaro.org>
* boards/remote-gdbserver-on-localhost.exp: New file.
Nick Clifton [Fri, 24 Apr 2015 09:15:41 +0000 (10:15 +0100)]
Skip the compressed1d test for targets which do not use the elf32.em linker emulation file.
* ld-elf/compressed1d.d: Add notarget for ELF based targets that
do not use elf.em.
Hans-Peter Nilsson [Fri, 24 Apr 2015 04:10:19 +0000 (06:10 +0200)]
Correct ld-elf/compressed1e.d to use notarget and for cris-elf, not cris-*.
Don't XPASS cris-linux which *does* support -shared.
And xfail is for bugs, notarget is for not-applicable.
H.J. Lu [Fri, 24 Apr 2015 01:58:46 +0000 (18:58 -0700)]
Xfail cris and frv for ld-elf/compressed1e.d
cris and frv don't support -shared.
* ld-elf/compressed1e.d: Only run for Linux/gnu. Xfail cris and
frv.
GDB Administrator [Fri, 24 Apr 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Thu, 23 Apr 2015 23:37:44 +0000 (16:37 -0700)]
Delay setting up compressed debug section names
When we set up st_name for output section name in elf_fake_sections, we
don't know if the compressed DWARF debug section will be smaller. We may
end up with compressed DWARF debug sections which are bigger than the
uncompressed ones. This patch delays setting up st_name for output DWARF
debug section to _bfd_elf_assign_file_positions_for_non_load which will
compress the output debug section. We also postpone placement of shstrtab
section after DWARF debug sections have been compressed. The net effect
is .shstrtab section is now placed after .symtab and .strtab sections.
bfd/
PR ld/18277
* compress.c (bfd_compress_section_contents): Remove the
write_compress argument.
(bfd_init_section_compress_status): Updated.
(bfd_compress_section): Likewise.
* elf.c (_bfd_elf_set_reloc_sh_name): New.
(_bfd_elf_init_reloc_shdr): Add delay_st_name_p. Set sh_name
to (unsigned int) -1 if delay_st_name_p is TRUE. Use
_bfd_elf_set_reloc_sh_name.
(elf_fake_sections): Don't rename DWARF debug section for
linker output if it will be compressed. Instead, set
delay_st_name_p to TRUE and pass it to _bfd_elf_init_reloc_shdr.
(assign_section_numbers): Call _bfd_elf_strtab_addref only if
sh_name != (unsigned int) -1. Don't finalize nor assign
shstrtab section here. Delay setting output section names to
_bfd_elf_write_object_contents.
(_bfd_elf_compute_section_file_positions): Update comments on
sh_offset for shstrtab section.
(assign_file_positions_for_non_load_sections): Set sh_offset to
-1 for shstrtab section.
(assign_file_positions_except_relocs): Likewise.
(_bfd_elf_assign_file_positions_for_non_load): Set up sh_name
when compressing DWARF debug sections. Place shstrtab section
after DWARF debug sections have been compressed.
(_bfd_elf_write_object_contents): Setting sh_name for output
sections.
ld/testsuite/
PR ld/18277
* ld-elf/compressed1d.d: New.
* ld-elf/compressed1e.d: Likewise.
Matthew Fortune [Thu, 23 Apr 2015 19:09:13 +0000 (20:09 +0100)]
Improve warning messages for la/dla
gas/
* config/tc-mips.c (macro): State the recommended way of creating
32-bit or 64-bit addresses.
gas/testsuite/
* gas/mips/dla-warn.l: New file.
* gas/mips/dla-warn.s: New file.
* gas/mips/la-warn.l: New file.
* gas/mips/la-warn.s: New file.
* gas/mips/mips.exp: Run new tests.
Sriraman Tallam [Thu, 23 Apr 2015 20:56:40 +0000 (13:56 -0700)]
Add option --weak-unresolved-symbols to treat unresolved symbols as weak ref.
This patch adds option --weak-unresolved-symbols to treat unresolved symbols as
weak references. This is helpful when we want the link to succeed with unresolved
symbols and the dynamic loader to not complain at run-time. Option
--warn-unresolved-symbols lets the link succeed but could fail at run-time with
unresolved symbol warnings especially when the unresolved symbols have GOT entries
and dynamic relocations against them, like when -fPIE is used.
Sriraman Tallam [Thu, 23 Apr 2015 20:48:24 +0000 (13:48 -0700)]
Add option --weak-unresolved-symbols to treat unresolved as weak references.
This patch adds option --weak-unresolved-symbols to treat unresolved symbols as
weak references. This is helpful when we want the link to succeed with unresolved
symbols and the dynamic loader to not complain at run-time. Option
--warn-unresolved-symbols lets the link succeed but could fail at run-time with
unresolved symbol warnings especially when the unresolved symbols have GOT entries
and dynamic relocations against them, like when -fPIE is used.
2015-04-23 Sriraman Tallam <tmsriram@google.com>
* options.h (--weak-unresolved-symbols): New option.
* symtab.cc (Symbol_table::sized_write_globals): Change symbol
binding to weak with new option.
* symtab.h (is_weak_undefined): Check for new option.
(is_strong_undefined): Check for new option.
* testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/weak_unresolved_symbols_test.cc: New file.
Matthew Fortune [Thu, 23 Apr 2015 19:10:50 +0000 (20:10 +0100)]
Fix r6-branch-constraints test when run with n64 as default ABI
gas/testsuite/
* gas/mips/mips.exp: Require o32 for r6-branch-constraints.
H.J. Lu [Thu, 23 Apr 2015 14:58:05 +0000 (07:58 -0700)]
Don't change compressed input debug section names
Change compressed input debug section name for objdump is very confusing.
But we need to change it for linker so that linker will consider the
input section as a debug section. This patch delays section rename to
elf_fake_sections for objcopy and avoids it for objdump.
bfd/
PR binutils/18209
* bfd.c (bfd): Add is_linker_input.
* elf.c (convert_debug_to_zdebug): New.
(convert_zdebug_to_debug): Likewise.
(_bfd_elf_make_section_from_shdr): Don't convert .debug_* to
.zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME.
(_bfd_elf_init_reloc_shdr): Pass a pointer to section name
instead of a pointer to section.
(elf_fake_sections): Rename the section name if SEC_ELF_RENAME
is set.
* section.c (SEC_ELF_RENAME): New.
* bfd-in2.h: Regenerated.
binutils/
PR binutils/18209
* objcopy.c (setup_section): Copy compress status.
binutils/testsuite/
PR binutils/18209
* binutils-all/compress.exp: Replace dw2-3.W with dw2-3gabi.W
on zlib-gabi output.
* binutils-all/dw2-1.W: Convert section names to .zdebug_*.
* binutils-all/dw2-3.W: Likewise.
* binutils-all/objdump.W: Likewise.
* binutils-all/dw2-3gabi.W: New file.
ld/
PR binutils/18209
* ldfile.c (ldfile_try_open_bfd): Set is_linker_input to 1.
Pedro Alves [Thu, 23 Apr 2015 14:48:27 +0000 (15:48 +0100)]
Fix gdb.base/interrupt.exp racy fail against gdbserver
Currently, against gdbserver, interrupt.exp occasionaly fails like
this:
ERROR: Process no longer exists
UNRESOLVED: gdb.base/interrupt.exp: send end of file
The problem is that we see gdbserver exiting before we match gdb's
output:
expect: does "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n" (spawn_id exp8) match regular expression "end of file"? Gate "end of file"? gate=no
expect: read eof
expect: set expect_out(spawn_id) "exp8"
expect: set expect_out(buffer) "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n"
Fix this by removing $inferior_spawn_id from the set of spawn ids
expect is watching as soon as we see the "end of file" string out of
the inferior spawn id, using an indirect spawn id list.
Tested on x86-64 Fedora 20, native and gdbserver (both target remote
and extended-remote).
gdb/testsuite/ChangeLog:
2015-04-23 Pedro Alves <palves@redhat.com>
* gdb.base/interrupt.exp: Use an indirect spawn id list holding
$inferior_spawn_id instead of $inferior_spawn_id directly. On
"end of file", remove $inferior_spawn_id from the indirect list.
Pedro Alves [Thu, 23 Apr 2015 14:48:27 +0000 (15:48 +0100)]
gdb.base/interrupt.exp: Rename saw_eof to saw_end_of_file
To avoid confusion between "end of file" string matching and eof
matching, as in process exit.
gdb/testsuite/ChangeLog:
2015-04-23 Pedro Alves <palves@redhat.com>
* gdb.base/interrupt.exp: Rename saw_eof to saw_end_of_file.
Pedro Alves [Thu, 23 Apr 2015 14:48:26 +0000 (15:48 +0100)]
gdb_test_multiple match eof of any spawn_id
Since silent handling of eof is usually the wrong thing to do, this
patch makes gdb_test_multiple handle it for all $any_spawn_id.
Currently, against gdbserver, interrupt.exp occasionaly fails like
this:
FAIL: gdb.base/interrupt.exp: send end of file
gdb.log with expect debug output enabled shows:
expect: does "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n" (spawn_id exp8) match regular expression "end of file"? Gate "end of file"? gate=no
expect: read eof
expect: set expect_out(spawn_id) "exp8"
expect: set expect_out(buffer) "\r\n\r\nChild exited with status 0\r\nGDBserver exiting\r\n"
FAIL: gdb.base/interrupt.exp: send end of file
Note "expect: read eof" for spawn_id=exp8. exp8 is
inferior_spawn_id/gdbserver_spawn_id. That means
expect/gdb_test_multiple saw gdbserver exit before we got the expected
gdb output. Since there's no explicit pattern for "eof", expect (and
thus gdb_test_multiple) just returns.
After this commit, we get instead:
ERROR: Process no longer exists
UNRESOLVED: gdb.base/interrupt.exp: send end of file
Note that before we still got an FAIL because $saw_inferior_exit is 0
when we get to:
gdb_assert { $saw_eof && $saw_inferior_exit } $msg
Fixing the fail (now unresolved) will be the subject of a separate
patch.
gdb/testsuite/ChangeLog:
2015-04-23 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_test_multiple): Match eof/full_buffer/timeout
on $any_spawn_id instead of only on $gdb_spawn_id.
Jan Beulich [Thu, 23 Apr 2015 14:42:40 +0000 (16:42 +0200)]
x86: disambiguate disassembly of certain AVX512 insns
Certain conversion operations as well as vfpclassp{d,s} are ambiguous
when the input operand is in memory and no broadcast is being used.
While in Intel mode this gets resolved by printing suitable operand
size modifiers, AT&T mode need mnemonic suffixes to be added.
gas/testsuite/
2015-04-23 Jan Beulich <jbeulich@suse.com>
* gas/i386/avx512dq.d: Add 'z' suffix to vfpclassp{d,s} non-
register, non-broadcast cases.
* gas/i386/x86-64-avx512dq.d: Likewise.
* gas/i386/avx512dq_vl.d: Add 'x' and 'y' suffixes to
vcvt{,u}qq2ps and vfpclassp{d,s} non-register, non-broadcast
cases.
* gas/i386/x86-64-avx512dq_vl.d: Likewise.
* gas/i386/avx512f_vl.d: Add 'x' and 'y' suffixes to
vcvt{,t}pd2{,u}dq and vcvtpd2ps non-register, non-broadcast
cases.
* gas/i386/x86-64-avx512f_vl.d: Likewise.
opcodes/
2015-04-23 Jan Beulich <jbeulich@suse.com>
* i386-dis.c (putop): Extend "XY" handling to AVX512. Handle "XZ".
* i386-dis-evex.h.c (vcvtpd2ps, vcvtqq2ps, vcvttpd2udq,
vcvtpd2udq, vcvtuqq2ps, vcvttpd2dq, vcvtpd2dq): Add %XY.
(vfpclasspd, vfpclassps): Add %XZ.
Jan Beulich [Thu, 23 Apr 2015 14:41:21 +0000 (16:41 +0200)]
x86: don't require operand size specification for AVX512 broadcasts
Certain conversion operations as well as vfpclassp{d,s} are ambiguous
when the input operand is in memory. That ambiguity, however, doesn't
apply when using broadcasts (the destination operand size can be
induced from the broadcast specifier).
gas/
2015-04-23 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (match_mem_size): Also allow no size
specification when broadcasting.
gas/testsuite/
2015-04-23 Jan Beulich <jbeulich@suse.com>
* gas/i386/avx512dq.s: Drop 'z' suffix from vfpclassp{d,s} in
some AT&T and all Intel cases.
* gas/i386/x86-64-avx512dq.s: Likewise.
* gas/i386/avx512dq_vl.s: Drop 'x' and 'y' suffixes from
vcvt{,u}qq2ps and vfpclassp{d,s} in some AT&T and all Intel
cases.
* gas/i386/x86-64-avx512dq_vl.s: Likewise.
* gas/i386/avx512f_vl.s: Drop 'x' and 'y' suffixes from
vcvt{,t}pd2{,u}dq and vcvtpd2ps in some AT&T and all Intel
cases.
* gas/i386/x86-64-avx512f_vl.s: Likewise.