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