patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,74 @@
     1.4 +See http://sources.redhat.com/ml/binutils/2004-08/msg00256.html
     1.5 +
     1.6 +Date: Fri, 20 Aug 2004 21:13:43 -0400
     1.7 +From: Daniel Jacobowitz <drow at false dot org>
     1.8 +To: binutils at sources dot redhat dot com
     1.9 +Subject: Re: Handle SEC_LINK_DUPLICATES_SAME_CONTENTS for arm-linux
    1.10 +Message-ID: <20040821011342.GA30319@nevyn.them.org>
    1.11 +Mail-Followup-To: binutils at sources dot redhat dot com
    1.12 +References: <20040818145518.GA9774@nevyn.them.org> <20040819055040.GA11820@lucon.org> <20040819080034.GE21716@bubble.modra.org> <20040820173240.GA17678@nevyn.them.org> <20040821003737.GB16016@bubble.modra.org>
    1.13 +In-Reply-To: <20040821003737 dot GB16016 at bubble dot modra dot org>
    1.14 +
    1.15 +On Sat, Aug 21, 2004 at 10:07:38AM +0930, Alan Modra wrote:
    1.16 +> On Fri, Aug 20, 2004 at 01:32:40PM -0400, Daniel Jacobowitz wrote:
    1.17 +> > Thanks.  How's this?
    1.18 +> 
    1.19 +> As you might have guessed from my rather slack review of your previous
    1.20 +> patch, I trust you enough to give the OK without proper review.  But
    1.21 +> since you asked...  :)
    1.22 +
    1.23 +Checked in as so.
    1.24 +
    1.25 +-- 
    1.26 +Daniel Jacobowitz
    1.27 +
    1.28 +2004-08-20  Daniel Jacobowitz  <dan@debian.org>
    1.29 +
    1.30 +	* elflink.c (_bfd_elf_section_already_linked): Handle
    1.31 +	SEC_LINK_DUPLICATES_SAME_CONTENTS.
    1.32 +
    1.33 +Index: elflink.c
    1.34 +===================================================================
    1.35 +RCS file: /big/fsf/rsync/src-cvs/src/bfd/elflink.c,v
    1.36 +retrieving revision 1.97
    1.37 +diff -u -p -r1.97 elflink.c
    1.38 +--- binutils/bfd/elflink.c	18 Aug 2004 02:45:42 -0000	1.97
    1.39 ++++ binutils/bfd/elflink.c	21 Aug 2004 00:59:08 -0000
    1.40 +@@ -9366,6 +9366,36 @@ _bfd_elf_section_already_linked (bfd *ab
    1.41 + 		  (_("%B: duplicate section `%A' has different size\n"),
    1.42 + 		   abfd, sec);
    1.43 + 	      break;
    1.44 ++
    1.45 ++	    case SEC_LINK_DUPLICATES_SAME_CONTENTS:
    1.46 ++	      if (sec->size != l->sec->size)
    1.47 ++		(*_bfd_error_handler)
    1.48 ++		  (_("%B: duplicate section `%A' has different size\n"),
    1.49 ++		   abfd, sec);
    1.50 ++	      else if (sec->size != 0)
    1.51 ++		{
    1.52 ++		  bfd_byte *sec_contents, *l_sec_contents;
    1.53 ++
    1.54 ++		  if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
    1.55 ++		    (*_bfd_error_handler)
    1.56 ++		      (_("%B: warning: could not read contents of section `%A'\n"),
    1.57 ++		       abfd, sec);
    1.58 ++		  else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
    1.59 ++							&l_sec_contents))
    1.60 ++		    (*_bfd_error_handler)
    1.61 ++		      (_("%B: warning: could not read contents of section `%A'\n"),
    1.62 ++		       l->sec->owner, l->sec);
    1.63 ++		  else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
    1.64 ++		    (*_bfd_error_handler)
    1.65 ++		      (_("%B: warning: duplicate section `%A' has different contents\n"),
    1.66 ++		       abfd, sec);
    1.67 ++
    1.68 ++		  if (sec_contents)
    1.69 ++		    free (sec_contents);
    1.70 ++		  if (l_sec_contents)
    1.71 ++		    free (l_sec_contents);
    1.72 ++		}
    1.73 ++	      break;
    1.74 + 	    }
    1.75 + 
    1.76 + 	  /* Set the output_section field so that lang_add_section
    1.77 +