Don't complain about dbCC to long branch conversion

* config/tc-m68k.c (md_convert_frag_1): Don't complain with
--pcrel about TAB (DBCCLBR, LONG) conversion.
[AArch64] Fix ld testcase linker script glitch.

  Specify -T relocs.ld for emit-relocs-local-addend.d to be consistent
  will all other emit-relocs* testcases

  ld/testsuite/
    * ld-aarch64/emit-relocs-local-addend.d: Use target linker script.
[ARM] Fix 32-bit host build failure.

  gas/
    * config/tc-arm.c (add_to_lit_pool): Use "inst.operands[1].imm" for * sign
    extension.  Casting the type of imm1 and imm2 to offsetT.  Fix one logic
    error when checking X_op.
[GDBserver] Avoid stale errno

Although most compilers follow right-to-left evaluation order, the
order of evaluation of a function call's arguments is really
unspecified.  target_pid_to_str or ptid_of may well clobber errno when
we get to evaluate the third argument to debug_printf.

gdb/gdbserver/
2014-07-15  Pedro Alves  <palves@redhat.com>

	* linux-low.c (linux_kill_one_lwp): Save errno and work with saved
	copy.
Handle OP_STRING in dump_subexp_body_standard

For some reason, OP_STRING is not handled in dump_subexp_body_standard.
This makes the output of "set debug expression 1" very bad when a string
is involved. Example:

(gdb) set debug expression 1
(gdb) print "hello"
... (random garbage, possibly segfault)

This commit handles OP_STRING and skips the appropriate number of exp
elements. The line corresponding to the string now looks like:

	    0  OP_STRING             Language-specific string type: 0

gdb/ChangeLog:

2014-07-15  Simon Marchi  <simon.marchi@ericsson.com>

	* expprint.c (dump_subexp_body_standard): Handle OP_STRING.
[GDB/Linux] Avoid stale errno

The fix that went into GDBserver is also needed on the GDB side.

Although most compilers follow right-to-left evaluation order, the
order of evaluation of a function call's arguments is really
unspecified.  target_pid_to_str may well clobber errno when we get to
evaluate the third argument to fprintf_unfiltered.

gdb/
2014-07-15  Pedro Alves  <palves@redhat.com>

	* linux-nat.c (kill_callback): Save errno and work with saved
	copy.
Add support for the __flash qualifier on AVR

The __flash qualifier is part of the named address spaces for AVR [1]. It
allows putting read-only data in the flash memory, normally reserved for
code.

When used together with a pointer, the DW_AT_address_class attribute is set
to 1 and allows GDB to detect that when it will be dereferenced, the data
will be loaded from the flash memory (with the LPM instruction).

We can now properly debug the following code:

~~~
const __flash char data_in_flash = 0xab;

int
main (void)
{
  const __flash char *pointer_to_flash = &data_in_flash;
}
~~~

~~~
(gdb) print pointer_to_flash
$1 = 0x1e8 <data_in_flash> "\253"
(gdb) print/x *pointer_to_flash
$2 = 0xab
(gdb) x/x pointer_to_flash
0x1e8 <data_in_flash>: 0xXXXXXXab
~~~

Whereas previously, GDB would revert to the default address space which is
RAM and mapped in higher memory:

~~~
(gdb) print pointer_to_flash
$1 = 0x8001e8 ""
~~~

[1] https://gcc.gnu.org/onlinedocs/gcc/Named-Address-Spaces.html

2014-07-15  Pierre Langlois  <pierre.langlois@embecosm.com>

gdb/
	* avr-tdep.c (AVR_TYPE_ADDRESS_CLASS_FLASH): New macro.
	(AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH): Likewise.
	(avr_address_to_pointer): Check for AVR_TYPE_ADDRESS_CLASS_FLASH.
	(avr_pointer_to_address): Likewise.
	(avr_address_class_type_flags): New function.
	(avr_address_class_type_flags_to_name): Likewise.
	(avr_address_class_name_to_type_flags): Likewise.
	(avr_gdbarch_init): Set address_class_type_flags,
	address_class_type_flags_to_name and
	address_class_name_to_type_flags.

gdb/testsuite/
	* gdb.arch/avr-flash-qualifer.c: New.
	* gdb.arch/avr-flash-qualifer.exp: New.
gdb.base/reread.exp: Really restart GDB

The other day I noticed that default_gdb_start reuses the GDB process
if it has been spawned already:

