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