Fix compilation error in mips.cc with some versions of GCC.
[binutils-gdb.git] / gold / ChangeLog
1 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
2
3 * mips.cc (Mips_output_data_got::do_write): Add missing template
4 args via typedef.
5
6 2016-05-30 Marcin Koƛcielnicki <koriakin@0x04.net>
7
8 PR/19960
9 * s390.cc (Target_s390::ss_code_st_r14): Removed.
10 (Target_s390::ss_code_l_r14): Removed.
11 (Target_s390::ss_code_ear): Removed.
12 (Target_s390::ss_code_c): Removed.
13 (Target_s390::ss_match_st_r14): New function.
14 (Target_s390::ss_match_l_r14): New function.
15 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
16 of matching code directly.
17 (Target_s390::ss_match_ear): New function.
18 (Target_s390::ss_match_c): New function.
19 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
20 of matching code directly.
21
22 2016-05-19 Cary Coutant <ccoutant@gmail.com>
23
24 PR gold/19823
25 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
26 parameter; check for protected symbol.
27 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
28 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
29 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
30 (Symbol_table::add_from_dynobj): Mark protected symbols.
31 * symtab.h (Symbol::is_protected): New method.
32 (Symbol::set_is_protected): New method.
33 (Symbol::is_protected_): New data member.
34
35 * testsuite/Makefile.am (copy_test_protected): New test.
36 * testsuite/Makefile.in: Regenerate.
37 * testsuite/copy_test.cc (main): Add legal reference to protected
38 symbol.
39 * testsuite/copy_test_v1.cc (main): Likewise.
40 * testsuite/copy_test_2.cc (ip): Add protected symbol.
41 * testsuite/copy_test_protected.cc: New test source file.
42 * testsuite/copy_test_protected.sh: New test script.
43
44 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
45
46 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
47 for global got symbols, and set addend to 0.
48 (Mips_got_entry::hash): Change hash algorithm.
49 (Mips_got_entry::equals): Refactor.
50 (Mips_got_entry::object): Return input object for local got symbols
51 from union d.
52 (Mips_got_entry::addend): Change return of the relocation addend.
53 (Mips_got_entry::addend_): Move from union d.
54 (Mips_got_entry::object_): Move into union d.
55 (class Mips_symbol_hash): New class.
56 (Mips_got_info::Global_got_entry_set): New type.
57 (Mips_got_info::global_got_symbols): Change return type to
58 Global_got_entry_set.
59 (Mips_got_info::global_got_symbols_): Change type to
60 Global_got_entry_set.
61 (Mips_symbol::hash): New method.
62 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
63 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
64 (Mips_output_data_mips_stubs::symbols_): Change type to
65 Mips_stubs_entry_set.
66 (Mips_got_info::record_global_got_symbol): Don't pass object
67 argument when creating global got symbol.
68 (Mips_got_info::record_got_entry): Remove find before inserting
69 got entries.
70 (Mips_got_info::add_reloc_only_entries): Change type of iterator
71 to Global_got_entry_set.
72 (Mips_got_info::count_got_symbols): Likewise.
73 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
74 for adding entries to symbols_.
75 (Mips_output_data_la25_stub::do_write): Change type of iterator
76 to std::vector.
77 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
78 of iterator to Mips_stubs_entry_set.
79 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
80 (Mips_output_data_mips_stubs::do_write): Likewise.
81
82 2016-05-06 Han Shen <shenhan@google.com>
83
84 PR gold/19987.
85
86 * aarch64-reloc.def: New relocation type.
87 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
88 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
89 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
90 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
91
92 2016-04-28 Nick Clifton <nickc@redhat.com>
93
94 * po/zh_CN.po: Updated Chinese (simplified) translation.
95
96 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
97
98 * Makefile.in: Regenerated with automake 1.11.6.
99 * aclocal.m4: Likewise.
100 * testsuite/Makefile.in: Likewise.
101
102 2016-03-30 Cary Coutant <ccoutant@gmail.com>
103
104 PR gold/16979
105 * symtab.cc (Symbol_table::define_default_version): Check for case
106 where symbols are both in different shared objects.
107
108 2016-03-27 Cary Coutant <ccoutant@gmail.com>
109
110 PR gold/16111
111 * i386.cc (Target_i386): Add check for fully-resolved symbol for
112 R_386_GOTOFF.
113
114 2016-03-22 Nick Clifton <nickc@redhat.com>
115
116 * configure: Regenerate.
117
118 2016-03-21 Cary Coutant <ccoutant@gmail.com>
119
120 PR gold/19842
121 * errors.cc (Errors::undefined_symbol): Add info message when
122 symbol should have been provided by a plugin.
123 * target-reloc.h (issue_undefined_symbol_error): Check for
124 placeholder symbols defined in discarded sections.
125 * testsuite/Makefile.am (plugin_test_9b): New test case.
126 * testsuite/Makefile.in: Regenerate.
127 * testsuite/plugin_test_9b_elf.cc: New test source file.
128 * testsuite/plugin_test_9b_ir.cc: New test source file.
129
130 2016-03-20 Cary Coutant <ccoutant@gmail.com>
131
132 PR gold/19002
133 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
134 * testsuite/Makefile.am (eh_test_2): New test.
135 * testsuite/Makefile.in: Regenerate.
136 * testsuite/eh_test_2.sh: New test script.
137 * testsuite/eh_test_a.cc (bar): Make it comdat.
138 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
139
140 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
141
142 * mips.cc (Mips_relobj::is_n64_): Remove.
143 (Target_mips::ei_class_): Likewise.
144 (Mips_relobj::is_newabi): Call methods.
145 (Mips_relobj::is_n64): Change checking for N64 ABI.
146 (Target_mips::is_output_n64): Likewise.
147 (Target_mips::merge_processor_specific_flags): Remove ei_class
148 argument, and remove comparing ei_class.
149 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
150 of the ELF header.
151 (Target_mips::do_finalize_sections): Don't pass ei_class argument
152 to merge_processor_specific_flags.
153 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
154 change checking for N64 ABI.
155
156 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
157
158 * mips.cc (enum Special_relocation_symbol): New enum type.
159 (is_readonly_section): New function.
160 (eh_reloc): Likewise.
161 (Mips_got_entry::is_section_symbol_): New member.
162 (Mips_got_entry::is_section_symbol): New method.
163 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
164 argument.
165 (Mips_relobj::mips_elf_options_section_name): New method.
166 (Mips_output_data_got::record_local_got_symbol): Add
167 is_section_symbol argument, and pass it to
168 Mips_got_info::record_local_got_symbol.
169 (Mips_output_data_got::got_offset): Add addend argument, and pass
170 it to Relobj::local_got_offset.
171 (struct Mips_output_reloc_writer): New type.
172 (class Mips_output_data_reloc): New class.
173 (Mips_output_data_plt::Reloc_section): Change type to
174 Mips_output_data_reloc.
175 (Target_mips::Reloc_section): Likewise.
176 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
177 (Mips_classify_reloc::get_r_type2): New method.
178 (Mips_classify_reloc::get_r_type3): Likewise.
179 (Mips_classify_reloc::get_r_ssym): Likewise.
180 (Target_mips::Reloca_section): Remove.
181 (Relocate::should_apply_static_reloc): Rename from
182 should_apply_r_mips_32_reloc.
183 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
184 and r_offset.
185 (Mips_relocate_functions::Valtype): New type.
186 (Mips_relocate_functions::Valtype64): New type.
187 (Mips_relocate_functions::check_overflow): New method.
188 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
189 interface.
190 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
191 (Mips_relocate_functions::rel16): Add support for resolving
192 relocations for Mips64.
193 (Mips_relocate_functions::rel32): Likewise.
194 (Mips_relocate_functions::reljalr): Likewise.
195 (Mips_relocate_functions::relpc32): Likewise.
196 (Mips_relocate_functions::rel26): Likewise.
197 (Mips_relocate_functions::relpc16): Likewise.
198 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
199 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
200 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
201 (Mips_relocate_functions::do_relhi16): Likewise.
202 (Mips_relocate_functions::do_relgot16_local): Likewise.
203 (Mips_relocate_functions::rello16): Likewise.
204 (Mips_relocate_functions::relgot): Likewise.
205 (Mips_relocate_functions::relgotpage): Likewise.
206 (Mips_relocate_functions::relgotofst): Likewise.
207 (Mips_relocate_functions::relgot_hi16): Likewise.
208 (Mips_relocate_functions::relgot_lo16): Likewise.
209 (Mips_relocate_functions::relgprel): Likewise.
210 (Mips_relocate_functions::relgprel32): Likewise.
211 (Mips_relocate_functions::tlsrelhi16): Likewise.
212 (Mips_relocate_functions::tlsrello16): Likewise.
213 (Mips_relocate_functions::tlsrel32): Likewise.
214 (Mips_relocate_functions::relsub): Likewise.
215 (Mips_relocate_functions::releh): New method.
216 (Mips_relocate_functions::rel64): Likewise.
217 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
218 pass it to Mips_got_entry.
219 (Mips_got_info::add_local_entries): Pass addend argument
220 to code functions, and for STT_SECTION symbols call
221 add_symbolless_local_addend.
222 (Mips_got_info::add_tls_entries): Pass addend argument to code
223 functions.
224 (Mips_relobj::do_read_symbols): Read gp value that was used to
225 create object.
226 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
227 instruction. Opcode for instruction will be selected later.
228 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
229 (Target_mips::scan_relocatable_relocs): Likewise.
230 (Target_mips::emit_relocs_scan): Likewise.
231 (Target_mips::relocate_relocs): Likewise.
232 (Target_mips::do_finalize_sections): Skip objects for merging
233 processor specific flags in which all input sections will be
234 discarded.
235 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
236 (Target_mips::Scan::get_reference_flags): Likewise.
237 (Target_mips::relocate_special_relocatable): Call rel26 method with
238 calculate_only and calculated_value arguments.
239 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
240 dynamic relocation against a readonly sections, and pass
241 is_section_symbol to Mips_got_info::record_local_got_symbol.
242 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
243 dynamic relocation against a readonly sections, and pass r_type
244 and r_offset to Target_mips::copy_reloc.
245 (Target_mips::Relocate::relocate): Add support for resolving
246 relocations for Mips64.
247 (Target_mips::mips_info): Add case for Mips64 default dynamic
248 linker name.
249 (Target_selector_mips): Correct emulation names.
250
251 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
252
253 * mips.cc (class Mips_output_data_la25_stub): Add
254 do_print_to_mapfile function.
255
256 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
257
258 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
259 elf_r_info.
260
261 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
262
263 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
264 * testsuite/plugin_layout_with_alignment.c: This.
265 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
266 (plugin_layout_with_alignment): Likewise.
267 * testsuite/Makefile.in: Regenerated.
268
269 2016-03-08 Cary Coutant <ccoutant@gmail.com>
270
271 PR 19751
272 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
273 for constructor.
274 * testsuite/Makefile.in: Regenerate.
275 * testsuite/dynamic_list.sh: Likewise.
276 * testsuite/retain_symbols_file_test.sh: Likewise.
277
278 2016-03-08 Cary Coutant <ccoutant@gmail.com>
279
280 PR 19751
281 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
282 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
283
284 2016-03-08 Cary Coutant <ccoutant@gmail.com>
285 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
286
287 * output.cc (Output_reloc_writer): New type.
288 (Output_data_reloc_base::do_write): Move implementation to template
289 in output.h and replace with invocation of template.
290 * output.h (Output_file): Move to top of file.
291 (Output_reloc::get_symbol_index): Move to public interface.
292 (Output_reloc::get_address): Likewise.
293 (Output_data_reloc_base::do_write_generic): New function template.
294
295 2016-03-04 Cary Coutant <ccoutant@gmail.com>
296
297 PR gold/19019
298 PR gold/19763
299 * symtab.cc: Instantiate Sized_symbol::init_constant and
300 Sized_symbol::init_undefined.
301
302 2016-03-03 Cary Coutant <ccoutant@gmail.com>
303
304 PR gold/19019
305 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
306 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
307 * mips.cc (Target_mips::make_symbol): Adjust function signature.
308 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
309 (Target_sparc::do_is_defined_by_abi): Remove test for
310 STT_SPARC_REGISTER.
311 (Target_sparc::Register_symbol): New struct type.
312 (Target_sparc::register_syms_): New data member.
313 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
314 (Target_sparc::make_symbol): New function.
315 (Target_sparc::do_finalize_sections): Add register symbols and new
316 dynamic table entries.
317 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
318 (Symbol_table::add_target_global_symbol): New function.
319 (Symbol_table::target_symbols_): New data member.
320 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
321 (Symbol_table::Symbol_table): Initialize target_symbols_.
322 (Symbol_table::add_from_object): Pass additional parameters to
323 Target::make_symbol.
324 (Symbol_table::define_special_symbol): Likewise.
325 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
326 undefined symbol value.
327 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
328 (Symbol_table::sized_finalize): Likewise.
329 (Symbol_table::sized_write_globals): Likewise.
330 * target.h (Sized_target::make_symbol): Add name, st_type, object,
331 st_shndx, and value parameters.
332
333 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
334
335 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
336 LDPK_WEAKUNDEF symbols.
337
338 2016-03-03 Than McIntosh <thanm@google.com>
339
340 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
341 and get_input_section_alignment in transfer vector.
342 (get_input_section_alignment): New function.
343 (get_input_section_size): New function.
344 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
345 * testsuite/Makefile.in: [Regenerate.]
346 * testsuite/plugin_section_alignment.cc: New test file.
347 * testsuite/plugin_layout_with_alignment.cc: New test file.
348 * testsuite/plugin_layout_with_alignment.sh: New test file.
349
350 2016-03-03 Evgenii Stepanov <eugenis@google.com>
351
352 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
353 parameter.
354 * plugin.cc (get_symbols_v3): New function.
355 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
356 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
357 new version.
358
359 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
360 Cary Coutant <ccoutant@gmail.com>
361
362 PR gold/19735
363 * ehframe.h (Cie::fde_encoding): New method.
364 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
365 address ranges.
366
367 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
368
369 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
370 -mrelax-relocations=yes to $(TEST_AS).
371 (x86_64_mov_to_lea6.o): Likewise.
372 (x86_64_overflow_pc32.o): Remove duplicated target.
373 * testsuite/Makefile.in: Regenerated.
374
375 2016-02-15 Marcin Koƛcielnicki <koriakin@0x04.net>
376
377 * s390.cc (Target_s390::match_view_u): New helper method.
378 (Target_s390::do_is_call_to_non_split): New method.
379 (Target_s390::ss_code_st_r14): New const.
380 (Target_s390::ss_code_l_r14): New const.
381 (Target_s390::ss_code_bras_8): New const.
382 (Target_s390::ss_code_l_basr): New const.
383 (Target_s390::ss_code_a_basr): New const.
384 (Target_s390::ss_code_ear): New const.
385 (Target_s390::ss_code_c): New const.
386 (Target_s390::ss_code_larl): New const.
387 (Target_s390::ss_code_brasl): New const.
388 (Target_s390::ss_code_jg): New const.
389 (Target_s390::ss_code_jgl): New const.
390 (Target_s390::ss_match_mcount): New helper method.
391 (Target_s390::ss_match_l): New helper method.
392 (Target_s390::ss_match_ahi): New helper method.
393 (Target_s390::ss_match_alfi): New helper method.
394 (Target_s390::ss_match_cr): New helper method.
395 (Target_s390::do_calls_non_split): New method.
396 * testsuite/Makefile.am: Added new tests.
397 * testsuite/Makefile.in: Regenerate.
398 * testsuite/split_s390.sh: New test.
399 * testsuite/split_s390_1_a1.s: New test.
400 * testsuite/split_s390_1_a2.s: New test.
401 * testsuite/split_s390_1_n1.s: New test.
402 * testsuite/split_s390_1_n2.s: New test.
403 * testsuite/split_s390_1_z1.s: New test.
404 * testsuite/split_s390_1_z2.s: New test.
405 * testsuite/split_s390_1_z3.s: New test.
406 * testsuite/split_s390_1_z4.s: New test.
407 * testsuite/split_s390_2_ns.s: New test.
408 * testsuite/split_s390_2_s.s: New test.
409 * testsuite/split_s390x_1_a1.s: New test.
410 * testsuite/split_s390x_1_a2.s: New test.
411 * testsuite/split_s390x_1_n1.s: New test.
412 * testsuite/split_s390x_1_n2.s: New test.
413 * testsuite/split_s390x_1_z1.s: New test.
414 * testsuite/split_s390x_1_z2.s: New test.
415 * testsuite/split_s390x_1_z3.s: New test.
416 * testsuite/split_s390x_1_z4.s: New test.
417 * testsuite/split_s390x_2_ns.s: New test.
418 * testsuite/split_s390x_2_s.s: New test.
419
420 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
421
422 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
423 info message for every erratum 843419 found and fixed.
424
425 2016-02-07 Cary Coutant <ccoutant@gmail.com>
426
427 PR gold/18695
428 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
429 information to relocation overflow errors.
430
431 2016-02-06 Cary Coutant <ccoutant@gmail.com>
432
433 PR gold/18695
434 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
435 overflow checking when symbol value + addend < 0.
436
437 2016-02-06 Cary Coutant <ccoutant@gmail.com>
438
439 PR gold/19577
440 * reloc.h (Limits): New class.
441 (Bits::has_overflow32): Use min/max values from Limits.
442 (Bits::has_unsigned_overflow32): Likewise.
443 (Bits::has_signed_unsigned_overflow32): Likewise.
444 (Bits::has_overflow): Likewise.
445 (Bits::has_unsigned_overflow): Likewise.
446 (Bits::has_signed_unsigned_overflow64): Likewise.
447
448 2016-02-06 Cary Coutant <ccoutant@gmail.com>
449
450 PR gold/19567
451 * reloc.h (Relocate_functions::Overflow_check): Add comments.
452 * x86_64.cc (X86_64_relocate_functions): New class.
453 (Target_x86_64::Relocate::relocate): Use the new class.
454 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
455 (x32_overflow_pc32): New test case.
456 * testsuite/Makefile.in: Regenerate.
457 * testsuite/x32_overflow_pc32.sh: New script.
458 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
459
460 2016-02-06 Cary Coutant <ccoutant@gmail.com>
461
462 PR gold/19577
463 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
464 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
465
466 2016-02-06 Cary Coutant <ccoutant@gmail.com>
467
468 PR gold/19577
469 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
470 comparison.
471 (Bits::has_unsigned_overflow): Likewise.
472
473 2016-02-06 Marcin Koƛcielnicki <koriakin@0x04.net>
474
475 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
476 parameters.
477 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
478 and view_size to is_call_to_non_split.
479 * target.cc (Target::is_call_to_non_split): Add view and view_size
480 parameters.
481 * target.h (class Target): Likewise.
482
483 2016-02-05 Sriraman Tallam <tmsriram@google.com>
484
485 * icf.cc (get_rel_addend): New function.
486 (get_section_contents): Move merge section addend computation to a
487 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
488 Fix bug to not read past the length of the section.
489
490 2016-02-05 Cary Coutant <ccoutant@gmail.com>
491 Andrew Senkevich <andrew.senkevich@intel.com>
492
493 PR gold/18695
494 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
495 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
496 R_X86_64_PLT32.
497 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
498 * testsuite/x86_64_overflow_pc32.sh: New test script.
499 * testsuite/x86_64_overflow_pc32.s: New source file.
500
501 2016-02-05 Cary Coutant <ccoutant@gmail.com>
502
503 PR gold/18695
504 * reloc.h (Relocate_functions::Address): New typedef.
505 (Relocate_functions::Addendtype): New typedef.
506 (Relocate_functions::Overflow_check): New enum type.
507 (Relocate_functions::Reloc_status): New enum type.
508 (Relocate_functions::check_overflow): New function template.
509 (Relocate_functions::rel): Add check parameter; check for overflow.
510 (Relocate_functions::rel_unaligned): Likewise.
511 (Relocate_functions::rela): Likewise.
512 (Relocate_functions::pcrel): Likewise.
513 (Relocate_functions::pcrel_unaligned): Likewise.
514 (Relocate_functions::pcrela): Likewise.
515 (Relocate_functions::rel8): Adjust parameter types.
516 (Relocate_functions::rela8): Likewise.
517 (Relocate_functions::pcrel8): Likewise.
518 (Relocate_functions::pcrela8): Likewise.
519 (Relocate_functions::rel16): Likewise.
520 (Relocate_functions::rela168): Likewise.
521 (Relocate_functions::pcrel16): Likewise.
522 (Relocate_functions::pcrela16): Likewise.
523 (Relocate_functions::rel32): Likewise.
524 (Relocate_functions::rel32_unaligned): Likewise.
525 (Relocate_functions::rela32): Likewise.
526 (Relocate_functions::pcrel32): Likewise.
527 (Relocate_functions::pcrel32_unaligned): Likewise.
528 (Relocate_functions::pcrela32): Likewise.
529 (Relocate_functions::rel8_check): New function.
530 (Relocate_functions::rela8_check): New function.
531 (Relocate_functions::pcrel8_check): New function.
532 (Relocate_functions::pcrela8_check): New function.
533 (Relocate_functions::rel16_check): New function.
534 (Relocate_functions::rela168_check): New function.
535 (Relocate_functions::pcrel16_check): New function.
536 (Relocate_functions::pcrela16_check): New function.
537 (Relocate_functions::rel32_check): New function.
538 (Relocate_functions::rel32_unaligned_check): New function.
539 (Relocate_functions::rela32_check): New function.
540 (Relocate_functions::pcrel32_check): New function.
541 (Relocate_functions::pcrel32_unaligned_check): New function.
542 (Relocate_functions::pcrela32_check): New function.
543 (Bits::has_unsigned_overflow32): New function.
544 (Bits::has_unsigned_overflow): New function.
545 * testsuite/Makefile.am (overflow_unittest): New test.
546 * testsuite/Makefile.in: Regenerate.
547 * testsuite/overflow_unittest.cc: New source file.
548
549 2016-02-04 Alan Modra <amodra@gmail.com>
550
551 * powerpc.cc (relocate): Adjust last patch for big-endian.
552
553 2016-02-02 Alan Modra <amodra@gmail.com>
554
555 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
556
557 2016-01-15 Han Shen <shenhan@google.com>
558
559 PR gold/19472 - need pc-relative stubs.
560
561 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
562 stub type for DSOs and pie executables.
563
564 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
565
566 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
567 'typename'.
568
569 2016-01-12 Cary Coutant <ccoutant@gmail.com>
570
571 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
572 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
573 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
574 specializations) New method.
575
576 2016-01-11 Cary Coutant <ccoutant@gmail.com>
577
578 PR gold/19353
579 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
580 we have a TLS segment for GD-to-IE optimization.
581 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
582 Adjust all calls.
583 (Target_i386::tls_desc_gd_to_ie): Likewise.
584 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
585 for TLSDESC GD-to-IE optimizations.
586 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
587 Adjust all calls.
588 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
589 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
590 for TLSDESC GD-to-IE optimizations.
591
592 2016-01-11 Cary Coutant <ccoutant@gmail.com>
593
594 Refactor gold to enable support for MIPS-64 relocation format.
595
596 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
597 (gc_process_relocs): Remove sh_type template parameter.
598 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
599 * object.h (Sized_relobj_file::split_stack_adjust): Add target
600 parameter.
601 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
602 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
603 specializations) Remove.
604 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
605 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
606 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
607 (Sized_relobj_file::split_stack_adjust): Add target parameter.
608 Adjust all callers.
609 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
610 Target::get_r_sym() to get r_sym field from relocations.
611 (Track_relocs::next_symndx): Call Target::get_r_sym().
612 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
613 add Classify_reloc template parameter. Use for accessing r_sym and
614 r_type.
615 (relocate_section): Likewise.
616 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
617 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
618 (Default_scan_relocatable_relocs::Reltype): New typedef.
619 (Default_scan_relocatable_relocs::reloc_size): New const.
620 (Default_scan_relocatable_relocs::sh_type): New const.
621 (Default_scan_relocatable_relocs::get_r_sym): New method.
622 (Default_scan_relocatable_relocs::get_r_type): New method.
623 (Default_emit_relocs_strategy): New class.
624 (scan_relocatable_relocs): Replace sh_type template parameter with
625 Scan_relocatable_relocs class. Use it to access r_sym and r_type
626 fields.
627 (relocate_relocs): Replace sh_type template parameter with
628 Classify_reloc class. Use it to access r_sym and r_type fields.
629 * target.h (Target::is_call_to_non_split): Replace r_type parameter
630 with pointer to relocation. Adjust all callers.
631 (Target::do_is_call_to_non_split): Likewise.
632 (Target::emit_relocs_scan): New virtual method.
633 (Sized_target::get_r_sym): New virtual method.
634 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
635 with pointer to relocation.
636
637 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
638 (Target_aarch64::Relocatable_size_for_reloc): Remove.
639 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
640 (Target_aarch64::scan_relocs): Likewise.
641 (Target_aarch64::relocate_section): Likewise.
642 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
643 Remove.
644 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
645 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
646 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
647 template parameter.
648 (Target_arm::emit_relocs_scan): New method.
649 (Target_arm::Relocatable_size_for_reloc): Replace with...
650 (Target_arm::Classify_reloc): ...this.
651 (Target_arm::gc_process_relocs): Use Classify_reloc.
652 (Target_arm::scan_relocs): Likewise.
653 (Target_arm::relocate_section): Likewise.
654 (Target_arm::scan_relocatable_relocs): Likewise.
655 (Target_arm::relocate_relocs): Likewise.
656 * i386.cc (Target_i386::emit_relocs_scan): New method.
657 (Target_i386::Relocatable_size_for_reloc): Replace with...
658 (Target_i386::Classify_reloc): ...this.
659 (Target_i386::gc_process_relocs): Use Classify_reloc.
660 (Target_i386::scan_relocs): Likewise.
661 (Target_i386::relocate_section): Likewise.
662 (Target_i386::scan_relocatable_relocs): Likewise.
663 (Target_i386::relocate_relocs): Likewise.
664 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
665 parameter.
666 (Mips_reloc_types): New class template.
667 (Mips_classify_reloc): New class template.
668 (Target_mips::Reltype): New typedef.
669 (Target_mips::Relatype): New typedef.
670 (Target_mips::emit_relocs_scan): New method.
671 (Target_mips::get_r_sym): New method.
672 (Target_mips::Relocatable_size_for_reloc): Replace with
673 Mips_classify_reloc.
674 (Target_mips::copy_reloc): Use Mips_classify_reloc.
675 (Target_mips::gc_process_relocs): Likewise.
676 (Target_mips::scan_relocs): Likewise.
677 (Target_mips::relocate_section): Likewise.
678 (Target_mips::scan_relocatable_relocs): Likewise.
679 (Target_mips::relocate_relocs): Likewise.
680 (mips_get_size_for_reloc): New function, factored out from
681 Relocatable_size_for_reloc::get_size_for_reloc.
682 (Target_mips::Scan::local): Use Mips_classify_reloc.
683 (Target_mips::Scan::global): Likewise.
684 (Target_mips::Relocate::relocate): Likewise.
685 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
686 (Target_powerpc::Relocatable_size_for_reloc): Remove.
687 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
688 (Target_powerpc::scan_relocs): Likewise.
689 (Target_powerpc::relocate_section): Likewise.
690 (Powerpc_scan_relocatable_reloc): Convert to class template.
691 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
692 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
693 (Powerpc_scan_relocatable_reloc::sh_type): New const.
694 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
695 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
696 (Target_powerpc::scan_relocatable_relocs): Use
697 Powerpc_scan_relocatable_reloc.
698 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
699 * s390.cc (Target_s390::emit_relocs_scan): New method.
700 (Target_s390::Relocatable_size_for_reloc): Remove.
701 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
702 (Target_s390::scan_relocs): Likewise.
703 (Target_s390::relocate_section): Likewise.
704 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
705 Remove.
706 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
707 (Target_s390::relocate_relocs): Use Default_classify_reloc.
708 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
709 (Target_sparc::Relocatable_size_for_reloc): Remove.
710 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
711 (Target_sparc::scan_relocs): Likewise.
712 (Target_sparc::relocate_section): Likewise.
713 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
714 Remove.
715 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
716 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
717 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
718 (Target_tilegx::Relocatable_size_for_reloc): Remove.
719 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
720 (Target_tilegx::scan_relocs): Likewise.
721 (Target_tilegx::relocate_section): Likewise.
722 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
723 Remove.
724 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
725 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
726 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
727 (Target_x86_64::Relocatable_size_for_reloc): Remove.
728 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
729 (Target_x86_64::scan_relocs): Likewise.
730 (Target_x86_64::relocate_section): Likewise.
731 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
732 Remove.
733 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
734 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
735
736 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
737
738 2016-01-01 Alan Modra <amodra@gmail.com>
739
740 Update year range in copyright notice of all files.
741
742 For older changes see ChangeLog-0815
743 \f
744 Copyright (C) 2016 Free Software Foundation, Inc.
745
746 Copying and distribution of this file, with or without modification,
747 are permitted in any medium without royalty provided the copyright
748 notice and this notice are preserved.
749
750 Local Variables:
751 mode: change-log
752 left-margin: 8
753 fill-column: 74
754 version-control: never
755 End: