<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff -urN orig.binutils-2.9.1/bfd/ChangeLog binutils-2.9.1/bfd/ChangeLog
--- orig.binutils-2.9.1/bfd/ChangeLog	1998-05-01 12:47:57.000000000 -0300
+++ binutils-2.9.1/bfd/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,36 @@
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* README: Updated bug reporting address.
+	* configure.in: Set version number to 2.9.1-ps2dev.
+	* configure: Rebuild.
+	
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* config.bfd (mips-*-irx*): New target.
+	* elf.c (assign_file_positions_for_segments): Assign file offsets to
+	sections in PT_MIPS_IRXHDR segments.  Don't use non-allocated
+	sections when calculating the size of the memory image.
+	* elf32-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
+	SHT_MIPS_IOPMOD sections.
+	(mips_elf_check_relocs): Don't create a .rel.dyn section unless it
+	is going to be used.
+	(_bfd_mips_elf_fake_sections): Recognize IRX files.
+	* elflink.h (elf_bfd_final_link): Don't strip .symtab and .strtab
+	section headers if emitting relocations.  Don't emit section
+	symbols when stripping everything in an irx.
+	(elf_link_input_bfd): Don't emit global symbols when stripping
+	everything from an irx.  Don't assert when a relocation's symbol
+	index is zero.
+	
+	Backported from changes made on 2000-05-17 by
+	S. Bharadwaj Yadavalli  &lt;sby@scrugs.lkg.dec.com&gt; and
+	Rick Gorton             &lt;gorton@scrugs.lkg.dec.com&gt;
+	* elflink.h: Add emitrelocations support: when enabled, relocation
+	information and relocation sections are put into final output
+	executables.  If the emitrelocations flag is set, do the following:
+	(elf_bfd_final_link): Emit relocation sections.
+	(elf_link_input_bfd): Compute relocation section contents.
+
 Mon Apr 27 11:49:55 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* configure.in: Set version number to 2.9.1.
diff -urN orig.binutils-2.9.1/bfd/README binutils-2.9.1/bfd/README
--- orig.binutils-2.9.1/bfd/README	1998-05-01 12:47:59.000000000 -0300
+++ binutils-2.9.1/bfd/README	2004-01-30 12:21:27.000000000 -0400
@@ -31,7 +31,7 @@
 	Use mmap when accessing files.  This is faster on some hosts,
 	but slower on others.  It may not work on all hosts.
 
-Report bugs with BFD to bug-gnu-utils@gnu.org.
+Report bugs with BFD to ps2dev-bugs@lists.sourceforge.net.
 
 Patches are encouraged.  When sending patches, always send the output
 of diff -u or diff -c from the original file to the new file.  Do not
diff -urN orig.binutils-2.9.1/bfd/config.bfd binutils-2.9.1/bfd/config.bfd
--- orig.binutils-2.9.1/bfd/config.bfd	1998-05-01 12:48:05.000000000 -0300
+++ binutils-2.9.1/bfd/config.bfd	2004-01-30 12:21:27.000000000 -0400
@@ -431,6 +431,10 @@
     targ_defvec=bfd_elf32_bigmips_vec
     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
     ;;
+  mips*-*-irx*)
+    targ_defvec=bfd_elf32_littlemips_vec
+    targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+    ;;
   mips*-*-none)
     targ_defvec=bfd_elf32_bigmips_vec
     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
diff -urN orig.binutils-2.9.1/bfd/configure binutils-2.9.1/bfd/configure
--- orig.binutils-2.9.1/bfd/configure	1998-05-01 12:48:05.000000000 -0300
+++ binutils-2.9.1/bfd/configure	2004-01-30 12:21:27.000000000 -0400
@@ -993,7 +993,7 @@
 
 PACKAGE=bfd
 
-VERSION=2.9.1
+VERSION=2.9.1-ps2dev
 
 if test "`cd $srcdir &amp;&amp; pwd`" != "`pwd`" &amp;&amp; test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1&gt;&amp;2; exit 1; }
diff -urN orig.binutils-2.9.1/bfd/configure.in binutils-2.9.1/bfd/configure.in
--- orig.binutils-2.9.1/bfd/configure.in	1998-05-01 12:48:05.000000000 -0300
+++ binutils-2.9.1/bfd/configure.in	2004-01-30 12:21:27.000000000 -0400
@@ -7,7 +7,7 @@
 AC_CANONICAL_SYSTEM
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.9.1)
+AM_INIT_AUTOMAKE(bfd, 2.9.1-ps2dev)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
diff -urN orig.binutils-2.9.1/bfd/elf.c binutils-2.9.1/bfd/elf.c
--- orig.binutils-2.9.1/bfd/elf.c	1998-05-01 12:48:08.000000000 -0300
+++ binutils-2.9.1/bfd/elf.c	2004-01-30 12:21:27.000000000 -0400
@@ -2570,7 +2570,12 @@
 	  p-&gt;p_memsz += alloc * bed-&gt;s-&gt;sizeof_phdr;
 	}
 
