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