gold aarch64 patch to enable linking hello_wolrd.

elfcpp/ChangeLog:
2014-08-08  Han Shen  <shenhan@google.com>

	* aarch64.h (withdrawn): Replaced with R_AARCH64_withdrawn.

2014-08-08  Jing Yu  <jingyu@google.com>
	    Han Shen  <shenhan@google.com>

	* Makefile.am (HFILES): Add aarch64-reloc-property.h.
	(DEFFILES): add aarch64-reloc.def.
	(TARGETSOURCES): Add aarch64-reloc-property.cc.
	(ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
	* Makefile.in: Regenerate.
	* aarch64-reloc-property.cc: New file.
	* aarch64-reloc-property.h: New file.
	* aarch64-reloc.def: New file.
	* aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
	with tab to make the format consistent.
	(Output_data_got_aarch64::symbol_table_): New method.
	(Target_aarch64::do_plt_address_for_global): New method.
	(Target_aarch64::do_plt_address_for_local): New method.
	(Target_aarch64::do_select_as_default_target): New method.
	(Target_aarch64::do_make_data_plt): New method.
	(Target_aarch64::make_data_plt): New method.
	(Output_data_plt_aarch64::has_irelative_section): New method.
	(Output_data_plt_aarch64::address_for_global): New method.
	(Output_data_plt_aarch64::address_for_local): New method.
	(Output_data_plt_aarch64::irelative_rel_): New parameter.
	(Output_data_plt_aarch64::add_entry): Implement contents.
	(Output_data_plt_aarch64::set_final_data_size): Fix typo.
	(Output_data_plt_aarch64::do_write): Remove useless got_base. Set
	the got_pov entry to plt0.
	(Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
	Implement contents.
	(Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
	(AArch64_howto): New struct.
	(aarch64_howto[]): New static const array.
	(AArch64_relocate_functions): New class.
	(Target_aarch64::Scan::get_reference_flags): Remove method.
	(Target_aarch64::Scan::local): Implement to support a few relocations.
	(Target_aarch64::Scan::global): Implement to support a few relocations.
	(Target_aarch64::make_plt_section): Implement contents.
	(Target_aarch64::make_plt_entry): Implement contents.
	(Target_aarch64::do_finalize_sections): Implement contents.
	(Target_aarch64::Relocate::relocate): Implement a few relocations.
	(Target_aarch64::relocate_section): Implement contents.
daily update
        * ldlang.h (struct lang_input_statement_flags): Add pushed
        member.
        * ldlex.h (enum option_values): Add OPTION_PUSH_STATE and
        OPTION_POP_STATE.
        * lexsup.c (ld_options): Add entries for --push-state and
        --pop-state.
        (parse_args): Handle OPTION_PUSH_STATE and OPTION_POP_STATE.
        * ld.texinfo: Document --push-state and --pop-state.
Make test messages in gdb.mi/mi-var-display.exp unique

When I fix a bug in gdb.mi/mi-var-display.exp, I find its test
messages aren't unique, which makes some confusions for me.

$ cat testsuite/gdb.sum | grep "PASS" | sort | uniq -c | sort -n
...
 2 PASS: gdb.mi/mi-var-display.exp: set format variable bar
 2 PASS: gdb.mi/mi-var-display.exp: set format variable foo
 2 PASS: gdb.mi/mi-var-display.exp: set format variable weird.func_ptr
 2 PASS: gdb.mi/mi-var-display.exp: set format variable weird.func_ptr_ptr
 2 PASS: gdb.mi/mi-var-display.exp: show format variable foo
 3 PASS: gdb.mi/mi-var-display.exp: eval variable foo

This patch is to make test messages in mi-var-display.exp unique.

gdb/testsuite:

2014-08-09  Yao Qi  <yao@codesourcery.com>

	PR testsuite/13443
	* gdb.mi/mi-var-display.exp: Make test messages unique.
Remove duplicated code on checking address 0x0 is accessiable

I find some gdb.python tests fail on arm-none-eabi target, because the
tests assume that memory on address 0x is inaccessible.  Some tests
(in gdb.base) are aware of this, so do a "x 0" check first.  However,
the code is copy-n-paste.

This patch is to move the "x 0" check to a procedure in lib/gdb.exp,
and get needed tests call it.  The original code matches pattern
"0x0:\[ \t\]*Error accessing memory address 0x0\r\n$gdb_prompt $", but
I remove it from the new proc is_address_zero_readable, because GDB
doesn't emit such message any more.

gdb/testsuite:

2014-08-09  Yao Qi  <yao@codesourcery.com>

	* gdb.base/display.exp: Invoke is_address_zero_readable.
	* gdb.guile/scm-value.exp (test_value_in_inferior): Likewise.
	* gdb.python/py-value.exp (test_value_in_inferior): Likewise.
	* gdb.base/hbreak-unmapped.exp: Return if
	is_address_zero_readable returns true.
	* gdb.base/signest.exp: Likewise.
	* gdb.base/signull.exp: Likewise.
	* gdb.base/sigbpt.exp: Likewise.
	* gdb.guile/scm-disasm.exp: Do the test if
	is_address_zero_readable returns false.
	* gdb.guile/scm-pretty-print.exp (run_lang_tests): Likewise.
	* gdb.python/py-arch.exp: Likewise.
	* gdb.python/py-prettyprint.exp (run_lang_tests): Likewise.
	* lib/gdb.exp (is_address_zero_readable): New proc.
Fix PR remote/9053: remove dead code on query packet size

The code becomes dead as GDB evolves.  In 2003, Andrew Cagney post patch
https://sourceware.org/ml/gdb-patches/2003-10/msg00511.html to add target
read/write partial methods.  They support query buffer size when both
OFFSET and LEN is zero, and it was used in avr-tdep.c and kod.c.  Then,
Daniel added target_read_object_alloc and avr-tdep.c switches to use that
in patch https://sourceware.org/ml/gdb-patches/2006-07/msg00009.html
From then on, GDB on longer queries the buffer size, so the code
returning packet size in remote_xfer_partial became dead.

PR 17060 is duplicated of PR 9053, so I mention the latter in the
ChangeLog entry.  Rebuild GDB with this patch.  OK to apply?
I'll mark PR 17060 as duplicated once the patch is applied.

gdb:

2014-08-09  Yao Qi  <yao@codesourcery.com>

	PR remote/9053
	* remote.c (remote_xfer_partial): Remove dead code.
daily update
daily update
linux-nat.c (linux_nat_thread_address_space): Delete dead code.
Introduce common/errors.h

This introduces common/errors.h.  This holds some error- and warning-
related declarations that can be used by the code in common, nat and
target.  Some of the declared functions must be provided by the client
as documented by the header file comments.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/errors.h: New file.
	* common/errors.c: Likewise.
	* Makefile.in (SFILES): Add common/errors.c.
	(HFILES_NO_SRCDIR): Add common/errors.h.
	(COMMON_OBS): Add errors.o.
	(errors.o): New rule.
	* common/common-defs.h: Include errors.h.
	* utils.h (perror_with_name, error, verror, warning, vwarning):
	Don't declare.
	* common/common-utils.h: (malloc_failure, internal_error):
	Likewise.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* Makefile.in (SFILES): Add common/errors.c.
	(OBS): Add errors.o.
	(IPA_OBS): Add errors-ipa.o.
	(errors.o): New rule.
	(errors-ipa.o): Likewise.
	* utils.h (perror_with_name, error, warning): Don't declare.
	* utils.c (warning): Renamed and rewritten as...
	(vwarning): New function.
	(error): Renamed and rewritten as...
	(verror): New function.
	(internal_error): Renamed and rewritten as...
	(internal_verror): New function.
Introduce common-types.h

This introduces common-types.h.  This file defines various standard
types used by gdb and gdbserver.

Currently these types are conditionally defined based on GDBSERVER.
The long term goal is to remove all such tests; however, this is
difficult as currently gdb uses definitions from BFD.  In the meantime
this is still a step in the right direction.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/common-types.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add common/common-types.h.
	* common/common-defs.h: Include common-types.h.
	* defs.h (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST)
	(ULONGEST): Remove.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* server.h: Add static assertion.
	(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
Move print-utils.h to common-defs.h

This commit moves the inclusion of print-utils.h to common-defs.h
and removes all other inclusions.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* common/common-defs.h: Include print-utils.h.
	* utils.h: Do not include print-utils.h.

gdb/gdbserver/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* utils.h: Do not include print-utils.h.
Introduce common-debug.h

This introduces common-debug.h.  This holds the flag debug_hw_points
(which can be set to enable debugging of the hardware breakpoint/
watchpoint support code) and debug_printf and debug_vprintf, two
functions that the common code can use to print debugging messages.
Clients of the common code are expected to implement debug_vprintf;
a debug_vprintf function is written from scratch for GDB, and
gdbserver's existing debug_printf is repurposed as debug_vprintf.

common/agent.c is changed to use debug_vprintf rather than
defining the macro DEBUG_AGENT depending on GDBSERVER.

nat/i386-dregs.c is changed to use the externally-implemented
debug_printf, rather than defining it itself, and a now-unnecessary
declaration of debug_hw_points is removed.

Various other files are changed to remove declarations of
debug_hw_points.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/common-debug.h: New file.
	* common/common-debug.c: Likewise.
	* debug.c: Likewise.
	* Makefile.in (SFILES): Add common/common-debug.c.
	(HFILES_NO_SRCDIR): Add common/common-debug.h.
	(COMMON_OBS): Add common-debug.o and debug.o.
	(common-debug.o): New rule.
	* common/common-defs.h: Include common-debug.h.
	* common/agent.c (debug_agent_printf): New function.
	(DEBUG_AGENT): Redefine.
	* nat/i386-dregs.c (debug_printf): Undefine.
	(debug_hw_points): Remove.
	* aarch64-linux-nat.c (debug_hw_points): Likewise.
	* i386-nat.c (debug_hw_points): Likewise.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* Makefile.in (SFILES): Add common/common-debug.c.
	(OBS): Add common-debug.o.
	(common-debug.o): New rule.
	* debug.h (debug_printf): Don't declare.
	* debug.c (debug_printf): Renamed and rewritten as...
	(debug_vprintf): New function.
	* server.h (debug_hw_points): Remove.
	* server.c (debug_hw_points): Likewise.
	* linux-aarch64-low.c (debug_hw_points): Likewise.
Introduce target/target.h

This introduces target/target.h.  This file declares some functions
that the shared code can use and that clients must implement.  It also
changes some shared code to use these functions.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* target/target.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add target/target.h.
	* target.h: Include target/target.h.
	(target_resume, target_wait, target_stop, target_read_memory)
	(target_write_memory, non_stop): Don't declare.
	* target.c (target_read_uint32): New function.
	* common/agent.c: Include target/target.h.
	[!GDBSERVER]: Don't include target.h or infrun.h.
	(agent_get_helper_thread_id): Use target_read_uint32.
	(agent_run_command): Always use target_resume, target_stop,
	target_wait, target_write_memory, and target_read_memory.
	(agent_capability_check): Use target_read_uint32.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* target.c (target_wait, target_stop, target_resume)
	(target_read_memory, target_read_uint32)
	(target_write_memory): New functions.
Introduce target/symbol.h

This introduces target/symbol.h.  This file declares a function that
the shared code can use and that the clients must implement.  It also
changes some shared code to use these functions.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* target/symbol.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add target/symbol.h.
	* target.h: Include target/symbol.h.
	* target.c (target_look_up_symbol): New function.
	* common/agent.c: Include target/symbol.h.
	[!GDBSERVER]: Don't include objfiles.h.
	(agent_look_up_symbols): Use target_look_up_symbol.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* target.c: Include target/symbol.h.
	(target_look_up_symbol): New function.
Introduce common-regcache.h

This introduces common-regcache.h.  This contains two functions that
allow nat/linux-btrace.c to be simplified.  A better long term
solution would be unify the regcache code, but this is sufficient for
now.

gdb/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* common/common-regcache.h: New file.
	* Makefile.in (HFILES_NO_SRCDIR): Add common/common-regcache.h.
	* regcache.h: Include common-regcache.h.
	(regcache_read_pc): Don't declare.
	* regcache.c (get_thread_regcache_for_ptid): New function.
	* nat/linux-btrace.c: Don't include regcache.h.
	Include common-regcache.h.
	(perf_event_read_bts): Use get_thread_regcache_for_ptid.

gdb/gdbserver/
2014-08-07  Tom Tromey  <tromey@redhat.com>
	    Gary Benson  <gbenson@redhat.com>

	* regcache.h: Include common-regcache.h.
	(regcache_read_pc): Don't declare.
	* regcache.c (get_thread_regcache_for_ptid): New function.
Include common-defs.h instead of defs.h/server.h in shared code

This commit makes 19 of the 22 shared .c files in common, nat and
target include common-defs.h instead of defs.h/server.h.  The
remaining three files need slight extra work and are dealt with
in separate commits.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* common/agent.c: Include common-defs.h.
	Don't include defs.h or server.h.
	* common/buffer.c: Likewise.
	* common/common-debug.c: Likewise.
	* common/common-utils.c: Likewise.
	* common/errors.c: Likewise.
	* common/filestuff.c: Likewise.
	* common/format.c: Likewise.
	* common/gdb_vecs.c: Likewise.
	* common/print-utils.c: Likewise.
	* common/ptid.c: Likewise.
	* common/rsp-low.c: Likewise.
	* common/signals.c: Likewise.
	* common/vec.c: Likewise.
	* common/xml-utils.c: Likewise.
	* nat/linux-osdata.c: Likewise.
	* nat/linux-procfs.c: Likewise.
	* nat/linux-ptrace.c: Likewise.
	* nat/mips-linux-watch.c: Likewise.
	* target/waitstatus.c: Likewise.
Remove GDBSERVER uses from linux-btrace.c

This commit makes nat/linux-btrace.c include common-defs.h rather
than defs.h or server.h.  A couple of minor changes were required
to support this change.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* nat/linux-btrace.c: Include common-defs.h.
	Don't include defs.h, server.h or gdbthread.h.
	* nat/linux-btrace.h (struct target_ops): New forward declaration.
Remove GDBSERVER uses from i386-dregs.c

This commit makes nat/i386-dregs.c include common-defs.h rather than
defs.h or server.h.  An extra header required including in order to
support this change.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* nat/i386-dregs.c: Include common-defs.h and break-common.h.
	Don't include defs.h or server.h.
Remove one GDBSERVER use from linux-waitpid.c

This commit makes nat/linux-waitpid.c include common-defs.h rather
than defs.h or server.h.  A use of GDBSERVER had to be left in to
support some some thread_db debug code.  This hack will be removed
when the Linux thread_db code is unified and made shared.

gdb/
2014-08-07  Gary Benson  <gbenson@redhat.com>

	* nat/linux-waitpid.c: Include common-defs.h.
	Don't include defs.h or server.h.
	(linux_debug) [GDBSERVER]: Declare debug_threads.