diff -Naur binutils-2.20.1.orig/bfd/ChangeLog.rtems binutils-2.20.1/bfd/ChangeLog.rtems
--- binutils-2.20.1.orig/bfd/ChangeLog.rtems	1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.20.1/bfd/ChangeLog.rtems	2014-02-14 16:00:14.821158097 +0100
@@ -0,0 +1,6 @@
+2010-08-25  H.J. Lu  <hongjiu.lu@intel.com>
+ 
+	PR ld/11939
+	* elflink.c (elf_link_add_object_symbols): Don't set
+	unique_global for non-ELF hash link table.
+
diff -Naur binutils-2.20.1.orig/bfd/doc/bfd.texinfo binutils-2.20.1/bfd/doc/bfd.texinfo
--- binutils-2.20.1.orig/bfd/doc/bfd.texinfo	2009-09-02 09:18:38.000000000 +0200
+++ binutils-2.20.1/bfd/doc/bfd.texinfo	2014-02-14 16:00:14.822158083 +0100
@@ -1,7 +1,7 @@
 \input texinfo.tex
 @setfilename bfd.info
 @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000,
-@c 2001, 2002, 2003, 2006, 2007, 2008, 2009
+@c 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2013
 @c Free Software Foundation, Inc.
 @c 
 @synindex fn cp
@@ -17,7 +17,8 @@
 @copying
 This file documents the BFD library.
 
-Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007, 2008, 2013
+Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -65,7 +66,8 @@
 @end tex
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 2001, 2003, 2006, 2008 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 2001, 2003, 2006, 2008, 2013
+Free Software Foundation, Inc.
 
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
@@ -323,7 +325,7 @@
 @printindex cp
 
 @tex
-% I think something like @colophon should be in texinfo.  In the
+% I think something like @@colophon should be in texinfo.  In the
 % meantime:
 \long\def\colophon{\hbox to0pt{}\vfill
 \centerline{The body of this manual is set in}
@@ -334,7 +336,7 @@
 \centerline{{\sl\fontname\tensl\/}}
 \centerline{are used for emphasis.}\vfill}
 \page\colophon
-% Blame: doc@cygnus.com, 28mar91.
+% Blame: doc@@cygnus.com, 28mar91.
 @end tex
 
 @bye
diff -Naur binutils-2.20.1.orig/bfd/doc/ChangeLog binutils-2.20.1/bfd/doc/ChangeLog
--- binutils-2.20.1.orig/bfd/doc/ChangeLog	2009-08-30 00:10:58.000000000 +0200
+++ binutils-2.20.1/bfd/doc/ChangeLog	2014-02-14 16:00:14.822158083 +0100
@@ -1,3 +1,7 @@
+2013-01-07  Patrice Dumas  <pertusus@free.fr>
+
+	* bfd.texinfo: Replace @ with @@ when it is part of the text.
+
 2009-08-29  Martin Thuresson  <martin@mtme.org>
 
 	* chew.c (newentry, add_intrinsic): Rename variable new to
diff -Naur binutils-2.20.1.orig/bfd/elflink.c binutils-2.20.1/bfd/elflink.c
--- binutils-2.20.1.orig/bfd/elflink.c	2009-09-10 13:47:12.000000000 +0200
+++ binutils-2.20.1/bfd/elflink.c	2014-02-14 16:00:14.823158069 +0100
@@ -4154,7 +4154,8 @@
 	h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
       *sym_hash = h;
