1 2016-12-01 Cary Coutant <ccoutant@gmail.com>
4 * script-sections.cc (Script_sections): Set *keep to false when
7 2016-12-01 Cary Coutant <ccoutant@gmail.com>
10 * target.h (Target::default_text_segment_address): Bump default
11 start address up to ABI page size.
13 2016-12-01 Cary Coutant <ccoutant@gmail.com>
16 * options.cc (General_options::object_format_to_string): New function.
17 (General_options::copy_from_posdep_options): New function.
18 (General_options::parse_push_state): New function.
19 (General_options::parse_pop_state): New function.
20 * options.h (--push-state, --pop-state): New options.
21 (General_options::object_format_to_string): New method.
22 (General_options::set_incremental_disposition): New method.
23 (General_options::copy_from_posdep_options): New method.
24 (General_options::options_stack_): New data member.
26 2016-12-01 Cary Coutant <ccoutant@gmail.com>
29 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
30 section symbols correctly.
31 * arm.cc (Target_arm): Likewise.
32 * powerpc.cc (Target_powerpc): Likewise.
34 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
36 * aarch64-reloc.def: Fix spelling in comments.
38 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
40 * aarch64.cc: Fix spelling in comments.
41 * arm.cc: Fix spelling in comments.
42 * icf.cc: Fix spelling in comments.
43 * layout.cc: Fix spelling in comments.
44 * layout.h: Fix spelling in comments.
45 * mips.cc: Fix spelling in comments.
46 * output.h: Fix spelling in comments.
47 * plugin.h: Fix spelling in comments.
48 * script-sections.h: Fix spelling in comments.
49 * script.h: Fix spelling in comments.
50 * stringpool.h: Fix spelling in comments.
51 * tilegx.cc: Fix spelling in comments.
53 2016-11-22 Cary Coutant <ccoutant@gmail.com>
56 * options.cc (One_option::print): Print "(default)" when appropriate.
57 * options.h: Clean up and re-sort options.
58 (One_option::is_default): New data member.
59 (One_option::One_option): Add is_default parameter; adjust all calls.
60 (DEFINE_var): Add is_default__ parameter; adjust all calls.
61 (DEFINE_bool): Set is_default based on default_value__.
62 (DEFINE_bool_ignore): New macro.
63 (--no-eh-frame-hdr): New option.
64 (--enable-new-dtags): Remove mention of DT_FLAGS.
66 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
68 * configure: Regenerate.
70 2016-11-21 Cary Coutant <ccoutant@gmail.com>
73 * gold.cc (queue_middle_tasks): Force valid target earlier.
75 2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
77 * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
78 (Layout::create_build_id): Generate uuid using UuidCreate().
80 2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com>
82 * configure.ac: add missing '$'.
83 * configure: Regenerate.
85 2016-10-21 Gergely Nagy <ngg@tresorit.com>
88 * icf.cc (match_sections): Add new parameter section_addraligns.
89 Check section alignment and keep the section with the strictest
91 (find_identical_sections): New local variable section_addraligns.
92 Store each section's alignment.
93 * testsuite/pr17704a_test.s: New file.
94 * testsuite/Makefile.am (pr17704a_test): New test.
95 * testsuite/Makefile.in: Regenerate.
97 2016-10-06 Alan Modra <amodra@gmail.com>
99 * powerpc.cc (Target_powerpc::Relocate::relocate): Add fall
101 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
103 2016-10-06 Alan Modra <amodra@gmail.com>
105 * aarch64.cc: Spell fall through comments as "// Fall through.".
108 * powerpc.cc: Likewise.
110 * sparc.cc: Likewise.
111 * x86_64.cc: Likewise.
112 * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing
113 fall through comments.
114 * sparc.cc: (Target_sparc::Scan::global): Likewise.
115 (Target_sparc::Relocate::relocate): Likewise.
116 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
117 * resolve.cc (symbol_to_bits): Add missing break.
119 2016-09-26 Cary Coutant <ccoutant@gmail.com>
122 * symtab.cc (Symbol_table::define_default_version): Check that
123 unversioned symbol is defined.
125 2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
127 * Makefile.in: Regenerate.
128 * configure: Likewise.
129 * testsuite/Makefile.in: Likewise.
131 2016-09-26 Alan Modra <amodra@gmail.com>
133 * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
135 * output.cc (Output_segment::set_section_addresses): Likewise.
136 * testsuite/Makefile.in: Regenerate.
138 2016-09-02 Doug Kwan <dougkwan@google.com>
140 * arm.cc (Target_arm::Target_arm): Move method definition outside of
141 class definition. Add code to handle --target1-rel, --target1-abs
142 and --target2= options.
143 (Target_arm::get_reloc_reloc_type): Change method to be non-static
145 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
147 (Target_arm::Scan::local, Target_arm::Scan::global,
148 Target_arm::Relocate::relocate,
149 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
150 call to Target_arm::get_real_reloc_type.
151 (Target_arm::get_real_reloc_type): Use command line options to
152 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
153 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
156 2016-08-31 Alan Modra <amodra@gmail.com>
158 * powerpc.cc (class Stub_control): Delete stub14_group_size_
159 and has14_. Add group_size_.
160 (Stub_control::can_add_to_stub_group): Adjust to suit. Print
161 debug info when switching to adding sections before stubs.
163 2016-08-31 Alan Modra <amodra@gmail.com>
165 * debug.h (DEBUG_TARGET): New.
166 (DEBUG_ALL): Add DEBUG_TARGET.
167 (gold_debug): Delete FORMAT param.
168 * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
170 2016-08-30 Alan Modra <amodra@gmail.com>
173 * powerpc.cc (class Stub_control): Add has14_. Comment owner_.
174 (Stub_control::can_add_to_stub_group): Correct grouping of
175 sections containing 14-bit external branches. When returning
176 false, set state_ to reflect the fact that we have one section
177 for the next group. Rewrite most of function for clarity.
178 Add and expand comments.
179 (Target_powerpc::do_relax): Print stub group size retry in hex.
181 2016-08-26 Han Shen <shenhan@google.com>
183 PR gold/20529 - relaxing loop never ends.
185 * powerpc.cc (Stub_table::min_size_threshold_): New member to
187 (Stub_table::set_min_size_threshold): New member function.
188 (Stub_table::set_address_and_size): Add code to only allow size
190 (Target_powerpc::do_relax): Add code to record last size.
192 2016-08-23 Roland McGrath <roland@hack.frob.com>
194 * options.h (General_options): Grok -z stack-size.
195 * output.h (Output_segment::set_size): New method.
196 * layout.cc (Layout::create_executable_stack_info): Renamed to ...
197 (Layout::create_stack_segment): ... this. Always create the
198 segment if -z stack-size was used.
199 (Layout::set_segment_offsets): Don't call ->set_offset on the
200 PT_GNU_STACK segment.
202 2016-08-15 Bharathi Seshadri <bseshadr@cisco.com>
204 * options.h (General_options): Add --be8 option.
205 * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8.
206 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise.
207 (Output_data_plt_arm_short::do_fill_plt_entry): Likewise.
208 (Output_data_plt_arm_long::do_fill_plt_entry): Likewise.
209 (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
211 2016-08-17 Cary Coutant <ccoutant@gmail.com>
213 * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
215 * testsuite/Makefile.am (pr20216a): Add missing dependencies.
216 (pr20308a): Add -Bgcctestdir/ to compile rules.
217 * testsuite/Makefile.in: Regenerate.
219 2016-08-12 Roland McGrath <roland@hack.frob.com>
222 * script-sections.cc (Script_sections::release_segments):
223 Reset this->segments_created_.
225 2016-08-12 Roland McGrath <roland@hack.frob.com>
227 * yyscript.y (HIDDEN): New %token.
228 (assignment): Handle HIDDEN(string = expr) syntax.
229 * script.cc (script_keyword_parsecodes): Add HIDDEN.
231 2016-08-10 Cary Coutant <ccoutant@gmail.com>
234 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
235 R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
237 * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
238 (pr20216_ld.o): Likewise.
239 * testsuite/Makefile.in: Regenerate.
241 2016-08-10 James Clarke <jrtc27@jrtc27.com>
244 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
245 which will be present for STT_SPARC_REGISTER.
246 (Symbol_table::add_from_pluginobj): Likewise.
247 (Symbol_table::add_from_dynobj): Likewise.
248 (Symbol_table::add_from_incrobj): Removed dead code.
250 2016-08-10 James Clarke <jrtc27@jrtc27.com>
253 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
254 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
256 2016-08-10 James Clarke <jrtc27@jrtc27.com>
259 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on
262 2016-06-29 Cary Coutant <ccoutant@gmail.com>
265 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
267 2016-06-29 Cary Coutant <ccoutant@gmail.com>
269 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2.
270 * testsuite/Makefile.in: Regenerate.
272 2016-06-30 Alan Modra <amodra@gmail.com>
274 * testsuite/Makefile.am (memory_test, memory_test_2): Pass
275 -Wl,-z to gcc, not plain -z.
276 * testsuite/Makefile.in: Regenerate.
278 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
281 * i386.cc (Target_i386::Relocate::relocate): Allow
282 R_386_GOT32X relocation against ___tls_get_addr.
283 (Target_i386::Relocate::tls_gd_to_ie): Support indirect
284 call to __tls_get_addr.
285 (Target_i386::Relocate::tls_gd_to_le): Likewise.
286 (Target_i386::Relocate::tls_ld_to_le): Likewise.
287 * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
288 pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
289 (pr20308a_test_SOURCES): New.
290 (pr20308a_test_DEPENDENCIES): Likewise.
291 (pr20308a_test_CFLAGS): Likewise.
292 (pr20308a_test_LDFLAGS): Likewise.
293 (pr20308a_test_LDADD): Likewise.
294 (pr20308b_test_SOURCES): Likewise.
295 (pr20308b_test_DEPENDENCIES): Likewise.
296 (pr20308b_test_CFLAGS): Likewise.
297 (pr20308b_test_LDFLAGS): Likewise.
298 (pr20308b_test_LDADD): Likewise.
299 (pr20308c_test_SOURCES): Likewise.
300 (pr20308c_test_DEPENDENCIES): Likewise.
301 (pr20308c_test_CFLAGS): Likewise.
302 (pr20308c_test_LDFLAGS): Likewise.
303 (pr20308c_test_LDADD): Likewise.
304 (pr20308d_test_SOURCES): Likewise.
305 (pr20308d_test_DEPENDENCIES): Likewise.
306 (pr20308d_test_CFLAGS): Likewise.
307 (pr20308d_test_LDFLAGS): Likewise.
308 (pr20308d_test_LDADD): Likewise.
309 (pr20308e_test_SOURCES): Likewise.
310 (pr20308e_test_DEPENDENCIES): Likewise.
311 (pr20308e_test_CFLAGS): Likewise.
312 (pr20308e_test_LDFLAGS): Likewise.
313 (pr20308e_test_LDADD): Likewise.
314 (pr20308a.so): Likewise.
315 (pr20308b.so): Likewise.
316 (pr20308_gd.o): Likewise.
317 (pr20308_ld.o): Likewise.
318 (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
319 * testsuite/Makefile.in: Regenerated.
320 * testsuite/pr20308_def.c: New file.
321 * testsuite/pr20308_gd.S: Likewise.
322 * testsuite/pr20308_ld.S: Likewise.
323 * testsuite/pr20308_main.c: Likewise.
325 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
328 * configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
330 * configure: Regenerated.
331 * x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
332 R_X86_64_GOTPCRELX relocation against __tls_get_addr.
333 (Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
334 call to __tls_get_addr.
335 (Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
336 (Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
337 * testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
338 pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
339 (pr20216a_test_SOURCES): New.
340 (pr20216a_test_DEPENDENCIES): Likewise.
341 (pr20216a_test_CFLAGS): Likewise.
342 (pr20216a_test_LDFLAGS): Likewise.
343 (pr20216a_test_LDADD): Likewise.
344 (pr20216b_test_SOURCES): Likewise.
345 (pr20216b_test_DEPENDENCIES): Likewise.
346 (pr20216b_test_CFLAGS): Likewise.
347 (pr20216b_test_LDFLAGS): Likewise.
348 (pr20216b_test_LDADD): Likewise.
349 (pr20216c_test_SOURCES): Likewise.
350 (pr20216c_test_DEPENDENCIES): Likewise.
351 (pr20216c_test_CFLAGS): Likewise.
352 (pr20216c_test_LDFLAGS): Likewise.
353 (pr20216c_test_LDADD): Likewise.
354 (pr20216d_test_SOURCES): Likewise.
355 (pr20216d_test_DEPENDENCIES): Likewise.
356 (pr20216d_test_CFLAGS): Likewise.
357 (pr20216d_test_LDFLAGS): Likewise.
358 (pr20216d_test_LDADD): Likewise.
359 (pr20216e_test_SOURCES): Likewise.
360 (pr20216e_test_DEPENDENCIES): Likewise.
361 (pr20216e_test_CFLAGS): Likewise.
362 (pr20216e_test_LDFLAGS): Likewise.
363 (pr20216e_test_LDADD): Likewise.
364 (pr20216a.so): Likewise.
365 (pr20216b.so): Likewise.
366 (pr20216_gd.o): Likewise.
367 (pr20216_ld.o): Likewise.
368 (MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
369 * testsuite/Makefile.in: Regenerated.
370 * testsuite/pr20216_def.c: New file.
371 * testsuite/pr20216_gd.S: Likewise.
372 * testsuite/pr20216_ld.S: Likewise.
373 * testsuite/pr20216_main.c: Likewise.
375 2016-06-29 Alan Modra <amodra@gmail.com>
377 * script_test_12.t: Delete .plt, specify 64k page size.
378 * script_test_12i.t: Likewise.
380 2016-06-29 Alan Modra <amodra@gmail.com>
382 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
385 2016-06-29 Alan Modra <amodra@gmail.com>
387 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
388 * testsuite/Makefile.in: Regenerate.
390 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
392 * aarch64-reloc.def (NONE): New relocation.
393 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
394 (Target_aarch64::Scan::global): Likewise.
395 * testsuite/Makefile.am (aarch64_reloc_none): New test.
396 * testsuite/Makefile.in: Regenerate.
397 * testsuite/aarch64_reloc_none.s: New test source file.
398 * testsuite/aarch64_reloc_none.sh: New test script.
400 2016-06-28 Sriraman Tallam <tmsriram@google.com>
402 * x86_64.cc (Lazy_view): New class.
403 (can_convert_mov_to_lea): Templatize function. Make the function
404 check for appropriate relocation types and use the view parameter
405 to get section contents.
406 (can_convert_callq_to_direct): New function.
407 (Target_x86_64<size>::Scan::global): Refactor.
408 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
409 call via GOT that can be converted.
410 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
411 * testsuite/Makefile.in: Regenerate.
412 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
413 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
415 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
417 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
418 from the top level to the places of its use.
420 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
423 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
424 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
425 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
426 (Output_section_element_input::print): Likewise.
427 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
428 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
429 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
431 * testsuite/Makefile.am (script_test_14): New test.
432 * testsuite/Makefile.in: Regenerate.
433 * testsuite/script_test_14.s: New test source file.
434 * testsuite/script_test_14.sh: New test script.
435 * testsuite/script_test_14.t: New test linker script.
437 2016-06-28 James Clarke <jrtc27@jrtc27.com>
439 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
440 to R_SPARC_RELATIVE if class is ELFCLASS64.
441 (Target_sparc::Scan::global): Likewise.
443 2016-06-23 Cary Coutant <ccoutant@gmail.com>
444 Igor Kudrin <ikudrin@accesssoftek.com>
448 (Output_section_element_input::set_section_addresses): Keep bin_count
449 separate from input_pattern_count.
450 * testsuite/script_test_12.t: Add another section .x4.
451 * testsuite/script_test_12i.t: Likewise.
452 * testsuite/script_test_12a.c: Likewise.
453 * testsuite/script_test_12b.c: Likewise.
455 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
457 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
459 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
462 * NEWS: Mention --enable-relro.
463 * configure.ac: Add --enable-relro.
464 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
466 * config.in: Regenerated.
467 * configure: Likewise.
468 * options.h (General_options::relro): Default to
471 2016-06-20 Cary Coutant <ccoutant@gmail.com>
473 * NEWS: Add new features in 1.12.
474 * version.cc (version_string): Bump to 1.12.
476 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
479 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
481 (Target_i386::plt_entry_size): Likewise.
482 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
483 (Target_x86_64<size>::plt_entry_size): Likewise.
485 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
487 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
488 (Target_mips::rld_map_): New data member.
489 (Target_mips::do_finalize_sections): Add support for
490 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
491 .rld_map section, and __RLD_MAP symbol.
492 (Target_mips::do_dynamic_tag_custom_value): Add support for
493 DT_MIPS_RLD_MAP_REL dynamic tag.
494 * output.cc (Output_data_dynamic::get_entry_offset): New method
496 * output.h (Output_data_dynamic::get_entry_offset): New method
499 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
501 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
503 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
505 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
506 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
507 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
508 (is_matching_lo16_reloc): Likewise.
509 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
510 (Mips_output_data_plt::plt_entry_r6): New static data member for
512 (Target_mips::is_output_r6): New method.
513 (Target_mips::Mips_mach): Add new enum constants.
514 (Mips_relocate_functions::Status): Likewise.
515 (Mips_relocate_functions::pchi16_relocs): New static data member.
516 (Mips_relocate_functions::relpc21): New method.
517 (Mips_relocate_functions::relpc26): Likewise.
518 (Mips_relocate_functions::relpc18): Likewise.
519 (Mips_relocate_functions::relpc19): Likewise.
520 (Mips_relocate_functions::relpchi16): Likewise.
521 (Mips_relocate_functions::do_relpchi16): Likewise.
522 (Mips_relocate_functions::relpclo16): Likewise.
523 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
525 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
526 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
527 E_MIPS_ARCH_64R6 support.
528 (Target_mips::update_abiflags_isa): Likewise.
529 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
530 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
532 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
534 (Target_mips::Scan::global): Add support for relocs:
535 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
536 (Target_mips::Relocate::relocate): Call functions for resolving
537 Mips32r6 and Mips64r6 relocations, and print error message for
538 STATUS_PCREL_UNALIGNED.
539 (Target_mips::Scan::get_reference_flags): Add support for relocs:
540 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
541 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
542 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
543 E_MIPS_ARCH_64R6 support.
545 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
548 * testsuite/script_test_2.t: Add .got.plt after .got.
550 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
552 * mips.cc (struct Mips_abiflags): New struct.
553 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
555 (Mips_relobj::~Mips_relobj): Delete object pointed by
556 attributes_section_data_.
557 (Mips_relobj::abiflags): New method.
558 (Mips_relobj::attributes_section_data): Likewise.
559 (Mips_relobj::attributes_section_data_): New data member.
560 (Mips_relobj::abiflags_): Likewise.
561 (class Mips_output_section_abiflags): New class.
562 (Target_mips::Target_mips): Initialize attributes_section_data_,
563 abiflags_ and has_abiflags_section_.
564 (Target_mips::do_should_include_section): Don't emit input
565 .MIPS.abiflags sections to output .MIPS.abiflags.
566 (Target_mips::Mips_mach): Add new enum constants.
567 (Target_mips::mips_isa_ext_mach): New method.
568 (Target_mips::mips_isa_ext): Likewise.
569 (Target_mips::update_abiflags_isa): Likewise.
570 (Target_mips::infer_abiflags): Likewise.
571 (Target_mips::create_abiflags): Likewise.
572 (Target_mips::fp_abi_string): Likewise.
573 (Target_mips::select_fp_abi): Likewise.
574 (Target_mips::merge_obj_attributes): Likewise.
575 (Target_mips::merge_obj_abiflags): Likewise.
576 (Target_mips::level_rev): Likewise.
577 (Target_mips::merge_obj_e_flags): Rename from
578 merge_processor_specific_flags. Remove dyn_obj argument,
579 call update_abiflags_isa when needed, compare NaN encodings and
581 (Target_mips::add_machine_extensions): Add two machine extensions
583 (Target_mips::attributes_section_data_): New data member.
584 (Target_mips::abiflags_): Likewise.
585 (Target_mips::has_abiflags_section_): Likewise.
586 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
587 .MIPS.abiflags sections if they exists.
588 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
589 E_MIPS_MACH_OCTEON3 support.
590 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
591 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
592 .MIPS.abiflags sections from input. Create these sections if
594 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
595 E_MIPS_MACH_OCTEON3 support, and change strings for
596 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
599 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
601 * mips.cc (Mips_relobj::Mips_relobj): Initialize
602 has_reginfo_section_.
603 (Mips_relobj::has_reginfo_section_): New data member.
604 (Mips_relobj::has_reginfo_section): New method.
605 (class Mips_output_section_reginfo): Change base class to
606 Output_section_data, and set masks of the output .reginfo section
608 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
610 (Mips_output_section_reginfo::set_masks): Likewise.
611 (Mips_output_section_reginfo::set_final_data_size): Likewise.
612 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
613 (Target_mips::do_make_output_section): Remove.
614 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
615 if the object contains a .reginfo section.
616 (Target_mips::do_finalize_sections): Create a .reginfo output
619 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
621 * mips.cc (Mips_output_data_got::do_write): Add missing template
624 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
627 * s390.cc (Target_s390::ss_code_st_r14): Removed.
628 (Target_s390::ss_code_l_r14): Removed.
629 (Target_s390::ss_code_ear): Removed.
630 (Target_s390::ss_code_c): Removed.
631 (Target_s390::ss_match_st_r14): New function.
632 (Target_s390::ss_match_l_r14): New function.
633 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
634 of matching code directly.
635 (Target_s390::ss_match_ear): New function.
636 (Target_s390::ss_match_c): New function.
637 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
638 of matching code directly.
640 2016-05-19 Cary Coutant <ccoutant@gmail.com>
643 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
644 parameter; check for protected symbol.
645 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
646 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
647 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
648 (Symbol_table::add_from_dynobj): Mark protected symbols.
649 * symtab.h (Symbol::is_protected): New method.
650 (Symbol::set_is_protected): New method.
651 (Symbol::is_protected_): New data member.
653 * testsuite/Makefile.am (copy_test_protected): New test.
654 * testsuite/Makefile.in: Regenerate.
655 * testsuite/copy_test.cc (main): Add legal reference to protected
657 * testsuite/copy_test_v1.cc (main): Likewise.
658 * testsuite/copy_test_2.cc (ip): Add protected symbol.
659 * testsuite/copy_test_protected.cc: New test source file.
660 * testsuite/copy_test_protected.sh: New test script.
662 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
664 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
665 for global got symbols, and set addend to 0.
666 (Mips_got_entry::hash): Change hash algorithm.
667 (Mips_got_entry::equals): Refactor.
668 (Mips_got_entry::object): Return input object for local got symbols
670 (Mips_got_entry::addend): Change return of the relocation addend.
671 (Mips_got_entry::addend_): Move from union d.
672 (Mips_got_entry::object_): Move into union d.
673 (class Mips_symbol_hash): New class.
674 (Mips_got_info::Global_got_entry_set): New type.
675 (Mips_got_info::global_got_symbols): Change return type to
676 Global_got_entry_set.
677 (Mips_got_info::global_got_symbols_): Change type to
678 Global_got_entry_set.
679 (Mips_symbol::hash): New method.
680 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
681 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
682 (Mips_output_data_mips_stubs::symbols_): Change type to
683 Mips_stubs_entry_set.
684 (Mips_got_info::record_global_got_symbol): Don't pass object
685 argument when creating global got symbol.
686 (Mips_got_info::record_got_entry): Remove find before inserting
688 (Mips_got_info::add_reloc_only_entries): Change type of iterator
689 to Global_got_entry_set.
690 (Mips_got_info::count_got_symbols): Likewise.
691 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
692 for adding entries to symbols_.
693 (Mips_output_data_la25_stub::do_write): Change type of iterator
695 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
696 of iterator to Mips_stubs_entry_set.
697 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
698 (Mips_output_data_mips_stubs::do_write): Likewise.
700 2016-05-06 Han Shen <shenhan@google.com>
704 * aarch64-reloc.def: New relocation type.
705 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
706 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
707 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
708 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
710 2016-04-28 Nick Clifton <nickc@redhat.com>
712 * po/zh_CN.po: Updated Chinese (simplified) translation.
714 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
716 * Makefile.in: Regenerated with automake 1.11.6.
717 * aclocal.m4: Likewise.
718 * testsuite/Makefile.in: Likewise.
720 2016-03-30 Cary Coutant <ccoutant@gmail.com>
723 * symtab.cc (Symbol_table::define_default_version): Check for case
724 where symbols are both in different shared objects.
726 2016-03-27 Cary Coutant <ccoutant@gmail.com>
729 * i386.cc (Target_i386): Add check for fully-resolved symbol for
732 2016-03-22 Nick Clifton <nickc@redhat.com>
734 * configure: Regenerate.
736 2016-03-21 Cary Coutant <ccoutant@gmail.com>
739 * errors.cc (Errors::undefined_symbol): Add info message when
740 symbol should have been provided by a plugin.
741 * target-reloc.h (issue_undefined_symbol_error): Check for
742 placeholder symbols defined in discarded sections.
743 * testsuite/Makefile.am (plugin_test_9b): New test case.
744 * testsuite/Makefile.in: Regenerate.
745 * testsuite/plugin_test_9b_elf.cc: New test source file.
746 * testsuite/plugin_test_9b_ir.cc: New test source file.
748 2016-03-20 Cary Coutant <ccoutant@gmail.com>
751 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
752 * testsuite/Makefile.am (eh_test_2): New test.
753 * testsuite/Makefile.in: Regenerate.
754 * testsuite/eh_test_2.sh: New test script.
755 * testsuite/eh_test_a.cc (bar): Make it comdat.
756 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
758 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
760 * mips.cc (Mips_relobj::is_n64_): Remove.
761 (Target_mips::ei_class_): Likewise.
762 (Mips_relobj::is_newabi): Call methods.
763 (Mips_relobj::is_n64): Change checking for N64 ABI.
764 (Target_mips::is_output_n64): Likewise.
765 (Target_mips::merge_processor_specific_flags): Remove ei_class
766 argument, and remove comparing ei_class.
767 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
769 (Target_mips::do_finalize_sections): Don't pass ei_class argument
770 to merge_processor_specific_flags.
771 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
772 change checking for N64 ABI.
774 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
776 * mips.cc (enum Special_relocation_symbol): New enum type.
777 (is_readonly_section): New function.
778 (eh_reloc): Likewise.
779 (Mips_got_entry::is_section_symbol_): New member.
780 (Mips_got_entry::is_section_symbol): New method.
781 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
783 (Mips_relobj::mips_elf_options_section_name): New method.
784 (Mips_output_data_got::record_local_got_symbol): Add
785 is_section_symbol argument, and pass it to
786 Mips_got_info::record_local_got_symbol.
787 (Mips_output_data_got::got_offset): Add addend argument, and pass
788 it to Relobj::local_got_offset.
789 (struct Mips_output_reloc_writer): New type.
790 (class Mips_output_data_reloc): New class.
791 (Mips_output_data_plt::Reloc_section): Change type to
792 Mips_output_data_reloc.
793 (Target_mips::Reloc_section): Likewise.
794 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
795 (Mips_classify_reloc::get_r_type2): New method.
796 (Mips_classify_reloc::get_r_type3): Likewise.
797 (Mips_classify_reloc::get_r_ssym): Likewise.
798 (Target_mips::Reloca_section): Remove.
799 (Relocate::should_apply_static_reloc): Rename from
800 should_apply_r_mips_32_reloc.
801 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
803 (Mips_relocate_functions::Valtype): New type.
804 (Mips_relocate_functions::Valtype64): New type.
805 (Mips_relocate_functions::check_overflow): New method.
806 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
808 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
809 (Mips_relocate_functions::rel16): Add support for resolving
810 relocations for Mips64.
811 (Mips_relocate_functions::rel32): Likewise.
812 (Mips_relocate_functions::reljalr): Likewise.
813 (Mips_relocate_functions::relpc32): Likewise.
814 (Mips_relocate_functions::rel26): Likewise.
815 (Mips_relocate_functions::relpc16): Likewise.
816 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
817 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
818 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
819 (Mips_relocate_functions::do_relhi16): Likewise.
820 (Mips_relocate_functions::do_relgot16_local): Likewise.
821 (Mips_relocate_functions::rello16): Likewise.
822 (Mips_relocate_functions::relgot): Likewise.
823 (Mips_relocate_functions::relgotpage): Likewise.
824 (Mips_relocate_functions::relgotofst): Likewise.
825 (Mips_relocate_functions::relgot_hi16): Likewise.
826 (Mips_relocate_functions::relgot_lo16): Likewise.
827 (Mips_relocate_functions::relgprel): Likewise.
828 (Mips_relocate_functions::relgprel32): Likewise.
829 (Mips_relocate_functions::tlsrelhi16): Likewise.
830 (Mips_relocate_functions::tlsrello16): Likewise.
831 (Mips_relocate_functions::tlsrel32): Likewise.
832 (Mips_relocate_functions::relsub): Likewise.
833 (Mips_relocate_functions::releh): New method.
834 (Mips_relocate_functions::rel64): Likewise.
835 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
836 pass it to Mips_got_entry.
837 (Mips_got_info::add_local_entries): Pass addend argument
838 to code functions, and for STT_SECTION symbols call
839 add_symbolless_local_addend.
840 (Mips_got_info::add_tls_entries): Pass addend argument to code
842 (Mips_relobj::do_read_symbols): Read gp value that was used to
844 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
845 instruction. Opcode for instruction will be selected later.
846 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
847 (Target_mips::scan_relocatable_relocs): Likewise.
848 (Target_mips::emit_relocs_scan): Likewise.
849 (Target_mips::relocate_relocs): Likewise.
850 (Target_mips::do_finalize_sections): Skip objects for merging
851 processor specific flags in which all input sections will be
853 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
854 (Target_mips::Scan::get_reference_flags): Likewise.
855 (Target_mips::relocate_special_relocatable): Call rel26 method with
856 calculate_only and calculated_value arguments.
857 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
858 dynamic relocation against a readonly sections, and pass
859 is_section_symbol to Mips_got_info::record_local_got_symbol.
860 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
861 dynamic relocation against a readonly sections, and pass r_type
862 and r_offset to Target_mips::copy_reloc.
863 (Target_mips::Relocate::relocate): Add support for resolving
864 relocations for Mips64.
865 (Target_mips::mips_info): Add case for Mips64 default dynamic
867 (Target_selector_mips): Correct emulation names.
869 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
871 * mips.cc (class Mips_output_data_la25_stub): Add
872 do_print_to_mapfile function.
874 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
876 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
879 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
881 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
882 * testsuite/plugin_layout_with_alignment.c: This.
883 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
884 (plugin_layout_with_alignment): Likewise.
885 * testsuite/Makefile.in: Regenerated.
887 2016-03-08 Cary Coutant <ccoutant@gmail.com>
890 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
892 * testsuite/Makefile.in: Regenerate.
893 * testsuite/dynamic_list.sh: Likewise.
894 * testsuite/retain_symbols_file_test.sh: Likewise.
896 2016-03-08 Cary Coutant <ccoutant@gmail.com>
899 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
900 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
902 2016-03-08 Cary Coutant <ccoutant@gmail.com>
903 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
905 * output.cc (Output_reloc_writer): New type.
906 (Output_data_reloc_base::do_write): Move implementation to template
907 in output.h and replace with invocation of template.
908 * output.h (Output_file): Move to top of file.
909 (Output_reloc::get_symbol_index): Move to public interface.
910 (Output_reloc::get_address): Likewise.
911 (Output_data_reloc_base::do_write_generic): New function template.
913 2016-03-04 Cary Coutant <ccoutant@gmail.com>
917 * symtab.cc: Instantiate Sized_symbol::init_constant and
918 Sized_symbol::init_undefined.
920 2016-03-03 Cary Coutant <ccoutant@gmail.com>
923 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
924 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
925 * mips.cc (Target_mips::make_symbol): Adjust function signature.
926 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
927 (Target_sparc::do_is_defined_by_abi): Remove test for
929 (Target_sparc::Register_symbol): New struct type.
930 (Target_sparc::register_syms_): New data member.
931 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
932 (Target_sparc::make_symbol): New function.
933 (Target_sparc::do_finalize_sections): Add register symbols and new
934 dynamic table entries.
935 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
936 (Symbol_table::add_target_global_symbol): New function.
937 (Symbol_table::target_symbols_): New data member.
938 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
939 (Symbol_table::Symbol_table): Initialize target_symbols_.
940 (Symbol_table::add_from_object): Pass additional parameters to
942 (Symbol_table::define_special_symbol): Likewise.
943 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
944 undefined symbol value.
945 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
946 (Symbol_table::sized_finalize): Likewise.
947 (Symbol_table::sized_write_globals): Likewise.
948 * target.h (Sized_target::make_symbol): Add name, st_type, object,
949 st_shndx, and value parameters.
951 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
953 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
954 LDPK_WEAKUNDEF symbols.
956 2016-03-03 Than McIntosh <thanm@google.com>
958 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
959 and get_input_section_alignment in transfer vector.
960 (get_input_section_alignment): New function.
961 (get_input_section_size): New function.
962 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
963 * testsuite/Makefile.in: [Regenerate.]
964 * testsuite/plugin_section_alignment.cc: New test file.
965 * testsuite/plugin_layout_with_alignment.cc: New test file.
966 * testsuite/plugin_layout_with_alignment.sh: New test file.
968 2016-03-03 Evgenii Stepanov <eugenis@google.com>
970 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
972 * plugin.cc (get_symbols_v3): New function.
973 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
974 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
977 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
978 Cary Coutant <ccoutant@gmail.com>
981 * ehframe.h (Cie::fde_encoding): New method.
982 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
985 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
987 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
988 -mrelax-relocations=yes to $(TEST_AS).
989 (x86_64_mov_to_lea6.o): Likewise.
990 (x86_64_overflow_pc32.o): Remove duplicated target.
991 * testsuite/Makefile.in: Regenerated.
993 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
995 * s390.cc (Target_s390::match_view_u): New helper method.
996 (Target_s390::do_is_call_to_non_split): New method.
997 (Target_s390::ss_code_st_r14): New const.
998 (Target_s390::ss_code_l_r14): New const.
999 (Target_s390::ss_code_bras_8): New const.
1000 (Target_s390::ss_code_l_basr): New const.
1001 (Target_s390::ss_code_a_basr): New const.
1002 (Target_s390::ss_code_ear): New const.
1003 (Target_s390::ss_code_c): New const.
1004 (Target_s390::ss_code_larl): New const.
1005 (Target_s390::ss_code_brasl): New const.
1006 (Target_s390::ss_code_jg): New const.
1007 (Target_s390::ss_code_jgl): New const.
1008 (Target_s390::ss_match_mcount): New helper method.
1009 (Target_s390::ss_match_l): New helper method.
1010 (Target_s390::ss_match_ahi): New helper method.
1011 (Target_s390::ss_match_alfi): New helper method.
1012 (Target_s390::ss_match_cr): New helper method.
1013 (Target_s390::do_calls_non_split): New method.
1014 * testsuite/Makefile.am: Added new tests.
1015 * testsuite/Makefile.in: Regenerate.
1016 * testsuite/split_s390.sh: New test.
1017 * testsuite/split_s390_1_a1.s: New test.
1018 * testsuite/split_s390_1_a2.s: New test.
1019 * testsuite/split_s390_1_n1.s: New test.
1020 * testsuite/split_s390_1_n2.s: New test.
1021 * testsuite/split_s390_1_z1.s: New test.
1022 * testsuite/split_s390_1_z2.s: New test.
1023 * testsuite/split_s390_1_z3.s: New test.
1024 * testsuite/split_s390_1_z4.s: New test.
1025 * testsuite/split_s390_2_ns.s: New test.
1026 * testsuite/split_s390_2_s.s: New test.
1027 * testsuite/split_s390x_1_a1.s: New test.
1028 * testsuite/split_s390x_1_a2.s: New test.
1029 * testsuite/split_s390x_1_n1.s: New test.
1030 * testsuite/split_s390x_1_n2.s: New test.
1031 * testsuite/split_s390x_1_z1.s: New test.
1032 * testsuite/split_s390x_1_z2.s: New test.
1033 * testsuite/split_s390x_1_z3.s: New test.
1034 * testsuite/split_s390x_1_z4.s: New test.
1035 * testsuite/split_s390x_2_ns.s: New test.
1036 * testsuite/split_s390x_2_s.s: New test.
1038 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
1040 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
1041 info message for every erratum 843419 found and fixed.
1043 2016-02-07 Cary Coutant <ccoutant@gmail.com>
1046 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
1047 information to relocation overflow errors.
1049 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1052 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
1053 overflow checking when symbol value + addend < 0.
1055 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1058 * reloc.h (Limits): New class.
1059 (Bits::has_overflow32): Use min/max values from Limits.
1060 (Bits::has_unsigned_overflow32): Likewise.
1061 (Bits::has_signed_unsigned_overflow32): Likewise.
1062 (Bits::has_overflow): Likewise.
1063 (Bits::has_unsigned_overflow): Likewise.
1064 (Bits::has_signed_unsigned_overflow64): Likewise.
1066 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1069 * reloc.h (Relocate_functions::Overflow_check): Add comments.
1070 * x86_64.cc (X86_64_relocate_functions): New class.
1071 (Target_x86_64::Relocate::relocate): Use the new class.
1072 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
1073 (x32_overflow_pc32): New test case.
1074 * testsuite/Makefile.in: Regenerate.
1075 * testsuite/x32_overflow_pc32.sh: New script.
1076 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
1078 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1081 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
1082 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
1084 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1087 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
1089 (Bits::has_unsigned_overflow): Likewise.
1091 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
1093 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
1095 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
1096 and view_size to is_call_to_non_split.
1097 * target.cc (Target::is_call_to_non_split): Add view and view_size
1099 * target.h (class Target): Likewise.
1101 2016-02-05 Sriraman Tallam <tmsriram@google.com>
1103 * icf.cc (get_rel_addend): New function.
1104 (get_section_contents): Move merge section addend computation to a
1105 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
1106 Fix bug to not read past the length of the section.
1108 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1109 Andrew Senkevich <andrew.senkevich@intel.com>
1112 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
1113 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
1115 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
1116 * testsuite/x86_64_overflow_pc32.sh: New test script.
1117 * testsuite/x86_64_overflow_pc32.s: New source file.
1119 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1122 * reloc.h (Relocate_functions::Address): New typedef.
1123 (Relocate_functions::Addendtype): New typedef.
1124 (Relocate_functions::Overflow_check): New enum type.
1125 (Relocate_functions::Reloc_status): New enum type.
1126 (Relocate_functions::check_overflow): New function template.
1127 (Relocate_functions::rel): Add check parameter; check for overflow.
1128 (Relocate_functions::rel_unaligned): Likewise.
1129 (Relocate_functions::rela): Likewise.
1130 (Relocate_functions::pcrel): Likewise.
1131 (Relocate_functions::pcrel_unaligned): Likewise.
1132 (Relocate_functions::pcrela): Likewise.
1133 (Relocate_functions::rel8): Adjust parameter types.
1134 (Relocate_functions::rela8): Likewise.
1135 (Relocate_functions::pcrel8): Likewise.
1136 (Relocate_functions::pcrela8): Likewise.
1137 (Relocate_functions::rel16): Likewise.
1138 (Relocate_functions::rela168): Likewise.
1139 (Relocate_functions::pcrel16): Likewise.
1140 (Relocate_functions::pcrela16): Likewise.
1141 (Relocate_functions::rel32): Likewise.
1142 (Relocate_functions::rel32_unaligned): Likewise.
1143 (Relocate_functions::rela32): Likewise.
1144 (Relocate_functions::pcrel32): Likewise.
1145 (Relocate_functions::pcrel32_unaligned): Likewise.
1146 (Relocate_functions::pcrela32): Likewise.
1147 (Relocate_functions::rel8_check): New function.
1148 (Relocate_functions::rela8_check): New function.
1149 (Relocate_functions::pcrel8_check): New function.
1150 (Relocate_functions::pcrela8_check): New function.
1151 (Relocate_functions::rel16_check): New function.
1152 (Relocate_functions::rela168_check): New function.
1153 (Relocate_functions::pcrel16_check): New function.
1154 (Relocate_functions::pcrela16_check): New function.
1155 (Relocate_functions::rel32_check): New function.
1156 (Relocate_functions::rel32_unaligned_check): New function.
1157 (Relocate_functions::rela32_check): New function.
1158 (Relocate_functions::pcrel32_check): New function.
1159 (Relocate_functions::pcrel32_unaligned_check): New function.
1160 (Relocate_functions::pcrela32_check): New function.
1161 (Bits::has_unsigned_overflow32): New function.
1162 (Bits::has_unsigned_overflow): New function.
1163 * testsuite/Makefile.am (overflow_unittest): New test.
1164 * testsuite/Makefile.in: Regenerate.
1165 * testsuite/overflow_unittest.cc: New source file.
1167 2016-02-04 Alan Modra <amodra@gmail.com>
1169 * powerpc.cc (relocate): Adjust last patch for big-endian.
1171 2016-02-02 Alan Modra <amodra@gmail.com>
1173 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
1175 2016-01-15 Han Shen <shenhan@google.com>
1177 PR gold/19472 - need pc-relative stubs.
1179 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
1180 stub type for DSOs and pie executables.
1182 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
1184 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
1187 2016-01-12 Cary Coutant <ccoutant@gmail.com>
1189 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
1190 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
1191 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
1192 specializations) New method.
1194 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1197 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
1198 we have a TLS segment for GD-to-IE optimization.
1199 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
1201 (Target_i386::tls_desc_gd_to_ie): Likewise.
1202 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
1203 for TLSDESC GD-to-IE optimizations.
1204 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
1206 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
1207 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
1208 for TLSDESC GD-to-IE optimizations.
1210 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1212 Refactor gold to enable support for MIPS-64 relocation format.
1214 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
1215 (gc_process_relocs): Remove sh_type template parameter.
1216 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
1217 * object.h (Sized_relobj_file::split_stack_adjust): Add target
1219 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
1220 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
1221 specializations) Remove.
1222 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
1223 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
1224 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
1225 (Sized_relobj_file::split_stack_adjust): Add target parameter.
1227 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
1228 Target::get_r_sym() to get r_sym field from relocations.
1229 (Track_relocs::next_symndx): Call Target::get_r_sym().
1230 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
1231 add Classify_reloc template parameter. Use for accessing r_sym and
1233 (relocate_section): Likewise.
1234 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
1235 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
1236 (Default_scan_relocatable_relocs::Reltype): New typedef.
1237 (Default_scan_relocatable_relocs::reloc_size): New const.
1238 (Default_scan_relocatable_relocs::sh_type): New const.
1239 (Default_scan_relocatable_relocs::get_r_sym): New method.
1240 (Default_scan_relocatable_relocs::get_r_type): New method.
1241 (Default_emit_relocs_strategy): New class.
1242 (scan_relocatable_relocs): Replace sh_type template parameter with
1243 Scan_relocatable_relocs class. Use it to access r_sym and r_type
1245 (relocate_relocs): Replace sh_type template parameter with
1246 Classify_reloc class. Use it to access r_sym and r_type fields.
1247 * target.h (Target::is_call_to_non_split): Replace r_type parameter
1248 with pointer to relocation. Adjust all callers.
1249 (Target::do_is_call_to_non_split): Likewise.
1250 (Target::emit_relocs_scan): New virtual method.
1251 (Sized_target::get_r_sym): New virtual method.
1252 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
1253 with pointer to relocation.
1255 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
1256 (Target_aarch64::Relocatable_size_for_reloc): Remove.
1257 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
1258 (Target_aarch64::scan_relocs): Likewise.
1259 (Target_aarch64::relocate_section): Likewise.
1260 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
1262 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
1263 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
1264 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
1266 (Target_arm::emit_relocs_scan): New method.
1267 (Target_arm::Relocatable_size_for_reloc): Replace with...
1268 (Target_arm::Classify_reloc): ...this.
1269 (Target_arm::gc_process_relocs): Use Classify_reloc.
1270 (Target_arm::scan_relocs): Likewise.
1271 (Target_arm::relocate_section): Likewise.
1272 (Target_arm::scan_relocatable_relocs): Likewise.
1273 (Target_arm::relocate_relocs): Likewise.
1274 * i386.cc (Target_i386::emit_relocs_scan): New method.
1275 (Target_i386::Relocatable_size_for_reloc): Replace with...
1276 (Target_i386::Classify_reloc): ...this.
1277 (Target_i386::gc_process_relocs): Use Classify_reloc.
1278 (Target_i386::scan_relocs): Likewise.
1279 (Target_i386::relocate_section): Likewise.
1280 (Target_i386::scan_relocatable_relocs): Likewise.
1281 (Target_i386::relocate_relocs): Likewise.
1282 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
1284 (Mips_reloc_types): New class template.
1285 (Mips_classify_reloc): New class template.
1286 (Target_mips::Reltype): New typedef.
1287 (Target_mips::Relatype): New typedef.
1288 (Target_mips::emit_relocs_scan): New method.
1289 (Target_mips::get_r_sym): New method.
1290 (Target_mips::Relocatable_size_for_reloc): Replace with
1291 Mips_classify_reloc.
1292 (Target_mips::copy_reloc): Use Mips_classify_reloc.
1293 (Target_mips::gc_process_relocs): Likewise.
1294 (Target_mips::scan_relocs): Likewise.
1295 (Target_mips::relocate_section): Likewise.
1296 (Target_mips::scan_relocatable_relocs): Likewise.
1297 (Target_mips::relocate_relocs): Likewise.
1298 (mips_get_size_for_reloc): New function, factored out from
1299 Relocatable_size_for_reloc::get_size_for_reloc.
1300 (Target_mips::Scan::local): Use Mips_classify_reloc.
1301 (Target_mips::Scan::global): Likewise.
1302 (Target_mips::Relocate::relocate): Likewise.
1303 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
1304 (Target_powerpc::Relocatable_size_for_reloc): Remove.
1305 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
1306 (Target_powerpc::scan_relocs): Likewise.
1307 (Target_powerpc::relocate_section): Likewise.
1308 (Powerpc_scan_relocatable_reloc): Convert to class template.
1309 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
1310 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
1311 (Powerpc_scan_relocatable_reloc::sh_type): New const.
1312 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
1313 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
1314 (Target_powerpc::scan_relocatable_relocs): Use
1315 Powerpc_scan_relocatable_reloc.
1316 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
1317 * s390.cc (Target_s390::emit_relocs_scan): New method.
1318 (Target_s390::Relocatable_size_for_reloc): Remove.
1319 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
1320 (Target_s390::scan_relocs): Likewise.
1321 (Target_s390::relocate_section): Likewise.
1322 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
1324 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
1325 (Target_s390::relocate_relocs): Use Default_classify_reloc.
1326 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
1327 (Target_sparc::Relocatable_size_for_reloc): Remove.
1328 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
1329 (Target_sparc::scan_relocs): Likewise.
1330 (Target_sparc::relocate_section): Likewise.
1331 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
1333 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
1334 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
1335 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
1336 (Target_tilegx::Relocatable_size_for_reloc): Remove.
1337 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
1338 (Target_tilegx::scan_relocs): Likewise.
1339 (Target_tilegx::relocate_section): Likewise.
1340 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
1342 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
1343 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
1344 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
1345 (Target_x86_64::Relocatable_size_for_reloc): Remove.
1346 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
1347 (Target_x86_64::scan_relocs): Likewise.
1348 (Target_x86_64::relocate_section): Likewise.
1349 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1351 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
1352 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
1354 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
1356 2016-01-01 Alan Modra <amodra@gmail.com>
1358 Update year range in copyright notice of all files.
1360 For older changes see ChangeLog-0815
1362 Copyright (C) 2016 Free Software Foundation, Inc.
1364 Copying and distribution of this file, with or without modification,
1365 are permitted in any medium without royalty provided the copyright
1366 notice and this notice are preserved.
1372 version-control: never