patches/binutils/2.15.90.0.3/binutils-20040820-duplicates.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Mar 12 18:59:31 2007 +0000 (2007-03-12)
changeset 19 d80e6dedcc13
permissions -rw-r--r--
Auto-detect Darwin (MacOS-X) and disable libintl for during build for this platform.
A bit of help tweaking.
     1 See http://sources.redhat.com/ml/binutils/2004-08/msg00256.html
     2 
     3 Date: Fri, 20 Aug 2004 21:13:43 -0400
     4 From: Daniel Jacobowitz <drow at false dot org>
     5 To: binutils at sources dot redhat dot com
     6 Subject: Re: Handle SEC_LINK_DUPLICATES_SAME_CONTENTS for arm-linux
     7 Message-ID: <20040821011342.GA30319@nevyn.them.org>
     8 Mail-Followup-To: binutils at sources dot redhat dot com
     9 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>
    10 In-Reply-To: <20040821003737 dot GB16016 at bubble dot modra dot org>
    11 
    12 On Sat, Aug 21, 2004 at 10:07:38AM +0930, Alan Modra wrote:
    13 > On Fri, Aug 20, 2004 at 01:32:40PM -0400, Daniel Jacobowitz wrote:
    14 > > Thanks.  How's this?
    15 > 
    16 > As you might have guessed from my rather slack review of your previous
    17 > patch, I trust you enough to give the OK without proper review.  But
    18 > since you asked...  :)
    19 
    20 Checked in as so.
    21 
    22 -- 
    23 Daniel Jacobowitz
    24 
    25 2004-08-20  Daniel Jacobowitz  <dan@debian.org>
    26 
    27 	* elflink.c (_bfd_elf_section_already_linked): Handle
    28 	SEC_LINK_DUPLICATES_SAME_CONTENTS.
    29 
    30 Index: elflink.c
    31 ===================================================================
    32 RCS file: /big/fsf/rsync/src-cvs/src/bfd/elflink.c,v
    33 retrieving revision 1.97
    34 diff -u -p -r1.97 elflink.c
    35 --- binutils/bfd/elflink.c	18 Aug 2004 02:45:42 -0000	1.97
    36 +++ binutils/bfd/elflink.c	21 Aug 2004 00:59:08 -0000
    37 @@ -9366,6 +9366,36 @@ _bfd_elf_section_already_linked (bfd *ab
    38  		  (_("%B: duplicate section `%A' has different size\n"),
    39  		   abfd, sec);
    40  	      break;
    41 +
    42 +	    case SEC_LINK_DUPLICATES_SAME_CONTENTS:
    43 +	      if (sec->size != l->sec->size)
    44 +		(*_bfd_error_handler)
    45 +		  (_("%B: duplicate section `%A' has different size\n"),
    46 +		   abfd, sec);
    47 +	      else if (sec->size != 0)
    48 +		{
    49 +		  bfd_byte *sec_contents, *l_sec_contents;
    50 +
    51 +		  if (!bfd_malloc_and_get_section (abfd, sec, &sec_contents))
    52 +		    (*_bfd_error_handler)
    53 +		      (_("%B: warning: could not read contents of section `%A'\n"),
    54 +		       abfd, sec);
    55 +		  else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec,
    56 +							&l_sec_contents))
    57 +		    (*_bfd_error_handler)
    58 +		      (_("%B: warning: could not read contents of section `%A'\n"),
    59 +		       l->sec->owner, l->sec);
    60 +		  else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0)
    61 +		    (*_bfd_error_handler)
    62 +		      (_("%B: warning: duplicate section `%A' has different contents\n"),
    63 +		       abfd, sec);
    64 +
    65 +		  if (sec_contents)
    66 +		    free (sec_contents);
    67 +		  if (l_sec_contents)
    68 +		    free (l_sec_contents);
    69 +		}
    70 +	      break;
    71  	    }
    72  
    73  	  /* Set the output_section field so that lang_add_section
    74