summaryrefslogtreecommitdiff
path: root/patches/binutils/2.17a
diff options
context:
space:
mode:
Diffstat (limited to 'patches/binutils/2.17a')
-rw-r--r--patches/binutils/2.17a/100-uclibc-conf.patch149
-rw-r--r--patches/binutils/2.17a/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.17a/120-makeinfo-version.patch16
-rw-r--r--patches/binutils/2.17a/130-ld_makefile_patch.patch24
-rw-r--r--patches/binutils/2.17a/140-better_file_error.patch17
-rw-r--r--patches/binutils/2.17a/150-check_ldrunpath_length.patch21
-rw-r--r--patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch28
-rw-r--r--patches/binutils/2.17a/170-bfd-hash-tweak.patch23
-rw-r--r--patches/binutils/2.17a/180-psignal.patch29
-rw-r--r--patches/binutils/2.17a/190-skip-comments.patch95
-rw-r--r--patches/binutils/2.17a/200-cross-gprof.patch22
-rw-r--r--patches/binutils/2.17a/210-i386-no-divide-comment.patch64
12 files changed, 512 insertions, 0 deletions
diff --git a/patches/binutils/2.17a/100-uclibc-conf.patch b/patches/binutils/2.17a/100-uclibc-conf.patch
new file mode 100644
index 0000000..267b76c
--- /dev/null
+++ b/patches/binutils/2.17a/100-uclibc-conf.patch
@@ -0,0 +1,149 @@
+diff -dur binutils-2.17.old/bfd/configure binutils-2.17/bfd/configure
+--- binutils-2.17.old/bfd/configure 2006-06-23 20:17:03.000000000 +0200
++++ binutils-2.17/bfd/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3576,7 +3576,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+diff -dur binutils-2.17.old/binutils/configure binutils-2.17/binutils/configure
+--- binutils-2.17.old/binutils/configure 2006-04-06 23:49:29.000000000 +0200
++++ binutils-2.17/binutils/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+diff -dur binutils-2.17.old/configure binutils-2.17/configure
+--- binutils-2.17.old/configure 2006-04-06 23:49:25.000000000 +0200
++++ binutils-2.17/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -1276,7 +1276,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -1584,7 +1584,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
+--- binutils-2.17.old/configure.in 2006-06-23 20:19:53.000000000 +0200
++++ binutils-2.17/configure.in 2007-05-01 18:26:03.000000000 +0200
+@@ -468,7 +468,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -776,7 +776,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[[3456789]]86-*-vsta) ;; # don't add gprof back in
+ i[[3456789]]86-*-go32*) ;; # don't add gprof back in
+diff -dur binutils-2.17.old/gas/configure binutils-2.17/gas/configure
+--- binutils-2.17.old/gas/configure 2006-04-06 23:49:31.000000000 +0200
++++ binutils-2.17/gas/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3411,7 +3411,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+diff -dur binutils-2.17.old/gprof/configure binutils-2.17/gprof/configure
+--- binutils-2.17.old/gprof/configure 2006-04-06 23:49:33.000000000 +0200
++++ binutils-2.17/gprof/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3414,6 +3414,11 @@
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd* | knetbsd*-gnu)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
+diff -dur binutils-2.17.old/ld/configure binutils-2.17/ld/configure
+--- binutils-2.17.old/ld/configure 2006-04-11 12:36:26.000000000 +0200
++++ binutils-2.17/ld/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3413,7 +3413,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+diff -dur binutils-2.17.old/libtool.m4 binutils-2.17/libtool.m4
+--- binutils-2.17.old/libtool.m4 2005-12-27 17:37:57.000000000 +0100
++++ binutils-2.17/libtool.m4 2007-05-01 18:26:03.000000000 +0200
+@@ -739,7 +739,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+diff -dur binutils-2.17.old/ltconfig binutils-2.17/ltconfig
+--- binutils-2.17.old/ltconfig 2005-07-16 04:36:38.000000000 +0200
++++ binutils-2.17/ltconfig 2007-05-01 18:26:03.000000000 +0200
+@@ -602,6 +602,7 @@
+
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
++linux-uclibc*) ;;
+ linux-gnu*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1247,7 +1248,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+diff -dur binutils-2.17.old/opcodes/configure binutils-2.17/opcodes/configure
+--- binutils-2.17.old/opcodes/configure 2006-02-17 15:36:28.000000000 +0100
++++ binutils-2.17/opcodes/configure 2007-05-01 18:26:03.000000000 +0200
+@@ -3579,7 +3579,7 @@
+ ;;
+
+ # This must be Linux ELF.
+-linux-gnu*)
++linux-gnu*|linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
diff --git a/patches/binutils/2.17a/110-arm-eabi-conf.patch b/patches/binutils/2.17a/110-arm-eabi-conf.patch
new file mode 100644
index 0000000..88d3a4f
--- /dev/null
+++ b/patches/binutils/2.17a/110-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -dur binutils-2.17.old/configure binutils-2.17/configure
+--- binutils-2.17.old/configure 2007-05-01 18:26:03.000000000 +0200
++++ binutils-2.17/configure 2007-05-01 18:26:06.000000000 +0200
+@@ -1305,7 +1305,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
+diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
+--- binutils-2.17.old/configure.in 2007-05-01 18:26:03.000000000 +0200
++++ binutils-2.17/configure.in 2007-05-01 18:26:06.000000000 +0200
+@@ -497,7 +497,7 @@
+ arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ noconfigdirs="$noconfigdirs target-libjava target-libobjc"
+ ;;
diff --git a/patches/binutils/2.17a/120-makeinfo-version.patch b/patches/binutils/2.17a/120-makeinfo-version.patch
new file mode 100644
index 0000000..50ff5dd
--- /dev/null
+++ b/patches/binutils/2.17a/120-makeinfo-version.patch
@@ -0,0 +1,16 @@
+diff -u binutils-2.18-orig/configure binutils-2.18/configure
+--- binutils-2.18-orig/configure 2007-08-06 16:29:40.000000000 -0400
++++ binutils-2.18/configure 2007-09-27 22:41:51.000000000 -0400
+@@ -6125,10 +6125,10 @@
+ *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
+ *)
+
+- # For an installed makeinfo, we require it to be from texinfo 4.4 or
++ # For an installed makeinfo, we require it to be from texinfo 4.6 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
diff --git a/patches/binutils/2.17a/130-ld_makefile_patch.patch b/patches/binutils/2.17a/130-ld_makefile_patch.patch
new file mode 100644
index 0000000..b40ec67
--- /dev/null
+++ b/patches/binutils/2.17a/130-ld_makefile_patch.patch
@@ -0,0 +1,24 @@
+diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
+--- binutils-2.17.old/ld/Makefile.am 2006-06-03 06:45:50.000000000 +0200
++++ binutils-2.17/ld/Makefile.am 2007-05-01 18:26:09.000000000 +0200
+@@ -20,7 +20,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.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
+--- binutils-2.17.old/ld/Makefile.in 2006-06-03 06:45:50.000000000 +0200
++++ binutils-2.17/ld/Makefile.in 2007-05-01 18:26:09.000000000 +0200
+@@ -269,7 +269,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.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/patches/binutils/2.17a/140-better_file_error.patch b/patches/binutils/2.17a/140-better_file_error.patch
new file mode 100644
index 0000000..7900f17
--- /dev/null
+++ b/patches/binutils/2.17a/140-better_file_error.patch
@@ -0,0 +1,17 @@
+diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
+--- binutils-2.17.old/bfd/opncls.c 2006-03-16 13:20:16.000000000 +0100
++++ binutils-2.17/bfd/opncls.c 2007-05-01 18:26:11.000000000 +0200
+@@ -158,6 +158,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ if (nbfd == NULL)
diff --git a/patches/binutils/2.17a/150-check_ldrunpath_length.patch b/patches/binutils/2.17a/150-check_ldrunpath_length.patch
new file mode 100644
index 0000000..7c24796
--- /dev/null
+++ b/patches/binutils/2.17a/150-check_ldrunpath_length.patch
@@ -0,0 +1,21 @@
+diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
+--- binutils-2.17.old/ld/emultempl/elf32.em 2006-06-12 15:05:04.000000000 +0200
++++ binutils-2.17/ld/emultempl/elf32.em 2007-05-01 18:26:13.000000000 +0200
+@@ -970,6 +970,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -1154,6 +1156,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ command_line.filter_shlib,
diff --git a/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch b/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch
new file mode 100644
index 0000000..0a4980b
--- /dev/null
+++ b/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch
@@ -0,0 +1,28 @@
+diff -dur binutils-2.17.old/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
+--- binutils-2.17.old/bfd/elf32-mips.c 2006-03-22 10:28:13.000000000 +0100
++++ binutils-2.17/bfd/elf32-mips.c 2007-05-01 18:26:15.000000000 +0200
+@@ -1617,7 +1617,9 @@
+
+ /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
+ page sizes of up to that limit, so we need to respect it. */
+-#define ELF_MAXPAGESIZE 0x10000
++/*#define ELF_MAXPAGESIZE 0x10000*/
++/* Use 4K to shrink the elf header. NOT for general use! */
++#define ELF_MAXPAGESIZE 0x1000
+ #define elf32_bed elf32_tradbed
+
+ /* Include the target file again for this target. */
+diff -dur binutils-2.17.old/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
+--- binutils-2.17.old/bfd/elfn32-mips.c 2005-11-23 15:04:17.000000000 +0100
++++ binutils-2.17/bfd/elfn32-mips.c 2007-05-01 18:26:15.000000000 +0200
+@@ -2402,7 +2402,9 @@
+
+ /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
+ page sizes of up to that limit, so we need to respect it. */
+-#define ELF_MAXPAGESIZE 0x10000
++/*#define ELF_MAXPAGESIZE 0x10000*/
++/* Use 4K to shrink the elf header. NOT for general use! */
++#define ELF_MAXPAGESIZE 0x1000
+ #define elf32_bed elf32_tradbed
+
+ /* Include the target file again for this target. */
diff --git a/patches/binutils/2.17a/170-bfd-hash-tweak.patch b/patches/binutils/2.17a/170-bfd-hash-tweak.patch
new file mode 100644
index 0000000..c878282
--- /dev/null
+++ b/patches/binutils/2.17a/170-bfd-hash-tweak.patch
@@ -0,0 +1,23 @@
+Signed-off-by: dank@kegel.com
+
+Raising the size of the hash table is a noticable win when linking
+at least one large app.
+
+There was a patch,
+http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
+to do this dynamically. No idea why that didn't make it in.
+So this tiny change to raise the default size is just
+a stopgap for now.
+
+
+--- binutils-2.17/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
++++ binutils-2.17/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
+@@ -298,7 +298,7 @@
+ */
+
+ /* The default number of entries to use when creating a hash table. */
+-#define DEFAULT_SIZE 4051
++#define DEFAULT_SIZE 32749
+ static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
+
+ /* Create a new hash table, given a number of entries. */
diff --git a/patches/binutils/2.17a/180-psignal.patch b/patches/binutils/2.17a/180-psignal.patch
new file mode 100644
index 0000000..2506ff2
--- /dev/null
+++ b/patches/binutils/2.17a/180-psignal.patch
@@ -0,0 +1,29 @@
+Make psignal prototype in libiberty match that in glibc.
+
+Fixes:
+
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
+/usr/include/signal.h:131: prototype declaration
+gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
+mprotect... make[1]: *** [strsignal.o] Error 1
+make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
+make: *** [all-libiberty] Error 2
+
+when building on red hat 7.1
+though it's a bit of a mystery why libiberty's psignal is being compiled at
+all, since red hat 7.1's glibc supports psignal (hence the error message)
+
+--- binutils-2.17/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
++++ binutils-2.17/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
+@@ -536,7 +536,7 @@
+
+ /*
+
+-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
+
+ Print @var{message} to the standard error, followed by a colon,
+ followed by the description of the signal specified by @var{signo},
diff --git a/patches/binutils/2.17a/190-skip-comments.patch b/patches/binutils/2.17a/190-skip-comments.patch
new file mode 100644
index 0000000..df49ad3
--- /dev/null
+++ b/patches/binutils/2.17a/190-skip-comments.patch
@@ -0,0 +1,95 @@
+[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
+
+Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
+Fixes
+localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
+when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
+
+Paths adjusted to match crosstool's patcher.
+
+Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
+From: Andreas Schwab <schwab at suse dot de>
+To: Nathan Sidwell <nathan at codesourcery dot com>
+Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
+Date: Fri, 23 Apr 2004 22:27:19 +0200
+Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
+
+Nathan Sidwell <nathan@codesourcery.com> writes:
+
+> Index: read.c
+> ===================================================================
+> RCS file: /cvs/src/src/gas/read.c,v
+> retrieving revision 1.76
+> diff -c -3 -p -r1.76 read.c
+> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
+> --- read.c 18 Mar 2004 09:56:05 -0000
+> *************** read_a_source_file (char *name)
+> *** 1053,1059 ****
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! ignore_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+> --- 1053,1059 ----
+> #endif
+> input_line_pointer--;
+> /* Report unknown char as ignored. */
+> ! demand_empty_rest_of_line ();
+> }
+>
+> #ifdef md_after_pass_hook
+
+This means that the unknown character is no longer ignored, despite the
+comment. As a side effect a line starting with a line comment character
+not followed by APP in NO_APP mode now triggers an error instead of just a
+warning, breaking builds of glibc on m68k-linux. Earlier in
+read_a_source_file where #APP is handled there is another comment that
+claims that unknown comments are ignored, when in fact they aren't (only
+the initial line comment character is skipped).
+
+Note that the presence of #APP will mess up the line counters, but
+that appears to be difficult to fix.
+
+Andreas.
+
+2004-04-23 Andreas Schwab <schwab@suse.de>
+
+ * read.c (read_a_source_file): Ignore unknown text after line
+ comment character. Fix misleading comment.
+
+--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
+@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
+ unsigned int new_length;
+ char *tmp_buf = 0;
+
+- bump_line_counters ();
+ s = input_line_pointer;
+ if (strncmp (s, "APP\n", 4))
+- continue; /* We ignore it */
++ {
++ /* We ignore it */
++ ignore_rest_of_line ();
++ continue;
++ }
++ bump_line_counters ();
+ s += 4;
+
+ sb_new (&sbuf);
+@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
+ continue;
+ #endif
+ input_line_pointer--;
+- /* Report unknown char as ignored. */
++ /* Report unknown char as error. */
+ demand_empty_rest_of_line ();
+ }
+
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
diff --git a/patches/binutils/2.17a/200-cross-gprof.patch b/patches/binutils/2.17a/200-cross-gprof.patch
new file mode 100644
index 0000000..eda79b3
--- /dev/null
+++ b/patches/binutils/2.17a/200-cross-gprof.patch
@@ -0,0 +1,22 @@
+--- binutils-2.17/configure.old 2004-07-21 21:36:47.000000000 -0700
++++ binutils-2.17/configure 2004-07-21 21:37:08.000000000 -0700
+@@ -1022,7 +1022,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
+--- binutils-2.17/configure.in.old 2004-07-21 21:37:19.000000000 -0700
++++ binutils-2.17/configure.in 2004-07-21 21:37:34.000000000 -0700
+@@ -227,7 +227,7 @@
+
+ # Some tools are only suitable for building in a "native" situation.
+ # Remove these if host!=target.
+-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+
+ # Similarly, some are only suitable for cross toolchains.
+ # Remove these if host=target.
diff --git a/patches/binutils/2.17a/210-i386-no-divide-comment.patch b/patches/binutils/2.17a/210-i386-no-divide-comment.patch
new file mode 100644
index 0000000..c6b3f62
--- /dev/null
+++ b/patches/binutils/2.17a/210-i386-no-divide-comment.patch
@@ -0,0 +1,64 @@
+diff -durN binutils-2.17.orig/gas/config/tc-i386.c binutils-2.17/gas/config/tc-i386.c
+--- binutils-2.17.orig/gas/config/tc-i386.c 2006-04-07 08:40:57.000000000 +0200
++++ binutils-2.17/gas/config/tc-i386.c 2008-09-22 09:06:07.000000000 +0200
+@@ -196,24 +196,10 @@
+ #endif
+ ;
+
+-#if (defined (TE_I386AIX) \
+- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
+- && !defined (TE_GNU) \
+- && !defined (TE_LINUX) \
+- && !defined (TE_NETWARE) \
+- && !defined (TE_FreeBSD) \
+- && !defined (TE_NetBSD)))
+ /* This array holds the chars that always start a comment. If the
+- pre-processor is disabled, these aren't very useful. The option
+- --divide will remove '/' from this list. */
+-const char *i386_comment_chars = "#/";
+-#define SVR4_COMMENT_CHARS 1
+-#define PREFIX_SEPARATOR '\\'
+-
+-#else
++ pre-processor is disabled, these aren't very useful. */
+ const char *i386_comment_chars = "#";
+ #define PREFIX_SEPARATOR '/'
+-#endif
+
+ /* This array holds the chars that only start a comment at the beginning of
+ a line. If the line seems to have the form '# 123 filename'
+@@ -5486,20 +5472,6 @@
+ break;
+
+ case OPTION_DIVIDE:
+-#ifdef SVR4_COMMENT_CHARS
+- {
+- char *n, *t;
+- const char *s;
+-
+- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
+- t = n;
+- for (s = i386_comment_chars; *s != '\0'; s++)
+- if (*s != '/')
+- *t++ = *s;
+- *t = '\0';
+- i386_comment_chars = n;
+- }
+-#endif
+ break;
+
+ default:
+@@ -5525,13 +5497,8 @@
+ fprintf (stream, _("\
+ -s ignored\n"));
+ #endif
+-#ifdef SVR4_COMMENT_CHARS
+- fprintf (stream, _("\
+- --divide do not treat `/' as a comment character\n"));
+-#else
+ fprintf (stream, _("\
+ --divide ignored\n"));
+-#endif
+ }
+
+ #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \