Commit Graph

87349 Commits

Author SHA1 Message Date
Cary Coutant 6eeb0170bb Don't allow COPY relocations for protected symbols.
gold/
	PR gold/19823
	* copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
	parameter; check for protected symbol.
	* copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
	* mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
	* symtab.cc (Symbol::init_fields): Initialize is_protected_.
	(Symbol_table::add_from_dynobj): Mark protected symbols.
	* symtab.h (Symbol::is_protected): New method.
	(Symbol::set_is_protected): New method.
	(Symbol::is_protected_): New data member.

	* testsuite/Makefile.am (copy_test_protected): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/copy_test.cc (main): Add legal reference to protected
	symbol.
	* testsuite/copy_test_v1.cc (main): Likewise.
	* testsuite/copy_test_2.cc (ip): Add protected symbol.
	* testsuite/copy_test_protected.cc: New test source file.
	* testsuite/copy_test_protected.sh: New test script.
2016-05-19 15:05:03 -07:00
Vladimir Radosavljevic 15eb1bebe1 Fix non-deterministic behavior when generating MIPS GOT.
* mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
	for global got symbols, and set addend to 0.
	(Mips_got_entry::hash): Change hash algorithm.
	(Mips_got_entry::equals): Refactor.
	(Mips_got_entry::object): Return input object for local got symbols
	from union d.
	(Mips_got_entry::addend): Change return of the relocation addend.
	(Mips_got_entry::addend_): Move from union d.
	(Mips_got_entry::object_): Move into union d.
	(class Mips_symbol_hash): New class.
	(Mips_got_info::Global_got_entry_set): New type.
	(Mips_got_info::global_got_symbols): Change return type to
	Global_got_entry_set.
	(Mips_got_info::global_got_symbols_): Change type to
	Global_got_entry_set.
	(Mips_symbol::hash): New method.
	(Mips_output_data_la25_stub::symbols_): Change type to std::vector.
	(Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
	(Mips_output_data_mips_stubs::symbols_): Change type to
	Mips_stubs_entry_set.
	(Mips_got_info::record_global_got_symbol): Don't pass object
	argument when creating global got symbol.
	(Mips_got_info::record_got_entry): Remove find before inserting
	got entries.
	(Mips_got_info::add_reloc_only_entries): Change type of iterator
	to Global_got_entry_set.
	(Mips_got_info::count_got_symbols): Likewise.
	(Mips_output_data_la25_stub::create_la25_stub): Use push_back
	for adding entries to symbols_.
	(Mips_output_data_la25_stub::do_write): Change type of iterator
	to std::vector.
	(Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
	of iterator to Mips_stubs_entry_set.
	(Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
	(Mips_output_data_mips_stubs::do_write): Likewise.
2016-05-19 15:04:51 -07:00
H.J. Lu 7d4d970973 Don't convert R_386_GOT32 relocation
Don't convert R_386_GOT32 since we can't tell if it is applied
to "mov $foo@GOT, %reg" which isn't a load via GOT.

bfd/

	PR ld/20117
	* elf32-i386.c (elf_i386_convert_load_reloc): Don't check
	R_386_GOT32X.
	(elf_i386_convert_load): Don't convert R_386_GOT32.

ld/

	PR ld/20117
	* testsuite/ld-i386/i386.exp: Run pr20117.
	* testsuite/ld-i386/pr19609-1i.d: Updated.
	* testsuite/ld-i386/pr20117.d: New file.
	* testsuite/ld-i386/pr20117.s: Likewise.
2016-05-19 12:57:11 -07:00
Alan Modra 606851fbf6 Set sh_entsize for .init_array and similar.
PR gas/20118
	* elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY,
	SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.
2016-05-20 00:35:24 +09:30
Andreas Schwab bfb0d950a5 Fix invalid implicit conversions from void *
* ia64-libunwind-tdep.c (libunwind_descr): Add cast from void *.
	(libunwind_frame_set_descr): Likewise.
	(libunwind_frame_cache): Likewise.
	(libunwind_frame_dealloc_cache): Likewise.
	(libunwind_frame_sniffer): Likewise.
	(libunwind_search_unwind_table): Likewise.
	(libunwind_sigtramp_frame_sniffer): Likewise.
	(libunwind_get_reg_special): Likewise.
	(libunwind_load): Likewise.
	* ia64-linux-nat.c (ia64_linux_fetch_register): Likewise.
	(ia64_linux_store_register): Likewise.
	(ia64_linux_xfer_partial): Likewise.
	* ia64-tdep.c (ia64_access_reg): Likewise.
	(ia64_access_fpreg): Likewise.
	(ia64_access_rse_reg): Likewise.
	(ia64_access_rse_fpreg): Likewise.
2016-05-19 15:31:56 +02:00
Claudiu Zissulescu fc3eec7ebd [ARC] Fixed-linker-related-testsuite-for-ARC
ld/
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* testsuite/ld-elf/compressed1d.d: Removed from notarget.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/group8b.d: Likewise.
	* testsuite/ld-elf/group9a.d: Likewise.
	* testsuite/ld-elf/group9b.d: Likewise.
	* testsuite/ld-elf/pr12851.d: Likewise.
	* testsuite/ld-elf/pr12975.d: Likewise.
	* testsuite/ld-elf/pr13177.d: Likewise.
	* testsuite/ld-elf/pr13195.d: Likewise.
	* testsuite/ld-elf/pr17615.d: Likewise.
	* testsuite/ld-elf/eh-frame-hdr.d: Removed from xfail.
	* testsuite/ld-elf/group3b.d: Likewise.
	* testsuite/ld-srec/srec.exp: Likewise.
	* testsuite/lib/ld-lib.exp (check_gc_sections_available): Mark ARC
	as supporting gc.
	(check_shared_lib_support): Mark ARC as supporting.
2016-05-19 15:06:51 +02:00
Claudiu Zissulescu c0913ebfaf [ARC] Emulation and default script template changes.
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* emulparams/arcelf.sh: Changed.
	* emulparams/arclinux.sh: Likewise.
	* scripttempl/arclinux.sc: Moved to a more standard implementation
	similar to elf.sc.
2016-05-19 15:06:50 +02:00
Claudiu Zissulescu 3c8adacaf9 [ARC] BFD fixes.
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (arc_elf_final_write_processing): Changed.
	(debug_arc_reloc): Likewise.
	(elf_arc_relocate_section): Likewise.
	(elf_arc_check_relocs): Likewise.
	(elf_arc_adjust_dynamic_symbol): Likewise.
	(elf_arc_add_symbol_hook): Likewise.
2016-05-19 15:06:49 +02:00
Maciej W. Rozycki c4107a7def LD/testsuite: Fix `ft32-*-*' position in `check_shared_lib_support'
ld/
	* testsuite/lib/ld-lib.exp (check_shared_lib_support): Reorder
	`ft32-*-*' behind `frv-*-*'.
2016-05-19 11:19:04 +01:00
Maciej W. Rozycki 6b200de0f7 Remove unsupported `am34-*-linux*' target triplet
The `am34-*-linux*' target cannot be configured for, `am34' is not a CPU
name recognized by `config.sub'.  It has never been, required code has
not been contributed to GNU config, neither before nor since the
addition of the target triplet to our configury with commit bfff164249
("Add MN10300 linker relaxation support for symbol differences") back in
2007.  Also there is no difference in actual tool configuration between
the `am34-*-linux*' and `am33_2.0-*-linux*' targets, except from a
different executable prefix and tooldir name.

Given the above remove the target triplet from our configuration.

	bfd/
	* config.bfd: Remove `am34-*-linux*' support.

	ld/
	* configure.tgt: Remove `am34-*-linux*' support.
2016-05-19 11:13:10 +01:00
Alan Modra 514e58b726 Correct "Fix powerpc subis range"
* ppc-opc.c (NSISIGNOPT): Use insert_nsi and extract_nsi.
2016-05-19 16:56:02 +09:30
Alan Modra e43de63c8f Fix powerpc subis range
* ppc-opc.c: Formatting.
	(NSISIGNOPT): Define.
	(powerpc_opcodes <subis>): Use NSISIGNOPT.
2016-05-19 14:18:11 +09:30
Alan Modra 82bc9362f1 Hack crossref tests for powerpc64
A different set of hacks to make the crossref tests pass on powerpc64
and powerpc64le.

	* testsuite/ld-scripts/crossref.exp: Remove -mcall-aixdesc hack.
	* testsuite/ld-scripts/cross2.t: Tweak .opd and .toc placement.
	* testsuite/ld-scripts/cross3.t: Likewise.
	* testsuite/ld-scripts/cross4.t: Likewise.
	* testsuite/ld-scripts/cross5.t: Likewise.
	* testsuite/ld-scripts/cross6.t: Likewise.
	* testsuite/ld-scripts/cross7.t: Likewise.
2016-05-19 14:07:06 +09:30
Alan Modra f1b2ca70c9 ld-elf/shared.exp mix_pic_and_non_pic
Tweaks to make it easier to re-run these testcases by hand.

	* testsuite/ld-elf/shared.exp (mix_pic_and_non_pic): Pass in
	exe name rather than constructing testname.  Fix typo in
	sub-test name.  Log copying.  Use -rpath rather than -R.
2016-05-19 14:07:05 +09:30
Alan Modra 57e7d11848 Allocate ppc64 got and dynrelocs before plt
The idea being to make undefined weak syms dynamic, before deciding
whether a sym needs a plt entry.  Fixes pr19719 ld testcase.

	* elf64-ppc.c (allocate_dynrelocs): Allocate got and other dynamic
	relocs before plt relocs.
2016-05-19 14:06:56 +09:30
Alan Modra 9f284bf9da Fix ppc64le S-record test fail
Segfaults on --defsym symbol (__stack_chk_fail in this instance).

	* elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
	before dereferencing.
2016-05-19 13:40:12 +09:30
GDB Administrator 6472871146 Automatic date update in version.in 2016-05-19 00:00:09 +00:00
Andrew Burgess 38cd8a0de8 gas/arc: Make member of arc_flags const
By making the flgp field of struct arc_flags constant we can remove a
place where we cast away the const-ness of a variable.  Also, given that
the value assigned to this field almost always comes from compile-time
constant data, having the field non-constant is probably a bad thing.

gas/ChangeLog:

	* config/tc-arc.c (find_opcode_match): Remove casting away of
	const.
	* config/tc-arc.h (struct arc_flags): Make flgp field const.
2016-05-18 22:24:51 +01:00
Andrew Burgess 9e32d9ae97 gas/arc: Use BFD_VMA_FMT for printf format specifier
Some debug code has the wrong printf format specifier for some types
that are (ultimately) bfd_vma.  Fixed by using BFD_VMA_FMT string.  This
only becomes an issue when building the tc-arc.c file with -DDEBUG=1 to
build in the debug code.

gas/ChangeLog:

	* config/tc-arc.c (md_pcrel_from_section): Use BFD_VMA_FMT where
	appropriate.
	(md_convert_frag): Likewise.
2016-05-18 22:24:25 +01:00
Andrew Burgess fe779266b3 gas/arc: Fix array overrun when checking opcode array
The opcode array iterator mechanism can, in some situations, result in
reading memory outside of the opcode array.  When using the
iterator-next mechanism to find the next possible arc_opcode, if we find
an opcode where the name field is NULL, or the name does not match, then
the cached opcode pointer is not set to NULL.  The result is that
another call to iterator-next will again increment the opcode
pointer (which might now point outside the opcode array) and attempt to
access the name field of this undefined opcode.

Fixed in this commit by clearing the cached opcode pointer.

I've added a test case, which currently shows the bug, however, this
will only expose this bug while the opcode used (dsp_fp_cmp) is the last
opcode in the table.

gas/ChangeLog:

	* config/tc-arc.c (arc_opcode_hash_entry_iterator_next): Set
	cached opcode to NULL when we reach a non-matching opcode.
	* testsuite/gas/arc/asm-errors-2.d: New file.
	* testsuite/gas/arc/asm-errors-2.err: New file.
	* testsuite/gas/arc/asm-errors-2.s: New file.
2016-05-18 22:23:40 +01:00
Andrew Burgess 3b889a7878 gas/arc: Add guard against operand array overflow.
Currently supplying an input file with too many operands to an
instruction will cause the assembler to overflow and array and trigger
undefined behaviour.

This change checks that we don't access outside the limits of the
operand array.

gas/ChangeLog:

	* config/tc-arc.c (tokenize_arguments): Add checks for array
	overflow.
	* testsuite/gas/arc/asm-errors.s: Addition test line added.
	* testsuite/gas/arc/asm-errors.err: Update expected results.
2016-05-18 22:22:49 +01:00
Tom Tromey 45f4ed92d1 Fix build failure with GCC 4.1.
2016-05-18  Tom Tromey  <tom@tromey.com>

	* rust-lang.c (rust_subscript): Initialize "high".
2016-05-18 11:15:31 -06:00
Nick Clifton f507bebf45 Prevent a run time segmentation fault when stripping a corrupt binary.
PR 20096
	* objcopy.c (copy_relocations_in_section): Also check for the
	symbol pointed to by sym_ptr_ptr being NULL.
2016-05-18 15:21:16 +01:00
Simon Marchi 9e8f9b05ad Add mi-threads-interrupt.exp test (PR 20039)
Add a new test for PR 20039.  The test spawns new threads, then tries to
interrupt, continue, and interrupt again.  This use case was fixed by
commit 5fe966540d in master, but gdb 7.11
is affected (so if you try it on the gdb-7.11-branch right now, the test
will fail).

New in v2, the test now handles mi-async on mode properly.  The failure
was specific to mi-async off, but I don't think it's bad to test the
same thing under async on mode.  I added a little hack when running in
async mode to work around bug 20045.

I also removed one continue/interrupt pair, as a single one was enough to
trigger the problem.

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-threads-interrupt.c: New file.
	* gdb.mi/mi-threads-interrupt.exp: New file.
2016-05-18 10:13:16 -04:00
Simon Marchi 28addb40c7 Fix double prompt output after run control MI commands with mi-async on (PR 20045)
When you use a run control command (-exec-run, -exec-continue,
-exec-next, ...) with mi-async on, an extra (gdb) prompt is displayed:

  -exec-continue
  ^running
  *running,thread-id="all"
  (gdb)
  (gdb)

It doesn't seem to be a big problem for front-ends, since this behavior
started in gdb 7.9 and we haven't heard anything about that.  However,
it caused me some trouble while writing a test for PR 20039 [1].

The problem comes from an extra (gdb) prompt that we write when running
in mi-async off mode to emulate a past buggy behavior.  When executing a
run control command synchronously, previous gdbs always printed a prompt
right away, even though they are not ready to accept new MI commands
until the target stops.  Only at this time should they display a prompt.
But to keep backwards compatibility apparently, we print it anyway.
Since commit 198297aaf, the condition that decides whether we should
print that "bogus" prompt or not has become true, even when running with
mi-async on.  Since we already print a prompt at the end of the
asynchronous command execution, it results in two prompts for one
command.

The proposed fix is to call target_can_async_p instead of
target_is_async_p, to make the condition:

  if (!target_can_async_p () || sync_execution)
    ... show prompt ...

That shows the prompt if we are emulating a synchronous command on top
of an asynchronous target (sync_execution) or if the target simply can't
run asynchronously (!target_can_async_p ()).

Note that this code is changed and this bug fixed by Pedro's separate
console series, but I think it would be nice to have it fixed in the
mean time.

I ran the gdb.mi directory of the testsuite with mi-async on and off, I
didn't see any regressions.

gdb/ChangeLog:

	* mi/mi-main.c (mi_on_resume): Call target_can_async_p instead
	of target_is_async_p.

[1] https://sourceware.org/ml/gdb-patches/2016-05/msg00075.html
2016-05-18 10:12:54 -04:00
Maciej W. Rozycki 1401d2fe67 MIPS/opcodes: Correct mixed MIPS16 and microMIPS disassembly
Mixing MIPS16 and microMIPS code in a single binary isn't usually
supported but GAS happily produces such code if requested.  However it
is not correctly disassembled even if a symbol table is available and
function symbols are correctly anotated with the ISA mode.  This is
because the ELF-header global microMIPS ASE flag takes precedence over
MIPS16 function annotation, causing them to be treated as regular MIPS
code.

Correct the problem by respecting function symbol anotation regardless
of the ELF-header flag.

	binutils/
	* testsuite/binutils-all/mips/mixed-mips16-micromips.d: New test.
	* testsuite/binutils-all/mips/mixed-mips16-micromips.s: New test
	source.
	* testsuite/binutils-all/mips/mips.exp: Run the new test.

	opcodes/
	* mips-dis.c (is_compressed_mode_p): Add `micromips_p' operand,
	replacing references to `micromips_ase' throughout.
	(_print_insn_mips): Don't use file-level microMIPS annotation to
	determine the disassembly mode with the symbol table.
2016-05-18 13:07:24 +01:00
Nick Clifton 5049806017 Updated Swedish translations for bfd and binutils 2016-05-18 12:44:43 +01:00
Trevor Saunders 42e58860e2 rx: make field type enum
gas/ChangeLog:

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

	* config/tc-rx.c (struct cpu_type): Change the type of a field from
	int to enum rx_cpu_types.
2016-05-18 06:26:27 -04:00
Trevor Saunders 4bfaa1cae7 change the type of some fields to bfd_reloc_code_real_type
gas/ChangeLog:

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

	* config/tc-dlx.c (struct machine_it): change the type of a field from
	int to bfd_reloc_code_real_type.
	* config/tc-tic4x.c: Likewise.
2016-05-18 06:26:07 -04:00
Trevor Saunders eb408eaac9 commit ChangeLog for previous commit 2016-05-18 06:17:33 -04:00
Trevor Saunders b42e9fa8cc Change type of v850_target_arch to enum bfd_architecture
gas/ChangeLog:

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

	* config/tc-v850.c (v850_target_arch): change type to enum
	bfd_architecture.
	* config/tc-v850.h (v850_target_arch): Likewise.
2016-05-18 06:09:44 -04:00
Nick Clifton d1f70bdcab Fix lots of linker testsuite failures for the FT32 target.
* scripttempl/ft32.sc: Use fixed constants for memory region
	lengths.  Include DWARF debug sections.
	(.data .bss): Do not assign locations during relocatable links.
	* testsuite/ld-elf/compressed1d.d: Skip for FT32.
	* testsuite/ld-elf/sec-to-seg.exp: Likewise.
	* testsuite/ld-elf/sec64k.exp: Likewise.
	* testsuite/ld-elf/init-fini-array.d: XFail for FT32.
	* testsuite/ld-elf/merge.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.s: Likewise.
	* testsuite/ld-elf/orphan3.d: Likewise.
	* testsuite/ld-elf/pr349.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise.
	* testsuite/lib/ld-lib.exp (check_shared_lib_support): Note
	that the FT32 does not support shared libraries.
2016-05-18 10:11:47 +01:00
Alan Modra 7f9919700d elf32-arm.c build breakage
* elf32-arm.c (elf32_arm_size_stubs): Free or cache local syms
	for each BFD.  Don't goto error_ret_free_local from outside loop.
2016-05-18 15:46:34 +09:30
Maciej W. Rozycki c69075ac09 MIPS/readelf: Use the `d_val' dynamic entry member with the relevant tags
binutils/
	* readelf.c (dynamic_section_mips_val) <DT_MIPS_RLD_VERSION>
	<DT_MIPS_LOCAL_GOTNO, DT_MIPS_CONFLICTNO, DT_MIPS_LIBLISTNO>
	<DT_MIPS_SYMTABNO, DT_MIPS_UNREFEXTNO, DT_MIPS_HIPAGENO>
	<DT_MIPS_DELTA_CLASS_NO, DT_MIPS_DELTA_INSTANCE_NO>
	<DT_MIPS_DELTA_RELOC_NO, DT_MIPS_DELTA_SYM_NO>
	<DT_MIPS_DELTA_CLASSSYM_NO, DT_MIPS_COMPACT_SIZE>: Use the
	`d_val' rather than `d_ptr' member of the dynamic entry.
2016-05-18 04:36:52 +01:00
Alan Modra a255f00a28 PPC_OPERAND_SIGNOPT range.
Commit b84bf58a accidentally extended the range of allowed negative
numbers.

	* config/tc-ppc.c (ppc_insert_operand): Trim PPC_OPERAND_SIGNOPT
	allowed negative range.
	* testsuite/gas/ppc/power9.s: Test xxspltib of -128, not -256.
	* testsuite/gas/ppc/power9.d: Update.
2016-05-18 12:43:21 +09:30
GDB Administrator dec880ee27 Automatic date update in version.in 2016-05-18 00:00:18 +00:00
Simon Marchi 61c6156df6 Fix -exec-run not running asynchronously with mi-async on (PR gdb/18077)
When doing -exec-run on a freshly started GDB, the only target on the
target stack at the time the dummy one.  When mi_async_p is called to
know whether the run should be async, it queries whether the current
target (dummy) supports async, and the answer is no.  The fix is to make
the code query the target that will be used for the run, which is not
necessarily the current target.

No regressions in the gdb.mi directory using the unix, native-gdbserver
and native-extended-gdbserver boards.  The test doesn't pass when
forcing maint set target-async off, obviously, since it makes mi-async
have no effect.  It doesn't seem like other tests are checking for that
eventuality, so I didn't in the new test.

gdb/ChangeLog:

	* mi/mi-main.c (run_one_inferior): Use run target to determine
	whether to run async or not.
	(mi_cmd_exec_run): Likewise.

gdb/testsuite/ChangeLog:

	* gdb.mi/mi-async-run.exp: New file.
	* gdb.mi/mi-async-run.c: New file.
2016-05-17 16:46:18 -04:00
Tom Tromey 01739a3b6a Rename OP_F90_RANGE to OP_RANGE.
This renames OP_F90_RANGE to OP_RANGE, and similarly renames the
f90_range_type enum.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* std-operator.def (OP_RANGE): Rename from OP_F90_RANGE.
	* rust-lang.c: Don't include f-lang.h.
	(rust_range, rust_compute_range, rust_subscript)
	(rust_evaluate_subexp): Update.
	* rust-exp.y: Don't include f-lang.h.
	(ast_range, convert_ast_to_expression): Update.
	* parse.c (operator_length_standard): Update.
	* f-lang.h (enum f90_range_type): Move to expression.h.
	* f-exp.y: Use OP_RANGE.
	* expression.h (enum range_type): New enum; renamed from
	f90_range_type.
	* expprint.c: Don't include f-lang.h.
	(print_subexp_standard, dump_subexp_body_standard): Use OP_RANGE.
	* eval.c (value_f90_subarray, evaluate_subexp_standard): Update.
2016-05-17 12:02:03 -06:00
Tom Tromey 0bdfa368bc Add Rust documentation
This patch adds documentation for the new Rust support in gdb.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* NEWS: Add Rust item.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* gdb.texinfo (Supported Languages): Mention Rust.  Update menu.
	(Rust): New node.
2016-05-17 12:02:02 -06:00
Tom Tromey 67218854b1 Update gdb test suite for Rust
This updates the gdb test suite for Rust.

2016-05-17  Tom Tromey  <tom@tromey.com>
	    Manish Goregaokar <manishsmail@gmail.com>

	* lib/rust-support.exp: New file.
	* lib/gdb.exp (skip_rust_tests): New proc.
	(build_executable_from_specs): Handle rust.
	* lib/future.exp (gdb_find_rustc): New proc.
	(gdb_default_target_compile): Handle rust.
	* gdb.rust/expr.exp: New file.
	* gdb.rust/generics.exp: New file.
	* gdb.rust/generics.rs: New file.
	* gdb.rust/methods.exp: New file.
	* gdb.rust/methods.rs: New file.
	* gdb.rust/modules.exp: New file.
	* gdb.rust/modules.rs: New file.
	* gdb.rust/simple.exp: New file.
	* gdb.rust/simple.rs: New file.
2016-05-17 12:02:01 -06:00
Tom Tromey c44af4ebc0 Add support for the Rust language
This patch adds support for the Rust language.

2016-05-17  Tom Tromey  <tom@tromey.com>
	    Manish Goregaokar <manishsmail@gmail.com>

	* symtab.c (symbol_find_demangled_name): Handle Rust.
	* symfile.c (init_filename_language_table): Treat ".rs" as Rust.
	* std-operator.def (STRUCTOP_ANONYMOUS, OP_RUST_ARRAY): New
	constants.
	* rust-lang.h: New file.
	* rust-lang.c: New file.
	* rust-exp.y: New file.
	* dwarf2read.c (read_file_scope): Add Rust producer sniffing.
	(dwarf2_compute_name, read_func_scope, read_structure_type)
	(read_base_type, read_subrange_type, set_cu_language)
	(new_symbol_full, determine_prefix): Handle Rust.
	* defs.h (enum language) <language_rust>: New constant.
	* Makefile.in (SFILES): Add rust-exp.y, rust-lang.c.
	(COMMON_OBS): Add rust-exp.o, rust-lang.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* gdb.base/default.exp (set language): Add rust.
2016-05-17 12:02:00 -06:00
Tom Tromey 00272ec4b0 Add array start and end strings to generic_val_print_decorations
For Rust value-printing, I wanted to use generic_val_print_array, but
I also wanted to control the starting and ending strings.

This patch adds new strings to generic_val_print_decorations, updates
generic_val_print_array to use them, and updates all the existing
instances of generic_val_print_decorations.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* valprint.h (struct generic_val_print_array) <array_start,
	array_end>: New fields.
	* valprint.c (generic_val_print_array): Add "decorations"
	parameter.  Use "array_start", "array_end".
	(generic_val_print) <TYPE_CODE_ARRAY>: Update.
	* p-valprint.c (p_decorations): Update.
	* m2-valprint.c (m2_decorations): Update.
	* f-valprint.c (f_decorations): Update.
	* c-valprint.c (c_decorations): Update.
2016-05-17 12:02:00 -06:00
Tom Tromey dcd1f97951 Add self-test framework to gdb
I wanted to unit test the Rust lexer, so I added a simple unit testing
command to gdb.

The intent is that self tests will only be compiled into gdb in
development mode.  In release mode they simply won't exist.  So, this
exposes $development to C code as GDB_SELF_TEST.

In development mode, test functions are registered with the self test
module.  A test function is just a function that does some checks, and
throws an exception on failure.

Then this adds a new "maint selftest" command which invokes the test
functions, and a new dejagnu test case that invokes it.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* NEWS: Add "maint selftest" entry.
	* selftest.h: New file.
	* selftest.c: New file.
	* maint.c: Include selftest.h.
	(maintenance_selftest): New function.
	(_initialize_maint_cmds): Add "maint selftest" command.
	* configure.ac (GDB_SELF_TEST): Maybe define.
	* config.in, configure: Rebuild.
	* Makefile.in (SFILES): Add selftest.c.
	(COMMON_OBS): Add selftest.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* gdb.texinfo (Maintenance Commands): Document "maint selftest".

2016-05-17  Tom Tromey  <tom@tromey.com>

	* gdb.gdb/unittest.exp: New file.
2016-05-17 12:01:59 -06:00
Tom Tromey e4b8a1c839 Make gdb expression debugging handle OP_F90_RANGE
print_subexp_standard and dump_subexp_body_standard did not handle
OP_F90_RANGE.  Attempting to dump an expression using this opcode
would fail.

This patch adds support for this opcode to these functions.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* expprint.c: Include f-lang.h.
	(print_subexp_standard, dump_subexp_body_standard): Handle
	OP_F90_RANGE.
2016-05-17 12:01:58 -06:00
Tom Tromey 9ab0bb2a67 Fix latent yacc-related bug in gdb/Makefile.in init.c rule
gdb's Makefile.in does not currently scan .y files to add global
initializers from these files to init.c.  However, at least ada-exp.y
tries to use this feature.

This patch fixes the problem.

2016-05-17  Tom Tromey  <tom@tromey.com>

	* Makefile.in (init.c): Search .y files for initialization
	functions.
2016-05-17 12:01:57 -06:00
Tom Tromey 5ff087ac18 Add DW_LANG_Rust
include/
	* dwarf2.h (enum dwarf_source_language) <DW_LANG_Rust,
	DW_LANG_Rust_old>: New constants.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235643 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-17 11:11:20 -06:00
H.J. Lu 68bce0209f Check global CC in at_least_gcc_version
at_least_gcc_version should check global CC.

	* testsuite/lib/ld-lib.exp (at_least_gcc_version): Check
	global CC.
2016-05-17 09:55:05 -07:00
H.J. Lu 23b5dc392b Fix date in ChangeLog 2016-05-17 09:53:44 -07:00
Thomas Preud'homme 659f032c0a Make ARMv8-M GAS tests pass on non ELF targets
2016-05-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
	* testsuite/gas/arm/archv8m-cmse-msr-base.d: Force Thumb when
	disassembling and stop skipping targets.
	* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
	* testsuite/gas/arm/archv8m-base.d: Also allow nops after the last
	instruction for targets that have stronger alignment requirement.
	* testsuite/gas/arm/archv8m-cmse-base.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
	* testsuite/gas/arm/archv8m-main.d: Likewise.
	* testsuite/gas/arm/archv8m.s: Add label.
	* testsuite/gas/arm/archv8m-cmse.s: Likewise.
	* testsuite/gas/arm/archv8m-cmse-msr.s: Likewise.
	* testsuite/gas/arm/archv8m-cmse-main.s: Likewise.
2016-05-17 16:38:11 +01:00
Senthil Kumar Selvaraj 1bdc036f25 Place progmem data from AVR's libc before other progmem data.
* scripttempl/avr.sc (text): Place .progmem.data from avr-libc
	above .progmem*.
	* scripttempl/avrtiny.sc (text): Likewise.
2016-05-17 13:14:26 +01:00