binutils-gdb.git
8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Jun 2016 00:00:17 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd support for .MIPS.abiflags and .gnu.attributes sections.
Vladimir Radosavljevic [Fri, 10 Jun 2016 22:50:13 +0000 (15:50 -0700)]
Add support for .MIPS.abiflags and .gnu.attributes sections.

elfcpp/
* elfcpp.h (SHT_MIPS_ABIFLAGS): New enum constant.
* mips.h (EF_MIPS_FP64, EF_MIPS_NAN2008): New enum constants for
processor-specific flags.
(E_MIPS_MACH_5900): New enum constant for machine variant.
(AFL_REG_NONE, AFL_REG_32, AFL_REG_64, AFL_REG_128): New enum
constants.
(AFL_ASE_DSP, AFL_ASE_DSPR2, AFL_ASE_EVA, AFL_ASE_MCU,
AFL_ASE_MDMX, AFL_ASE_MIPS3D, AFL_ASE_MT, AFL_ASE_SMARTMIPS,
AFL_ASE_VIRT, AFL_ASE_MSA, AFL_ASE_MIPS16, AFL_ASE_MICROMIPS,
AFL_ASE_XPA): Likewise.
(AFL_EXT_XLR, AFL_EXT_OCTEON2, AFL_EXT_OCTEONP,
AFL_EXT_LOONGSON_3A, AFL_EXT_OCTEON, AFL_EXT_5900, AFL_EXT_4650,
AFL_EXT_4010, AFL_EXT_4100, AFL_EXT_3900, AFL_EXT_10000,
AFL_EXT_SB1, AFL_EXT_4111, AFL_EXT_4120, AFL_EXT_5400,
AFL_EXT_5500, AFL_EXT_LOONGSON_2E, AFL_EXT_LOONGSON_2F,
AFL_EXT_OCTEON3): Likewise.
(Tag_GNU_MIPS_ABI_FP, Tag_GNU_MIPS_ABI_MSA): Likewise.
(Val_GNU_MIPS_ABI_FP_ANY, Val_GNU_MIPS_ABI_FP_DOUBLE,
Val_GNU_MIPS_ABI_FP_SINGLE, Val_GNU_MIPS_ABI_FP_SOFT,
Val_GNU_MIPS_ABI_FP_OLD_64,Val_GNU_MIPS_ABI_FP_XX,
Val_GNU_MIPS_ABI_FP_64, Val_GNU_MIPS_ABI_FP_64A,
Val_GNU_MIPS_ABI_FP_NAN2008, Val_GNU_MIPS_ABI_MSA_ANY,
Val_GNU_MIPS_ABI_MSA_128): Likewise.
(AFL_FLAGS1_ODDSPREG): New enum constant.
gold/
* mips.cc (struct Mips_abiflags): New struct.
(Mips_relobj::Mips_relobj): Initialize attributes_section_data_
and abiflags_.
(Mips_relobj::~Mips_relobj): Delete object pointed by
attributes_section_data_.
(Mips_relobj::abiflags): New method.
(Mips_relobj::attributes_section_data): Likewise.
(Mips_relobj::attributes_section_data_): New data member.
(Mips_relobj::abiflags_): Likewise.
(class Mips_output_section_abiflags): New class.
(Target_mips::Target_mips): Initialize attributes_section_data_,
abiflags_ and has_abiflags_section_.
(Target_mips::do_should_include_section): Don't emit input
.MIPS.abiflags sections to output .MIPS.abiflags.
(Target_mips::Mips_mach): Add new enum constants.
(Target_mips::mips_isa_ext_mach): New method.
(Target_mips::mips_isa_ext): Likewise.
(Target_mips::update_abiflags_isa): Likewise.
(Target_mips::infer_abiflags): Likewise.
(Target_mips::create_abiflags): Likewise.
(Target_mips::fp_abi_string): Likewise.
(Target_mips::select_fp_abi): Likewise.
(Target_mips::merge_obj_attributes): Likewise.
(Target_mips::merge_obj_abiflags): Likewise.
(Target_mips::level_rev): Likewise.
(Target_mips::merge_obj_e_flags): Rename from
merge_processor_specific_flags. Remove dyn_obj argument,
call update_abiflags_isa when needed, compare NaN encodings and
compare FP64 state.
(Target_mips::add_machine_extensions): Add two machine extensions
and fix one.
(Target_mips::attributes_section_data_): New data member.
(Target_mips::abiflags_): Likewise.
(Target_mips::has_abiflags_section_): Likewise.
(Mips_relobj::do_read_symbols): Read .gnu.attributes and
.MIPS.abiflags sections if they exists.
(Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
E_MIPS_MACH_OCTEON3 support.
(Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
(Target_mips::do_finalize_sections): Merge .gnu.attributes and
.MIPS.abiflags sections from input. Create these sections if
needed.
(Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
E_MIPS_MACH_OCTEON3 support, and change strings for
E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
to match bfd.

8 years agosparc-coff writing uninitialized memory
Alan Modra [Sat, 11 Jun 2016 05:19:49 +0000 (14:49 +0930)]
sparc-coff writing uninitialized memory

sparc-coff has a 20 byte symbol entry with an extra field, but neglects
to initialize the field.  Fix that.

* coff/sparc.h (COFF_ADJUST_SYM_OUT_POST): Define.

8 years agoUse size_t rather than bfd_size_type
Alan Modra [Sat, 11 Jun 2016 07:52:55 +0000 (17:22 +0930)]
Use size_t rather than bfd_size_type

I noticed when writing _bfd_elf_strtab_save/restore that size_t would
be better than bfd_size_type for a number of things in elf-strtab.c.
Using a 64-bit bfd_size_type on a 32-bit host doesn't make much sense
for array sizes and indices.

* elf-strtab.c (struct strtab_save): Use size_t for "size".
(struct elf_strtab_hash): Likewise for "size" and "alloced".
(_bfd_elf_strtab_init): Formatting.
(_bfd_elf_strtab_add): Return size_t rather than bfd_size_type.
(_bfd_elf_strtab_addref): Take size_t idx param.
(_bfd_elf_strtab_delref, _bfd_elf_strtab_refcount): Likewise.
(_bfd_elf_strtab_offset): Likewise.
(_bfd_elf_strtab_clear_all_refs): Use size_t idx.
(_bfd_elf_strtab_save): Use size_t "idx" and "size" vars.
(_bfd_elf_strtab_restore, _bfd_elf_strtab_emit): Similarly.
(_bfd_elf_strtab_finalize): Similarly.
* elf-bfd.h (_bfd_elf_strtab_add): Update prototypes.
(_bfd_elf_strtab_addref, _bfd_elf_strtab_delref): Likewise.
(_bfd_elf_strtab_refcount, _bfd_elf_strtab_offset): Likewise.
* elf.c (bfd_elf_get_elf_syms): Calculate symbol buffer size
using bfd_size_type.
(bfd_section_from_shdr): Delete amt.
(_bfd_elf_init_reloc_shdr): Likewise.
(_bfd_elf_link_assign_sym_version): Likewise.
(assign_section_numbers): Use size_t reloc_count.
* elflink.c (struct elf_symbuf_head): Use size_t "count".
(bfd_elf_link_record_dynamic_symbol): Use size_t for some vars.
(elf_link_is_defined_archive_symbol): Likewise.
(elf_add_dt_needed_tag): Likewise.
(elf_finalize_dynstr): Likewise.
(elf_link_add_object_symbols): Likewise.
(bfd_elf_size_dynamic_sections): Likewise.
(elf_create_symbuf): Similarly.
(bfd_elf_match_symbols_in_sections): Likewise.
(elf_link_swap_symbols_out): Likewise.
(elf_link_check_versioned_symbol): Likewise.
(bfd_elf_gc_record_vtinherit): Likewise.
(bfd_elf_gc_common_finalize_got_offsets): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Jun 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix problems emitting MIPS .reginfo section.
Vladimir Radosavljevic [Fri, 10 Jun 2016 22:32:33 +0000 (15:32 -0700)]
Fix problems emitting MIPS .reginfo section.

gold/
* mips.cc (Mips_relobj::Mips_relobj): Initialize
has_reginfo_section_.
(Mips_relobj::has_reginfo_section_): New data member.
(Mips_relobj::has_reginfo_section): New method.
(class Mips_output_section_reginfo): Change base class to
Output_section_data, and set masks of the output .reginfo section
in constructor.
(Mips_output_section_reginfo::as_mips_output_section_reginfo):
Remove.
(Mips_output_section_reginfo::set_masks): Likewise.
(Mips_output_section_reginfo::set_final_data_size): Likewise.
(Mips_output_section_reginfo::do_print_to_mapfile): New method.
(Target_mips::do_make_output_section): Remove.
(Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
if the object contains a .reginfo section.
(Target_mips::do_finalize_sections): Create a .reginfo output
section if needed.

8 years agoConstify arch_type and friends
Tom Tromey [Mon, 6 Jun 2016 14:06:15 +0000 (08:06 -0600)]
Constify arch_type and friends

While working on the Rust support, I happened to notice that arch_type
and related functions take "char *" arguments, where "const char *"
would be more correct.  This patch fixes this oversight.  Tested by
rebuilding.

2016-06-10  Tom Tromey  <tom@tromey.com>

* gdbtypes.c (arch_type, arch_integer_type, arch_character_type)
(arch_boolean_type, arch_float_type, arch_complex_type)
(arch_flags_type, append_flags_type_field)
(append_flags_type_flag, arch_composite_type)
(append_composite_type_field_raw)
(append_composite_type_field_aligned)
(append_composite_type_field): Make "name" parameter const.
* gdbtypes.h (arch_type, arch_integer_type, arch_character_type)
(arch_boolean_type, arch_float_type, arch_complex_type)
(append_composite_type_field, append_composite_type_field_aligned)
(append_composite_type_field_raw, arch_flags_type)
(append_flags_type_field, append_flags_type_flag): Constify.

8 years agoFix PR rust/20110
Tom Tromey [Wed, 18 May 2016 23:22:30 +0000 (17:22 -0600)]
Fix PR rust/20110

PR rust/20110 concerns the type of an integer constant that is too
large for "i32", the default integer type.  This patch changes the
type of such a constant to i64.  This is important because such values
are often addresses, so truncating them by default is unfriendly.

Built and regtested on x86-64 Fedora 23.

2016-06-10  Tom Tromey  <tom@tromey.com>

PR rust/20110:
* rust-exp.y (lex_number): Don't truncate large numbers to i32.

2016-06-10  Tom Tromey  <tom@tromey.com>

PR rust/20110:
* gdb.rust/expr.exp: Add test for integer constant larger than
i32.

8 years agoFix rust-exp handling in makefile
Tom Tromey [Sat, 4 Jun 2016 16:21:01 +0000 (10:21 -0600)]
Fix rust-exp handling in makefile

I noticed that the rust-exp handling in the Makefile differed from
that of other .y files.  I believe I noticed this by seeing a stray
"rm" in the build log.

This patch changes the Makefile to bring the rust-exp handling in line
with that of other .y files.

2016-06-10  Tom Tromey  <tom@tromey.com>

* Makefile.in (COMMON_OBS): Remove rust-exp.o.
(YYFILES): Add rust-exp.c.
(YYOBJ): Add rust-exp.o.
(local-maintainer-clean): Remove rust-exp.c.

8 years agoS/390: Dump unknown instructions according to their length.
Andreas Krebbel [Fri, 10 Jun 2016 11:40:48 +0000 (13:40 +0200)]
S/390: Dump unknown instructions according to their length.

Unknown instructions are currently just dumped as .long 1234.  On
S/390 we can do a bit better since the instruction length is encoded
in the opcode.  That way also unknown instructions can be skipped
according to their real length.  That way we can continue correctly
after that instruction.  However, there are also some drawbacks with
that behavior when dumping data.  So for now that behavior is only
enabled for text section but even there it might mess things up when
having a literal pool embedded in the code.  Therefore I've left the
feature disabled by default and have added the -Minsnlength option to
enable it explicitely.

opcodes/ChangeLog:

2016-06-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* s390-dis.c (option_use_insn_len_bits_p): New file scope
variable.
(init_disasm): Handle new command line option "insnlength".
(print_s390_disassembler_options): Mention new option in help
output.
(print_insn_s390): Use the encoded insn length when dumping
unknown instructions.

8 years agoFortran: Testsuite, non-local references in nested functions.
Bernhard Heckel [Fri, 10 Jun 2016 09:16:49 +0000 (11:16 +0200)]
Fortran: Testsuite, non-local references in nested functions.

Non-local references in nested functions are usually implemented
by using DWARF static link. This feature was added
with commit 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6
(DWARF: handle non-local references in nested functions) but
a testcase was missing in Fortran.

2016-06-10  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Testsuite/Changelog:
* gdb.fortran/nested-funcs.exp: New.
* gdb.fortran/nested-funcs.f90: New.

8 years agoAdd negative repeat count to 'x' command
Toshihito Kikuchi [Fri, 10 Jun 2016 05:47:42 +0000 (22:47 -0700)]
Add negative repeat count to 'x' command

This change adds support for specifying a negative repeat count to
all the formats of the 'x' command to examine memory backward.
A new testcase 'examine-backward' is added to cover this new feature.

Here's the example output from the new feature:

<format 'i'>
(gdb) bt
#0  Func1 (n=42, p=0x40432e "hogehoge") at main.cpp:5
#1  0x00000000004041fa in main (argc=1, argv=0x7fffffffdff8) at main.cpp:19
(gdb) x/-4i 0x4041fa
  0x4041e5 <main(int, char**)+11>: mov   %rsi,-0x10(%rbp)
  0x4041e9 <main(int, char**)+15>: lea   0x13e(%rip),%rsi
  0x4041f0 <main(int, char**)+22>: mov   $0x2a,%edi
  0x4041f5 <main(int, char**)+27>: callq 0x404147

<format 'x'>
(gdb) x/-4xw 0x404200
0x4041f0 <main(int, char**)+22>: 0x00002abf 0xff4de800 0x76e8ffff 0xb8ffffff
(gdb) x/-4
0x4041e0 <main(int, char**)+6>:  0x7d8910ec 0x758948fc 0x358d48f0 0x0000013e

gdb/ChangeLog:

* NEWS: Mention that GDB now supports a negative repeat count in
the 'x' command.
* printcmd.c (decode_format): Allow '-' in the parameter
"string_ptr" to accept a negative repeat count.
(find_instruction_backward): New function.
(read_memory_backward): New function.
(integer_is_zero): New function.
(find_string_backward): New function.
(do_examine): Use new functions to examine memory backward.
(_initialize_printcmd): Mention that 'x' command supports a negative
repeat count.

gdb/doc/ChangeLog:

* gdb.texinfo (Examining Memory): Document negative repeat
count in the 'x' command.

gdb/testsuite/ChangeLog:

* gdb.base/examine-backward.c: New file.
* gdb.base/examine-backward.exp: New file.

8 years agoAdd myself as a write-after-approval GDB maintainer
Toshihito Kikuchi [Fri, 10 Jun 2016 04:59:04 +0000 (21:59 -0700)]
Add myself as a write-after-approval GDB maintainer

gdb/ChangeLog:

* MAINTAINERS (Write After Approval): Add Toshihito Kikuchi.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Jun 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd missing ChangeLog entries
H.J. Lu [Thu, 9 Jun 2016 23:54:58 +0000 (16:54 -0700)]
Add missing ChangeLog entries

8 years agoPR python/19819 - remove unused globals from py-xmethods.c
Tom Tromey [Thu, 9 Jun 2016 16:43:01 +0000 (10:43 -0600)]
PR python/19819 - remove unused globals from py-xmethods.c

PR python/19819 concerns some unused global variables in
py-xmethods.c.  This patch deletes the unused globals.

Tested by rebuilding.

2016-06-09  Tom Tromey  <tom@tromey.com>

PR python/19819:
* python/py-xmethods.c (invoke_method_name)
(py_get_result_type_method_name, py_invoke_method_name): Remove.
(gdbpy_initialize_xmethods): Don't initialize
py_invoke_method_name, py_get_result_type_method_name.

8 years agoFix compilation error in mips.cc with some versions of GCC.
Artemiy Volkov [Thu, 9 Jun 2016 18:39:57 +0000 (11:39 -0700)]
Fix compilation error in mips.cc with some versions of GCC.

gold/
* mips.cc (Mips_output_data_got::do_write): Add missing template
args via typedef.

8 years agoFix PR 20221 - adjust syms and relocs only if relax shrunk section.
Denis Chertykov [Thu, 9 Jun 2016 16:17:43 +0000 (19:17 +0300)]
Fix PR 20221 - adjust syms and relocs only if relax shrunk section.

This patch fixes an edge case in linker relaxation that causes symbol
values to be computed incorrectly in the presence of align directives
in input source code.

bfd/
* elf32-avr.c (elf32_avr_relax_delete_bytes): Adjust syms
and relocs only if shrinking occurred.

ld/
* testsuite/ld-avr/avr-prop-5.d: New.
* testsuite/ld-avr/avr-prop-5.s: New.

8 years agoPrint symbol names in comments for LDS/STS disassembly.
Denis Chertykov [Thu, 9 Jun 2016 16:00:57 +0000 (19:00 +0300)]
Print symbol names in comments for LDS/STS disassembly.

This patch adds default data address space origin (0x800000) to the symbol addresses.
when disassemble lds/sts instructions. So that symbol names shall be printed in comments
for lds/sts instructions disassemble.

ld/
* testsuite/ld-avr/lds-mega.d: New test.
* testsuite/ld-avr/lds-mega.s: New test source.
* testsuite/ld-avr/lds-tiny.d: New test.
* testsuite/ld-avr/lds-tiny.s: New test source.

opcodes/
* avr-dis.c (avr_operand): Add default data address space origin (0x800000) to the
address and set as symbol address for LDS/ STS immediate operands.

8 years agosparc: add missing comment about hyperprivileged register operands
Jose E. Marchesi [Wed, 8 Jun 2016 20:46:22 +0000 (13:46 -0700)]
sparc: add missing comment about hyperprivileged register operands

include/ChangeLog:

2016-06-08  Jose E. Marchesi  <jose.marchesi@oracle.com>

* opcode/sparc.h: Add missing documentation for hyperprivileged
registers in rd (%) and rs1 ($).

8 years ago[AARCH64][GAS] Fix two -Wstack-usage warnings.
Renlin Li [Thu, 9 Jun 2016 09:08:08 +0000 (10:08 +0100)]
[AARCH64][GAS] Fix two -Wstack-usage warnings.

Warning triggerd by gcc 5 with -O0 flag.
error: stack usage might be unbounded [-Werror=stack-usage=]

gas/

2016-06-08  Renlin Li  <renlin.li@arm.com>

* config/tc-aarch64.c (print_operands): Substitute size.
(output_operand_error_record): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Jun 2016 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoi386: Test external function reference without PLT
H.J. Lu [Wed, 8 Jun 2016 19:41:50 +0000 (12:41 -0700)]
i386: Test external function reference without PLT

To call an external function, the direct branch to the PLT entry can be
replaced by an indirect branch via the GOT slot, which is similar to the
first instruction in the PLT slot.  Instead using the PLT slot as function
address, the function address is retrieved from the GOT slot.  The
R_386_GOT32X relocation can be used to compute the address of the symbol’s
GOT entry without base register when PIC is disabled.  In non-PIC
executable,

call/jmp *func@GOT

should be used for indirect branch via the GOT slot and

movl func@GOT, %eax

should be used to load function address.  Unlike PIC case, no register
is needed to access GOT.  If linker determines the function is defined
locally, it converts indirect branch via the GOT slot to direct branch
with a nop prefix and converts load via the GOT slot to load immediate
or lea.

* testsuite/ld-i386/libno-plt-1b.dd: New file.
* testsuite/ld-i386/libno-plt-1b.rd: Likewise.
* testsuite/ld-i386/no-plt-1a.dd: Likewise.
* testsuite/ld-i386/no-plt-1a.rd: Likewise.
* testsuite/ld-i386/no-plt-1b.dd: Likewise.
* testsuite/ld-i386/no-plt-1b.rd: Likewise.
* testsuite/ld-i386/no-plt-1c.dd: Likewise.
* testsuite/ld-i386/no-plt-1c.rd: Likewise.
* testsuite/ld-i386/no-plt-1d.dd: Likewise.
* testsuite/ld-i386/no-plt-1d.rd: Likewise.
* testsuite/ld-i386/no-plt-1e.dd: Likewise.
* testsuite/ld-i386/no-plt-1e.rd: Likewise.
* testsuite/ld-i386/no-plt-1f.dd: Likewise.
* testsuite/ld-i386/no-plt-1f.rd: Likewise.
* testsuite/ld-i386/no-plt-1g.dd: Likewise.
* testsuite/ld-i386/no-plt-1g.rd: Likewise.
* testsuite/ld-i386/no-plt-1h.dd: Likewise.
* testsuite/ld-i386/no-plt-1h.rd: Likewise.
* testsuite/ld-i386/no-plt-1i.dd: Likewise.
* testsuite/ld-i386/no-plt-1i.rd: Likewise.
* testsuite/ld-i386/no-plt-1j.dd: Likewise.
* testsuite/ld-i386/no-plt-1j.rd: Likewise.
* testsuite/ld-i386/no-plt-check1a.S: Likewise.
* testsuite/ld-i386/no-plt-check1b.S: Likewise.
* testsuite/ld-i386/no-plt-extern1a.S: Likewise.
* testsuite/ld-i386/no-plt-extern1b.S: Likewise.
* testsuite/ld-i386/no-plt-func1.c: Likewise.
* testsuite/ld-i386/no-plt-main1.c: Likewise.
* testsuite/ld-i386/no-plt.exp: Likewise.

8 years agoUpdate test name
H.J. Lu [Wed, 8 Jun 2016 19:27:32 +0000 (12:27 -0700)]
Update test name

* testsuite/ld-x86-64/tls.exp (run_cc_link_tests): Update test
name.

8 years agoSupport i386 TLS code sequences without PLT
H.J. Lu [Wed, 8 Jun 2016 18:59:47 +0000 (11:59 -0700)]
Support i386 TLS code sequences without PLT

We can generate i386 TLS code sequences for general and local dynamic
models without PLT, which uses indirect call via GOT:

call *___tls_get_addr@GOT(%reg)

where EBX register isn't required as GOT base, instead of direct call:

call ___tls_get_addr[@PLT]

which requires EBX register as GOT base.

Since direct call is 4-byte long and indirect call, is 5-byte long, the
extra one byte must be handled properly.

For general dynamic model, 7-byte lea instruction before call instruction
is replaced by 6-byte one to make room for indirect call.  For local
dynamic model, we simply use 5-byte indirect call.

TLS linker optimization is updated to recognize new instruction patterns.
For local dynamic model to local exec model transition, we generate
a 6-byte lea instruction as nop, instead of a 1-byte nop plus a 4-byte
lea instruction.  Since linker may convert

call ___tls_get_addr[@PLT]

to

addr32 call ____tls_get_addr

when producing static executable, both patterns are recognized.

bfd/

* elf64-i386.c (elf_i386_link_hash_entry): Add tls_get_addr.
(elf_i386_link_hash_newfunc): Initialize tls_get_addr to 2.
(elf_i386_check_tls_transition): Check indirect call and direct
call with the addr32 prefix for general and local dynamic models.
Set the tls_get_addr feild.
(elf_i386_convert_load_reloc): Always use addr32 prefix for
indirect ___tls_get_addr call via GOT.
(elf_i386_relocate_section): Handle GD->LE, GD->IE and LD->LE
transitions with indirect call and direct call with the addr32
prefix.

ld/

* testsuite/ld-i386/i386.exp: Run libtlspic2.so, tlsbin2,
tlsgd3, tlsld2, tlsgd4, tlspie3a, tlspie3b and tlspie3c.
* testsuite/ld-i386/pass.out: New file.
* testsuite/ld-i386/tls-def1.c: Likewise.
* testsuite/ld-i386/tls-gd1.S: Likewise.
* testsuite/ld-i386/tls-ld1.S: Likewise.
* testsuite/ld-i386/tls-main1.c: Likewise.
* testsuite/ld-i386/tls.exp: Likewise.
* testsuite/ld-i386/tlsbin2-nacl.rd: Likewise.
* testsuite/ld-i386/tlsbin2.dd: Likewise.
* testsuite/ld-i386/tlsbin2.rd: Likewise.
* testsuite/ld-i386/tlsbin2.sd: Likewise.
* testsuite/ld-i386/tlsbin2.td: Likewise.
* testsuite/ld-i386/tlsbinpic2.s: Likewise.
* testsuite/ld-i386/tlsgd3.dd: Likewise.
* testsuite/ld-i386/tlsgd3.s: Likewise.
* testsuite/ld-i386/tlsgd4.d: Likewise.
* testsuite/ld-i386/tlsgd4.s: Likewise.
* testsuite/ld-i386/tlsld2.s: Likewise.
* testsuite/ld-i386/tlspic2-nacl.rd: Likewise.
* testsuite/ld-i386/tlspic2.dd: Likewise.
* testsuite/ld-i386/tlspic2.rd: Likewise.
* testsuite/ld-i386/tlspic2.sd: Likewise.
* testsuite/ld-i386/tlspic2.td: Likewise.
* testsuite/ld-i386/tlspic3.s: Likewise.
* testsuite/ld-i386/tlspie3.s: Likewise.
* testsuite/ld-i386/tlspie3a.d: Likewise.
* testsuite/ld-i386/tlspie3b.d: Likewise.
* testsuite/ld-i386/tlspie3c.d: Likewise.

8 years agoSupport any relocation order
H.J. Lu [Wed, 8 Jun 2016 17:10:56 +0000 (10:10 -0700)]
Support any relocation order

* testsuite/ld-x86-64/no-plt-1a.rd: Support any relocation order.
* testsuite/ld-x86-64/no-plt-1b.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1c.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1d.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1e.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1f.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1g.rd: Likewise.
* testsuite/ld-x86-64/no-plt.exp: Fix a typo.

8 years agoAdd missing ChangeLog entries
H.J. Lu [Wed, 8 Jun 2016 14:47:07 +0000 (07:47 -0700)]
Add missing ChangeLog entries

8 years agoX86-64: Test external function reference without PLT
H.J. Lu [Wed, 8 Jun 2016 11:55:10 +0000 (04:55 -0700)]
X86-64: Test external function reference without PLT

To call an external function, the direct branch to the PLT entry can be
replaced by an indirect branch via the GOT slot, which is similar to the
first instruction in the PLT slot.  Instead using the PLT slot as function
address, the function address is retrieved from the GOT slot.  If linker
determines the function is defined locally, it converts indirect branch
via the GOT slot to direct branch with a nop prefix and converts load via
the GOT slot to load immediate or lea,

* testsuite/ld-x86-64/libno-plt-1b.dd: Likewise.
* testsuite/ld-x86-64/libno-plt-1b.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1a.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1a.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1b.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1b.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1c.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1c.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1d.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1d.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1e.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1e.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1f.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1f.rd: Likewise.
* testsuite/ld-x86-64/no-plt-1g.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1g.rd: Likewise.
* testsuite/ld-x86-64/no-plt-check1.S: Likewise.
* testsuite/ld-x86-64/no-plt.exp: Likewise.
* testsuite/ld-x86-64/no-plt-extern1.S: Likewise.
* testsuite/ld-x86-64/no-plt-func1.c: Likewise.
* testsuite/ld-x86-64/no-plt-main1.c: Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Jun 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agobfd/s390: Misc minor fixes.
Marcin Kościelnicki [Fri, 3 Jun 2016 14:39:15 +0000 (16:39 +0200)]
bfd/s390: Misc minor fixes.

The only non-comment fix here is in the code writing out the 3 fixed
.got.plt entries - it mistakenly put a 64-bit 0 at offsets 8 and 12
instead of 8 and 16.

bfd/ChangeLog:

* elf32-s390.c (elf_s390_finish_dynamic_symbol): Fix comment.
* elf64-s390.c (elf_s390x_plt_entry): Fix comment.
(elf_s390_relocate_section): Fix comment.
(elf_s390_finish_dynamic_sections): Fix initialization of fixed
.got.plt entries.

8 years agomi/mi-interp.c: Add missing braces
Simon Marchi [Tue, 7 Jun 2016 14:02:42 +0000 (10:02 -0400)]
mi/mi-interp.c: Add missing braces

gdb/ChangeLog:

* mi/mi-interp.c (mi_record_changed): Add missing braces.

8 years agold/testsuite/ld-elf/init-fini-arrays.d: Remove `ft32-*-*' xfail
Maciej W. Rozycki [Fri, 27 May 2016 16:53:01 +0000 (17:53 +0100)]
ld/testsuite/ld-elf/init-fini-arrays.d: Remove `ft32-*-*' xfail

Revert the addition of `ft32-*-*' to this test case made with commit
d1f70bdcab6c ("Fix lots of linker testsuite failures for the FT32
target.") as this case scores an XPASS now.

ld/
* testsuite/ld-elf/init-fini-arrays.d: Remove `ft32-*-*' xfail.

8 years agoFix PLT first entry GOT operand calculation.
Andreas Krebbel [Tue, 7 Jun 2016 14:45:15 +0000 (16:45 +0200)]
Fix PLT first entry GOT operand calculation.

Embedding the .plt section in another revealed a bug in the way the
larl operand of the first magic plt entry is being calculated.  Fixed
with the attached patch.

bfd/ChangeLog:

* elf64-s390.c (elf_s390_finish_dynamic_sections): Subtract plt
section offset when calculation the larl operand in the first PLT
entry.

ld/ChangeLog:

* testsuite/ld-s390/pltoffset-1.dd: New test.
* testsuite/ld-s390/pltoffset-1.ld: New test.
* testsuite/ld-s390/pltoffset-1.s: New test.
* testsuite/ld-s390/s390.exp: Run new test.

8 years agoPowerPC VLE
Alan Modra [Tue, 7 Jun 2016 12:34:38 +0000 (22:04 +0930)]
PowerPC VLE

VLE is an encoding, not a particular processor architecture, so it
isn't really proper to select insns based on PPC_OPCODE_VLE.  For
example
{"evaddw",  VX (4, 512), VX_MASK, PPCSPE|PPCVLE, PPCNONE, {RS, RA, RB}},
{"vaddubs", VX (4, 512), VX_MASK, PPCVEC|PPCVLE, PPCNONE, {VD, VA, VB}},
shows two insns that have the same encoding, both available with VLE.
Enabling both with VLE means we can't disassemble the second variant
even if -Maltivec is given rather than -Mspe.  Also, we don't check
user assembly against the processor type as well as we could.

Another problem is that when using the VLE encoding, insns from the
main ppc opcode table are not available, except those using opcode 4
and 31.  Correcting this revealed two errors in the ld testsuite,
use of "nop" and "rfmci" when -mvle.

This patch fixes those problems in the opcode table, and removes
PPCNONE.  I find a plain 0 distracts less from other values.

In addition, I've implemented code to recognize some machine values
from the apuinfo note present in ppc32 objects.  It's not a complete
disambiguation since we're lacking info to detect newer chips, but
what we have should help with disassembly.

include/
* elf/ppc.h (APUINFO_SECTION_NAME, APUINFO_LABEL, PPC_APUINFO_ISEL,
PPC_APUINFO_PMR, PPC_APUINFO_RFMCI, PPC_APUINFO_CACHELCK,
PPC_APUINFO_SPE, PPC_APUINFO_EFS, PPC_APUINFO_BRLOCK,
PPC_APUINFO_VLE: Define.
opcodes/
* ppc-dis.c (ppc_opts): Delete extraneous parentheses.  Default
cpu for "vle" to e500.
* ppc-opc.c (ALLOW8_SPRG): Remove PPC_OPCODE_VLE.
(NO371, PPCSPE, PPCISEL, PPCEFS, MULHW, DCBT_EO): Likewise.
(PPCNONE): Delete, substitute throughout.
(powerpc_opcodes): Remove PPCVLE from "flags".  Add to "deprecated"
except for major opcode 4 and 31.
(vle_opcodes <se_rfmci>): Add PPCRFMCI to flags.
bfd/
* cpu-powerpc.c (powerpc_compatible): Allow bfd_mach_ppc_vle entry
to match other 32-bit archs.
* elf32-ppc.c (_bfd_elf_ppc_set_arch): New function.
(ppc_elf_object_p): Call it.
(ppc_elf_special_sections): Use APUINFO_SECTION_NAME.  Fix
overlong line.
(APUINFO_SECTION_NAME, APUINFO_LABEL): Don't define here.
* elf64-ppc.c (ppc64_elf_object_p): Call _bfd_elf_ppc_set_arch.
* bfd-in.h (_bfd_elf_ppc_at_tls_transform,
_bfd_elf_ppc_at_tprel_transform): Move to..
* elf-bfd.h: ..here.
(_bfd_elf_ppc_set_arch): Declare.
* bfd-in2.h: Regenerate.
gas/
* config/tc-ppc.c (PPC_APUINFO_ISEL, PPC_APUINFO_PMR,
PPC_APUINFO_RFMCI, PPC_APUINFO_CACHELCK, PPC_APUINFO_SPE,
PPC_APUINFO_EFS, PPC_APUINFO_BRLOCK, PPC_APUINFO_VLE): Don't define.
(ppc_setup_opcodes): Check vle disables powerpc_opcodes overridden
by vle_opcodes, and that vle flag doesn't enable opcodes.  Don't
add vle_opcodes twice.
(ppc_cleanup): Use APUINFO_SECTION_NAME and APUINFO_LABEL.
ld/
* testsuite/ld-powerpc/apuinfo1.s: Delete nop.
* testsuite/ld-powerpc/apuinfo-vle2.s: New.
* testsuite/ld-powerpc/powerpc.exp: Use apuinfo-vle2.s.

8 years agoFrame static link: Handle null pointer.
Bernhard Heckel [Tue, 7 Jun 2016 11:36:05 +0000 (13:36 +0200)]
Frame static link: Handle null pointer.

2016-06-07  Bernhard Heckel  <bernhard.heckel@intel.com>

gdb/Changelog:
* findvar.c (follow_static_link): Check for valid pointer.

8 years ago[ARM] Add command line option for RAS extension.
Matthew Wahab [Tue, 7 Jun 2016 08:56:42 +0000 (09:56 +0100)]
[ARM] Add command line option for RAS extension.

This patch adds the architecture extension "+ras" to enable RAS
support. It is enabled by default for -march=armv8.2-a and available but
disabled by default for armv8-a and armv8.1-a.

gas/
* config/tc-arm.c (arm_ext_v8_2): Rename to arm_ext_ras.
(arm_ext_ras): Renamed from arm_ext_v8_2.
(insns): Update for arm_ext_v8_2 renaming.
(arm_extensions): Add "ras".
* doc/c-arm.texi (ARM Options): Add an entry for "ras".
* testsuite/gas/arm/armv8-a+ras.d: New.
* testsuite/gas/arm/armv8_2-a.d: Add explicit command line
options.

include/
* opcode/arm.h (ARM_EXT2_RAS): New.  Also align preceding
entries.
(ARM_AEXT_V8_2A): Add ARM_EXT2_RAS.

opcodes/
* arm-dis.c (arm_opcodes): Replace ARM_EXT_V8_2A with
ARM_EXT_RAS in relevant entries.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Jun 2016 00:00:16 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd method/format information to =record-started
Simon Marchi [Mon, 30 May 2016 21:29:39 +0000 (17:29 -0400)]
Add method/format information to =record-started

Eclipse CDT now supports enabling execution recording using two methods
(full and btrace) and both formats for btrace (bts and pt).  In the
event that recording is enabled behind the back of the GUI (by the user
on the command line, or a script), we need to know which method/format
are being used, so it can be correctly reflected in the interface.  This
patch adds this information to the =record-started async record.

Before:

  =record-started,thread-group="i1"

After:

  =record-started,thread-group="i1",method="btrace",format="bts"
  =record-started,thread-group="i1",method="btrace",format="pt"
  =record-started,thread-group="i1",method="full"

The "format" field is only present when the current method supports
multiple formats (only the btrace method as of now).

gdb/ChangeLog:

* NEWS: Mention the new fields in =record-started.
* common/btrace-common.h (btrace_format_short_string): New function
declaration.
* common/btrace-common.c (btrace_format_short_string): New
function.
* mi/mi-interp.c (mi_record_changed): Output method and format
fields in the =record-started record.
* record-btrace.c (record_btrace_open): Adapt record_changed
notification.
* record-full.c (record_full_open): Likewise.
* record.c (cmd_record_stop): Likewise.

gdb/doc/ChangeLog:

* gdb.texinfo (GDB/MI Async Records): Document method and
format fields in =record-started.
* observer.texi (record_changed): Add method and format
parameters.

gdb/testsuite/ChangeLog:

* gdb.mi/mi-record-changed.exp: Adjust =record-started output
matching.

8 years agoSupport x86-64 TLS code sequences without PLT
H.J. Lu [Mon, 6 Jun 2016 18:06:55 +0000 (11:06 -0700)]
Support x86-64 TLS code sequences without PLT

We can generate x86-64 TLS code sequences for general and local dynamic
models without PLT, which uses indirect call via GOT:

call *__tls_get_addr@GOTPCREL(%rip)

instead of direct call:

call __tls_get_addr[@PLT]

Since direct call is 4-byte long and indirect call, is 5-byte long, the
extra one byte must be handled properly.

For general dynamic model, one 0x66 prefix before call instruction is
removed to make room for indirect call.  For local dynamic model, we
simply use 5-byte indirect call.

TLS linker optimization is updated to recognize new instruction patterns.
For local dynamic model to local exec model transition, we generate
4 0x66 prefixes, instead of 3, before mov instruction in 64-bit and
generate a 5-byte nop, instead of 4-byte, before mov instruction in
32-bit.  Since linker may convert

call *__tls_get_addr@GOTPCREL(%rip)

to

addr32 call __tls_get_addr

when producing static executable, both patterns are recognized.

bfd/

* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add tls_get_addr.
(elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 2.
(elf_x86_64_check_tls_transition): Check indirect call and
direct call with the addr32 prefix for general and local dynamic
models.  Set the tls_get_addr feild.
(elf_x86_64_convert_load_reloc): Always use addr32 prefix for
indirect __tls_get_addr call via GOT.
(elf_x86_64_relocate_section): Handle GD->LE, GD->IE and LD->LE
transitions with indirect call and direct call with the addr32
prefix.

ld/

* testsuite/ld-x86-64/pass.out: New file.
* testsuite/ld-x86-64/tls-def1.c: Likewise.
* testsuite/ld-x86-64/tls-gd1.S: Likewise.
* testsuite/ld-x86-64/tls-ld1.S: Likewise.
* testsuite/ld-x86-64/tls-main1.c: Likewise.
* testsuite/ld-x86-64/tls.exp: Likewise.
* testsuite/ld-x86-64/tlsbin2-nacl.rd: Likewise.
* testsuite/ld-x86-64/tlsbin2.dd: Likewise.
* testsuite/ld-x86-64/tlsbin2.rd: Likewise.
* testsuite/ld-x86-64/tlsbin2.sd: Likewise.
* testsuite/ld-x86-64/tlsbin2.td: Likewise.
* testsuite/ld-x86-64/tlsbinpic2.s: Likewise.
* testsuite/ld-x86-64/tlsgd10.dd: Likewise.
* testsuite/ld-x86-64/tlsgd10.s: Likewise.
* testsuite/ld-x86-64/tlsgd11.dd: Likewise.
* testsuite/ld-x86-64/tlsgd11.s: Likewise.
* testsuite/ld-x86-64/tlsgd12.d: Likewise.
* testsuite/ld-x86-64/tlsgd12.s: Likewise.
* testsuite/ld-x86-64/tlsgd13.d: Likewise.
* testsuite/ld-x86-64/tlsgd13.s: Likewise.
* testsuite/ld-x86-64/tlsgd14.dd: Likewise.
* testsuite/ld-x86-64/tlsgd14.s: Likewise.
* testsuite/ld-x86-64/tlsgd5c.s: Likewise.
* testsuite/ld-x86-64/tlsgd6c.s: Likewise.
* testsuite/ld-x86-64/tlsgd9.dd: Likewise.
* testsuite/ld-x86-64/tlsgd9.s: Likewise.
* testsuite/ld-x86-64/tlsld4.dd: Likewise.
* testsuite/ld-x86-64/tlsld4.s: Likewise.
* testsuite/ld-x86-64/tlsld5.dd: Likewise.
* testsuite/ld-x86-64/tlsld5.s: Likewise.
* testsuite/ld-x86-64/tlsld6.dd: Likewise.
* testsuite/ld-x86-64/tlsld6.s: Likewise.
* testsuite/ld-x86-64/tlspic2-nacl.rd: Likewise.
* testsuite/ld-x86-64/tlspic2.dd: Likewise.
* testsuite/ld-x86-64/tlspic2.rd: Likewise.
* testsuite/ld-x86-64/tlspic2.sd: Likewise.
* testsuite/ld-x86-64/tlspic2.td: Likewise.
* testsuite/ld-x86-64/tlspic3.s: Likewise.
* testsuite/ld-x86-64/tlspie2.s: Likewise.
* testsuite/ld-x86-64/tlspie2a.d: Likewise.
* testsuite/ld-x86-64/tlspie2b.d: Likewise.
* testsuite/ld-x86-64/tlspie2c.d: Likewise.
* testsuite/ld-x86-64/tlsgd5.dd: Updated.
* testsuite/ld-x86-64/tlsgd6.dd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run libtlspic2.so, tlsbin2,
tlsgd5b, tlsgd6b, tlsld4, tlsld5, tlsld6, tlsgd9, tlsgd10,
tlsgd11, tlsgd14, tlsgd12, tlsgd13, tlspie2a, tlspie2b and
tlspie2c.

8 years ago2016-06-06 Christian Groessler <chris@groessler.org>
Christian Groessler [Mon, 6 Jun 2016 07:47:25 +0000 (09:47 +0200)]
2016-06-06  Christian Groessler  <chris@groessler.org>

* ChangeLog: Fix entry from 2016-06-04.

8 years agofixup another old style function definition
Trevor Saunders [Tue, 24 May 2016 12:59:35 +0000 (08:59 -0400)]
fixup another old style function definition

gas/ChangeLog:

2016-06-05  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* itbl-parse.y (yyerror): Use modern argument declaration style.

8 years agosh{,64}: make arg type enum
Trevor Saunders [Sun, 29 May 2016 02:31:07 +0000 (22:31 -0400)]
sh{,64}: make arg type enum

The values are always members of the enum, except the two places -1 is assigned
only to playcate -Wuninitialized because gcc isn't or at least didn't used to
be smart enough to figure out its only used if it was set.

gas/ChangeLog:

2016-06-05  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-sh.c (parse_reg): Change type of mode argument to
sh_arg_type.
(get_operand): Adjust.
(insert): Change type of how to bfd_reloc_code_real_type.
(insert4): Likewise.
* config/tc-sh64.c (shmedia_get_operand): Adjust.
(shmedia_parse_reg): Change type of mode to shmedia_arg_type.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Jun 2016 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agonds32: constify ptr_arg
Trevor Saunders [Sat, 28 May 2016 21:57:44 +0000 (17:57 -0400)]
nds32: constify ptr_arg

it points to the result of strchr on a const char *, so it aliases
something that is const.  Further its only passed to a function that expects a
const char *, so there's no reason for it to not be const.

gas/ChangeLog:

2016-06-05  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-nds32.c (nds32_parse_option): Make the type of ptr_arg
const char *.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Jun 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agold/testsuite/ld-z8k/test-ld.sh: Remove. Checked in by mistake.
Christian Groessler [Sat, 4 Jun 2016 20:39:46 +0000 (22:39 +0200)]
ld/testsuite/ld-z8k/test-ld.sh: Remove.  Checked in by mistake.

8 years agoAdd z8k ld testsuite and fix range check in coff-z8k.c
Christian Groessler [Sat, 4 Jun 2016 20:15:52 +0000 (22:15 +0200)]
Add z8k ld testsuite and fix range check in coff-z8k.c

bfd/
* coff-z8k.c (extra_case): Fix range check for R_JR relocation.

ld/
* ld/testsuite/ld-z8k/0filler.s: New file.
* ld/testsuite/ld-z8k/branch-target.s: New file.
* ld/testsuite/ld-z8k/branch-target2.s: New file.
* ld/testsuite/ld-z8k/calr-back-8001.d: New file.
* ld/testsuite/ld-z8k/calr-back-8002.d: New file.
* ld/testsuite/ld-z8k/calr-back-fail-8001.d: New file.
* ld/testsuite/ld-z8k/calr-back-fail-8002.d: New file.
* ld/testsuite/ld-z8k/calr-forw-8001.d: New file.
* ld/testsuite/ld-z8k/calr-forw-8002.d: New file.
* ld/testsuite/ld-z8k/calr-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/calr-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/calr-opcode.s: New file.
* ld/testsuite/ld-z8k/dbjnz-forw-8001.d: New file.
* ld/testsuite/ld-z8k/dbjnz-forw-8002.d: New file.
* ld/testsuite/ld-z8k/dbjnz-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/dbjnz-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/dbjnz-opcode.s: New file.
* ld/testsuite/ld-z8k/djnz-back-8001.d: New file.
* ld/testsuite/ld-z8k/djnz-back-8002.d: New file.
* ld/testsuite/ld-z8k/djnz-back-fail-8001.d: New file.
* ld/testsuite/ld-z8k/djnz-back-fail-8002.d: New file.
* ld/testsuite/ld-z8k/djnz-forw-8001.d: New file.
* ld/testsuite/ld-z8k/djnz-forw-8002.d: New file.
* ld/testsuite/ld-z8k/djnz-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/djnz-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/djnz-opcode.s: New file.
* ld/testsuite/ld-z8k/filler.s: New file.
* ld/testsuite/ld-z8k/jr-back-8001.d: New file.
* ld/testsuite/ld-z8k/jr-back-8002.d: New file.
* ld/testsuite/ld-z8k/jr-back-fail-8001.d: New file.
* ld/testsuite/ld-z8k/jr-back-fail-8002.d: New file.
* ld/testsuite/ld-z8k/jr-forw-8001.d: New file.
* ld/testsuite/ld-z8k/jr-forw-8002.d: New file.
* ld/testsuite/ld-z8k/jr-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/jr-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/jr-opcode.s: New file.
* ld/testsuite/ld-z8k/ldr-back-8001.d: New file.
* ld/testsuite/ld-z8k/ldr-back-8002.d: New file.
* ld/testsuite/ld-z8k/ldr-back-fail-8001.d: New file.
* ld/testsuite/ld-z8k/ldr-back-fail-8002.d: New file.
* ld/testsuite/ld-z8k/ldr-forw-8001.d: New file.
* ld/testsuite/ld-z8k/ldr-forw-8002.d: New file.
* ld/testsuite/ld-z8k/ldr-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/ldr-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/ldr-opcode.s: New file.
* ld/testsuite/ld-z8k/ldrb-forw-8001.d: New file.
* ld/testsuite/ld-z8k/ldrb-forw-8002.d: New file.
* ld/testsuite/ld-z8k/ldrb-forw-fail-8001.d: New file.
* ld/testsuite/ld-z8k/ldrb-forw-fail-8002.d: New file.
* ld/testsuite/ld-z8k/ldrb-opcode.s: New file.
* ld/testsuite/ld-z8k/ldrb-opcode2.s: New file.
* ld/testsuite/ld-z8k/other-file.s: New file.
* ld/testsuite/ld-z8k/reloc.dd: New file.
* ld/testsuite/ld-z8k/reloc.ld: New file.
* ld/testsuite/ld-z8k/relocseg.dd: New file.
* ld/testsuite/ld-z8k/relocseg.ld: New file.
* ld/testsuite/ld-z8k/relocseg1.dd: New file.
* ld/testsuite/ld-z8k/test-ld.sh: New file.
* ld/testsuite/ld-z8k/this-file.s: New file.
* ld/testsuite/ld-z8k/z8k.exp: New file.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Jun 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoRe-add support for lbarx, lharx, stbcx. and sthcx. insns back to the E6500 cpu.
Peter Bergner [Fri, 3 Jun 2016 23:38:02 +0000 (18:38 -0500)]
Re-add support for lbarx, lharx, stbcx. and sthcx. insns back to the E6500 cpu.

opcodes/
PR binutils/20196
* ppc-opc.c (powerpc_opcodes <lbarx, lharx, stbcx., sthcx.>): Enable
opcodes for E6500.

gas/
PR binutils/20196
* gas/testsuite/gas/ppc/e6500.s <lbarx, lharx, lwarx, ldarx,
stbcx., sthcx., stwcx., stdcx.>: Add tests.
* gas/testsuite/gas/ppc/e6500.d: Likewise.
* gas/testsuite/gas/ppc/power8.s: Likewise.
* gas/testsuite/gas/ppc/power8.d: Likewise.
* gas/testsuite/gas/ppc/power4.s <lwarx, ldarx, stwcx.,
stdcx.>: Add tests.
* gas/testsuite/gas/ppc/power4.d: Likewise.

8 years agoHandle indirect branches for AMD64 and Intel64
H.J. Lu [Fri, 3 Jun 2016 22:55:29 +0000 (15:55 -0700)]
Handle indirect branches for AMD64 and Intel64

AMD64 spec and Intel64 spec differ in indirect branches in 64-bit mode.
AMD64 supports indirect branches with 16-bit address via the data size
prefix while the data size prefix is ignored by Intel64.

gas/

PR binutis/18386
* testsuite/gas/i386/i386.exp: Run x86-64-branch-4.
* testsuite/gas/i386/x86-64-branch.d: Updated.
* testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise.
* testsuite/gas/i386/x86-64-branch-4.l: New file.
* testsuite/gas/i386/x86-64-branch-4.s: Likewise.

opcodes/

PR binutis/18386
* i386-dis.c (indirEv): Replace stack_v_mode with indir_v_mode.
(indir_v_mode): New.
Add comments for '&'.
(reg_table): Replace "{T|}" with "{&|}" on call and jmp.
(putop): Handle '&'.
(intel_operand_size): Handle indir_v_mode.
(OP_E_register): Likewise.
* i386-opc.tbl: Mark 64-bit indirect call/jmp as AMD64.  Add
64-bit indirect call/jmp for AMD64.
* i386-tbl.h: Regenerated

8 years ago[AArch64][gas] Add support for Cortex-A73
Kyrylo Tkachov [Fri, 3 Jun 2016 15:59:24 +0000 (16:59 +0100)]
[AArch64][gas] Add support for Cortex-A73

* config/tc-aarch64.c (aarch64_cpus): Add cortex-a73 entry.
* doc/c-aarch64.texi (-mcpu): Document cortex-a73 value.

8 years ago[ARM][gas] Add support for Cortex-A73
Kyrylo Tkachov [Fri, 3 Jun 2016 15:58:21 +0000 (16:58 +0100)]
[ARM][gas] Add support for Cortex-A73

* config/tc-arm.c (arm_cpus): Add cortex-a73 entry.
* doc/c-arm.texi (-mcpu=): Document cortex-a73 value.

8 years agoFix C++ build for Cygwin
Jon Turney [Thu, 2 Jun 2016 13:34:10 +0000 (13:34 +0000)]
Fix C++ build for Cygwin

gdb/ChangeLog:

2016-06-02  Jon Turney  <jon.turney@dronecode.org.uk>

* windows-nat.c (handle_output_debug_string): Return type of
gdb_signal_from_host() is gdb_signal, not an int.
(windows_get_exec_module_filename): Add pointer casts for C++.

gdb/gdbserver/ChangeLog:

2016-06-02  Jon Turney  <jon.turney@dronecode.org.uk>

* win32-low.c (win32_create_inferior): Add pointer casts for C++.

8 years agoUpdate x86 linker tests for --disable-x86-relax-relocations
H.J. Lu [Fri, 3 Jun 2016 11:10:11 +0000 (04:10 -0700)]
Update x86 linker tests for --disable-x86-relax-relocations

Pass -mrelax-relocations=yes to x86 linker tests, which require relax
relocations, to support --disable-x86-relax-relocations.

* testsuite/ld-i386/i386.exp: Assemble gotpc1.o and pr19319b.o
with -mrelax-relocations=yes.
* testsuite/ld-i386/lea1a.d (as): Add -mrelax-relocations=yes.
* testsuite/ld-i386/lea1b.d (as): Likewise.
* testsuite/ld-i386/lea1d.d (as): Likewise.
* testsuite/ld-i386/lea1e.d (as): Likewise.
* testsuite/ld-i386/lea1f.d (as): Likewise.
* testsuite/ld-i386/load7.d (as): Likewise.
* testsuite/ld-i386/mov1b.d (as): Likewise.
* testsuite/ld-i386/pr19175.d (as): Likewise.
* testsuite/ld-ifunc/ifunc-13-i386.d (as): Likewise.
* testsuite/ld-ifunc/ifunc-21-i386.d (as): Likewise.
* testsuite/ld-ifunc/ifunc-22-i386.d (as): Likewise.
* testsuite/ld-x86-64/x86-64.exp: Assemble gotpcrel1a.o,
gotpcrel1b.o and gotpcrel1c.o with -mrelax-relocations=yes.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Jun 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix PR python/18984
Tom Tromey [Sat, 19 Sep 2015 23:45:47 +0000 (17:45 -0600)]
Fix PR python/18984

This fixes PR python/18984.

The bug is that gdbpy_solib_name uses GDB_PY_LL_ARG, whereas it should
use GDB_PY_LLU_ARG to avoid overflow.

Built and tested on x86-64 Fedora 23.

2016-06-02  Tom Tromey  <tom@tromey.com>

PR python/18984:
* python/python.c (gdbpy_solib_name): Use GDB_PY_LLU_ARG.

2016-06-02  Tom Tromey  <tom@tromey.com>

PR python/18984:
* gdb.python/py-shared.exp: Add solib_name test.

8 years agoAdd "arm_any" architecture type to allow -m option to various binutils to match any...
Nick Clifton [Thu, 2 Jun 2016 16:17:03 +0000 (17:17 +0100)]
Add "arm_any" architecture type to allow -m option to various binutils to match any ARM architecture.

PR target/20088
* cpu-arm.c (processors): Add "arm_any" type to match any ARM
architecture.
(arch_info_struct): Likewise.
(architectures): Likewise.

8 years agoAlso check that the group header's sh_info field is valid.
Nick Clifton [Thu, 2 Jun 2016 15:32:45 +0000 (16:32 +0100)]
Also check that the group header's sh_info field is valid.

PR 20089
* objcopy.c (group_signature): Fail if the input symbol table has
not been loaded, or if the sh_info field of the group header is 0.

8 years agoFix a seg-fault when stripping a corrupt binary.
Nick Clifton [Thu, 2 Jun 2016 15:20:27 +0000 (16:20 +0100)]
Fix a seg-fault when stripping a corrupt binary.

PR 20089
* objcopy.c (group_signature): Fail if the input symbol table has
not been loaded.

8 years agomi-memory-changed.exp: Fix filename passed to untested
Simon Marchi [Thu, 2 Jun 2016 14:05:59 +0000 (10:05 -0400)]
mi-memory-changed.exp: Fix filename passed to untested

gdb/testsuite/ChangeLog:

* gdb.mi/mi-memory-changed.exp: Fix filename passed to untested.

8 years agoAllow ARC Linux targets that do not use uclibc.
Vineet Gupta [Thu, 2 Jun 2016 14:03:47 +0000 (15:03 +0100)]
Allow ARC Linux targets that do not use uclibc.

bfd    * config.bfd: Replace -uclibc with *.

gas    * configure.tgt: Replace -uclibc with *.

ld     * configure.tgt: Replace -uclibc with *.

8 years agoReplace data32 with data16 in comments
H.J. Lu [Thu, 2 Jun 2016 13:50:45 +0000 (06:50 -0700)]
Replace data32 with data16 in comments

The 0x66 prefix is data16, not data32 in 64-bit.

* elf64-x86-64.c: Replace data32 with data16 in comments.

8 years agoAdd support for 48 and 64 bit ARC instructions.
Andrew Burgess [Thu, 2 Jun 2016 13:03:23 +0000 (14:03 +0100)]
Add support for 48 and 64 bit ARC instructions.

gas * config/tc-arc.c (parse_opcode_flags): New function.
(find_opcode_match): Move flag parsing code out to new function.
Ignore operands marked IGNORE.
(build_fake_opcode_hash_entry): New function.
(find_special_case_long_opcode): New function.
(find_special_case): Lookup long opcodes.
* testsuite/gas/arc/nps400-7.d: New file.
* testsuite/gas/arc/nps400-7.s: New file.

include * opcode/arc.h (MAX_INSN_ARGS): Increase to 16.
(struct arc_long_opcode): New structure.
(arc_long_opcodes): Declare.
(arc_num_long_opcodes): Declare.

opcodes * arc-dis.c (struct arc_operand_iterator): New structure.
(find_format_from_table): All the old content from find_format,
with some minor adjustments, and parameter renaming.
(find_format_long_instructions): New function.
(find_format): Rewritten.
(arc_insn_length): Add LSB parameter.
(extract_operand_value): New function.
(operand_iterator_next): New function.
(print_insn_arc): Use new functions to find opcode, and iterator
over operands.
* arc-opc.c (insert_nps_3bit_dst_short): New function.
(extract_nps_3bit_dst_short): New function.
(insert_nps_3bit_src2_short): New function.
(extract_nps_3bit_src2_short): New function.
(insert_nps_bitop1_size): New function.
(extract_nps_bitop1_size): New function.
(insert_nps_bitop2_size): New function.
(extract_nps_bitop2_size): New function.
(insert_nps_bitop_mod4_msb): New function.
(extract_nps_bitop_mod4_msb): New function.
(insert_nps_bitop_mod4_lsb): New function.
(extract_nps_bitop_mod4_lsb): New function.
(insert_nps_bitop_dst_pos3_pos4): New function.
(extract_nps_bitop_dst_pos3_pos4): New function.
(insert_nps_bitop_ins_ext): New function.
(extract_nps_bitop_ins_ext): New function.
(arc_operands): Add new operands.
(arc_long_opcodes): New global array.
(arc_num_long_opcodes): New global.
* arc-nps400-tbl.h: Add comments referencing arc_long_opcodes.

8 years agoFix a bug displaying the interpretation of a CFA block that just contains DW_CFA_NOP...
Nick Clifton [Thu, 2 Jun 2016 10:34:49 +0000 (11:34 +0100)]
Fix a bug displaying the interpretation of a CFA block that just contains DW_CFA_NOP instructions.

* dwarf.c (display_debug_frames): Do not display any
interpretation if the block consists solely of DW__CFA_NOPs.

8 years agoRevert PR16467 change
Alan Modra [Mon, 30 May 2016 00:13:44 +0000 (09:43 +0930)]
Revert PR16467 change

This reverts the pr16467 change, which was incorrect due to faulty
analysis of the pr16467 testcase.  The failure was not due to a
mismatch in symbol type (ifunc/non-ifunc) but due to a symbol loop
being set up.

See https://sourceware.org/ml/binutils/2016-06/msg00013.html for some
rambling on versioned symbols and ELF shared library symbol overriding
that explain this patch.

bfd/
PR ld/20159
PR ld/16467
* elflink.c (_bfd_elf_merge_symbol): Revert PR16467 change.
(_bfd_elf_add_default_symbol): Don't indirect to/from defined
symbol given a version by a script different to the version
of the symbol being added.
(elf_link_add_object_symbols): Use _bfd_elf_strtab_save and
_bfd_elf_strtab_restore.  Don't fudge dynstr references.
* elf-strtab.c (_bfd_elf_strtab_restore_size): Delete.
(struct strtab_save): New.
(_bfd_elf_strtab_save, _bfd_elf_strtab_restore): New functions.
* elf-bfd.h (_bfd_elf_strtab_restore_size): Delete.
(_bfd_elf_strtab_save, _bfd_elf_strtab_restore): Declare.

8 years agons32k: remove dupplicate definition of input_line_pointer
Trevor Saunders [Sun, 29 May 2016 05:04:01 +0000 (01:04 -0400)]
ns32k: remove dupplicate definition of input_line_pointer

gas/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-ns32k.c: Remove definition of input_line_pointer.

8 years agoadd more extern C
Trevor Saunders [Sun, 29 May 2016 08:29:22 +0000 (04:29 -0400)]
add more extern C

opcodes/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* nds32-asm.h: Add extern "C".
* sh-opc.h: Likewise.

bfd/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* elf32-hppa.h: Add extern "C".
* elf32-nds32.h: Likewise.
* elf32-tic6x.h: Likewise.

include/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* elf/mips.h: Likewise.
* elf/sh.h: Likewise.
* opcode/d10v.h: Likewise.
* opcode/d30v.h: Likewise.
* opcode/ia64.h: Likewise.
* opcode/mips.h: Likewise.
* opcode/ppc.h: Likewise.
* opcode/sparc.h: Likewise.
* opcode/tic6x.h: Likewise.
* opcode/v850.h: Likewise.

8 years agoavr: replace sentinal with iteration from 0 to ARRAY_SIZE
Trevor Saunders [Fri, 13 May 2016 06:51:41 +0000 (02:51 -0400)]
avr: replace sentinal with iteration from 0 to ARRAY_SIZE

This seems a little easier to understand than using a sentinal, and will
hopefully let the compiler optimize the loop better.  It also has the effect
that we stop initializing a field of the sentinal that is an enum with zero.

gas/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-avr.c (avr_parse_cons_expression): Replace iteration to
sentinal with iteration to array size.

8 years agoxtensa: typedef enums when defining them
Trevor Saunders [Mon, 28 Mar 2016 09:42:02 +0000 (05:42 -0400)]
xtensa: typedef enums when defining them

I think this is the more typical way to do this.  Its also slightly shorter and
less repeditive.

gas/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/xtensa-relax.h: Move typedefs of enums to the enums
definition.

8 years agons32k: use XOBNEW in another spot
Trevor Saunders [Sun, 29 May 2016 05:04:15 +0000 (01:04 -0400)]
ns32k: use XOBNEW in another spot

gas/ChangeLog:

2016-06-01  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-ns32k.c (bit_fix_new): Replace obstack-alloc with XOBNEW
macro.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Jun 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd new Serbian translation for the bfd library.
Nick Clifton [Wed, 1 Jun 2016 15:51:55 +0000 (16:51 +0100)]
Add new Serbian translation for the bfd library.

* po/sr.po: New Serbian translation.
* configure.ac (ALL_LINGUAS): Add sr.
* configure: Regenerate.

8 years agogdb/remote-fileio.c: Eliminate custom SIGINT signal handler
Pedro Alves [Wed, 1 Jun 2016 15:34:49 +0000 (16:34 +0100)]
gdb/remote-fileio.c: Eliminate custom SIGINT signal handler

... and fix Ctrl-C races.

The current remote-fileio.c SIGINT/EINTR code can lose Ctrl-C --
there's a period where SIG_IGN is installed as signal handler, for
example.

Since:

 - remote.c no longer installs a custom SIGINT handler;

 - The current remote-fileio.c SIGINT handler is basically the same as
   the default SIGINT handler (event-top.c:handle_sigint), in
   principle, except that instead of setting the quit flag, it sets a
   separate flag.

I think we should be able to completely remove the remote-fileio.c
SIGINT handler, and centralize on the quit flag, thus fixing the
Ctrl-C race.

gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <palves@redhat.com>

* remote-fileio.c (remote_fio_ctrl_c_flag, remote_fio_sa)
(remote_fio_osa)
(remote_fio_ofunc, remote_fileio_sig_init, remote_fileio_sig_set)
(remote_fileio_sig_exit, remote_fileio_ctrl_c_signal_handler):
Delete.
(remote_fileio_o_quit_handler): New global.
(remote_fileio_quit_handler): New function.
(remote_fileio_reply): Check the quit flag instead of the custom
'remote_fio_ctrl_c_flag' flag.  Restore the quit handler instead
of changing the SIGINT handler.
(do_remote_fileio_request): Override the quit handler instead of
changing the SIGINT handler.

8 years agoAdd support for some variants of the ARC nps400 rflt instruction.
Graham Markall [Wed, 1 Jun 2016 15:29:27 +0000 (16:29 +0100)]
Add support for some variants of the ARC nps400 rflt instruction.

gas     * testsuite/gas/arc/nps-400-1.s: Add rflt variants with
        operands of types a,b,u6, 0,b,u6, and 0,b,limm.
        * testsuite/gas/arc/nps-400-1.d: Likewise.

opcodes * arc-nps400-tbl.h: Add operands a,b,u6, 0,b,u6, and
        0,b,limm to the rflt instruction.

8 years agoAdd xmalloc_failed() function to common-utils.c in to avoid the need to link in libib...
Nick Clifton [Wed, 1 Jun 2016 10:44:08 +0000 (11:44 +0100)]
Add xmalloc_failed() function to common-utils.c in to avoid the need to link in libiberty's xmalloc code.

8 years agoinfcmd, btrace: fix crash in 'finish' for tailcall-only frames
Markus Metzger [Tue, 31 May 2016 07:03:15 +0000 (09:03 +0200)]
infcmd, btrace: fix crash in 'finish' for tailcall-only frames

Patch 7eb895307f53 Skip unwritable frames in command "finish"
skips non-writable frames in addition to tailcall frames.

If skip_tailcall_frames already returns NULL, skip_unwritable_frames
will be called with a NULL frame and crash in get_frame_arch.  This is
caught by gdb.btrace/tailcall-only.exp.

Further, if we ever end up with a mixture of tailcall and non-writable
frames, we may not skip all of them, as intended.

Loop over skip_tailcall_frames and skip_unwritable_frames as long as at least
one of them makes progress.

gdb/
* infcmd.c (skip_finish_frames): New.
(finish_command): Call skip_finish_frames.

8 years agoWake up interruptible_select in remote_fileio ctrl-c handler
Yao Qi [Wed, 1 Jun 2016 08:33:40 +0000 (09:33 +0100)]
Wake up interruptible_select in remote_fileio ctrl-c handler

As reported in PR 19998, after type ctrl-c, GDB hang there and does
not send interrupt.  It causes a fail in gdb.base/interrupt.exp.
All targets support remote fileio should be affected.

When we type ctrc-c, SIGINT is handled by remote_fileio_sig_set,
as shown below,

 #0  remote_fileio_sig_set (sigint_func=0x4495d0 <remote_fileio_ctrl_c_signal_handler(int)>) at /home/yao/SourceCode/gnu/gdb/git/gdb/remote-fileio.c:325
 #1  0x00000000004495de in remote_fileio_ctrl_c_signal_handler (signo=<optimised out>) at /home/yao/SourceCode/gnu/gdb/git/gdb/remote-fileio.c:349
 #2  <signal handler called>
 #3  0x00007ffff647ed83 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:81
 #4  0x00000000005530ce in interruptible_select (n=10, readfds=readfds@entry=0x7fffffffd730, writefds=writefds@entry=0x0, exceptfds=exceptfds@entry=0x0,
    timeout=timeout@entry=0x0) at /home/yao/SourceCode/gnu/gdb/git/gdb/event-top.c:1017
 #5  0x000000000061ab20 in stdio_file_read (file=<optimised out>, buf=0x12d02e0 "\n\022-\001", length_buf=16383)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/ui-file.c:577
 #6  0x000000000044a4dc in remote_fileio_func_read (buf=0x12c0360 "") at /home/yao/SourceCode/gnu/gdb/git/gdb/remote-fileio.c:583
 #7  0x0000000000449598 in do_remote_fileio_request (uiout=<optimised out>, buf_arg=buf_arg@entry=0x12c0340)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/remote-fileio.c:1179

we don't set quit_serial_event,

  do
    {
      res = gdb_select (n, readfds, writefds, exceptfds, timeout);
    }
  while (res == -1 && errno == EINTR);

  if (res == 1 && FD_ISSET (fd, readfds))
    {
      errno = EINTR;
      return -1;
    }
  return res;

we can't go out of the loop above, and that is why GDB can't send
interrupt.

Recently, we stop throwing exception from SIGINT handler
(remote_fileio_ctrl_c_signal_handler)
https://sourceware.org/ml/gdb-patches/2016-03/msg00372.html, which
is correct, because gdb_select is interruptible.  However, in the
same patch series, we add interruptible_select later as a wrapper
to gdb_select, https://sourceware.org/ml/gdb-patches/2016-03/msg00375.html
and it is not interruptible (because of the loop in it) unless
select/poll-able file descriptors are marked.

This fix in this patch is to call quit_serial_event_set, so that we can
go out of the loop above, return -1 and set errno to EINTR.

2016-06-01  Yao Qi  <yao.qi@linaro.org>

PR remote/19998
* remote-fileio.c (remote_fileio_ctrl_c_signal_handler): Call
quit_serial_event_set.

8 years agosh: make constant unsigned to avoid narrowing
Trevor Saunders [Sun, 29 May 2016 00:29:54 +0000 (20:29 -0400)]
sh: make constant unsigned to avoid narrowing

Shifting into the sign bit of a 32 bit int and then converting to a unsigned
type is less straight forward than just shifting an unsigned value.

opcodes/ChangeLog:

2016-05-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* sh-opc.h (ARCH_SH_HAS_DSP): Make the shifted value an unsigned
constant.

8 years agoDocument the GDB 7.11.1 release in gdb/ChangeLog
Joel Brobecker [Wed, 1 Jun 2016 00:49:49 +0000 (17:49 -0700)]
Document the GDB 7.11.1 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.11.1 released.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Jun 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years ago[PR gdb/19893] Fix handling of synthetic C++ references
Martin Galvan [Tue, 31 May 2016 18:54:01 +0000 (15:54 -0300)]
[PR gdb/19893] Fix handling of synthetic C++ references

https://sourceware.org/bugzilla/show_bug.cgi?id=19893

I've traced the main source of the problem to pieced_value_funcs.coerce_ref not being
implemented. Since gdb always assumes references are implemented as pointers, this
causes it to think that it's dealing with a NULL pointer, thus breaking any operations
involving synthetic references.

What I did here was implementing pieced_value_funcs.coerce_ref using some of the synthetic
pointer handling code from indirect_pieced_value, as Pedro suggested. I also made a few
adjustments to the reference printing code so that it correctly shows either the address
of the referenced value or (if it's non-addressable) the "<synthetic pointer>" string.

I also wrote some unit tests based on Dwarf::assemble; these took a while to make
because in most cases I needed a synthetic reference to a physical variable. Additionally,
I started working on a unit test for classes that have a vtable, but ran into a few issues
so that'll probably go in a future patch. One thing that should definitely be fixed is that
proc function_range (called for MACRO_AT_func) will always try to compile/link using gcc
with the default options instead of g++, thus breaking C++ compilations that require e.g. libstdc++.

gdb/ChangeLog:

* dwarf2loc.c (coerce_pieced_ref, indirect_synthetic_pointer,
fetch_const_value_from_synthetic_pointer): New functions.
(indirect_pieced_value): Move lower half to indirect_synthetic_pointer.
(pieced_value_funcs): Implement coerce_ref.
* valops.c (value_addr): Call coerce_ref for synthetic references.
* valprint.c (valprint_check_validity): Return true for synthetic
references.  Also, don't show "<synthetic pointer>" if they reference
addressable values.
(generic_val_print_ref): Handle synthetic references.  Also move some
code to print_ref_address.
(print_ref_address, get_value_addr_contents): New functions.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/implref.exp: Rename to...
* gdb.dwarf2/implref-const.exp: ...this.  Also add more test statements.
* gdb.dwarf2/implref-array.c: New file.
* gdb.dwarf2/implref-array.exp: Likewise.
* gdb.dwarf2/implref-global.c: Likewise.
* gdb.dwarf2/implref-global.exp: Likewise.
* gdb.dwarf2/implref-struct.c: Likewise.
* gdb.dwarf2/implref-struct.exp: Likewise.

8 years agoobjcopy add-symbol uninitialised struct
Alan Modra [Tue, 31 May 2016 10:51:09 +0000 (20:21 +0930)]
objcopy add-symbol uninitialised struct

* objcopy.c: Formatting, whitespace throughout.
(copy_main): Init newsym->othersym.
(parse_symflags): Make len a size_t.  Adjust uses.

8 years agoDon't needlessly clear xmemdup allocated memory.
Alan Modra [Tue, 31 May 2016 11:04:47 +0000 (20:34 +0930)]
Don't needlessly clear xmemdup allocated memory.

* xmemdup.c (xmemdup): Use xmalloc rather than xcalloc.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 May 2016 00:00:16 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agogold/s390: Fix compilation on gcc 4.4
Marcin Kościelnicki [Fri, 6 May 2016 21:02:43 +0000 (23:02 +0200)]
gold/s390: Fix compilation on gcc 4.4

gold/ChangeLog:

PR/19960
* s390.cc (Target_s390::ss_code_st_r14): Removed.
(Target_s390::ss_code_l_r14): Removed.
(Target_s390::ss_code_ear): Removed.
(Target_s390::ss_code_c): Removed.
(Target_s390::ss_match_st_r14): New function.
(Target_s390::ss_match_l_r14): New function.
(Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
of matching code directly.
(Target_s390::ss_match_ear): New function.
(Target_s390::ss_match_c): New function.
(Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
of matching code directly.

8 years agoAdd tests for 64bit values in trace-condition.exp
Antoine Tremblay [Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)]
Add tests for 64bit values in trace-condition.exp

This patch adds tests for emit operations with 64 bit values. It takes
special care to avoid mistakes that one could make on a 32bit architecture
using 64bit values.

gdb/testsuite/ChangeLog:

* gdb.trace/trace-condition.exp: Add 64bit tests.

8 years agoAdd variable length tests for emit_ref in trace-condition.exp
Antoine Tremblay [Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)]
Add variable length tests for emit_ref in trace-condition.exp

This patch add variable length tests for emit_ref by reading the variable
passed as argument of 8 to 64 bit.

gdb/testsuite/ChangeLog:

* gdb.trace/trace-condition.c (marker): Adapt signature to 8 to 64
bits types.
(main): Adapt to 8 to 64 bits types.
* gdb.trace/trace-condition.exp: Add new tests.

8 years agoAdd emit_less_unsigned test in trace-condition.exp
Antoine Tremblay [Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)]
Add emit_less_unsigned test in trace-condition.exp

This patch adds coverage for emit_less_unsigned.

gdb/testsuite/ChangeLog:

* gdb.trace/trace-condition.exp: Add emit_less_unsigned test.

8 years agoMove trace conditions tests from ftrace.exp to trace-condition.exp
Antoine Tremblay [Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)]
Move trace conditions tests from ftrace.exp to trace-condition.exp

This patch moves conditional tests that were done in ftrace.exp to
trace-condition.exp.

Note that emit_ref is now tested by the anarg local variable there is no
need to test the register directly.

All emit calls have been tested using asserts before / after the move, to
ensure that the tests cover the same functions.

Note that these function were not covered before and are still not:
emit_gt_goto, emit_lt_goto, emit_pop, emit_unsigned_less.

gdb/testsuite/ChangeLog:

* gdb.trace/ftrace.exp (test_ftrace_condition): Remove.
Move condition tests...
* gdb.trace/trace-condition.exp: Here.

8 years agoAdd counter-cases for trace-condition.exp tests
Antoine Tremblay [Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)]
Add counter-cases for trace-condition.exp tests

In trace-condition.exp, tests are done by doing a conditional tracepoint
and validating that the trace contains all the frames that could be
collected if that condition is true.

E.g. test_tracepoints $trace_command "21 + 21 == 42" 10

This will always return true and collect the 10 frames possible to collect
with the test program.

However, if the condition evaluation is broken such that the condition is
unconditional we will not notice this problem.

This patch adds counter-cases to such conditions like so:

$trace_command "21 + 11 == 42" 0

This way such a problem would be noticed.

gdb/testsuite/ChangeLog:

* gdb.trace/trace-condition.exp: Add counter-case tests.

8 years agoPR 15231: import bare DW_TAG_lexical_block
Jan Kratochvil [Mon, 30 May 2016 12:14:43 +0000 (14:14 +0200)]
PR 15231: import bare DW_TAG_lexical_block

Local variables in lambdas are not accessible
https://sourceware.org/bugzilla/show_bug.cgi?id=15231

GDB: read_lexical_block_scope
  /* Ignore blocks with missing or invalid low and high pc attributes.  */
[...]
  if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
    return;

But sometimes there is:

FAIL: gcc-5.3.1-6.fc23.x86_64
 <2><92>: Abbrev Number: 11 (DW_TAG_lexical_block)
 <3><9c>: Abbrev Number: 13 (DW_TAG_structure_type)
    <9d>   DW_AT_name        : (indirect string, offset: 0x3c): <lambda()>
    [...]

Where DW_TAG_lexical_block has no attributes.  Such whole subtree is currently
dropped by GDB while I think it should just import all its children DIEs.

It even XFAIL->XPASSes gdb.ada/out_of_line_in_inlined.exp:
commit 0fa7fe506c242b459c4c05d331e7c7d66fb52390
Author: Joel Brobecker <brobecker@adacore.com>
    out of line functions nested inside inline functions.
So I have removed that xfail.

gdb/ChangeLog
2016-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR c++/15231
* dwarf2read.c (enum pc_bounds_kind): Add PC_BOUNDS_INVALID.
(process_psymtab_comp_unit_reader, read_func_scope): Adjust callers.
(read_lexical_block_scope): Import DIEs from bare DW_TAG_lexical_block.
(read_call_site_scope): Adjust callers.
(dwarf2_get_pc_bounds): Implement pc_bounds_invalid.
(dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.

gdb/testsuite/ChangeLog
2016-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR c++/15231
* gdb.ada/out_of_line_in_inlined.exp: Remove xfails.
* gdb.dwarf2/dw2-lexical-block-bare.exp: New file.

8 years agoCode cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
Jan Kratochvil [Mon, 30 May 2016 12:11:43 +0000 (14:11 +0200)]
Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum

Make the code (maybe) more readable + primarily prepare it for [patch 2/2]
enum extension.

This change should have no code change impact.

gdb/ChangeLog
2016-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

Code cleanup: dwarf2_get_pc_bounds: -1/0/+1 -> enum
* dwarf2read.c (enum pc_bounds_kind) New.
(dwarf2_get_pc_bounds): Use it in the declaration.
(process_psymtab_comp_unit_reader): Adjust caller.  Rename has_pc_info
to cu_bounds_kind.
(read_func_scope, read_lexical_block_scope, read_call_site_scope):
Adjust callers.
(dwarf2_get_pc_bounds): Use enum pc_bounds_kind in the definition.
(dwarf2_get_subprogram_pc_bounds, get_scope_pc_bounds): Adjust callers.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 May 2016 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoNEWS: QCatchSyscalls: simplify
Jan Kratochvil [Sun, 29 May 2016 18:45:42 +0000 (20:45 +0200)]
NEWS: QCatchSyscalls: simplify

Standardize the QCatchSyscalls NEWS entry.

gdb/ChangeLog
2016-05-29  Jan Kratochvil  <jan.kratochvil@redhat.com>

* NEWS (QCatchSyscalls): Remove the parameter.  Include ...
(QCatchSyscalls:1 in qSupported) ... this separate entry which got
deleted.

8 years agoNEWS: Remove empty line.
Jan Kratochvil [Sun, 29 May 2016 16:40:32 +0000 (18:40 +0200)]
NEWS: Remove empty line.

gdb/ChangeLog
2016-05-29  Jan Kratochvil  <jan.kratochvil@redhat.com>

* NEWS (N stop reply): Remove empty line.

8 years agoAdd missing ChangeLog entries
H.J. Lu [Sun, 29 May 2016 15:26:43 +0000 (08:26 -0700)]
Add missing ChangeLog entries

8 years agoAdd .noavx512XX directives to x86 assembler
H.J. Lu [Fri, 27 May 2016 22:41:45 +0000 (15:41 -0700)]
Add .noavx512XX directives to x86 assembler

Add .noavx512f, .noavx512cd, .noavx512er, .noavx512pf, .noavx512dq,
.noavx512bw, .noavx512vl, .noavx512ifma, .noavx512vbmi directives to x86
assembler.

gas/

PR gas/20145
* config/tc-i386.c (cpu_noarch): Add noavx512f, noavx512cd,
noavx512er, noavx512pf, noavx512dq, noavx512bw, noavx512vl,
noavx512ifma and noavx512vbmi.
* doc/c-i386.texi: Mention noavx512f, noavx512cd, noavx512er,
noavx512pf, noavx512dq, noavx512bw, noavx512vl, noavx512ifma
and noavx512vbmi.
* testsuite/gas/i386/i386.exp: Run noavx512-1 and noavx512-2.
* testsuite/gas/i386/noavx512-1.l: New file.
* testsuite/gas/i386/noavx512-1.s: Likewise.
* testsuite/gas/i386/noavx512-2.l: Likewise.
* testsuite/gas/i386/noavx512-2.s: Likewise.

opcodes/

PR gas/20145
* i386-gen.c (cpu_flag_init): Add CPU_ANY_AVX512F_FLAGS,
CPU_ANY_AVX512CD_FLAGS, CPU_ANY_AVX512ER_FLAGS,
CPU_ANY_AVX512PF_FLAGS, CPU_ANY_AVX512DQ_FLAGS,
CPU_ANY_AVX512BW_FLAGS, CPU_ANY_AVX512VL_FLAGS,
CPU_ANY_AVX512IFMA_FLAGS and CPU_ANY_AVX512VBMI_FLAGS.
* i386-init.h: Regenerated.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd dependencies to configure rule
Alan Modra [Sat, 28 May 2016 13:06:04 +0000 (22:36 +0930)]
Add dependencies to configure rule

* Makefile.tpl (configure): Depend on m4 files included.
* Makefile.in: Regenerate.

8 years agoMIPS/BFD: Correctly handle `bfd_reloc_outofrange' with branches
Maciej W. Rozycki [Sat, 28 May 2016 09:57:58 +0000 (10:57 +0100)]
MIPS/BFD: Correctly handle `bfd_reloc_outofrange' with branches

Fix internal errors like:

ld: BFD (GNU Binutils) 2.26.51.20160526 internal error, aborting at .../bfd/elfxx-mips.c:10278 in _bfd_mips_elf_relocate_section

ld: Please report this bug.

triggered by the `bfd_reloc_outofrange' condition on branch relocations.

bfd/
* elfxx-mips.c (b_reloc_p): New function.
(_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Handle
branch relocations.

ld/
* testsuite/ld-mips-elf/unaligned-branch.d: New test.
* testsuite/ld-mips-elf/unaligned-branch.s: New test source.
* testsuite/ld-mips-elf/unaligned-text.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new test.