]> git.pld-linux.org Git - packages/binutils.git/blame - x86_crash.patch
upstream fix for crash in 2.38 when building openjdk on i686; rel 2
[packages/binutils.git] / x86_crash.patch
CommitLineData
ba5fa713
JP
1From ae1cab7d3f39686d9c7ddadbac297e9ae76ffccf Mon Sep 17 00:00:00 2001
2From: "H.J. Lu" <hjl.tools@gmail.com>
3Date: Tue, 15 Feb 2022 15:03:02 -0800
4Subject: [PATCH] i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL
5
6Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation
7in read-only section.
8
9bfd/
10
11 PR ld/28894
12 * elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow
13 R_386_TLS_IE.
14
15ld/
16 PR ld/28894
17 * testsuite/ld-i386/i386.exp: Run pr28894.
18 * testsuite/ld-i386/pr28894.d: New file.
19 * testsuite/ld-i386/pr28894.s: Likewise.
20
21(cherry picked from commit 3319ba7a8d6a42ba071d691789bc184632399331)
22---
23 bfd/elfxx-x86.h | 1 +
24 ld/testsuite/ld-i386/i386.exp | 1 +
25 ld/testsuite/ld-i386/pr28894.d | 3 +++
26 ld/testsuite/ld-i386/pr28894.s | 7 +++++++
27 4 files changed, 12 insertions(+)
28 create mode 100644 ld/testsuite/ld-i386/pr28894.d
29 create mode 100644 ld/testsuite/ld-i386/pr28894.s
30
31diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
32index 3219f363a9a..77fb1ad72bc 100644
33--- a/bfd/elfxx-x86.h
34+++ b/bfd/elfxx-x86.h
35@@ -80,6 +80,7 @@
36 #define I386_NEED_DYNAMIC_RELOC_TYPE_P(TYPE) \
37 (I386_SIZE_TYPE_P (TYPE) \
38 || I386_RELATIVE_RELOC_TYPE_P (TYPE) \
39+ || (TYPE) == R_386_TLS_IE \
40 || (TYPE) == R_386_TLS_LE \
41 || (TYPE) == R_386_TLS_LE_32)
42 #define X86_NEED_DYNAMIC_RELOC_TYPE_P(IS_X86_64, TYPE) \
43diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
44index d997c757325..fadbd160420 100644
45--- a/ld/testsuite/ld-i386/i386.exp
46+++ b/ld/testsuite/ld-i386/i386.exp
47@@ -510,6 +510,7 @@ run_dump_test "pr27491-4"
48 run_dump_test "dt-relr-1a"
49 run_dump_test "dt-relr-1b"
50 run_dump_test "pr28870"
51+run_dump_test "pr28894"
52
53 if { !([istarget "i?86-*-linux*"]
54 || [istarget "i?86-*-gnu*"]
55diff --git a/ld/testsuite/ld-i386/pr28894.d b/ld/testsuite/ld-i386/pr28894.d
56new file mode 100644
57index 00000000000..a8d1111eb1f
58--- /dev/null
59+++ b/ld/testsuite/ld-i386/pr28894.d
60@@ -0,0 +1,3 @@
61+#as: --32
62+#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
63+#error: .*warning: creating DT_TEXTREL in a shared object
64diff --git a/ld/testsuite/ld-i386/pr28894.s b/ld/testsuite/ld-i386/pr28894.s
65new file mode 100644
66index 00000000000..1d3e3f37f3e
67--- /dev/null
68+++ b/ld/testsuite/ld-i386/pr28894.s
69@@ -0,0 +1,7 @@
70+ .text
71+ addl foo@INDNTPOFF, %eax
72+ .section .tbss,"awT",@nobits
73+ .globl foo
74+ .hidden foo
75+foo:
76+ .byte 0
77--
782.27.0
79
This page took 0.06579 seconds and 4 git commands to generate.