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