-      if (p-&gt;p_type == PT_LOAD)
+      /* FIXME: 0x70000080 == PT_MIPS_IRXHDR.  It is not good and
+         shouldn't be necessary to include code for processor specific
+         features in this file.  Perhaps p-&gt;p_type == PT_LOAD is not
+         the right check to be making here.  */
+
+      if (p-&gt;p_type == PT_LOAD || p-&gt;p_type == 0x70000080)
 	{
 	  if (! m-&gt;includes_filehdr &amp;&amp; ! m-&gt;includes_phdrs)
 	    p-&gt;p_offset = off;
@@ -2595,7 +2600,12 @@
 	  flags = sec-&gt;flags;
 	  align = 1 &lt;&lt; bfd_get_section_alignment (abfd, sec);
 
-	  if (p-&gt;p_type == PT_LOAD)
+	  /* FIXME: 0x70000080 == PT_MIPS_IRXHDR.  It is not good and
+	     shouldn't be necessary to include code for processor
+	     specific features in this file.  Perhaps p-&gt;p_type ==
+	     PT_LOAD is not the right check to be making here.  */
+
+	  if (p-&gt;p_type == PT_LOAD || p-&gt;p_type == 0x70000080)
 	    {
 	      bfd_vma adjust;
 
@@ -2640,7 +2650,8 @@
 		voff += sec-&gt;_raw_size;
 	    }
 
-	  p-&gt;p_memsz += sec-&gt;_raw_size;
+	  if ((flags &amp; SEC_ALLOC) != 0)
+	    p-&gt;p_memsz += sec-&gt;_raw_size;
 
 	  if ((flags &amp; SEC_LOAD) != 0)
 	    p-&gt;p_filesz += sec-&gt;_raw_size;
diff -urN orig.binutils-2.9.1/bfd/elf32-mips.c binutils-2.9.1/bfd/elf32-mips.c
--- orig.binutils-2.9.1/bfd/elf32-mips.c	1998-05-01 12:48:09.000000000 -0300
+++ binutils-2.9.1/bfd/elf32-mips.c	2004-01-30 12:21:27.000000000 -0400
@@ -2099,6 +2099,10 @@
      probably get away with this.  */
   switch (hdr-&gt;sh_type)
     {
+    case SHT_MIPS_IOPMOD:
+      if (strcmp (name, ".iopmod") != 0)
+	return false;
+      break;
     case SHT_MIPS_LIBLIST:
       if (strcmp (name, ".liblist") != 0)
 	return false;
@@ -2261,7 +2265,25 @@
 
   name = bfd_get_section_name (abfd, sec);
 
-  if (strcmp (name, ".liblist") == 0)
+  if (strcmp (name, ".iopmod") == 0)
+    {
+      /* Verify that this bfd is going to be an IRX, and not an object
+         file or a rogue elf with an .iopmod section by looking for
+         the PT_MIPS_IRXHDR program header.  */
+      struct elf_segment_map *m;
+
+      for (m = elf_tdata (abfd)-&gt;segment_map; m != NULL; m = m-&gt;next)
+	if (m-&gt;p_type == PT_MIPS_IRXHDR)
+	  {
+	    /* Mark the file as an IRX.  */
+	    elf_elfheader (abfd)-&gt;e_type = ET_IRX;
+	    /* Setup the section type and flags.  */
+	    hdr-&gt;sh_type = SHT_MIPS_IOPMOD;
+	    hdr-&gt;sh_addr = 0;
+	    hdr-&gt;sh_flags &amp;= ~(SHF_ALLOC | SHF_WRITE | SHF_EXECINSTR);
+	  }
+    }
+  else if (strcmp (name, ".liblist") == 0)
     {
       hdr-&gt;sh_type = SHT_MIPS_LIBLIST;
       hdr-&gt;sh_info = sec-&gt;_raw_size / sizeof (Elf32_Lib);
@@ -6025,33 +6047,33 @@
 	  if ((info-&gt;shared || h != NULL)
 	      &amp;&amp; (sec-&gt;flags &amp; SEC_ALLOC) != 0)
 	    {
-	      if (sreloc == NULL)
-		{
-		  const char *name = ".rel.dyn";
-
-		  sreloc = bfd_get_section_by_name (dynobj, name);
-		  if (sreloc == NULL)
-		    {
-		      sreloc = bfd_make_section (dynobj, name);
-		      if (sreloc == NULL
-			  || ! bfd_set_section_flags (dynobj, sreloc,
-						      (SEC_ALLOC
-						       | SEC_LOAD
-						       | SEC_HAS_CONTENTS
-						       | SEC_IN_MEMORY
-						       | SEC_LINKER_CREATED
-						       | SEC_READONLY))
-			  || ! bfd_set_section_alignment (dynobj, sreloc,
-							  4))
-			return false;
-		    }
-		}
 	      if (info-&gt;shared)
 		{
 		  /* When creating a shared object, we must copy these
 		     reloc types into the output file as R_MIPS_REL32
 		     relocs.  We make room for this reloc in the
 		     .rel.dyn reloc section */
+		  if (sreloc == NULL)
+		    {
+		      const char *name = ".rel.dyn";
+		      
+		      sreloc = bfd_get_section_by_name (dynobj, name);
+		      if (sreloc == NULL)
+			{
+			  sreloc = bfd_make_section (dynobj, name);
+			  if (sreloc == NULL
+			      || ! bfd_set_section_flags (dynobj, sreloc,
+							  (SEC_ALLOC
+							   | SEC_LOAD
+							   | SEC_HAS_CONTENTS
+							   | SEC_IN_MEMORY
+							   | SEC_LINKER_CREATED
+							   | SEC_READONLY))
+			      || ! bfd_set_section_alignment (dynobj, sreloc,
+							      4))
+			    return false;
+			}
+		    }
 		  if (sreloc-&gt;_raw_size == 0)
 		    {
 		      /* Add a null element. */
diff -urN orig.binutils-2.9.1/bfd/elflink.h binutils-2.9.1/bfd/elflink.h
--- orig.binutils-2.9.1/bfd/elflink.h	1998-05-01 12:48:10.000000000 -0300
+++ binutils-2.9.1/bfd/elflink.h	2004-01-30 12:21:27.000000000 -0400
@@ -3483,7 +3483,8 @@
 		 the linker has decided to not include.  */
 	      sec-&gt;linker_mark = true;
 
-	      if (info-&gt;relocateable)
+	      if (info-&gt;relocateable
+		  || info-&gt;emitrelocations)
 		o-&gt;reloc_count += sec-&gt;reloc_count;
 
 	      if (sec-&gt;_raw_size &gt; max_contents_size)
@@ -3543,7 +3544,8 @@
   /* Figure out the file positions for everything but the symbol table
      and the relocs.  We set symcount to force assign_section_numbers
      to create a symbol table.  */
-  abfd-&gt;symcount = info-&gt;strip == strip_all ? 0 : 1;
+  abfd-&gt;symcount = (info-&gt;strip == strip_all
+		    &amp;&amp; !info-&gt;emitrelocations) ? 0 : 1;
   BFD_ASSERT (! abfd-&gt;output_has_begun);
   if (! _bfd_elf_compute_section_file_positions (abfd, info))
     goto error_return;
@@ -3622,7 +3624,8 @@
 
   /* Start writing out the symbol table.  The first symbol is always a
      dummy symbol.  */
-  if (info-&gt;strip != strip_all || info-&gt;relocateable)
+  if (info-&gt;strip != strip_all || info-&gt;relocateable
+      || info-&gt;emitrelocations)
     {
       elfsym.st_value = 0;
       elfsym.st_size = 0;
@@ -3655,7 +3658,9 @@
      symbols have no names.  We store the index of each one in the
      index field of the section, so that we can find it again when
      outputting relocs.  */
-  if (info-&gt;strip != strip_all || info-&gt;relocateable)
+  if (info-&gt;strip != strip_all || info-&gt;relocateable
+      || (info-&gt;emitrelocations &amp;&amp; !(elf_elfheader (abfd)-&gt;e_type == ET_IRX
+				     &amp;&amp; info-&gt;strip == strip_all)))
     {
       elfsym.st_size = 0;
       elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
@@ -4700,7 +4705,7 @@
 				     finfo-&gt;sections))
 	    return false;
 
-	  if (finfo-&gt;info-&gt;relocateable)
+	  if (finfo-&gt;info-&gt;relocateable || finfo-&gt;info-&gt;emitrelocations)
 	    {
 	      Elf_Internal_Rela *irela;
 	      Elf_Internal_Rela *irelaend;
@@ -4721,7 +4726,11 @@
 		  asection *sec;
 
 		  irela-&gt;r_offset += o-&gt;output_offset;
-
+		  
+		  /* Relocs in an executable have to be virtual addresses.  */
+		  if (finfo-&gt;info-&gt;emitrelocations)
+		    irela-&gt;r_offset += o-&gt;output_section-&gt;vma;
+		  
 		  r_symndx = ELF_R_SYM (irela-&gt;r_info);
 
 		  if (r_symndx == 0)
@@ -4751,9 +4760,18 @@
 			 elf_link_output_extsym that this symbol is
 			 used by a reloc.  */
 		      BFD_ASSERT (rh-&gt;indx &lt; 0);
-		      rh-&gt;indx = -2;
-
-		      *rel_hash = rh;
+		      if (elf_elfheader (output_bfd)-&gt;e_type != ET_IRX
+			  || finfo-&gt;info-&gt;strip != strip_all)
+			{
+			  rh-&gt;indx = -2;
+			  *rel_hash = rh;
+			}
+		      else
+			{
+			  irela-&gt;r_info = 
+			    ELF_R_INFO (0, ELF_R_TYPE (irela-&gt;r_info));
+			  *rel_hash = NULL;
+			}
 
 		      continue;
 		    }
@@ -4783,7 +4801,8 @@
 		      else
 			{
 			  r_symndx = sec-&gt;output_section-&gt;target_index;
-			  BFD_ASSERT (r_symndx != 0);
+			  /* r_symndx is zero in stripped IRX files.  */
+			  /* BFD_ASSERT (r_symndx != 0); */
 			}
 		    }
 		  else
diff -urN orig.binutils-2.9.1/binutils/ChangeLog binutils-2.9.1/binutils/ChangeLog
--- orig.binutils-2.9.1/binutils/ChangeLog	1998-05-01 12:49:30.000000000 -0300
+++ binutils-2.9.1/binutils/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,19 @@
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* addr2line.c (usage): Updated bug reporting info.
+	* ar.c (usage): Likewise.
+	* binutils.texi: Likewise.
+	* nlmconv.c (show_usage): Likewise.
+	* nm.c (usage): Likewise.
+	* objcopy.c (copy_usage, strip_usage): Likewise.
+	* objdump.c (usage): Likewise.
+	* size.c (usage): Likewise.
+	* strings.c (usage): Likewise.
+	* windres.c (usage): Likewise.
+	
+	* configure.in: Set version number to 2.9.1-ps2dev.
+	* configure: Rebuild.
+	
 Mon Apr 27 13:45:26 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* configure.in: Set version number to 2.9.1.
diff -urN orig.binutils-2.9.1/binutils/addr2line.c binutils-2.9.1/binutils/addr2line.c
--- orig.binutils-2.9.1/binutils/addr2line.c	1998-05-01 12:49:30.000000000 -0300
+++ binutils-2.9.1/binutils/addr2line.c	2004-01-30 12:21:27.000000000 -0400
@@ -80,7 +80,7 @@
 	   program_name);
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/ar.c binutils-2.9.1/binutils/ar.c
--- orig.binutils-2.9.1/binutils/ar.c	1998-05-01 12:49:30.000000000 -0300
+++ binutils-2.9.1/binutils/ar.c	2004-01-30 12:21:27.000000000 -0400
@@ -235,7 +235,7 @@
   list_supported_targets (program_name, stderr);
 
   if (help)
-    fprintf (s, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (s, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
 
   xexit (help ? 0 : 1);
 }
diff -urN orig.binutils-2.9.1/binutils/binutils.info-1 binutils-2.9.1/binutils/binutils.info-1
--- orig.binutils-2.9.1/binutils/binutils.info-1	1998-05-01 12:59:45.000000000 -0300
+++ binutils-2.9.1/binutils/binutils.info-1	2004-01-30 12:21:27.000000000 -0400
@@ -30,7 +30,7 @@
 ************
 
    This brief manual contains preliminary documentation for the GNU
-binary utilities (collectively version 2.9.1):
+binary utilities (collectively version 2.9.1-ps2dev):
 
 * Menu:
 
diff -urN orig.binutils-2.9.1/binutils/binutils.info-2 binutils-2.9.1/binutils/binutils.info-2
--- orig.binutils-2.9.1/binutils/binutils.info-2	1998-05-01 12:59:45.000000000 -0300
+++ binutils-2.9.1/binutils/binutils.info-2	2004-01-30 12:21:27.000000000 -0400
@@ -631,7 +631,7 @@
 individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
 
    In any event, we also recommend that you send bug reports for the
-binary utilities to `bug-gnu-utils@gnu.org'.
+binary utilities to `ps2dev-bugs@lists.sourceforge.net'.
 
    The fundamental principle of reporting bugs usefully is this:
 *report all the facts*.  If you are not sure whether to state a fact or
diff -urN orig.binutils-2.9.1/binutils/binutils.texi binutils-2.9.1/binutils/binutils.texi
--- orig.binutils-2.9.1/binutils/binutils.texi	1998-05-01 12:49:31.000000000 -0300
+++ binutils-2.9.1/binutils/binutils.texi	2004-01-30 12:21:27.000000000 -0400
@@ -2317,7 +2317,7 @@
 distribution.
 
 In any event, we also recommend that you send bug reports for the binary
-utilities to @samp{bug-gnu-utils@@gnu.org}.
+utilities to @samp{ps2dev-bugs@@lists.sourceforge.net}.
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
diff -urN orig.binutils-2.9.1/binutils/config.texi binutils-2.9.1/binutils/config.texi
--- orig.binutils-2.9.1/binutils/config.texi	1998-05-01 12:59:43.000000000 -0300
+++ binutils-2.9.1/binutils/config.texi	2004-01-30 12:21:27.000000000 -0400
@@ -1 +1 @@
-@set VERSION 2.9.1
+@set VERSION 2.9.1-ps2dev
diff -urN orig.binutils-2.9.1/binutils/configure binutils-2.9.1/binutils/configure
--- orig.binutils-2.9.1/binutils/configure	1998-05-01 12:49:31.000000000 -0300
+++ binutils-2.9.1/binutils/configure	2004-01-30 12:21:27.000000000 -0400
@@ -798,7 +798,7 @@
 
 PACKAGE=binutils
 
-VERSION=2.9.1
+VERSION=2.9.1-ps2dev
 
 if test "`cd $srcdir &amp;&amp; pwd`" != "`pwd`" &amp;&amp; test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1&gt;&amp;2; exit 1; }
diff -urN orig.binutils-2.9.1/binutils/configure.in binutils-2.9.1/binutils/configure.in
--- orig.binutils-2.9.1/binutils/configure.in	1998-05-01 12:49:32.000000000 -0300
+++ binutils-2.9.1/binutils/configure.in	2004-01-30 12:21:27.000000000 -0400
@@ -5,7 +5,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(binutils, 2.9.1)
+AM_INIT_AUTOMAKE(binutils, 2.9.1-ps2dev)
 
 AM_PROG_LIBTOOL
 
diff -urN orig.binutils-2.9.1/binutils/nlmconv.c binutils-2.9.1/binutils/nlmconv.c
--- orig.binutils-2.9.1/binutils/nlmconv.c	1998-05-01 12:49:34.000000000 -0300
+++ binutils-2.9.1/binutils/nlmconv.c	2004-01-30 12:21:27.000000000 -0400
@@ -1132,7 +1132,7 @@
        [in-file [out-file]]\n",
 	   program_name);
   if (status == 0)
-    fprintf (file, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (file, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/nm.c binutils-2.9.1/binutils/nm.c
--- orig.binutils-2.9.1/binutils/nm.c	1998-05-01 12:49:34.000000000 -0300
+++ binutils-2.9.1/binutils/nm.c	2004-01-30 12:21:27.000000000 -0400
@@ -299,7 +299,7 @@
 	   program_name);
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/objcopy.c binutils-2.9.1/binutils/objcopy.c
--- orig.binutils-2.9.1/binutils/objcopy.c	1998-05-01 12:49:34.000000000 -0300
+++ binutils-2.9.1/binutils/objcopy.c	2004-01-30 12:21:27.000000000 -0400
@@ -309,7 +309,7 @@
        [--verbose] [--version] [--help] in-file [out-file]\n");
   list_supported_targets (program_name, stream);
   if (exit_status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (exit_status);
 }
 
@@ -328,7 +328,7 @@
 	   program_name);
   list_supported_targets (program_name, stream);
   if (exit_status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (exit_status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/objdump.c binutils-2.9.1/binutils/objdump.c
--- orig.binutils-2.9.1/binutils/objdump.c	1998-05-01 12:49:34.000000000 -0300
+++ binutils-2.9.1/binutils/objdump.c	2004-01-30 12:21:27.000000000 -0400
@@ -233,7 +233,7 @@
 at least one option besides -l (--line-numbers) must be given\n");
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/size.c binutils-2.9.1/binutils/size.c
--- orig.binutils-2.9.1/binutils/size.c	1998-05-01 12:49:36.000000000 -0300
+++ binutils-2.9.1/binutils/size.c	2004-01-30 12:21:27.000000000 -0400
@@ -85,7 +85,7 @@
 #endif
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/binutils/strings.c binutils-2.9.1/binutils/strings.c
--- orig.binutils-2.9.1/binutils/strings.c	1998-05-01 12:49:36.000000000 -0300
+++ binutils-2.9.1/binutils/strings.c	2004-01-30 12:21:27.000000000 -0400
@@ -503,6 +503,6 @@
 	   program_name);
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
diff -urN orig.binutils-2.9.1/binutils/windres.c binutils-2.9.1/binutils/windres.c
--- orig.binutils-2.9.1/binutils/windres.c	1998-05-01 12:49:36.000000000 -0300
+++ binutils-2.9.1/binutils/windres.c	2004-01-30 12:21:27.000000000 -0400
@@ -824,7 +824,7 @@
 No input-file is stdin, default rc.  No output-file is stdout, default rc.\n");
   list_supported_targets (program_name, stream);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/config.sub binutils-2.9.1/config.sub
--- orig.binutils-2.9.1/config.sub	1998-05-01 12:48:46.000000000 -0300
+++ binutils-2.9.1/config.sub	2004-01-30 12:21:27.000000000 -0400
@@ -209,6 +209,10 @@
 	d10v)				# CYGNUS LOCAL meissner/d10v
 		basic_machine=$basic_machine-unknown
 		;;
+	iop)
+		basic_machine=mipsel-scei
+		os=-irx
+		;;
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -933,7 +937,7 @@
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -uxpv*)
+	      | -mingw32* | -linux-gnu* | -uxpv* | -irx* )
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	# CYGNUS LOCAL
diff -urN orig.binutils-2.9.1/gas/ChangeLog binutils-2.9.1/gas/ChangeLog
--- orig.binutils-2.9.1/gas/ChangeLog	1998-05-01 12:45:02.000000000 -0300
+++ binutils-2.9.1/gas/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,18 @@
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* README: Updated bug reporting info.
+	* doc/as.texinfo: Likewise.
+	* as.c (show_usage): Likewise.
+	* gasp.c (show_usage): Likewise.
+	
+	* configure.in: Set version number to 2.9.1-ps2dev.
+	* configure: Rebuild.
+	
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* configure.in (mips-*-irx*): New target.
+	* configure: Regenerate.
+
 Mon Apr 27 13:45:04 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* configure.in: Set version number to 2.9.1.