-      h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
+      if (is_elf_hash_table (htab))
+	h->unique_global = (flags & BSF_GNU_UNIQUE) != 0;
 
       new_weakdef = FALSE;
       if (dynamic
diff -Naur binutils-2.20.1.orig/bfd/Makefile.am binutils-2.20.1/bfd/Makefile.am
--- binutils-2.20.1.orig/bfd/Makefile.am	2010-03-03 14:31:55.000000000 +0100
+++ binutils-2.20.1/bfd/Makefile.am	2014-02-14 16:00:14.822158083 +0100
@@ -4,7 +4,7 @@
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Uncomment the following line when doing a release.
-# RELEASE=y
+RELEASE=y
 
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
diff -Naur binutils-2.20.1.orig/bfd/Makefile.in binutils-2.20.1/bfd/Makefile.in
--- binutils-2.20.1.orig/bfd/Makefile.in	2010-03-03 14:59:15.000000000 +0100
+++ binutils-2.20.1/bfd/Makefile.in	2014-02-14 16:00:14.822158083 +0100
@@ -317,7 +317,7 @@
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Uncomment the following line when doing a release.
-# RELEASE=y
+RELEASE = y
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 SUBDIRS = doc po
diff -Naur binutils-2.20.1.orig/binutils/ar.c binutils-2.20.1/binutils/ar.c
--- binutils-2.20.1.orig/binutils/ar.c	2009-09-14 13:43:25.000000000 +0200
+++ binutils-2.20.1/binutils/ar.c	2014-02-14 16:00:14.824158055 +0100
@@ -38,7 +38,6 @@
 #include "filenames.h"
 #include "binemul.h"
 #include "plugin.h"
-#include <sys/stat.h>
 
 #ifdef __GO32___
 #define EXT_NAME_LEN 3		/* Bufflen of addition to name if it's MS-DOS.  */
diff -Naur binutils-2.20.1.orig/binutils/bucomm.c binutils-2.20.1/binutils/bucomm.c
--- binutils-2.20.1.orig/binutils/bucomm.c	2009-09-14 13:43:26.000000000 +0200
+++ binutils-2.20.1/binutils/bucomm.c	2014-02-14 16:00:14.824158055 +0100
@@ -29,7 +29,6 @@
 #include "filenames.h"
 #include "libbfd.h"
 
-#include <sys/stat.h>
 #include <time.h>		/* ctime, maybe time_t */
 #include <assert.h>
 #include "bucomm.h"
diff -Naur binutils-2.20.1.orig/binutils/budbg.h binutils-2.20.1/binutils/budbg.h
--- binutils-2.20.1.orig/binutils/budbg.h	2009-09-02 09:22:31.000000000 +0200
+++ binutils-2.20.1/binutils/budbg.h	2014-02-14 16:00:14.824158055 +0100
@@ -1,5 +1,5 @@
 /* budbg.c -- Interfaces to the generic debugging information routines.
-   Copyright 1995, 1996, 2002, 2003, 2005, 2007, 2008
+   Copyright 1995, 1996, 2002, 2003, 2005, 2007, 2008, 2012
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -23,8 +23,6 @@
 #ifndef BUDBG_H
 #define BUDBG_H
 
-#include <stdio.h>
-
 /* Routine used to read generic debugging information.  */
 
 extern void *read_debugging_info (bfd *, asymbol **, long, bfd_boolean);
diff -Naur binutils-2.20.1.orig/binutils/ChangeLog binutils-2.20.1/binutils/ChangeLog
--- binutils-2.20.1.orig/binutils/ChangeLog	2010-02-22 09:06:49.000000000 +0100
+++ binutils-2.20.1/binutils/ChangeLog	2014-02-14 16:00:14.824158055 +0100
@@ -1,3 +1,24 @@
+2014-02-14  Ralf Corsépius  <ralf.corsepius@rtems.org>
+
+	Backport from master:
+	2012-02-09  Alan Modra  <amodra@gmail.com>
+
+	* sysdep.h: Include sys/stat.h here.
+	* ar.c: Don't include headers already included by sysdep.h.
+	* bucomm.c: Likewise.
+	* budbg.h: Likewise.
+	* dlltool.h: Likewise.
+	* nlmconv.c: Likewise.
+	* objcopy.c: Likewise.
+	* objdump.c: Likewise.
+	* readelf.c: Likewise.
+	* rename.c: Likewise.
+	* resrc.c: Likewise.
+	* strings.c: Likewise.
+	* dllwrap.c: Remove alloca pragma handled by sysdep.h, and
+	remove duplicate headers.
+	* dlltool.c: Likewise and ensure #include sysdep.h is first.
+
 2010-02-05  Christophe Lyon  <christophe.lyon@st.com>
 
 	* objdump.c (disassemble_bytes): Clear aux->reloc before printing
diff -Naur binutils-2.20.1.orig/binutils/dlltool.c binutils-2.20.1/binutils/dlltool.c
--- binutils-2.20.1.orig/binutils/dlltool.c	2009-10-20 10:38:12.000000000 +0200
+++ binutils-2.20.1/binutils/dlltool.c	2014-02-14 16:00:14.824158055 +0100
@@ -254,8 +254,6 @@
 #include "safe-ctype.h"
 
 #include <time.h>
-#include <sys/stat.h>
-#include <stdarg.h>
 #include <assert.h>
 
 #ifdef DLLTOOL_ARM
@@ -307,6 +305,8 @@
 #endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
 #endif /* ! HAVE_SYS_WAIT_H */
 
+#define show_allnames 0
+
 /* ifunc and ihead data structures: ttk@cygnus.com 1997
 
    When IMPORT declarations are encountered in a .def file the
diff -Naur binutils-2.20.1.orig/binutils/dlltool.h binutils-2.20.1/binutils/dlltool.h
--- binutils-2.20.1.orig/binutils/dlltool.h	2009-09-02 09:22:32.000000000 +0200
+++ binutils-2.20.1/binutils/dlltool.h	2014-02-14 16:00:14.824158055 +0100
@@ -1,5 +1,6 @@
 /* dlltool.h -- header file for dlltool
-   Copyright 1997, 1998, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 2003, 2004, 2005, 2007, 2009, 2012
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -18,9 +19,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#include "ansidecl.h"
-#include <stdio.h>
-
 extern void def_code (int);
 extern void def_data (int);
 extern void def_description (const char *);
diff -Naur binutils-2.20.1.orig/binutils/dllwrap.c binutils-2.20.1/binutils/dllwrap.c
--- binutils-2.20.1.orig/binutils/dllwrap.c	2007-07-05 18:54:45.000000000 +0200
+++ binutils-2.20.1/binutils/dllwrap.c	2014-02-14 16:00:14.825158042 +0100
@@ -20,13 +20,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-/* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# ifdef _AIX
- #pragma alloca
-#endif
-#endif
-
 #include "sysdep.h"
 #include "bfd.h"
 #include "libiberty.h"
@@ -35,7 +28,6 @@
 #include "bucomm.h"
 
 #include <time.h>
-#include <sys/stat.h>
 
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
diff -Naur binutils-2.20.1.orig/binutils/nlmconv.c binutils-2.20.1/binutils/nlmconv.c
--- binutils-2.20.1.orig/binutils/nlmconv.c	2009-09-02 09:22:32.000000000 +0200
+++ binutils-2.20.1/binutils/nlmconv.c	2014-02-14 16:00:14.825158042 +0100
@@ -1,6 +1,7 @@
 /* nlmconv.c -- NLM conversion program
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -41,8 +42,6 @@
 
 #include "ansidecl.h"
 #include <time.h>
-#include <sys/stat.h>
-#include <sys/file.h>
 #include <assert.h>
 #include "getopt.h"
 
diff -Naur binutils-2.20.1.orig/binutils/objcopy.c binutils-2.20.1/binutils/objcopy.c
--- binutils-2.20.1.orig/binutils/objcopy.c	2010-01-14 11:48:23.000000000 +0100
+++ binutils-2.20.1/binutils/objcopy.c	2014-02-14 16:00:14.825158042 +0100
@@ -30,7 +30,6 @@
 #include "filenames.h"
 #include "fnmatch.h"
 #include "elf-bfd.h"
-#include <sys/stat.h>
 #include "libbfd.h"
 #include "coff/internal.h"
 #include "libcoff.h"
diff -Naur binutils-2.20.1.orig/binutils/objdump.c binutils-2.20.1/binutils/objdump.c
--- binutils-2.20.1.orig/binutils/objdump.c	2010-02-22 09:06:49.000000000 +0100
+++ binutils-2.20.1/binutils/objdump.c	2014-02-14 16:00:14.826158028 +0100
@@ -69,8 +69,6 @@
 #include <sys/mman.h>
 #endif
 
-#include <sys/stat.h>
-
 /* Internal headers for the ELF .stab-dump code - sorry.  */
 #define	BYTES_IN_WORD	32
 #include "aout/aout64.h"
diff -Naur binutils-2.20.1.orig/binutils/readelf.c binutils-2.20.1/binutils/readelf.c
--- binutils-2.20.1.orig/binutils/readelf.c	2010-01-14 11:48:23.000000000 +0100
+++ binutils-2.20.1/binutils/readelf.c	2014-02-14 16:00:14.827158014 +0100
@@ -41,10 +41,8 @@
   ELF file than is provided by objdump.  In particular it can display DWARF
   debugging information which (at the moment) objdump cannot.  */
 
-#include "config.h"
 #include "sysdep.h"
 #include <assert.h>
-#include <sys/stat.h>
 #include <time.h>
 #ifdef HAVE_ZLIB_H
 #include <zlib.h>
diff -Naur binutils-2.20.1.orig/binutils/rename.c binutils-2.20.1/binutils/rename.c
--- binutils-2.20.1.orig/binutils/rename.c	2009-09-02 09:22:32.000000000 +0200
+++ binutils-2.20.1/binutils/rename.c	2014-02-14 16:00:14.827158014 +0100
@@ -22,8 +22,6 @@
 #include "bfd.h"
 #include "bucomm.h"
 
-#include <sys/stat.h>
-
 #ifdef HAVE_GOOD_UTIME_H
 #include <utime.h>
 #else /* ! HAVE_GOOD_UTIME_H */
diff -Naur binutils-2.20.1.orig/binutils/resrc.c binutils-2.20.1/binutils/resrc.c
--- binutils-2.20.1.orig/binutils/resrc.c	2008-07-30 06:34:56.000000000 +0200
+++ binutils-2.20.1/binutils/resrc.c	2014-02-14 16:00:14.827158014 +0100
@@ -32,11 +32,6 @@
 #include "windres.h"
 
 #include <assert.h>
-#include <errno.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
diff -Naur binutils-2.20.1.orig/binutils/strings.c binutils-2.20.1/binutils/strings.c
--- binutils-2.20.1.orig/binutils/strings.c	2009-09-14 13:43:26.000000000 +0200
+++ binutils-2.20.1/binutils/strings.c	2014-02-14 16:00:14.827158014 +0100
@@ -65,7 +65,6 @@
 #include "getopt.h"
 #include "libiberty.h"
 #include "safe-ctype.h"
-#include <sys/stat.h>
 #include "bucomm.h"
 
 #define STRING_ISGRAPHIC(c) \
diff -Naur binutils-2.20.1.orig/binutils/sysdep.h binutils-2.20.1/binutils/sysdep.h
--- binutils-2.20.1.orig/binutils/sysdep.h	2009-03-18 12:27:17.000000000 +0100
+++ binutils-2.20.1/binutils/sysdep.h	2014-02-14 16:00:14.827158014 +0100
@@ -1,6 +1,6 @@
 /* sysdep.h -- handle host dependencies for binutils
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
+   2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2012
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -69,6 +69,10 @@
 #endif
 #endif
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
 #include "binary-io.h"
 
 #if !HAVE_DECL_STPCPY
