d824511082d4fe7cbd096d7424d521eb493aa1ae
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2016-02-06 Cary Coutant <ccoutant@gmail.com>
2
3 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
4 overflow checking when symbol value + addend < 0.
5
6 2016-02-06 Cary Coutant <ccoutant@gmail.com>
7
8 PR gold/19577
9 * reloc.h (Limits): New class.
10 (Bits::has_overflow32): Use min/max values from Limits.
11 (Bits::has_unsigned_overflow32): Likewise.
12 (Bits::has_signed_unsigned_overflow32): Likewise.
13 (Bits::has_overflow): Likewise.
14 (Bits::has_unsigned_overflow): Likewise.
15 (Bits::has_signed_unsigned_overflow64): Likewise.
16
17 2016-02-06 Cary Coutant <ccoutant@gmail.com>
18
19 PR gold/19567
20 * reloc.h (Relocate_functions::Overflow_check): Add comments.
21 * x86_64.cc (X86_64_relocate_functions): New class.
22 (Target_x86_64::Relocate::relocate): Use the new class.
23 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
24 (x32_overflow_pc32): New test case.
25 * testsuite/Makefile.in: Regenerate.
26 * testsuite/x32_overflow_pc32.sh: New script.
27 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
28
29 2016-02-06 Cary Coutant <ccoutant@gmail.com>
30
31 PR gold/19577
32 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
33 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
34
35 2016-02-06 Cary Coutant <ccoutant@gmail.com>
36
37 PR gold/19577
38 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
39 comparison.
40 (Bits::has_unsigned_overflow): Likewise.
41
42 2016-02-06 Marcin Koƛcielnicki <koriakin@0x04.net>
43
44 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
45 parameters.
46 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
47 and view_size to is_call_to_non_split.
48 * target.cc (Target::is_call_to_non_split): Add view and view_size
49 parameters.
50 * target.h (class Target): Likewise.
51
52 2016-02-05 Sriraman Tallam <tmsriram@google.com>
53
54 * icf.cc (get_rel_addend): New function.
55 (get_section_contents): Move merge section addend computation to a
56 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
57 Fix bug to not read past the length of the section.
58
59 2016-02-05 Cary Coutant <ccoutant@gmail.com>
60 Andrew Senkevich <andrew.senkevich@intel.com>
61
62 PR gold/18695
63 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
64 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
65 R_X86_64_PLT32.
66 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
67 * testsuite/x86_64_overflow_pc32.sh: New test script.
68 * testsuite/x86_64_overflow_pc32.s: New source file.
69
70 2016-02-05 Cary Coutant <ccoutant@gmail.com>
71
72 PR gold/18695
73 * reloc.h (Relocate_functions::Address): New typedef.
74 (Relocate_functions::Addendtype): New typedef.
75 (Relocate_functions::Overflow_check): New enum type.
76 (Relocate_functions::Reloc_status): New enum type.
77 (Relocate_functions::check_overflow): New function template.
78 (Relocate_functions::rel): Add check parameter; check for overflow.
79 (Relocate_functions::rel_unaligned): Likewise.
80 (Relocate_functions::rela): Likewise.
81 (Relocate_functions::pcrel): Likewise.
82 (Relocate_functions::pcrel_unaligned): Likewise.
83 (Relocate_functions::pcrela): Likewise.
84 (Relocate_functions::rel8): Adjust parameter types.
85 (Relocate_functions::rela8): Likewise.
86 (Relocate_functions::pcrel8): Likewise.
87 (Relocate_functions::pcrela8): Likewise.
88 (Relocate_functions::rel16): Likewise.
89 (Relocate_functions::rela168): Likewise.
90 (Relocate_functions::pcrel16): Likewise.
91 (Relocate_functions::pcrela16): Likewise.
92 (Relocate_functions::rel32): Likewise.
93 (Relocate_functions::rel32_unaligned): Likewise.
94 (Relocate_functions::rela32): Likewise.
95 (Relocate_functions::pcrel32): Likewise.
96 (Relocate_functions::pcrel32_unaligned): Likewise.
97 (Relocate_functions::pcrela32): Likewise.
98 (Relocate_functions::rel8_check): New function.
99 (Relocate_functions::rela8_check): New function.
100 (Relocate_functions::pcrel8_check): New function.
101 (Relocate_functions::pcrela8_check): New function.
102 (Relocate_functions::rel16_check): New function.
103 (Relocate_functions::rela168_check): New function.
104 (Relocate_functions::pcrel16_check): New function.
105 (Relocate_functions::pcrela16_check): New function.
106 (Relocate_functions::rel32_check): New function.
107 (Relocate_functions::rel32_unaligned_check): New function.
108 (Relocate_functions::rela32_check): New function.
109 (Relocate_functions::pcrel32_check): New function.
110 (Relocate_functions::pcrel32_unaligned_check): New function.
111 (Relocate_functions::pcrela32_check): New function.
112 (Bits::has_unsigned_overflow32): New function.
113 (Bits::has_unsigned_overflow): New function.
114 * testsuite/Makefile.am (overflow_unittest): New test.
115 * testsuite/Makefile.in: Regenerate.
116 * testsuite/overflow_unittest.cc: New source file.
117
118 2016-02-04 Alan Modra <amodra@gmail.com>
119
120 * powerpc.cc (relocate): Adjust last patch for big-endian.
121
122 2016-02-02 Alan Modra <amodra@gmail.com>
123
124 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
125
126 2016-01-15 Han Shen <shenhan@google.com>
127
128 PR gold/19472 - need pc-relative stubs.
129
130 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
131 stub type for DSOs and pie executables.
132
133 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
134
135 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
136 'typename'.
137
138 2016-01-12 Cary Coutant <ccoutant@gmail.com>
139
140 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
141 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
142 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
143 specializations) New method.
144
145 2016-01-11 Cary Coutant <ccoutant@gmail.com>
146
147 PR gold/19353
148 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
149 we have a TLS segment for GD-to-IE optimization.
150 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
151 Adjust all calls.
152 (Target_i386::tls_desc_gd_to_ie): Likewise.
153 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
154 for TLSDESC GD-to-IE optimizations.
155 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
156 Adjust all calls.
157 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
158 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
159 for TLSDESC GD-to-IE optimizations.
160
161 2016-01-11 Cary Coutant <ccoutant@gmail.com>
162
163 Refactor gold to enable support for MIPS-64 relocation format.
164
165 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
166 (gc_process_relocs): Remove sh_type template parameter.
167 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
168 * object.h (Sized_relobj_file::split_stack_adjust): Add target
169 parameter.
170 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
171 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
172 specializations) Remove.
173 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
174 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
175 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
176 (Sized_relobj_file::split_stack_adjust): Add target parameter.
177 Adjust all callers.
178 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
179 Target::get_r_sym() to get r_sym field from relocations.
180 (Track_relocs::next_symndx): Call Target::get_r_sym().
181 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
182 add Classify_reloc template parameter. Use for accessing r_sym and
183 r_type.
184 (relocate_section): Likewise.
185 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
186 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
187 (Default_scan_relocatable_relocs::Reltype): New typedef.
188 (Default_scan_relocatable_relocs::reloc_size): New const.
189 (Default_scan_relocatable_relocs::sh_type): New const.
190 (Default_scan_relocatable_relocs::get_r_sym): New method.
191 (Default_scan_relocatable_relocs::get_r_type): New method.
192 (Default_emit_relocs_strategy): New class.
193 (scan_relocatable_relocs): Replace sh_type template parameter with
194 Scan_relocatable_relocs class. Use it to access r_sym and r_type
195 fields.
196 (relocate_relocs): Replace sh_type template parameter with
197 Classify_reloc class. Use it to access r_sym and r_type fields.
198 * target.h (Target::is_call_to_non_split): Replace r_type parameter
199 with pointer to relocation. Adjust all callers.
200 (Target::do_is_call_to_non_split): Likewise.
201 (Target::emit_relocs_scan): New virtual method.
202 (Sized_target::get_r_sym): New virtual method.
203 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
204 with pointer to relocation.
205
206 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
207 (Target_aarch64::Relocatable_size_for_reloc): Remove.
208 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
209 (Target_aarch64::scan_relocs): Likewise.
210 (Target_aarch64::relocate_section): Likewise.
211 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
212 Remove.
213 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
214 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
215 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
216 template parameter.
217 (Target_arm::emit_relocs_scan): New method.
218 (Target_arm::Relocatable_size_for_reloc): Replace with...
219 (Target_arm::Classify_reloc): ...this.
220 (Target_arm::gc_process_relocs): Use Classify_reloc.
221 (Target_arm::scan_relocs): Likewise.
222 (Target_arm::relocate_section): Likewise.
223 (Target_arm::scan_relocatable_relocs): Likewise.
224 (Target_arm::relocate_relocs): Likewise.
225 * i386.cc (Target_i386::emit_relocs_scan): New method.
226 (Target_i386::Relocatable_size_for_reloc): Replace with...
227 (Target_i386::Classify_reloc): ...this.
228 (Target_i386::gc_process_relocs): Use Classify_reloc.
229 (Target_i386::scan_relocs): Likewise.
230 (Target_i386::relocate_section): Likewise.
231 (Target_i386::scan_relocatable_relocs): Likewise.
232 (Target_i386::relocate_relocs): Likewise.
233 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
234 parameter.
235 (Mips_reloc_types): New class template.
236 (Mips_classify_reloc): New class template.
237 (Target_mips::Reltype): New typedef.
238 (Target_mips::Relatype): New typedef.
239 (Target_mips::emit_relocs_scan): New method.
240 (Target_mips::get_r_sym): New method.
241 (Target_mips::Relocatable_size_for_reloc): Replace with
242 Mips_classify_reloc.
243 (Target_mips::copy_reloc): Use Mips_classify_reloc.
244 (Target_mips::gc_process_relocs): Likewise.
245 (Target_mips::scan_relocs): Likewise.
246 (Target_mips::relocate_section): Likewise.
247 (Target_mips::scan_relocatable_relocs): Likewise.
248 (Target_mips::relocate_relocs): Likewise.
249 (mips_get_size_for_reloc): New function, factored out from
250 Relocatable_size_for_reloc::get_size_for_reloc.
251 (Target_mips::Scan::local): Use Mips_classify_reloc.
252 (Target_mips::Scan::global): Likewise.
253 (Target_mips::Relocate::relocate): Likewise.
254 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
255 (Target_powerpc::Relocatable_size_for_reloc): Remove.
256 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
257 (Target_powerpc::scan_relocs): Likewise.
258 (Target_powerpc::relocate_section): Likewise.
259 (Powerpc_scan_relocatable_reloc): Convert to class template.
260 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
261 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
262 (Powerpc_scan_relocatable_reloc::sh_type): New const.
263 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
264 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
265 (Target_powerpc::scan_relocatable_relocs): Use
266 Powerpc_scan_relocatable_reloc.
267 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
268 * s390.cc (Target_s390::emit_relocs_scan): New method.
269 (Target_s390::Relocatable_size_for_reloc): Remove.
270 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
271 (Target_s390::scan_relocs): Likewise.
272 (Target_s390::relocate_section): Likewise.
273 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
274 Remove.
275 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
276 (Target_s390::relocate_relocs): Use Default_classify_reloc.
277 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
278 (Target_sparc::Relocatable_size_for_reloc): Remove.
279 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
280 (Target_sparc::scan_relocs): Likewise.
281 (Target_sparc::relocate_section): Likewise.
282 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
283 Remove.
284 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
285 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
286 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
287 (Target_tilegx::Relocatable_size_for_reloc): Remove.
288 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
289 (Target_tilegx::scan_relocs): Likewise.
290 (Target_tilegx::relocate_section): Likewise.
291 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
292 Remove.
293 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
294 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
295 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
296 (Target_x86_64::Relocatable_size_for_reloc): Remove.
297 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
298 (Target_x86_64::scan_relocs): Likewise.
299 (Target_x86_64::relocate_section): Likewise.
300 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
301 Remove.
302 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
303 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
304
305 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
306
307 2016-01-01 Alan Modra <amodra@gmail.com>
308
309 Update year range in copyright notice of all files.
310
311 For older changes see ChangeLog-0815
312 \f
313 Copyright (C) 2016 Free Software Foundation, Inc.
314
315 Copying and distribution of this file, with or without modification,
316 are permitted in any medium without royalty provided the copyright
317 notice and this notice are preserved.
318
319 Local Variables:
320 mode: change-log
321 left-margin: 8
322 fill-column: 74
323 version-control: never
324 End:
This page took 0.035243 seconds and 4 git commands to generate.