[binutils] Import fix for PR ld/12851 (BZ 711268)

Nicholas Clifton nickc at fedoraproject.org
Fri Jun 10 07:52:14 UTC 2011


commit 9a40ab20dbdc4e603cbb8bbb7fd907bea192fed0
Author: nick clifton <nickc at Gift.(none)>
Date:   Fri Jun 10 08:52:05 2011 +0100

    Import fix for PR ld/12851 (BZ 711268)

 binutils-2.21.52.0.1-keeping-notes.patch |   67 ++++++++++++++++++++++++++++++
 binutils.spec                            |    7 +++-
 2 files changed, 73 insertions(+), 1 deletions(-)
---
diff --git a/binutils-2.21.52.0.1-keeping-notes.patch b/binutils-2.21.52.0.1-keeping-notes.patch
new file mode 100644
index 0000000..656cca3
--- /dev/null
+++ b/binutils-2.21.52.0.1-keeping-notes.patch
@@ -0,0 +1,67 @@
+diff -cp ../binutils-2.21.52.0.1.orig/bfd/ChangeLog bfd/ChangeLog
+*** ../binutils-2.21.52.0.1.orig/bfd/ChangeLog	2011-06-10 08:31:15.181479004 +0100
+--- bfd/ChangeLog	2011-06-10 08:37:07.663479004 +0100
+***************
+*** 1,3 ****
+--- 1,9 ----
++ 2011-06-08  H.J. Lu  <hongjiu.lu at intel.com>
++ 
++ 	PR ld/12851
++ 	* elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here.
++ 	(bfd_elf_gc_sections): Also check SHT_NOTE sections.
++ 
+  2011-06-08  Alan Modra  <amodra at gmail.com>
+  
+  	* aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c,
+Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/doc and bfd/doc
+diff -cp ../binutils-2.21.52.0.1.orig/bfd/elflink.c bfd/elflink.c
+*** ../binutils-2.21.52.0.1.orig/bfd/elflink.c	2011-06-10 08:31:12.961479004 +0100
+--- bfd/elflink.c	2011-06-10 08:36:10.796479004 +0100
+*************** elf_gc_sweep (bfd *abfd, struct bfd_link
+*** 11818,11827 ****
+  	      o->gc_mark = first->gc_mark;
+  	    }
+  	  else if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
+! 		   || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0
+! 		   || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE)
+  	    {
+! 	      /* Keep debug, special and SHT_NOTE sections.  */
+  	      o->gc_mark = 1;
+  	    }
+  
+--- 11818,11826 ----
+  	      o->gc_mark = first->gc_mark;
+  	    }
+  	  else if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
+! 		   || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
+  	    {
+! 	      /* Keep debug and special sections.  */
+  	      o->gc_mark = 1;
+  	    }
+  
+*************** bfd_elf_gc_sections (bfd *abfd, struct b
+*** 12103,12110 ****
+        if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+  	continue;
+  
+        for (o = sub->sections; o != NULL; o = o->next)
+! 	if ((o->flags & (SEC_EXCLUDE | SEC_KEEP)) == SEC_KEEP && !o->gc_mark)
+  	  if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
+  	    return FALSE;
+      }
+--- 12102,12113 ----
+        if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+  	continue;
+  
++       /* Also keep SHT_NOTE sections.  */
+        for (o = sub->sections; o != NULL; o = o->next)
+! 	if ((o->flags & SEC_EXCLUDE) == 0
+! 	    && ((o->flags & SEC_KEEP) != 0
+! 		|| elf_section_data (o)->this_hdr.sh_type == SHT_NOTE)
+! 	    && !o->gc_mark)
+  	  if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
+  	    return FALSE;
+      }
+Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/hosts and bfd/hosts
+Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/.libs and bfd/.libs
+Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/po and bfd/po
diff --git a/binutils.spec b/binutils.spec
index 2fabf6f..11b7a9a 100644
--- a/binutils.spec
+++ b/binutils.spec
@@ -17,7 +17,7 @@
 Summary: A GNU collection of binary utilities
 Name: %{?cross}binutils%{?_with_debug:-debug}
 Version: 2.21.52.0.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv3+
 Group: Development/Tools
 URL: http://sources.redhat.com/binutils
@@ -31,6 +31,7 @@ Patch05: binutils-2.20.51.0.2-set-long-long.patch
 Patch06: binutils-2.20.51.0.10-copy-osabi.patch
 Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch
 Patch08: binutils-2.20.51.0.2-build-id.patch
+Patch09: binutils-2.21.52.0.1-keeping-notes.patch
 
 %define gold_arches %ix86 x86_64
 
@@ -129,6 +130,7 @@ using libelf instead of BFD.
 %patch06 -p0 -b .copy-osabi~
 %patch07 -p0 -b .sec-merge-emit~
 %patch08 -p0 -b .build-id~
+%patch09 -p0 -b .keeping-notes~
 
 # We cannot run autotools as there is an exact requirement of autoconf-2.59.
 
@@ -417,6 +419,9 @@ exit 0
 %endif # %{isnative}
 
 %changelog
+* Fri Jun  10 2011 Nick Clifton <nickc at redhat.com> - 2.21.52.0.1-2
+- Import fix for PR ld/12851 (BZ 711268)
+
 * Thu Jun  09 2011 Nick Clifton <nickc at redhat.com> - 2.21.52.0.1-1
 - Rebase on 2.21.52.0.1 tarball.  (BZ 712025)
 


More information about the scm-commits mailing list