diff -urN orig.binutils-2.9.1/gas/README binutils-2.9.1/gas/README
--- orig.binutils-2.9.1/gas/README	1998-05-01 12:45:03.000000000 -0300
+++ binutils-2.9.1/gas/README	2004-01-30 12:21:27.000000000 -0400
@@ -227,10 +227,7 @@
 REPORTING BUGS IN GAS
 =====================
 
-Bugs in gas should be reported to bug-gnu-utils@gnu.org.  They may be
-cross-posted to bug-gcc if they affect the use of gas with gcc.  They
-should not be reported just to bug-gcc, since I don't read that list,
-and therefore wouldn't see them.
+Bugs in gas should be reported to ps2dev-bugs@lists.sourceforge.net.
 
 If you report a bug in GAS, please remember to include:
 
diff -urN orig.binutils-2.9.1/gas/as.c binutils-2.9.1/gas/as.c
--- orig.binutils-2.9.1/gas/as.c	1998-05-01 12:45:05.000000000 -0300
+++ binutils-2.9.1/gas/as.c	2004-01-30 12:21:27.000000000 -0400
@@ -180,7 +180,7 @@
 
   md_show_usage (stream);
 
-  fprintf (stream, "\nReport bugs to bug-gnu-utils@gnu.org\n");
+  fprintf (stream, "\nReport bugs to ps2dev-bugs@lists.sourceforge.net\n");
 }
 
 #ifdef USE_EMULATIONS
diff -urN orig.binutils-2.9.1/gas/config/tc-mips.c binutils-2.9.1/gas/config/tc-mips.c
--- orig.binutils-2.9.1/gas/config/tc-mips.c	1998-05-01 12:44:43.000000000 -0300
+++ binutils-2.9.1/gas/config/tc-mips.c	2004-01-30 12:21:30.000000000 -0400
@@ -1082,7 +1082,8 @@
 	   running program can access it.  However, we don't load it
 	   if we are configured for an embedded target */
 	flags = SEC_READONLY | SEC_DATA;
-	if (strcmp (TARGET_OS, "elf") != 0)
+	if (strcmp (TARGET_OS, "elf") != 0
+	    &amp;&amp; strcmp (TARGET_VENDOR, "scei") != 0 )
 	  flags |= SEC_ALLOC | SEC_LOAD;
 
 	if (! mips_64)
@@ -7132,7 +7133,52 @@
 		    goto notreg;
 		  else
 		    {
-		      if (s[1] == 'f' &amp;&amp; s[2] == 'p')
+                      int __is_alias = 0;
+                      #define CHECK_ALIAS(x, n) \
+                      if (!__is_alias) \
+                        { \
+                          const char __alias[] = #x, * __p; \
+                          int __i; \
+                          for (__p = __alias, __i = 1; *__p &amp;&amp; (s[__i] == *__p); __p++, __i++); \
+                          if (!*__p) \
+                            { \
+                              s += __i; \
+                              regno = n; \
+                              __is_alias = 1; \
+                            } \
+                        }
+                      CHECK_ALIAS(zr,  0);
+                      CHECK_ALIAS(v0,  2);
+                      CHECK_ALIAS(v1,  3);
+                      CHECK_ALIAS(a0,  4);
+                      CHECK_ALIAS(a1,  5);
+                      CHECK_ALIAS(a2,  6);
+                      CHECK_ALIAS(a3,  7);
+                      CHECK_ALIAS(t0,  8);
+                      CHECK_ALIAS(t1,  9);
+                      CHECK_ALIAS(t2, 10);
+                      CHECK_ALIAS(t3, 11);
+                      CHECK_ALIAS(t4, 12);
+                      CHECK_ALIAS(t5, 13);
+                      CHECK_ALIAS(t6, 14);
+                      CHECK_ALIAS(t7, 15);
+                      CHECK_ALIAS(s0, 16);
+                      CHECK_ALIAS(s1, 17);
+                      CHECK_ALIAS(s2, 18);
+                      CHECK_ALIAS(s3, 19);
+                      CHECK_ALIAS(s4, 20);
+                      CHECK_ALIAS(s5, 21);
+                      CHECK_ALIAS(s6, 22);
+                      CHECK_ALIAS(s7, 23);
+                      CHECK_ALIAS(t8, 24);
+                      CHECK_ALIAS(t9, 25);
+                      CHECK_ALIAS(k0, 26);
+                      CHECK_ALIAS(k1, 27);
+		      CHECK_ALIAS(ra, 31);
+                      if (__is_alias)
+                        {
+                        }
+                      else if (s[1] == 'f' &amp;&amp; s[2] == 'p')
 			{
 			  s += 3;
 			  regno = FP;
diff -urN orig.binutils-2.9.1/gas/configure binutils-2.9.1/gas/configure
--- orig.binutils-2.9.1/gas/configure	1998-05-01 12:45:07.000000000 -0300
+++ binutils-2.9.1/gas/configure	2004-01-30 12:21:27.000000000 -0400
@@ -800,7 +800,7 @@
 
 PACKAGE=gas
 
-VERSION=2.9.1
+VERSION=2.9.1-ps2dev
 
 if test "`cd $srcdir &amp;&amp; pwd`" != "`pwd`" &amp;&amp; test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1&gt;&amp;2; exit 1; }
@@ -1556,6 +1556,7 @@
       mips-*-irix6*)	    fmt=elf ;;
       mips-*-irix5*)        fmt=elf ;;
       mips-*-irix*)         fmt=ecoff ;;
+      mips-*-irx*)          fmt=elf endian=little ;;
       mips-*-lnews*)        fmt=ecoff em=lnews ;;
       mips-*-riscos*)       fmt=ecoff ;;
       mips-*-sysv*)         fmt=ecoff ;;
