[binutils/f16] Import fix for "strip -g", aka PR binutils/13180. (BZ 765782)
Nicholas Clifton
nickc at fedoraproject.org
Wed Dec 14 10:34:34 UTC 2011
commit e1dafbd78ec7a27eee9c2a8fc5a6a4e327f0dfb5
Author: Nick Clifton <nickc at redhat.com>
Date: Wed Dec 14 10:33:42 2011 +0000
Import fix for "strip -g", aka PR binutils/13180. (BZ 765782)
binutils-2.21.53.0.1-strip-g.patch | 72 ++++++++++++++++++++++++++++++++++++
binutils.spec | 7 +++-
2 files changed, 78 insertions(+), 1 deletions(-)
---
diff --git a/binutils-2.21.53.0.1-strip-g.patch b/binutils-2.21.53.0.1-strip-g.patch
new file mode 100644
index 0000000..ebd2632
--- /dev/null
+++ b/binutils-2.21.53.0.1-strip-g.patch
@@ -0,0 +1,72 @@
+*** ../binutils-2.21.53.0.1.orig/binutils/objcopy.c 2011-12-14 09:57:44.013157749 +0000
+--- binutils/objcopy.c 2011-12-14 10:13:12.380183483 +0000
+*************** is_specified_symbol (const char *name, h
+*** 901,910 ****
+ return htab_find (htab, name) != NULL;
+ }
+
+! /* See if a section is being removed. */
+
+ static bfd_boolean
+! is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
+ {
+ if (sections_removed || sections_copied)
+ {
+--- 901,910 ----
+ return htab_find (htab, name) != NULL;
+ }
+
+! /* See if a non-group section is being removed. */
+
+ static bfd_boolean
+! is_strip_section_1 (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
+ {
+ if (sections_removed || sections_copied)
+ {
+*************** is_strip_section (bfd *abfd ATTRIBUTE_UN
+*** 931,940 ****
+--- 931,952 ----
+ return FALSE;
+ }
+
++ return FALSE;
++ }
++
++ /* See if a section is being removed. */
++
++ static bfd_boolean
++ is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
++ {
++ if (is_strip_section_1 (abfd, sec))
++ return TRUE;
++
+ if ((bfd_get_section_flags (abfd, sec) & SEC_GROUP) != 0)
+ {
+ asymbol *gsym;
+ const char *gname;
++ asection *elt, *first;
+
+ /* PR binutils/3181
+ If we are going to strip the group signature symbol, then
+*************** is_strip_section (bfd *abfd ATTRIBUTE_UN
+*** 948,953 ****
+--- 960,978 ----
+ && !is_specified_symbol (gname, keep_specific_htab))
+ || is_specified_symbol (gname, strip_specific_htab))
+ return TRUE;
++
++ /* Remove the group section if all members are removed. */
++ first = elt = elf_next_in_group (sec);
++ while (elt != NULL)
++ {
++ if (!is_strip_section_1 (abfd, elt))
++ return FALSE;
++ elt = elf_next_in_group (elt);
++ if (elt == first)
++ break;
++ }
++
++ return TRUE;
+ }
+
+ return FALSE;
diff --git a/binutils.spec b/binutils.spec
index 3b7665f..96eceb4 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.53.0.1
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@@ -34,6 +34,7 @@ Patch08: binutils-2.20.51.0.2-build-id.patch
Patch09: binutils-2.21.53.0.1-debug_macro.patch
Patch10: binutils-2.21.53.0.1-ppc64-stub-size.patch
Patch11: binutils-2.21.53.0.1-demangle.patch
+Patch12: binutils-2.21.53.0.1-strip-g.patch
%define gold_arches %ix86 x86_64
@@ -135,6 +136,7 @@ using libelf instead of BFD.
%patch09 -p0 -b .debug_macro~
%patch10 -p0 -b .stub_size~
%patch11 -p0 -b .demangle~
+%patch12 -p0 -b .strip-g~
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@@ -429,6 +431,9 @@ exit 0
%endif # %{isnative}
%changelog
+* Wed Dec 14 2011 Nick Clifton <nickc at redhat.com> - 2.21.53.0.1-6
+- Import fix for "strip -g", aka PR binutils/13180. (BZ 765782)
+
* Fri Sep 30 2011 Ricky Zhou <ricky at fedoraproject.org> - 2.21.53.0.1-5
- Rebuild libopcodes.a with -fPIC. (BZ 7344315)
More information about the scm-commits
mailing list