summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Wourms <dragon@gentoo.org>2003-05-08 20:52:39 +0000
committerNicholas Wourms <dragon@gentoo.org>2003-05-08 20:52:39 +0000
commit96b80ef0e96ab8f6e76c78c815ed2b232e3ef45e (patch)
tree7d72c2deb4f49283e2ded964ad16e576219e899e /sys-devel
parentAdded patch to binutils to resync with CVS head. Fix a few problems with the... (diff)
downloadgentoo-2-96b80ef0e96ab8f6e76c78c815ed2b232e3ef45e.tar.gz
gentoo-2-96b80ef0e96ab8f6e76c78c815ed2b232e3ef45e.tar.bz2
gentoo-2-96b80ef0e96ab8f6e76c78c815ed2b232e3ef45e.zip
Added patch to binutils to resync with CVS head. Fix a few problems with the testsuite and weak symbols. Re-enable 3rd party patches/addons.
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/binutils/ChangeLog13
-rw-r--r--sys-devel/binutils/Manifest4
-rw-r--r--sys-devel/binutils/binutils-2.14.90.0.1-r1.ebuild175
-rw-r--r--sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-eh-frame-ro.patch484
-rw-r--r--sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-sparc-nonpic.patch94
-rw-r--r--sys-devel/binutils/files/digest-binutils-2.14.90.0.1-r12
6 files changed, 769 insertions, 3 deletions
diff --git a/sys-devel/binutils/ChangeLog b/sys-devel/binutils/ChangeLog
index 22d515b88d1f..9a751343dd4e 100644
--- a/sys-devel/binutils/ChangeLog
+++ b/sys-devel/binutils/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for sys-devel/binutils
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/ChangeLog,v 1.44 2003/05/06 17:56:18 lu_zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/ChangeLog,v 1.45 2003/05/08 20:52:27 dragon Exp $
+
+*binutils-2.14.90.0.1-r1 (08 May 2003)
+
+ 08 May 2003; Nicholas Wourms <dragon@gentoo.org>
+ binutils-2.14.90.0.1-r1.ebuild,
+ files/2.14/binutils-2.14.90.0.1-eh-frame-ro.patch,
+ files/2.14/binutils-2.14.90.0.1-sparc-nonpic.patch:
+ Added patch to resync with CVS head, bumped revision to reflect this. This
+ version should resolve any outstanding testsuite & weak symbol issues. I
+ have also added the previous patches back into the ebuild, compiles and
+ passes the testsuite on x86 w/o any regressions.
*binutils-2.14.90.0.1 (06 May 2003)
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
index 54d210360ad9..2658529f55f2 100644
--- a/sys-devel/binutils/Manifest
+++ b/sys-devel/binutils/Manifest
@@ -1,4 +1,4 @@
-MD5 10f771646ade43488a76fc8f33fa1978 ChangeLog 7016
+MD5 65238ddd14e2b00cb850ab6d1986dc87 ChangeLog 7526
MD5 d189f3ead52fedbc4494c79157c153f7 binutils-2.11.92.0.12.3-r2.ebuild 3134
MD5 a665aacd5e8087aa9c51272fa8c357c7 binutils-2.11.92.0.7.ebuild 2366
MD5 743a59e3857ba3b11beab01e6a5442b5 binutils-2.12.90.0.15.ebuild 3521
@@ -12,7 +12,7 @@ MD5 8730038a660b29c4398be9320bedb1c7 binutils-2.13.90.0.18.ebuild 4533
MD5 c98f5e3a4ce9bbb59162ee9b3bbf319e binutils-2.13.90.0.18-r1.ebuild 5329
MD5 ff717bcf4a9aebb432e43af00bd65ba6 binutils-2.13.90.0.20-r1.ebuild 4970
MD5 58ae9cb837ec30cecafe368b8442ade8 binutils-2.14.90.0.1.ebuild 4912
-MD5 d3fa4218165f516eac7e08a5da0652d6 binutils-2.14.90.0.1-r1.ebuild 4892
+MD5 e17f989ef57536f69746d386e62099a6 binutils-2.14.90.0.1-r1.ebuild 5004
MD5 fe5fb935b171a472f5eb1a8bca63c136 files/binutils-2.12.90.0.14-glibc21.patch 7936
MD5 f453b3f208b17cd18380bc3653936487 files/binutils-2.12.90.0.14-x86_64-libpic.patch 1184
MD5 db3f89b51f6961b0cf92bdddf8127ea7 files/digest-binutils-2.11.92.0.12.3-r2 161
diff --git a/sys-devel/binutils/binutils-2.14.90.0.1-r1.ebuild b/sys-devel/binutils/binutils-2.14.90.0.1-r1.ebuild
new file mode 100644
index 000000000000..b495556d644f
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.14.90.0.1-r1.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.14.90.0.1-r1.ebuild,v 1.1 2003/05/08 20:52:27 dragon Exp $
+
+IUSE="nls bootstrap 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 -fssa"
+
+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
+ http://cvs.gentoo.org/~dragon/${P}-20030508-cvs-update.patch.bz2"
+HOMEPAGE="http://sources.redhat.com/binutils/"
+
+SLOT="0"
+LICENSE="GPL-2 | LGPL-2"
+KEYWORDS="~x86 ~ppc -alpha -sparc ~mips -hppa -arm"
+
+DEPEND="virtual/glibc
+ >=sys-apps/portage-2.0.21
+ nls? ( sys-devel/gettext )
+ || ( dev-lang/perl
+ ( !build? ( dev-lang/perl ) )
+ ( !bootstrap? ( dev-lang/perl ) )
+ )"
+# This is a hairy one. Basically depend on dev-lang/perl
+# if "build" or "bootstrap" not in USE.
+
+
+# filter CFLAGS=".. -O2 .." on arm
+if [ "${ARCH}" = "arm" ]; then
+ CFLAGS="$(echo "${CFLAGS}" | sed -e 's,-O[2-9] ,-O1 ,')"
+fi
+
+src_unpack() {
+
+ unpack ${A}
+
+ cd ${S}
+
+ # CVS Branch Updates
+ # This is necessary to get testsuite working again. It also
+ # provides futher updates and necessary fixes for mips. It
+ # fixes a few weak symbol issues, as well.
+ # <dragon@gentoo.org> (08 May 2003)
+ epatch ${WORKDIR}/${P}-20030508-cvs-update.patch
+
+ # 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-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.18-ltconfig-multilib.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.18-s390-file-loc.patch
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.18-testsuite-Wall-fixes.patch
+ epatch ${FILESDIR}/2.14/${P}-sparc-nonpic.patch
+ epatch ${FILESDIR}/2.14/${P}-eh-frame-ro.patch
+
+ use x86 &> /dev/null \
+ && epatch ${FILESDIR}/2.13/${P}-array-sects-compat.patch
+
+ # Add patches for mips
+ if [ "${ARCH}" = "mips" ]
+ then
+ epatch ${FILESDIR}/2.13/${PN}-2.13.90.0.20-gas-mips-gprel.patch
+ fi
+
+}
+
+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
+
+ make configure-bfd || die
+ make headers -C bfd || die
+ emake tooldir="${ROOT}/usr/bin" \
+ all || die
+
+ 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.14/binutils-2.14.90.0.1-eh-frame-ro.patch b/sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-eh-frame-ro.patch
new file mode 100644
index 000000000000..ce4fc4db8944
--- /dev/null
+++ b/sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-eh-frame-ro.patch
@@ -0,0 +1,484 @@
+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.
+
+diff -Naurp binutils-2.13.90.0.20.orig/ld/emultempl/elf32.em binutils-2.13.90.0.20/ld/emultempl/elf32.em
+--- binutils-2.13.90.0.20.orig/ld/emultempl/elf32.em 2003-03-19 12:19:16.000000000 -0500
++++ binutils-2.13.90.0.20/ld/emultempl/elf32.em 2003-05-01 15:52:02.000000000 -0400
+@@ -1056,7 +1056,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
+@@ -1296,7 +1297,7 @@ gld${EMULATION_NAME}_place_orphan (file,
+ (bfd_vma) 0,
+ (etree_type *) NULL,
+ (etree_type *) NULL,
+- load_base);
++ load_base, 0);
+
+ lang_add_section (&os->children, s, os, file);
+
+diff -Naurp binutils-2.13.90.0.20.orig/ld/emultempl/mmo.em binutils-2.13.90.0.20/ld/emultempl/mmo.em
+--- binutils-2.13.90.0.20.orig/ld/emultempl/mmo.em 2002-12-16 15:22:53.000000000 -0500
++++ binutils-2.13.90.0.20/ld/emultempl/mmo.em 2003-05-01 15:52:02.000000000 -0400
+@@ -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);
+
+diff -Naurp binutils-2.13.90.0.20.orig/ld/emultempl/pe.em binutils-2.13.90.0.20/ld/emultempl/pe.em
+--- binutils-2.13.90.0.20.orig/ld/emultempl/pe.em 2003-05-01 15:49:44.000000000 -0400
++++ binutils-2.13.90.0.20/ld/emultempl/pe.em 2003-05-01 15:52:02.000000000 -0400
+@@ -1511,6 +1511,8 @@ output_prev_sec_find (os)
+ u = lookup->next)
+ {
+ lookup = &u->output_section_statement;
++ if (lookup->constraint == -1)
++ continue;
+ if (lookup == os)
+ return s;
+
+@@ -1677,7 +1679,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);
+
+diff -Naurp binutils-2.13.90.0.20.orig/ld/ldgram.y binutils-2.13.90.0.20/ld/ldgram.y
+--- binutils-2.13.90.0.20.orig/ld/ldgram.y 2003-05-01 15:49:45.000000000 -0400
++++ binutils-2.13.90.0.20/ld/ldgram.y 2003-05-01 15:55:29.000000000 -0400
+@@ -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
+ {}
+diff -Naurp binutils-2.13.90.0.20.orig/ld/ldlang.c binutils-2.13.90.0.20/ld/ldlang.c
+--- binutils-2.13.90.0.20.orig/ld/ldlang.c 2003-05-01 15:49:45.000000000 -0400
++++ binutils-2.13.90.0.20/ld/ldlang.c 2003-05-01 15:52:02.000000000 -0400
+@@ -72,6 +72,10 @@ static lang_input_statement_type *new_af
+ bfd_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
+@@ -94,6 +98,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 bfd_boolean load_symbols
+@@ -111,6 +118,9 @@ static void lang_reasonable_defaults
+ PARAMS ((void));
+ static void insert_undefined
+ PARAMS ((const char *));
++static void check_input_sections
++ PARAMS ((lang_statement_union_type *,
++ lang_output_section_statement_type *));
+ static void lang_place_undefineds
+ PARAMS ((void));
+ static void map_input_to_output_sections
+@@ -745,9 +755,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;
+@@ -757,7 +768,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;
+ }
+@@ -766,12 +779,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)
+ {
+
+@@ -786,6 +807,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);
+@@ -805,6 +827,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;
+@@ -1482,6 +1511,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. */
+@@ -2151,6 +2205,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 attach to output sections. */
+
+ static void
+@@ -2172,6 +2261,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);
+@@ -2242,6 +2348,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)
+ {
+@@ -4116,7 +4224,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;
+@@ -4124,12 +4232,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
+@@ -4855,6 +4965,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)
+@@ -4915,7 +5027,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;
+@@ -4985,7 +5098,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
+diff -Naurp binutils-2.13.90.0.20.orig/ld/ldlang.h binutils-2.13.90.0.20/ld/ldlang.h
+--- binutils-2.13.90.0.20.orig/ld/ldlang.h 2003-03-19 12:19:16.000000000 -0500
++++ binutils-2.13.90.0.20/ld/ldlang.h 2003-05-01 15:52:02.000000000 -0400
+@@ -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;
++ bfd_boolean all_input_readonly;
+
+ union etree_union *load_base;
+
+@@ -394,7 +396,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
+diff -Naurp binutils-2.13.90.0.20.orig/ld/ldlex.l binutils-2.13.90.0.20/ld/ldlex.l
+--- binutils-2.13.90.0.20.orig/ld/ldlex.l 2003-05-01 15:49:45.000000000 -0400
++++ binutils-2.13.90.0.20/ld/ldlex.l 2003-05-01 15:52:02.000000000 -0400
+@@ -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 -Naurp binutils-2.13.90.0.20.orig/ld/mri.c binutils-2.13.90.0.20/ld/mri.c
+--- binutils-2.13.90.0.20.orig/ld/mri.c 2003-01-21 13:21:34.000000000 -0500
++++ binutils-2.13.90.0.20/ld/mri.c 2003-05-01 15:52:02.000000000 -0400
+@@ -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;
+diff -Naurp binutils-2.13.90.0.20.orig/ld/scripttempl/elf.sc binutils-2.13.90.0.20/ld/scripttempl/elf.sc
+--- binutils-2.13.90.0.20.orig/ld/scripttempl/elf.sc 2003-05-01 15:49:45.000000000 -0400
++++ binutils-2.13.90.0.20/ld/scripttempl/elf.sc 2003-05-01 15:52:02.000000000 -0400
+@@ -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}}
diff --git a/sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-sparc-nonpic.patch b/sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-sparc-nonpic.patch
new file mode 100644
index 000000000000..78b55fe1e398
--- /dev/null
+++ b/sys-devel/binutils/files/2.14/binutils-2.14.90.0.1-sparc-nonpic.patch
@@ -0,0 +1,94 @@
+2002-04-20 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-sparc.c (elf32_sparc_relocate_section): Find real output
+ section with SEC_MERGE.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
+--- bfd/elf32-sparc.c.jj Thu Feb 6 08:07:10 2003
++++ bfd/elf32-sparc.c Thu Feb 6 08:31:54 2003
+@@ -2168,7 +2168,7 @@ elf32_sparc_relocate_section (output_bfd
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+- bfd_vma relocation, off;
++ bfd_vma relocation, off, orig_addend = 0;
+ bfd_reloc_status_type r;
+ bfd_boolean is_plt = FALSE;
+ bfd_boolean unresolved_reloc;
+@@ -2196,6 +2196,7 @@ elf32_sparc_relocate_section (output_bfd
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
++ orig_addend = rel->r_addend;
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+ }
+ else
+@@ -2525,6 +2526,24 @@ elf32_sparc_relocate_section (output_bfd
+ asection *osec;
+
+ osec = sec->output_section;
++ /* FIXME: As soon as making sections zero size
++ is possible, this if can go away. */
++ if (bfd_is_abs_section (osec)
++ && h == NULL
++ && (sec->flags & SEC_MERGE)
++ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
++ && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
++ {
++ asection *msec;
++
++ msec = sec;
++ _bfd_merged_section_offset (output_bfd, &msec,
++ elf_section_data (sec)->sec_info,
++ sym->st_value + orig_addend,
++ (bfd_vma) 0);
++ osec = msec->output_section;
++ }
++
+ indx = elf_section_data (osec)->dynindx;
+
+ /* FIXME: we really should be able to link non-pic
+--- bfd/elf64-sparc.c.jj Thu Feb 6 08:07:10 2003
++++ bfd/elf64-sparc.c Thu Feb 6 08:31:54 2003
+@@ -2016,7 +2016,7 @@ sparc64_elf_relocate_section (output_bfd
+ struct elf_link_hash_entry *h;
+ Elf_Internal_Sym *sym;
+ asection *sec;
+- bfd_vma relocation, off;
++ bfd_vma relocation, off, orig_addend = 0;
+ bfd_reloc_status_type r;
+ bfd_boolean is_plt = FALSE;
+ bfd_boolean unresolved_reloc;
+@@ -2039,6 +2039,7 @@ sparc64_elf_relocate_section (output_bfd
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
++ orig_addend = rel->r_addend;
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
+ }
+ else
+@@ -2267,6 +2268,24 @@ sparc64_elf_relocate_section (output_bfd
+ asection *osec;
+
+ osec = sec->output_section;
++ /* FIXME: As soon as making sections zero size
++ is possible, this if can go away. */
++ if (bfd_is_abs_section (osec)
++ && h == NULL
++ && (sec->flags & SEC_MERGE)
++ && ELF_ST_TYPE (sym->st_info) == STT_SECTION
++ && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
++ {
++ asection *msec;
++
++ msec = sec;
++ _bfd_merged_section_offset (output_bfd, &msec,
++ elf_section_data (sec)->sec_info,
++ sym->st_value + orig_addend,
++ (bfd_vma) 0);
++ osec = msec->output_section;
++ }
++
+ indx = elf_section_data (osec)->dynindx;
+
+ /* We are turning this relocation into one
diff --git a/sys-devel/binutils/files/digest-binutils-2.14.90.0.1-r1 b/sys-devel/binutils/files/digest-binutils-2.14.90.0.1-r1
new file mode 100644
index 000000000000..be20d368e9b2
--- /dev/null
+++ b/sys-devel/binutils/files/digest-binutils-2.14.90.0.1-r1
@@ -0,0 +1,2 @@
+MD5 2018bb21eba8fe09b1a3d53321ebffa4 binutils-2.14.90.0.1.tar.bz2 10314430
+MD5 9a96b9a9187ae3e59e70a468a722c704 binutils-2.14.90.0.1-20030508-cvs-update.patch.bz2 49178