diff -urN orig.binutils-2.9.1/gas/configure.in binutils-2.9.1/gas/configure.in
--- orig.binutils-2.9.1/gas/configure.in	1998-05-01 12:45:07.000000000 -0300
+++ binutils-2.9.1/gas/configure.in	2004-01-30 12:21:27.000000000 -0400
@@ -10,7 +10,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(gas, 2.9.1)
+AM_INIT_AUTOMAKE(gas, 2.9.1-ps2dev)
 
 AM_PROG_LIBTOOL
 
@@ -227,6 +227,7 @@
       mips-*-irix6*)	    fmt=elf ;;
       mips-*-irix5*)        fmt=elf ;;
       mips-*-irix*)         fmt=ecoff ;;
+      mips-*-irx*)          fmt=elf endian=little ;;
       mips-*-lnews*)        fmt=ecoff em=lnews ;;
       mips-*-riscos*)       fmt=ecoff ;;
       mips-*-sysv*)         fmt=ecoff ;;
diff -urN orig.binutils-2.9.1/gas/doc/as.info-6 binutils-2.9.1/gas/doc/as.info-6
--- orig.binutils-2.9.1/gas/doc/as.info-6	1998-05-01 12:45:01.000000000 -0300
+++ binutils-2.9.1/gas/doc/as.info-6	2004-01-30 12:21:27.000000000 -0400
@@ -818,7 +818,7 @@
 individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
 
    In any event, we also recommend that you send bug reports for `as'
-to `bug-gnu-utils@gnu.org'.
+to `ps2dev-bugs@lists.sourceforge.net'.
 
    The fundamental principle of reporting bugs usefully is this:
 *report all the facts*.  If you are not sure whether to state a fact or
diff -urN orig.binutils-2.9.1/gas/doc/as.texinfo binutils-2.9.1/gas/doc/as.texinfo
--- orig.binutils-2.9.1/gas/doc/as.texinfo	1998-05-01 12:44:56.000000000 -0300
+++ binutils-2.9.1/gas/doc/as.texinfo	2004-01-30 12:21:27.000000000 -0400
@@ -4949,7 +4949,7 @@
 distribution.
 
 In any event, we also recommend that you send bug reports for @code{@value{AS}}
-to @samp{bug-gnu-utils@@gnu.org}.
+to @samp{ps2dev-bugs@lists.sourceforge.net}.
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
diff -urN orig.binutils-2.9.1/gas/gasp.c binutils-2.9.1/gas/gasp.c
--- orig.binutils-2.9.1/gas/gasp.c	1998-05-01 12:45:11.000000000 -0300
+++ binutils-2.9.1/gas/gasp.c	2004-01-30 12:21:27.000000000 -0400
@@ -3579,7 +3579,7 @@
   [-Ipath]                        add to include path list\n\
   [in-file]\n");
   if (status == 0)
-    printf ("\nReport bugs to bug-gnu-utils@gnu.org\n");
+    printf ("\nReport bugs to ps2dev-bugs@lists.sourceforge.net\n");
   exit (status);
 }
 
diff -urN orig.binutils-2.9.1/gprof/ChangeLog binutils-2.9.1/gprof/ChangeLog
--- orig.binutils-2.9.1/gprof/ChangeLog	1998-05-01 12:49:41.000000000 -0300
+++ binutils-2.9.1/gprof/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,9 @@
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* configure.in: Set version number to 2.9.1-ps2dev.
+	* configure: Rebuild.
+	* gprof.c (usage): Updated bug reporting info.
+	
 Mon Apr 27 13:45:35 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* configure.in: Set version number to 2.9.1.
diff -urN orig.binutils-2.9.1/gprof/configure binutils-2.9.1/gprof/configure
--- orig.binutils-2.9.1/gprof/configure	1998-05-01 12:49:42.000000000 -0300
+++ binutils-2.9.1/gprof/configure	2004-01-30 12:21:27.000000000 -0400
@@ -794,7 +794,7 @@
 
 PACKAGE=gprof
 
-VERSION=2.9.1
+VERSION=2.9.1-ps2dev
 
 if test "`cd $srcdir &amp;&amp; pwd`" != "`pwd`" &amp;&amp; test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1&gt;&amp;2; exit 1; }
diff -urN orig.binutils-2.9.1/gprof/configure.in binutils-2.9.1/gprof/configure.in
--- orig.binutils-2.9.1/gprof/configure.in	1998-05-01 12:49:42.000000000 -0300
+++ binutils-2.9.1/gprof/configure.in	2004-01-30 12:21:27.000000000 -0400
@@ -4,7 +4,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(gprof, 2.9.1)
+AM_INIT_AUTOMAKE(gprof, 2.9.1-ps2dev)
 
 AM_PROG_LIBTOOL
 
diff -urN orig.binutils-2.9.1/gprof/gprof.c binutils-2.9.1/gprof/gprof.c
--- orig.binutils-2.9.1/gprof/gprof.c	1998-05-01 12:49:43.000000000 -0300
+++ binutils-2.9.1/gprof/gprof.c	2004-01-30 12:21:27.000000000 -0400
@@ -157,7 +157,7 @@
 	[image-file] [profile-file...]\n",
 	   whoami);
   if (status == 0)
-    fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+    fprintf (stream, "Report bugs to ps2dev-bugs@lists.sourceforge.net\n");
   done (status);
 }
 
diff -urN orig.binutils-2.9.1/include/ChangeLog binutils-2.9.1/include/ChangeLog
--- orig.binutils-2.9.1/include/ChangeLog	1998-05-01 12:48:22.000000000 -0300
+++ binutils-2.9.1/include/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,10 @@
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	Backported from changes made on 2000-05-17 by
+	S. Bharadwaj Yadavalli  &lt;sby@scrugs.lkg.dec.com&gt; and
+	Rick Gorton             &lt;gorton@scrugs.lkg.dec.com&gt;
+	* bfdlink.h (struct bfd_link_info): Add emitrelocations flag.
+
 Tue Feb 24 13:05:02 1998  Doug Evans  &lt;devans@canuck.cygnus.com&gt;
 
 	* dis-asm.h (disassemble_info): Member `symbol' renamed to `symbols'
diff -urN orig.binutils-2.9.1/include/bfdlink.h binutils-2.9.1/include/bfdlink.h
--- orig.binutils-2.9.1/include/bfdlink.h	1998-05-01 12:48:22.000000000 -0300
+++ binutils-2.9.1/include/bfdlink.h	2004-01-30 12:21:27.000000000 -0400
@@ -179,6 +179,9 @@
   const struct bfd_link_callbacks *callbacks;
   /* true if BFD should generate a relocateable object file.  */
   boolean relocateable;
+  /* true if BFD should generate relocation information in the final
+     executable.  */
+  boolean emitrelocations;
   /* true if BFD should generate a "task linked" object file,
      similar to relocatable but also with globals converted to statics. */
   boolean task_link;
diff -urN orig.binutils-2.9.1/include/elf/ChangeLog binutils-2.9.1/include/elf/ChangeLog
--- orig.binutils-2.9.1/include/elf/ChangeLog	1998-05-01 12:48:24.000000000 -0300
+++ binutils-2.9.1/include/elf/ChangeLog	2004-01-30 12:21:27.000000000 -0400
@@ -1,3 +1,8 @@
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+	
+	* common.h (ET_IRX): New macro.
+	* mips.h (SHT_MIPS_IOPMOD, PT_MIPS_IRXHDR): New macros.
+
 Sat Feb 28 17:04:41 1998  Richard Henderson  &lt;rth@cygnus.com&gt;
 
 	* alpha.h (EF_ALPHA_32BIT, EF_ALPHA_CANRELAX): New.
diff -urN orig.binutils-2.9.1/include/elf/common.h binutils-2.9.1/include/elf/common.h
--- orig.binutils-2.9.1/include/elf/common.h	1998-05-01 12:48:24.000000000 -0300
+++ binutils-2.9.1/include/elf/common.h	2004-01-30 12:21:27.000000000 -0400
@@ -67,6 +67,7 @@
 #define ET_DYN		3		/* Shared object file */
 #define ET_CORE		4		/* Core file */
 #define ET_LOPROC	0xFF00		/* Processor-specific */
+#define ET_IRX          0xFF80          /* IRX file for PlayStation 2's IOP */
 #define ET_HIPROC	0xFFFF		/* Processor-specific */
 
 /* Values for e_machine, which identifies the architecture */
diff -urN orig.binutils-2.9.1/include/elf/mips.h binutils-2.9.1/include/elf/mips.h
--- orig.binutils-2.9.1/include/elf/mips.h	1998-05-01 12:48:24.000000000 -0300
+++ binutils-2.9.1/include/elf/mips.h	2004-01-30 12:21:27.000000000 -0400
@@ -124,6 +124,9 @@
 /* Events section.  */
 #define SHT_MIPS_EVENTS		0x70000021
 
+/* .iopmod section for IRXs */
+#define SHT_MIPS_IOPMOD         0x70000080
+
 /* A section of type SHT_MIPS_LIBLIST contains an array of the
    following structure.  The sh_link field is the section index of the
    string table.  The sh_info field is the number of entries in the
@@ -253,6 +256,9 @@
 
 /* Runtime procedure table.  */
 #define PT_MIPS_RTPROC		0x70000001
+
+/* IRX header */
+#define PT_MIPS_IRXHDR          0x70000080      
 
 /* Processor specific dynamic array tags.  */
 
diff -urN orig.binutils-2.9.1/ld/ChangeLog binutils-2.9.1/ld/ChangeLog
--- orig.binutils-2.9.1/ld/ChangeLog	1998-05-01 12:48:47.000000000 -0300
+++ binutils-2.9.1/ld/ChangeLog	2004-01-30 12:21:28.000000000 -0400
@@ -1,3 +1,37 @@
+2002-06-15  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* scripttempl/irx.sc: Broke multiple line shell parameter
+	expansions into single line expansions.
+	
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* lexsup.c (help): Updated bug reporting info.
+	* ld.texinfo: Likewise.
+	
+	* configure.in: Set version number to 2.9.1-ps2dev.
+	* configure: Rebuild.
+	
+2002-04-20  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* scripttempl/irx.sc: Don't create a .iopmod section when RELOCATING.
+	
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* Makefile.am (emipsirx.c): New target.
+	(ALL_EMULATIONS): Added emipsirx.o.
+	* Makefile.in: Rebuild.
+	* configure.tgt (mips*el-*-irx*): New target.
+	* emulparams/mipsirx.em: New file.
+	* emultempl/irx.em: New file.
+	* scripttempl/irx.sc: New file.
+
+	Backported from changes made on 2000-05-17 by
+	S. Bharadwaj Yadavalli  &lt;sby@scrugs.lkg.dec.com&gt; and
+	Rick Gorton             &lt;gorton@scrugs.lkg.dec.com&gt;
+	Add support for '-q' == '--emit-relocs' switch.
+	* ldmain.c (main): Default to false.
+	* lexsup.c (parse_args): Turn on emitrelocations flag if set.
+	
 Mon Apr 27 11:56:21 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* configure.in: Set version number to 2.9.1.
