summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2002-12-30 00:18:57 +0000
committerMartin Schlemmer <azarah@gentoo.org>2002-12-30 00:18:57 +0000
commit42abdf042456c65e7280eae0facdd3e83efb76e4 (patch)
tree7e5fd457977c55834dce605038c4af6fd78dee6e /sys-devel
parentnew version (diff)
downloadgentoo-2-42abdf042456c65e7280eae0facdd3e83efb76e4.tar.gz
gentoo-2-42abdf042456c65e7280eae0facdd3e83efb76e4.tar.bz2
gentoo-2-42abdf042456c65e7280eae0facdd3e83efb76e4.zip
update with patches
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/binutils/ChangeLog7
-rw-r--r--sys-devel/binutils/binutils-2.13.90.0.16-r1.ebuild157
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-glibc21.patch65
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch11
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-gotpcrel.patch15
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-testsuite.patch18
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch475
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch113
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch15
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch34
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch180
-rw-r--r--sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch144
-rw-r--r--sys-devel/binutils/files/digest-binutils-2.13.90.0.16-r11
13 files changed, 1234 insertions, 1 deletions
diff --git a/sys-devel/binutils/ChangeLog b/sys-devel/binutils/ChangeLog
index b7c4ef3303ce..7a46f237487c 100644
--- a/sys-devel/binutils/ChangeLog
+++ b/sys-devel/binutils/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-devel/binutils
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/ChangeLog,v 1.19 2002/12/13 18:34:58 gerk Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/ChangeLog,v 1.20 2002/12/30 00:18:57 azarah Exp $
+
+*binutils-2.13.90.0.16-r1 (30 Dec 2002)
+
+ 30 Dec 2002; Martin Schlemmer <azarah@gentoo.org> binutils-2.13.90.0.16-r1.ebuild :
+ Update with patches from Redhat/Mandrake for various issues.
13 Dec 2002; Mark Guertin <gerk@gentoo.org> binutils-2.13.90.0.16.ebuild :
Marked stable for ppc.
diff --git a/sys-devel/binutils/binutils-2.13.90.0.16-r1.ebuild b/sys-devel/binutils/binutils-2.13.90.0.16-r1.ebuild
new file mode 100644
index 000000000000..cf55460e30b8
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.13.90.0.16-r1.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.13.90.0.16-r1.ebuild,v 1.1 2002/12/30 00:18:57 azarah Exp $
+
+IUSE="nls bootstrap static build"
+
+# NOTE to Maintainer: ChangeLog states that it no longer use perl to build
+# the manpages, but seems this is incorrect ....
+
+inherit eutils libtool flag-o-matic
+
+# Generate borked binaries. Bug #6730
+filter-flags "-fomit-frame-pointer"
+
+S="${WORKDIR}/${P}"
+DESCRIPTION="Tools necessary to build programs"
+SRC_URI="ftp://ftp.kernel.org/pub/linux/devel/binutils/${P}.tar.bz2
+ ftp://ftp.kernel.org/pub/linux/devel/binutils/test/${P}.tar.bz2"
+HOMEPAGE="http://sources.redhat.com/binutils/"
+
+SLOT="0"
+LICENSE="GPL-2|LGPL-2"
+KEYWORDS="~x86 ~ppc ~alpha ~sparc"
+
+DEPEND="virtual/glibc
+ >=sys-apps/portage-2.0.21
+ nls? ( sys-devel/gettext )
+ || ( sys-devel/perl
+ ( !build? ( sys-devel/perl ) )
+ ( !bootstrap? ( sys-devel/perl ) )
+ )"
+# This is a hairy one. Basically depend on sys-devel/perl
+# if "build" or "bootstrap" not in USE.
+
+src_unpack() {
+
+ unpack ${A}
+
+ cd ${S}
+ # Various patches from Redhat/Mandrake...
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-glibc21.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-ia64-brl.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-x86_64-testsuite.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.10-x86_64-gotpcrel.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-rodata-cst.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-eh-frame-ro.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-ppc-apuinfo.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-stt_tls.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-ia64-bootstrap.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.16-tls-strip.patch
+}
+
+src_compile() {
+
+ local myconf=""
+ use nls && \
+ myconf="${myconf} --without-included-gettext" || \
+ myconf="${myconf} --disable-nls"
+
+ # Fix /usr/lib/libbfd.la
+ elibtoolize --portage
+
+ ./configure --enable-shared \
+ --enable-64-bit-bfd \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --host=${CHOST} \
+ ${myconf} || die
+
+ if [ "`use static`" ]
+ then
+ make headers -C bfd CFLAGS=-O || die
+ emake -e LDFLAGS=-all-static || die
+ else
+ make headers -C bfd CFLAGS=-O || die
+ emake || die
+ fi
+
+ if [ -z "`use build`" ]
+ then
+ if [ -z "`use bootstrap`" ]
+ then
+ #nuke the manpages to recreate them (only use this if we have perl)
+ find . -name '*.1' -exec rm -f {} \; || :
+ fi
+ #make the info pages (makeinfo included with gcc is used)
+ make info || die
+ fi
+}
+
+src_install() {
+
+ make prefix=${D}/usr \
+ mandir=${D}/usr/share/man \
+ infodir=${D}/usr/share/info \
+ install || die
+
+ insinto /usr/include
+ doins include/libiberty.h
+
+ #c++filt is included with gcc -- what are these GNU people thinking?
+ #but not the manpage, so leave that!
+ rm -f ${D}/usr/bin/c++filt #${D}/usr/share/man/man1/c++filt*
+
+ # By default strip has a symlink going from /usr/${CHOST}/bin/strip to
+ # /usr/bin/strip we should reverse it:
+
+ rm ${D}/usr/${CHOST}/bin/strip; mv ${D}/usr/bin/strip ${D}/usr/${CHOST}/bin/strip
+ # The strip symlink gets created in the loop below
+
+ # By default ar, as, ld, nm, ranlib and strip are in two places; create
+ # symlinks. This will reduce the size of the tbz2 significantly. We also
+ # move all the stuff in /usr/bin to /usr/${CHOST}/bin and create the
+ # appropriate symlinks. Things are cleaner that way.
+ cd ${D}/usr/bin
+ local x=""
+ for x in * strip
+ do
+ if [ ! -e ../${CHOST}/bin/${x} ]
+ then
+ mv ${x} ../${CHOST}/bin/${x}
+ else
+ rm -f ${x}
+ fi
+ ln -s ../${CHOST}/bin/${x} ${x}
+ done
+
+ cd ${S}
+ if [ -z "`use build`" ]
+ then
+ make prefix=${D}/usr \
+ mandir=${D}/usr/share/man \
+ infodir=${D}/usr/share/info \
+ install-info || die
+
+ dodoc COPYING* README
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/COPYING bfd/README bfd/PORTING bfd/TODO
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/COPYING gas/NEWS gas/README*
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/COPYING.LIB libiberty/README
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ # Install pre-generated manpages .. currently we do not ...
+ else
+ rm -rf ${D}/usr/share/man
+ fi
+}
+
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-glibc21.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-glibc21.patch
new file mode 100644
index 000000000000..b3ffa8e789bd
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-glibc21.patch
@@ -0,0 +1,65 @@
+--- binutils-2.13.90.0.10/ld/emulparams/elf_i386_glibc21.sh.glibc21 2002-11-15 15:12:42.000000000 +0100
++++ binutils-2.13.90.0.10/ld/emulparams/elf_i386_glibc21.sh 2002-11-15 15:12:42.000000000 +0100
+@@ -0,0 +1,11 @@
++SCRIPT_NAME=elf
++OUTPUT_FORMAT="elf32-i386"
++TEXT_START_ADDR=0x08048000
++MAXPAGESIZE=0x1000
++NONPAGED_TEXT_START_ADDR=0x08048000
++ARCH=i386
++MACHINE=
++NOP=0x9090
++TEMPLATE_NAME=elf32
++GENERATE_SHLIB_SCRIPT=yes
++LIB_PATH=/usr/i386-glibc21-linux/lib:/usr/local/lib
+--- binutils-2.13.90.0.10/ld/configure.tgt.glibc21 2002-10-10 06:09:41.000000000 +0200
++++ binutils-2.13.90.0.10/ld/configure.tgt 2002-11-15 15:14:38.000000000 +0100
+@@ -147,6 +147,8 @@ i[3456]86-*-linux-gnu*) targ_emul=elf_i3
+ if test x${want64} = xtrue; then
+ targ_extra_emuls="$targ_extra_emuls elf_x86_64"
+ fi
++ targ_extra_emuls="i386linux elf_i386_glibc21"
++ targ_extra_libpath=elf_i386_glibc21
+ tdir_i386linux=${targ_alias}aout
+ ;;
+ x86_64-*-linux-gnu*) targ_emul=elf_x86_64
+--- binutils-2.13.90.0.10/ld/Makefile.am.glibc21 2002-10-10 06:09:41.000000000 +0200
++++ binutils-2.13.90.0.10/ld/Makefile.am 2002-11-15 15:12:42.000000000 +0100
+@@ -185,6 +185,7 @@ ALL_EMULATIONS = \
+ eelf_i386_be.o \
+ eelf_i386_chaos.o \
+ eelf_i386_fbsd.o \
++ eelf_i386_glibc21.o \
+ eelf_i386_ldso.o \
+ eelf_s390.o \
+ egld960.o \
+@@ -734,6 +735,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf
+ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
++eelf_i386_glibc21.c: $(srcdir)/emulparams/elf_i386_glibc21.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_i386_glibc21 "$(tdir_elf_i386_glibc21)"
+ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+--- binutils-2.13.90.0.10/ld/Makefile.in.glibc21 2002-10-10 06:09:41.000000000 +0200
++++ binutils-2.13.90.0.10/ld/Makefile.in 2002-11-15 15:12:42.000000000 +0100
+@@ -295,6 +295,7 @@ ALL_EMULATIONS = \
+ eelf_i386.o \
+ eelf_i386_be.o \
+ eelf_i386_chaos.o \
++ eelf_i386_glibc21.o \
+ eelf_i386_fbsd.o \
+ eelf_i386_ldso.o \
+ eelf_s390.o \
+@@ -1457,6 +1458,9 @@ eelf_i386_be.c: $(srcdir)/emulparams/elf
+ eelf_i386_chaos.c: $(srcdir)/emulparams/elf_i386_chaos.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf_chaos.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_chaos "$(tdir_elf_i386_chaos)"
++eelf_i386_glibc21.c: $(srcdir)/emulparams/elf_i386_glibc21.sh \
++ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} elf_i386_glibc21 "$(tdir_elf_i386_glibc21)"
+ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch
new file mode 100644
index 000000000000..579e6f8e25a8
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-ia64-brl.patch
@@ -0,0 +1,11 @@
+--- binutils-2.13.90.0.10/bfd/elfxx-ia64.c.ia64-brl 2002-09-27 17:33:09.000000000 +0200
++++ binutils-2.13.90.0.10/bfd/elfxx-ia64.c 2002-11-15 15:17:17.000000000 +0100
+@@ -645,7 +645,7 @@ static const bfd_byte plt_full_entry[PLT
+
+ /* Select out of range branch fixup type. Note that Itanium does
+ not support brl, and so it gets emulated by the kernel. */
+-#undef USE_BRL
++#define USE_BRL
+
+ static const bfd_byte oor_brl[16] =
+ {
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-gotpcrel.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-gotpcrel.patch
new file mode 100644
index 000000000000..263e7920966e
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-gotpcrel.patch
@@ -0,0 +1,15 @@
+--- binutils-2.13.90.0.10/gas/config/tc-i386.c.x86_64-gotpcrel 2002-11-15 15:16:42.000000000 +0100
++++ binutils-2.13.90.0.10/gas/config/tc-i386.c 2002-11-15 15:22:40.000000000 +0100
+@@ -1220,6 +1220,12 @@ tc_i386_fix_adjustable (fixP)
+ && fixP->fx_pcrel)
+ return 0;
+
++ /* The x86_64 GOTPCREL are represented as 32bit PCrel relocations
++ and changed later by validate_fix. */
++ if (GOT_symbol && fixP->fx_subsy == GOT_symbol
++ && fixP->fx_r_type == BFD_RELOC_32_PCREL)
++ return 0;
++
+ /* adjust_reloc_syms doesn't know about the GOT. */
+ if (fixP->fx_r_type == BFD_RELOC_386_GOTOFF
+ || fixP->fx_r_type == BFD_RELOC_386_PLT32
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-testsuite.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-testsuite.patch
new file mode 100644
index 000000000000..2fc380f60358
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.10-x86_64-testsuite.patch
@@ -0,0 +1,18 @@
+--- binutils-2.13.90.0.10/ld/testsuite/ld-selective/selective.exp.x86_64-testsuite 2002-08-14 19:35:11.000000000 +0200
++++ binutils-2.13.90.0.10/ld/testsuite/ld-selective/selective.exp 2002-11-15 15:22:22.000000000 +0100
+@@ -50,11 +50,11 @@ if {[istarget "alpha*-*-*"]} {
+ #
+ # FIXME: Instead of table, read settings from each source-file.
+ set seltests {
+- {selective1 C 1.c {} {} {dropme1 dropme2} {alpha*-*}}
+- {selective2 C 2.c {} {} {foo} {alpha*-* mips*-*}}
++ {selective1 C 1.c {} {} {dropme1 dropme2} {alpha*-* x86_64*-*}}
++ {selective2 C 2.c {} {} {foo} {alpha*-* mips*-* x86_64*-*}}
+ {selective3 C 2.c {-u foo} {foo} {{foo 0}} {mips*-*}}
+- {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {alpha*-* mips*-*}}
+- {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {alpha*-* mips*-*}}
++ {selective4 C++ 3.cc {} {start a A::foo() B::foo()} {A::bar()} {alpha*-* mips*-* x86_64*-*}}
++ {selective5 C++ 4.cc {} {start a A::bar()} {A::foo() B::foo()} {alpha*-* mips*-* x86_64*-*}}
+ {selective6 C++ 5.cc {} {start a A::bar()}
+ {A::foo() B::foo() dropme1() dropme2()} {*-*-*}}
+ }
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch
new file mode 100644
index 000000000000..51fa567e139c
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-eh-frame-ro.patch
@@ -0,0 +1,475 @@
+2002-11-22 Jakub Jelinek <jakub@redhat.com>
+
+ * ldgram.y (sect_constraint): New.
+ (ONLY_IF_RO, ONLY_IF_RW): New tokens.
+ (section): Add sect_constraint. Pass additional argument
+ to lang_enter_output_section_statement.
+ * mri.c (mri_draw_tree): Pass additional argument to
+ lang_enter_output_section_statement.
+ * emultempl/pe.em (place_orphan): Likewise.
+ (output_prev_sec_find): Disregard output section statements with
+ constraint == -1.
+ * emultempl/mmo.em (output_prev_sec_find): Likewise.
+ (mmo_place_orphan): Pass additional argument to
+ lang_enter_output_section_statement.
+ * emultempl/elf32.em (output_prev_sec_find): Disregard output section
+ statements with constraint == -1.
+ (place_orphan): Pass additional argument to
+ lang_enter_output_section_statement.
+ * ldlang.c (lang_enter_overlay_section): Likewise.
+ (lang_output_section_find_1): New.
+ (lang_output_section_find): Use it.
+ (lang_output_section_statement_lookup_1): New.
+ (lang_output_section_statement_lookup): Use it.
+ (check_section_callback, check_input_sections): New.
+ (map_input_to_output_sections): Check if all input sections
+ are readonly if ONLY_IF_RO or ONLY_IF_RW was seen.
+ (strip_excluded_output_sections): Disregard output section statements
+ with constraint == -1.
+ (lang_record_phdrs): Likewise.
+ (lang_enter_output_section_statement): Add constraint argument.
+ Use lang_output_section_statement_lookup_1.
+ * ldlang.h (lang_output_section_statement_type): Add constraint
+ and all_input_readonly fields.
+ (lang_enter_output_section_statement): Adjust prototype.
+ * ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens.
+ * scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text
+ segment if all input sections are readonly.
+
+--- ld/ldgram.y.jj 2002-10-14 13:30:34.000000000 +0200
++++ ld/ldgram.y 2002-11-22 22:27:18.000000000 +0100
+@@ -143,14 +143,14 @@ static int error_index;
+ %token ORIGIN FILL
+ %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
+ %token ALIGNMOD AT PROVIDE
+-%type <token> assign_op atype attributes_opt
++%type <token> assign_op atype attributes_opt sect_constraint
+ %type <name> filename
+ %token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
+ %token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
+ %token INPUT_SCRIPT INPUT_MRI_SCRIPT INPUT_DEFSYM CASE EXTERN START
+ %token <name> VERS_TAG VERS_IDENTIFIER
+ %token GLOBAL LOCAL VERSIONK INPUT_VERSION_SCRIPT
+-%token KEEP
++%token KEEP ONLY_IF_RO ONLY_IF_RW
+ %token EXCLUDE_FILE
+ %type <versyms> vers_defns
+ %type <versnode> vers_tag
+@@ -828,21 +828,28 @@ opt_at:
+ | { $$ = 0; }
+ ;
+
++sect_constraint:
++ ONLY_IF_RO { $$ = ONLY_IF_RO; }
++ | ONLY_IF_RW { $$ = ONLY_IF_RW; }
++ | { $$ = 0; }
++ ;
++
+ section: NAME { ldlex_expression(); }
+ opt_exp_with_type
+ opt_at { ldlex_popstate (); ldlex_script (); }
++ sect_constraint
+ '{'
+ {
+ lang_enter_output_section_statement($1, $3,
+ sectype,
+- 0, 0, 0, $4);
++ 0, 0, 0, $4, $6);
+ }
+ statement_list_opt
+ '}' { ldlex_popstate (); ldlex_expression (); }
+ memspec_opt memspec_at_opt phdr_opt fill_opt
+ {
+ ldlex_popstate ();
+- lang_leave_output_section_statement ($14, $11, $13, $12);
++ lang_leave_output_section_statement ($15, $12, $14, $13);
+ }
+ opt_comma
+ {}
+--- ld/mri.c.jj 2002-10-31 19:10:42.000000000 +0100
++++ ld/mri.c 2002-11-22 18:38:27.000000000 +0100
+@@ -237,7 +237,7 @@ mri_draw_tree ()
+ lang_enter_output_section_statement (p->name, base,
+ p->ok_to_load ? 0 : noload_section,
+ 1, align, subalign,
+- (etree_type *) NULL);
++ (etree_type *) NULL, 0);
+ base = 0;
+ tmp = (struct wildcard_list *) xmalloc (sizeof *tmp);
+ tmp->next = NULL;
+--- ld/emultempl/mmo.em.jj 2002-07-30 16:20:15.000000000 +0200
++++ ld/emultempl/mmo.em 2002-11-22 22:42:44.000000000 +0100
+@@ -56,6 +56,8 @@ output_prev_sec_find (os)
+ u = lookup->next)
+ {
+ lookup = &u->output_section_statement;
++ if (lookup->constraint == -1)
++ continue;
+ if (lookup == os)
+ break;
+ if (lookup->bfd_section != NULL
+@@ -141,7 +143,7 @@ mmo_place_orphan (file, s)
+ (bfd_vma) 0,
+ (etree_type *) NULL,
+ (etree_type *) NULL,
+- (etree_type *) NULL);
++ (etree_type *) NULL, 0);
+
+ lang_add_section (&os->children, s, os, file);
+
+--- ld/emultempl/pe.em.jj 2002-11-21 15:58:51.000000000 +0100
++++ ld/emultempl/pe.em 2002-11-22 22:43:02.000000000 +0100
+@@ -1489,6 +1489,8 @@ output_prev_sec_find (os)
+ u = lookup->next)
+ {
+ lookup = &u->output_section_statement;
++ if (lookup->constraint == -1)
++ continue;
+ if (lookup == os)
+ return s;
+
+@@ -1655,7 +1657,7 @@ gld_${EMULATION_NAME}_place_orphan (file
+ (bfd_vma) 0,
+ (etree_type *) NULL,
+ (etree_type *) NULL,
+- (etree_type *) NULL);
++ (etree_type *) NULL, 0);
+
+ lang_add_section (&add_child, s, os, file);
+
+--- ld/emultempl/elf32.em.jj 2002-10-31 19:10:44.000000000 +0100
++++ ld/emultempl/elf32.em 2002-11-22 22:42:16.000000000 +0100
+@@ -1009,7 +1009,8 @@ output_rel_find (sec)
+ for (u = lang_output_section_statement.head; u; u = lookup->next)
+ {
+ lookup = &u->output_section_statement;
+- if (strncmp (".rel", lookup->name, 4) == 0)
++ if (lookup->constraint != -1
++ && strncmp (".rel", lookup->name, 4) == 0)
+ {
+ /* Don't place after .rel.plt as doing so results in wrong
+ dynamic tags. Also, place allocated reloc sections before
+@@ -1236,7 +1237,7 @@ gld${EMULATION_NAME}_place_orphan (file,
+ (bfd_vma) 0,
+ (etree_type *) NULL,
+ (etree_type *) NULL,
+- (etree_type *) NULL);
++ (etree_type *) NULL, 0);
+
+ lang_add_section (&os->children, s, os, file);
+
+--- ld/scripttempl/elf.sc.jj 2002-09-25 11:21:42.000000000 +0200
++++ ld/scripttempl/elf.sc 2002-11-22 22:35:47.000000000 +0100
+@@ -280,6 +280,8 @@ cat <<EOF
+ ${CREATE_SHLIB-${SBSS2}}
+ ${OTHER_READONLY_SECTIONS}
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
++ .eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
++ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table) }
+
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+@@ -312,8 +314,8 @@ cat <<EOF
+ .data1 ${RELOCATING-0} : { *(.data1) }
+ .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
+ .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
+- .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
+- .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
++ .eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
++ .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table) }
+ ${WRITABLE_RODATA+${RODATA}}
+ ${OTHER_READWRITE_SECTIONS}
+ ${TEXT_DYNAMIC-${DYNAMIC}}
+--- ld/ldlang.h.jj 2002-10-10 00:53:07.000000000 +0200
++++ ld/ldlang.h 2002-11-22 22:27:37.000000000 +0100
+@@ -132,6 +132,8 @@ typedef struct lang_output_section_state
+
+ int subsection_alignment; /* alignment of components */
+ int section_alignment; /* alignment of start of section */
++ int constraint;
++ boolean all_input_readonly;
+
+ union etree_union *load_base;
+
+@@ -385,7 +387,7 @@ extern lang_output_section_statement_typ
+ bfd_vma block_value,
+ etree_type *align,
+ etree_type *subalign,
+- etree_type *));
++ etree_type *, int));
+ extern void lang_final PARAMS ((void));
+ extern void lang_process PARAMS ((void));
+ extern void lang_section_start PARAMS ((const char *, union etree_union *));
+--- ld/ldlang.c.jj 2002-11-14 14:06:22.000000000 +0100
++++ ld/ldlang.c 2002-11-22 22:41:51.000000000 +0100
+@@ -71,6 +71,10 @@ static void lang_for_each_statement_work
+ static lang_input_statement_type *new_afile
+ PARAMS ((const char *, lang_input_file_enum_type, const char *, boolean));
+ static lang_memory_region_type *lang_memory_default PARAMS ((asection *));
++static lang_output_section_statement_type * lang_output_section_find_1
++ PARAMS ((const char *, int));
++static lang_output_section_statement_type *
++ lang_output_section_statement_lookup_1 PARAMS ((const char *, int));
+ static void lang_map_flags PARAMS ((flagword));
+ static void init_os PARAMS ((lang_output_section_statement_type *));
+ static void exp_init_os PARAMS ((etree_type *));
+@@ -86,6 +90,9 @@ static lang_statement_union_type *wild_s
+ static void output_section_callback
+ PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
+ lang_input_statement_type *, PTR));
++static void check_section_callback
++ PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *,
++ lang_input_statement_type *, PTR));
+ static lang_input_statement_type *lookup_name PARAMS ((const char *));
+ static boolean load_symbols
+ PARAMS ((lang_input_statement_type *, lang_statement_list_type *));
+@@ -98,6 +105,9 @@ static void open_input_bfds PARAMS ((lan
+ static void lang_reasonable_defaults PARAMS ((void));
+ static void insert_undefined PARAMS ((const char *));
+ static void lang_place_undefineds PARAMS ((void));
++static void check_input_sections
++ PARAMS ((lang_statement_union_type *,
++ lang_output_section_statement_type *));
+ static void map_input_to_output_sections
+ PARAMS ((lang_statement_union_type *, const char *,
+ lang_output_section_statement_type *));
+@@ -700,9 +710,10 @@ lang_memory_default (section)
+ return lang_memory_region_lookup ("*default*");
+ }
+
+-lang_output_section_statement_type *
+-lang_output_section_find (name)
++static lang_output_section_statement_type *
++lang_output_section_find_1 (name, constraint)
+ const char *const name;
++ int constraint;
+ {
+ lang_statement_union_type *u;
+ lang_output_section_statement_type *lookup;
+@@ -712,7 +723,9 @@ lang_output_section_find (name)
+ u = lookup->next)
+ {
+ lookup = &u->output_section_statement;
+- if (strcmp (name, lookup->name) == 0)
++ if (strcmp (name, lookup->name) == 0
++ && lookup->constraint != -1
++ && (constraint == 0 || constraint == lookup->constraint))
+ {
+ return lookup;
+ }
+@@ -721,12 +734,20 @@ lang_output_section_find (name)
+ }
+
+ lang_output_section_statement_type *
+-lang_output_section_statement_lookup (name)
++lang_output_section_find (name)
++ const char *const name;
++{
++ return lang_output_section_find_1 (name, 0);
++}
++
++static lang_output_section_statement_type *
++lang_output_section_statement_lookup_1 (name, constraint)
+ const char *const name;
++ int constraint;
+ {
+ lang_output_section_statement_type *lookup;
+
+- lookup = lang_output_section_find (name);
++ lookup = lang_output_section_find_1 (name, constraint);
+ if (lookup == (lang_output_section_statement_type *) NULL)
+ {
+
+@@ -741,6 +762,7 @@ lang_output_section_statement_lookup (na
+ lookup->next = (lang_statement_union_type *) NULL;
+ lookup->bfd_section = (asection *) NULL;
+ lookup->processed = false;
++ lookup->constraint = constraint;
+ lookup->sectype = normal_section;
+ lookup->addr_tree = (etree_type *) NULL;
+ lang_list_init (&lookup->children);
+@@ -760,6 +782,13 @@ lang_output_section_statement_lookup (na
+ return lookup;
+ }
+
++lang_output_section_statement_type *
++lang_output_section_statement_lookup (name)
++ const char *const name;
++{
++ return lang_output_section_statement_lookup_1 (name, 0);
++}
++
+ static void
+ lang_map_flags (flag)
+ flagword flag;
+@@ -1434,6 +1463,31 @@ output_section_callback (ptr, sec, secti
+ }
+ }
+
++/* Check if all sections in a wild statement for a particular FILE
++ are readonly. */
++
++static void
++check_section_callback (ptr, sec, section, file, output)
++ lang_wild_statement_type *ptr ATTRIBUTE_UNUSED;
++ struct wildcard_list *sec ATTRIBUTE_UNUSED;
++ asection *section;
++ lang_input_statement_type *file ATTRIBUTE_UNUSED;
++ PTR output;
++{
++ /* Exclude sections that match UNIQUE_SECTION_LIST. */
++ if (unique_section_p (bfd_get_section_name (file->the_bfd, section)))
++ return;
++
++ if (section->output_section == NULL)
++ {
++ flagword flags = bfd_get_section_flags (section->owner, section);
++
++ if ((flags & SEC_READONLY) == 0)
++ ((lang_output_section_statement_type *) output)->all_input_readonly
++ = false;
++ }
++}
++
+ /* This is passed a file name which must have been seen already and
+ added to the statement tree. We will see if it has been opened
+ already and had its symbols read. If not then we'll read it. */
+@@ -2099,6 +2153,41 @@ lang_place_undefineds ()
+ }
+ }
+
++/* Check for all readonly or some readwrite sections. */
++
++static void
++check_input_sections (s, output_section_statement)
++ lang_statement_union_type *s;
++ lang_output_section_statement_type *output_section_statement;
++{
++ for (; s != (lang_statement_union_type *) NULL; s = s->header.next)
++ {
++ switch (s->header.type)
++ {
++ case lang_wild_statement_enum:
++ walk_wild (&s->wild_statement, check_section_callback,
++ output_section_statement);
++ if (! output_section_statement->all_input_readonly)
++ return;
++ break;
++ case lang_constructors_statement_enum:
++ check_input_sections (constructor_list.head,
++ output_section_statement);
++ if (! output_section_statement->all_input_readonly)
++ return;
++ break;
++ case lang_group_statement_enum:
++ check_input_sections (s->group_statement.children.head,
++ output_section_statement);
++ if (! output_section_statement->all_input_readonly)
++ return;
++ break;
++ default:
++ break;
++ }
++ }
++}
++
+ /* Open input files and attatch to output sections. */
+
+ static void
+@@ -2120,6 +2209,23 @@ map_input_to_output_sections (s, target,
+ output_section_statement);
+ break;
+ case lang_output_section_statement_enum:
++ if (s->output_section_statement.constraint)
++ {
++ if (s->output_section_statement.constraint == -1)
++ break;
++ s->output_section_statement.all_input_readonly = true;
++ check_input_sections (s->output_section_statement.children.head,
++ &s->output_section_statement);
++ if ((s->output_section_statement.all_input_readonly
++ && s->output_section_statement.constraint == ONLY_IF_RW)
++ || (!s->output_section_statement.all_input_readonly
++ && s->output_section_statement.constraint == ONLY_IF_RO))
++ {
++ s->output_section_statement.constraint = -1;
++ break;
++ }
++ }
++
+ map_input_to_output_sections (s->output_section_statement.children.head,
+ target,
+ &s->output_section_statement);
+@@ -2190,6 +2296,8 @@ strip_excluded_output_sections ()
+ asection *s;
+
+ os = &u->output_section_statement;
++ if (os->constraint == -1)
++ continue;
+ s = os->bfd_section;
+ if (s != NULL && (s->flags & SEC_EXCLUDE) != 0)
+ {
+@@ -4056,7 +4164,7 @@ topower (x)
+ lang_output_section_statement_type *
+ lang_enter_output_section_statement (output_section_statement_name,
+ address_exp, sectype, block_value,
+- align, subalign, ebase)
++ align, subalign, ebase, constraint)
+ const char *output_section_statement_name;
+ etree_type *address_exp;
+ enum section_type sectype;
+@@ -4064,12 +4172,14 @@ lang_enter_output_section_statement (out
+ etree_type *align;
+ etree_type *subalign;
+ etree_type *ebase;
++ int constraint;
+ {
+ lang_output_section_statement_type *os;
+
+ current_section =
+ os =
+- lang_output_section_statement_lookup (output_section_statement_name);
++ lang_output_section_statement_lookup_1 (output_section_statement_name,
++ constraint);
+
+ /* Add this statement to tree. */
+ #if 0
+@@ -4784,6 +4894,8 @@ lang_record_phdrs ()
+ struct lang_output_section_phdr_list *pl;
+
+ os = &u->output_section_statement;
++ if (os->constraint == -1)
++ continue;
+
+ pl = os->phdrs;
+ if (pl != NULL)
+@@ -4844,7 +4956,8 @@ lang_record_phdrs ()
+ {
+ struct lang_output_section_phdr_list *pl;
+
+- if (u->output_section_statement.bfd_section == NULL)
++ if (u->output_section_statement.constraint == -1
++ || u->output_section_statement.bfd_section == NULL)
+ continue;
+
+ for (pl = u->output_section_statement.phdrs;
+@@ -4914,7 +5027,7 @@ lang_enter_overlay_section (name)
+ etree_type *size;
+
+ lang_enter_output_section_statement (name, overlay_vma, normal_section,
+- 0, 0, 0, 0);
++ 0, 0, 0, 0, 0);
+
+ /* If this is the first section, then base the VMA of future
+ sections on this one. This will work correctly even if `.' is
+--- ld/ldlex.l.jj 2002-10-31 19:10:42.000000000 +0100
++++ ld/ldlex.l 2002-11-22 17:29:14.000000000 +0100
+@@ -303,6 +303,8 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^]([*?
+ <EXPRESSION,BOTH,SCRIPT>"COPY" { RTOKEN(COPY);}
+ <EXPRESSION,BOTH,SCRIPT>"INFO" { RTOKEN(INFO);}
+ <EXPRESSION,BOTH,SCRIPT>"OVERLAY" { RTOKEN(OVERLAY);}
++<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); }
++<EXPRESSION,BOTH,SCRIPT>"ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); }
+ <BOTH,SCRIPT>"o" { RTOKEN(ORIGIN);}
+ <BOTH,SCRIPT>"org" { RTOKEN(ORIGIN);}
+ <BOTH,SCRIPT>"l" { RTOKEN( LENGTH);}
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch
new file mode 100644
index 000000000000..6266ec60f04d
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ia64-bootstrap.patch
@@ -0,0 +1,113 @@
+2002-11-29 Jakub Jelinek <jakub@redhat.com>
+
+ * elfxx-ia64.c (elfNN_ia64_obj_tdata): New struct.
+ (elfNN_ia64_tdata): New macro.
+ (elfNN_ia64_mkobject, elfNN_ia64_object_p): New functions.
+ (get_local_sym_hash): Assign keys to input bfds instead of using
+ their pointer addresses for hashing purposes.
+ (bfd_elfNN_mkobject, elf_backend_object_p): Define.
+
+--- bfd/elfxx-ia64.c.jj 2002-11-28 15:49:52.000000000 +0100
++++ bfd/elfxx-ia64.c 2002-11-29 01:38:39.000000000 +0100
+@@ -152,6 +152,15 @@ struct elfNN_ia64_link_hash_table
+ struct elfNN_ia64_local_hash_table loc_hash_table;
+ };
+
++struct elfNN_ia64_obj_tdata
++{
++ struct elf_obj_tdata root;
++ unsigned long key;
++};
++
++#define elfNN_ia64_tdata(abfd) \
++ ((struct elfNN_ia64_obj_tdata *) (abfd)->tdata.any)
++
+ #define elfNN_ia64_hash_table(p) \
+ ((struct elfNN_ia64_link_hash_table *) ((p)->hash))
+
+@@ -317,6 +326,8 @@ static boolean elfNN_ia64_print_private_
+ PARAMS ((bfd *abfd, PTR ptr));
+ static enum elf_reloc_type_class elfNN_ia64_reloc_type_class
+ PARAMS ((const Elf_Internal_Rela *));
++static boolean elfNN_ia64_mkobject PARAMS ((bfd *));
++static boolean elfNN_ia64_object_p PARAMS ((bfd *));
+ static boolean elfNN_ia64_hpux_vec
+ PARAMS ((const bfd_target *vec));
+ static void elfNN_hpux_post_process_headers
+@@ -1834,26 +1845,22 @@ get_local_sym_hash (ia64_info, abfd, rel
+ const Elf_Internal_Rela *rel;
+ boolean create;
+ {
+- char *addr_name;
+- size_t len;
++ char *addr_name [2 * sizeof (unsigned long) + 2];
+ struct elfNN_ia64_local_hash_entry *ret;
++ static unsigned long key;
++
++ if (! elfNN_ia64_tdata (abfd)->key)
++ elfNN_ia64_tdata (abfd)->key = ++key;
+
+ /* Construct a string for use in the elfNN_ia64_local_hash_table.
+ name describes what was once anonymous memory. */
+
+- len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
+- len += 10; /* %p slop */
+-
+- addr_name = bfd_malloc (len);
+- if (addr_name == NULL)
+- return 0;
+- sprintf (addr_name, "%p:%lx",
+- (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info));
++ sprintf (addr_name, "%lx:%lx", elfNN_ia64_tdata (abfd)->key,
++ (unsigned long) ELFNN_R_SYM (rel->r_info));
+
+ /* Collect the canonical entry data for this address. */
+ ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
+ addr_name, create, create);
+- free (addr_name);
+ return ret;
+ }
+
+@@ -4660,6 +4667,32 @@ elfNN_ia64_reloc_type_class (rela)
+ }
+
+ static boolean
++elfNN_ia64_mkobject (abfd)
++ bfd *abfd;
++{
++ bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
++ abfd->tdata.any = bfd_zalloc (abfd, amt);
++ if (abfd->tdata.any == NULL)
++ return false;
++ return true;
++}
++
++static boolean
++elfNN_ia64_object_p (abfd)
++ bfd *abfd;
++{
++ /* Allocate our special target data. */
++ struct elfNN_ia64_obj_tdata *new_tdata;
++ bfd_size_type amt = sizeof (struct elfNN_ia64_obj_tdata);
++ new_tdata = bfd_zalloc (abfd, amt);
++ if (new_tdata == NULL)
++ return false;
++ new_tdata->root = *abfd->tdata.elf_obj_data;
++ abfd->tdata.any = new_tdata;
++ return true;
++}
++
++static boolean
+ elfNN_ia64_hpux_vec (const bfd_target *vec)
+ {
+ extern const bfd_target bfd_elfNN_ia64_hpux_big_vec;
+@@ -4718,6 +4751,9 @@ elfNN_hpux_backend_section_from_bfd_sect
+ #define elf_info_to_howto \
+ elfNN_ia64_info_to_howto
+
++#define bfd_elfNN_mkobject elfNN_ia64_mkobject
++#define elf_backend_object_p elfNN_ia64_object_p
++
+ #define bfd_elfNN_bfd_reloc_type_lookup \
+ elfNN_ia64_reloc_type_lookup
+ #define bfd_elfNN_bfd_is_local_label_name \
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch
new file mode 100644
index 000000000000..14ae4c50c697
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-ppc-apuinfo.patch
@@ -0,0 +1,15 @@
+2002-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ * config/tc-ppc.c (ppc_cleanup): Remove SEC_MERGE.
+
+--- gas/config/tc-ppc.c.jj Fri Sep 27 11:33:09 2002
++++ gas/config/tc-ppc.c Wed Nov 27 11:37:13 2002
+@@ -1329,7 +1329,7 @@ ppc_cleanup ()
+ apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0);
+ bfd_set_section_flags (stdoutput,
+ apuinfo_secp,
+- SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
++ SEC_HAS_CONTENTS | SEC_READONLY);
+
+ p = frag_more (4);
+ md_number_to_chars (p, (valueT) 8, 4);
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch
new file mode 100644
index 000000000000..e3931a2b19e7
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-rodata-cst.patch
@@ -0,0 +1,34 @@
+2002-11-24 Jakub Jelinek <jakub@redhat.com>
+
+ * write.c (subsegs_finish): For SEC_MERGE sections pad last fragment
+ to entsize.
+
+--- gas/write.c.jj 2002-11-21 15:58:39.000000000 +0100
++++ gas/write.c 2002-11-24 23:54:58.000000000 +0100
+@@ -1409,7 +1409,25 @@ subsegs_finish ()
+ any alignment is meaningless, and, moreover, will look weird
+ if we are generating a listing. */
+ if (!had_errors ())
+- alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
++ {
++ alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
++#ifdef BFD_ASSEMBLER
++ if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
++ && now_seg->entsize)
++ {
++ unsigned int entsize = now_seg->entsize;
++ int entalign = 0;
++
++ while ((entsize & 1) == 0)
++ {
++ ++entalign;
++ entsize >>= 1;
++ }
++ if (entalign > alignment)
++ alignment = entalign;
++ }
++#endif
++ }
+
+ if (subseg_text_p (now_seg))
+ frag_align_code (alignment, 0);
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch
new file mode 100644
index 000000000000..6623d288cbfe
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-stt_tls.patch
@@ -0,0 +1,180 @@
+2002-11-29 Jakub Jelinek <jakub@redhat.com>
+
+ * config/tc-ia64.c (md_apply_fix3): Add default case.
+
+2002-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ * symbols.c (S_SET_THREAD_LOCAL): New function.
+ * symbols.h (S_SET_THREAD_LOCAL): New prototype.
+ * config/tc-i386.c (md_apply_fix3): Call S_SET_THREAD_LOCAL
+ for TLS relocations.
+ * config/tc-ia64.c (md_apply_fix3): Likewise.
+ * config/tc-alpha.c (md_apply_fix3): Likewise.
+
+ * ld-i386/tlsnopic.rd: Change NOTYPE to TLS for UND sg* symbols.
+
+--- gas/config/tc-i386.c.jj 2002-10-14 13:30:31.000000000 +0200
++++ gas/config/tc-i386.c 2002-11-14 15:11:07.000000000 +0100
+@@ -4679,17 +4679,27 @@ md_apply_fix3 (fixP, valP, seg)
+ value = -4;
+ break;
+
+- case BFD_RELOC_386_GOT32:
+ case BFD_RELOC_386_TLS_GD:
+ case BFD_RELOC_386_TLS_LDM:
+ case BFD_RELOC_386_TLS_IE_32:
+ case BFD_RELOC_386_TLS_IE:
+ case BFD_RELOC_386_TLS_GOTIE:
+- case BFD_RELOC_X86_64_GOT32:
+ case BFD_RELOC_X86_64_TLSGD:
+ case BFD_RELOC_X86_64_TLSLD:
+ case BFD_RELOC_X86_64_GOTTPOFF:
+ value = 0; /* Fully resolved at runtime. No addend. */
++ /* Fallthrough */
++ case BFD_RELOC_386_TLS_LE:
++ case BFD_RELOC_386_TLS_LDO_32:
++ case BFD_RELOC_386_TLS_LE_32:
++ case BFD_RELOC_X86_64_DTPOFF32:
++ case BFD_RELOC_X86_64_TPOFF32:
++ S_SET_THREAD_LOCAL (fixP->fx_addsy);
++ break;
++
++ case BFD_RELOC_386_GOT32:
++ case BFD_RELOC_X86_64_GOT32:
++ value = 0; /* Fully resolved at runtime. No addend. */
+ break;
+
+ case BFD_RELOC_VTABLE_INHERIT:
+--- gas/config/tc-ia64.c.jj 2002-09-10 14:50:57.000000000 +0200
++++ gas/config/tc-ia64.c 2002-11-19 13:28:47.000000000 +0100
+@@ -10413,8 +10413,9 @@ md_apply_fix3 (fix, valP, seg)
+ }
+ if (fix->fx_addsy)
+ {
+- if (fix->fx_r_type == (int) BFD_RELOC_UNUSED)
++ switch (fix->fx_r_type)
+ {
++ case BFD_RELOC_UNUSED:
+ /* This must be a TAG13 or TAG13b operand. There are no external
+ relocs defined for them, so we must give an error. */
+ as_bad_where (fix->fx_file, fix->fx_line,
+@@ -10422,6 +10423,21 @@ md_apply_fix3 (fix, valP, seg)
+ elf64_ia64_operands[fix->tc_fix_data.opnd].desc);
+ fix->fx_done = 1;
+ return;
++
++ case BFD_RELOC_IA64_TPREL14:
++ case BFD_RELOC_IA64_TPREL22:
++ case BFD_RELOC_IA64_TPREL64I:
++ case BFD_RELOC_IA64_LTOFF_TPREL22:
++ case BFD_RELOC_IA64_LTOFF_DTPMOD22:
++ case BFD_RELOC_IA64_DTPREL14:
++ case BFD_RELOC_IA64_DTPREL22:
++ case BFD_RELOC_IA64_DTPREL64I:
++ case BFD_RELOC_IA64_LTOFF_DTPREL22:
++ S_SET_THREAD_LOCAL (fix->fx_addsy);
++ break;
++
++ default:
++ break;
+ }
+
+ /* ??? This is a hack copied from tc-i386.c to make PCREL relocs
+--- gas/config/tc-alpha.c.jj 2002-11-14 14:04:42.000000000 +0100
++++ gas/config/tc-alpha.c 2002-11-19 16:14:03.000000000 +0100
+@@ -1261,6 +1261,8 @@ md_apply_fix3 (fixP, valP, seg)
+
+ #ifdef OBJ_ELF
+ case BFD_RELOC_ALPHA_BRSGP:
++ return;
++
+ case BFD_RELOC_ALPHA_TLSGD:
+ case BFD_RELOC_ALPHA_TLSLDM:
+ case BFD_RELOC_ALPHA_GOTDTPREL16:
+@@ -1271,6 +1273,8 @@ md_apply_fix3 (fixP, valP, seg)
+ case BFD_RELOC_ALPHA_TPREL_HI16:
+ case BFD_RELOC_ALPHA_TPREL_LO16:
+ case BFD_RELOC_ALPHA_TPREL16:
++ if (fixP->fx_addsy)
++ S_SET_THREAD_LOCAL (fixP->fx_addsy);
+ return;
+ #endif
+
+--- gas/symbols.h.jj 2002-09-10 14:50:53.000000000 +0200
++++ gas/symbols.h 2002-11-14 14:26:10.000000000 +0100
+@@ -102,6 +102,7 @@ extern void S_SET_EXTERNAL PARAMS ((symb
+ extern void S_SET_NAME PARAMS ((symbolS *, char *));
+ extern void S_CLEAR_EXTERNAL PARAMS ((symbolS *));
+ extern void S_SET_WEAK PARAMS ((symbolS *));
++extern void S_SET_THREAD_LOCAL PARAMS ((symbolS *));
+ #endif
+
+ #ifndef WORKING_DOT_WORD
+--- gas/symbols.c.jj 2002-09-21 23:44:50.000000000 +0200
++++ gas/symbols.c 2002-11-19 13:02:03.000000000 +0100
+@@ -1951,6 +1951,25 @@ S_SET_WEAK (s)
+ }
+
+ void
++S_SET_THREAD_LOCAL (s)
++ symbolS *s;
++{
++ if (LOCAL_SYMBOL_CHECK (s))
++ s = local_symbol_convert ((struct local_symbol *) s);
++ if (bfd_is_com_section (s->bsym->section)
++ && (s->bsym->flags & BSF_THREAD_LOCAL) != 0)
++ return;
++ s->bsym->flags |= BSF_THREAD_LOCAL;
++ if ((s->bsym->flags & BSF_FUNCTION) != 0)
++ as_bad (_("Accessing function `%s' as thread-local object"),
++ S_GET_NAME (s));
++ else if (! bfd_is_und_section (s->bsym->section)
++ && (s->bsym->section->flags & SEC_THREAD_LOCAL) == 0)
++ as_bad (_("Accessing `%s' as thread-local object"),
++ S_GET_NAME (s));
++}
++
++void
+ S_SET_NAME (s, name)
+ symbolS *s;
+ char *name;
+--- ld/testsuite/ld-i386/tlsnopic.rd.jj 2002-09-19 12:01:19.000000000 +0200
++++ ld/testsuite/ld-i386/tlsnopic.rd 2002-11-14 15:07:13.000000000 +0100
+@@ -84,13 +84,13 @@ Symbol table '.dynsym' contains 22 entri
+ +9: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +9 *
+ +10: [0-9a-f]+ +0 SECTION LOCAL DEFAULT +10 *
+ +11: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _DYNAMIC
+- +12: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg3
+- +13: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg4
++ +12: 0+ +0 TLS +GLOBAL DEFAULT UND sg3
++ +13: 0+ +0 TLS +GLOBAL DEFAULT UND sg4
+ +14: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
+- +15: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg5
+- +16: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg1
++ +15: 0+ +0 TLS +GLOBAL DEFAULT UND sg5
++ +16: 0+ +0 TLS +GLOBAL DEFAULT UND sg1
+ +17: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
+- +18: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg2
++ +18: 0+ +0 TLS +GLOBAL DEFAULT UND sg2
+ +19: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
+ +20: 0+2080 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
+ +21: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
+@@ -121,13 +121,13 @@ Symbol table '.symtab' contains 34 entri
+ +21: 0+14 +0 TLS +LOCAL HIDDEN +7 sh1
+ +22: 0+18 +0 TLS +LOCAL HIDDEN +7 sh2
+ +23: [0-9a-f]+ +0 OBJECT GLOBAL DEFAULT ABS _DYNAMIC
+- +24: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg3
+- +25: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg4
++ +24: 0+ +0 TLS +GLOBAL DEFAULT UND sg3
++ +25: 0+ +0 TLS +GLOBAL DEFAULT UND sg4
+ +26: 0+1000 +0 FUNC +GLOBAL DEFAULT +5 fn3
+- +27: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg5
+- +28: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg1
++ +27: 0+ +0 TLS +GLOBAL DEFAULT UND sg5
++ +28: 0+ +0 TLS +GLOBAL DEFAULT UND sg1
+ +29: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS __bss_start
+- +30: 0+ +0 NOTYPE GLOBAL DEFAULT UND sg2
++ +30: 0+ +0 TLS +GLOBAL DEFAULT UND sg2
+ +31: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _edata
+ +32: 0+2080 +0 OBJECT GLOBAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_
+ +33: [0-9a-f]+ +0 NOTYPE GLOBAL DEFAULT ABS _end
diff --git a/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch
new file mode 100644
index 000000000000..3a7b50a5562e
--- /dev/null
+++ b/sys-devel/binutils/files/2.13/binutils-2.13.90.0.16-tls-strip.patch
@@ -0,0 +1,144 @@
+2002-11-30 Jakub Jelinek <jakub@redhat.com>
+
+ * elf.c (elf_sort_sections): Don't reorder .tbss.
+ (assign_file_positions_for_segments): Only adjust off/voff
+ for increased alignment in PT_LOAD or PT_NOTE segment,
+ but adjust p_filesz for .tbss too. in PT_LOAD consider
+ .tbss to have zero memory size.
+ (copy_private_bfd_data) [SECTION_SIZE]: Define.
+ [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it.
+ [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections
+ into PT_TLS segment. Never put SHF_TLS sections in
+ segments other than PT_TLS or PT_LOAD.
+
+--- bfd/elf.c.jj 2002-11-28 15:49:48.000000000 +0100
++++ bfd/elf.c 2002-11-29 23:58:06.000000000 +0100
+@@ -3494,6 +3494,7 @@ elf_sort_sections (arg1, arg2)
+ {
+ const asection *sec1 = *(const asection **) arg1;
+ const asection *sec2 = *(const asection **) arg2;
++ bfd_size_type size1, size2;
+
+ /* Sort by LMA first, since this is the address used to
+ place the section into a segment. */
+@@ -3511,7 +3512,7 @@ elf_sort_sections (arg1, arg2)
+
+ /* Put !SEC_LOAD sections after SEC_LOAD ones. */
+
+-#define TOEND(x) (((x)->flags & SEC_LOAD) == 0)
++#define TOEND(x) (((x)->flags & (SEC_LOAD|SEC_THREAD_LOCAL)) == 0)
+
+ if (TOEND (sec1))
+ {
+@@ -3533,9 +3534,12 @@ elf_sort_sections (arg1, arg2)
+ /* Sort by size, to put zero sized sections
+ before others at the same address. */
+
+- if (sec1->_raw_size < sec2->_raw_size)
++ size1 = (sec1->flags & SEC_LOAD) ? sec1->_raw_size : 0;
++ size2 = (sec2->flags & SEC_LOAD) ? sec2->_raw_size : 0;
++
++ if (size1 < size2)
+ return -1;
+- if (sec1->_raw_size > sec2->_raw_size)
++ if (size1 > size2)
+ return 1;
+
+ return sec1->target_index - sec2->target_index;
+@@ -3816,9 +3820,15 @@ assign_file_positions_for_segments (abfd
+ bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz);
+
+ p->p_memsz += adjust;
+- off += adjust;
+- voff += adjust;
+- if ((flags & SEC_LOAD) != 0)
++ if (p->p_type == PT_LOAD
++ || (p->p_type == PT_NOTE
++ && bfd_get_format (abfd) == bfd_core))
++ {
++ off += adjust;
++ voff += adjust;
++ }
++ if ((flags & SEC_LOAD) != 0
++ || (flags & SEC_THREAD_LOCAL) != 0)
+ p->p_filesz += adjust;
+ }
+
+@@ -3875,7 +3885,9 @@ Error: First section in segment (%s) sta
+ || (flags & SEC_HAS_CONTENTS) != 0)
+ off += sec->_raw_size;
+
+- if ((flags & SEC_ALLOC) != 0)
++ if ((flags & SEC_ALLOC) != 0
++ && ((flags & SEC_LOAD) != 0
++ || (flags & SEC_THREAD_LOCAL) == 0))
+ voff += sec->_raw_size;
+ }
+
+@@ -3902,6 +3914,9 @@ Error: First section in segment (%s) sta
+ }
+ else
+ {
++ if ((sec->flags & SEC_LOAD) != 0
++ || (sec->flags & SEC_THREAD_LOCAL) == 0
++ || p->p_type == PT_TLS)
+ p->p_memsz += sec->_raw_size;
+
+ if ((flags & SEC_LOAD) != 0)
+@@ -4545,18 +4560,23 @@ copy_private_bfd_data (ibfd, obfd)
+ (start + (segment->p_memsz > segment->p_filesz \
+ ? segment->p_memsz : segment->p_filesz))
+
++#define SECTION_SIZE(section, segment) \
++ (((section->flags & (SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) \
++ != SEC_THREAD_LOCAL || segment->p_type == PT_TLS) \
++ ? section->_raw_size : 0)
++
+ /* Returns true if the given section is contained within
+ the given segment. VMA addresses are compared. */
+ #define IS_CONTAINED_BY_VMA(section, segment) \
+ (section->vma >= segment->p_vaddr \
+- && (section->vma + section->_raw_size \
++ && (section->vma + SECTION_SIZE (section, segment) \
+ <= (SEGMENT_END (segment, segment->p_vaddr))))
+
+ /* Returns true if the given section is contained within
+ the given segment. LMA addresses are compared. */
+ #define IS_CONTAINED_BY_LMA(section, segment, base) \
+ (section->lma >= base \
+- && (section->lma + section->_raw_size \
++ && (section->lma + SECTION_SIZE (section, segment) \
+ <= SEGMENT_END (segment, base)))
+
+ /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */
+@@ -4588,7 +4608,9 @@ copy_private_bfd_data (ibfd, obfd)
+ if that is set for the segment and the VMA otherwise,
+ 2. It is an allocated segment,
+ 3. There is an output section associated with it,
+- 4. The section has not already been allocated to a previous segment. */
++ 4. The section has not already been allocated to a previous segment.
++ 5. PT_TLS segment includes only SHF_TLS sections.
++ 6. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. */
+ #define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \
+ ((((segment->p_paddr \
+ ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
+@@ -4596,6 +4618,11 @@ copy_private_bfd_data (ibfd, obfd)
+ && (section->flags & SEC_ALLOC) != 0) \
+ || IS_COREFILE_NOTE (segment, section)) \
+ && section->output_section != NULL \
++ && (segment->p_type != PT_TLS \
++ || (section->flags & SEC_THREAD_LOCAL)) \
++ && (segment->p_type == PT_LOAD \
++ || segment->p_type == PT_TLS \
++ || (section->flags & SEC_THREAD_LOCAL) == 0) \
+ && ! section->segment_mark)
+
+ /* Returns true iff seg1 starts after the end of seg2. */
+@@ -5073,6 +5100,7 @@ copy_private_bfd_data (ibfd, obfd)
+ #endif
+
+ #undef SEGMENT_END
++#undef SECTION_SIZE
+ #undef IS_CONTAINED_BY_VMA
+ #undef IS_CONTAINED_BY_LMA
+ #undef IS_COREFILE_NOTE
diff --git a/sys-devel/binutils/files/digest-binutils-2.13.90.0.16-r1 b/sys-devel/binutils/files/digest-binutils-2.13.90.0.16-r1
new file mode 100644
index 000000000000..351046eb89ea
--- /dev/null
+++ b/sys-devel/binutils/files/digest-binutils-2.13.90.0.16-r1
@@ -0,0 +1 @@
+MD5 d27a33db69b9799a414d98f4b274b3a6 binutils-2.13.90.0.16.tar.bz2 9735189