proc default_gdb_start { } {
...
    if [info exists gdb_spawn_id] {
	return 0
    }

I was a bit surprised, and so I hacked in an error to check whether
anything is relying on it:

 + if [info exists gdb_spawn_id] {
 +    error "GDB already spawned"
 + }

And lo, that tripped on a funny buglet (see below).  The comment in
reread.exp says "Restart GDB entirely", but in reality, due to the
above, that's not what is happening, as a gdb_exit call is missing.
The test is proceeding with the previous GDB process...

I don't really want to go hunt for whether there's an odd setup out
there that assumes this in its board file or something, so for now,
I'm taking the simple route of just making the test do what it says it
does.  I think this much makes it an obvious fix.

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 (gdb) PASS: gdb.base/reread.exp: run to foo() second time
 ERROR: tcl error sourcing ../src/gdb/testsuite/gdb.base/reread.exp.
 ERROR: GDB already spawned
     while executing
 "error "GDB already spawned""
     invoked from within
 "if [info exists gdb_spawn_id] {
	 error "GDB already spawned"
     }"
     (procedure "default_gdb_start" line 22)
     invoked from within
 "default_gdb_start"
     (procedure "gdb_start" line 2)
     invoked from within
 "gdb_start"
     invoked from within
 "if [is_remote target] {
     unsupported "second pass: GDB should check for changes before running"
 } else {

     # Put the older executable back in pl..."
     (file "../src/gdb/testsuite/gdb.base/reread.exp" line 114)
     invoked from within
 "source ../src/gdb/testsuite/gdb.base/reread.exp"
     ("uplevel" body line 1)
     invoked from within
 "uplevel #0 source ../src/gdb/testsuite/gdb.base/reread.exp"
     invoked from within
 "catch "uplevel #0 source $test_file_name""
 testcase ../src/gdb/testsuite/gdb.base/reread.exp completed in 1 seconds
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gdb/testsuite/
2014-07-15  Pedro Alves  <palves@redhat.com>

	* gdb.base/reread.exp: Use clean_restart.
Update elf_i386_compute_jump_table_size

Commit e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8 changed how
next_tls_desc_index was set up.  This patch updates
elf_i386_compute_jump_table_size to use elf.srelplt->reloc_count
instead of next_tls_desc_index.

bfd/

	PR ld/17057
	* elf32-i386.c (elf_i386_compute_jump_table_size): Replace
	next_tls_desc_index with elf.srelplt->reloc_count.

ld/testsuite/

	PR ld/17057
	* ld-i386/i386.exp: Run pr17057.
	* ld-i386/pr17057.d: New file.
	* ld-i386/pr17057.s: Likewise.
daily update
[Patch, microblaze]: Add wdc.ext.clear and wdc.ext.flush insns

Added two new instructions, wdc.ext.clear and wdc.ext.flush,
to enable MicroBlaze to flush an external cache, which is
used with the new coherency support for multiprocessing.

Signed-off-by:nagaraju <nmekala@xilix.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
[Patch, microblaze]: Add mlittle-endian and mbig-endian flags

Added support in gas for mlittle-endian and mbig-endian flags
as options.

Updated show usage for MicroBlaze specific assembler options
to include new entries.

Signed-off-by:nagaraju <nmekala@xilix.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
[Patch, microblaze]: Initial port of microblaze core reading support

Added support for reading notes in linux core dumps
Support for reading of PRSTATUS and PSINFO information for rebuilding
".reg" sections of core dumps at run time.

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
[Patch, microblaze]: Communicate in larger blocks with the target

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
[Patch, microblaze]: Add mb singlestepping.

Fix prologue analysis for little-endian.
Always provide a frame base.

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
[Patch, microblaze]: Add initial port of linux gdbserver

add gdb_proc_service_h to gdbserver microblaze-linux

gdbserver needs to initialise the microblaze registers

other archs use this step to run a *_arch_setup() to carry out all
architecture specific setup - may need to add in future

 * add linux-ptrace.o to gdbserver configure
 * gdb/configure.tgt: Set build_gdbserver=yes
 * Update breakpoint opcode
 * fix segfault on connecting gdbserver
 * add microblaze_linux_memory_remove_breakpoint
 * add set_solib_svr4_fetch_link_map_offsets
 * add set_gdbarch_fetch_tls_load_module_address
 * Force reading of r0 as 0, prevent stores

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
[Patch, microblaze]: Add slr and shr regs and little-endian breakpoint

Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
[Patch, microblaze]: Added Backtrace support to GDB

Added backtrace support without debugging information.

Earlier backtrace used to work only when debug information is available.
Previous pc & sp values are calculated incorrectly due to which backtrace
was failing.

In this patch, previous frame sp & pc values are calculated correctly
in microblaze_frame_cache function and supplied them to
microblaze_frame_prev_register function

Signed-off-by:nagaraju <nmekala@xilix.com>
[Patch, microblaze]: Initial support for native gdb

microblaze: Follow PPC method of getting setting registers
using PTRACE PEEK/POKE

Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
[Patch, gdb]: Robustify inline function support

Signed-off-by: Edgar E. Iglesias <edgar@axis.com>