diff -urN binutils-2.19.1/debian/patches/001_ld_makefile_patch.dpatch binutils-2.19.1.cross/debian/patches/001_ld_makefile_patch.dpatch --- binutils-2.19.1/debian/patches/001_ld_makefile_patch.dpatch 2009-03-07 02:51:28.000000000 +0100 +++ binutils-2.19.1.cross/debian/patches/001_ld_makefile_patch.dpatch 2009-03-07 03:07:19.000000000 +0100 @@ -6,6 +6,9 @@ ## DP: Author: Chris Chimelis ## DP: Upstream status: N/A ## DP: Date: ?? +## DP: Fixed by Hector Oron +## DP: corrects some typos on ld scripts to be able to build +## DP: multilib'd cross compilers. if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" @@ -26,22 +29,26 @@ exit 0 @DPATCH@ -diff -urNad --exclude=CVS --exclude=.svn ./ld/Makefile.am /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.am ---- ./ld/Makefile.am 2005-08-31 03:27:36.000000000 +0000 -+++ /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.am 2005-09-02 21:42:18.000000000 +0000 -@@ -20,7 +20,7 @@ +diff -urNad binutils-2.19.1.cross~/ld/Makefile.am binutils-2.19.1.cross/ld/Makefile.am +--- binutils-2.19.1.cross~/ld/Makefile.am 2008-12-23 14:54:51.000000000 +0100 ++++ binutils-2.19.1.cross/ld/Makefile.am 2009-03-07 03:07:06.000000000 +0100 +@@ -18,7 +18,11 @@ # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. -scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) ++scriptdir = `if [ "@host@" = "@target@" ] ; then \ ++ echo '$(libdir)'; \ ++ else \ ++ echo '$(tooldir)/lib'; \ ++ fi` EMUL = @EMUL@ EMULATION_OFILES = @EMULATION_OFILES@ -diff -urNad --exclude=CVS --exclude=.svn ./ld/Makefile.in /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.in ---- ./ld/Makefile.in 2005-08-31 03:27:36.000000000 +0000 -+++ /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.in 2005-09-02 21:43:37.259127535 +0000 -@@ -268,7 +268,7 @@ +diff -urNad binutils-2.19.1.cross~/ld/Makefile.in binutils-2.19.1.cross/ld/Makefile.in +--- binutils-2.19.1.cross~/ld/Makefile.in 2008-12-23 14:54:52.000000000 +0100 ++++ binutils-2.19.1.cross/ld/Makefile.in 2009-03-07 03:07:06.000000000 +0100 +@@ -291,7 +291,7 @@ # We put the scripts in the directory $(scriptdir)/ldscripts. # We can't put the scripts in $(datadir) because the SEARCH_DIR # directives need to be different for native and cross linkers. @@ -50,3 +57,23 @@ BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include +@@ -1307,6 +1307,7 @@ + + ldmain.o: ldmain.c config.status + $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \ ++ -DSCRIPTDIR='"'$(scriptdir)'"' \ + -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \ + -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \ + $(srcdir)/ldmain.c +diff -urNad binutils-2.19.1.cross~/ld/genscripts.sh binutils-2.19.1.cross/ld/genscripts.sh +--- binutils-2.19.1.cross~/ld/genscripts.sh 2008-01-28 12:07:44.000000000 +0100 ++++ binutils-2.19.1.cross/ld/genscripts.sh 2009-03-07 03:07:06.000000000 +0100 +@@ -208,7 +208,7 @@ + *:*${LIBPATH_SUFFIX}) ;; + *) + paths="${exec_prefix}/${target_alias}/lib${LIBPATH_SUFFIX}" +- if [ x"${TOOL_LIB}" != x ]; then ++ if [ "x${TOOL_LIB}" != "x" ]; then + paths="${paths} ${exec_prefix}/${TOOL_LIB}/lib${LIBPATH_SUFFIX}" + fi + for path in $paths; do diff -urN binutils-2.19.1/debian/patches/00list binutils-2.19.1.cross/debian/patches/00list --- binutils-2.19.1/debian/patches/00list 2009-03-07 02:51:28.000000000 +0100 +++ binutils-2.19.1.cross/debian/patches/00list 2009-03-07 03:09:37.000000000 +0100 @@ -5,3 +5,4 @@ 012_check_ldrunpath_length 013_bash_in_ld_testsuite 127_x86_64_i386_biarch +128_PR7093 diff -urN binutils-2.19.1/debian/patches/128_PR7093.dpatch binutils-2.19.1.cross/debian/patches/128_PR7093.dpatch --- binutils-2.19.1/debian/patches/128_PR7093.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ binutils-2.19.1.cross/debian/patches/128_PR7093.dpatch 2009-03-07 03:09:17.000000000 +0100 @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 128_PR7093.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad binutils-2.19.1.cross~/bfd/elf32-arm.c binutils-2.19.1.cross/bfd/elf32-arm.c +--- binutils-2.19.1.cross~/bfd/elf32-arm.c 2009-01-14 10:03:23.000000000 +0100 ++++ binutils-2.19.1.cross/bfd/elf32-arm.c 2009-03-07 03:09:15.000000000 +0100 +@@ -4621,6 +4621,10 @@ + Elf_Internal_Shdr *hdr; + unsigned int i, localsyms; + ++ /* PR 7093: Make sure that we are dealing with an arm elf binary. */ ++ if (! is_arm_elf (abfd)) ++ return; ++ + if ((abfd->flags & DYNAMIC) != 0) + return; +