Add binutils-2.21.

Use --enable-gold=default for dual linker support.

Change-Id: Id1a744c7db58a0b5e7a3be174cdfa875f2f86e49
Add binutils-2.22
Fix compiler warnings

Otherwise GCC 4.2.1 (mingw32-gcc) and GCC 4.0.1 (Apple's GCC) produce
warnings and overall build stopped (-Werror used).
Fix ICE when build with mingw32-gcc

This is known bug of gcc-4.2 (which mingw32-gcc in Ubuntu 11.10 is).
This bug were fixed in later versions but we need to be able build with
4.2 too.

Bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33094
Update binutils-2.21. Changes are the followings

gold/yyscript.y
  Status: Backport
  Owner: saugustine
  Backport upstream patch to fix INCLUDE syntax errors.
  http://sourceware.org/ml/binutils/2011-11/msg00089.html

gold/dirsearch.cc
gold/dirsearch.h
gold/script.cc.cc
  Status: Backport
  Owner: saugustine
  Backport upstream patch to implement INCLUDE directive
  http://sourceware.org/ml/binutils/2011-11/msg00165.html

gas/config/tc-arm.c
gas/testsuite/gas/arm/attr-march-armv7.d
include/opcode/arm.h
  Status: Upstream
  Owner: dougkwan
  Fix b/5803351 by merging relevant parts of:
  http://www.cygwin.com/ml/binutils-cvs/2011-04/msg00112.html

gold/arm.cc
  Status: Upstream
  Owner: dougkwan
  Fix PIE crashes on ARM.
  http://sourceware.org/ml/binutils-cvs/2012-02/msg00012.html

gas/as.c
  Status: Local for mobile release branch
  Owner: jingyu
  Allow .incbin by default.

Change-Id: Ie13a05e621ad34e292bc0384b3a05b9f7f6d6f8d
Fix a few gold bugs.

Change-Id: Iac85fb0c38afd5f8d800ac08b30ae4790be09d0b
Fix a gold bug.

gold/icf.cc
gold/icf.h
  Status: In upstream.
    Fix dangling pointer bug caused by calling c_str method of temporary
    string object.
    http://cygwin.com/ml/binutils/2011-02/msg00030.html

Change-Id: If296a2c0adda0ab825bd248abdbe21ab0f071721
Preserve the original p_align and p_flags if they are valid.

bfd/elf.c
  Status: backport
  http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.552&r2=1.553

Change-Id: I7046260ece65494a337c6bbbeee620b761827299
Fixed ld --gc-sections bug.

Change-Id: Ib856c96ca91fea2860c872d81a15ebd496a42783
Fix a typo in https://android-review.googlesource.com/#/c/36585/

Change-Id: I210af69414aefc7f9bdd8ffc1967d4539ff88369
Fixed binutils-2.21/gold build in MacOSX

The gcc 4.2.1 (Apple Inc. build 5666, dot 3) comes with Xcode 3.2.6
emits warning for "while (0);" and breaks the build (thanks to -Werror
which treat warning as error).  Change to "do {} while (0)" to fix it.

Change-Id: I7515b57ea2a7b7aac073d6752aea4620f5a9cce1
Support decoding of symbols for plt entries on arm

Fix to enable objdump to generate function@plt symbols for plt entries on arm as it already did for x86

Change-Id: I5b2997d82a53777b930d16a090dd355e403811be
Signed-off-by: Chris Stratton <cs07024@gmail.com>
Fix error: unresolvable R_ARM_THM_CALL relocation

Backport of fix in cvs binutils 1.277
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-arm.c.diff?cvsroot=src&r1=text&tr1=1.277&r2=text&tr2=1.276&f=u

Related issue & thread
http://code.google.com/p/android/issues/detail?id=35342
https://groups.google.com/forum/?fromgroups#!topic/android-ndk/HaLycHImqL8

Change-Id: Iee449ff9ed8effe6591aee5258eed502c7a484de
Fix ld.gold mingw build

Back port fixes in 2.21.51 for mingw build:

For systems w/o mmap support
  1.29 config.in
  1.62 configure.ac
  1.65 configure
  1.73 fileread.cc
  1.3 mremap.c
  1.142 output.cc
  1.120 output.h

For mingw specific
  1.10 descriptos.cc
  1.143 output.cc

Change-Id: I40e088266c203106864f5a440d8bdf2ab295e547
Removed unused variables

-Werror may fail compilation if variables defined but left unused
The patch already appears in upstream

Change-Id: Ie2310d3176d5514b92c5c6514856622a2c068c74
Fix ld.gold build with latest mingw 20120730

Backport patch 1.859 (CVS ChangeLog revision)
Remove unused typedefs
All changes are already in trunk

Change-Id: I47826e83b37275bab77e94a8213aafbcc9d7de28
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Fix ld.gold i586-mingw32msvc

By adding cast where i586-mingw32msvc-gcc gives warnings later
treated as errors

Change-Id: I98325a9ffc90c151647439bcef343fac9e360770
Provide __executable_start for PIE

Backport

http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/scripttempl/elf.sc.diff?cvsroot=
src&r1=1.114&r2=1.115

to provide __executable_start for PIE.  Also see

Change-Id: I43efa67f287f966e5e9cdd72c31ac63de0ba1a3c
https://android-review.googlesource.com/#/c/42250/
Merge branch 'crystax-r7' into crystax-r8
Fix elfxx-mips.c, mipself.em and elf.c with 5 fixes: a. http://sourceware.org/bugzilla/show_bug.cgi?id=12637 mips-linux-gnu: relocation truncated to fit: R_MIPS_TLS_LDM b. http://sourceware.org/bugzilla/show_bug.cgi?id=12845 ld segfaults when using --gc-sections c. http://sourceware.org/ml/binutils/2011-05/msg00198.html Refix MIPS GOT_PAGE counting d. Follow warning symbol link in mips_elf_count_got_symbols. e. Follow warning symbol link in mips_elf_allocate_lazy_stub.