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