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