REname binutils patches to not include 'binutils' nor the version in the patch names.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 28 20:17:48 2008 +0000 (2008-07-28)
changeset 745e445c00d134d
parent 744 4bf8448536d5
child 746 b150d6f590fc
REname binutils patches to not include 'binutils' nor the version in the patch names.
patches/binutils/2.14/100-binutils-sh-relocs.patch
patches/binutils/2.14/100-sh-relocs.patch
patches/binutils/2.15/710-allow-gcc-4.0.patch
patches/binutils/2.15/710-binutils-2.15-allow-gcc-4.0.patch
patches/binutils/2.15/720-binutils-2.15-psignal.patch
patches/binutils/2.15/720-psignal.patch
patches/binutils/2.15/730-binutils-2.15-solaris-qsort.patch
patches/binutils/2.15/730-solaris-qsort.patch
patches/binutils/2.15/740-binutils-2.15-vmx.patch
patches/binutils/2.15/740-vmx.patch
patches/binutils/2.15/750-arm-undef-imm.patch
patches/binutils/2.15/750-binutils-arm-undef-imm.patch
patches/binutils/2.15/760-binutils-skip-comments.patch
patches/binutils/2.15/760-skip-comments.patch
patches/binutils/2.15/790-ld-2.15-callahan.patch
patches/binutils/2.15/790-ld-callahan.patch
patches/binutils/2.15/800-ld-2.15-stabs-tweak.patch
patches/binutils/2.15/800-ld-stabs-tweak.patch
patches/binutils/2.16.1/110-binutils-2.15-psignal.patch
patches/binutils/2.16.1/110-psignal.patch
patches/binutils/2.16.1/120-binutils-skip-comments.patch
patches/binutils/2.16.1/120-skip-comments.patch
patches/binutils/2.17/300-001_ld_makefile_patch.patch
patches/binutils/2.17/300-006_better_file_error.patch
patches/binutils/2.17/300-012_check_ldrunpath_length.patch
patches/binutils/2.17/300-ld_makefile_patch.patch
patches/binutils/2.17/301-better_file_error.patch
patches/binutils/2.17/302-check_ldrunpath_length.patch
patches/binutils/2.17/501-binutils-2.15-psignal.patch
patches/binutils/2.17/501-psignal.patch
patches/binutils/2.17/502-binutils-skip-comments.patch
patches/binutils/2.17/502-skip-comments.patch
     1.1 --- a/patches/binutils/2.14/100-binutils-sh-relocs.patch	Mon Jul 28 20:10:34 2008 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,38 +0,0 @@
     1.4 -Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp>
     1.5 -To: dank@kegel.com
     1.6 -Cc: kkojima@rr.iij4u.or.jp
     1.7 -Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
     1.8 - with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
     1.9 -In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700"
    1.10 -	<3F28A15A.5010400@kegel.com>
    1.11 -References: <3F28A15A.5010400@kegel.com>
    1.12 -Date: Thu, 31 Jul 2003 21:47:38 +0900
    1.13 -From: kaz Kojima <kkojima@rr.iij4u.or.jp>
    1.14 -
    1.15 -Dan Kegel <dank@kegel.com> wrote:
    1.16 ->> I'll give binutils-2.14.90.0.5 a shot, then. 
    1.17 -> 
    1.18 -> No joy - same problem.  Guess I'll take this up on binutils and/or libc-alpha.
    1.19 -
    1.20 -Please try the patch below, though it's a diff against the current
    1.21 -binutils CVS.
    1.22 -
    1.23 -Regards,
    1.24 -	kaz
    1.25 ---
    1.26 -diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c
    1.27 ---- src/bfd/elf32-sh.c.old	Fri Jul 25 14:46:58 2003
    1.28 -+++ src/bfd/elf32-sh.c	Thu Jul 31 21:09:38 2003
    1.29 -@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
    1.30 - 							  sreloc, 2))
    1.31 - 			return FALSE;
    1.32 - 		    }
    1.33 -+#if 0
    1.34 - 		  if (sec->flags & SEC_READONLY)
    1.35 - 		    info->flags |= DF_TEXTREL;
    1.36 -+#endif
    1.37 - 		  elf_section_data (sec)->sreloc = sreloc;
    1.38 - 		}
    1.39 - 
    1.40 -
    1.41 -
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/binutils/2.14/100-sh-relocs.patch	Mon Jul 28 20:17:48 2008 +0000
     2.3 @@ -0,0 +1,38 @@
     2.4 +Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp>
     2.5 +To: dank@kegel.com
     2.6 +Cc: kkojima@rr.iij4u.or.jp
     2.7 +Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails
     2.8 + with "libc.so: text relocations used" in glibc-2.3.2 for sh4)
     2.9 +In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700"
    2.10 +	<3F28A15A.5010400@kegel.com>
    2.11 +References: <3F28A15A.5010400@kegel.com>
    2.12 +Date: Thu, 31 Jul 2003 21:47:38 +0900
    2.13 +From: kaz Kojima <kkojima@rr.iij4u.or.jp>
    2.14 +
    2.15 +Dan Kegel <dank@kegel.com> wrote:
    2.16 +>> I'll give binutils-2.14.90.0.5 a shot, then. 
    2.17 +> 
    2.18 +> No joy - same problem.  Guess I'll take this up on binutils and/or libc-alpha.
    2.19 +
    2.20 +Please try the patch below, though it's a diff against the current
    2.21 +binutils CVS.
    2.22 +
    2.23 +Regards,
    2.24 +	kaz
    2.25 +--
    2.26 +diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c
    2.27 +--- src/bfd/elf32-sh.c.old	Fri Jul 25 14:46:58 2003
    2.28 ++++ src/bfd/elf32-sh.c	Thu Jul 31 21:09:38 2003
    2.29 +@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
    2.30 + 							  sreloc, 2))
    2.31 + 			return FALSE;
    2.32 + 		    }
    2.33 ++#if 0
    2.34 + 		  if (sec->flags & SEC_READONLY)
    2.35 + 		    info->flags |= DF_TEXTREL;
    2.36 ++#endif
    2.37 + 		  elf_section_data (sec)->sreloc = sreloc;
    2.38 + 		}
    2.39 + 
    2.40 +
    2.41 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/binutils/2.15/710-allow-gcc-4.0.patch	Mon Jul 28 20:17:48 2008 +0000
     3.3 @@ -0,0 +1,75 @@
     3.4 +Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html
     3.5 +
     3.6 +Fixes:
     3.7 +In file included from ./targ-cpu.h:1,
     3.8 +                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/obj-elf.h:42,
     3.9 +                 from ./obj-format.h:1,
    3.10 +                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/te-linux.h:4,
    3.11 +                 from ./targ-env.h:1,
    3.12 +                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/as.h:626,
    3.13 +                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/app.c:30:
    3.14 +/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type
    3.15 +make[3]: *** [app.o] Error 1
    3.16 +make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas'
    3.17 +
    3.18 +when building binutils-2.15 with gcc-4.0
    3.19 +
    3.20 +
    3.21 +diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h
    3.22 +--- binutils-2.15.old/gas/as.h	2003-11-22 18:14:21.000000000 -0800
    3.23 ++++ binutils-2.15/gas/as.h	2006-02-14 22:05:35.000000000 -0800
    3.24 +@@ -605,7 +605,26 @@
    3.25 + struct expressionS;
    3.26 + struct fix;
    3.27 + typedef struct symbol symbolS;
    3.28 +-struct relax_type;
    3.29 ++
    3.30 ++/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    3.31 ++   and write.c care about it anyway.  */
    3.32 ++/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about
    3.33 ++            incomplete element types in arrays, if relax_type isn't defined
    3.34 ++            here. So I moved the definition back from tc.h to here. */
    3.35 ++struct relax_type
    3.36 ++{
    3.37 ++  /* Forward reach. Signed number. > 0.  */
    3.38 ++  long rlx_forward;
    3.39 ++  /* Backward reach. Signed number. < 0.  */
    3.40 ++  long rlx_backward;
    3.41 ++
    3.42 ++  /* Bytes length of this address.  */
    3.43 ++  unsigned char rlx_length;
    3.44 ++
    3.45 ++  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    3.46 ++  relax_substateT rlx_more;
    3.47 ++};
    3.48 ++
    3.49 + typedef struct frag fragS;
    3.50 + 
    3.51 + #ifdef BFD_ASSEMBLER
    3.52 +diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h
    3.53 +--- binutils-2.15.old/gas/tc.h	2003-12-03 15:39:38.000000000 -0800
    3.54 ++++ binutils-2.15/gas/tc.h	2006-02-14 22:03:35.000000000 -0800
    3.55 +@@ -24,23 +24,6 @@
    3.56 + 
    3.57 + extern const pseudo_typeS md_pseudo_table[];
    3.58 + 
    3.59 +-/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    3.60 +-   and write.c care about it anyway.  */
    3.61 +-
    3.62 +-struct relax_type
    3.63 +-{
    3.64 +-  /* Forward reach. Signed number. > 0.  */
    3.65 +-  long rlx_forward;
    3.66 +-  /* Backward reach. Signed number. < 0.  */
    3.67 +-  long rlx_backward;
    3.68 +-
    3.69 +-  /* Bytes length of this address.  */
    3.70 +-  unsigned char rlx_length;
    3.71 +-
    3.72 +-  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    3.73 +-  relax_substateT rlx_more;
    3.74 +-};
    3.75 +-
    3.76 + typedef struct relax_type relax_typeS;
    3.77 + 
    3.78 + extern const int md_reloc_size;	/* Size of a relocation record */
     4.1 --- a/patches/binutils/2.15/710-binutils-2.15-allow-gcc-4.0.patch	Mon Jul 28 20:10:34 2008 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,75 +0,0 @@
     4.4 -Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html
     4.5 -
     4.6 -Fixes:
     4.7 -In file included from ./targ-cpu.h:1,
     4.8 -                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/obj-elf.h:42,
     4.9 -                 from ./obj-format.h:1,
    4.10 -                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/te-linux.h:4,
    4.11 -                 from ./targ-env.h:1,
    4.12 -                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/as.h:626,
    4.13 -                 from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/app.c:30:
    4.14 -/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type
    4.15 -make[3]: *** [app.o] Error 1
    4.16 -make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas'
    4.17 -
    4.18 -when building binutils-2.15 with gcc-4.0
    4.19 -
    4.20 -
    4.21 -diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h
    4.22 ---- binutils-2.15.old/gas/as.h	2003-11-22 18:14:21.000000000 -0800
    4.23 -+++ binutils-2.15/gas/as.h	2006-02-14 22:05:35.000000000 -0800
    4.24 -@@ -605,7 +605,26 @@
    4.25 - struct expressionS;
    4.26 - struct fix;
    4.27 - typedef struct symbol symbolS;
    4.28 --struct relax_type;
    4.29 -+
    4.30 -+/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    4.31 -+   and write.c care about it anyway.  */
    4.32 -+/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about
    4.33 -+            incomplete element types in arrays, if relax_type isn't defined
    4.34 -+            here. So I moved the definition back from tc.h to here. */
    4.35 -+struct relax_type
    4.36 -+{
    4.37 -+  /* Forward reach. Signed number. > 0.  */
    4.38 -+  long rlx_forward;
    4.39 -+  /* Backward reach. Signed number. < 0.  */
    4.40 -+  long rlx_backward;
    4.41 -+
    4.42 -+  /* Bytes length of this address.  */
    4.43 -+  unsigned char rlx_length;
    4.44 -+
    4.45 -+  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    4.46 -+  relax_substateT rlx_more;
    4.47 -+};
    4.48 -+
    4.49 - typedef struct frag fragS;
    4.50 - 
    4.51 - #ifdef BFD_ASSEMBLER
    4.52 -diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h
    4.53 ---- binutils-2.15.old/gas/tc.h	2003-12-03 15:39:38.000000000 -0800
    4.54 -+++ binutils-2.15/gas/tc.h	2006-02-14 22:03:35.000000000 -0800
    4.55 -@@ -24,23 +24,6 @@
    4.56 - 
    4.57 - extern const pseudo_typeS md_pseudo_table[];
    4.58 - 
    4.59 --/* JF moved this here from as.h under the theory that nobody except MACHINE.c
    4.60 --   and write.c care about it anyway.  */
    4.61 --
    4.62 --struct relax_type
    4.63 --{
    4.64 --  /* Forward reach. Signed number. > 0.  */
    4.65 --  long rlx_forward;
    4.66 --  /* Backward reach. Signed number. < 0.  */
    4.67 --  long rlx_backward;
    4.68 --
    4.69 --  /* Bytes length of this address.  */
    4.70 --  unsigned char rlx_length;
    4.71 --
    4.72 --  /* Next longer relax-state.  0 means there is no 'next' relax-state.  */
    4.73 --  relax_substateT rlx_more;
    4.74 --};
    4.75 --
    4.76 - typedef struct relax_type relax_typeS;
    4.77 - 
    4.78 - extern const int md_reloc_size;	/* Size of a relocation record */
     5.1 --- a/patches/binutils/2.15/720-binutils-2.15-psignal.patch	Mon Jul 28 20:10:34 2008 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,40 +0,0 @@
     5.4 -Make psignal prototype in libiberty match that in glibc.
     5.5 -
     5.6 -Fixes:
     5.7 -
     5.8 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
     5.9 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
    5.10 -/usr/include/signal.h:131: prototype declaration
    5.11 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
    5.12 -/usr/include/signal.h:131: prototype declaration
    5.13 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
    5.14 -mprotect... make[1]: *** [strsignal.o] Error 1
    5.15 -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'
    5.16 -make: *** [all-libiberty] Error 2
    5.17 -
    5.18 -when building on red hat 7.1
    5.19 -though it's a bit of a mystery why libiberty's psignal is being compiled at
    5.20 -all, since red hat 7.1's glibc supports psignal (hence the error message)
    5.21 -
    5.22 ---- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
    5.23 -+++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
    5.24 -@@ -544,7 +544,7 @@
    5.25 - 
    5.26 - /*
    5.27 - 
    5.28 --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
    5.29 -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
    5.30 - 
    5.31 - Print @var{message} to the standard error, followed by a colon,
    5.32 - followed by the description of the signal specified by @var{signo},
    5.33 -@@ -557,9 +557,7 @@
    5.34 - #ifndef HAVE_PSIGNAL
    5.35 - 
    5.36 - void
    5.37 --psignal (signo, message)
    5.38 --  unsigned signo;
    5.39 --  char *message;
    5.40 -+psignal (int signo, const char *message)
    5.41 - {
    5.42 -   if (signal_names == NULL)
    5.43 -     {
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/binutils/2.15/720-psignal.patch	Mon Jul 28 20:17:48 2008 +0000
     6.3 @@ -0,0 +1,40 @@
     6.4 +Make psignal prototype in libiberty match that in glibc.
     6.5 +
     6.6 +Fixes:
     6.7 +
     6.8 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
     6.9 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
    6.10 +/usr/include/signal.h:131: prototype declaration
    6.11 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
    6.12 +/usr/include/signal.h:131: prototype declaration
    6.13 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
    6.14 +mprotect... make[1]: *** [strsignal.o] Error 1
    6.15 +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'
    6.16 +make: *** [all-libiberty] Error 2
    6.17 +
    6.18 +when building on red hat 7.1
    6.19 +though it's a bit of a mystery why libiberty's psignal is being compiled at
    6.20 +all, since red hat 7.1's glibc supports psignal (hence the error message)
    6.21 +
    6.22 +--- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
    6.23 ++++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
    6.24 +@@ -544,7 +544,7 @@
    6.25 + 
    6.26 + /*
    6.27 + 
    6.28 +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
    6.29 ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
    6.30 + 
    6.31 + Print @var{message} to the standard error, followed by a colon,
    6.32 + followed by the description of the signal specified by @var{signo},
    6.33 +@@ -557,9 +557,7 @@
    6.34 + #ifndef HAVE_PSIGNAL
    6.35 + 
    6.36 + void
    6.37 +-psignal (signo, message)
    6.38 +-  unsigned signo;
    6.39 +-  char *message;
    6.40 ++psignal (int signo, const char *message)
    6.41 + {
    6.42 +   if (signal_names == NULL)
    6.43 +     {
     7.1 --- a/patches/binutils/2.15/730-binutils-2.15-solaris-qsort.patch	Mon Jul 28 20:10:34 2008 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,22 +0,0 @@
     7.4 -See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html
     7.5 -
     7.6 ---- src/bfd/elflink.c.org	2004-07-05 09:11:42.920597000 -0400
     7.7 -+++ src/bfd/elflink.c	2004-07-05 09:12:59.240847000 -0400
     7.8 -@@ -2700,7 +2700,7 @@
     7.9 -     return vdiff > 0 ? 1 : -1;
    7.10 -   else
    7.11 -     {
    7.12 --      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
    7.13 -+      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
    7.14 -       if (sdiff != 0)
    7.15 - 	return sdiff > 0 ? 1 : -1;
    7.16 -     }
    7.17 -@@ -3954,7 +3954,7 @@
    7.18 - 		i = idx + 1;
    7.19 - 	      else
    7.20 - 		{
    7.21 --		  long sdiff = slook - h->root.u.def.section;
    7.22 -+		  long sdiff = slook->id - h->root.u.def.section->id;
    7.23 - 		  if (sdiff < 0)
    7.24 - 		    j = idx;
    7.25 - 		  else if (sdiff > 0)
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/binutils/2.15/730-solaris-qsort.patch	Mon Jul 28 20:17:48 2008 +0000
     8.3 @@ -0,0 +1,22 @@
     8.4 +See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html
     8.5 +
     8.6 +--- src/bfd/elflink.c.org	2004-07-05 09:11:42.920597000 -0400
     8.7 ++++ src/bfd/elflink.c	2004-07-05 09:12:59.240847000 -0400
     8.8 +@@ -2700,7 +2700,7 @@
     8.9 +     return vdiff > 0 ? 1 : -1;
    8.10 +   else
    8.11 +     {
    8.12 +-      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
    8.13 ++      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
    8.14 +       if (sdiff != 0)
    8.15 + 	return sdiff > 0 ? 1 : -1;
    8.16 +     }
    8.17 +@@ -3954,7 +3954,7 @@
    8.18 + 		i = idx + 1;
    8.19 + 	      else
    8.20 + 		{
    8.21 +-		  long sdiff = slook - h->root.u.def.section;
    8.22 ++		  long sdiff = slook->id - h->root.u.def.section->id;
    8.23 + 		  if (sdiff < 0)
    8.24 + 		    j = idx;
    8.25 + 		  else if (sdiff > 0)
     9.1 --- a/patches/binutils/2.15/740-binutils-2.15-vmx.patch	Mon Jul 28 20:10:34 2008 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,45 +0,0 @@
     9.4 -Grabbed with
     9.5 -wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src'
     9.6 -See 
     9.7 -http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html
     9.8 -and
     9.9 -http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html
    9.10 -
    9.11 -This fixes problems like
    9.12 -{standard input}: Assembler messages:
    9.13 -{standard input}:1: Error: Unrecognized opcode: `dssall' 
    9.14 -which show up in binutils-2.15 when building the Linux kernel,
    9.15 -or possibly failed compilations when building setjmp/longjmp in glibc.
    9.16 -
    9.17 -An alternative fix would be to pass -many to the assembler.
    9.18 -A patch to do that for glibc is at
    9.19 -wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com'
    9.20 -Yet another, better, fix would be for gcc to generate assembly
    9.21 -that told the assembler which processor type to use.
    9.22 -Presumably the Linux kernel sources would need a fix, too.
    9.23 -Probably better to just fix binutils to accept sources that it used to.
    9.24 -
    9.25 -
    9.26 -===================================================================
    9.27 -RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
    9.28 -retrieving revision 1.70
    9.29 -retrieving revision 1.71
    9.30 -diff -u -r1.70 -r1.71
    9.31 ---- src/opcodes/ppc-opc.c	2004/05/05 13:43:36	1.70
    9.32 -+++ src/opcodes/ppc-opc.c	2004/05/19 05:11:48	1.71
    9.33 -@@ -1004,8 +1004,13 @@
    9.34 - 
    9.35 -   /* If only one bit of the FXM field is set, we can use the new form
    9.36 -      of the instruction, which is faster.  Unlike the Power4 branch hint
    9.37 --     encoding, this is not backward compatible.  */
    9.38 --  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
    9.39 -+     encoding, this is not backward compatible.  Do not generate the
    9.40 -+     new form unless -mpower4 has been given, or -many and the two
    9.41 -+     operand form of mfcr was used.  */
    9.42 -+  else if ((value & -value) == value
    9.43 -+	   && ((dialect & PPC_OPCODE_POWER4) != 0
    9.44 -+	       || ((dialect & PPC_OPCODE_ANY) != 0
    9.45 -+		   && (insn & (0x3ff << 1)) == 19 << 1)))
    9.46 -     insn |= 1 << 20;
    9.47 - 
    9.48 -   /* Any other value on mfcr is an error.  */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/binutils/2.15/740-vmx.patch	Mon Jul 28 20:17:48 2008 +0000
    10.3 @@ -0,0 +1,45 @@
    10.4 +Grabbed with
    10.5 +wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src'
    10.6 +See 
    10.7 +http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html
    10.8 +and
    10.9 +http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html
   10.10 +
   10.11 +This fixes problems like
   10.12 +{standard input}: Assembler messages:
   10.13 +{standard input}:1: Error: Unrecognized opcode: `dssall' 
   10.14 +which show up in binutils-2.15 when building the Linux kernel,
   10.15 +or possibly failed compilations when building setjmp/longjmp in glibc.
   10.16 +
   10.17 +An alternative fix would be to pass -many to the assembler.
   10.18 +A patch to do that for glibc is at
   10.19 +wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com'
   10.20 +Yet another, better, fix would be for gcc to generate assembly
   10.21 +that told the assembler which processor type to use.
   10.22 +Presumably the Linux kernel sources would need a fix, too.
   10.23 +Probably better to just fix binutils to accept sources that it used to.
   10.24 +
   10.25 +
   10.26 +===================================================================
   10.27 +RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
   10.28 +retrieving revision 1.70
   10.29 +retrieving revision 1.71
   10.30 +diff -u -r1.70 -r1.71
   10.31 +--- src/opcodes/ppc-opc.c	2004/05/05 13:43:36	1.70
   10.32 ++++ src/opcodes/ppc-opc.c	2004/05/19 05:11:48	1.71
   10.33 +@@ -1004,8 +1004,13 @@
   10.34 + 
   10.35 +   /* If only one bit of the FXM field is set, we can use the new form
   10.36 +      of the instruction, which is faster.  Unlike the Power4 branch hint
   10.37 +-     encoding, this is not backward compatible.  */
   10.38 +-  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
   10.39 ++     encoding, this is not backward compatible.  Do not generate the
   10.40 ++     new form unless -mpower4 has been given, or -many and the two
   10.41 ++     operand form of mfcr was used.  */
   10.42 ++  else if ((value & -value) == value
   10.43 ++	   && ((dialect & PPC_OPCODE_POWER4) != 0
   10.44 ++	       || ((dialect & PPC_OPCODE_ANY) != 0
   10.45 ++		   && (insn & (0x3ff << 1)) == 19 << 1)))
   10.46 +     insn |= 1 << 20;
   10.47 + 
   10.48 +   /* Any other value on mfcr is an error.  */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/binutils/2.15/750-arm-undef-imm.patch	Mon Jul 28 20:17:48 2008 +0000
    11.3 @@ -0,0 +1,51 @@
    11.4 +From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src
    11.5 +See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html,
    11.6 +"[CRITICAL PATCH] 2.6: fix silent build error]"
    11.7 +
    11.8 +Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc
    11.9 +Branch: MAIN
   11.10 +CVS Tags: binutils_latest_snapshot, HEAD
   11.11 +Changes since 1.168: +14 -1 lines
   11.12 +
   11.13 +(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
   11.14 +from undefined symbols.
   11.15 +Always consider this fixup to have been processed as a reloc cannot be
   11.16 +generated for it.
   11.17 +
   11.18 +
   11.19 +===================================================================
   11.20 +RCS file: /cvs/src/src/gas/config/tc-arm.c,v
   11.21 +retrieving revision 1.168
   11.22 +retrieving revision 1.169
   11.23 +diff -u -r1.168 -r1.169
   11.24 +--- src/gas/config/tc-arm.c	2004/04/30 10:51:12	1.168
   11.25 ++++ src/gas/config/tc-arm.c	2004/07/02 11:12:29	1.169
   11.26 +@@ -12186,6 +12186,20 @@
   11.27 +   switch (fixP->fx_r_type)
   11.28 +     {
   11.29 +     case BFD_RELOC_ARM_IMMEDIATE:
   11.30 ++      /* We claim that this fixup has been processed here,
   11.31 ++	 even if in fact we generate an error because we do
   11.32 ++	 not have a reloc for it, so tc_gen_reloc will reject it.  */
   11.33 ++      fixP->fx_done = 1;
   11.34 ++
   11.35 ++      if (fixP->fx_addsy
   11.36 ++	  && ! S_IS_DEFINED (fixP->fx_addsy))
   11.37 ++	{
   11.38 ++	  as_bad_where (fixP->fx_file, fixP->fx_line,
   11.39 ++			_("undefined symbol %s used as an immediate value"),
   11.40 ++			S_GET_NAME (fixP->fx_addsy));
   11.41 ++	  break;
   11.42 ++	}
   11.43 ++
   11.44 +       newimm = validate_immediate (value);
   11.45 +       temp = md_chars_to_number (buf, INSN_SIZE);
   11.46 + 
   11.47 +@@ -12202,7 +12216,6 @@
   11.48 + 
   11.49 +       newimm |= (temp & 0xfffff000);
   11.50 +       md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
   11.51 +-      fixP->fx_done = 1;
   11.52 +       break;
   11.53 + 
   11.54 +     case BFD_RELOC_ARM_ADRL_IMMEDIATE:
    12.1 --- a/patches/binutils/2.15/750-binutils-arm-undef-imm.patch	Mon Jul 28 20:10:34 2008 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,51 +0,0 @@
    12.4 -From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src
    12.5 -See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html,
    12.6 -"[CRITICAL PATCH] 2.6: fix silent build error]"
    12.7 -
    12.8 -Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc
    12.9 -Branch: MAIN
   12.10 -CVS Tags: binutils_latest_snapshot, HEAD
   12.11 -Changes since 1.168: +14 -1 lines
   12.12 -
   12.13 -(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
   12.14 -from undefined symbols.
   12.15 -Always consider this fixup to have been processed as a reloc cannot be
   12.16 -generated for it.
   12.17 -
   12.18 -
   12.19 -===================================================================
   12.20 -RCS file: /cvs/src/src/gas/config/tc-arm.c,v
   12.21 -retrieving revision 1.168
   12.22 -retrieving revision 1.169
   12.23 -diff -u -r1.168 -r1.169
   12.24 ---- src/gas/config/tc-arm.c	2004/04/30 10:51:12	1.168
   12.25 -+++ src/gas/config/tc-arm.c	2004/07/02 11:12:29	1.169
   12.26 -@@ -12186,6 +12186,20 @@
   12.27 -   switch (fixP->fx_r_type)
   12.28 -     {
   12.29 -     case BFD_RELOC_ARM_IMMEDIATE:
   12.30 -+      /* We claim that this fixup has been processed here,
   12.31 -+	 even if in fact we generate an error because we do
   12.32 -+	 not have a reloc for it, so tc_gen_reloc will reject it.  */
   12.33 -+      fixP->fx_done = 1;
   12.34 -+
   12.35 -+      if (fixP->fx_addsy
   12.36 -+	  && ! S_IS_DEFINED (fixP->fx_addsy))
   12.37 -+	{
   12.38 -+	  as_bad_where (fixP->fx_file, fixP->fx_line,
   12.39 -+			_("undefined symbol %s used as an immediate value"),
   12.40 -+			S_GET_NAME (fixP->fx_addsy));
   12.41 -+	  break;
   12.42 -+	}
   12.43 -+
   12.44 -       newimm = validate_immediate (value);
   12.45 -       temp = md_chars_to_number (buf, INSN_SIZE);
   12.46 - 
   12.47 -@@ -12202,7 +12216,6 @@
   12.48 - 
   12.49 -       newimm |= (temp & 0xfffff000);
   12.50 -       md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
   12.51 --      fixP->fx_done = 1;
   12.52 -       break;
   12.53 - 
   12.54 -     case BFD_RELOC_ARM_ADRL_IMMEDIATE:
    13.1 --- a/patches/binutils/2.15/760-binutils-skip-comments.patch	Mon Jul 28 20:10:34 2008 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,101 +0,0 @@
    13.4 -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    13.5 -Fixes
    13.6 -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    13.7 -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
    13.8 -
    13.9 -Paths adjusted to match crosstool's patcher.
   13.10 -
   13.11 -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   13.12 -From: Andreas Schwab <schwab at suse dot de>
   13.13 -To: Nathan Sidwell <nathan at codesourcery dot com>
   13.14 -Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   13.15 -Date: Fri, 23 Apr 2004 22:27:19 +0200
   13.16 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   13.17 -
   13.18 -Nathan Sidwell <nathan@codesourcery.com> writes:
   13.19 -
   13.20 -> Index: read.c
   13.21 -> ===================================================================
   13.22 -> RCS file: /cvs/src/src/gas/read.c,v
   13.23 -> retrieving revision 1.76
   13.24 -> diff -c -3 -p -r1.76 read.c
   13.25 -> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   13.26 -> --- read.c	18 Mar 2004 09:56:05 -0000
   13.27 -> *************** read_a_source_file (char *name)
   13.28 -> *** 1053,1059 ****
   13.29 ->   #endif
   13.30 ->   	  input_line_pointer--;
   13.31 ->   	  /* Report unknown char as ignored.  */
   13.32 -> ! 	  ignore_rest_of_line ();
   13.33 ->   	}
   13.34 ->   
   13.35 ->   #ifdef md_after_pass_hook
   13.36 -> --- 1053,1059 ----
   13.37 ->   #endif
   13.38 ->   	  input_line_pointer--;
   13.39 ->   	  /* Report unknown char as ignored.  */
   13.40 -> ! 	  demand_empty_rest_of_line ();
   13.41 ->   	}
   13.42 ->   
   13.43 ->   #ifdef md_after_pass_hook
   13.44 -
   13.45 -This means that the unknown character is no longer ignored, despite the
   13.46 -comment.  As a side effect a line starting with a line comment character
   13.47 -not followed by APP in NO_APP mode now triggers an error instead of just a
   13.48 -warning, breaking builds of glibc on m68k-linux.  Earlier in
   13.49 -read_a_source_file where #APP is handled there is another comment that
   13.50 -claims that unknown comments are ignored, when in fact they aren't (only
   13.51 -the initial line comment character is skipped).
   13.52 -
   13.53 -Note that the presence of #APP will mess up the line counters, but
   13.54 -that appears to be difficult to fix.
   13.55 -
   13.56 -Andreas.
   13.57 -
   13.58 -2004-04-23  Andreas Schwab  <schwab@suse.de>
   13.59 -
   13.60 -	* read.c (read_a_source_file): Ignore unknown text after line
   13.61 -	comment character.  Fix misleading comment.
   13.62 -
   13.63 ---- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   13.64 -+++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   13.65 -@@ -1,6 +1,6 @@
   13.66 - /* read.c - read a source file -
   13.67 -    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
   13.68 --   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
   13.69 -+   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
   13.70 - 
   13.71 - This file is part of GAS, the GNU Assembler.
   13.72 - 
   13.73 -@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   13.74 - 	      unsigned int new_length;
   13.75 - 	      char *tmp_buf = 0;
   13.76 - 
   13.77 --	      bump_line_counters ();
   13.78 - 	      s = input_line_pointer;
   13.79 - 	      if (strncmp (s, "APP\n", 4))
   13.80 --		continue;	/* We ignore it */
   13.81 -+		{
   13.82 -+		  /* We ignore it */
   13.83 -+		  ignore_rest_of_line ();
   13.84 -+		  continue;
   13.85 -+		}
   13.86 -+	      bump_line_counters ();
   13.87 - 	      s += 4;
   13.88 - 
   13.89 - 	      sb_new (&sbuf);
   13.90 -@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   13.91 - 	    continue;
   13.92 - #endif
   13.93 - 	  input_line_pointer--;
   13.94 --	  /* Report unknown char as ignored.  */
   13.95 -+	  /* Report unknown char as error.  */
   13.96 - 	  demand_empty_rest_of_line ();
   13.97 - 	}
   13.98 - 
   13.99 -
  13.100 --- 
  13.101 -Andreas Schwab, SuSE Labs, schwab@suse.de
  13.102 -SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
  13.103 -Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
  13.104 -"And now for something completely different."
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/patches/binutils/2.15/760-skip-comments.patch	Mon Jul 28 20:17:48 2008 +0000
    14.3 @@ -0,0 +1,101 @@
    14.4 +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    14.5 +Fixes
    14.6 +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    14.7 +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
    14.8 +
    14.9 +Paths adjusted to match crosstool's patcher.
   14.10 +
   14.11 +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   14.12 +From: Andreas Schwab <schwab at suse dot de>
   14.13 +To: Nathan Sidwell <nathan at codesourcery dot com>
   14.14 +Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   14.15 +Date: Fri, 23 Apr 2004 22:27:19 +0200
   14.16 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   14.17 +
   14.18 +Nathan Sidwell <nathan@codesourcery.com> writes:
   14.19 +
   14.20 +> Index: read.c
   14.21 +> ===================================================================
   14.22 +> RCS file: /cvs/src/src/gas/read.c,v
   14.23 +> retrieving revision 1.76
   14.24 +> diff -c -3 -p -r1.76 read.c
   14.25 +> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   14.26 +> --- read.c	18 Mar 2004 09:56:05 -0000
   14.27 +> *************** read_a_source_file (char *name)
   14.28 +> *** 1053,1059 ****
   14.29 +>   #endif
   14.30 +>   	  input_line_pointer--;
   14.31 +>   	  /* Report unknown char as ignored.  */
   14.32 +> ! 	  ignore_rest_of_line ();
   14.33 +>   	}
   14.34 +>   
   14.35 +>   #ifdef md_after_pass_hook
   14.36 +> --- 1053,1059 ----
   14.37 +>   #endif
   14.38 +>   	  input_line_pointer--;
   14.39 +>   	  /* Report unknown char as ignored.  */
   14.40 +> ! 	  demand_empty_rest_of_line ();
   14.41 +>   	}
   14.42 +>   
   14.43 +>   #ifdef md_after_pass_hook
   14.44 +
   14.45 +This means that the unknown character is no longer ignored, despite the
   14.46 +comment.  As a side effect a line starting with a line comment character
   14.47 +not followed by APP in NO_APP mode now triggers an error instead of just a
   14.48 +warning, breaking builds of glibc on m68k-linux.  Earlier in
   14.49 +read_a_source_file where #APP is handled there is another comment that
   14.50 +claims that unknown comments are ignored, when in fact they aren't (only
   14.51 +the initial line comment character is skipped).
   14.52 +
   14.53 +Note that the presence of #APP will mess up the line counters, but
   14.54 +that appears to be difficult to fix.
   14.55 +
   14.56 +Andreas.
   14.57 +
   14.58 +2004-04-23  Andreas Schwab  <schwab@suse.de>
   14.59 +
   14.60 +	* read.c (read_a_source_file): Ignore unknown text after line
   14.61 +	comment character.  Fix misleading comment.
   14.62 +
   14.63 +--- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   14.64 ++++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   14.65 +@@ -1,6 +1,6 @@
   14.66 + /* read.c - read a source file -
   14.67 +    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
   14.68 +-   1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
   14.69 ++   1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
   14.70 + 
   14.71 + This file is part of GAS, the GNU Assembler.
   14.72 + 
   14.73 +@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   14.74 + 	      unsigned int new_length;
   14.75 + 	      char *tmp_buf = 0;
   14.76 + 
   14.77 +-	      bump_line_counters ();
   14.78 + 	      s = input_line_pointer;
   14.79 + 	      if (strncmp (s, "APP\n", 4))
   14.80 +-		continue;	/* We ignore it */
   14.81 ++		{
   14.82 ++		  /* We ignore it */
   14.83 ++		  ignore_rest_of_line ();
   14.84 ++		  continue;
   14.85 ++		}
   14.86 ++	      bump_line_counters ();
   14.87 + 	      s += 4;
   14.88 + 
   14.89 + 	      sb_new (&sbuf);
   14.90 +@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   14.91 + 	    continue;
   14.92 + #endif
   14.93 + 	  input_line_pointer--;
   14.94 +-	  /* Report unknown char as ignored.  */
   14.95 ++	  /* Report unknown char as error.  */
   14.96 + 	  demand_empty_rest_of_line ();
   14.97 + 	}
   14.98 + 
   14.99 +
  14.100 +-- 
  14.101 +Andreas Schwab, SuSE Labs, schwab@suse.de
  14.102 +SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
  14.103 +Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
  14.104 +"And now for something completely different."
    15.1 --- a/patches/binutils/2.15/790-ld-2.15-callahan.patch	Mon Jul 28 20:10:34 2008 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,677 +0,0 @@
    15.4 -Signed-off-by: dank@kegel.com
    15.5 -Fixes ld speed issue. 
    15.6 -See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
    15.7 -See thread "Re: optimizations for 3x speedup in ld",
    15.8 -http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
    15.9 -
   15.10 -Wildcard section matching enhancement, backported from the binutils CVS tree.
   15.11 -Here's the CVS log comment from the original change to ldlang.c:
   15.12 -
   15.13 -revision 1.177
   15.14 -date: 2005/04/06 15:33:02;  author: jakub;  state: Exp;  lines: +438 -51
   15.15 -2005-04-06  Jakub Jelinek  <jakub@redhat.com>
   15.16 -
   15.17 -        * ldlang.c: Formatting.
   15.18 -        (walk_wild_consider_section): Remember return value from wildcardp.
   15.19 -        (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
   15.20 -        (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
   15.21 -
   15.22 -2005-04-06  Robert O'Callahan  <rocallahan@novell.com>
   15.23 -
   15.24 -        * ld.h (lean_section_userdata_type): Remove.
   15.25 -        (fat_section_userdata_type): Remove file field.
   15.26 -        (SECTION_USERDATA_SIZE): Remove.
   15.27 -        * ldlang.c (init_os): Eliminate initialization of unused
   15.28 -        lean_section_userdata_type.
   15.29 -
   15.30 -        * ldlang.h (callback_t, walk_wild_section_handler_t): New
   15.31 -        typedefs.
   15.32 -        (struct lang_wild_statement_struct): Add walk_wild_section_handler
   15.33 -        and handler_data fields.
   15.34 -        * ldlang.c (callback_t): Removed.
   15.35 -        (walk_wild_consider_section, walk_wild_section_general,
   15.36 -        section_iterator_callback, find_section, is_simple_wild,
   15.37 -        match_simple_wild, walk_wild_section_specs1_wild0,
   15.38 -        walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
   15.39 -        walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
   15.40 -        wild_spec_can_overlap, analyze_walk_wild_section_handler): New
   15.41 -        functions.
   15.42 -        (lang_add_wild): Call analyze_walk_wild_section_handler.
   15.43 -        (walk_wild_section): Renamed to walk_wild_section_general and
   15.44 -        created a wrapper function.
   15.45 -        (section_iterator_callback_data): New typedef.
   15.46 -
   15.47 -Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported
   15.48 -as well.
   15.49 -
   15.50 ---- binutils-2.15/bfd/bfd-in2.h.old	2004-05-17 15:35:56.000000000 -0400
   15.51 -+++ binutils-2.15/bfd/bfd-in2.h	2006-02-09 11:54:45.989940000 -0500
   15.52 -@@ -1425,6 +1425,10 @@
   15.53 - 
   15.54 - asection *bfd_get_section_by_name (bfd *abfd, const char *name);
   15.55 - 
   15.56 -+asection *bfd_get_section_by_name_if (bfd *abfd, const char *name,
   15.57 -+   bfd_boolean (*operation) (bfd *, asection *, void *),
   15.58 -+   void *user_storage);
   15.59 -+
   15.60 - char *bfd_get_unique_section_name
   15.61 -    (bfd *abfd, const char *templat, int *count);
   15.62 - 
   15.63 ---- binutils-2.15/bfd/section.c.old	2003-12-01 01:33:01.000000000 -0500
   15.64 -+++ binutils-2.15/bfd/section.c	2006-01-23 14:16:54.768993000 -0500
   15.65 -@@ -801,6 +801,57 @@
   15.66 - 
   15.67 - /*
   15.68 - FUNCTION
   15.69 -+	bfd_get_section_by_name_if
   15.70 -+
   15.71 -+SYNOPSIS
   15.72 -+	asection *bfd_get_section_by_name_if
   15.73 -+	  (bfd *abfd,
   15.74 -+	   const char *name,
   15.75 -+	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
   15.76 -+	   void *obj);
   15.77 -+
   15.78 -+DESCRIPTION
   15.79 -+	Call the provided function @var{func} for each section
   15.80 -+	attached to the BFD @var{abfd} whose name matches @var{name},
   15.81 -+	passing @var{obj} as an argument. The function will be called
   15.82 -+	as if by
   15.83 -+
   15.84 -+|	func (abfd, the_section, obj);
   15.85 -+
   15.86 -+	It returns the first section for which @var{func} returns true,
   15.87 -+	otherwise <<NULL>>.
   15.88 -+
   15.89 -+*/
   15.90 -+
   15.91 -+asection *
   15.92 -+bfd_get_section_by_name_if (bfd *abfd, const char *name,
   15.93 -+			    bfd_boolean (*operation) (bfd *,
   15.94 -+						      asection *,
   15.95 -+						      void *),
   15.96 -+			    void *user_storage)
   15.97 -+{
   15.98 -+  struct section_hash_entry *sh;
   15.99 -+  unsigned long hash;
  15.100 -+
  15.101 -+  sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
  15.102 -+  if (sh == NULL)
  15.103 -+    return NULL;
  15.104 -+
  15.105 -+  hash = sh->root.hash;
  15.106 -+  do
  15.107 -+    {
  15.108 -+      if ((*operation) (abfd, &sh->section, user_storage))
  15.109 -+	return &sh->section;
  15.110 -+      sh = (struct section_hash_entry *) sh->root.next;
  15.111 -+    }
  15.112 -+  while (sh != NULL && sh->root.hash == hash
  15.113 -+	 && strcmp (sh->root.string, name) == 0);
  15.114 -+
  15.115 -+  return NULL;
  15.116 -+}
  15.117 -+
  15.118 -+/*
  15.119 -+FUNCTION
  15.120 - 	bfd_get_unique_section_name
  15.121 - 
  15.122 - SYNOPSIS
  15.123 ---- binutils-2.15/ld/ldlang.c.old	2004-05-17 15:36:16.000000000 -0400
  15.124 -+++ binutils-2.15/ld/ldlang.c	2006-01-23 13:40:12.745499000 -0500
  15.125 -@@ -81,9 +81,6 @@
  15.126 - static void lang_record_phdrs (void);
  15.127 - static void lang_do_version_exports_section (void);
  15.128 - 
  15.129 --typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  15.130 --			    asection *, lang_input_statement_type *, void *);
  15.131 --
  15.132 - /* Exported variables.  */
  15.133 - lang_output_section_statement_type *abs_output_section;
  15.134 - lang_statement_list_type lang_output_section_statement;
  15.135 -@@ -138,21 +135,71 @@
  15.136 - 
  15.137 - /* Generic traversal routines for finding matching sections.  */
  15.138 - 
  15.139 -+/* Try processing a section against a wildcard.  This just calls
  15.140 -+   the callback unless the filename exclusion list is present
  15.141 -+   and excludes the file.  It's hardly ever present so this
  15.142 -+   function is very fast.  */
  15.143 -+
  15.144 -+static void
  15.145 -+walk_wild_consider_section (lang_wild_statement_type *ptr,
  15.146 -+			    lang_input_statement_type *file,
  15.147 -+			    asection *s,
  15.148 -+			    struct wildcard_list *sec,
  15.149 -+			    callback_t callback,
  15.150 -+			    void *data)
  15.151 -+{
  15.152 -+  bfd_boolean skip = FALSE;
  15.153 -+  struct name_list *list_tmp;
  15.154 -+
  15.155 -+  /* Don't process sections from files which were
  15.156 -+     excluded.  */
  15.157 -+  for (list_tmp = sec->spec.exclude_name_list;
  15.158 -+       list_tmp;
  15.159 -+       list_tmp = list_tmp->next)
  15.160 -+    {
  15.161 -+      bfd_boolean is_wildcard = wildcardp (list_tmp->name);
  15.162 -+      if (is_wildcard)
  15.163 -+	skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  15.164 -+      else
  15.165 -+	skip = strcmp (list_tmp->name, file->filename) == 0;
  15.166 -+
  15.167 -+      /* If this file is part of an archive, and the archive is
  15.168 -+	 excluded, exclude this file.  */
  15.169 -+      if (! skip && file->the_bfd != NULL
  15.170 -+	  && file->the_bfd->my_archive != NULL
  15.171 -+	  && file->the_bfd->my_archive->filename != NULL)
  15.172 -+	{
  15.173 -+	  if (is_wildcard)
  15.174 -+	    skip = fnmatch (list_tmp->name,
  15.175 -+			    file->the_bfd->my_archive->filename,
  15.176 -+			    0) == 0;
  15.177 -+	  else
  15.178 -+	    skip = strcmp (list_tmp->name,
  15.179 -+			   file->the_bfd->my_archive->filename) == 0;
  15.180 -+	}
  15.181 -+
  15.182 -+      if (skip)
  15.183 -+	break;
  15.184 -+    }
  15.185 -+
  15.186 -+  if (!skip)
  15.187 -+    (*callback) (ptr, sec, s, file, data);
  15.188 -+}
  15.189 -+
  15.190 -+/* Lowest common denominator routine that can handle everything correctly,
  15.191 -+   but slowly.  */
  15.192 -+
  15.193 - static void
  15.194 --walk_wild_section (lang_wild_statement_type *ptr,
  15.195 --		   lang_input_statement_type *file,
  15.196 --		   callback_t callback,
  15.197 --		   void *data)
  15.198 -+walk_wild_section_general (lang_wild_statement_type *ptr,
  15.199 -+			   lang_input_statement_type *file,
  15.200 -+			   callback_t callback,
  15.201 -+			   void *data)
  15.202 - {
  15.203 -   asection *s;
  15.204 --
  15.205 --  if (file->just_syms_flag)
  15.206 --    return;
  15.207 -+  struct wildcard_list *sec;
  15.208 - 
  15.209 -   for (s = file->the_bfd->sections; s != NULL; s = s->next)
  15.210 -     {
  15.211 --      struct wildcard_list *sec;
  15.212 --
  15.213 -       sec = ptr->section_list;
  15.214 -       if (sec == NULL)
  15.215 - 	(*callback) (ptr, sec, s, file, data);
  15.216 -@@ -160,39 +207,8 @@
  15.217 -       while (sec != NULL)
  15.218 - 	{
  15.219 - 	  bfd_boolean skip = FALSE;
  15.220 --	  struct name_list *list_tmp;
  15.221 --
  15.222 --	  /* Don't process sections from files which were
  15.223 --	     excluded.  */
  15.224 --	  for (list_tmp = sec->spec.exclude_name_list;
  15.225 --	       list_tmp;
  15.226 --	       list_tmp = list_tmp->next)
  15.227 --	    {
  15.228 --	      if (wildcardp (list_tmp->name))
  15.229 --		skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  15.230 --	      else
  15.231 --		skip = strcmp (list_tmp->name, file->filename) == 0;
  15.232 --
  15.233 --	      /* If this file is part of an archive, and the archive is
  15.234 --		 excluded, exclude this file.  */
  15.235 --	      if (! skip && file->the_bfd != NULL
  15.236 --		  && file->the_bfd->my_archive != NULL
  15.237 --		  && file->the_bfd->my_archive->filename != NULL)
  15.238 --		{
  15.239 --		  if (wildcardp (list_tmp->name))
  15.240 --		    skip = fnmatch (list_tmp->name,
  15.241 --				    file->the_bfd->my_archive->filename,
  15.242 --				    0) == 0;
  15.243 --		  else
  15.244 --		    skip = strcmp (list_tmp->name,
  15.245 --				   file->the_bfd->my_archive->filename) == 0;
  15.246 --		}
  15.247 --
  15.248 --	      if (skip)
  15.249 --		break;
  15.250 --	    }
  15.251 - 
  15.252 --	  if (!skip && sec->spec.name != NULL)
  15.253 -+	  if (sec->spec.name != NULL)
  15.254 - 	    {
  15.255 - 	      const char *sname = bfd_get_section_name (file->the_bfd, s);
  15.256 - 
  15.257 -@@ -203,13 +219,381 @@
  15.258 - 	    }
  15.259 - 
  15.260 - 	  if (!skip)
  15.261 --	    (*callback) (ptr, sec, s, file, data);
  15.262 -+	    walk_wild_consider_section (ptr, file, s, sec, callback, data);
  15.263 - 
  15.264 - 	  sec = sec->next;
  15.265 - 	}
  15.266 -     }
  15.267 - }
  15.268 - 
  15.269 -+/* Routines to find a single section given its name.  If there's more
  15.270 -+   than one section with that name, we report that.  */
  15.271 -+
  15.272 -+typedef struct
  15.273 -+{
  15.274 -+  asection *found_section;
  15.275 -+  bfd_boolean multiple_sections_found;
  15.276 -+} section_iterator_callback_data;
  15.277 -+
  15.278 -+static bfd_boolean
  15.279 -+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
  15.280 -+{
  15.281 -+  section_iterator_callback_data *d = data;
  15.282 -+
  15.283 -+  if (d->found_section != NULL)
  15.284 -+    {
  15.285 -+      d->multiple_sections_found = TRUE;
  15.286 -+      return TRUE;
  15.287 -+    }
  15.288 -+
  15.289 -+  d->found_section = s;
  15.290 -+  return FALSE;
  15.291 -+}
  15.292 -+
  15.293 -+static asection *
  15.294 -+find_section (lang_input_statement_type *file,
  15.295 -+	      struct wildcard_list *sec,
  15.296 -+	      bfd_boolean *multiple_sections_found)
  15.297 -+{
  15.298 -+  section_iterator_callback_data cb_data = { NULL, FALSE };
  15.299 -+
  15.300 -+  bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, 
  15.301 -+			      section_iterator_callback, &cb_data);
  15.302 -+  *multiple_sections_found = cb_data.multiple_sections_found;
  15.303 -+  return cb_data.found_section;
  15.304 -+}
  15.305 -+
  15.306 -+/* Code for handling simple wildcards without going through fnmatch,
  15.307 -+   which can be expensive because of charset translations etc.  */
  15.308 -+
  15.309 -+/* A simple wild is a literal string followed by a single '*',
  15.310 -+   where the literal part is at least 4 characters long.  */
  15.311 -+
  15.312 -+static bfd_boolean
  15.313 -+is_simple_wild (const char *name)
  15.314 -+{
  15.315 -+  size_t len = strcspn (name, "*?[");
  15.316 -+  return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
  15.317 -+}
  15.318 -+
  15.319 -+static bfd_boolean
  15.320 -+match_simple_wild (const char *pattern, const char *name)
  15.321 -+{
  15.322 -+  /* The first four characters of the pattern are guaranteed valid
  15.323 -+     non-wildcard characters.  So we can go faster.  */
  15.324 -+  if (pattern[0] != name[0] || pattern[1] != name[1]
  15.325 -+      || pattern[2] != name[2] || pattern[3] != name[3])
  15.326 -+    return FALSE;
  15.327 -+
  15.328 -+  pattern += 4;
  15.329 -+  name += 4;
  15.330 -+  while (*pattern != '*')
  15.331 -+    if (*name++ != *pattern++)
  15.332 -+      return FALSE;
  15.333 -+
  15.334 -+  return TRUE;
  15.335 -+}
  15.336 -+
  15.337 -+/* Specialized, optimized routines for handling different kinds of
  15.338 -+   wildcards */
  15.339 -+
  15.340 -+static void
  15.341 -+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
  15.342 -+				lang_input_statement_type *file,
  15.343 -+				callback_t callback,
  15.344 -+				void *data)
  15.345 -+{
  15.346 -+  /* We can just do a hash lookup for the section with the right name.
  15.347 -+     But if that lookup discovers more than one section with the name
  15.348 -+     (should be rare), we fall back to the general algorithm because
  15.349 -+     we would otherwise have to sort the sections to make sure they
  15.350 -+     get processed in the bfd's order.  */
  15.351 -+  bfd_boolean multiple_sections_found;
  15.352 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  15.353 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  15.354 -+
  15.355 -+  if (multiple_sections_found)
  15.356 -+    walk_wild_section_general (ptr, file, callback, data);
  15.357 -+  else if (s0)
  15.358 -+    walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
  15.359 -+}
  15.360 -+
  15.361 -+static void
  15.362 -+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
  15.363 -+				lang_input_statement_type *file,
  15.364 -+				callback_t callback,
  15.365 -+				void *data)
  15.366 -+{
  15.367 -+  asection *s;
  15.368 -+  struct wildcard_list *wildsec0 = ptr->handler_data[0];
  15.369 -+
  15.370 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  15.371 -+    {
  15.372 -+      const char *sname = bfd_get_section_name (file->the_bfd, s);
  15.373 -+      bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
  15.374 -+
  15.375 -+      if (!skip)
  15.376 -+	walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
  15.377 -+    }
  15.378 -+}
  15.379 -+
  15.380 -+static void
  15.381 -+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
  15.382 -+				lang_input_statement_type *file,
  15.383 -+				callback_t callback,
  15.384 -+				void *data)
  15.385 -+{
  15.386 -+  asection *s;
  15.387 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  15.388 -+  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  15.389 -+  bfd_boolean multiple_sections_found;
  15.390 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  15.391 -+
  15.392 -+  if (multiple_sections_found)
  15.393 -+    {
  15.394 -+      walk_wild_section_general (ptr, file, callback, data);
  15.395 -+      return;
  15.396 -+    }
  15.397 -+
  15.398 -+  /* Note that if the section was not found, s0 is NULL and
  15.399 -+     we'll simply never succeed the s == s0 test below.  */
  15.400 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  15.401 -+    {
  15.402 -+      /* Recall that in this code path, a section cannot satisfy more
  15.403 -+	 than one spec, so if s == s0 then it cannot match
  15.404 -+	 wildspec1.  */
  15.405 -+      if (s == s0)
  15.406 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  15.407 -+      else
  15.408 -+	{
  15.409 -+	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  15.410 -+	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  15.411 -+
  15.412 -+	  if (!skip)
  15.413 -+	    walk_wild_consider_section (ptr, file, s, wildsec1, callback,
  15.414 -+					data);
  15.415 -+	}
  15.416 -+    }
  15.417 -+}
  15.418 -+
  15.419 -+static void
  15.420 -+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
  15.421 -+				lang_input_statement_type *file,
  15.422 -+				callback_t callback,
  15.423 -+				void *data)
  15.424 -+{
  15.425 -+  asection *s;
  15.426 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  15.427 -+  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  15.428 -+  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  15.429 -+  bfd_boolean multiple_sections_found;
  15.430 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  15.431 -+
  15.432 -+  if (multiple_sections_found)
  15.433 -+    {
  15.434 -+      walk_wild_section_general (ptr, file, callback, data);
  15.435 -+      return;
  15.436 -+    }
  15.437 -+
  15.438 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  15.439 -+    {
  15.440 -+      if (s == s0)
  15.441 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  15.442 -+      else
  15.443 -+	{
  15.444 -+	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  15.445 -+	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  15.446 -+
  15.447 -+	  if (!skip)
  15.448 -+	    walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
  15.449 -+	  else
  15.450 -+	    {
  15.451 -+	      skip = !match_simple_wild (wildsec2->spec.name, sname);
  15.452 -+	      if (!skip)
  15.453 -+		walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  15.454 -+					    data);
  15.455 -+	    }
  15.456 -+	}
  15.457 -+    }
  15.458 -+}
  15.459 -+
  15.460 -+static void
  15.461 -+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
  15.462 -+				lang_input_statement_type *file,
  15.463 -+				callback_t callback,
  15.464 -+				void *data)
  15.465 -+{
  15.466 -+  asection *s;
  15.467 -+  struct wildcard_list *sec0 = ptr->handler_data[0];
  15.468 -+  struct wildcard_list *sec1 = ptr->handler_data[1];
  15.469 -+  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  15.470 -+  struct wildcard_list *wildsec3 = ptr->handler_data[3];
  15.471 -+  bfd_boolean multiple_sections_found;
  15.472 -+  asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
  15.473 -+
  15.474 -+  if (multiple_sections_found)
  15.475 -+    {
  15.476 -+      walk_wild_section_general (ptr, file, callback, data);
  15.477 -+      return;
  15.478 -+    }
  15.479 -+
  15.480 -+  s1 = find_section (file, sec1, &multiple_sections_found);
  15.481 -+  if (multiple_sections_found)
  15.482 -+    {
  15.483 -+      walk_wild_section_general (ptr, file, callback, data);
  15.484 -+      return;
  15.485 -+    }
  15.486 -+
  15.487 -+  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  15.488 -+    {
  15.489 -+      if (s == s0)
  15.490 -+	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  15.491 -+      else
  15.492 -+	if (s == s1)
  15.493 -+	  walk_wild_consider_section (ptr, file, s, sec1, callback, data);
  15.494 -+	else
  15.495 -+	  {
  15.496 -+	    const char *sname = bfd_get_section_name (file->the_bfd, s);
  15.497 -+	    bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
  15.498 -+						   sname);
  15.499 -+
  15.500 -+	    if (!skip)
  15.501 -+	      walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  15.502 -+					  data);
  15.503 -+	    else
  15.504 -+	      {
  15.505 -+		skip = !match_simple_wild (wildsec3->spec.name, sname);
  15.506 -+		if (!skip)
  15.507 -+		  walk_wild_consider_section (ptr, file, s, wildsec3,
  15.508 -+					      callback, data);
  15.509 -+	      }
  15.510 -+	  }
  15.511 -+    }
  15.512 -+}
  15.513 -+
  15.514 -+static void
  15.515 -+walk_wild_section (lang_wild_statement_type *ptr,
  15.516 -+		   lang_input_statement_type *file,
  15.517 -+		   callback_t callback,
  15.518 -+		   void *data)
  15.519 -+{
  15.520 -+  if (file->just_syms_flag)
  15.521 -+    return;
  15.522 -+
  15.523 -+  (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
  15.524 -+}
  15.525 -+
  15.526 -+/* Returns TRUE when name1 is a wildcard spec that might match
  15.527 -+   something name2 can match.  We're conservative: we return FALSE
  15.528 -+   only if the prefixes of name1 and name2 are different up to the
  15.529 -+   first wildcard character.  */
  15.530 -+
  15.531 -+static bfd_boolean
  15.532 -+wild_spec_can_overlap (const char *name1, const char *name2)
  15.533 -+{
  15.534 -+  size_t prefix1_len = strcspn (name1, "?*[");
  15.535 -+  size_t prefix2_len = strcspn (name2, "?*[");
  15.536 -+  size_t min_prefix_len;
  15.537 -+
  15.538 -+  /* Note that if there is no wildcard character, then we treat the
  15.539 -+     terminating 0 as part of the prefix.  Thus ".text" won't match
  15.540 -+     ".text." or ".text.*", for example.  */
  15.541 -+  if (name1[prefix1_len] == '\0')
  15.542 -+    prefix1_len++;
  15.543 -+  if (name2[prefix2_len] == '\0')
  15.544 -+    prefix2_len++;
  15.545 -+
  15.546 -+  min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
  15.547 -+
  15.548 -+  return memcmp (name1, name2, min_prefix_len) == 0;
  15.549 -+}
  15.550 -+
  15.551 -+/* Select specialized code to handle various kinds of wildcard
  15.552 -+   statements.  */
  15.553 -+
  15.554 -+static void
  15.555 -+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
  15.556 -+{
  15.557 -+  int sec_count = 0;
  15.558 -+  int wild_name_count = 0;
  15.559 -+  struct wildcard_list *sec;
  15.560 -+  int signature;
  15.561 -+  int data_counter;
  15.562 -+
  15.563 -+  ptr->walk_wild_section_handler = walk_wild_section_general;
  15.564 -+
  15.565 -+  /* Count how many wildcard_specs there are, and how many of those
  15.566 -+     actually use wildcards in the name.  Also, bail out if any of the
  15.567 -+     wildcard names are NULL. (Can this actually happen?
  15.568 -+     walk_wild_section used to test for it.)  And bail out if any
  15.569 -+     of the wildcards are more complex than a simple string
  15.570 -+     ending in a single '*'.  */
  15.571 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  15.572 -+    {
  15.573 -+      ++sec_count;
  15.574 -+      if (sec->spec.name == NULL)
  15.575 -+	return;
  15.576 -+      if (wildcardp (sec->spec.name))
  15.577 -+	{
  15.578 -+	  ++wild_name_count;
  15.579 -+	  if (!is_simple_wild (sec->spec.name))
  15.580 -+	    return;
  15.581 -+	}
  15.582 -+    }
  15.583 -+
  15.584 -+  /* The zero-spec case would be easy to optimize but it doesn't
  15.585 -+     happen in practice.  Likewise, more than 4 specs doesn't
  15.586 -+     happen in practice.  */
  15.587 -+  if (sec_count == 0 || sec_count > 4)
  15.588 -+    return;
  15.589 -+
  15.590 -+  /* Check that no two specs can match the same section.  */
  15.591 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  15.592 -+    {
  15.593 -+      struct wildcard_list *sec2;
  15.594 -+      for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
  15.595 -+	{
  15.596 -+	  if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
  15.597 -+	    return;
  15.598 -+	}
  15.599 -+    }
  15.600 -+
  15.601 -+  signature = (sec_count << 8) + wild_name_count;
  15.602 -+  switch (signature)
  15.603 -+    {
  15.604 -+    case 0x0100:
  15.605 -+      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
  15.606 -+      break;
  15.607 -+    case 0x0101:
  15.608 -+      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
  15.609 -+      break;
  15.610 -+    case 0x0201:
  15.611 -+      ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
  15.612 -+      break;
  15.613 -+    case 0x0302:
  15.614 -+      ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
  15.615 -+      break;
  15.616 -+    case 0x0402:
  15.617 -+      ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
  15.618 -+      break;
  15.619 -+    default:
  15.620 -+      return;
  15.621 -+    }
  15.622 -+
  15.623 -+  /* Now fill the data array with pointers to the specs, first the
  15.624 -+     specs with non-wildcard names, then the specs with wildcard
  15.625 -+     names.  It's OK to process the specs in different order from the
  15.626 -+     given order, because we've already determined that no section
  15.627 -+     will match more than one spec.  */
  15.628 -+  data_counter = 0;
  15.629 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  15.630 -+    if (!wildcardp (sec->spec.name))
  15.631 -+      ptr->handler_data[data_counter++] = sec;
  15.632 -+  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  15.633 -+    if (wildcardp (sec->spec.name))
  15.634 -+      ptr->handler_data[data_counter++] = sec;
  15.635 -+}
  15.636 -+
  15.637 - /* Handle a wild statement for a single file F.  */
  15.638 - 
  15.639 - static void
  15.640 -@@ -4353,6 +4737,7 @@
  15.641 -   new->section_list = section_list;
  15.642 -   new->keep_sections = keep_sections;
  15.643 -   lang_list_init (&new->children);
  15.644 -+  analyze_walk_wild_section_handler (new);
  15.645 - }
  15.646 - 
  15.647 - void
  15.648 ---- binutils-2.15/ld/ldlang.h.old	2004-05-17 15:36:16.000000000 -0400
  15.649 -+++ binutils-2.15/ld/ldlang.h	2006-01-23 13:32:33.653292000 -0500
  15.650 -@@ -295,7 +295,17 @@
  15.651 -   union lang_statement_union *file;
  15.652 - } lang_afile_asection_pair_statement_type;
  15.653 - 
  15.654 --typedef struct lang_wild_statement_struct
  15.655 -+typedef struct lang_wild_statement_struct lang_wild_statement_type;
  15.656 -+
  15.657 -+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  15.658 -+			    asection *, lang_input_statement_type *, void *);
  15.659 -+
  15.660 -+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
  15.661 -+					     lang_input_statement_type *,
  15.662 -+					     callback_t callback,
  15.663 -+					     void *data);
  15.664 -+
  15.665 -+struct lang_wild_statement_struct
  15.666 - {
  15.667 -   lang_statement_header_type header;
  15.668 -   const char *filename;
  15.669 -@@ -303,7 +313,10 @@
  15.670 -   struct wildcard_list *section_list;
  15.671 -   bfd_boolean keep_sections;
  15.672 -   lang_statement_list_type children;
  15.673 --} lang_wild_statement_type;
  15.674 -+
  15.675 -+  walk_wild_section_handler_t walk_wild_section_handler;
  15.676 -+  struct wildcard_list *handler_data[4];
  15.677 -+};
  15.678 - 
  15.679 - typedef struct lang_address_statement_struct
  15.680 - {
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/binutils/2.15/790-ld-callahan.patch	Mon Jul 28 20:17:48 2008 +0000
    16.3 @@ -0,0 +1,677 @@
    16.4 +Signed-off-by: dank@kegel.com
    16.5 +Fixes ld speed issue. 
    16.6 +See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
    16.7 +See thread "Re: optimizations for 3x speedup in ld",
    16.8 +http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
    16.9 +
   16.10 +Wildcard section matching enhancement, backported from the binutils CVS tree.
   16.11 +Here's the CVS log comment from the original change to ldlang.c:
   16.12 +
   16.13 +revision 1.177
   16.14 +date: 2005/04/06 15:33:02;  author: jakub;  state: Exp;  lines: +438 -51
   16.15 +2005-04-06  Jakub Jelinek  <jakub@redhat.com>
   16.16 +
   16.17 +        * ldlang.c: Formatting.
   16.18 +        (walk_wild_consider_section): Remember return value from wildcardp.
   16.19 +        (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
   16.20 +        (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
   16.21 +
   16.22 +2005-04-06  Robert O'Callahan  <rocallahan@novell.com>
   16.23 +
   16.24 +        * ld.h (lean_section_userdata_type): Remove.
   16.25 +        (fat_section_userdata_type): Remove file field.
   16.26 +        (SECTION_USERDATA_SIZE): Remove.
   16.27 +        * ldlang.c (init_os): Eliminate initialization of unused
   16.28 +        lean_section_userdata_type.
   16.29 +
   16.30 +        * ldlang.h (callback_t, walk_wild_section_handler_t): New
   16.31 +        typedefs.
   16.32 +        (struct lang_wild_statement_struct): Add walk_wild_section_handler
   16.33 +        and handler_data fields.
   16.34 +        * ldlang.c (callback_t): Removed.
   16.35 +        (walk_wild_consider_section, walk_wild_section_general,
   16.36 +        section_iterator_callback, find_section, is_simple_wild,
   16.37 +        match_simple_wild, walk_wild_section_specs1_wild0,
   16.38 +        walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
   16.39 +        walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
   16.40 +        wild_spec_can_overlap, analyze_walk_wild_section_handler): New
   16.41 +        functions.
   16.42 +        (lang_add_wild): Call analyze_walk_wild_section_handler.
   16.43 +        (walk_wild_section): Renamed to walk_wild_section_general and
   16.44 +        created a wrapper function.
   16.45 +        (section_iterator_callback_data): New typedef.
   16.46 +
   16.47 +Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported
   16.48 +as well.
   16.49 +
   16.50 +--- binutils-2.15/bfd/bfd-in2.h.old	2004-05-17 15:35:56.000000000 -0400
   16.51 ++++ binutils-2.15/bfd/bfd-in2.h	2006-02-09 11:54:45.989940000 -0500
   16.52 +@@ -1425,6 +1425,10 @@
   16.53 + 
   16.54 + asection *bfd_get_section_by_name (bfd *abfd, const char *name);
   16.55 + 
   16.56 ++asection *bfd_get_section_by_name_if (bfd *abfd, const char *name,
   16.57 ++   bfd_boolean (*operation) (bfd *, asection *, void *),
   16.58 ++   void *user_storage);
   16.59 ++
   16.60 + char *bfd_get_unique_section_name
   16.61 +    (bfd *abfd, const char *templat, int *count);
   16.62 + 
   16.63 +--- binutils-2.15/bfd/section.c.old	2003-12-01 01:33:01.000000000 -0500
   16.64 ++++ binutils-2.15/bfd/section.c	2006-01-23 14:16:54.768993000 -0500
   16.65 +@@ -801,6 +801,57 @@
   16.66 + 
   16.67 + /*
   16.68 + FUNCTION
   16.69 ++	bfd_get_section_by_name_if
   16.70 ++
   16.71 ++SYNOPSIS
   16.72 ++	asection *bfd_get_section_by_name_if
   16.73 ++	  (bfd *abfd,
   16.74 ++	   const char *name,
   16.75 ++	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
   16.76 ++	   void *obj);
   16.77 ++
   16.78 ++DESCRIPTION
   16.79 ++	Call the provided function @var{func} for each section
   16.80 ++	attached to the BFD @var{abfd} whose name matches @var{name},
   16.81 ++	passing @var{obj} as an argument. The function will be called
   16.82 ++	as if by
   16.83 ++
   16.84 ++|	func (abfd, the_section, obj);
   16.85 ++
   16.86 ++	It returns the first section for which @var{func} returns true,
   16.87 ++	otherwise <<NULL>>.
   16.88 ++
   16.89 ++*/
   16.90 ++
   16.91 ++asection *
   16.92 ++bfd_get_section_by_name_if (bfd *abfd, const char *name,
   16.93 ++			    bfd_boolean (*operation) (bfd *,
   16.94 ++						      asection *,
   16.95 ++						      void *),
   16.96 ++			    void *user_storage)
   16.97 ++{
   16.98 ++  struct section_hash_entry *sh;
   16.99 ++  unsigned long hash;
  16.100 ++
  16.101 ++  sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
  16.102 ++  if (sh == NULL)
  16.103 ++    return NULL;
  16.104 ++
  16.105 ++  hash = sh->root.hash;
  16.106 ++  do
  16.107 ++    {
  16.108 ++      if ((*operation) (abfd, &sh->section, user_storage))
  16.109 ++	return &sh->section;
  16.110 ++      sh = (struct section_hash_entry *) sh->root.next;
  16.111 ++    }
  16.112 ++  while (sh != NULL && sh->root.hash == hash
  16.113 ++	 && strcmp (sh->root.string, name) == 0);
  16.114 ++
  16.115 ++  return NULL;
  16.116 ++}
  16.117 ++
  16.118 ++/*
  16.119 ++FUNCTION
  16.120 + 	bfd_get_unique_section_name
  16.121 + 
  16.122 + SYNOPSIS
  16.123 +--- binutils-2.15/ld/ldlang.c.old	2004-05-17 15:36:16.000000000 -0400
  16.124 ++++ binutils-2.15/ld/ldlang.c	2006-01-23 13:40:12.745499000 -0500
  16.125 +@@ -81,9 +81,6 @@
  16.126 + static void lang_record_phdrs (void);
  16.127 + static void lang_do_version_exports_section (void);
  16.128 + 
  16.129 +-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  16.130 +-			    asection *, lang_input_statement_type *, void *);
  16.131 +-
  16.132 + /* Exported variables.  */
  16.133 + lang_output_section_statement_type *abs_output_section;
  16.134 + lang_statement_list_type lang_output_section_statement;
  16.135 +@@ -138,21 +135,71 @@
  16.136 + 
  16.137 + /* Generic traversal routines for finding matching sections.  */
  16.138 + 
  16.139 ++/* Try processing a section against a wildcard.  This just calls
  16.140 ++   the callback unless the filename exclusion list is present
  16.141 ++   and excludes the file.  It's hardly ever present so this
  16.142 ++   function is very fast.  */
  16.143 ++
  16.144 ++static void
  16.145 ++walk_wild_consider_section (lang_wild_statement_type *ptr,
  16.146 ++			    lang_input_statement_type *file,
  16.147 ++			    asection *s,
  16.148 ++			    struct wildcard_list *sec,
  16.149 ++			    callback_t callback,
  16.150 ++			    void *data)
  16.151 ++{
  16.152 ++  bfd_boolean skip = FALSE;
  16.153 ++  struct name_list *list_tmp;
  16.154 ++
  16.155 ++  /* Don't process sections from files which were
  16.156 ++     excluded.  */
  16.157 ++  for (list_tmp = sec->spec.exclude_name_list;
  16.158 ++       list_tmp;
  16.159 ++       list_tmp = list_tmp->next)
  16.160 ++    {
  16.161 ++      bfd_boolean is_wildcard = wildcardp (list_tmp->name);
  16.162 ++      if (is_wildcard)
  16.163 ++	skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  16.164 ++      else
  16.165 ++	skip = strcmp (list_tmp->name, file->filename) == 0;
  16.166 ++
  16.167 ++      /* If this file is part of an archive, and the archive is
  16.168 ++	 excluded, exclude this file.  */
  16.169 ++      if (! skip && file->the_bfd != NULL
  16.170 ++	  && file->the_bfd->my_archive != NULL
  16.171 ++	  && file->the_bfd->my_archive->filename != NULL)
  16.172 ++	{
  16.173 ++	  if (is_wildcard)
  16.174 ++	    skip = fnmatch (list_tmp->name,
  16.175 ++			    file->the_bfd->my_archive->filename,
  16.176 ++			    0) == 0;
  16.177 ++	  else
  16.178 ++	    skip = strcmp (list_tmp->name,
  16.179 ++			   file->the_bfd->my_archive->filename) == 0;
  16.180 ++	}
  16.181 ++
  16.182 ++      if (skip)
  16.183 ++	break;
  16.184 ++    }
  16.185 ++
  16.186 ++  if (!skip)
  16.187 ++    (*callback) (ptr, sec, s, file, data);
  16.188 ++}
  16.189 ++
  16.190 ++/* Lowest common denominator routine that can handle everything correctly,
  16.191 ++   but slowly.  */
  16.192 ++
  16.193 + static void
  16.194 +-walk_wild_section (lang_wild_statement_type *ptr,
  16.195 +-		   lang_input_statement_type *file,
  16.196 +-		   callback_t callback,
  16.197 +-		   void *data)
  16.198 ++walk_wild_section_general (lang_wild_statement_type *ptr,
  16.199 ++			   lang_input_statement_type *file,
  16.200 ++			   callback_t callback,
  16.201 ++			   void *data)
  16.202 + {
  16.203 +   asection *s;
  16.204 +-
  16.205 +-  if (file->just_syms_flag)
  16.206 +-    return;
  16.207 ++  struct wildcard_list *sec;
  16.208 + 
  16.209 +   for (s = file->the_bfd->sections; s != NULL; s = s->next)
  16.210 +     {
  16.211 +-      struct wildcard_list *sec;
  16.212 +-
  16.213 +       sec = ptr->section_list;
  16.214 +       if (sec == NULL)
  16.215 + 	(*callback) (ptr, sec, s, file, data);
  16.216 +@@ -160,39 +207,8 @@
  16.217 +       while (sec != NULL)
  16.218 + 	{
  16.219 + 	  bfd_boolean skip = FALSE;
  16.220 +-	  struct name_list *list_tmp;
  16.221 +-
  16.222 +-	  /* Don't process sections from files which were
  16.223 +-	     excluded.  */
  16.224 +-	  for (list_tmp = sec->spec.exclude_name_list;
  16.225 +-	       list_tmp;
  16.226 +-	       list_tmp = list_tmp->next)
  16.227 +-	    {
  16.228 +-	      if (wildcardp (list_tmp->name))
  16.229 +-		skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
  16.230 +-	      else
  16.231 +-		skip = strcmp (list_tmp->name, file->filename) == 0;
  16.232 +-
  16.233 +-	      /* If this file is part of an archive, and the archive is
  16.234 +-		 excluded, exclude this file.  */
  16.235 +-	      if (! skip && file->the_bfd != NULL
  16.236 +-		  && file->the_bfd->my_archive != NULL
  16.237 +-		  && file->the_bfd->my_archive->filename != NULL)
  16.238 +-		{
  16.239 +-		  if (wildcardp (list_tmp->name))
  16.240 +-		    skip = fnmatch (list_tmp->name,
  16.241 +-				    file->the_bfd->my_archive->filename,
  16.242 +-				    0) == 0;
  16.243 +-		  else
  16.244 +-		    skip = strcmp (list_tmp->name,
  16.245 +-				   file->the_bfd->my_archive->filename) == 0;
  16.246 +-		}
  16.247 +-
  16.248 +-	      if (skip)
  16.249 +-		break;
  16.250 +-	    }
  16.251 + 
  16.252 +-	  if (!skip && sec->spec.name != NULL)
  16.253 ++	  if (sec->spec.name != NULL)
  16.254 + 	    {
  16.255 + 	      const char *sname = bfd_get_section_name (file->the_bfd, s);
  16.256 + 
  16.257 +@@ -203,13 +219,381 @@
  16.258 + 	    }
  16.259 + 
  16.260 + 	  if (!skip)
  16.261 +-	    (*callback) (ptr, sec, s, file, data);
  16.262 ++	    walk_wild_consider_section (ptr, file, s, sec, callback, data);
  16.263 + 
  16.264 + 	  sec = sec->next;
  16.265 + 	}
  16.266 +     }
  16.267 + }
  16.268 + 
  16.269 ++/* Routines to find a single section given its name.  If there's more
  16.270 ++   than one section with that name, we report that.  */
  16.271 ++
  16.272 ++typedef struct
  16.273 ++{
  16.274 ++  asection *found_section;
  16.275 ++  bfd_boolean multiple_sections_found;
  16.276 ++} section_iterator_callback_data;
  16.277 ++
  16.278 ++static bfd_boolean
  16.279 ++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
  16.280 ++{
  16.281 ++  section_iterator_callback_data *d = data;
  16.282 ++
  16.283 ++  if (d->found_section != NULL)
  16.284 ++    {
  16.285 ++      d->multiple_sections_found = TRUE;
  16.286 ++      return TRUE;
  16.287 ++    }
  16.288 ++
  16.289 ++  d->found_section = s;
  16.290 ++  return FALSE;
  16.291 ++}
  16.292 ++
  16.293 ++static asection *
  16.294 ++find_section (lang_input_statement_type *file,
  16.295 ++	      struct wildcard_list *sec,
  16.296 ++	      bfd_boolean *multiple_sections_found)
  16.297 ++{
  16.298 ++  section_iterator_callback_data cb_data = { NULL, FALSE };
  16.299 ++
  16.300 ++  bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, 
  16.301 ++			      section_iterator_callback, &cb_data);
  16.302 ++  *multiple_sections_found = cb_data.multiple_sections_found;
  16.303 ++  return cb_data.found_section;
  16.304 ++}
  16.305 ++
  16.306 ++/* Code for handling simple wildcards without going through fnmatch,
  16.307 ++   which can be expensive because of charset translations etc.  */
  16.308 ++
  16.309 ++/* A simple wild is a literal string followed by a single '*',
  16.310 ++   where the literal part is at least 4 characters long.  */
  16.311 ++
  16.312 ++static bfd_boolean
  16.313 ++is_simple_wild (const char *name)
  16.314 ++{
  16.315 ++  size_t len = strcspn (name, "*?[");
  16.316 ++  return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
  16.317 ++}
  16.318 ++
  16.319 ++static bfd_boolean
  16.320 ++match_simple_wild (const char *pattern, const char *name)
  16.321 ++{
  16.322 ++  /* The first four characters of the pattern are guaranteed valid
  16.323 ++     non-wildcard characters.  So we can go faster.  */
  16.324 ++  if (pattern[0] != name[0] || pattern[1] != name[1]
  16.325 ++      || pattern[2] != name[2] || pattern[3] != name[3])
  16.326 ++    return FALSE;
  16.327 ++
  16.328 ++  pattern += 4;
  16.329 ++  name += 4;
  16.330 ++  while (*pattern != '*')
  16.331 ++    if (*name++ != *pattern++)
  16.332 ++      return FALSE;
  16.333 ++
  16.334 ++  return TRUE;
  16.335 ++}
  16.336 ++
  16.337 ++/* Specialized, optimized routines for handling different kinds of
  16.338 ++   wildcards */
  16.339 ++
  16.340 ++static void
  16.341 ++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
  16.342 ++				lang_input_statement_type *file,
  16.343 ++				callback_t callback,
  16.344 ++				void *data)
  16.345 ++{
  16.346 ++  /* We can just do a hash lookup for the section with the right name.
  16.347 ++     But if that lookup discovers more than one section with the name
  16.348 ++     (should be rare), we fall back to the general algorithm because
  16.349 ++     we would otherwise have to sort the sections to make sure they
  16.350 ++     get processed in the bfd's order.  */
  16.351 ++  bfd_boolean multiple_sections_found;
  16.352 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  16.353 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  16.354 ++
  16.355 ++  if (multiple_sections_found)
  16.356 ++    walk_wild_section_general (ptr, file, callback, data);
  16.357 ++  else if (s0)
  16.358 ++    walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
  16.359 ++}
  16.360 ++
  16.361 ++static void
  16.362 ++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
  16.363 ++				lang_input_statement_type *file,
  16.364 ++				callback_t callback,
  16.365 ++				void *data)
  16.366 ++{
  16.367 ++  asection *s;
  16.368 ++  struct wildcard_list *wildsec0 = ptr->handler_data[0];
  16.369 ++
  16.370 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  16.371 ++    {
  16.372 ++      const char *sname = bfd_get_section_name (file->the_bfd, s);
  16.373 ++      bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
  16.374 ++
  16.375 ++      if (!skip)
  16.376 ++	walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
  16.377 ++    }
  16.378 ++}
  16.379 ++
  16.380 ++static void
  16.381 ++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
  16.382 ++				lang_input_statement_type *file,
  16.383 ++				callback_t callback,
  16.384 ++				void *data)
  16.385 ++{
  16.386 ++  asection *s;
  16.387 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  16.388 ++  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  16.389 ++  bfd_boolean multiple_sections_found;
  16.390 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  16.391 ++
  16.392 ++  if (multiple_sections_found)
  16.393 ++    {
  16.394 ++      walk_wild_section_general (ptr, file, callback, data);
  16.395 ++      return;
  16.396 ++    }
  16.397 ++
  16.398 ++  /* Note that if the section was not found, s0 is NULL and
  16.399 ++     we'll simply never succeed the s == s0 test below.  */
  16.400 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  16.401 ++    {
  16.402 ++      /* Recall that in this code path, a section cannot satisfy more
  16.403 ++	 than one spec, so if s == s0 then it cannot match
  16.404 ++	 wildspec1.  */
  16.405 ++      if (s == s0)
  16.406 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  16.407 ++      else
  16.408 ++	{
  16.409 ++	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  16.410 ++	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  16.411 ++
  16.412 ++	  if (!skip)
  16.413 ++	    walk_wild_consider_section (ptr, file, s, wildsec1, callback,
  16.414 ++					data);
  16.415 ++	}
  16.416 ++    }
  16.417 ++}
  16.418 ++
  16.419 ++static void
  16.420 ++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
  16.421 ++				lang_input_statement_type *file,
  16.422 ++				callback_t callback,
  16.423 ++				void *data)
  16.424 ++{
  16.425 ++  asection *s;
  16.426 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  16.427 ++  struct wildcard_list *wildsec1 = ptr->handler_data[1];
  16.428 ++  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  16.429 ++  bfd_boolean multiple_sections_found;
  16.430 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found);
  16.431 ++
  16.432 ++  if (multiple_sections_found)
  16.433 ++    {
  16.434 ++      walk_wild_section_general (ptr, file, callback, data);
  16.435 ++      return;
  16.436 ++    }
  16.437 ++
  16.438 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  16.439 ++    {
  16.440 ++      if (s == s0)
  16.441 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  16.442 ++      else
  16.443 ++	{
  16.444 ++	  const char *sname = bfd_get_section_name (file->the_bfd, s);
  16.445 ++	  bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
  16.446 ++
  16.447 ++	  if (!skip)
  16.448 ++	    walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
  16.449 ++	  else
  16.450 ++	    {
  16.451 ++	      skip = !match_simple_wild (wildsec2->spec.name, sname);
  16.452 ++	      if (!skip)
  16.453 ++		walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  16.454 ++					    data);
  16.455 ++	    }
  16.456 ++	}
  16.457 ++    }
  16.458 ++}
  16.459 ++
  16.460 ++static void
  16.461 ++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
  16.462 ++				lang_input_statement_type *file,
  16.463 ++				callback_t callback,
  16.464 ++				void *data)
  16.465 ++{
  16.466 ++  asection *s;
  16.467 ++  struct wildcard_list *sec0 = ptr->handler_data[0];
  16.468 ++  struct wildcard_list *sec1 = ptr->handler_data[1];
  16.469 ++  struct wildcard_list *wildsec2 = ptr->handler_data[2];
  16.470 ++  struct wildcard_list *wildsec3 = ptr->handler_data[3];
  16.471 ++  bfd_boolean multiple_sections_found;
  16.472 ++  asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
  16.473 ++
  16.474 ++  if (multiple_sections_found)
  16.475 ++    {
  16.476 ++      walk_wild_section_general (ptr, file, callback, data);
  16.477 ++      return;
  16.478 ++    }
  16.479 ++
  16.480 ++  s1 = find_section (file, sec1, &multiple_sections_found);
  16.481 ++  if (multiple_sections_found)
  16.482 ++    {
  16.483 ++      walk_wild_section_general (ptr, file, callback, data);
  16.484 ++      return;
  16.485 ++    }
  16.486 ++
  16.487 ++  for (s = file->the_bfd->sections; s != NULL; s = s->next)
  16.488 ++    {
  16.489 ++      if (s == s0)
  16.490 ++	walk_wild_consider_section (ptr, file, s, sec0, callback, data);
  16.491 ++      else
  16.492 ++	if (s == s1)
  16.493 ++	  walk_wild_consider_section (ptr, file, s, sec1, callback, data);
  16.494 ++	else
  16.495 ++	  {
  16.496 ++	    const char *sname = bfd_get_section_name (file->the_bfd, s);
  16.497 ++	    bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
  16.498 ++						   sname);
  16.499 ++
  16.500 ++	    if (!skip)
  16.501 ++	      walk_wild_consider_section (ptr, file, s, wildsec2, callback,
  16.502 ++					  data);
  16.503 ++	    else
  16.504 ++	      {
  16.505 ++		skip = !match_simple_wild (wildsec3->spec.name, sname);
  16.506 ++		if (!skip)
  16.507 ++		  walk_wild_consider_section (ptr, file, s, wildsec3,
  16.508 ++					      callback, data);
  16.509 ++	      }
  16.510 ++	  }
  16.511 ++    }
  16.512 ++}
  16.513 ++
  16.514 ++static void
  16.515 ++walk_wild_section (lang_wild_statement_type *ptr,
  16.516 ++		   lang_input_statement_type *file,
  16.517 ++		   callback_t callback,
  16.518 ++		   void *data)
  16.519 ++{
  16.520 ++  if (file->just_syms_flag)
  16.521 ++    return;
  16.522 ++
  16.523 ++  (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
  16.524 ++}
  16.525 ++
  16.526 ++/* Returns TRUE when name1 is a wildcard spec that might match
  16.527 ++   something name2 can match.  We're conservative: we return FALSE
  16.528 ++   only if the prefixes of name1 and name2 are different up to the
  16.529 ++   first wildcard character.  */
  16.530 ++
  16.531 ++static bfd_boolean
  16.532 ++wild_spec_can_overlap (const char *name1, const char *name2)
  16.533 ++{
  16.534 ++  size_t prefix1_len = strcspn (name1, "?*[");
  16.535 ++  size_t prefix2_len = strcspn (name2, "?*[");
  16.536 ++  size_t min_prefix_len;
  16.537 ++
  16.538 ++  /* Note that if there is no wildcard character, then we treat the
  16.539 ++     terminating 0 as part of the prefix.  Thus ".text" won't match
  16.540 ++     ".text." or ".text.*", for example.  */
  16.541 ++  if (name1[prefix1_len] == '\0')
  16.542 ++    prefix1_len++;
  16.543 ++  if (name2[prefix2_len] == '\0')
  16.544 ++    prefix2_len++;
  16.545 ++
  16.546 ++  min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
  16.547 ++
  16.548 ++  return memcmp (name1, name2, min_prefix_len) == 0;
  16.549 ++}
  16.550 ++
  16.551 ++/* Select specialized code to handle various kinds of wildcard
  16.552 ++   statements.  */
  16.553 ++
  16.554 ++static void
  16.555 ++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
  16.556 ++{
  16.557 ++  int sec_count = 0;
  16.558 ++  int wild_name_count = 0;
  16.559 ++  struct wildcard_list *sec;
  16.560 ++  int signature;
  16.561 ++  int data_counter;
  16.562 ++
  16.563 ++  ptr->walk_wild_section_handler = walk_wild_section_general;
  16.564 ++
  16.565 ++  /* Count how many wildcard_specs there are, and how many of those
  16.566 ++     actually use wildcards in the name.  Also, bail out if any of the
  16.567 ++     wildcard names are NULL. (Can this actually happen?
  16.568 ++     walk_wild_section used to test for it.)  And bail out if any
  16.569 ++     of the wildcards are more complex than a simple string
  16.570 ++     ending in a single '*'.  */
  16.571 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  16.572 ++    {
  16.573 ++      ++sec_count;
  16.574 ++      if (sec->spec.name == NULL)
  16.575 ++	return;
  16.576 ++      if (wildcardp (sec->spec.name))
  16.577 ++	{
  16.578 ++	  ++wild_name_count;
  16.579 ++	  if (!is_simple_wild (sec->spec.name))
  16.580 ++	    return;
  16.581 ++	}
  16.582 ++    }
  16.583 ++
  16.584 ++  /* The zero-spec case would be easy to optimize but it doesn't
  16.585 ++     happen in practice.  Likewise, more than 4 specs doesn't
  16.586 ++     happen in practice.  */
  16.587 ++  if (sec_count == 0 || sec_count > 4)
  16.588 ++    return;
  16.589 ++
  16.590 ++  /* Check that no two specs can match the same section.  */
  16.591 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  16.592 ++    {
  16.593 ++      struct wildcard_list *sec2;
  16.594 ++      for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
  16.595 ++	{
  16.596 ++	  if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
  16.597 ++	    return;
  16.598 ++	}
  16.599 ++    }
  16.600 ++
  16.601 ++  signature = (sec_count << 8) + wild_name_count;
  16.602 ++  switch (signature)
  16.603 ++    {
  16.604 ++    case 0x0100:
  16.605 ++      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
  16.606 ++      break;
  16.607 ++    case 0x0101:
  16.608 ++      ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
  16.609 ++      break;
  16.610 ++    case 0x0201:
  16.611 ++      ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
  16.612 ++      break;
  16.613 ++    case 0x0302:
  16.614 ++      ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
  16.615 ++      break;
  16.616 ++    case 0x0402:
  16.617 ++      ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
  16.618 ++      break;
  16.619 ++    default:
  16.620 ++      return;
  16.621 ++    }
  16.622 ++
  16.623 ++  /* Now fill the data array with pointers to the specs, first the
  16.624 ++     specs with non-wildcard names, then the specs with wildcard
  16.625 ++     names.  It's OK to process the specs in different order from the
  16.626 ++     given order, because we've already determined that no section
  16.627 ++     will match more than one spec.  */
  16.628 ++  data_counter = 0;
  16.629 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  16.630 ++    if (!wildcardp (sec->spec.name))
  16.631 ++      ptr->handler_data[data_counter++] = sec;
  16.632 ++  for (sec = ptr->section_list; sec != NULL; sec = sec->next)
  16.633 ++    if (wildcardp (sec->spec.name))
  16.634 ++      ptr->handler_data[data_counter++] = sec;
  16.635 ++}
  16.636 ++
  16.637 + /* Handle a wild statement for a single file F.  */
  16.638 + 
  16.639 + static void
  16.640 +@@ -4353,6 +4737,7 @@
  16.641 +   new->section_list = section_list;
  16.642 +   new->keep_sections = keep_sections;
  16.643 +   lang_list_init (&new->children);
  16.644 ++  analyze_walk_wild_section_handler (new);
  16.645 + }
  16.646 + 
  16.647 + void
  16.648 +--- binutils-2.15/ld/ldlang.h.old	2004-05-17 15:36:16.000000000 -0400
  16.649 ++++ binutils-2.15/ld/ldlang.h	2006-01-23 13:32:33.653292000 -0500
  16.650 +@@ -295,7 +295,17 @@
  16.651 +   union lang_statement_union *file;
  16.652 + } lang_afile_asection_pair_statement_type;
  16.653 + 
  16.654 +-typedef struct lang_wild_statement_struct
  16.655 ++typedef struct lang_wild_statement_struct lang_wild_statement_type;
  16.656 ++
  16.657 ++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
  16.658 ++			    asection *, lang_input_statement_type *, void *);
  16.659 ++
  16.660 ++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
  16.661 ++					     lang_input_statement_type *,
  16.662 ++					     callback_t callback,
  16.663 ++					     void *data);
  16.664 ++
  16.665 ++struct lang_wild_statement_struct
  16.666 + {
  16.667 +   lang_statement_header_type header;
  16.668 +   const char *filename;
  16.669 +@@ -303,7 +313,10 @@
  16.670 +   struct wildcard_list *section_list;
  16.671 +   bfd_boolean keep_sections;
  16.672 +   lang_statement_list_type children;
  16.673 +-} lang_wild_statement_type;
  16.674 ++
  16.675 ++  walk_wild_section_handler_t walk_wild_section_handler;
  16.676 ++  struct wildcard_list *handler_data[4];
  16.677 ++};
  16.678 + 
  16.679 + typedef struct lang_address_statement_struct
  16.680 + {
    17.1 --- a/patches/binutils/2.15/800-ld-2.15-stabs-tweak.patch	Mon Jul 28 20:10:34 2008 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,33 +0,0 @@
    17.4 -Signed-off-by: dank@kegel.com
    17.5 -
    17.6 -See http://sourceware.org/ml/binutils/2005-12/msg00270.html
    17.7 -http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
    17.8 -
    17.9 -STABS hash table size change, backported from the binutils CVS tree.  Here's
   17.10 -the CVS log comment for the original change:
   17.11 -
   17.12 -revision 1.25
   17.13 -date: 2005/12/29 10:29:23;  author: nickc;  state: Exp;  lines: +2 -3
   17.14 -(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
   17.15 -bfd_hash_table_init_n(...,251) so that the size of the hash table can be
   17.16 -controlled by the user.
   17.17 -
   17.18 -Note that tunable hash table size changes were added after 2.15.  The effect
   17.19 -of this change is to make bfd use its default hash table size for the stabs
   17.20 -hash as well.
   17.21 -
   17.22 -
   17.23 ---- binutils-2.15/bfd/stabs.c.old	2004-05-17 15:36:04.000000000 -0400
   17.24 -+++ binutils-2.15/bfd/stabs.c	2006-02-09 15:21:56.567014000 -0500
   17.25 -@@ -241,9 +241,8 @@
   17.26 - 	goto error_return;
   17.27 -       /* Make sure the first byte is zero.  */
   17.28 -       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
   17.29 --      if (! bfd_hash_table_init_n (&sinfo->includes.root,
   17.30 --				   stab_link_includes_newfunc,
   17.31 --				   251))
   17.32 -+      if (! bfd_hash_table_init (&sinfo->includes.root,
   17.33 -+				   stab_link_includes_newfunc))
   17.34 - 	goto error_return;
   17.35 -       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
   17.36 -       sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/binutils/2.15/800-ld-stabs-tweak.patch	Mon Jul 28 20:17:48 2008 +0000
    18.3 @@ -0,0 +1,33 @@
    18.4 +Signed-off-by: dank@kegel.com
    18.5 +
    18.6 +See http://sourceware.org/ml/binutils/2005-12/msg00270.html
    18.7 +http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
    18.8 +
    18.9 +STABS hash table size change, backported from the binutils CVS tree.  Here's
   18.10 +the CVS log comment for the original change:
   18.11 +
   18.12 +revision 1.25
   18.13 +date: 2005/12/29 10:29:23;  author: nickc;  state: Exp;  lines: +2 -3
   18.14 +(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
   18.15 +bfd_hash_table_init_n(...,251) so that the size of the hash table can be
   18.16 +controlled by the user.
   18.17 +
   18.18 +Note that tunable hash table size changes were added after 2.15.  The effect
   18.19 +of this change is to make bfd use its default hash table size for the stabs
   18.20 +hash as well.
   18.21 +
   18.22 +
   18.23 +--- binutils-2.15/bfd/stabs.c.old	2004-05-17 15:36:04.000000000 -0400
   18.24 ++++ binutils-2.15/bfd/stabs.c	2006-02-09 15:21:56.567014000 -0500
   18.25 +@@ -241,9 +241,8 @@
   18.26 + 	goto error_return;
   18.27 +       /* Make sure the first byte is zero.  */
   18.28 +       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
   18.29 +-      if (! bfd_hash_table_init_n (&sinfo->includes.root,
   18.30 +-				   stab_link_includes_newfunc,
   18.31 +-				   251))
   18.32 ++      if (! bfd_hash_table_init (&sinfo->includes.root,
   18.33 ++				   stab_link_includes_newfunc))
   18.34 + 	goto error_return;
   18.35 +       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
   18.36 +       sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
    19.1 --- a/patches/binutils/2.16.1/110-binutils-2.15-psignal.patch	Mon Jul 28 20:10:34 2008 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,40 +0,0 @@
    19.4 -Make psignal prototype in libiberty match that in glibc.
    19.5 -
    19.6 -Fixes:
    19.7 -
    19.8 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    19.9 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   19.10 -/usr/include/signal.h:131: prototype declaration
   19.11 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   19.12 -/usr/include/signal.h:131: prototype declaration
   19.13 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   19.14 -mprotect... make[1]: *** [strsignal.o] Error 1
   19.15 -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'
   19.16 -make: *** [all-libiberty] Error 2
   19.17 -
   19.18 -when building on red hat 7.1
   19.19 -though it's a bit of a mystery why libiberty's psignal is being compiled at
   19.20 -all, since red hat 7.1's glibc supports psignal (hence the error message)
   19.21 -
   19.22 ---- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   19.23 -+++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   19.24 -@@ -544,7 +544,7 @@
   19.25 - 
   19.26 - /*
   19.27 - 
   19.28 --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   19.29 -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   19.30 - 
   19.31 - Print @var{message} to the standard error, followed by a colon,
   19.32 - followed by the description of the signal specified by @var{signo},
   19.33 -@@ -557,9 +557,7 @@
   19.34 - #ifndef HAVE_PSIGNAL
   19.35 - 
   19.36 - void
   19.37 --psignal (signo, message)
   19.38 --  unsigned signo;
   19.39 --  char *message;
   19.40 -+psignal (int signo, const char *message)
   19.41 - {
   19.42 -   if (signal_names == NULL)
   19.43 -     {
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/binutils/2.16.1/110-psignal.patch	Mon Jul 28 20:17:48 2008 +0000
    20.3 @@ -0,0 +1,40 @@
    20.4 +Make psignal prototype in libiberty match that in glibc.
    20.5 +
    20.6 +Fixes:
    20.7 +
    20.8 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    20.9 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   20.10 +/usr/include/signal.h:131: prototype declaration
   20.11 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   20.12 +/usr/include/signal.h:131: prototype declaration
   20.13 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   20.14 +mprotect... make[1]: *** [strsignal.o] Error 1
   20.15 +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'
   20.16 +make: *** [all-libiberty] Error 2
   20.17 +
   20.18 +when building on red hat 7.1
   20.19 +though it's a bit of a mystery why libiberty's psignal is being compiled at
   20.20 +all, since red hat 7.1's glibc supports psignal (hence the error message)
   20.21 +
   20.22 +--- binutils-2.15/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   20.23 ++++ binutils-2.15/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   20.24 +@@ -544,7 +544,7 @@
   20.25 + 
   20.26 + /*
   20.27 + 
   20.28 +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   20.29 ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   20.30 + 
   20.31 + Print @var{message} to the standard error, followed by a colon,
   20.32 + followed by the description of the signal specified by @var{signo},
   20.33 +@@ -557,9 +557,7 @@
   20.34 + #ifndef HAVE_PSIGNAL
   20.35 + 
   20.36 + void
   20.37 +-psignal (signo, message)
   20.38 +-  unsigned signo;
   20.39 +-  char *message;
   20.40 ++psignal (int signo, const char *message)
   20.41 + {
   20.42 +   if (signal_names == NULL)
   20.43 +     {
    21.1 --- a/patches/binutils/2.16.1/120-binutils-skip-comments.patch	Mon Jul 28 20:10:34 2008 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,95 +0,0 @@
    21.4 -[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    21.5 -
    21.6 -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    21.7 -Fixes
    21.8 -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    21.9 -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   21.10 -
   21.11 -Paths adjusted to match crosstool's patcher.
   21.12 -
   21.13 -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   21.14 -From: Andreas Schwab <schwab at suse dot de>
   21.15 -To: Nathan Sidwell <nathan at codesourcery dot com>
   21.16 -Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   21.17 -Date: Fri, 23 Apr 2004 22:27:19 +0200
   21.18 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   21.19 -
   21.20 -Nathan Sidwell <nathan@codesourcery.com> writes:
   21.21 -
   21.22 -> Index: read.c
   21.23 -> ===================================================================
   21.24 -> RCS file: /cvs/src/src/gas/read.c,v
   21.25 -> retrieving revision 1.76
   21.26 -> diff -c -3 -p -r1.76 read.c
   21.27 -> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   21.28 -> --- read.c	18 Mar 2004 09:56:05 -0000
   21.29 -> *************** read_a_source_file (char *name)
   21.30 -> *** 1053,1059 ****
   21.31 ->   #endif
   21.32 ->   	  input_line_pointer--;
   21.33 ->   	  /* Report unknown char as ignored.  */
   21.34 -> ! 	  ignore_rest_of_line ();
   21.35 ->   	}
   21.36 ->   
   21.37 ->   #ifdef md_after_pass_hook
   21.38 -> --- 1053,1059 ----
   21.39 ->   #endif
   21.40 ->   	  input_line_pointer--;
   21.41 ->   	  /* Report unknown char as ignored.  */
   21.42 -> ! 	  demand_empty_rest_of_line ();
   21.43 ->   	}
   21.44 ->   
   21.45 ->   #ifdef md_after_pass_hook
   21.46 -
   21.47 -This means that the unknown character is no longer ignored, despite the
   21.48 -comment.  As a side effect a line starting with a line comment character
   21.49 -not followed by APP in NO_APP mode now triggers an error instead of just a
   21.50 -warning, breaking builds of glibc on m68k-linux.  Earlier in
   21.51 -read_a_source_file where #APP is handled there is another comment that
   21.52 -claims that unknown comments are ignored, when in fact they aren't (only
   21.53 -the initial line comment character is skipped).
   21.54 -
   21.55 -Note that the presence of #APP will mess up the line counters, but
   21.56 -that appears to be difficult to fix.
   21.57 -
   21.58 -Andreas.
   21.59 -
   21.60 -2004-04-23  Andreas Schwab  <schwab@suse.de>
   21.61 -
   21.62 -	* read.c (read_a_source_file): Ignore unknown text after line
   21.63 -	comment character.  Fix misleading comment.
   21.64 -
   21.65 ---- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   21.66 -+++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   21.67 -@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   21.68 - 	      unsigned int new_length;
   21.69 - 	      char *tmp_buf = 0;
   21.70 - 
   21.71 --	      bump_line_counters ();
   21.72 - 	      s = input_line_pointer;
   21.73 - 	      if (strncmp (s, "APP\n", 4))
   21.74 --		continue;	/* We ignore it */
   21.75 -+		{
   21.76 -+		  /* We ignore it */
   21.77 -+		  ignore_rest_of_line ();
   21.78 -+		  continue;
   21.79 -+		}
   21.80 -+	      bump_line_counters ();
   21.81 - 	      s += 4;
   21.82 - 
   21.83 - 	      sb_new (&sbuf);
   21.84 -@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   21.85 - 	    continue;
   21.86 - #endif
   21.87 - 	  input_line_pointer--;
   21.88 --	  /* Report unknown char as ignored.  */
   21.89 -+	  /* Report unknown char as error.  */
   21.90 - 	  demand_empty_rest_of_line ();
   21.91 - 	}
   21.92 - 
   21.93 -
   21.94 --- 
   21.95 -Andreas Schwab, SuSE Labs, schwab@suse.de
   21.96 -SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   21.97 -Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   21.98 -"And now for something completely different."
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/patches/binutils/2.16.1/120-skip-comments.patch	Mon Jul 28 20:17:48 2008 +0000
    22.3 @@ -0,0 +1,95 @@
    22.4 +[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    22.5 +
    22.6 +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    22.7 +Fixes
    22.8 +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    22.9 +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   22.10 +
   22.11 +Paths adjusted to match crosstool's patcher.
   22.12 +
   22.13 +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   22.14 +From: Andreas Schwab <schwab at suse dot de>
   22.15 +To: Nathan Sidwell <nathan at codesourcery dot com>
   22.16 +Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   22.17 +Date: Fri, 23 Apr 2004 22:27:19 +0200
   22.18 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   22.19 +
   22.20 +Nathan Sidwell <nathan@codesourcery.com> writes:
   22.21 +
   22.22 +> Index: read.c
   22.23 +> ===================================================================
   22.24 +> RCS file: /cvs/src/src/gas/read.c,v
   22.25 +> retrieving revision 1.76
   22.26 +> diff -c -3 -p -r1.76 read.c
   22.27 +> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   22.28 +> --- read.c	18 Mar 2004 09:56:05 -0000
   22.29 +> *************** read_a_source_file (char *name)
   22.30 +> *** 1053,1059 ****
   22.31 +>   #endif
   22.32 +>   	  input_line_pointer--;
   22.33 +>   	  /* Report unknown char as ignored.  */
   22.34 +> ! 	  ignore_rest_of_line ();
   22.35 +>   	}
   22.36 +>   
   22.37 +>   #ifdef md_after_pass_hook
   22.38 +> --- 1053,1059 ----
   22.39 +>   #endif
   22.40 +>   	  input_line_pointer--;
   22.41 +>   	  /* Report unknown char as ignored.  */
   22.42 +> ! 	  demand_empty_rest_of_line ();
   22.43 +>   	}
   22.44 +>   
   22.45 +>   #ifdef md_after_pass_hook
   22.46 +
   22.47 +This means that the unknown character is no longer ignored, despite the
   22.48 +comment.  As a side effect a line starting with a line comment character
   22.49 +not followed by APP in NO_APP mode now triggers an error instead of just a
   22.50 +warning, breaking builds of glibc on m68k-linux.  Earlier in
   22.51 +read_a_source_file where #APP is handled there is another comment that
   22.52 +claims that unknown comments are ignored, when in fact they aren't (only
   22.53 +the initial line comment character is skipped).
   22.54 +
   22.55 +Note that the presence of #APP will mess up the line counters, but
   22.56 +that appears to be difficult to fix.
   22.57 +
   22.58 +Andreas.
   22.59 +
   22.60 +2004-04-23  Andreas Schwab  <schwab@suse.de>
   22.61 +
   22.62 +	* read.c (read_a_source_file): Ignore unknown text after line
   22.63 +	comment character.  Fix misleading comment.
   22.64 +
   22.65 +--- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   22.66 ++++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   22.67 +@@ -950,10 +950,14 @@ read_a_source_file (char *name)
   22.68 + 	      unsigned int new_length;
   22.69 + 	      char *tmp_buf = 0;
   22.70 + 
   22.71 +-	      bump_line_counters ();
   22.72 + 	      s = input_line_pointer;
   22.73 + 	      if (strncmp (s, "APP\n", 4))
   22.74 +-		continue;	/* We ignore it */
   22.75 ++		{
   22.76 ++		  /* We ignore it */
   22.77 ++		  ignore_rest_of_line ();
   22.78 ++		  continue;
   22.79 ++		}
   22.80 ++	      bump_line_counters ();
   22.81 + 	      s += 4;
   22.82 + 
   22.83 + 	      sb_new (&sbuf);
   22.84 +@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
   22.85 + 	    continue;
   22.86 + #endif
   22.87 + 	  input_line_pointer--;
   22.88 +-	  /* Report unknown char as ignored.  */
   22.89 ++	  /* Report unknown char as error.  */
   22.90 + 	  demand_empty_rest_of_line ();
   22.91 + 	}
   22.92 + 
   22.93 +
   22.94 +-- 
   22.95 +Andreas Schwab, SuSE Labs, schwab@suse.de
   22.96 +SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   22.97 +Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   22.98 +"And now for something completely different."
    23.1 --- a/patches/binutils/2.17/300-001_ld_makefile_patch.patch	Mon Jul 28 20:10:34 2008 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,24 +0,0 @@
    23.4 -diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
    23.5 ---- binutils-2.17.old/ld/Makefile.am	2006-06-03 06:45:50.000000000 +0200
    23.6 -+++ binutils-2.17/ld/Makefile.am	2007-05-01 18:26:09.000000000 +0200
    23.7 -@@ -20,7 +20,7 @@
    23.8 - # We put the scripts in the directory $(scriptdir)/ldscripts.
    23.9 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   23.10 - # directives need to be different for native and cross linkers.
   23.11 --scriptdir = $(tooldir)/lib
   23.12 -+scriptdir = $(libdir)
   23.13 - 
   23.14 - EMUL = @EMUL@
   23.15 - EMULATION_OFILES = @EMULATION_OFILES@
   23.16 -diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
   23.17 ---- binutils-2.17.old/ld/Makefile.in	2006-06-03 06:45:50.000000000 +0200
   23.18 -+++ binutils-2.17/ld/Makefile.in	2007-05-01 18:26:09.000000000 +0200
   23.19 -@@ -269,7 +269,7 @@
   23.20 - # We put the scripts in the directory $(scriptdir)/ldscripts.
   23.21 - # We can't put the scripts in $(datadir) because the SEARCH_DIR
   23.22 - # directives need to be different for native and cross linkers.
   23.23 --scriptdir = $(tooldir)/lib
   23.24 -+scriptdir = $(libdir)
   23.25 - BASEDIR = $(srcdir)/..
   23.26 - BFDDIR = $(BASEDIR)/bfd
   23.27 - INCDIR = $(BASEDIR)/include
    24.1 --- a/patches/binutils/2.17/300-006_better_file_error.patch	Mon Jul 28 20:10:34 2008 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,17 +0,0 @@
    24.4 -diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
    24.5 ---- binutils-2.17.old/bfd/opncls.c	2006-03-16 13:20:16.000000000 +0100
    24.6 -+++ binutils-2.17/bfd/opncls.c	2007-05-01 18:26:11.000000000 +0200
    24.7 -@@ -158,6 +158,13 @@
    24.8 - {
    24.9 -   bfd *nbfd;
   24.10 -   const bfd_target *target_vec;
   24.11 -+  struct stat s;
   24.12 -+
   24.13 -+  if (stat (filename, &s) == 0)
   24.14 -+    if (S_ISDIR(s.st_mode)) {
   24.15 -+      bfd_set_error (bfd_error_file_not_recognized);
   24.16 -+      return NULL;
   24.17 -+    }
   24.18 - 
   24.19 -   nbfd = _bfd_new_bfd ();
   24.20 -   if (nbfd == NULL)
    25.1 --- a/patches/binutils/2.17/300-012_check_ldrunpath_length.patch	Mon Jul 28 20:10:34 2008 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,21 +0,0 @@
    25.4 -diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
    25.5 ---- binutils-2.17.old/ld/emultempl/elf32.em	2006-06-12 15:05:04.000000000 +0200
    25.6 -+++ binutils-2.17/ld/emultempl/elf32.em	2007-05-01 18:26:13.000000000 +0200
    25.7 -@@ -970,6 +970,8 @@
    25.8 - 	      && command_line.rpath == NULL)
    25.9 - 	    {
   25.10 - 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   25.11 -+	      if ((lib_path) && (strlen (lib_path) == 0))
   25.12 -+		  lib_path = NULL;
   25.13 - 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   25.14 - 						      force))
   25.15 - 		break;
   25.16 -@@ -1154,6 +1156,8 @@
   25.17 -   rpath = command_line.rpath;
   25.18 -   if (rpath == NULL)
   25.19 -     rpath = (const char *) getenv ("LD_RUN_PATH");
   25.20 -+  if ((rpath) && (strlen (rpath) == 0))
   25.21 -+      rpath = NULL;
   25.22 -   if (! (bfd_elf_size_dynamic_sections
   25.23 - 	 (output_bfd, command_line.soname, rpath,
   25.24 - 	  command_line.filter_shlib,
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/patches/binutils/2.17/300-ld_makefile_patch.patch	Mon Jul 28 20:17:48 2008 +0000
    26.3 @@ -0,0 +1,24 @@
    26.4 +diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
    26.5 +--- binutils-2.17.old/ld/Makefile.am	2006-06-03 06:45:50.000000000 +0200
    26.6 ++++ binutils-2.17/ld/Makefile.am	2007-05-01 18:26:09.000000000 +0200
    26.7 +@@ -20,7 +20,7 @@
    26.8 + # We put the scripts in the directory $(scriptdir)/ldscripts.
    26.9 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   26.10 + # directives need to be different for native and cross linkers.
   26.11 +-scriptdir = $(tooldir)/lib
   26.12 ++scriptdir = $(libdir)
   26.13 + 
   26.14 + EMUL = @EMUL@
   26.15 + EMULATION_OFILES = @EMULATION_OFILES@
   26.16 +diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
   26.17 +--- binutils-2.17.old/ld/Makefile.in	2006-06-03 06:45:50.000000000 +0200
   26.18 ++++ binutils-2.17/ld/Makefile.in	2007-05-01 18:26:09.000000000 +0200
   26.19 +@@ -269,7 +269,7 @@
   26.20 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   26.21 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   26.22 + # directives need to be different for native and cross linkers.
   26.23 +-scriptdir = $(tooldir)/lib
   26.24 ++scriptdir = $(libdir)
   26.25 + BASEDIR = $(srcdir)/..
   26.26 + BFDDIR = $(BASEDIR)/bfd
   26.27 + INCDIR = $(BASEDIR)/include
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/patches/binutils/2.17/301-better_file_error.patch	Mon Jul 28 20:17:48 2008 +0000
    27.3 @@ -0,0 +1,17 @@
    27.4 +diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
    27.5 +--- binutils-2.17.old/bfd/opncls.c	2006-03-16 13:20:16.000000000 +0100
    27.6 ++++ binutils-2.17/bfd/opncls.c	2007-05-01 18:26:11.000000000 +0200
    27.7 +@@ -158,6 +158,13 @@
    27.8 + {
    27.9 +   bfd *nbfd;
   27.10 +   const bfd_target *target_vec;
   27.11 ++  struct stat s;
   27.12 ++
   27.13 ++  if (stat (filename, &s) == 0)
   27.14 ++    if (S_ISDIR(s.st_mode)) {
   27.15 ++      bfd_set_error (bfd_error_file_not_recognized);
   27.16 ++      return NULL;
   27.17 ++    }
   27.18 + 
   27.19 +   nbfd = _bfd_new_bfd ();
   27.20 +   if (nbfd == NULL)
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/patches/binutils/2.17/302-check_ldrunpath_length.patch	Mon Jul 28 20:17:48 2008 +0000
    28.3 @@ -0,0 +1,21 @@
    28.4 +diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
    28.5 +--- binutils-2.17.old/ld/emultempl/elf32.em	2006-06-12 15:05:04.000000000 +0200
    28.6 ++++ binutils-2.17/ld/emultempl/elf32.em	2007-05-01 18:26:13.000000000 +0200
    28.7 +@@ -970,6 +970,8 @@
    28.8 + 	      && command_line.rpath == NULL)
    28.9 + 	    {
   28.10 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
   28.11 ++	      if ((lib_path) && (strlen (lib_path) == 0))
   28.12 ++		  lib_path = NULL;
   28.13 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
   28.14 + 						      force))
   28.15 + 		break;
   28.16 +@@ -1154,6 +1156,8 @@
   28.17 +   rpath = command_line.rpath;
   28.18 +   if (rpath == NULL)
   28.19 +     rpath = (const char *) getenv ("LD_RUN_PATH");
   28.20 ++  if ((rpath) && (strlen (rpath) == 0))
   28.21 ++      rpath = NULL;
   28.22 +   if (! (bfd_elf_size_dynamic_sections
   28.23 + 	 (output_bfd, command_line.soname, rpath,
   28.24 + 	  command_line.filter_shlib,
    29.1 --- a/patches/binutils/2.17/501-binutils-2.15-psignal.patch	Mon Jul 28 20:10:34 2008 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,29 +0,0 @@
    29.4 -Make psignal prototype in libiberty match that in glibc.
    29.5 -
    29.6 -Fixes:
    29.7 -
    29.8 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    29.9 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   29.10 -/usr/include/signal.h:131: prototype declaration
   29.11 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   29.12 -/usr/include/signal.h:131: prototype declaration
   29.13 -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   29.14 -mprotect... make[1]: *** [strsignal.o] Error 1
   29.15 -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'
   29.16 -make: *** [all-libiberty] Error 2
   29.17 -
   29.18 -when building on red hat 7.1
   29.19 -though it's a bit of a mystery why libiberty's psignal is being compiled at
   29.20 -all, since red hat 7.1's glibc supports psignal (hence the error message)
   29.21 -
   29.22 ---- binutils-2.17/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   29.23 -+++ binutils-2.17/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   29.24 -@@ -536,7 +536,7 @@
   29.25 - 
   29.26 - /*
   29.27 - 
   29.28 --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   29.29 -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   29.30 - 
   29.31 - Print @var{message} to the standard error, followed by a colon,
   29.32 - followed by the description of the signal specified by @var{signo},
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/patches/binutils/2.17/501-psignal.patch	Mon Jul 28 20:17:48 2008 +0000
    30.3 @@ -0,0 +1,29 @@
    30.4 +Make psignal prototype in libiberty match that in glibc.
    30.5 +
    30.6 +Fixes:
    30.7 +
    30.8 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
    30.9 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
   30.10 +/usr/include/signal.h:131: prototype declaration
   30.11 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
   30.12 +/usr/include/signal.h:131: prototype declaration
   30.13 +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
   30.14 +mprotect... make[1]: *** [strsignal.o] Error 1
   30.15 +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'
   30.16 +make: *** [all-libiberty] Error 2
   30.17 +
   30.18 +when building on red hat 7.1
   30.19 +though it's a bit of a mystery why libiberty's psignal is being compiled at
   30.20 +all, since red hat 7.1's glibc supports psignal (hence the error message)
   30.21 +
   30.22 +--- binutils-2.17/libiberty/strsignal.c.old	2005-04-18 13:57:40.000000000 -0700
   30.23 ++++ binutils-2.17/libiberty/strsignal.c	2005-04-18 13:59:09.000000000 -0700
   30.24 +@@ -536,7 +536,7 @@
   30.25 + 
   30.26 + /*
   30.27 + 
   30.28 +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
   30.29 ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
   30.30 + 
   30.31 + Print @var{message} to the standard error, followed by a colon,
   30.32 + followed by the description of the signal specified by @var{signo},
    31.1 --- a/patches/binutils/2.17/502-binutils-skip-comments.patch	Mon Jul 28 20:10:34 2008 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,95 +0,0 @@
    31.4 -[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    31.5 -
    31.6 -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    31.7 -Fixes
    31.8 -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    31.9 -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   31.10 -
   31.11 -Paths adjusted to match crosstool's patcher.
   31.12 -
   31.13 -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   31.14 -From: Andreas Schwab <schwab at suse dot de>
   31.15 -To: Nathan Sidwell <nathan at codesourcery dot com>
   31.16 -Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   31.17 -Date: Fri, 23 Apr 2004 22:27:19 +0200
   31.18 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   31.19 -
   31.20 -Nathan Sidwell <nathan@codesourcery.com> writes:
   31.21 -
   31.22 -> Index: read.c
   31.23 -> ===================================================================
   31.24 -> RCS file: /cvs/src/src/gas/read.c,v
   31.25 -> retrieving revision 1.76
   31.26 -> diff -c -3 -p -r1.76 read.c
   31.27 -> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   31.28 -> --- read.c	18 Mar 2004 09:56:05 -0000
   31.29 -> *************** read_a_source_file (char *name)
   31.30 -> *** 1053,1059 ****
   31.31 ->   #endif
   31.32 ->   	  input_line_pointer--;
   31.33 ->   	  /* Report unknown char as ignored.  */
   31.34 -> ! 	  ignore_rest_of_line ();
   31.35 ->   	}
   31.36 ->   
   31.37 ->   #ifdef md_after_pass_hook
   31.38 -> --- 1053,1059 ----
   31.39 ->   #endif
   31.40 ->   	  input_line_pointer--;
   31.41 ->   	  /* Report unknown char as ignored.  */
   31.42 -> ! 	  demand_empty_rest_of_line ();
   31.43 ->   	}
   31.44 ->   
   31.45 ->   #ifdef md_after_pass_hook
   31.46 -
   31.47 -This means that the unknown character is no longer ignored, despite the
   31.48 -comment.  As a side effect a line starting with a line comment character
   31.49 -not followed by APP in NO_APP mode now triggers an error instead of just a
   31.50 -warning, breaking builds of glibc on m68k-linux.  Earlier in
   31.51 -read_a_source_file where #APP is handled there is another comment that
   31.52 -claims that unknown comments are ignored, when in fact they aren't (only
   31.53 -the initial line comment character is skipped).
   31.54 -
   31.55 -Note that the presence of #APP will mess up the line counters, but
   31.56 -that appears to be difficult to fix.
   31.57 -
   31.58 -Andreas.
   31.59 -
   31.60 -2004-04-23  Andreas Schwab  <schwab@suse.de>
   31.61 -
   31.62 -	* read.c (read_a_source_file): Ignore unknown text after line
   31.63 -	comment character.  Fix misleading comment.
   31.64 -
   31.65 ---- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   31.66 -+++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   31.67 -@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
   31.68 - 	      unsigned int new_length;
   31.69 - 	      char *tmp_buf = 0;
   31.70 - 
   31.71 --	      bump_line_counters ();
   31.72 - 	      s = input_line_pointer;
   31.73 - 	      if (strncmp (s, "APP\n", 4))
   31.74 --		continue;	/* We ignore it */
   31.75 -+		{
   31.76 -+		  /* We ignore it */
   31.77 -+		  ignore_rest_of_line ();
   31.78 -+		  continue;
   31.79 -+		}
   31.80 -+	      bump_line_counters ();
   31.81 - 	      s += 4;
   31.82 - 
   31.83 - 	      sb_new (&sbuf);
   31.84 -@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
   31.85 - 	    continue;
   31.86 - #endif
   31.87 - 	  input_line_pointer--;
   31.88 --	  /* Report unknown char as ignored.  */
   31.89 -+	  /* Report unknown char as error.  */
   31.90 - 	  demand_empty_rest_of_line ();
   31.91 - 	}
   31.92 - 
   31.93 -
   31.94 --- 
   31.95 -Andreas Schwab, SuSE Labs, schwab@suse.de
   31.96 -SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   31.97 -Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   31.98 -"And now for something completely different."
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/patches/binutils/2.17/502-skip-comments.patch	Mon Jul 28 20:17:48 2008 +0000
    32.3 @@ -0,0 +1,95 @@
    32.4 +[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
    32.5 +
    32.6 +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
    32.7 +Fixes
    32.8 +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' 
    32.9 +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
   32.10 +
   32.11 +Paths adjusted to match crosstool's patcher.
   32.12 +
   32.13 +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
   32.14 +From: Andreas Schwab <schwab at suse dot de>
   32.15 +To: Nathan Sidwell <nathan at codesourcery dot com>
   32.16 +Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
   32.17 +Date: Fri, 23 Apr 2004 22:27:19 +0200
   32.18 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
   32.19 +
   32.20 +Nathan Sidwell <nathan@codesourcery.com> writes:
   32.21 +
   32.22 +> Index: read.c
   32.23 +> ===================================================================
   32.24 +> RCS file: /cvs/src/src/gas/read.c,v
   32.25 +> retrieving revision 1.76
   32.26 +> diff -c -3 -p -r1.76 read.c
   32.27 +> *** read.c	12 Mar 2004 17:48:12 -0000	1.76
   32.28 +> --- read.c	18 Mar 2004 09:56:05 -0000
   32.29 +> *************** read_a_source_file (char *name)
   32.30 +> *** 1053,1059 ****
   32.31 +>   #endif
   32.32 +>   	  input_line_pointer--;
   32.33 +>   	  /* Report unknown char as ignored.  */
   32.34 +> ! 	  ignore_rest_of_line ();
   32.35 +>   	}
   32.36 +>   
   32.37 +>   #ifdef md_after_pass_hook
   32.38 +> --- 1053,1059 ----
   32.39 +>   #endif
   32.40 +>   	  input_line_pointer--;
   32.41 +>   	  /* Report unknown char as ignored.  */
   32.42 +> ! 	  demand_empty_rest_of_line ();
   32.43 +>   	}
   32.44 +>   
   32.45 +>   #ifdef md_after_pass_hook
   32.46 +
   32.47 +This means that the unknown character is no longer ignored, despite the
   32.48 +comment.  As a side effect a line starting with a line comment character
   32.49 +not followed by APP in NO_APP mode now triggers an error instead of just a
   32.50 +warning, breaking builds of glibc on m68k-linux.  Earlier in
   32.51 +read_a_source_file where #APP is handled there is another comment that
   32.52 +claims that unknown comments are ignored, when in fact they aren't (only
   32.53 +the initial line comment character is skipped).
   32.54 +
   32.55 +Note that the presence of #APP will mess up the line counters, but
   32.56 +that appears to be difficult to fix.
   32.57 +
   32.58 +Andreas.
   32.59 +
   32.60 +2004-04-23  Andreas Schwab  <schwab@suse.de>
   32.61 +
   32.62 +	* read.c (read_a_source_file): Ignore unknown text after line
   32.63 +	comment character.  Fix misleading comment.
   32.64 +
   32.65 +--- binutils/gas/read.c.~1.78.~	2004-04-23 08:58:23.000000000 +0200
   32.66 ++++ binutils/gas/read.c	2004-04-23 21:49:01.000000000 +0200
   32.67 +@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
   32.68 + 	      unsigned int new_length;
   32.69 + 	      char *tmp_buf = 0;
   32.70 + 
   32.71 +-	      bump_line_counters ();
   32.72 + 	      s = input_line_pointer;
   32.73 + 	      if (strncmp (s, "APP\n", 4))
   32.74 +-		continue;	/* We ignore it */
   32.75 ++		{
   32.76 ++		  /* We ignore it */
   32.77 ++		  ignore_rest_of_line ();
   32.78 ++		  continue;
   32.79 ++		}
   32.80 ++	      bump_line_counters ();
   32.81 + 	      s += 4;
   32.82 + 
   32.83 + 	      sb_new (&sbuf);
   32.84 +@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
   32.85 + 	    continue;
   32.86 + #endif
   32.87 + 	  input_line_pointer--;
   32.88 +-	  /* Report unknown char as ignored.  */
   32.89 ++	  /* Report unknown char as error.  */
   32.90 + 	  demand_empty_rest_of_line ();
   32.91 + 	}
   32.92 + 
   32.93 +
   32.94 +-- 
   32.95 +Andreas Schwab, SuSE Labs, schwab@suse.de
   32.96 +SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
   32.97 +Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
   32.98 +"And now for something completely different."