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