[packages/binutils] upstream patch for elf property removal; rel 2

atler atler at pld-linux.org
Fri Jul 26 22:47:13 CEST 2019


commit 80865ef7603bdcc6a5aea670f1ca0467033149e2
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Jul 26 22:45:30 2019 +0200

    upstream patch for elf property removal; rel 2
    
    see https://sourceware.org/bugzilla/show_bug.cgi?id=24721

 binutils-elf_remove_property.patch | 170 +++++++++++++++++++++++++++++++++++++
 binutils.spec                      |   4 +-
 2 files changed, 173 insertions(+), 1 deletion(-)
---
diff --git a/binutils.spec b/binutils.spec
index 436f6ff..4060360 100644
--- a/binutils.spec
+++ b/binutils.spec
@@ -24,7 +24,7 @@ Summary(tr.UTF-8):	GNU geliştirme araçları
 Summary(uk.UTF-8):	Набір інструментів GNU для побудови виконуваних програм
 Name:		binutils
 Version:	2.32
-Release:	1
+Release:	2
 Epoch:		4
 License:	GPL v3+
 Group:		Development/Tools
@@ -48,6 +48,7 @@ Patch12:	binutils-CVE-2019-9073.patch
 Patch13:	binutils-CVE-2019-9074.patch
 Patch14:	binutils-CVE-2019-9075.patch
 Patch15:	binutils-CVE-2019-9077.patch
+Patch16:	%{name}-elf_remove_property.patch
 URL:		http://sources.redhat.com/binutils/
 BuildRequires:	autoconf >= 2.64
 BuildRequires:	automake >= 1:1.11
@@ -181,6 +182,7 @@ niektórych pakietów.
 %patch13 -p1
 %patch14 -p1
 %patch15 -p1
+%patch16 -p1
 
 # file contains hacks for ac 2.59 only
 %{__rm} config/override.m4
