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