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