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