diff -urN orig.binutils-2.9.1/ld/Makefile.am binutils-2.9.1/ld/Makefile.am
--- orig.binutils-2.9.1/ld/Makefile.am	1998-05-01 12:48:47.000000000 -0300
+++ binutils-2.9.1/ld/Makefile.am	2004-01-30 12:21:28.000000000 -0400
@@ -154,6 +154,7 @@
 	emipsbsd.o \
 	emipsidt.o \
 	emipsidtl.o \
+	emipsirx.o \
 	emipslit.o \
 	emipslnews.o \
 	enews.o \
@@ -436,6 +437,9 @@
 emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
+emipsirx.c: $(srcdir)/emulparams/mipsirx.sh \
+  $(srcdir)/emultempl/irx.em $(srcdir)/scripttempl/mipsirx.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} mipsirx "$(tdir_mipsirx)"
 emipslit.c:  $(srcdir)/emulparams/mipslit.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} mipslit "$(tdir_mipslit)"
diff -urN orig.binutils-2.9.1/ld/Makefile.in binutils-2.9.1/ld/Makefile.in
--- orig.binutils-2.9.1/ld/Makefile.in	1998-05-01 12:48:47.000000000 -0300
+++ binutils-2.9.1/ld/Makefile.in	2004-01-30 12:21:28.000000000 -0400
@@ -230,6 +230,7 @@
 	emipsbsd.o \
 	emipsidt.o \
 	emipsidtl.o \
+	emipsirx.o \
 	emipslit.o \
 	emipslnews.o \
 	enews.o \
@@ -946,6 +947,9 @@
 emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
+emipsirx.c: $(srcdir)/emulparams/mipsirx.sh \
+  $(srcdir)/emultempl/irx.em $(srcdir)/scripttempl/irx.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} mipsirx "$(tdir_mipsirx)"
 emipslit.c:  $(srcdir)/emulparams/mipslit.sh \
   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} mipslit "$(tdir_mipslit)"
diff -urN orig.binutils-2.9.1/ld/configure binutils-2.9.1/ld/configure
--- orig.binutils-2.9.1/ld/configure	1998-05-01 12:48:48.000000000 -0300
+++ binutils-2.9.1/ld/configure	2004-01-30 12:21:28.000000000 -0400
@@ -798,7 +798,7 @@
 
 PACKAGE=ld
 
-VERSION=2.9.1
+VERSION=2.9.1-ps2dev
 
 if test "`cd $srcdir &amp;&amp; pwd`" != "`pwd`" &amp;&amp; test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1&gt;&amp;2; exit 1; }
diff -urN orig.binutils-2.9.1/ld/configure.in binutils-2.9.1/ld/configure.in
--- orig.binutils-2.9.1/ld/configure.in	1998-05-01 12:48:48.000000000 -0300
+++ binutils-2.9.1/ld/configure.in	2004-01-30 12:21:28.000000000 -0400
@@ -5,7 +5,7 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(ld, 2.9.1)
+AM_INIT_AUTOMAKE(ld, 2.9.1-ps2dev)
 
 AM_PROG_LIBTOOL
 
diff -urN orig.binutils-2.9.1/ld/configure.tgt binutils-2.9.1/ld/configure.tgt
--- orig.binutils-2.9.1/ld/configure.tgt	1998-05-01 12:48:48.000000000 -0300
+++ binutils-2.9.1/ld/configure.tgt	2004-01-30 12:21:28.000000000 -0400
@@ -157,6 +157,9 @@
 mips*vr5000-*-elf*)	targ_emul=elf32b4300 ;;
 mips*el-*-elf*)		targ_emul=elf32elmip ;;
 mips*-*-elf*)		targ_emul=elf32ebmip ;;
+mips*el-*-irx*)		targ_emul=mipsirx
+			targ_extra_emuls=elf32elmip
+			;;
 mips*-*-rtems*)		targ_emul=elf32ebmip ;;
 mips*el-*-linux-gnu*)	targ_emul=elf32lsmip
 			targ_extra_emuls="elf32bsmip mipslit mipsbig"
