From: Niels Möller <nisse@lysator.liu.se>
Subject: When linking statically against libbfd we need to link against libz as well.
Bug-Debian: http://bugs.debian.org/648014

--- a/configure
+++ b/configure
@@ -5895,7 +5895,7 @@ else
 fi
 
     i_LIBS=`echo $n_LIBS | sed -e 's/-liberty/& -lintl/'`
-    sn_LIBS=`echo $n_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic/'`
+    sn_LIBS=`echo $n_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic -lz/'`
     si_LIBS=`echo $i_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic/'`
     LIBS=$sn_LIBS
     { echo "$as_me:$LINENO: checking whether bfd works with -Bstatic" >&5
--- a/configure.ac
+++ b/configure.ac
@@ -151,7 +151,7 @@ if test x$has_bfd = xyes ; then
     has_intl=
     AC_CHECK_LIB(intl, dcgettext, [has_intl=yes],[has_intl=no])
     i_LIBS=`echo $n_LIBS | sed -e 's/-liberty/& -lintl/'`
-    sn_LIBS=`echo $n_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic/'`
+    sn_LIBS=`echo $n_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic -lz/'`
     si_LIBS=`echo $i_LIBS | sed -e 's/-lbfd\( -liberty\)*/-Wl,-Bstatic & -Wl,-Bdynamic/'`
     LIBS=$sn_LIBS
     AC_MSG_CHECKING([whether bfd works with -Bstatic])
