fea77ca4966f886927747326a24321b7b5b75e7b
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2016-12-22 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/17643
4 * options.h (-z bndplt): New option.
5 * x86_64.cc (Output_data_plt_x86_64::regular_count): New method.
6 (Output_data_plt_x86_64::address_for_global): Move implementation into
7 virtual method.
8 (Output_data_plt_x86_64::address_for_local): Likewise.
9 (Output_data_plt_x86_64::got): New method.
10 (Output_data_plt_x86_64::got_plt): New method.
11 (Output_data_plt_x86_64::got_irelative): New method.
12 (Output_data_plt_x86_64::do_address_for_global): New virtual method.
13 (Output_data_plt_x86_64::do_address_for_local): New virtual method.
14 (class Output_data_plt_x86_64_bnd): New class.
15 (Target_x86_64::do_make_data_plt): Move out of line and specialize
16 for each size (both overloads).
17 (Output_data_plt_x86_64::set_final_data_size): Cosmetic changes.
18 * testsuite/Makefile.am (bnd_plt_1): New test case.
19 (bnd_ifunc_1): New test case.
20 (bnd_ifunc_2): New test case.
21 * testsuite/Makefile.in: Regenerate.
22 * testsuite/bnd_ifunc_1.s: New source file.
23 * testsuite/bnd_ifunc_1.sh: New shell script.
24 * testsuite/bnd_ifunc_2.s: New source file.
25 * testsuite/bnd_ifunc_2.sh: New shell script.
26 * testsuite/bnd_plt_1.s: New source file.
27 * testsuite/bnd_plt_1.sh: New shell script.
28
29 2016-12-22 Cary Coutant <ccoutant@gmail.com>
30
31 * layout.cc (Layout::finalize): Track count of forced-local symbols
32 in .dynsym.
33 (Layout::create_symtab_sections): Add local_dynamic_count parameter;
34 use that instead of sh_info value.
35 (Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
36 parameter; pass it to Symtab::set_dynsym_indexes(). Include forced
37 locals in sh_info value. Pass index of first real global to
38 Dynobj::create_gnu_hash_table() and Dynobj::create_elf_hash_table().
39 * layout.h (Layout::create_symtab_sections): Add local_dynamic_count
40 parameter.
41 (Layout::create_dynamic_symtab): Add pforced_local_dynamic_count
42 parameter.
43 * symtab.cc (Symbol_table::set_dynsym_indexes): Add pforced_local_count
44 parameter. Process forced-local symbols first and return the count.
45 (Symbol_table::finalize): Update comments.
46 * symtab.h (Symbol_table::set_dynsym_indexes): Add pforced_local_count
47 parameter.
48 (Symbol_table::first_dynamic_global_index_): Update comment.
49 (Symbol_table::dynamic_count_): Update comment.
50 * testsuite/Makefile.am (ifuncmod1.sh): New test case.
51 * testsuite/Makefile.in: Regenerate.
52 * testsuite/ifuncmod1.sh: New shell script.
53
54 2016-12-21 Cary Coutant <ccoutant@gmail.com>
55
56 * symtab.cc (Symbol_table::define_special_symbol): Add is_forced_local
57 parameter; if set, do not check version script.
58 (Symbol_table::do_define_in_output_data): Pass is_forced_local for
59 STB_LOCAL predefined symbols.
60 (Symbol_table::do_define_in_output_segment): Likewise.
61 (Symbol_table::do_define_in_output_segment): Likewise.
62 (Symbol_table::do_define_as_constant): Likewise.
63 * symtab.h (Symbol_table::define_special_symbol): Add is_forced_local
64 parameter. Adjust all callers.
65 * testsuite/Makefile.am (ver_test_8.sh): New test case.
66 * testsuite/Makefile.in: Regenerate.
67 * ver_test_8.sh: New test script.
68
69 2016-12-21 Cary Coutant <ccoutant@gmail.com>
70
71 * output.cc (Output_segment::first_section): Return NULL if there are
72 no sections in the segment.
73 * output.h (Output_segment::first_section_load_address): Assert that
74 first section is not NULL.
75 * symtab.cc (Symbol_table::sized_write_globals): Attach linker-created
76 segment-relative symbols to first section of the segment.
77
78 2016-12-21 Alan Modra <amodra@gmail.com>
79
80 * arm.cc: Fix comment chars with high bit set.
81
82 2016-12-20 Cary Coutant <ccoutant@gmail.com>
83
84 * testsuite/Makefile.am: Add missing dependencies on gcctestdir/ld
85 or ../ld-new.
86 * testsuite/Makefile.in: Regenerate.
87
88 2016-12-19 Cary Coutant <ccoutant@gmail.com>
89
90 PR gold/20949
91 * script.cc (Lex::get_token): Don't look ahead past NUL characters.
92
93 2016-12-19 Cary Coutant <ccoutant@gmail.com>
94
95 PR gold/14676
96 PR gold/20983
97 * layout.h (Layout::choose_output_section): Add match_input_spec
98 parameter. Adjust all callers.
99 * layout.cc (Layout::choose_output_section): Likewise. Pass
100 match_input_spec to Script_sections::output_section_name().
101 (Layout::create_note): Pass true for match_input_spec.
102 * script-sections.h (Script_sections::output_section_name): Add
103 match_input_spec parameter.
104 * script-sections.cc (Sections_element::output_section_name): Likewise.
105 (Output_section_definition::output_section_name): Likewise.
106 (Script_sections::output_section_name): Likewise.
107
108 2016-12-19 Igor Kudrin <ikudrin@accesssoftek.com>
109
110 * arm.cc (Target_arm::Target_arm): Move initialization code ...
111 (Target_arm::do_select_as_default_target): ... to here.
112 * testsuite/Makefile.am (arm_target_lazy_init): New test case.
113 * testsuite/Makefile.in: Regenerate.
114 * testsuite/arm_target_lazy_init.s: New source file.
115 * testsuite/arm_target_lazy_init.t: New linker script.
116
117 2016-12-19 Cary Coutant <ccoutant@gmail.com>
118
119 PR gold/20976
120 * symtab.cc (Symbol_table::sized_write_globals): Use address of
121 output section, not input section.
122 * testsuite/Makefile.am (pr20976): New test case.
123 * testsuite/Makefile.in: Regenerate.
124 * testsuite/pr20976.c: New source file.
125
126 2016-12-13 Cary Coutant <ccoutant@gmail.com>
127
128 PR gold/20749
129 * options.h (--orphan-handling): New option.
130 (General_options::Orphan_handling): New enum.
131 (General_options::orphan_handling_enum): New method.
132 (General_options::set_orphan_handling_enum): New method.
133 (General_options::orphan_handling_enum_): New data member.
134 * options.cc (General_options::General_options): Initialize new member.
135 (General_options::finalize): Convert --orphan-handling argument to enum.
136 * script-sections.cc (Script_sections::output_section_name): Check it.
137
138 2016-12-13 Cary Coutant <ccoutant@gmail.com>
139
140 PR gold/20522
141 * layout.cc (Layout::choose_output_section): Add is_reloc parameter.
142 Adjust all callers. Do not use linker script for is_reloc sections.
143 (Layout::layout_reloc): Pass is_reloc == true.
144 * layout.h (Layout::choose_output_section): Add is_reloc parameter.
145
146 2016-12-12 Igor Kudrin <ikudrin@accesssoftek.com>
147 Cary Coutant <ccoutant@gmail.com>
148
149 PR gold/14676
150 * script-sections.cc (Output_section_definition::output_section_name):
151 For linker-generated sections, compare with output section name.
152 * testsuite/Makefile.am (script_test_13): New test.
153 * testsuite/Makefile.in: Regenerate.
154 * testsuite/script_test_13.c: New source file.
155 * testsuite/script_test_13.sh: New script.
156 * testsuite/script_test_13.t: New linker script.
157
158 2016-12-12 Cary Coutant <ccoutant@gmail.com>
159
160 * script-sections.cc (Orphan_section_placement::update_last_alloc):
161 New method.
162 (Orphan_section_placement::find_place): Place orphan .data section
163 after either RODATA or TEXT.
164 (Script_sections::place_orphan): Call update_last_alloc for allocated
165 sections.
166 (Script_sections::create_segments): Improve handling of BSS.
167
168 2016-12-13 Alan Modra <amodra@gmail.com>
169
170 PR gold/16711
171 * testsuite/script_test_15a.sh: Allows larger p_filesz.
172 * testsuite/script_test_15b.sh: Likewise.
173 * testsuite/script_test_15c.sh: Likewise.
174
175 2016-12-13 Alan Modra <amodra@gmail.com>
176
177 PR gold/20717
178 * testsuite/pr20717.t: Add .got output section containing .toc.
179
180 2016-12-11 Igor Kudrin <ikudrin@accesssoftek.com>
181
182 PR gold/20717
183 * testsuite/Makefile.am (pr20717): New test.
184 * testsuite/Makefile.in: Regenerate.
185 * testsuite/pr20717.c: New test source file.
186 * testsuite/pr20717.sh: New test script.
187 * testsuite/pr20717.t: New test linker script.
188
189 2016-12-11 Cary Coutant <ccoutant@gmail.com>
190
191 PR gold/16711
192 * output.cc (Output_section::set_final_data_size): Calculate data size
193 based on relative offset rather than file offset.
194 (Output_segment::set_section_addresses): Track file offset separately
195 from address offset.
196 (Output_segment::set_section_list_addresses): Add pfoff parameter.
197 Track file offset separately. Don't move file offset for BSS
198 sections.
199 * output.h (Output_segment::set_section_list_addresses): Add pfoff
200 parameter.
201 * script-sections.cc (Orphan_section_placement): Add PLACE_LAST_ALLOC.
202 (Orphan_section_placement::Orphan_section_placement): Initialize it.
203 (Orphan_section_placement::output_section_init): Track last allocated
204 section.
205 (Orphan_section_placement::find_place): Place BSS after last allocated
206 section.
207 (Output_section_element_input::set_section_addresses): Always override
208 input section alignment when SUBALIGN is specified.
209 (Output_section_definition::set_section_addresses): Override alignment
210 of output section when SUBALIGN is specified.
211
212 * testsuite/Makefile.am (script_test_15a, script_test_15b)
213 (script_test_15c): New test cases.
214 * testsuite/Makefile.in: Regenerate.
215 * testsuite/script_test_2.cc: Adjust expected layout.
216 * testsuite/script_test_15.c: New source file.
217 * testsuite/script_test_15a.sh: New shell script.
218 * testsuite/script_test_15a.t: New linker script.
219 * testsuite/script_test_15b.sh: New shell script.
220 * testsuite/script_test_15b.t: New linker script.
221 * testsuite/script_test_15c.sh: New shell script.
222 * testsuite/script_test_15c.t: New linker script.
223
224 2016-12-08 Alan Modra <amodra@gmail.com>
225
226 * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
227 then asserting.
228
229 2016-12-08 Alan Modra <amodra@gmail.com>
230
231 * options.h (--stub-group-multi): Fix typo.
232
233 2016-12-07 Alan Modra <amodra@gmail.com>
234
235 * options.h (--stub-group-multi): New PowerPC option.
236 * powerpc.cc (Stub_control): Add multi_os_ var and param
237 to constructor. Sort start_ var later. Comment State.
238 (Stub_control::can_add_to_stub_group): Heed multi_os_.
239 (Target_powerpc::group_sections): Update.
240
241 2016-12-07 Alan Modra <amodra@gmail.com>
242
243 PR gold/20878
244 * powerpc.cc (Stub_control): Replace stubs_always_before_branch_
245 with stubs_always_after_branch_, group_end_addr_ with
246 group_start_addr_.
247 (Stub_control::can_add_to_stub_group): Rewrite to suit scanning
248 sections by increasing address.
249 (Target_powerpc::group_sections): Scan that way. Delete corner
250 case.
251 * options.h (--stub-group-size): Update help string.
252
253 2016-12-07 Alan Modra <amodra@gmail.com>
254
255 * powerpc.cc (Stub_table_owner): Provide constructor.
256 (Powerpc_relobj::set_stub_table): Resize fill with -1.
257 (Target_powerpc::Branch_info::make_stub): Provide target debug
258 output on returning false.
259
260 2016-12-05 Cary Coutant <ccoutant@gmail.com>
261 Tristan Gingold <gingold@adacore.com>
262
263 * object.cc (Sized_relobj_file::do_count_local_symbols): Check
264 is_ordinary before using shndx.
265 * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case.
266 * testsuite/Makefile.in: Regenerate.
267 * testsuite/file_in_many_sections.c: New source file.
268 * testsuite/file_in_many_sections_test.sh: New script.
269
270 2016-12-01 Cary Coutant <ccoutant@gmail.com>
271 Igor Kudrin <ikudrin@accesssoftek.com>
272
273 PR gold/20717
274 * script-sections.cc (Script_sections): Set *keep to false when
275 no match.
276
277 2016-12-01 Cary Coutant <ccoutant@gmail.com>
278
279 PR gold/20834
280 * target.h (Target::default_text_segment_address): Bump default
281 start address up to ABI page size.
282
283 2016-12-01 Cary Coutant <ccoutant@gmail.com>
284
285 PR gold/18989
286 * options.cc (General_options::object_format_to_string): New function.
287 (General_options::copy_from_posdep_options): New function.
288 (General_options::parse_push_state): New function.
289 (General_options::parse_pop_state): New function.
290 * options.h (--push-state, --pop-state): New options.
291 (General_options::object_format_to_string): New method.
292 (General_options::set_incremental_disposition): New method.
293 (General_options::copy_from_posdep_options): New method.
294 (General_options::options_stack_): New data member.
295
296 2016-12-01 Cary Coutant <ccoutant@gmail.com>
297
298 PR gold/20807
299 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle
300 section symbols correctly.
301 * arm.cc (Target_arm): Likewise.
302 * powerpc.cc (Target_powerpc): Likewise.
303
304 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
305
306 * aarch64-reloc.def: Fix spelling in comments.
307
308 2016-11-27 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
309
310 * aarch64.cc: Fix spelling in comments.
311 * arm.cc: Fix spelling in comments.
312 * icf.cc: Fix spelling in comments.
313 * layout.cc: Fix spelling in comments.
314 * layout.h: Fix spelling in comments.
315 * mips.cc: Fix spelling in comments.
316 * output.h: Fix spelling in comments.
317 * plugin.h: Fix spelling in comments.
318 * script-sections.h: Fix spelling in comments.
319 * script.h: Fix spelling in comments.
320 * stringpool.h: Fix spelling in comments.
321 * tilegx.cc: Fix spelling in comments.
322
323 2016-11-22 Cary Coutant <ccoutant@gmail.com>
324
325 PR gold/20346
326 * options.cc (One_option::print): Print "(default)" when appropriate.
327 * options.h: Clean up and re-sort options.
328 (One_option::is_default): New data member.
329 (One_option::One_option): Add is_default parameter; adjust all calls.
330 (DEFINE_var): Add is_default__ parameter; adjust all calls.
331 (DEFINE_bool): Set is_default based on default_value__.
332 (DEFINE_bool_ignore): New macro.
333 (--no-eh-frame-hdr): New option.
334 (--enable-new-dtags): Remove mention of DT_FLAGS.
335
336 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
337
338 * configure: Regenerate.
339
340 2016-11-21 Cary Coutant <ccoutant@gmail.com>
341
342 PR gold/20693
343 * gold.cc (queue_middle_tasks): Force valid target earlier.
344
345 2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
346
347 * layout.cc: Include windows.h and rpcdce.h (for MinGW32).
348 (Layout::create_build_id): Generate uuid using UuidCreate().
349
350 2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com>
351
352 * configure.ac: add missing '$'.
353 * configure: Regenerate.
354
355 2016-10-21 Gergely Nagy <ngg@tresorit.com>
356
357 PR gold/17704
358 * icf.cc (match_sections): Add new parameter section_addraligns.
359 Check section alignment and keep the section with the strictest
360 alignment.
361 (find_identical_sections): New local variable section_addraligns.
362 Store each section's alignment.
363 * testsuite/pr17704a_test.s: New file.
364 * testsuite/Makefile.am (pr17704a_test): New test.
365 * testsuite/Makefile.in: Regenerate.
366
367 2016-10-06 Alan Modra <amodra@gmail.com>
368
369 * powerpc.cc (Target_powerpc::Relocate::relocate): Add fall
370 through comment.
371 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
372
373 2016-10-06 Alan Modra <amodra@gmail.com>
374
375 * aarch64.cc: Spell fall through comments as "// Fall through.".
376 * arm.cc: Likewise.
377 * mips.cc: Likewise.
378 * powerpc.cc: Likewise.
379 * s390.cc: Likewise.
380 * sparc.cc: Likewise.
381 * x86_64.cc: Likewise.
382 * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing
383 fall through comments.
384 * sparc.cc: (Target_sparc::Scan::global): Likewise.
385 (Target_sparc::Relocate::relocate): Likewise.
386 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
387 * resolve.cc (symbol_to_bits): Add missing break.
388
389 2016-09-26 Cary Coutant <ccoutant@gmail.com>
390
391 PR gold/20238
392 * symtab.cc (Symbol_table::define_default_version): Check that
393 unversioned symbol is defined.
394
395 2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
396
397 * Makefile.in: Regenerate.
398 * configure: Likewise.
399 * testsuite/Makefile.in: Likewise.
400
401 2016-09-26 Alan Modra <amodra@gmail.com>
402
403 * aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
404 compiler warning.
405 * output.cc (Output_segment::set_section_addresses): Likewise.
406 * testsuite/Makefile.in: Regenerate.
407
408 2016-09-02 Doug Kwan <dougkwan@google.com>
409
410 * arm.cc (Target_arm::Target_arm): Move method definition outside of
411 class definition. Add code to handle --target1-rel, --target1-abs
412 and --target2= options.
413 (Target_arm::get_reloc_reloc_type): Change method to be non-static
414 and const.
415 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
416 member declaration.
417 (Target_arm::Scan::local, Target_arm::Scan::global,
418 Target_arm::Relocate::relocate,
419 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
420 call to Target_arm::get_real_reloc_type.
421 (Target_arm::get_real_reloc_type): Use command line options to
422 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
423 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
424 options.
425
426 2016-08-31 Alan Modra <amodra@gmail.com>
427
428 * powerpc.cc (class Stub_control): Delete stub14_group_size_
429 and has14_. Add group_size_.
430 (Stub_control::can_add_to_stub_group): Adjust to suit. Print
431 debug info when switching to adding sections before stubs.
432
433 2016-08-31 Alan Modra <amodra@gmail.com>
434
435 * debug.h (DEBUG_TARGET): New.
436 (DEBUG_ALL): Add DEBUG_TARGET.
437 (gold_debug): Delete FORMAT param.
438 * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
439
440 2016-08-30 Alan Modra <amodra@gmail.com>
441
442 PR 20523
443 * powerpc.cc (class Stub_control): Add has14_. Comment owner_.
444 (Stub_control::can_add_to_stub_group): Correct grouping of
445 sections containing 14-bit external branches. When returning
446 false, set state_ to reflect the fact that we have one section
447 for the next group. Rewrite most of function for clarity.
448 Add and expand comments.
449 (Target_powerpc::do_relax): Print stub group size retry in hex.
450
451 2016-08-26 Han Shen <shenhan@google.com>
452
453 PR gold/20529 - relaxing loop never ends.
454
455 * powerpc.cc (Stub_table::min_size_threshold_): New member to
456 limit size.
457 (Stub_table::set_min_size_threshold): New member function.
458 (Stub_table::set_address_and_size): Add code to only allow size
459 increase.
460 (Target_powerpc::do_relax): Add code to record last size.
461
462 2016-08-23 Roland McGrath <roland@hack.frob.com>
463
464 * options.h (General_options): Grok -z stack-size.
465 * output.h (Output_segment::set_size): New method.
466 * layout.cc (Layout::create_executable_stack_info): Renamed to ...
467 (Layout::create_stack_segment): ... this. Always create the
468 segment if -z stack-size was used.
469 (Layout::set_segment_offsets): Don't call ->set_offset on the
470 PT_GNU_STACK segment.
471
472 2016-08-15 Bharathi Seshadri <bseshadr@cisco.com>
473
474 * options.h (General_options): Add --be8 option.
475 * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8.
476 (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise.
477 (Output_data_plt_arm_short::do_fill_plt_entry): Likewise.
478 (Output_data_plt_arm_long::do_fill_plt_entry): Likewise.
479 (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
480
481 2016-08-17 Cary Coutant <ccoutant@gmail.com>
482
483 * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing
484 error message.
485 * testsuite/Makefile.am (pr20216a): Add missing dependencies.
486 (pr20308a): Add -Bgcctestdir/ to compile rules.
487 * testsuite/Makefile.in: Regenerate.
488
489 2016-08-12 Roland McGrath <roland@hack.frob.com>
490
491 PR gold/20462
492 * script-sections.cc (Script_sections::release_segments):
493 Reset this->segments_created_.
494
495 2016-08-12 Roland McGrath <roland@hack.frob.com>
496
497 * yyscript.y (HIDDEN): New %token.
498 (assignment): Handle HIDDEN(string = expr) syntax.
499 * script.cc (script_keyword_parsecodes): Add HIDDEN.
500
501 2016-08-10 Cary Coutant <ccoutant@gmail.com>
502
503 PR gold/20216
504 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for
505 R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing
506 error message.
507 * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/.
508 (pr20216_ld.o): Likewise.
509 * testsuite/Makefile.in: Regenerate.
510
511 2016-08-10 James Clarke <jrtc27@jrtc27.com>
512
513 PR gold/20443
514 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols,
515 which will be present for STT_SPARC_REGISTER.
516 (Symbol_table::add_from_pluginobj): Likewise.
517 (Symbol_table::add_from_dynobj): Likewise.
518 (Symbol_table::add_from_incrobj): Removed dead code.
519
520 2016-08-10 James Clarke <jrtc27@jrtc27.com>
521
522 PR gold/20442
523 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10
524 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
525
526 2016-08-10 James Clarke <jrtc27@jrtc27.com>
527
528 PR gold/20441
529 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on
530 sparc64.
531
532 2016-06-29 Cary Coutant <ccoutant@gmail.com>
533
534 PR gold/20310
535 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
536
537 2016-06-29 Cary Coutant <ccoutant@gmail.com>
538
539 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2.
540 * testsuite/Makefile.in: Regenerate.
541
542 2016-06-30 Alan Modra <amodra@gmail.com>
543
544 * testsuite/Makefile.am (memory_test, memory_test_2): Pass
545 -Wl,-z to gcc, not plain -z.
546 * testsuite/Makefile.in: Regenerate.
547
548 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
549
550 PR gold/20308
551 * i386.cc (Target_i386::Relocate::relocate): Allow
552 R_386_GOT32X relocation against ___tls_get_addr.
553 (Target_i386::Relocate::tls_gd_to_ie): Support indirect
554 call to __tls_get_addr.
555 (Target_i386::Relocate::tls_gd_to_le): Likewise.
556 (Target_i386::Relocate::tls_ld_to_le): Likewise.
557 * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test,
558 pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test.
559 (pr20308a_test_SOURCES): New.
560 (pr20308a_test_DEPENDENCIES): Likewise.
561 (pr20308a_test_CFLAGS): Likewise.
562 (pr20308a_test_LDFLAGS): Likewise.
563 (pr20308a_test_LDADD): Likewise.
564 (pr20308b_test_SOURCES): Likewise.
565 (pr20308b_test_DEPENDENCIES): Likewise.
566 (pr20308b_test_CFLAGS): Likewise.
567 (pr20308b_test_LDFLAGS): Likewise.
568 (pr20308b_test_LDADD): Likewise.
569 (pr20308c_test_SOURCES): Likewise.
570 (pr20308c_test_DEPENDENCIES): Likewise.
571 (pr20308c_test_CFLAGS): Likewise.
572 (pr20308c_test_LDFLAGS): Likewise.
573 (pr20308c_test_LDADD): Likewise.
574 (pr20308d_test_SOURCES): Likewise.
575 (pr20308d_test_DEPENDENCIES): Likewise.
576 (pr20308d_test_CFLAGS): Likewise.
577 (pr20308d_test_LDFLAGS): Likewise.
578 (pr20308d_test_LDADD): Likewise.
579 (pr20308e_test_SOURCES): Likewise.
580 (pr20308e_test_DEPENDENCIES): Likewise.
581 (pr20308e_test_CFLAGS): Likewise.
582 (pr20308e_test_LDFLAGS): Likewise.
583 (pr20308e_test_LDADD): Likewise.
584 (pr20308a.so): Likewise.
585 (pr20308b.so): Likewise.
586 (pr20308_gd.o): Likewise.
587 (pr20308_ld.o): Likewise.
588 (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so.
589 * testsuite/Makefile.in: Regenerated.
590 * testsuite/pr20308_def.c: New file.
591 * testsuite/pr20308_gd.S: Likewise.
592 * testsuite/pr20308_ld.S: Likewise.
593 * testsuite/pr20308_main.c: Likewise.
594
595 2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
596
597 PR gold/20216
598 * configure.ac (DEFAULT_TARGET_X86_64_OR_X32): New
599 AM_CONDITIONAL.
600 * configure: Regenerated.
601 * x86_64.cc (Target_x86_64<size>::Relocate::relocate): Allow
602 R_X86_64_GOTPCRELX relocation against __tls_get_addr.
603 (Target_x86_64<size>::Relocate::tls_gd_to_ie): Support indirect
604 call to __tls_get_addr.
605 (Target_x86_64<size>::Relocate::tls_gd_to_le): Likewise.
606 (Target_x86_64<size>::Relocate::tls_ld_to_le): Likewise.
607 * testsuite/Makefile.am (check_PROGRAMS): Add pr20216a_test,
608 pr20216b_test, pr20216c_test, pr20216d_test, pr20216e_test.
609 (pr20216a_test_SOURCES): New.
610 (pr20216a_test_DEPENDENCIES): Likewise.
611 (pr20216a_test_CFLAGS): Likewise.
612 (pr20216a_test_LDFLAGS): Likewise.
613 (pr20216a_test_LDADD): Likewise.
614 (pr20216b_test_SOURCES): Likewise.
615 (pr20216b_test_DEPENDENCIES): Likewise.
616 (pr20216b_test_CFLAGS): Likewise.
617 (pr20216b_test_LDFLAGS): Likewise.
618 (pr20216b_test_LDADD): Likewise.
619 (pr20216c_test_SOURCES): Likewise.
620 (pr20216c_test_DEPENDENCIES): Likewise.
621 (pr20216c_test_CFLAGS): Likewise.
622 (pr20216c_test_LDFLAGS): Likewise.
623 (pr20216c_test_LDADD): Likewise.
624 (pr20216d_test_SOURCES): Likewise.
625 (pr20216d_test_DEPENDENCIES): Likewise.
626 (pr20216d_test_CFLAGS): Likewise.
627 (pr20216d_test_LDFLAGS): Likewise.
628 (pr20216d_test_LDADD): Likewise.
629 (pr20216e_test_SOURCES): Likewise.
630 (pr20216e_test_DEPENDENCIES): Likewise.
631 (pr20216e_test_CFLAGS): Likewise.
632 (pr20216e_test_LDFLAGS): Likewise.
633 (pr20216e_test_LDADD): Likewise.
634 (pr20216a.so): Likewise.
635 (pr20216b.so): Likewise.
636 (pr20216_gd.o): Likewise.
637 (pr20216_ld.o): Likewise.
638 (MOSTLYCLEANFILES): Add pr20216a.so pr20216b.so.
639 * testsuite/Makefile.in: Regenerated.
640 * testsuite/pr20216_def.c: New file.
641 * testsuite/pr20216_gd.S: Likewise.
642 * testsuite/pr20216_ld.S: Likewise.
643 * testsuite/pr20216_main.c: Likewise.
644
645 2016-06-29 Alan Modra <amodra@gmail.com>
646
647 * script_test_12.t: Delete .plt, specify 64k page size.
648 * script_test_12i.t: Likewise.
649
650 2016-06-29 Alan Modra <amodra@gmail.com>
651
652 * testsuite/plugin_layout_with_alignment.c: Explicitly align all
653 variables.
654
655 2016-06-29 Alan Modra <amodra@gmail.com>
656
657 * testsuite/Makefile.am (copy_test_protected): Disable for powerpc.
658 * testsuite/Makefile.in: Regenerate.
659
660 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
661
662 * aarch64-reloc.def (NONE): New relocation.
663 * aarch64.cc (Target_aarch64::Scan::local): Handle R_AARCH64_NONE.
664 (Target_aarch64::Scan::global): Likewise.
665 * testsuite/Makefile.am (aarch64_reloc_none): New test.
666 * testsuite/Makefile.in: Regenerate.
667 * testsuite/aarch64_reloc_none.s: New test source file.
668 * testsuite/aarch64_reloc_none.sh: New test script.
669
670 2016-06-28 Sriraman Tallam <tmsriram@google.com>
671
672 * x86_64.cc (Lazy_view): New class.
673 (can_convert_mov_to_lea): Templatize function. Make the function
674 check for appropriate relocation types and use the view parameter
675 to get section contents.
676 (can_convert_callq_to_direct): New function.
677 (Target_x86_64<size>::Scan::global): Refactor.
678 (Target_x86_64<size>::Relocate::relocate): Refactor. Change any indirect
679 call via GOT that can be converted.
680 * testsuite/Makefile.am (x86_64_indirect_call_to_direct.sh): New test.
681 * testsuite/Makefile.in: Regenerate.
682 * testsuite/x86_64_indirect_call_to_direct1.s: New file.
683 * testsuite/x86_64_indirect_jump_to_direct1.s: New file.
684
685 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
686
687 * aarch64.cc (Target_aarch64::Scan::local): Move the call to got_section
688 from the top level to the places of its use.
689
690 2016-06-28 Igor Kudrin <ikudrin@accesssoftek.com>
691
692 PR gold/18098
693 * script-c.h (Sort_wildcard): Add SORT_WILDCARD_BY_INIT_PRIORITY.
694 * script-sections.cc (Input_section_sorter::get_init_priority): New method.
695 (Input_section_sorter::operator()): Handle SORT_WILDCARD_BY_INIT_PRIORITY.
696 (Output_section_element_input::print): Likewise.
697 * script.cc (script_keyword_parsecodes): Add entry SORT_BY_INIT_PRIORITY.
698 * yyscript.y (SORT_BY_INIT_PRIORITY): New token.
699 (wildcard_section): Handle SORT_BY_INIT_PRIORITY.
700
701 * testsuite/Makefile.am (script_test_14): New test.
702 * testsuite/Makefile.in: Regenerate.
703 * testsuite/script_test_14.s: New test source file.
704 * testsuite/script_test_14.sh: New test script.
705 * testsuite/script_test_14.t: New test linker script.
706
707 2016-06-28 James Clarke <jrtc27@jrtc27.com>
708
709 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
710 to R_SPARC_RELATIVE if class is ELFCLASS64.
711 (Target_sparc::Scan::global): Likewise.
712
713 2016-06-23 Cary Coutant <ccoutant@gmail.com>
714 Igor Kudrin <ikudrin@accesssoftek.com>
715
716 PR gold/15370
717 * script-sections.cc
718 (Output_section_element_input::set_section_addresses): Keep bin_count
719 separate from input_pattern_count.
720 * testsuite/script_test_12.t: Add another section .x4.
721 * testsuite/script_test_12i.t: Likewise.
722 * testsuite/script_test_12a.c: Likewise.
723 * testsuite/script_test_12b.c: Likewise.
724
725 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
726
727 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
728
729 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
730
731 PR ld/20283
732 * NEWS: Mention --enable-relro.
733 * configure.ac: Add --enable-relro.
734 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
735 to 1.
736 * config.in: Regenerated.
737 * configure: Likewise.
738 * options.h (General_options::relro): Default to
739 DEFAULT_LD_Z_RELRO.
740
741 2016-06-20 Cary Coutant <ccoutant@gmail.com>
742
743 * NEWS: Add new features in 1.12.
744 * version.cc (version_string): Bump to 1.12.
745
746 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
747
748 PR gold/20245
749 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
750 plt_ is NULL.
751 (Target_i386::plt_entry_size): Likewise.
752 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
753 (Target_x86_64<size>::plt_entry_size): Likewise.
754
755 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
756
757 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
758 (Target_mips::rld_map_): New data member.
759 (Target_mips::do_finalize_sections): Add support for
760 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
761 .rld_map section, and __RLD_MAP symbol.
762 (Target_mips::do_dynamic_tag_custom_value): Add support for
763 DT_MIPS_RLD_MAP_REL dynamic tag.
764 * output.cc (Output_data_dynamic::get_entry_offset): New method
765 definition.
766 * output.h (Output_data_dynamic::get_entry_offset): New method
767 declaration.
768
769 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
770
771 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
772
773 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
774
775 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
776 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
777 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
778 (is_matching_lo16_reloc): Likewise.
779 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
780 (Mips_output_data_plt::plt_entry_r6): New static data member for
781 R6 PLT entry.
782 (Target_mips::is_output_r6): New method.
783 (Target_mips::Mips_mach): Add new enum constants.
784 (Mips_relocate_functions::Status): Likewise.
785 (Mips_relocate_functions::pchi16_relocs): New static data member.
786 (Mips_relocate_functions::relpc21): New method.
787 (Mips_relocate_functions::relpc26): Likewise.
788 (Mips_relocate_functions::relpc18): Likewise.
789 (Mips_relocate_functions::relpc19): Likewise.
790 (Mips_relocate_functions::relpchi16): Likewise.
791 (Mips_relocate_functions::do_relpchi16): Likewise.
792 (Mips_relocate_functions::relpclo16): Likewise.
793 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
794 entry.
795 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
796 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
797 E_MIPS_ARCH_64R6 support.
798 (Target_mips::update_abiflags_isa): Likewise.
799 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
800 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
801 R_MIPS_PC19_S2.
802 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
803 and R_MIPS_PCLO16.
804 (Target_mips::Scan::global): Add support for relocs:
805 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
806 (Target_mips::Relocate::relocate): Call functions for resolving
807 Mips32r6 and Mips64r6 relocations, and print error message for
808 STATUS_PCREL_UNALIGNED.
809 (Target_mips::Scan::get_reference_flags): Add support for relocs:
810 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
811 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
812 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
813 E_MIPS_ARCH_64R6 support.
814
815 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
816
817 PR gold/20246
818 * testsuite/script_test_2.t: Add .got.plt after .got.
819
820 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
821
822 * mips.cc (struct Mips_abiflags): New struct.
823 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
824 and abiflags_.
825 (Mips_relobj::~Mips_relobj): Delete object pointed by
826 attributes_section_data_.
827 (Mips_relobj::abiflags): New method.
828 (Mips_relobj::attributes_section_data): Likewise.
829 (Mips_relobj::attributes_section_data_): New data member.
830 (Mips_relobj::abiflags_): Likewise.
831 (class Mips_output_section_abiflags): New class.
832 (Target_mips::Target_mips): Initialize attributes_section_data_,
833 abiflags_ and has_abiflags_section_.
834 (Target_mips::do_should_include_section): Don't emit input
835 .MIPS.abiflags sections to output .MIPS.abiflags.
836 (Target_mips::Mips_mach): Add new enum constants.
837 (Target_mips::mips_isa_ext_mach): New method.
838 (Target_mips::mips_isa_ext): Likewise.
839 (Target_mips::update_abiflags_isa): Likewise.
840 (Target_mips::infer_abiflags): Likewise.
841 (Target_mips::create_abiflags): Likewise.
842 (Target_mips::fp_abi_string): Likewise.
843 (Target_mips::select_fp_abi): Likewise.
844 (Target_mips::merge_obj_attributes): Likewise.
845 (Target_mips::merge_obj_abiflags): Likewise.
846 (Target_mips::level_rev): Likewise.
847 (Target_mips::merge_obj_e_flags): Rename from
848 merge_processor_specific_flags. Remove dyn_obj argument,
849 call update_abiflags_isa when needed, compare NaN encodings and
850 compare FP64 state.
851 (Target_mips::add_machine_extensions): Add two machine extensions
852 and fix one.
853 (Target_mips::attributes_section_data_): New data member.
854 (Target_mips::abiflags_): Likewise.
855 (Target_mips::has_abiflags_section_): Likewise.
856 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
857 .MIPS.abiflags sections if they exists.
858 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
859 E_MIPS_MACH_OCTEON3 support.
860 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
861 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
862 .MIPS.abiflags sections from input. Create these sections if
863 needed.
864 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
865 E_MIPS_MACH_OCTEON3 support, and change strings for
866 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
867 to match bfd.
868
869 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
870
871 * mips.cc (Mips_relobj::Mips_relobj): Initialize
872 has_reginfo_section_.
873 (Mips_relobj::has_reginfo_section_): New data member.
874 (Mips_relobj::has_reginfo_section): New method.
875 (class Mips_output_section_reginfo): Change base class to
876 Output_section_data, and set masks of the output .reginfo section
877 in constructor.
878 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
879 Remove.
880 (Mips_output_section_reginfo::set_masks): Likewise.
881 (Mips_output_section_reginfo::set_final_data_size): Likewise.
882 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
883 (Target_mips::do_make_output_section): Remove.
884 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
885 if the object contains a .reginfo section.
886 (Target_mips::do_finalize_sections): Create a .reginfo output
887 section if needed.
888
889 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
890
891 * mips.cc (Mips_output_data_got::do_write): Add missing template
892 args via typedef.
893
894 2016-05-30 Marcin Kościelnicki <koriakin@0x04.net>
895
896 PR/19960
897 * s390.cc (Target_s390::ss_code_st_r14): Removed.
898 (Target_s390::ss_code_l_r14): Removed.
899 (Target_s390::ss_code_ear): Removed.
900 (Target_s390::ss_code_c): Removed.
901 (Target_s390::ss_match_st_r14): New function.
902 (Target_s390::ss_match_l_r14): New function.
903 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
904 of matching code directly.
905 (Target_s390::ss_match_ear): New function.
906 (Target_s390::ss_match_c): New function.
907 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
908 of matching code directly.
909
910 2016-05-19 Cary Coutant <ccoutant@gmail.com>
911
912 PR gold/19823
913 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
914 parameter; check for protected symbol.
915 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
916 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
917 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
918 (Symbol_table::add_from_dynobj): Mark protected symbols.
919 * symtab.h (Symbol::is_protected): New method.
920 (Symbol::set_is_protected): New method.
921 (Symbol::is_protected_): New data member.
922
923 * testsuite/Makefile.am (copy_test_protected): New test.
924 * testsuite/Makefile.in: Regenerate.
925 * testsuite/copy_test.cc (main): Add legal reference to protected
926 symbol.
927 * testsuite/copy_test_v1.cc (main): Likewise.
928 * testsuite/copy_test_2.cc (ip): Add protected symbol.
929 * testsuite/copy_test_protected.cc: New test source file.
930 * testsuite/copy_test_protected.sh: New test script.
931
932 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
933
934 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
935 for global got symbols, and set addend to 0.
936 (Mips_got_entry::hash): Change hash algorithm.
937 (Mips_got_entry::equals): Refactor.
938 (Mips_got_entry::object): Return input object for local got symbols
939 from union d.
940 (Mips_got_entry::addend): Change return of the relocation addend.
941 (Mips_got_entry::addend_): Move from union d.
942 (Mips_got_entry::object_): Move into union d.
943 (class Mips_symbol_hash): New class.
944 (Mips_got_info::Global_got_entry_set): New type.
945 (Mips_got_info::global_got_symbols): Change return type to
946 Global_got_entry_set.
947 (Mips_got_info::global_got_symbols_): Change type to
948 Global_got_entry_set.
949 (Mips_symbol::hash): New method.
950 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
951 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
952 (Mips_output_data_mips_stubs::symbols_): Change type to
953 Mips_stubs_entry_set.
954 (Mips_got_info::record_global_got_symbol): Don't pass object
955 argument when creating global got symbol.
956 (Mips_got_info::record_got_entry): Remove find before inserting
957 got entries.
958 (Mips_got_info::add_reloc_only_entries): Change type of iterator
959 to Global_got_entry_set.
960 (Mips_got_info::count_got_symbols): Likewise.
961 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
962 for adding entries to symbols_.
963 (Mips_output_data_la25_stub::do_write): Change type of iterator
964 to std::vector.
965 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
966 of iterator to Mips_stubs_entry_set.
967 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
968 (Mips_output_data_mips_stubs::do_write): Likewise.
969
970 2016-05-06 Han Shen <shenhan@google.com>
971
972 PR gold/19987.
973
974 * aarch64-reloc.def: New relocation type.
975 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
976 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
977 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
978 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
979
980 2016-04-28 Nick Clifton <nickc@redhat.com>
981
982 * po/zh_CN.po: Updated Chinese (simplified) translation.
983
984 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
985
986 * Makefile.in: Regenerated with automake 1.11.6.
987 * aclocal.m4: Likewise.
988 * testsuite/Makefile.in: Likewise.
989
990 2016-03-30 Cary Coutant <ccoutant@gmail.com>
991
992 PR gold/16979
993 * symtab.cc (Symbol_table::define_default_version): Check for case
994 where symbols are both in different shared objects.
995
996 2016-03-27 Cary Coutant <ccoutant@gmail.com>
997
998 PR gold/16111
999 * i386.cc (Target_i386): Add check for fully-resolved symbol for
1000 R_386_GOTOFF.
1001
1002 2016-03-22 Nick Clifton <nickc@redhat.com>
1003
1004 * configure: Regenerate.
1005
1006 2016-03-21 Cary Coutant <ccoutant@gmail.com>
1007
1008 PR gold/19842
1009 * errors.cc (Errors::undefined_symbol): Add info message when
1010 symbol should have been provided by a plugin.
1011 * target-reloc.h (issue_undefined_symbol_error): Check for
1012 placeholder symbols defined in discarded sections.
1013 * testsuite/Makefile.am (plugin_test_9b): New test case.
1014 * testsuite/Makefile.in: Regenerate.
1015 * testsuite/plugin_test_9b_elf.cc: New test source file.
1016 * testsuite/plugin_test_9b_ir.cc: New test source file.
1017
1018 2016-03-20 Cary Coutant <ccoutant@gmail.com>
1019
1020 PR gold/19002
1021 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
1022 * testsuite/Makefile.am (eh_test_2): New test.
1023 * testsuite/Makefile.in: Regenerate.
1024 * testsuite/eh_test_2.sh: New test script.
1025 * testsuite/eh_test_a.cc (bar): Make it comdat.
1026 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
1027
1028 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1029
1030 * mips.cc (Mips_relobj::is_n64_): Remove.
1031 (Target_mips::ei_class_): Likewise.
1032 (Mips_relobj::is_newabi): Call methods.
1033 (Mips_relobj::is_n64): Change checking for N64 ABI.
1034 (Target_mips::is_output_n64): Likewise.
1035 (Target_mips::merge_processor_specific_flags): Remove ei_class
1036 argument, and remove comparing ei_class.
1037 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
1038 of the ELF header.
1039 (Target_mips::do_finalize_sections): Don't pass ei_class argument
1040 to merge_processor_specific_flags.
1041 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
1042 change checking for N64 ABI.
1043
1044 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1045
1046 * mips.cc (enum Special_relocation_symbol): New enum type.
1047 (is_readonly_section): New function.
1048 (eh_reloc): Likewise.
1049 (Mips_got_entry::is_section_symbol_): New member.
1050 (Mips_got_entry::is_section_symbol): New method.
1051 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
1052 argument.
1053 (Mips_relobj::mips_elf_options_section_name): New method.
1054 (Mips_output_data_got::record_local_got_symbol): Add
1055 is_section_symbol argument, and pass it to
1056 Mips_got_info::record_local_got_symbol.
1057 (Mips_output_data_got::got_offset): Add addend argument, and pass
1058 it to Relobj::local_got_offset.
1059 (struct Mips_output_reloc_writer): New type.
1060 (class Mips_output_data_reloc): New class.
1061 (Mips_output_data_plt::Reloc_section): Change type to
1062 Mips_output_data_reloc.
1063 (Target_mips::Reloc_section): Likewise.
1064 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
1065 (Mips_classify_reloc::get_r_type2): New method.
1066 (Mips_classify_reloc::get_r_type3): Likewise.
1067 (Mips_classify_reloc::get_r_ssym): Likewise.
1068 (Target_mips::Reloca_section): Remove.
1069 (Relocate::should_apply_static_reloc): Rename from
1070 should_apply_r_mips_32_reloc.
1071 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
1072 and r_offset.
1073 (Mips_relocate_functions::Valtype): New type.
1074 (Mips_relocate_functions::Valtype64): New type.
1075 (Mips_relocate_functions::check_overflow): New method.
1076 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
1077 interface.
1078 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
1079 (Mips_relocate_functions::rel16): Add support for resolving
1080 relocations for Mips64.
1081 (Mips_relocate_functions::rel32): Likewise.
1082 (Mips_relocate_functions::reljalr): Likewise.
1083 (Mips_relocate_functions::relpc32): Likewise.
1084 (Mips_relocate_functions::rel26): Likewise.
1085 (Mips_relocate_functions::relpc16): Likewise.
1086 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
1087 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
1088 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
1089 (Mips_relocate_functions::do_relhi16): Likewise.
1090 (Mips_relocate_functions::do_relgot16_local): Likewise.
1091 (Mips_relocate_functions::rello16): Likewise.
1092 (Mips_relocate_functions::relgot): Likewise.
1093 (Mips_relocate_functions::relgotpage): Likewise.
1094 (Mips_relocate_functions::relgotofst): Likewise.
1095 (Mips_relocate_functions::relgot_hi16): Likewise.
1096 (Mips_relocate_functions::relgot_lo16): Likewise.
1097 (Mips_relocate_functions::relgprel): Likewise.
1098 (Mips_relocate_functions::relgprel32): Likewise.
1099 (Mips_relocate_functions::tlsrelhi16): Likewise.
1100 (Mips_relocate_functions::tlsrello16): Likewise.
1101 (Mips_relocate_functions::tlsrel32): Likewise.
1102 (Mips_relocate_functions::relsub): Likewise.
1103 (Mips_relocate_functions::releh): New method.
1104 (Mips_relocate_functions::rel64): Likewise.
1105 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
1106 pass it to Mips_got_entry.
1107 (Mips_got_info::add_local_entries): Pass addend argument
1108 to code functions, and for STT_SECTION symbols call
1109 add_symbolless_local_addend.
1110 (Mips_got_info::add_tls_entries): Pass addend argument to code
1111 functions.
1112 (Mips_relobj::do_read_symbols): Read gp value that was used to
1113 create object.
1114 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
1115 instruction. Opcode for instruction will be selected later.
1116 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
1117 (Target_mips::scan_relocatable_relocs): Likewise.
1118 (Target_mips::emit_relocs_scan): Likewise.
1119 (Target_mips::relocate_relocs): Likewise.
1120 (Target_mips::do_finalize_sections): Skip objects for merging
1121 processor specific flags in which all input sections will be
1122 discarded.
1123 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
1124 (Target_mips::Scan::get_reference_flags): Likewise.
1125 (Target_mips::relocate_special_relocatable): Call rel26 method with
1126 calculate_only and calculated_value arguments.
1127 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
1128 dynamic relocation against a readonly sections, and pass
1129 is_section_symbol to Mips_got_info::record_local_got_symbol.
1130 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
1131 dynamic relocation against a readonly sections, and pass r_type
1132 and r_offset to Target_mips::copy_reloc.
1133 (Target_mips::Relocate::relocate): Add support for resolving
1134 relocations for Mips64.
1135 (Target_mips::mips_info): Add case for Mips64 default dynamic
1136 linker name.
1137 (Target_selector_mips): Correct emulation names.
1138
1139 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1140
1141 * mips.cc (class Mips_output_data_la25_stub): Add
1142 do_print_to_mapfile function.
1143
1144 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1145
1146 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
1147 elf_r_info.
1148
1149 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
1150
1151 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
1152 * testsuite/plugin_layout_with_alignment.c: This.
1153 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
1154 (plugin_layout_with_alignment): Likewise.
1155 * testsuite/Makefile.in: Regenerated.
1156
1157 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1158
1159 PR 19751
1160 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
1161 for constructor.
1162 * testsuite/Makefile.in: Regenerate.
1163 * testsuite/dynamic_list.sh: Likewise.
1164 * testsuite/retain_symbols_file_test.sh: Likewise.
1165
1166 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1167
1168 PR 19751
1169 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
1170 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
1171
1172 2016-03-08 Cary Coutant <ccoutant@gmail.com>
1173 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
1174
1175 * output.cc (Output_reloc_writer): New type.
1176 (Output_data_reloc_base::do_write): Move implementation to template
1177 in output.h and replace with invocation of template.
1178 * output.h (Output_file): Move to top of file.
1179 (Output_reloc::get_symbol_index): Move to public interface.
1180 (Output_reloc::get_address): Likewise.
1181 (Output_data_reloc_base::do_write_generic): New function template.
1182
1183 2016-03-04 Cary Coutant <ccoutant@gmail.com>
1184
1185 PR gold/19019
1186 PR gold/19763
1187 * symtab.cc: Instantiate Sized_symbol::init_constant and
1188 Sized_symbol::init_undefined.
1189
1190 2016-03-03 Cary Coutant <ccoutant@gmail.com>
1191
1192 PR gold/19019
1193 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
1194 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
1195 * mips.cc (Target_mips::make_symbol): Adjust function signature.
1196 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
1197 (Target_sparc::do_is_defined_by_abi): Remove test for
1198 STT_SPARC_REGISTER.
1199 (Target_sparc::Register_symbol): New struct type.
1200 (Target_sparc::register_syms_): New data member.
1201 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
1202 (Target_sparc::make_symbol): New function.
1203 (Target_sparc::do_finalize_sections): Add register symbols and new
1204 dynamic table entries.
1205 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
1206 (Symbol_table::add_target_global_symbol): New function.
1207 (Symbol_table::target_symbols_): New data member.
1208 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
1209 (Symbol_table::Symbol_table): Initialize target_symbols_.
1210 (Symbol_table::add_from_object): Pass additional parameters to
1211 Target::make_symbol.
1212 (Symbol_table::define_special_symbol): Likewise.
1213 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
1214 undefined symbol value.
1215 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
1216 (Symbol_table::sized_finalize): Likewise.
1217 (Symbol_table::sized_write_globals): Likewise.
1218 * target.h (Sized_target::make_symbol): Add name, st_type, object,
1219 st_shndx, and value parameters.
1220
1221 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1222
1223 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
1224 LDPK_WEAKUNDEF symbols.
1225
1226 2016-03-03 Than McIntosh <thanm@google.com>
1227
1228 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
1229 and get_input_section_alignment in transfer vector.
1230 (get_input_section_alignment): New function.
1231 (get_input_section_size): New function.
1232 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
1233 * testsuite/Makefile.in: [Regenerate.]
1234 * testsuite/plugin_section_alignment.cc: New test file.
1235 * testsuite/plugin_layout_with_alignment.cc: New test file.
1236 * testsuite/plugin_layout_with_alignment.sh: New test file.
1237
1238 2016-03-03 Evgenii Stepanov <eugenis@google.com>
1239
1240 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1241 parameter.
1242 * plugin.cc (get_symbols_v3): New function.
1243 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
1244 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
1245 new version.
1246
1247 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
1248 Cary Coutant <ccoutant@gmail.com>
1249
1250 PR gold/19735
1251 * ehframe.h (Cie::fde_encoding): New method.
1252 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
1253 address ranges.
1254
1255 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
1256
1257 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
1258 -mrelax-relocations=yes to $(TEST_AS).
1259 (x86_64_mov_to_lea6.o): Likewise.
1260 (x86_64_overflow_pc32.o): Remove duplicated target.
1261 * testsuite/Makefile.in: Regenerated.
1262
1263 2016-02-15 Marcin Kościelnicki <koriakin@0x04.net>
1264
1265 * s390.cc (Target_s390::match_view_u): New helper method.
1266 (Target_s390::do_is_call_to_non_split): New method.
1267 (Target_s390::ss_code_st_r14): New const.
1268 (Target_s390::ss_code_l_r14): New const.
1269 (Target_s390::ss_code_bras_8): New const.
1270 (Target_s390::ss_code_l_basr): New const.
1271 (Target_s390::ss_code_a_basr): New const.
1272 (Target_s390::ss_code_ear): New const.
1273 (Target_s390::ss_code_c): New const.
1274 (Target_s390::ss_code_larl): New const.
1275 (Target_s390::ss_code_brasl): New const.
1276 (Target_s390::ss_code_jg): New const.
1277 (Target_s390::ss_code_jgl): New const.
1278 (Target_s390::ss_match_mcount): New helper method.
1279 (Target_s390::ss_match_l): New helper method.
1280 (Target_s390::ss_match_ahi): New helper method.
1281 (Target_s390::ss_match_alfi): New helper method.
1282 (Target_s390::ss_match_cr): New helper method.
1283 (Target_s390::do_calls_non_split): New method.
1284 * testsuite/Makefile.am: Added new tests.
1285 * testsuite/Makefile.in: Regenerate.
1286 * testsuite/split_s390.sh: New test.
1287 * testsuite/split_s390_1_a1.s: New test.
1288 * testsuite/split_s390_1_a2.s: New test.
1289 * testsuite/split_s390_1_n1.s: New test.
1290 * testsuite/split_s390_1_n2.s: New test.
1291 * testsuite/split_s390_1_z1.s: New test.
1292 * testsuite/split_s390_1_z2.s: New test.
1293 * testsuite/split_s390_1_z3.s: New test.
1294 * testsuite/split_s390_1_z4.s: New test.
1295 * testsuite/split_s390_2_ns.s: New test.
1296 * testsuite/split_s390_2_s.s: New test.
1297 * testsuite/split_s390x_1_a1.s: New test.
1298 * testsuite/split_s390x_1_a2.s: New test.
1299 * testsuite/split_s390x_1_n1.s: New test.
1300 * testsuite/split_s390x_1_n2.s: New test.
1301 * testsuite/split_s390x_1_z1.s: New test.
1302 * testsuite/split_s390x_1_z2.s: New test.
1303 * testsuite/split_s390x_1_z3.s: New test.
1304 * testsuite/split_s390x_1_z4.s: New test.
1305 * testsuite/split_s390x_2_ns.s: New test.
1306 * testsuite/split_s390x_2_s.s: New test.
1307
1308 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
1309
1310 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
1311 info message for every erratum 843419 found and fixed.
1312
1313 2016-02-07 Cary Coutant <ccoutant@gmail.com>
1314
1315 PR gold/18695
1316 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
1317 information to relocation overflow errors.
1318
1319 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1320
1321 PR gold/18695
1322 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
1323 overflow checking when symbol value + addend < 0.
1324
1325 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1326
1327 PR gold/19577
1328 * reloc.h (Limits): New class.
1329 (Bits::has_overflow32): Use min/max values from Limits.
1330 (Bits::has_unsigned_overflow32): Likewise.
1331 (Bits::has_signed_unsigned_overflow32): Likewise.
1332 (Bits::has_overflow): Likewise.
1333 (Bits::has_unsigned_overflow): Likewise.
1334 (Bits::has_signed_unsigned_overflow64): Likewise.
1335
1336 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1337
1338 PR gold/19567
1339 * reloc.h (Relocate_functions::Overflow_check): Add comments.
1340 * x86_64.cc (X86_64_relocate_functions): New class.
1341 (Target_x86_64::Relocate::relocate): Use the new class.
1342 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
1343 (x32_overflow_pc32): New test case.
1344 * testsuite/Makefile.in: Regenerate.
1345 * testsuite/x32_overflow_pc32.sh: New script.
1346 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
1347
1348 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1349
1350 PR gold/19577
1351 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
1352 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
1353
1354 2016-02-06 Cary Coutant <ccoutant@gmail.com>
1355
1356 PR gold/19577
1357 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
1358 comparison.
1359 (Bits::has_unsigned_overflow): Likewise.
1360
1361 2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
1362
1363 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
1364 parameters.
1365 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
1366 and view_size to is_call_to_non_split.
1367 * target.cc (Target::is_call_to_non_split): Add view and view_size
1368 parameters.
1369 * target.h (class Target): Likewise.
1370
1371 2016-02-05 Sriraman Tallam <tmsriram@google.com>
1372
1373 * icf.cc (get_rel_addend): New function.
1374 (get_section_contents): Move merge section addend computation to a
1375 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
1376 Fix bug to not read past the length of the section.
1377
1378 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1379 Andrew Senkevich <andrew.senkevich@intel.com>
1380
1381 PR gold/18695
1382 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
1383 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
1384 R_X86_64_PLT32.
1385 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
1386 * testsuite/x86_64_overflow_pc32.sh: New test script.
1387 * testsuite/x86_64_overflow_pc32.s: New source file.
1388
1389 2016-02-05 Cary Coutant <ccoutant@gmail.com>
1390
1391 PR gold/18695
1392 * reloc.h (Relocate_functions::Address): New typedef.
1393 (Relocate_functions::Addendtype): New typedef.
1394 (Relocate_functions::Overflow_check): New enum type.
1395 (Relocate_functions::Reloc_status): New enum type.
1396 (Relocate_functions::check_overflow): New function template.
1397 (Relocate_functions::rel): Add check parameter; check for overflow.
1398 (Relocate_functions::rel_unaligned): Likewise.
1399 (Relocate_functions::rela): Likewise.
1400 (Relocate_functions::pcrel): Likewise.
1401 (Relocate_functions::pcrel_unaligned): Likewise.
1402 (Relocate_functions::pcrela): Likewise.
1403 (Relocate_functions::rel8): Adjust parameter types.
1404 (Relocate_functions::rela8): Likewise.
1405 (Relocate_functions::pcrel8): Likewise.
1406 (Relocate_functions::pcrela8): Likewise.
1407 (Relocate_functions::rel16): Likewise.
1408 (Relocate_functions::rela168): Likewise.
1409 (Relocate_functions::pcrel16): Likewise.
1410 (Relocate_functions::pcrela16): Likewise.
1411 (Relocate_functions::rel32): Likewise.
1412 (Relocate_functions::rel32_unaligned): Likewise.
1413 (Relocate_functions::rela32): Likewise.
1414 (Relocate_functions::pcrel32): Likewise.
1415 (Relocate_functions::pcrel32_unaligned): Likewise.
1416 (Relocate_functions::pcrela32): Likewise.
1417 (Relocate_functions::rel8_check): New function.
1418 (Relocate_functions::rela8_check): New function.
1419 (Relocate_functions::pcrel8_check): New function.
1420 (Relocate_functions::pcrela8_check): New function.
1421 (Relocate_functions::rel16_check): New function.
1422 (Relocate_functions::rela168_check): New function.
1423 (Relocate_functions::pcrel16_check): New function.
1424 (Relocate_functions::pcrela16_check): New function.
1425 (Relocate_functions::rel32_check): New function.
1426 (Relocate_functions::rel32_unaligned_check): New function.
1427 (Relocate_functions::rela32_check): New function.
1428 (Relocate_functions::pcrel32_check): New function.
1429 (Relocate_functions::pcrel32_unaligned_check): New function.
1430 (Relocate_functions::pcrela32_check): New function.
1431 (Bits::has_unsigned_overflow32): New function.
1432 (Bits::has_unsigned_overflow): New function.
1433 * testsuite/Makefile.am (overflow_unittest): New test.
1434 * testsuite/Makefile.in: Regenerate.
1435 * testsuite/overflow_unittest.cc: New source file.
1436
1437 2016-02-04 Alan Modra <amodra@gmail.com>
1438
1439 * powerpc.cc (relocate): Adjust last patch for big-endian.
1440
1441 2016-02-02 Alan Modra <amodra@gmail.com>
1442
1443 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
1444
1445 2016-01-15 Han Shen <shenhan@google.com>
1446
1447 PR gold/19472 - need pc-relative stubs.
1448
1449 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
1450 stub type for DSOs and pie executables.
1451
1452 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
1453
1454 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
1455 'typename'.
1456
1457 2016-01-12 Cary Coutant <ccoutant@gmail.com>
1458
1459 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
1460 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
1461 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
1462 specializations) New method.
1463
1464 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1465
1466 PR gold/19353
1467 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
1468 we have a TLS segment for GD-to-IE optimization.
1469 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
1470 Adjust all calls.
1471 (Target_i386::tls_desc_gd_to_ie): Likewise.
1472 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
1473 for TLSDESC GD-to-IE optimizations.
1474 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
1475 Adjust all calls.
1476 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
1477 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
1478 for TLSDESC GD-to-IE optimizations.
1479
1480 2016-01-11 Cary Coutant <ccoutant@gmail.com>
1481
1482 Refactor gold to enable support for MIPS-64 relocation format.
1483
1484 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
1485 (gc_process_relocs): Remove sh_type template parameter.
1486 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
1487 * object.h (Sized_relobj_file::split_stack_adjust): Add target
1488 parameter.
1489 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
1490 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
1491 specializations) Remove.
1492 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
1493 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
1494 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
1495 (Sized_relobj_file::split_stack_adjust): Add target parameter.
1496 Adjust all callers.
1497 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
1498 Target::get_r_sym() to get r_sym field from relocations.
1499 (Track_relocs::next_symndx): Call Target::get_r_sym().
1500 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
1501 add Classify_reloc template parameter. Use for accessing r_sym and
1502 r_type.
1503 (relocate_section): Likewise.
1504 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
1505 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
1506 (Default_scan_relocatable_relocs::Reltype): New typedef.
1507 (Default_scan_relocatable_relocs::reloc_size): New const.
1508 (Default_scan_relocatable_relocs::sh_type): New const.
1509 (Default_scan_relocatable_relocs::get_r_sym): New method.
1510 (Default_scan_relocatable_relocs::get_r_type): New method.
1511 (Default_emit_relocs_strategy): New class.
1512 (scan_relocatable_relocs): Replace sh_type template parameter with
1513 Scan_relocatable_relocs class. Use it to access r_sym and r_type
1514 fields.
1515 (relocate_relocs): Replace sh_type template parameter with
1516 Classify_reloc class. Use it to access r_sym and r_type fields.
1517 * target.h (Target::is_call_to_non_split): Replace r_type parameter
1518 with pointer to relocation. Adjust all callers.
1519 (Target::do_is_call_to_non_split): Likewise.
1520 (Target::emit_relocs_scan): New virtual method.
1521 (Sized_target::get_r_sym): New virtual method.
1522 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
1523 with pointer to relocation.
1524
1525 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
1526 (Target_aarch64::Relocatable_size_for_reloc): Remove.
1527 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
1528 (Target_aarch64::scan_relocs): Likewise.
1529 (Target_aarch64::relocate_section): Likewise.
1530 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
1531 Remove.
1532 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
1533 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
1534 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
1535 template parameter.
1536 (Target_arm::emit_relocs_scan): New method.
1537 (Target_arm::Relocatable_size_for_reloc): Replace with...
1538 (Target_arm::Classify_reloc): ...this.
1539 (Target_arm::gc_process_relocs): Use Classify_reloc.
1540 (Target_arm::scan_relocs): Likewise.
1541 (Target_arm::relocate_section): Likewise.
1542 (Target_arm::scan_relocatable_relocs): Likewise.
1543 (Target_arm::relocate_relocs): Likewise.
1544 * i386.cc (Target_i386::emit_relocs_scan): New method.
1545 (Target_i386::Relocatable_size_for_reloc): Replace with...
1546 (Target_i386::Classify_reloc): ...this.
1547 (Target_i386::gc_process_relocs): Use Classify_reloc.
1548 (Target_i386::scan_relocs): Likewise.
1549 (Target_i386::relocate_section): Likewise.
1550 (Target_i386::scan_relocatable_relocs): Likewise.
1551 (Target_i386::relocate_relocs): Likewise.
1552 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
1553 parameter.
1554 (Mips_reloc_types): New class template.
1555 (Mips_classify_reloc): New class template.
1556 (Target_mips::Reltype): New typedef.
1557 (Target_mips::Relatype): New typedef.
1558 (Target_mips::emit_relocs_scan): New method.
1559 (Target_mips::get_r_sym): New method.
1560 (Target_mips::Relocatable_size_for_reloc): Replace with
1561 Mips_classify_reloc.
1562 (Target_mips::copy_reloc): Use Mips_classify_reloc.
1563 (Target_mips::gc_process_relocs): Likewise.
1564 (Target_mips::scan_relocs): Likewise.
1565 (Target_mips::relocate_section): Likewise.
1566 (Target_mips::scan_relocatable_relocs): Likewise.
1567 (Target_mips::relocate_relocs): Likewise.
1568 (mips_get_size_for_reloc): New function, factored out from
1569 Relocatable_size_for_reloc::get_size_for_reloc.
1570 (Target_mips::Scan::local): Use Mips_classify_reloc.
1571 (Target_mips::Scan::global): Likewise.
1572 (Target_mips::Relocate::relocate): Likewise.
1573 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
1574 (Target_powerpc::Relocatable_size_for_reloc): Remove.
1575 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
1576 (Target_powerpc::scan_relocs): Likewise.
1577 (Target_powerpc::relocate_section): Likewise.
1578 (Powerpc_scan_relocatable_reloc): Convert to class template.
1579 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
1580 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
1581 (Powerpc_scan_relocatable_reloc::sh_type): New const.
1582 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
1583 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
1584 (Target_powerpc::scan_relocatable_relocs): Use
1585 Powerpc_scan_relocatable_reloc.
1586 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
1587 * s390.cc (Target_s390::emit_relocs_scan): New method.
1588 (Target_s390::Relocatable_size_for_reloc): Remove.
1589 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
1590 (Target_s390::scan_relocs): Likewise.
1591 (Target_s390::relocate_section): Likewise.
1592 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
1593 Remove.
1594 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
1595 (Target_s390::relocate_relocs): Use Default_classify_reloc.
1596 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
1597 (Target_sparc::Relocatable_size_for_reloc): Remove.
1598 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
1599 (Target_sparc::scan_relocs): Likewise.
1600 (Target_sparc::relocate_section): Likewise.
1601 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
1602 Remove.
1603 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
1604 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
1605 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
1606 (Target_tilegx::Relocatable_size_for_reloc): Remove.
1607 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
1608 (Target_tilegx::scan_relocs): Likewise.
1609 (Target_tilegx::relocate_section): Likewise.
1610 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
1611 Remove.
1612 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
1613 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
1614 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
1615 (Target_x86_64::Relocatable_size_for_reloc): Remove.
1616 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
1617 (Target_x86_64::scan_relocs): Likewise.
1618 (Target_x86_64::relocate_section): Likewise.
1619 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1620 Remove.
1621 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
1622 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
1623
1624 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
1625
1626 2016-01-01 Alan Modra <amodra@gmail.com>
1627
1628 Update year range in copyright notice of all files.
1629
1630 For older changes see ChangeLog-0815
1631 \f
1632 Copyright (C) 2016 Free Software Foundation, Inc.
1633
1634 Copying and distribution of this file, with or without modification,
1635 are permitted in any medium without royalty provided the copyright
1636 notice and this notice are preserved.
1637
1638 Local Variables:
1639 mode: change-log
1640 left-margin: 8
1641 fill-column: 74
1642 version-control: never
1643 End:
This page took 0.065081 seconds and 4 git commands to generate.