diff -urN orig.binutils-2.9.1/ld/emulparams/mipsirx.sh binutils-2.9.1/ld/emulparams/mipsirx.sh
--- orig.binutils-2.9.1/ld/emulparams/mipsirx.sh	1969-12-31 20:00:00.000000000 -0400
+++ binutils-2.9.1/ld/emulparams/mipsirx.sh	2004-01-30 12:21:28.000000000 -0400
@@ -0,0 +1,8 @@
+SCRIPT_NAME=irx
+OUTPUT_FORMAT="elf32-littlemips"
+ARCH=mips
+ENTRY=_start
+TEXT_START_ADDR=0x0
+DATA_ADDR=.
+TEMPLATE_NAME=irx
+
diff -urN orig.binutils-2.9.1/ld/emultempl/irx.em binutils-2.9.1/ld/emultempl/irx.em
--- orig.binutils-2.9.1/ld/emultempl/irx.em	1969-12-31 20:00:00.000000000 -0400
+++ binutils-2.9.1/ld/emultempl/irx.em	2004-01-30 12:21:28.000000000 -0400
@@ -0,0 +1,541 @@
+# This shell script emits a C file. -*- C -*-
+# It does some substitutions.
+cat &gt;e${EMULATION_NAME}.c &lt;&lt;EOF
+/* This file is is generated by a shell script.  DO NOT EDIT! */
+
+/* IRX emulation code for ${EMULATION_NAME}
+   Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+   Written by Steve Chamberlain steve@cygnus.com
+   IRX support by Douglas C. Knight fsdck@uaf.edu
+
+This file is part of GLD, the Gnu Linker.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#define TARGET_IS_${EMULATION_NAME}
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "bfdlink.h"
+#include "elf/common.h"
+#include "elf/mips.h"
+#include "elf-bfd.h"
+#undef NAME
+
+#include "ld.h"
+#include "ldmain.h"
+#include "ldemul.h"
+#include "ldfile.h"
+#include "ldgram.h"
+#include "ldmisc.h"
+#include "ldexp.h"
+#include "ldlang.h"
+
+static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
+static void gld${EMULATION_NAME}_after_parse PARAMS ((void));
+static void gld${EMULATION_NAME}_after_open PARAMS ((void));
+static void gld${EMULATION_NAME}_before_allocation PARAMS ((void));
+static void gld${EMULATION_NAME}_after_allocation PARAMS ((void));
+static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
+
+static boolean building_irx;
+static lang_output_section_statement_type *iopmod_section_statement;
+
+static struct lang_output_section_phdr_list default_phdr = {
+  name: " DEFAULT",
+  next: NULL,
+  used: false
+};
+static struct lang_output_section_phdr_list irxhdr_phdr = {
+  name: " IRXHDR",
+  next: NULL,
+  used: false
+};
+static struct lang_output_section_phdr_list none_phdr = {
+  name: "NONE",
+  next: NULL,
+  used: false
+};
+
+
+/* This is called just before parsing the linker script.  It does some
+   bfd configuration for irx filex, creates the irx program header,
+   and adds an .iopmod output section to the statement list.  */
+
+static void
+gld${EMULATION_NAME}_before_parse (void)
+{
+  ldfile_set_output_arch ("`echo ${ARCH}`");
+
+  /* Only setup IRX headers for executable files.  */
+  if (link_info.relocateable)
+    {
+      building_irx = false;
+      return;
+    }
+  
+  building_irx = true;
+  /* IRX files are dynamic.  They need their relocations.  */
+  link_info.emitrelocations = true;
+  /* This isn't really needed, but I've never seen an IRX that's
+     properly paged.  */
+  config.magic_demand_paged = false;
+  
+  /* The IRXHDR program header must be the first in the list of
+     program headers.  By creating it here, before processing the
+     linker script, it is always at the beginning of the list.  */
+  lang_new_phdr (irxhdr_phdr.name, exp_intop (PT_MIPS_IRXHDR), false,
+		 false, NULL, exp_intop (PF_R));
+
+  /* An .iopmod output section will be needed.  By creating the
+     .iopmod section before parsing the linker script, the iopmod
+     section statement will be placed at the top of the statement list
+     after the *ABS* section, but before any other sections from the
+     linker script.  The statements from the linker script can then be
+     accessed through iopmod_section_statement-&gt;next.  */
+  iopmod_section_statement = lang_output_section_statement_lookup (".iopmod");
+}
+
+
+/* gldmipsirx_after_parse () is executed after the linker script has
+   been parsed.  It puts the .iopmod output section into the IRXHDR
+   segment.  If the linker script did not create any program headers
+   of its own, this function also creates a PT_LOAD segment and puts
+   all of the remaining sections in it.  */
+
+static void
+gld${EMULATION_NAME}_after_parse (void)
+{
+  boolean linkscript_uses_phdrs;
+  lang_statement_union_type *stat;
+
+  /* Only setup IRX headers for executable files.  */
+  if (building_irx == false)
+    return;
+
+  /* Determine whether the link script assigned any sections to phdrs.  */
+
+  /* FIXME: If none of the sections have been explicitly assigned to a
+     segment, this function assumes that the linker script did not
+     create any program headers.  This function should not put the
+     sections in a new PT_LOAD segment if the linker script, for some
+     odd reason, created program headers but did not assign any of the
+     sections to any segments.  There is currently no way to tell
+     whether the linker script created any program headers because the
+     program header list is a static variable.  If there ever is any
+     reason to create program headers, but have all of the sections
+     remain segmentless, explicitly assign the first section in the
+     linker script to the section "NONE". */
+
+  linkscript_uses_phdrs = false;
+  for (stat = iopmod_section_statement-&gt;next; stat != NULL;
+       stat = stat-&gt;next)
+    if (stat-&gt;header.type == lang_output_section_statement_enum)
+      if (stat-&gt;output_section_statement.phdrs != NULL)
+	{
+	  linkscript_uses_phdrs = true;
+	  break;
+	}
+
+  if (! linkscript_uses_phdrs)
+    {
+      /* The linker script didn't use program headers, so build the
+         default segment and put all of the sections in it.  */
+      lang_new_phdr (default_phdr.name, exp_intop (PT_LOAD), false,
+		     false, NULL, exp_intop (PF_R | PF_W | PF_X));
+      for (stat = iopmod_section_statement-&gt;next; stat != NULL;
+	   stat = stat-&gt;next)
+	if (stat-&gt;header.type == lang_output_section_statement_enum)
+	    stat-&gt;output_section_statement.phdrs = &amp;default_phdr;
+    }
+
+  /* Add iopmod to the IRXHDR segment.  */
+  irxhdr_phdr.next = iopmod_section_statement-&gt;phdrs;
+  iopmod_section_statement-&gt;phdrs = &amp;irxhdr_phdr;
+
+  /* Keep IRXHDR from following through to following sections.  */
+  for (stat = iopmod_section_statement-&gt;next; stat != NULL;
+       stat = stat-&gt;next)
+    if (stat-&gt;header.type == lang_output_section_statement_enum)
+      {
+	if (! stat-&gt;output_section_statement.phdrs)
+	  {
+	    if (irxhdr_phdr.next)
+	      stat-&gt;output_section_statement.phdrs = irxhdr_phdr.next;
+	    else
+	      stat-&gt;output_section_statement.phdrs = &amp;none_phdr;
+	  }
+	break;
+      }
+}
+
+/* This is a macro to add a data statement of data type T and the data
+   expression E to the end of the statement list LP.  */
+
+#define new_data_stat(t,e,lp) {                         \
+  lang_statement_union_type *d;                         \
+  d = stat_alloc (sizeof (lang_data_statement_type));   \
+  d-&gt;header.type = lang_data_statement_enum;            \
+  d-&gt;header.next = NULL;                                \
+  ((lang_data_statement_type *) d)-&gt;exp = e;            \
+  ((lang_data_statement_type *) d)-&gt;type = t;           \
+  lang_statement_append (lp, d, &amp;d-&gt;header.next);       \
+}
+
+/* Called after input files have been opened, and their symbols
+   parsed.  If the .iopmod section is empty, construct a valid .iopmod
+   structure.  If _irx_id is defined, it is used as the id structure to
+   for this irx.  */
+
+static void
+gld${EMULATION_NAME}_after_open (void)
+{
+  lang_statement_list_type *stat_ptr;
+  union lang_statement_union *stat_list_remainder;
+  union lang_statement_union **stat_list_old_tail;
+  struct bfd_link_hash_entry *h;  
+  bfd_vma irxname_pos;
+  asection *irxname_sec;
+  bfd_vma irxid_pos;
+  asection *irxid_sec;
+  int irx_version;
+  char buf[64];
+  boolean result;
+  unsigned uit;
+  asymbol **syms;
+  arelent **rels;
+  long size;
+  long count;
+
+  /* Only setup IRX headers for executable files.  */
+  if (building_irx == false)
+    return;
+  
+  /* If the linker script didn't already start the .iopmod section,
+     build the basics now.  */
+  stat_ptr = &amp;iopmod_section_statement-&gt;children;
+  if (stat_ptr-&gt;head == NULL)
+    {
+      new_data_stat (LONG, exp_intop (0xffffffff), stat_ptr);
+      new_data_stat (LONG, exp_unop (ABSOLUTE, exp_nameop (NAME, "_start")),
+		 stat_ptr);
+      new_data_stat (LONG, exp_nameop (NAME, "_gp"), stat_ptr);
+      new_data_stat (LONG, exp_nameop (NAME, "_text_size"), stat_ptr);
+      new_data_stat (LONG, exp_nameop (NAME, "_data_size"), stat_ptr);
+      new_data_stat (LONG, exp_nameop (NAME, "_bss_size"), stat_ptr);
+      stat_list_old_tail = NULL;
+    }
+  else
+    {
+      /* If the linker script built an .iopmod section, make sure the
+         first six data statments are LONGS, and that the first LONG
+         is set to the int 0xffffffff.  If not, assume the linker
+         script knows what it's doing, and leave everything alone.  */
+      union lang_statement_union *stat_iter;
+      stat_iter = stat_ptr-&gt;head;
+      /* Make sure the first satement is a LONG data statement with
+         the value 0xffffffff.  */
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG
+	  || stat_iter-&gt;data_statement.exp-&gt;type.node_class != etree_value
+	  || stat_iter-&gt;data_statement.exp-&gt;type.node_code != INT
+	  || stat_iter-&gt;data_statement.exp-&gt;value.value != 0xffffffff)
+	return;
+
+      /* Make sure the next five statements are LONG data statements.  */
+      stat_iter = stat_iter-&gt;next;
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG)
+	return;
+      stat_iter = stat_iter-&gt;next;
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG)
+	return;
+      stat_iter = stat_iter-&gt;next;
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG)
+	return;
+      stat_iter = stat_iter-&gt;next;
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG)
+	return;
+      stat_iter = stat_iter-&gt;next;
+      if (stat_iter-&gt;header.type != lang_data_statement_enum
+	  || stat_iter-&gt;data_statement.type != LONG)
+	return;
+      
+      /* Cut the statement list off after the six LONGs, so that new
+         data can be inserted.  */
+      stat_list_old_tail = stat_ptr-&gt;tail;
+      stat_ptr-&gt;tail = &amp;stat_iter-&gt;next;
+      stat_list_remainder = stat_iter-&gt;next;
+    }
+
+  /* Look for an _irx_id symbol.  */
+  h = bfd_link_hash_lookup (link_info.hash, "_irx_id", false, false, true);
+  if (h != NULL)
+    if (h-&gt;type != bfd_link_hash_defined &amp;&amp; h-&gt;type != bfd_link_hash_defweak)
+      h = NULL;
+
+  /* If _irx_id is undefined.  Set the IRX version to 0.0 and name to
+     an empty string.  */
+  if (h == NULL)
+    {
+      new_data_stat (SHORT, exp_intop (0x0), stat_ptr);
+      new_data_stat (BYTE, exp_intop (0x0), stat_ptr);
+      goto eout;
+    }
+
+  /* Retrieve the contents of _irx_id.  */
+  irxid_pos = h-&gt;u.def.value;
+  irxid_sec = h-&gt;u.def.section;
+  result = bfd_get_section_contents (irxid_sec-&gt;owner,
+				     irxid_sec, buf,
+				     irxid_pos, 8);
+  if (! result)
+    {
+      einfo ("%F%P: could not read the contents of _irx_id from %E\n",
+	     irxid_sec-&gt;owner);
+      goto eout;
+    }
+
+  /* Extract the version number, and a pointer to the irx name.  */
+  irxname_pos = bfd_get_32 (irxid_sec-&gt;owner, &amp;buf[0]);
+  irx_version = bfd_get_16 (irxid_sec-&gt;owner, &amp;buf[4]);
+
+  /* Things get really ugly here.  The contents of the symbol table
+     and relocations are already in memory in the bfd's elf backend,
+     after calling the canonicalize functions there are two copies in
+     memory, one in the backends own format, and one in bfd's standard
+     format.  This could be a waste of memory, but we need to follow
+     the relocations, and digging through the backend's data would be
+     even uglier.  */
+
+  /* Canonicalize the symbol table for the bfd contaning _irx_id.  */
+  size = bfd_get_symtab_upper_bound (irxid_sec-&gt;owner);
+  if (size &lt; 0)
+    {
+      einfo ("%F%P: could not read symbols from %E\n", irxid_sec-&gt;owner);
+      goto eout;
+    }
+  syms = xmalloc (size);
+  count = bfd_canonicalize_symtab (irxid_sec-&gt;owner, syms);
+  if (count &lt; 0)
+    {
+      einfo ("%F%P: could not read symbols from %E\n",
+	     irxid_sec-&gt;owner);
+      goto eout;
+    }
+  
+  /* Canonicalize the relocations for the section containing _irx_id.  */
+  size = bfd_get_reloc_upper_bound (irxid_sec-&gt;owner, irxid_sec);
+  if (size &lt; 0)
+    {
+      einfo ("%F%P: could not read relocations from %E\n", irxid_sec-&gt;owner);
+      free (syms);
+      goto eout;
+    }
+  rels = xmalloc (size);
+  count = bfd_canonicalize_reloc (irxid_sec-&gt;owner, irxid_sec, rels, syms);
+  if (count &lt; 0)
+    {
+      einfo ("%F%P: could not read relocations from %E\n", irxid_sec-&gt;owner);
+      free (syms);
+      goto eout;
+    }
+
+  /* Find the relocation for the irx name pointer in _irx_id, and
+     extract the section that the irx name is stored in from it.  */
+  irxname_sec = NULL;
+  for (uit = 0; uit &lt; count; ++uit)
+    {
+      arelent *r;
+      r = rels[uit];
+      if (r-&gt;address == irxid_pos)
+	{
+	  if ((*r-&gt;sym_ptr_ptr)-&gt;flags &amp; (BSF_OBJECT | BSF_FUNCTION
+					  | BSF_SECTION_SYM))
+	    irxname_sec = (*r-&gt;sym_ptr_ptr)-&gt;section;
+	  else
+	    {
+	      /* The irx name is not in the same bfd, but we know what
+		 the symbol is called now, so we can look for it in
+		 the other bfds.  */
+	      h = bfd_link_hash_lookup (link_info.hash,
+					(*r-&gt;sym_ptr_ptr)-&gt;name, false,
+					false, true);
+	      if (h != NULL)
+		{
+		  irxname_pos = h-&gt;u.def.value;
+		  irxname_sec = h-&gt;u.def.section;
+		}
+	    }
+	}
+    }
+
+  /* Release what little memory we can.  */
+  free (rels);
+  free (syms);
+  
+  if (irxname_sec == NULL)
+    {
+      einfo ("%F%P: failed to resolve the irx name\n");
+      goto eout;
+    }
+
+  /* Retrieve up to 63 bytes of the the contents of the irx name.  */
+  count = irxname_sec-&gt;_raw_size;
+  count -= irxname_pos;
+  if (count &gt; 63)
+    count = 63;
+  buf[count] = 0;
+  result = bfd_get_section_contents (irxname_sec-&gt;owner,
+				     irxname_sec, buf,
+				     irxname_pos, count);
+  if (! result)
+    {
+      einfo ("%F%P: failed to resolve the irx name\n");
+      goto eout;
+    }
+
+  /* Set the first LONG in the .iopmod section to the address of the
+     _irx_id structure.  */
+  stat_ptr-&gt;head-&gt;data_statement.exp =
+    exp_unop (ABSOLUTE, exp_nameop (NAME, "_irx_id"));
+  /* Add the version number to the header.  */
+  new_data_stat (SHORT, exp_intop (irx_version), stat_ptr);
+  /* Add each byte of the IRX name to the header.  FIXME: If the name
+     is long and the linker script already has a lot of statements in
+     it, the linker could run out of space in the parse tree.  This
+     data could be added to the linker script as LONGs, and a SHORT,
+     and/or a BYTE to save tree nodes.  */
+  for (uit = 0; (uit &lt; 64) &amp;&amp; (buf[uit] != 0); ++uit)
+    new_data_stat (BYTE, exp_intop ((unsigned int) buf[uit]), stat_ptr);
+  /* Tack a null on to the end of the string.  */
+  new_data_stat (BYTE, exp_intop (0x0), stat_ptr);
+
+ eout:
+  /* Put anything that was cut off the end of the .iopmod section back
+     on.  */
+  if (stat_list_old_tail != NULL)
+    {
+      *stat_ptr-&gt;tail = stat_list_remainder;
+      stat_ptr-&gt;tail = stat_list_old_tail;
+    }
+  return;
+}
+
+/* Called before creating the output sections in the output bfd.
+   Since the .iopmod section's data is completely generated, it
+   doesn't have any alignment attributes associated with it.  Force
+   the iopmod section to be word aligned.  */
+
+static void
+gld${EMULATION_NAME}_before_allocation (void)
+{
+  /* Only setup IRX headers for executable files.  */
+  if (building_irx == false)
+    return;
+
+  if (iopmod_section_statement-&gt;bfd_section-&gt;alignment_power &lt; 2)
+    iopmod_section_statement-&gt;bfd_section-&gt;alignment_power = 2;
+}
+
+/* Called after the output sections have been created.  Makes the
+   .iopmod section exist in the file image, but not in the memory
+   image by marking it as a loaded section, but not allocated.  */
+
+static void
+gld${EMULATION_NAME}_after_allocation (void)
+{
+  /* Only setup IRX headers for executable files.  */
+  if (building_irx == false)
+    return;
+
+  iopmod_section_statement-&gt;bfd_section-&gt;flags |= SEC_LOAD;
+  iopmod_section_statement-&gt;bfd_section-&gt;flags &amp;= ~SEC_ALLOC;
+}
+
+static char *
+gld${EMULATION_NAME}_get_script(isfile)
+     int *isfile;
+EOF
+
+if test -n "$COMPILE_IN"
+then
+# Scripts compiled in.
+
+# sed commands to quote an ld script as a C string.
+sc="-f ${srcdir}/emultempl/stringify.sed"
+
+cat &gt;&gt;e${EMULATION_NAME}.c &lt;&lt;EOF
+{			     
+  *isfile = 0;
+
+  if (link_info.relocateable == true &amp;&amp; config.build_constructors == true)
+    return
+EOF
+sed $sc ldscripts/${EMULATION_NAME}.xu               &gt;&gt; e${EMULATION_NAME}.c
+echo '  ; else if (link_info.relocateable == true) return'\
+                                                     &gt;&gt; e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xr               &gt;&gt; e${EMULATION_NAME}.c
+echo '  ; else if (!config.text_read_only) return'   &gt;&gt; e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xbn              &gt;&gt; e${EMULATION_NAME}.c
+echo '  ; else if (!config.magic_demand_paged) return'&gt;&gt;e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.xn               &gt;&gt; e${EMULATION_NAME}.c
+echo '  ; else return'                               &gt;&gt; e${EMULATION_NAME}.c
+sed $sc ldscripts/${EMULATION_NAME}.x                &gt;&gt; e${EMULATION_NAME}.c
+echo '; }'                                           &gt;&gt; e${EMULATION_NAME}.c
+
+else
+# Scripts read from the filesystem.
+
+cat &gt;&gt;e${EMULATION_NAME}.c &lt;&lt;EOF
+{			     
+  *isfile = 1;
+
+  if (link_info.relocateable == true &amp;&amp; config.build_constructors == true)
+    return "ldscripts/${EMULATION_NAME}.xu";
+  else if (link_info.relocateable == true)
+    return "ldscripts/${EMULATION_NAME}.xr";
+  else if (!config.text_read_only)
+    return "ldscripts/${EMULATION_NAME}.xbn";
+  else if (!config.magic_demand_paged)
+    return "ldscripts/${EMULATION_NAME}.xn";
+  else
+    return "ldscripts/${EMULATION_NAME}.x";
+}
+EOF
+
+fi
+
+cat &gt;&gt;e${EMULATION_NAME}.c &lt;&lt;EOF
+
+struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = 
+{
+  gld${EMULATION_NAME}_before_parse,
+  syslib_default,
+  hll_default,
+  gld${EMULATION_NAME}_after_parse,
+  gld${EMULATION_NAME}_after_open,
+  gld${EMULATION_NAME}_after_allocation,
+  set_output_arch_default,
+  ldemul_default_target,
+  gld${EMULATION_NAME}_before_allocation,
+  gld${EMULATION_NAME}_get_script,
+  "${EMULATION_NAME}",
+  "${OUTPUT_FORMAT}"
+};
+EOF
diff -urN orig.binutils-2.9.1/ld/ld.info-3 binutils-2.9.1/ld/ld.info-3
--- orig.binutils-2.9.1/ld/ld.info-3	1998-05-01 12:49:27.000000000 -0300
+++ binutils-2.9.1/ld/ld.info-3	2004-01-30 12:21:28.000000000 -0400
@@ -500,7 +500,7 @@
 individuals in the file `etc/SERVICE' in the GNU Emacs distribution.
 
    In any event, we also recommend that you send bug reports for `ld'
-to `bug-gnu-utils@gnu.org'.
+to `ps2dev-bugs@lists.sourceforge.net'.
 
    The fundamental principle of reporting bugs usefully is this:
 *report all the facts*.  If you are not sure whether to state a fact or
diff -urN orig.binutils-2.9.1/ld/ld.texinfo binutils-2.9.1/ld/ld.texinfo
--- orig.binutils-2.9.1/ld/ld.texinfo	1998-05-01 12:48:48.000000000 -0300
+++ binutils-2.9.1/ld/ld.texinfo	2004-01-30 12:21:28.000000000 -0400
@@ -3394,7 +3394,7 @@
 distribution.
 
 In any event, we also recommend that you send bug reports for @code{ld}
-to @samp{bug-gnu-utils@@gnu.org}.
+to @samp{ps2dev-bugs@@lists.sourceforge.net}.
 
 The fundamental principle of reporting bugs usefully is this:
 @strong{report all the facts}.  If you are not sure whether to state a
diff -urN orig.binutils-2.9.1/ld/ldmain.c binutils-2.9.1/ld/ldmain.c
--- orig.binutils-2.9.1/ld/ldmain.c	1998-05-01 12:48:49.000000000 -0300
+++ binutils-2.9.1/ld/ldmain.c	2004-01-30 12:21:28.000000000 -0400
@@ -195,6 +195,7 @@
 
   link_info.callbacks = &amp;link_callbacks;
   link_info.relocateable = false;
+  link_info.emitrelocations = false;
   link_info.shared = false;
   link_info.symbolic = false;
   link_info.static_link = false;
diff -urN orig.binutils-2.9.1/ld/lexsup.c binutils-2.9.1/ld/lexsup.c
--- orig.binutils-2.9.1/ld/lexsup.c	1998-05-01 12:48:49.000000000 -0300
+++ binutils-2.9.1/ld/lexsup.c	2004-01-30 12:21:28.000000000 -0400
@@ -185,6 +185,8 @@
       'o', "FILE", "Set output file name", TWO_DASHES },
   { {NULL, required_argument, NULL, '\0'},
       'O', NULL, "Ignored", ONE_DASH },