diff --git a/binutils-elf_remove_property.patch b/binutils-elf_remove_property.patch
new file mode 100644
index 0000000..927e5ee
--- /dev/null
+++ b/binutils-elf_remove_property.patch
@@ -0,0 +1,170 @@
+From df010caac3b33b1d38b6d67024091854c3f77c77 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools at gmail.com>
+Date: Mon, 24 Jun 2019 11:08:40 -0700
+Subject: [PATCH] elf: Remove the property after reporting its removal
+
+commit d2ef37ebd9f771d06edf1fdea37970f60b242b2d
+Author: H.J. Lu <hjl.tools at gmail.com>
+Date:   Fri Dec 7 08:30:30 2018 -0800
+
+    elf: Report property change when merging properties
+
+failed to remove the property after reporting it has been removed.  This
+patch corrects it.
+
+bfd/
+
+	PR ld/24721
+	* elf-properties.c (elf_merge_gnu_property_list): Remove the
+	property after reporting property removal.
+
+ld/
+
+	PR ld/24721
+	* testsuite/ld-x86-64/x86-64.exp: Run PR ld/24721 tests.
+	* testsuite/ld-x86-64/pr24721-x32.d: New file.
+	* testsuite/ld-x86-64/pr24721.d: Likewise.
+	* testsuite/ld-x86-64/pr24721.map: Likewise.
+	* testsuite/ld-x86-64/pr24721a.s: Likewise.
+	* testsuite/ld-x86-64/pr24721b.s: Likewise.
+
+(cherry picked from commit f93ab3a0b8039a1667a666f013cca50b03d67f9b)
+---
+ bfd/ChangeLog                        |  6 ++++++
+ bfd/elf-properties.c                 | 10 ++++------
+ ld/ChangeLog                         | 10 ++++++++++
+ ld/testsuite/ld-x86-64/pr24721-x32.d |  6 ++++++
+ ld/testsuite/ld-x86-64/pr24721.d     |  6 ++++++
+ ld/testsuite/ld-x86-64/pr24721.map   |  3 +++
+ ld/testsuite/ld-x86-64/pr24721a.s    | 34 ++++++++++++++++++++++++++++++++++
+ ld/testsuite/ld-x86-64/pr24721b.s    |  6 ++++++
+ ld/testsuite/ld-x86-64/x86-64.exp    |  2 ++
+ 9 files changed, 77 insertions(+), 6 deletions(-)
+ create mode 100644 ld/testsuite/ld-x86-64/pr24721-x32.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr24721.d
+ create mode 100644 ld/testsuite/ld-x86-64/pr24721.map
+ create mode 100644 ld/testsuite/ld-x86-64/pr24721a.s
+ create mode 100644 ld/testsuite/ld-x86-64/pr24721b.s
+
+diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
+index 5e48d75..4a9907f 100644
+--- a/bfd/elf-properties.c
++++ b/bfd/elf-properties.c
+@@ -322,12 +322,10 @@ elf_merge_gnu_property_list (struct bfd_link_info *info, bfd *first_pbfd,
+ 			 (bfd_vma) p->property.pr_type, first_pbfd, abfd);
+ 		  }
+ 	      }
+-	    else
+-	      {
+-		/* Remove this property.  */
+-		*lastp = p->next;
+-		continue;
+-	      }
++
++	    /* Remove this property.  */
++	    *lastp = p->next;
++	    continue;
+ 	  }
+ 	else if (number_p)
+ 	  {
+diff --git a/ld/testsuite/ld-x86-64/pr24721-x32.d b/ld/testsuite/ld-x86-64/pr24721-x32.d
+new file mode 100644
+index 0000000..9b067ef
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr24721-x32.d
+@@ -0,0 +1,6 @@
++#source: pr24721a.s
++#source: pr24721b.s
++#as: --x32 -mx86-used-note=no
++#ld: -r -m elf32_x86_64 -Map tmpdir/pr24721.map
++#readelf: -n
++#map: pr24721.map
+diff --git a/ld/testsuite/ld-x86-64/pr24721.d b/ld/testsuite/ld-x86-64/pr24721.d
+new file mode 100644
+index 0000000..efa88db
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr24721.d
+@@ -0,0 +1,6 @@
++#source: pr24721a.s
++#source: pr24721b.s
++#as: --64 -defsym __64_bit__=1 -mx86-used-note=no
++#ld: -r -melf_x86_64 -Map tmpdir/pr24721.map
++#readelf: -n
++#map: pr24721.map
+diff --git a/ld/testsuite/ld-x86-64/pr24721.map b/ld/testsuite/ld-x86-64/pr24721.map
+new file mode 100644
+index 0000000..9e63fff
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr24721.map
+@@ -0,0 +1,3 @@
++#...
++Removed property 0xc0000002 to merge tmpdir/pr24721a.o \(0x1\) and tmpdir/pr24721b.o \(not found\)
++#pass
+diff --git a/ld/testsuite/ld-x86-64/pr24721a.s b/ld/testsuite/ld-x86-64/pr24721a.s
+new file mode 100644
+index 0000000..b229d19
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr24721a.s
+@@ -0,0 +1,34 @@
++	.text
++	.globl foo
++	.type foo, at function
++	.p2align 4
++foo:
++	ret
++
++	.section ".note.gnu.property", "a"
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++	.long 1f - 0f		/* name length */
++	.long 5f - 2f		/* data length */
++	.long 5			/* note type */
++0:	.asciz "GNU"		/* vendor name */
++1:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++2:	.long 0xc0000002	/* pr_type.  */
++	.long 4f - 3f		/* pr_datasz.  */
++3:
++	.long 0x1
++4:
++.ifdef __64_bit__
++	.p2align 3
++.else
++	.p2align 2
++.endif
++5:
+diff --git a/ld/testsuite/ld-x86-64/pr24721b.s b/ld/testsuite/ld-x86-64/pr24721b.s
+new file mode 100644
+index 0000000..3d11691
+--- /dev/null
++++ b/ld/testsuite/ld-x86-64/pr24721b.s
+@@ -0,0 +1,6 @@
++	.text
++	.globl bar
++	.type bar, at function
++	.p2align 4
++bar:
++	ret
+diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
+index 9a76486..707ab89 100644
+--- a/ld/testsuite/ld-x86-64/x86-64.exp
++++ b/ld/testsuite/ld-x86-64/x86-64.exp
+@@ -432,6 +432,8 @@ run_dump_test "pr24458b"
+ run_dump_test "pr23854"
+ run_dump_test "pr23930"
+ run_dump_test "pr23930-x32"
++run_dump_test "pr24721"
++run_dump_test "pr24721-x32"
+ 
+ if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
+     return
+-- 
+2.9.3
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/binutils.git/commitdiff/80865ef7603bdcc6a5aea670f1ca0467033149e2



More information about the pld-cvs-commit mailing list