[packages/binutils] upstream fix for crash in 2.38 when building openjdk on i686; rel 2
atler
atler at pld-linux.org
Wed Feb 16 00:21:29 CET 2022
commit ba5fa713466890bb5a0f6fb1e08f8dc49c625301
Author: Jan Palus <atler at pld-linux.org>
Date: Wed Feb 16 00:19:23 2022 +0100
upstream fix for crash in 2.38 when building openjdk on i686; rel 2
binutils.spec | 4 ++-
x86_crash.patch | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 1 deletion(-)
---
diff --git a/binutils.spec b/binutils.spec
index d0dfb25..5392b5b 100644
--- a/binutils.spec
+++ b/binutils.spec
@@ -28,7 +28,7 @@ Summary(tr.UTF-8): GNU geliştirme araçları
Summary(uk.UTF-8): Набір інструментів GNU для побудови виконуваних програм
Name: binutils
Version: 2.38
-Release: 1
+Release: 2
Epoch: 4
License: GPL v3+
Group: Development/Tools
@@ -46,6 +46,7 @@ Patch7: %{name}-libtool-m.patch
Patch9: %{name}-tooldir.patch
Patch10: %{name}-sanity-check.patch
Patch11: binutils-CVE-2019-1010204.patch
+Patch12: x86_crash.patch
URL: http://www.sourceware.org/binutils/
BuildRequires: autoconf >= 2.69
BuildRequires: automake >= 1:1.11
@@ -173,6 +174,7 @@ niektórych pakietów.
%patch9 -p1
%patch10 -p1
%patch11 -p1
+%patch12 -p1
# file contains hacks for ac 2.69 only
%{__rm} config/override.m4
diff --git a/x86_crash.patch b/x86_crash.patch
new file mode 100644
index 0000000..469243f
--- /dev/null
+++ b/x86_crash.patch
@@ -0,0 +1,79 @@
+From ae1cab7d3f39686d9c7ddadbac297e9ae76ffccf Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools at gmail.com>
+Date: Tue, 15 Feb 2022 15:03:02 -0800
+Subject: [PATCH] i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL
+
+Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation
+in read-only section.
+
+bfd/
+
+ PR ld/28894
+ * elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow
+ R_386_TLS_IE.
+
+ld/
+ PR ld/28894
+ * testsuite/ld-i386/i386.exp: Run pr28894.
+ * testsuite/ld-i386/pr28894.d: New file.
+ * testsuite/ld-i386/pr28894.s: Likewise.
+
+(cherry picked from commit 3319ba7a8d6a42ba071d691789bc184632399331)
+---
+ bfd/elfxx-x86.h | 1 +
+ ld/testsuite/ld-i386/i386.exp | 1 +
+ ld/testsuite/ld-i386/pr28894.d | 3 +++
+ ld/testsuite/ld-i386/pr28894.s | 7 +++++++
+ 4 files changed, 12 insertions(+)
+ create mode 100644 ld/testsuite/ld-i386/pr28894.d
+ create mode 100644 ld/testsuite/ld-i386/pr28894.s
+
+diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
+index 3219f363a9a..77fb1ad72bc 100644
+--- a/bfd/elfxx-x86.h
++++ b/bfd/elfxx-x86.h
+@@ -80,6 +80,7 @@
+ #define I386_NEED_DYNAMIC_RELOC_TYPE_P(TYPE) \
+ (I386_SIZE_TYPE_P (TYPE) \
+ || I386_RELATIVE_RELOC_TYPE_P (TYPE) \
++ || (TYPE) == R_386_TLS_IE \
+ || (TYPE) == R_386_TLS_LE \
+ || (TYPE) == R_386_TLS_LE_32)
+ #define X86_NEED_DYNAMIC_RELOC_TYPE_P(IS_X86_64, TYPE) \
+diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
+index d997c757325..fadbd160420 100644
+--- a/ld/testsuite/ld-i386/i386.exp
++++ b/ld/testsuite/ld-i386/i386.exp
+@@ -510,6 +510,7 @@ run_dump_test "pr27491-4"
+ run_dump_test "dt-relr-1a"
+ run_dump_test "dt-relr-1b"
+ run_dump_test "pr28870"
++run_dump_test "pr28894"
+
+ if { !([istarget "i?86-*-linux*"]
+ || [istarget "i?86-*-gnu*"]
+diff --git a/ld/testsuite/ld-i386/pr28894.d b/ld/testsuite/ld-i386/pr28894.d
+new file mode 100644
+index 00000000000..a8d1111eb1f
+--- /dev/null
++++ b/ld/testsuite/ld-i386/pr28894.d
+@@ -0,0 +1,3 @@
++#as: --32
++#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
++#error: .*warning: creating DT_TEXTREL in a shared object
+diff --git a/ld/testsuite/ld-i386/pr28894.s b/ld/testsuite/ld-i386/pr28894.s
+new file mode 100644
+index 00000000000..1d3e3f37f3e
+--- /dev/null
++++ b/ld/testsuite/ld-i386/pr28894.s
+@@ -0,0 +1,7 @@
++ .text
++ addl foo at INDNTPOFF, %eax
++ .section .tbss,"awT", at nobits
++ .globl foo
++ .hidden foo
++foo:
++ .byte 0
+--
+2.27.0
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/binutils.git/commitdiff/ba5fa713466890bb5a0f6fb1e08f8dc49c625301
More information about the pld-cvs-commit
mailing list