+  { {"emit-relocs", no_argument, NULL, 'q'},
+      'q', NULL, "Generate relocations in final output", TWO_DASHES },
   { {"relocateable", no_argument, NULL, 'r'},
       'r', NULL, "Generate relocateable output", TWO_DASHES },
   { {NULL, no_argument, NULL, '\0'},
@@ -603,6 +605,9 @@
 	case OPTION_OFORMAT:
 	  lang_add_output_format (optarg, (char *) NULL, (char *) NULL, 0);
 	  break;
+	case 'q':
+	  link_info.emitrelocations = true;
+          break;
 	case 'i':
 	case 'r':
 	  link_info.relocateable = true;
@@ -978,5 +983,5 @@
   printf ("%s: supported emulations: ", program_name);
   ldemul_list_emulations (stdout);
   printf ("\n");
-  printf ("\nReport bugs to bug-gnu-utils@gnu.org\n");
+  printf ("\nReport bugs to ps2dev-bugs@lists.sourceforge.net\n");
 }
diff -urN orig.binutils-2.9.1/ld/scripttempl/irx.sc binutils-2.9.1/ld/scripttempl/irx.sc
--- orig.binutils-2.9.1/ld/scripttempl/irx.sc	1969-12-31 20:00:00.000000000 -0400
+++ binutils-2.9.1/ld/scripttempl/irx.sc	2004-01-30 12:21:28.000000000 -0400
@@ -0,0 +1,117 @@
+# Link scripts for PlayStation 2 IRXs.
+
+# NOTE: Limit parameter expansions to a single line.  Cygwin's /bin/sh has
+# been freaking out when it reaches the end of a line, even when the text is
+# being quoted.
+
+test -z "$ENTRY" &amp;&amp; ENTRY=_start
+
+test -z "$TEXT_START_ADDR" &amp;&amp; TEXT_START_ADDR="0x0000"
+
+if test "x$LD_FLAG" = "xn" -o "x$LD_FLAG" = "xN"; then
+  DATA_ADDR=.
+else
+  test -z "$DATA_ADDR" &amp;&amp; DATA_ADDR=0x10000000
+fi
+
+# These variables are used to put braces in parameter expansions so that
+# they expand properly.
+LBRACE="{"
+RBRACE="}"
+
+cat &lt;&lt;EOF
+/* Link script for PlayStation 2 IRXs
+ * Written by Douglas C. Knight &lt;fsdck@uaf.edu&gt;
+ */
+
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+
+ENTRY(${ENTRY})
+SECTIONS
+{
+  ${RELOCATING+/* This is the .iopmod section for the IRX, it contains}
+  ${RELOCATING+   information that the IOP uses when loading the IRX.}
+  ${RELOCATING+   This section is placed in its own segment.  */}
+  ${RELOCATING+.iopmod : ${LBRACE}}
+  ${RELOCATING+  /* The linker will replace this first LONG with a pointer}
+  ${RELOCATING+     to _irx_id if the symbol has been defined.  */}
+  ${RELOCATING+  LONG (0xffffffff) ;}
+ 
+  ${RELOCATING+  LONG (_start) ;}
+  ${RELOCATING+  LONG (_gp) ;}
+  ${RELOCATING+  LONG (_text_size) ;}
+  ${RELOCATING+  LONG (_data_size) ;}
+  ${RELOCATING+  LONG (_bss_size) ;}
+  ${RELOCATING+  /* The linker will put a SHORT here with the version of}
+  ${RELOCATING+     the IRX (or zero if there is no version).  */}
+  ${RELOCATING+  /* The linker will put a null terminated string here}
+  ${RELOCATING+     containing the name of the IRX (or an empty string if}
+  ${RELOCATING+     the name is not known).  */}
+  ${RELOCATING+${RBRACE}}
+
+  ${RELOCATING+. = ${TEXT_START_ADDR} ;}
+  ${RELOCATING+_ftext = . ;}
+  .text : {
+    CREATE_OBJECT_SYMBOLS
+    * ( .text )
+    * ( .text.* )
+    * ( .init )
+    * ( .fini )
+  } = 0
+  ${RELOCATING+_etext  =  . ;}
+
+  ${RELOCATING+. = ${DATA_ADDR} ;}
+  ${RELOCATING+_fdata = . ;}
+  .rodata : {
+    * ( .rdata )
+    * ( .rodata )
+    * ( .rodata1 )
+    * ( .rodata.* )
+  } = 0
+
+  .data : {
+    * ( .data )
+    * ( .data1 )
+    * ( .data.* )
+    ${CONSTRUCTING+CONSTRUCTORS}
+  }
+
+  ${RELOCATING+. = ALIGN(16) ;}
+  ${RELOCATING+_gp = . + 0x8000 ;}
+
+  .sdata : {
+    * ( .lit8 )
+    * ( .lit4 )
+    * ( .sdata )
+    * ( .sdata.* )
+  }
+  ${RELOCATING+_edata = . ;}
+
+  ${RELOCATING+. = ALIGN(4) ;}
+  ${RELOCATING+_fbss = . ;}
+  .sbss : {
+    * ( .sbss )
+    * ( .scommon )
+  }
+
+  ${RELOCATING+_bss_start = . ;}
+  .bss : {
+    * ( .bss )
+    * ( COMMON )
+    ${RELOCATING+. = ALIGN(4) ;}
+  }
+  ${RELOCATING+_end = . ;}
+
+  ${RELOCATING+_text_size = _etext - _ftext ;}
+  ${RELOCATING+_data_size = _edata - _fdata ;}
+  ${RELOCATING+_bss_size = _end - _fbss ;}
+
+  /* This is the stuff that we don't want to be put in an IRX.  */
+  /DISCARD/ : {
+	* ( .reginfo )
+  }
+}
+
+EOF
diff -urN orig.binutils-2.9.1/ld/testsuite/ChangeLog binutils-2.9.1/ld/testsuite/ChangeLog
--- orig.binutils-2.9.1/ld/testsuite/ChangeLog	1998-05-01 12:49:00.000000000 -0300
+++ binutils-2.9.1/ld/testsuite/ChangeLog	2004-01-30 12:21:28.000000000 -0400
@@ -1,3 +1,7 @@
+2002-04-13  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* ld-scripts/phdrs.exp: Also run test for *-*-irx* targets.
+
 Tue Apr  7 12:50:17 1998  Manfred Hollstein  &lt;manfred@s-direktnet.de&gt;
 
 	* ld-cdtest/cdtest-foo.h (class Foo): Declare len to be static to
