diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.25.1.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/fix-internal-error-when-applying-TLSDESC-relocs-without-TLS-segment.patch | 166 |
2 files changed, 167 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.25.1.inc b/meta/recipes-devtools/binutils/binutils-2.25.1.inc index f3817fafb6..c7db9e0336 100644 --- a/meta/recipes-devtools/binutils/binutils-2.25.1.inc +++ b/meta/recipes-devtools/binutils/binutils-2.25.1.inc | |||
@@ -35,6 +35,7 @@ SRC_URI = "\ | |||
35 | file://0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch \ | 35 | file://0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch \ |
36 | file://binutils-octeon3.patch \ | 36 | file://binutils-octeon3.patch \ |
37 | file://add-thunderx-support-for-gas.patch \ | 37 | file://add-thunderx-support-for-gas.patch \ |
38 | file://fix-internal-error-when-applying-TLSDESC-relocs-without-TLS-segment.patch \ | ||
38 | " | 39 | " |
39 | S = "${WORKDIR}/git" | 40 | S = "${WORKDIR}/git" |
40 | 41 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/fix-internal-error-when-applying-TLSDESC-relocs-without-TLS-segment.patch b/meta/recipes-devtools/binutils/binutils/fix-internal-error-when-applying-TLSDESC-relocs-without-TLS-segment.patch new file mode 100644 index 0000000000..df9d54ccf5 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/fix-internal-error-when-applying-TLSDESC-relocs-without-TLS-segment.patch | |||
@@ -0,0 +1,166 @@ | |||
1 | From d21f123b0ead1806416cf0dafae12bec4cca8920 Mon Sep 17 00:00:00 2001 | ||
2 | From: Cary Coutant <ccoutant@gmail.com> | ||
3 | Date: Mon, 11 Jan 2016 23:57:44 -0800 | ||
4 | Subject: [PATCH] Fix internal error when applying TLSDESC relocations with no TLS segment. | ||
5 | |||
6 | gold/ | ||
7 | PR gold/19353 | ||
8 | * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that | ||
9 | we have a TLS segment for GD-to-IE optimization. | ||
10 | * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter. | ||
11 | Adjust all calls. | ||
12 | (Target_i386::tls_desc_gd_to_ie): Likewise. | ||
13 | (Target_i386::relocate_tls): Don't insist that we have a TLS segment | ||
14 | for TLSDESC GD-to-IE optimizations. | ||
15 | * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter. | ||
16 | Adjust all calls. | ||
17 | (Target_x86_64::tls_desc_gd_to_ie): Likewise. | ||
18 | (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment | ||
19 | for TLSDESC GD-to-IE optimizations. | ||
20 | --- | ||
21 | gold/aarch64.cc | 6 ------ | ||
22 | gold/i386.cc | 14 ++------------ | ||
23 | gold/x86_64.cc | 14 ++------------ | ||
24 | 4 files changed, 20 insertions(+), 30 deletions(-) | ||
25 | |||
26 | diff --git a/gold/aarch64.cc b/gold/aarch64.cc | ||
27 | index 20f2f4f..5ad061b 100644 | ||
28 | --- a/gold/aarch64.cc | ||
29 | +++ b/gold/aarch64.cc | ||
30 | @@ -7422,12 +7422,6 @@ Target_aarch64<size, big_endian>::Relocate::relocate_tls( | ||
31 | } | ||
32 | if (tlsopt == tls::TLSOPT_TO_IE) | ||
33 | { | ||
34 | - if (tls_segment == NULL) | ||
35 | - { | ||
36 | - gold_assert(parameters->errors()->error_count() > 0 | ||
37 | - || issue_undefined_symbol_error(gsym)); | ||
38 | - return aarch64_reloc_funcs::STATUS_BAD_RELOC; | ||
39 | - } | ||
40 | return tls_desc_gd_to_ie(relinfo, target, rela, r_type, | ||
41 | view, psymval, got_entry_address, | ||
42 | address); | ||
43 | diff --git a/gold/i386.cc b/gold/i386.cc | ||
44 | index 82886d4..a7168a8 100644 | ||
45 | --- a/gold/i386.cc | ||
46 | +++ b/gold/i386.cc | ||
47 | @@ -668,7 +668,6 @@ class Target_i386 : public Sized_target<32, false> | ||
48 | // Do a TLS General-Dynamic to Initial-Exec transition. | ||
49 | inline void | ||
50 | tls_gd_to_ie(const Relocate_info<32, false>*, size_t relnum, | ||
51 | - Output_segment* tls_segment, | ||
52 | const elfcpp::Rel<32, false>&, unsigned int r_type, | ||
53 | elfcpp::Elf_types<32>::Elf_Addr value, | ||
54 | unsigned char* view, | ||
55 | @@ -687,7 +686,6 @@ class Target_i386 : public Sized_target<32, false> | ||
56 | // transition. | ||
57 | inline void | ||
58 | tls_desc_gd_to_ie(const Relocate_info<32, false>*, size_t relnum, | ||
59 | - Output_segment* tls_segment, | ||
60 | const elfcpp::Rel<32, false>&, unsigned int r_type, | ||
61 | elfcpp::Elf_types<32>::Elf_Addr value, | ||
62 | unsigned char* view, | ||
63 | @@ -3054,7 +3052,7 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo, | ||
64 | } | ||
65 | if (optimized_type == tls::TLSOPT_TO_IE) | ||
66 | { | ||
67 | - this->tls_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type, | ||
68 | + this->tls_gd_to_ie(relinfo, relnum, rel, r_type, | ||
69 | got_offset, view, view_size); | ||
70 | break; | ||
71 | } | ||
72 | @@ -3116,13 +3114,7 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo, | ||
73 | } | ||
74 | if (optimized_type == tls::TLSOPT_TO_IE) | ||
75 | { | ||
76 | - if (tls_segment == NULL) | ||
77 | - { | ||
78 | - gold_assert(parameters->errors()->error_count() > 0 | ||
79 | - || issue_undefined_symbol_error(gsym)); | ||
80 | - return; | ||
81 | - } | ||
82 | - this->tls_desc_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type, | ||
83 | + this->tls_desc_gd_to_ie(relinfo, relnum, rel, r_type, | ||
84 | got_offset, view, view_size); | ||
85 | break; | ||
86 | } | ||
87 | @@ -3354,7 +3346,6 @@ Target_i386::Relocate::tls_gd_to_le(const Relocate_info<32, false>* relinfo, | ||
88 | inline void | ||
89 | Target_i386::Relocate::tls_gd_to_ie(const Relocate_info<32, false>* relinfo, | ||
90 | size_t relnum, | ||
91 | - Output_segment*, | ||
92 | const elfcpp::Rel<32, false>& rel, | ||
93 | unsigned int, | ||
94 | elfcpp::Elf_types<32>::Elf_Addr value, | ||
95 | @@ -3449,7 +3440,6 @@ inline void | ||
96 | Target_i386::Relocate::tls_desc_gd_to_ie( | ||
97 | const Relocate_info<32, false>* relinfo, | ||
98 | size_t relnum, | ||
99 | - Output_segment*, | ||
100 | const elfcpp::Rel<32, false>& rel, | ||
101 | unsigned int r_type, | ||
102 | elfcpp::Elf_types<32>::Elf_Addr value, | ||
103 | diff --git a/gold/x86_64.cc b/gold/x86_64.cc | ||
104 | index 3cfc064..4ad5afc 100644 | ||
105 | --- a/gold/x86_64.cc | ||
106 | +++ b/gold/x86_64.cc | ||
107 | @@ -816,7 +816,6 @@ class Target_x86_64 : public Sized_target<size, false> | ||
108 | // Do a TLS General-Dynamic to Initial-Exec transition. | ||
109 | inline void | ||
110 | tls_gd_to_ie(const Relocate_info<size, false>*, size_t relnum, | ||
111 | - Output_segment* tls_segment, | ||
112 | const elfcpp::Rela<size, false>&, unsigned int r_type, | ||
113 | typename elfcpp::Elf_types<size>::Elf_Addr value, | ||
114 | unsigned char* view, | ||
115 | @@ -835,7 +834,6 @@ class Target_x86_64 : public Sized_target<size, false> | ||
116 | // Do a TLSDESC-style General-Dynamic to Initial-Exec transition. | ||
117 | inline void | ||
118 | tls_desc_gd_to_ie(const Relocate_info<size, false>*, size_t relnum, | ||
119 | - Output_segment* tls_segment, | ||
120 | const elfcpp::Rela<size, false>&, unsigned int r_type, | ||
121 | typename elfcpp::Elf_types<size>::Elf_Addr value, | ||
122 | unsigned char* view, | ||
123 | @@ -3733,7 +3731,7 @@ Target_x86_64<size>::Relocate::relocate_tls( | ||
124 | if (optimized_type == tls::TLSOPT_TO_IE) | ||
125 | { | ||
126 | value = target->got_plt_section()->address() + got_offset; | ||
127 | - this->tls_gd_to_ie(relinfo, relnum, tls_segment, rela, r_type, | ||
128 | + this->tls_gd_to_ie(relinfo, relnum, rela, r_type, | ||
129 | value, view, address, view_size); | ||
130 | break; | ||
131 | } | ||
132 | @@ -3800,14 +3798,8 @@ Target_x86_64<size>::Relocate::relocate_tls( | ||
133 | } | ||
134 | if (optimized_type == tls::TLSOPT_TO_IE) | ||
135 | { | ||
136 | - if (tls_segment == NULL) | ||
137 | - { | ||
138 | - gold_assert(parameters->errors()->error_count() > 0 | ||
139 | - || issue_undefined_symbol_error(gsym)); | ||
140 | - return; | ||
141 | - } | ||
142 | value = target->got_plt_section()->address() + got_offset; | ||
143 | - this->tls_desc_gd_to_ie(relinfo, relnum, tls_segment, | ||
144 | + this->tls_desc_gd_to_ie(relinfo, relnum, | ||
145 | rela, r_type, value, view, address, | ||
146 | view_size); | ||
147 | break; | ||
148 | @@ -3973,7 +3965,6 @@ inline void | ||
149 | Target_x86_64<size>::Relocate::tls_gd_to_ie( | ||
150 | const Relocate_info<size, false>* relinfo, | ||
151 | size_t relnum, | ||
152 | - Output_segment*, | ||
153 | const elfcpp::Rela<size, false>& rela, | ||
154 | unsigned int, | ||
155 | typename elfcpp::Elf_types<size>::Elf_Addr value, | ||
156 | @@ -4085,7 +4076,6 @@ inline void | ||
157 | Target_x86_64<size>::Relocate::tls_desc_gd_to_ie( | ||
158 | const Relocate_info<size, false>* relinfo, | ||
159 | size_t relnum, | ||
160 | - Output_segment*, | ||
161 | const elfcpp::Rela<size, false>& rela, | ||
162 | unsigned int r_type, | ||
163 | typename elfcpp::Elf_types<size>::Elf_Addr value, | ||
164 | -- | ||
165 | 1.7.1 | ||
166 | |||