diff -urN orig.binutils-2.9.1/ld/testsuite/ld-scripts/phdrs.exp binutils-2.9.1/ld/testsuite/ld-scripts/phdrs.exp
--- orig.binutils-2.9.1/ld/testsuite/ld-scripts/phdrs.exp	1998-05-01 12:49:11.000000000 -0300
+++ binutils-2.9.1/ld/testsuite/ld-scripts/phdrs.exp	2004-01-30 12:21:28.000000000 -0400
@@ -8,6 +8,7 @@
      &amp;&amp; ![istarget *-*-linux*] \
      &amp;&amp; ![istarget *-*-irix5*] \
      &amp;&amp; ![istarget *-*-irix6*] \
+     &amp;&amp; ![istarget *-*-irx*] \
      &amp;&amp; ![istarget *-*-solaris2*] } {
     return
 }
diff -urN orig.binutils-2.9.1/libiberty/ChangeLog binutils-2.9.1/libiberty/ChangeLog
--- orig.binutils-2.9.1/libiberty/ChangeLog	1998-05-01 12:47:47.000000000 -0300
+++ binutils-2.9.1/libiberty/ChangeLog	2004-01-30 12:21:28.000000000 -0400
@@ -1,3 +1,11 @@
+2002-07-16  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* config/mh-cygwin32.h: Defined ERRORS_LDFLAGS.
+	
+2002-04-21  Douglas C. Knight  &lt;fsdck@uaf.edu&gt;
+
+	* README: Updated bug reporting info.
+	
 Mon Feb 23 14:33:15 1998  Ian Lance Taylor  &lt;ian@cygnus.com&gt;
 
 	* choose-temp.c: Fix handling of sys/file.h to work in libiberty.
diff -urN orig.binutils-2.9.1/libiberty/README binutils-2.9.1/libiberty/README
--- orig.binutils-2.9.1/libiberty/README	1998-05-01 12:47:48.000000000 -0300
+++ binutils-2.9.1/libiberty/README	2004-01-30 12:21:28.000000000 -0400
@@ -15,7 +15,8 @@
 try to run configure in this directory.  Follow the configuration
 instructions in ../README.
 
-Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu".  Thank you.
+Please report bugs and fixes to "ps2dev-bugs@lists.sourceforge.net".
+Thank you.
 
 ADDING A NEW FILE
 =================
diff -urN orig.binutils-2.9.1/libiberty/config/mh-cygwin32 binutils-2.9.1/libiberty/config/mh-cygwin32
--- orig.binutils-2.9.1/libiberty/config/mh-cygwin32	1998-05-01 12:47:46.000000000 -0300
+++ binutils-2.9.1/libiberty/config/mh-cygwin32	2004-01-30 12:21:28.000000000 -0400
@@ -1,2 +1,5 @@
 HDEFINES=-DNEED_sys_siglist -DNEED_basename -DNEED_strsignal
 EXTRA_OFILES=random.o
+# Cygwin's compiler prints warnings/info about importing from DLLs
+# which confuse needed.awk.  This option suppresses those warnings.
+ERRORS_LDFLAGS=-Wl,--enable-auto-import
diff -urN orig.binutils-2.9.1/libiberty/functions.def binutils-2.9.1/libiberty/functions.def
--- orig.binutils-2.9.1/libiberty/functions.def	1998-05-01 12:47:51.000000000 -0300
+++ binutils-2.9.1/libiberty/functions.def	2004-01-30 12:21:30.000000000 -0400
@@ -35,15 +35,15 @@
 DEF(strchr, char*, (s, c), CONST char *s AND int c)
 DEF(strdup, char*, (s1), char * s1)
 DEF(strrchr, char*, (s, c), CONST char *s AND int c)
-DEF(strstr, char*, (), NOTHING)
+DEF(strstr, char*, (h, n), CONST char *h AND CONST char *n)
 DEF(strtod, double, (), NOTHING)
 DEF(strtol, long, (), NOTHING)
 DEF(strtoul, unsigned long, (), NOTHING)
 DEF(tmpnam, char *, (s), char * s)
 DEF(vfork, int, (), NOTHING)
 DEF(vfprintf, int, (), NOTHING)
-DEF(vprintf, int, (), NOTHING)
-DEF(vsprintf, int, (), NOTHING)
+DEF(vprintf, int, (f), CONST char *f)
+DEF(vsprintf, int, (s, f), CONST char *s AND CONST char *f)
 DEF(sigsetmask, int, (), NOTHING)
 DEF(alloca, PTR, (size), size_t size)
 DEF(waitpid, int, (pid, statp, opts), int pid AND int* statp AND int opts )
@@ -55,8 +55,8 @@
    second arg is how to declare the variable, and the third is how to
    use it. */
 
-DEFVAR(sys_nerr, int sys_nerr, sys_nerr = 0)
-DEFVAR(sys_errlist, char *sys_errlist[], sys_errlist[0] = 0)
+/* DEFVAR(sys_nerr, int sys_nerr, sys_nerr = 0)
+DEFVAR(sys_errlist, char *sys_errlist[], sys_errlist[0] = 0) */
 DEFVAR(sys_siglist, char *sys_siglist[], sys_siglist[0] = 0)
 
 /* List of global functions that we want to look for in the host
diff -urN orig.binutils-2.9.1/ps2ver binutils-2.9.1/ps2ver
--- orig.binutils-2.9.1/ps2ver	1969-12-31 20:00:00.000000000 -0400
+++ binutils-2.9.1/ps2ver	2004-01-30 12:21:28.000000000 -0400
@@ -0,0 +1 @@
+20020804
</pre></body></html>