Don't convert R_SPARC_32 to R_SPARC_RELATIVE if class is ELFCLASS64.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2016-06-28 James Clarke <jrtc27@jrtc27.com>
2
3 * sparc.cc (Target_sparc::Scan::local): Don't convert R_SPARC_32
4 to R_SPARC_RELATIVE if class is ELFCLASS64.
5 (Target_sparc::Scan::global): Likewise.
6
7 2016-06-23 Cary Coutant <ccoutant@gmail.com>
8 Igor Kudrin <ikudrin@accesssoftek.com>
9
10 PR gold/15370
11 * script-sections.cc
12 (Output_section_element_input::set_section_addresses): Keep bin_count
13 separate from input_pattern_count.
14 * testsuite/script_test_12.t: Add another section .x4.
15 * testsuite/script_test_12i.t: Likewise.
16 * testsuite/script_test_12a.c: Likewise.
17 * testsuite/script_test_12b.c: Likewise.
18
19 2016-06-23 Igor Kudrin <ikudrin@accesssoftek.com>
20
21 * gold-threads.cc (impl_threads::Lock_impl_threads): Fix typos.
22
23 2016-06-22 H.J. Lu <hongjiu.lu@intel.com>
24
25 PR ld/20283
26 * NEWS: Mention --enable-relro.
27 * configure.ac: Add --enable-relro.
28 (DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
29 to 1.
30 * config.in: Regenerated.
31 * configure: Likewise.
32 * options.h (General_options::relro): Default to
33 DEFAULT_LD_Z_RELRO.
34
35 2016-06-20 Cary Coutant <ccoutant@gmail.com>
36
37 * NEWS: Add new features in 1.12.
38 * version.cc (version_string): Bump to 1.12.
39
40 2016-06-20 H.J. Lu <hongjiu.lu@intel.com>
41
42 PR gold/20245
43 * i386.cc (Target_i386::first_plt_entry_offset): Return 0 if
44 plt_ is NULL.
45 (Target_i386::plt_entry_size): Likewise.
46 (Target_x86_64<size>::first_plt_entry_offset): Likewise.
47 (Target_x86_64<size>::plt_entry_size): Likewise.
48
49 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
50
51 * mips.cc (Target_mips::Target_mips): Initialize rld_map_.
52 (Target_mips::rld_map_): New data member.
53 (Target_mips::do_finalize_sections): Add support for
54 DT_MIPS_RLD_MAP and DT_MIPS_RLD_MAP_REL dynamic tags,
55 .rld_map section, and __RLD_MAP symbol.
56 (Target_mips::do_dynamic_tag_custom_value): Add support for
57 DT_MIPS_RLD_MAP_REL dynamic tag.
58 * output.cc (Output_data_dynamic::get_entry_offset): New method
59 definition.
60 * output.h (Output_data_dynamic::get_entry_offset): New method
61 declaration.
62
63 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
64
65 * mips.cc (Mips_relocate_functions::relpc16): Add unaligned check.
66
67 2016-06-20 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
68
69 * mips.cc (relocation_needs_la25_stub): Add support for relocs:
70 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
71 (hi16_reloc): Add support for R_MIPS_PCHI16 relocation.
72 (is_matching_lo16_reloc): Likewise.
73 (lo16_reloc): Add support for R_MIPS_PCLO16 relocation.
74 (Mips_output_data_plt::plt_entry_r6): New static data member for
75 R6 PLT entry.
76 (Target_mips::is_output_r6): New method.
77 (Target_mips::Mips_mach): Add new enum constants.
78 (Mips_relocate_functions::Status): Likewise.
79 (Mips_relocate_functions::pchi16_relocs): New static data member.
80 (Mips_relocate_functions::relpc21): New method.
81 (Mips_relocate_functions::relpc26): Likewise.
82 (Mips_relocate_functions::relpc18): Likewise.
83 (Mips_relocate_functions::relpc19): Likewise.
84 (Mips_relocate_functions::relpchi16): Likewise.
85 (Mips_relocate_functions::do_relpchi16): Likewise.
86 (Mips_relocate_functions::relpclo16): Likewise.
87 (Mips_output_data_plt::do_write): Add support for Mips r6 plt
88 entry.
89 (Target_mips::mips_32bit_flags): Add E_MIPS_ARCH_32R6 support.
90 (Target_mips::elf_mips_mach): Add E_MIPS_ARCH_32R6 and
91 E_MIPS_ARCH_64R6 support.
92 (Target_mips::update_abiflags_isa): Likewise.
93 (mips_get_size_for_reloc): Add support for relocs: R_MIPS_PCHI16,
94 R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3 and
95 R_MIPS_PC19_S2.
96 (Target_mips::Scan::local): Add support for relocs: R_MIPS_PCHI16
97 and R_MIPS_PCLO16.
98 (Target_mips::Scan::global): Add support for relocs:
99 R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
100 (Target_mips::Relocate::relocate): Call functions for resolving
101 Mips32r6 and Mips64r6 relocations, and print error message for
102 STATUS_PCREL_UNALIGNED.
103 (Target_mips::Scan::get_reference_flags): Add support for relocs:
104 R_MIPS_PCHI16, R_MIPS_PCLO16, R_MIPS_PC21_S2, R_MIPS_PC26_S2,
105 R_MIPS_PC18_S3 and R_MIPS_PC19_S2.
106 (Target_mips::elf_mips_mach_name): Add E_MIPS_ARCH_32R6 and
107 E_MIPS_ARCH_64R6 support.
108
109 2016-06-13 H.J. Lu <hongjiu.lu@intel.com>
110
111 PR gold/20246
112 * testsuite/script_test_2.t: Add .got.plt after .got.
113
114 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
115
116 * mips.cc (struct Mips_abiflags): New struct.
117 (Mips_relobj::Mips_relobj): Initialize attributes_section_data_
118 and abiflags_.
119 (Mips_relobj::~Mips_relobj): Delete object pointed by
120 attributes_section_data_.
121 (Mips_relobj::abiflags): New method.
122 (Mips_relobj::attributes_section_data): Likewise.
123 (Mips_relobj::attributes_section_data_): New data member.
124 (Mips_relobj::abiflags_): Likewise.
125 (class Mips_output_section_abiflags): New class.
126 (Target_mips::Target_mips): Initialize attributes_section_data_,
127 abiflags_ and has_abiflags_section_.
128 (Target_mips::do_should_include_section): Don't emit input
129 .MIPS.abiflags sections to output .MIPS.abiflags.
130 (Target_mips::Mips_mach): Add new enum constants.
131 (Target_mips::mips_isa_ext_mach): New method.
132 (Target_mips::mips_isa_ext): Likewise.
133 (Target_mips::update_abiflags_isa): Likewise.
134 (Target_mips::infer_abiflags): Likewise.
135 (Target_mips::create_abiflags): Likewise.
136 (Target_mips::fp_abi_string): Likewise.
137 (Target_mips::select_fp_abi): Likewise.
138 (Target_mips::merge_obj_attributes): Likewise.
139 (Target_mips::merge_obj_abiflags): Likewise.
140 (Target_mips::level_rev): Likewise.
141 (Target_mips::merge_obj_e_flags): Rename from
142 merge_processor_specific_flags. Remove dyn_obj argument,
143 call update_abiflags_isa when needed, compare NaN encodings and
144 compare FP64 state.
145 (Target_mips::add_machine_extensions): Add two machine extensions
146 and fix one.
147 (Target_mips::attributes_section_data_): New data member.
148 (Target_mips::abiflags_): Likewise.
149 (Target_mips::has_abiflags_section_): Likewise.
150 (Mips_relobj::do_read_symbols): Read .gnu.attributes and
151 .MIPS.abiflags sections if they exists.
152 (Target_mips::elf_mips_mach): Add E_MIPS_MACH_5900 and
153 E_MIPS_MACH_OCTEON3 support.
154 (Target_mips::do_adjust_elf_header): Setup EI_ABIVERSION flag.
155 (Target_mips::do_finalize_sections): Merge .gnu.attributes and
156 .MIPS.abiflags sections from input. Create these sections if
157 needed.
158 (Target_mips::elf_mips_mach_name): Add E_MIPS_MACH_5900 and
159 E_MIPS_MACH_OCTEON3 support, and change strings for
160 E_MIPS_MACH_LS2E, E_MIPS_MACH_LS2F and E_MIPS_MACH_LS3A just
161 to match bfd.
162
163 2016-06-10 Vladimir Radosavljevic <Vladimir.Radosavljevic@imgtec.com>
164
165 * mips.cc (Mips_relobj::Mips_relobj): Initialize
166 has_reginfo_section_.
167 (Mips_relobj::has_reginfo_section_): New data member.
168 (Mips_relobj::has_reginfo_section): New method.
169 (class Mips_output_section_reginfo): Change base class to
170 Output_section_data, and set masks of the output .reginfo section
171 in constructor.
172 (Mips_output_section_reginfo::as_mips_output_section_reginfo):
173 Remove.
174 (Mips_output_section_reginfo::set_masks): Likewise.
175 (Mips_output_section_reginfo::set_final_data_size): Likewise.
176 (Mips_output_section_reginfo::do_print_to_mapfile): New method.
177 (Target_mips::do_make_output_section): Remove.
178 (Mips_relobj::do_read_symbols): Set has_reginfo_section_ to true
179 if the object contains a .reginfo section.
180 (Target_mips::do_finalize_sections): Create a .reginfo output
181 section if needed.
182
183 2016-06-09 Artemiy Volkov <artemiyv@acm.org>
184
185 * mips.cc (Mips_output_data_got::do_write): Add missing template
186 args via typedef.
187
188 2016-05-30 Marcin Koƛcielnicki <koriakin@0x04.net>
189
190 PR/19960
191 * s390.cc (Target_s390::ss_code_st_r14): Removed.
192 (Target_s390::ss_code_l_r14): Removed.
193 (Target_s390::ss_code_ear): Removed.
194 (Target_s390::ss_code_c): Removed.
195 (Target_s390::ss_match_st_r14): New function.
196 (Target_s390::ss_match_l_r14): New function.
197 (Target_s390::ss_match_mcount): Call ss_match_{l,st}_r14 instead
198 of matching code directly.
199 (Target_s390::ss_match_ear): New function.
200 (Target_s390::ss_match_c): New function.
201 (Target_s390::do_calls_non_split): Call ss_match_{ear,c} instead
202 of matching code directly.
203
204 2016-05-19 Cary Coutant <ccoutant@gmail.com>
205
206 PR gold/19823
207 * copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
208 parameter; check for protected symbol.
209 * copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
210 * mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
211 * symtab.cc (Symbol::init_fields): Initialize is_protected_.
212 (Symbol_table::add_from_dynobj): Mark protected symbols.
213 * symtab.h (Symbol::is_protected): New method.
214 (Symbol::set_is_protected): New method.
215 (Symbol::is_protected_): New data member.
216
217 * testsuite/Makefile.am (copy_test_protected): New test.
218 * testsuite/Makefile.in: Regenerate.
219 * testsuite/copy_test.cc (main): Add legal reference to protected
220 symbol.
221 * testsuite/copy_test_v1.cc (main): Likewise.
222 * testsuite/copy_test_2.cc (ip): Add protected symbol.
223 * testsuite/copy_test_protected.cc: New test source file.
224 * testsuite/copy_test_protected.sh: New test script.
225
226 2016-05-19 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
227
228 * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
229 for global got symbols, and set addend to 0.
230 (Mips_got_entry::hash): Change hash algorithm.
231 (Mips_got_entry::equals): Refactor.
232 (Mips_got_entry::object): Return input object for local got symbols
233 from union d.
234 (Mips_got_entry::addend): Change return of the relocation addend.
235 (Mips_got_entry::addend_): Move from union d.
236 (Mips_got_entry::object_): Move into union d.
237 (class Mips_symbol_hash): New class.
238 (Mips_got_info::Global_got_entry_set): New type.
239 (Mips_got_info::global_got_symbols): Change return type to
240 Global_got_entry_set.
241 (Mips_got_info::global_got_symbols_): Change type to
242 Global_got_entry_set.
243 (Mips_symbol::hash): New method.
244 (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
245 (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
246 (Mips_output_data_mips_stubs::symbols_): Change type to
247 Mips_stubs_entry_set.
248 (Mips_got_info::record_global_got_symbol): Don't pass object
249 argument when creating global got symbol.
250 (Mips_got_info::record_got_entry): Remove find before inserting
251 got entries.
252 (Mips_got_info::add_reloc_only_entries): Change type of iterator
253 to Global_got_entry_set.
254 (Mips_got_info::count_got_symbols): Likewise.
255 (Mips_output_data_la25_stub::create_la25_stub): Use push_back
256 for adding entries to symbols_.
257 (Mips_output_data_la25_stub::do_write): Change type of iterator
258 to std::vector.
259 (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
260 of iterator to Mips_stubs_entry_set.
261 (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
262 (Mips_output_data_mips_stubs::do_write): Likewise.
263
264 2016-05-06 Han Shen <shenhan@google.com>
265
266 PR gold/19987.
267
268 * aarch64-reloc.def: New relocation type.
269 * aarch64.cc (AArch64_relocate_functions::Page): Changed to public.
270 (Target_aarch64::Scan::local): Add R_AARCH64_LD64_GOTPAGE_LO15.
271 (Target_aarch64::Scan::global): Add R_AARCH64_LD64_GOTPAGE_LO15.
272 (Target_aarch64::Relocate::relocate): Implement R_AARCH64_LD64_GOTPAGE_LO15.
273
274 2016-04-28 Nick Clifton <nickc@redhat.com>
275
276 * po/zh_CN.po: Updated Chinese (simplified) translation.
277
278 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
279
280 * Makefile.in: Regenerated with automake 1.11.6.
281 * aclocal.m4: Likewise.
282 * testsuite/Makefile.in: Likewise.
283
284 2016-03-30 Cary Coutant <ccoutant@gmail.com>
285
286 PR gold/16979
287 * symtab.cc (Symbol_table::define_default_version): Check for case
288 where symbols are both in different shared objects.
289
290 2016-03-27 Cary Coutant <ccoutant@gmail.com>
291
292 PR gold/16111
293 * i386.cc (Target_i386): Add check for fully-resolved symbol for
294 R_386_GOTOFF.
295
296 2016-03-22 Nick Clifton <nickc@redhat.com>
297
298 * configure: Regenerate.
299
300 2016-03-21 Cary Coutant <ccoutant@gmail.com>
301
302 PR gold/19842
303 * errors.cc (Errors::undefined_symbol): Add info message when
304 symbol should have been provided by a plugin.
305 * target-reloc.h (issue_undefined_symbol_error): Check for
306 placeholder symbols defined in discarded sections.
307 * testsuite/Makefile.am (plugin_test_9b): New test case.
308 * testsuite/Makefile.in: Regenerate.
309 * testsuite/plugin_test_9b_elf.cc: New test source file.
310 * testsuite/plugin_test_9b_ir.cc: New test source file.
311
312 2016-03-20 Cary Coutant <ccoutant@gmail.com>
313
314 PR gold/19002
315 * ehframe.cc (Eh_frame::read_fde): Check for dropped functions.
316 * testsuite/Makefile.am (eh_test_2): New test.
317 * testsuite/Makefile.in: Regenerate.
318 * testsuite/eh_test_2.sh: New test script.
319 * testsuite/eh_test_a.cc (bar): Make it comdat.
320 * testsuite/eh_test_b.cc (bar): Add a duplicate copy.
321
322 2016-03-18 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
323
324 * mips.cc (Mips_relobj::is_n64_): Remove.
325 (Target_mips::ei_class_): Likewise.
326 (Mips_relobj::is_newabi): Call methods.
327 (Mips_relobj::is_n64): Change checking for N64 ABI.
328 (Target_mips::is_output_n64): Likewise.
329 (Target_mips::merge_processor_specific_flags): Remove ei_class
330 argument, and remove comparing ei_class.
331 (Target_mips::do_adjust_elf_header): Remove setting EI_CLASS field
332 of the ELF header.
333 (Target_mips::do_finalize_sections): Don't pass ei_class argument
334 to merge_processor_specific_flags.
335 (Target_mips::elf_mips_abi_name): Remove ei_class argument, and
336 change checking for N64 ABI.
337
338 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
339
340 * mips.cc (enum Special_relocation_symbol): New enum type.
341 (is_readonly_section): New function.
342 (eh_reloc): Likewise.
343 (Mips_got_entry::is_section_symbol_): New member.
344 (Mips_got_entry::is_section_symbol): New method.
345 (Mips_got_info::record_local_got_symbol): Add is_section_symbol
346 argument.
347 (Mips_relobj::mips_elf_options_section_name): New method.
348 (Mips_output_data_got::record_local_got_symbol): Add
349 is_section_symbol argument, and pass it to
350 Mips_got_info::record_local_got_symbol.
351 (Mips_output_data_got::got_offset): Add addend argument, and pass
352 it to Relobj::local_got_offset.
353 (struct Mips_output_reloc_writer): New type.
354 (class Mips_output_data_reloc): New class.
355 (Mips_output_data_plt::Reloc_section): Change type to
356 Mips_output_data_reloc.
357 (Target_mips::Reloc_section): Likewise.
358 (Mips_reloc_types::get_r_addend): Remove unsigned from return type.
359 (Mips_classify_reloc::get_r_type2): New method.
360 (Mips_classify_reloc::get_r_type3): Likewise.
361 (Mips_classify_reloc::get_r_ssym): Likewise.
362 (Target_mips::Reloca_section): Remove.
363 (Relocate::should_apply_static_reloc): Rename from
364 should_apply_r_mips_32_reloc.
365 (Target_mips::copy_reloc): Replace Reltype parameter with r_type
366 and r_offset.
367 (Mips_relocate_functions::Valtype): New type.
368 (Mips_relocate_functions::Valtype64): New type.
369 (Mips_relocate_functions::check_overflow): New method.
370 (Mips_relocate_functions::mips_reloc_unshuffle): Move to public
371 interface.
372 (Mips_relocate_functions::mips_reloc_shuffle): Likewise.
373 (Mips_relocate_functions::rel16): Add support for resolving
374 relocations for Mips64.
375 (Mips_relocate_functions::rel32): Likewise.
376 (Mips_relocate_functions::reljalr): Likewise.
377 (Mips_relocate_functions::relpc32): Likewise.
378 (Mips_relocate_functions::rel26): Likewise.
379 (Mips_relocate_functions::relpc16): Likewise.
380 (Mips_relocate_functions::relmicromips_pc7_s1): Likewise.
381 (Mips_relocate_functions::relmicromips_pc10_s1): Likewise.
382 (Mips_relocate_functions::relmicromips_pc16_s1): Likewise.
383 (Mips_relocate_functions::do_relhi16): Likewise.
384 (Mips_relocate_functions::do_relgot16_local): Likewise.
385 (Mips_relocate_functions::rello16): Likewise.
386 (Mips_relocate_functions::relgot): Likewise.
387 (Mips_relocate_functions::relgotpage): Likewise.
388 (Mips_relocate_functions::relgotofst): Likewise.
389 (Mips_relocate_functions::relgot_hi16): Likewise.
390 (Mips_relocate_functions::relgot_lo16): Likewise.
391 (Mips_relocate_functions::relgprel): Likewise.
392 (Mips_relocate_functions::relgprel32): Likewise.
393 (Mips_relocate_functions::tlsrelhi16): Likewise.
394 (Mips_relocate_functions::tlsrello16): Likewise.
395 (Mips_relocate_functions::tlsrel32): Likewise.
396 (Mips_relocate_functions::relsub): Likewise.
397 (Mips_relocate_functions::releh): New method.
398 (Mips_relocate_functions::rel64): Likewise.
399 (Mips_got_info::record_local_got_symbol): Add is_section_symbol and
400 pass it to Mips_got_entry.
401 (Mips_got_info::add_local_entries): Pass addend argument
402 to code functions, and for STT_SECTION symbols call
403 add_symbolless_local_addend.
404 (Mips_got_info::add_tls_entries): Pass addend argument to code
405 functions.
406 (Mips_relobj::do_read_symbols): Read gp value that was used to
407 create object.
408 (Mips_output_data_plt::plt_entry): Remove opcode from l[wd]
409 instruction. Opcode for instruction will be selected later.
410 (Target_mips::gc_process_relocs): Add case for SHT_RELA.
411 (Target_mips::scan_relocatable_relocs): Likewise.
412 (Target_mips::emit_relocs_scan): Likewise.
413 (Target_mips::relocate_relocs): Likewise.
414 (Target_mips::do_finalize_sections): Skip objects for merging
415 processor specific flags in which all input sections will be
416 discarded.
417 (mips_get_size_for_reloc): Add case for R_MIPS_EH.
418 (Target_mips::Scan::get_reference_flags): Likewise.
419 (Target_mips::relocate_special_relocatable): Call rel26 method with
420 calculate_only and calculated_value arguments.
421 (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a
422 dynamic relocation against a readonly sections, and pass
423 is_section_symbol to Mips_got_info::record_local_got_symbol.
424 (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a
425 dynamic relocation against a readonly sections, and pass r_type
426 and r_offset to Target_mips::copy_reloc.
427 (Target_mips::Relocate::relocate): Add support for resolving
428 relocations for Mips64.
429 (Target_mips::mips_info): Add case for Mips64 default dynamic
430 linker name.
431 (Target_selector_mips): Correct emulation names.
432
433 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
434
435 * mips.cc (class Mips_output_data_la25_stub): Add
436 do_print_to_mapfile function.
437
438 2016-03-17 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
439
440 * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of
441 elf_r_info.
442
443 2016-03-09 H.J. Lu <hongjiu.lu@intel.com>
444
445 * testsuite/plugin_layout_with_alignment.cc: Renamed to ..
446 * testsuite/plugin_layout_with_alignment.c: This.
447 * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated.
448 (plugin_layout_with_alignment): Likewise.
449 * testsuite/Makefile.in: Regenerated.
450
451 2016-03-08 Cary Coutant <ccoutant@gmail.com>
452
453 PR 19751
454 * testsuite/Makefile.am (retain_symbols_file_test): Remove check
455 for constructor.
456 * testsuite/Makefile.in: Regenerate.
457 * testsuite/dynamic_list.sh: Likewise.
458 * testsuite/retain_symbols_file_test.sh: Likewise.
459
460 2016-03-08 Cary Coutant <ccoutant@gmail.com>
461
462 PR 19751
463 * arm.cc (Reloc_stub::Key::name): Add unused attribute.
464 * dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
465
466 2016-03-08 Cary Coutant <ccoutant@gmail.com>
467 Vladimir Radosavljevic <vladimir.radosavljevic@imgtec.com>
468
469 * output.cc (Output_reloc_writer): New type.
470 (Output_data_reloc_base::do_write): Move implementation to template
471 in output.h and replace with invocation of template.
472 * output.h (Output_file): Move to top of file.
473 (Output_reloc::get_symbol_index): Move to public interface.
474 (Output_reloc::get_address): Likewise.
475 (Output_data_reloc_base::do_write_generic): New function template.
476
477 2016-03-04 Cary Coutant <ccoutant@gmail.com>
478
479 PR gold/19019
480 PR gold/19763
481 * symtab.cc: Instantiate Sized_symbol::init_constant and
482 Sized_symbol::init_undefined.
483
484 2016-03-03 Cary Coutant <ccoutant@gmail.com>
485
486 PR gold/19019
487 * layout.h (Layout::add_target_specific_dynamic_tag): New function.
488 * layout.cc (Layout::add_target_specific_dynamic_tag): New function.
489 * mips.cc (Target_mips::make_symbol): Adjust function signature.
490 * sparc.cc (Target_sparc::Target_sparc): Initialize register_syms_.
491 (Target_sparc::do_is_defined_by_abi): Remove test for
492 STT_SPARC_REGISTER.
493 (Target_sparc::Register_symbol): New struct type.
494 (Target_sparc::register_syms_): New data member.
495 (Target_sparc<64, true>::sparc_info): Set has_make_symbol to true.
496 (Target_sparc::make_symbol): New function.
497 (Target_sparc::do_finalize_sections): Add register symbols and new
498 dynamic table entries.
499 * symtab.h (Sized_symbol::init_undefined): Add value parameter.
500 (Symbol_table::add_target_global_symbol): New function.
501 (Symbol_table::target_symbols_): New data member.
502 * symtab.cc (Sized_symbol::init_undefined): Add value parameter.
503 (Symbol_table::Symbol_table): Initialize target_symbols_.
504 (Symbol_table::add_from_object): Pass additional parameters to
505 Target::make_symbol.
506 (Symbol_table::define_special_symbol): Likewise.
507 (Symbol_table::add_undefined_symbol_from_command_line): Pass 0 for
508 undefined symbol value.
509 (Symbol_table::set_dynsym_indexes): Process target-specific symbols.
510 (Symbol_table::sized_finalize): Likewise.
511 (Symbol_table::sized_write_globals): Likewise.
512 * target.h (Sized_target::make_symbol): Add name, st_type, object,
513 st_shndx, and value parameters.
514
515 2016-03-03 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
516
517 * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
518 LDPK_WEAKUNDEF symbols.
519
520 2016-03-03 Than McIntosh <thanm@google.com>
521
522 * plugin.cc (Plugin::load): Include hooks for get_input_section_size
523 and get_input_section_alignment in transfer vector.
524 (get_input_section_alignment): New function.
525 (get_input_section_size): New function.
526 * testsuite/Makefile.am: Add plugin_layout_with_alignment.sh test.
527 * testsuite/Makefile.in: [Regenerate.]
528 * testsuite/plugin_section_alignment.cc: New test file.
529 * testsuite/plugin_layout_with_alignment.cc: New test file.
530 * testsuite/plugin_layout_with_alignment.sh: New test file.
531
532 2016-03-03 Evgenii Stepanov <eugenis@google.com>
533
534 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
535 parameter.
536 * plugin.cc (get_symbols_v3): New function.
537 (Plugin::load): Add LDPT_GET_SYMBOLS_V3.
538 (Pluginobj::get_symbol_resolution_info): Return LDPS_NO_SYMS when using
539 new version.
540
541 2016-02-26 Egor Kochetov <egor.kochetov@intel.com>
542 Cary Coutant <ccoutant@gmail.com>
543
544 PR gold/19735
545 * ehframe.h (Cie::fde_encoding): New method.
546 * ehframe.cc (Eh_frame::read_fde): Discard FDEs for zero-length
547 address ranges.
548
549 2016-02-15 H.J. Lu <hongjiu.lu@intel.com>
550
551 * testsuite/Makefile.am (x86_64_mov_to_lea5.o): Pass
552 -mrelax-relocations=yes to $(TEST_AS).
553 (x86_64_mov_to_lea6.o): Likewise.
554 (x86_64_overflow_pc32.o): Remove duplicated target.
555 * testsuite/Makefile.in: Regenerated.
556
557 2016-02-15 Marcin Koƛcielnicki <koriakin@0x04.net>
558
559 * s390.cc (Target_s390::match_view_u): New helper method.
560 (Target_s390::do_is_call_to_non_split): New method.
561 (Target_s390::ss_code_st_r14): New const.
562 (Target_s390::ss_code_l_r14): New const.
563 (Target_s390::ss_code_bras_8): New const.
564 (Target_s390::ss_code_l_basr): New const.
565 (Target_s390::ss_code_a_basr): New const.
566 (Target_s390::ss_code_ear): New const.
567 (Target_s390::ss_code_c): New const.
568 (Target_s390::ss_code_larl): New const.
569 (Target_s390::ss_code_brasl): New const.
570 (Target_s390::ss_code_jg): New const.
571 (Target_s390::ss_code_jgl): New const.
572 (Target_s390::ss_match_mcount): New helper method.
573 (Target_s390::ss_match_l): New helper method.
574 (Target_s390::ss_match_ahi): New helper method.
575 (Target_s390::ss_match_alfi): New helper method.
576 (Target_s390::ss_match_cr): New helper method.
577 (Target_s390::do_calls_non_split): New method.
578 * testsuite/Makefile.am: Added new tests.
579 * testsuite/Makefile.in: Regenerate.
580 * testsuite/split_s390.sh: New test.
581 * testsuite/split_s390_1_a1.s: New test.
582 * testsuite/split_s390_1_a2.s: New test.
583 * testsuite/split_s390_1_n1.s: New test.
584 * testsuite/split_s390_1_n2.s: New test.
585 * testsuite/split_s390_1_z1.s: New test.
586 * testsuite/split_s390_1_z2.s: New test.
587 * testsuite/split_s390_1_z3.s: New test.
588 * testsuite/split_s390_1_z4.s: New test.
589 * testsuite/split_s390_2_ns.s: New test.
590 * testsuite/split_s390_2_s.s: New test.
591 * testsuite/split_s390x_1_a1.s: New test.
592 * testsuite/split_s390x_1_a2.s: New test.
593 * testsuite/split_s390x_1_n1.s: New test.
594 * testsuite/split_s390x_1_n2.s: New test.
595 * testsuite/split_s390x_1_z1.s: New test.
596 * testsuite/split_s390x_1_z2.s: New test.
597 * testsuite/split_s390x_1_z3.s: New test.
598 * testsuite/split_s390x_1_z4.s: New test.
599 * testsuite/split_s390x_2_ns.s: New test.
600 * testsuite/split_s390x_2_s.s: New test.
601
602 2016-02-11 Rahul Chaudhry <rahulchaudhry@google.com>
603
604 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Remove
605 info message for every erratum 843419 found and fixed.
606
607 2016-02-07 Cary Coutant <ccoutant@gmail.com>
608
609 PR gold/18695
610 * x86_64.cc (Target_x86_64::Relocate::relocate): Add additional
611 information to relocation overflow errors.
612
613 2016-02-06 Cary Coutant <ccoutant@gmail.com>
614
615 PR gold/18695
616 * x86_64.cc (X86_64_relocate_functions::pcrela32_check): Fix x32
617 overflow checking when symbol value + addend < 0.
618
619 2016-02-06 Cary Coutant <ccoutant@gmail.com>
620
621 PR gold/19577
622 * reloc.h (Limits): New class.
623 (Bits::has_overflow32): Use min/max values from Limits.
624 (Bits::has_unsigned_overflow32): Likewise.
625 (Bits::has_signed_unsigned_overflow32): Likewise.
626 (Bits::has_overflow): Likewise.
627 (Bits::has_unsigned_overflow): Likewise.
628 (Bits::has_signed_unsigned_overflow64): Likewise.
629
630 2016-02-06 Cary Coutant <ccoutant@gmail.com>
631
632 PR gold/19567
633 * reloc.h (Relocate_functions::Overflow_check): Add comments.
634 * x86_64.cc (X86_64_relocate_functions): New class.
635 (Target_x86_64::Relocate::relocate): Use the new class.
636 * testsuite/Makefile.am (x86_64_overflow_pc32): Add -Tdata option.
637 (x32_overflow_pc32): New test case.
638 * testsuite/Makefile.in: Regenerate.
639 * testsuite/x32_overflow_pc32.sh: New script.
640 * testsuite/x86_64_overflow_pc32.s: Remove .space directive.
641
642 2016-02-06 Cary Coutant <ccoutant@gmail.com>
643
644 PR gold/19577
645 * reloc.h (Bits::has_unsigned_overflow32): Fix static_cast.
646 (Bits::has_unsigned_overflow): Remove unnecessary static_cast.
647
648 2016-02-06 Cary Coutant <ccoutant@gmail.com>
649
650 PR gold/19577
651 * reloc.h (Bits::has_unsigned_overflow32): Fix unsigned/signed
652 comparison.
653 (Bits::has_unsigned_overflow): Likewise.
654
655 2016-02-06 Marcin Koƛcielnicki <koriakin@0x04.net>
656
657 * i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
658 parameters.
659 * reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
660 and view_size to is_call_to_non_split.
661 * target.cc (Target::is_call_to_non_split): Add view and view_size
662 parameters.
663 * target.h (class Target): Likewise.
664
665 2016-02-05 Sriraman Tallam <tmsriram@google.com>
666
667 * icf.cc (get_rel_addend): New function.
668 (get_section_contents): Move merge section addend computation to a
669 new function. Ignore negative values for SHT_REL and SHT_RELA addends.
670 Fix bug to not read past the length of the section.
671
672 2016-02-05 Cary Coutant <ccoutant@gmail.com>
673 Andrew Senkevich <andrew.senkevich@intel.com>
674
675 PR gold/18695
676 * x86_64.cc (Target_x86_64::Relocate::relocate): Add overflow
677 checking for R_X86_64_32, R_X86_64_32S, R_X86_64_PC32, and
678 R_X86_64_PLT32.
679 * testsuite/Makefile.am (x86_64_overflow_pc32): New test.
680 * testsuite/x86_64_overflow_pc32.sh: New test script.
681 * testsuite/x86_64_overflow_pc32.s: New source file.
682
683 2016-02-05 Cary Coutant <ccoutant@gmail.com>
684
685 PR gold/18695
686 * reloc.h (Relocate_functions::Address): New typedef.
687 (Relocate_functions::Addendtype): New typedef.
688 (Relocate_functions::Overflow_check): New enum type.
689 (Relocate_functions::Reloc_status): New enum type.
690 (Relocate_functions::check_overflow): New function template.
691 (Relocate_functions::rel): Add check parameter; check for overflow.
692 (Relocate_functions::rel_unaligned): Likewise.
693 (Relocate_functions::rela): Likewise.
694 (Relocate_functions::pcrel): Likewise.
695 (Relocate_functions::pcrel_unaligned): Likewise.
696 (Relocate_functions::pcrela): Likewise.
697 (Relocate_functions::rel8): Adjust parameter types.
698 (Relocate_functions::rela8): Likewise.
699 (Relocate_functions::pcrel8): Likewise.
700 (Relocate_functions::pcrela8): Likewise.
701 (Relocate_functions::rel16): Likewise.
702 (Relocate_functions::rela168): Likewise.
703 (Relocate_functions::pcrel16): Likewise.
704 (Relocate_functions::pcrela16): Likewise.
705 (Relocate_functions::rel32): Likewise.
706 (Relocate_functions::rel32_unaligned): Likewise.
707 (Relocate_functions::rela32): Likewise.
708 (Relocate_functions::pcrel32): Likewise.
709 (Relocate_functions::pcrel32_unaligned): Likewise.
710 (Relocate_functions::pcrela32): Likewise.
711 (Relocate_functions::rel8_check): New function.
712 (Relocate_functions::rela8_check): New function.
713 (Relocate_functions::pcrel8_check): New function.
714 (Relocate_functions::pcrela8_check): New function.
715 (Relocate_functions::rel16_check): New function.
716 (Relocate_functions::rela168_check): New function.
717 (Relocate_functions::pcrel16_check): New function.
718 (Relocate_functions::pcrela16_check): New function.
719 (Relocate_functions::rel32_check): New function.
720 (Relocate_functions::rel32_unaligned_check): New function.
721 (Relocate_functions::rela32_check): New function.
722 (Relocate_functions::pcrel32_check): New function.
723 (Relocate_functions::pcrel32_unaligned_check): New function.
724 (Relocate_functions::pcrela32_check): New function.
725 (Bits::has_unsigned_overflow32): New function.
726 (Bits::has_unsigned_overflow): New function.
727 * testsuite/Makefile.am (overflow_unittest): New test.
728 * testsuite/Makefile.in: Regenerate.
729 * testsuite/overflow_unittest.cc: New source file.
730
731 2016-02-04 Alan Modra <amodra@gmail.com>
732
733 * powerpc.cc (relocate): Adjust last patch for big-endian.
734
735 2016-02-02 Alan Modra <amodra@gmail.com>
736
737 * powerpc.cc (relocate): Further restrict ELFv2 entry optimization.
738
739 2016-01-15 Han Shen <shenhan@google.com>
740
741 PR gold/19472 - need pc-relative stubs.
742
743 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative
744 stub type for DSOs and pie executables.
745
746 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
747
748 * i386.cc (Target_i386::Classify_reloc::get_r_addend): Remove
749 'typename'.
750
751 2016-01-12 Cary Coutant <ccoutant@gmail.com>
752
753 * arm.cc (Target_arm::Classify_reloc::get_r_addend): New method.
754 * i386.cc (Target_i386::Classify_reloc::get_r_addend): New method.
755 * mips.cc (Target_arm::Mips_classify_reloc::get_r_addend): (Both
756 specializations) New method.
757
758 2016-01-11 Cary Coutant <ccoutant@gmail.com>
759
760 PR gold/19353
761 * aarch64.cc (Target_aarch64::relocate_tls): Don't insist that
762 we have a TLS segment for GD-to-IE optimization.
763 * i386.cc (Target_i386::tls_gd_to_ie): Remove tls_segment parameter.
764 Adjust all calls.
765 (Target_i386::tls_desc_gd_to_ie): Likewise.
766 (Target_i386::relocate_tls): Don't insist that we have a TLS segment
767 for TLSDESC GD-to-IE optimizations.
768 * x86_64.cc (Target_x86_64::tls_gd_to_ie): Remove tls_segment parameter.
769 Adjust all calls.
770 (Target_x86_64::tls_desc_gd_to_ie): Likewise.
771 (Target_x86_64::relocate_tls): Don't insist that we have a TLS segment
772 for TLSDESC GD-to-IE optimizations.
773
774 2016-01-11 Cary Coutant <ccoutant@gmail.com>
775
776 Refactor gold to enable support for MIPS-64 relocation format.
777
778 * gc.h (get_embedded_addend_size): Remove sh_type parameter.
779 (gc_process_relocs): Remove sh_type template parameter.
780 Use Classify_reloc to access r_sym, r_type, and r_addend fields.
781 * object.h (Sized_relobj_file::split_stack_adjust): Add target
782 parameter.
783 (Sized_relobj_file::split_stack_adjust_reltype): Likewise.
784 * reloc-types.h (Reloc_types::copy_reloc_addend): (SHT_REL and SHT_RELA
785 specializations) Remove.
786 * reloc.cc (Emit_relocs_strategy): Rename and move to target-reloc.h.
787 (Sized_relobj_file::emit_relocs_scan): Call Target::emit_relocs_scan().
788 (Sized_relobj_file::emit_relocs_scan_reltype): Remove.
789 (Sized_relobj_file::split_stack_adjust): Add target parameter.
790 Adjust all callers.
791 (Sized_relobj_file::split_stack_adjust_reltype): Likewise. Call
792 Target::get_r_sym() to get r_sym field from relocations.
793 (Track_relocs::next_symndx): Call Target::get_r_sym().
794 * target-reloc.h (scan_relocs): Remove sh_type template parameter;
795 add Classify_reloc template parameter. Use for accessing r_sym and
796 r_type.
797 (relocate_section): Likewise.
798 (Default_classify_reloc): New class (renamed and moved from reloc.cc).
799 (Default_scan_relocatable_relocs): Remove sh_type template parameter.
800 (Default_scan_relocatable_relocs::Reltype): New typedef.
801 (Default_scan_relocatable_relocs::reloc_size): New const.
802 (Default_scan_relocatable_relocs::sh_type): New const.
803 (Default_scan_relocatable_relocs::get_r_sym): New method.
804 (Default_scan_relocatable_relocs::get_r_type): New method.
805 (Default_emit_relocs_strategy): New class.
806 (scan_relocatable_relocs): Replace sh_type template parameter with
807 Scan_relocatable_relocs class. Use it to access r_sym and r_type
808 fields.
809 (relocate_relocs): Replace sh_type template parameter with
810 Classify_reloc class. Use it to access r_sym and r_type fields.
811 * target.h (Target::is_call_to_non_split): Replace r_type parameter
812 with pointer to relocation. Adjust all callers.
813 (Target::do_is_call_to_non_split): Likewise.
814 (Target::emit_relocs_scan): New virtual method.
815 (Sized_target::get_r_sym): New virtual method.
816 * target.cc (Target::do_is_call_to_non_split): Replace r_type parameter
817 with pointer to relocation.
818
819 * aarch64.cc (Target_aarch64::emit_relocs_scan): New method.
820 (Target_aarch64::Relocatable_size_for_reloc): Remove.
821 (Target_aarch64::gc_process_relocs): Use Default_classify_reloc.
822 (Target_aarch64::scan_relocs): Likewise.
823 (Target_aarch64::relocate_section): Likewise.
824 (Target_aarch64::Relocatable_size_for_reloc::get_size_for_reloc):
825 Remove.
826 (Target_aarch64::scan_relocatable_relocs): Use Default_classify_reloc.
827 (Target_aarch64::relocate_relocs): Use Default_classify_reloc.
828 * arm.cc (Target_arm::Arm_scan_relocatable_relocs): Remove sh_type
829 template parameter.
830 (Target_arm::emit_relocs_scan): New method.
831 (Target_arm::Relocatable_size_for_reloc): Replace with...
832 (Target_arm::Classify_reloc): ...this.
833 (Target_arm::gc_process_relocs): Use Classify_reloc.
834 (Target_arm::scan_relocs): Likewise.
835 (Target_arm::relocate_section): Likewise.
836 (Target_arm::scan_relocatable_relocs): Likewise.
837 (Target_arm::relocate_relocs): Likewise.
838 * i386.cc (Target_i386::emit_relocs_scan): New method.
839 (Target_i386::Relocatable_size_for_reloc): Replace with...
840 (Target_i386::Classify_reloc): ...this.
841 (Target_i386::gc_process_relocs): Use Classify_reloc.
842 (Target_i386::scan_relocs): Likewise.
843 (Target_i386::relocate_section): Likewise.
844 (Target_i386::scan_relocatable_relocs): Likewise.
845 (Target_i386::relocate_relocs): Likewise.
846 * mips.cc (Mips_scan_relocatable_relocs): Remove sh_type template
847 parameter.
848 (Mips_reloc_types): New class template.
849 (Mips_classify_reloc): New class template.
850 (Target_mips::Reltype): New typedef.
851 (Target_mips::Relatype): New typedef.
852 (Target_mips::emit_relocs_scan): New method.
853 (Target_mips::get_r_sym): New method.
854 (Target_mips::Relocatable_size_for_reloc): Replace with
855 Mips_classify_reloc.
856 (Target_mips::copy_reloc): Use Mips_classify_reloc.
857 (Target_mips::gc_process_relocs): Likewise.
858 (Target_mips::scan_relocs): Likewise.
859 (Target_mips::relocate_section): Likewise.
860 (Target_mips::scan_relocatable_relocs): Likewise.
861 (Target_mips::relocate_relocs): Likewise.
862 (mips_get_size_for_reloc): New function, factored out from
863 Relocatable_size_for_reloc::get_size_for_reloc.
864 (Target_mips::Scan::local): Use Mips_classify_reloc.
865 (Target_mips::Scan::global): Likewise.
866 (Target_mips::Relocate::relocate): Likewise.
867 * powerpc.cc (Target_powerpc::emit_relocs_scan): New method.
868 (Target_powerpc::Relocatable_size_for_reloc): Remove.
869 (Target_powerpc::gc_process_relocs): Use Default_classify_reloc.
870 (Target_powerpc::scan_relocs): Likewise.
871 (Target_powerpc::relocate_section): Likewise.
872 (Powerpc_scan_relocatable_reloc): Convert to class template.
873 (Powerpc_scan_relocatable_reloc::Reltype): New typedef.
874 (Powerpc_scan_relocatable_reloc::reloc_size): New const.
875 (Powerpc_scan_relocatable_reloc::sh_type): New const.
876 (Powerpc_scan_relocatable_reloc::get_r_sym): New method.
877 (Powerpc_scan_relocatable_reloc::get_r_type): New method.
878 (Target_powerpc::scan_relocatable_relocs): Use
879 Powerpc_scan_relocatable_reloc.
880 (Target_powerpc::relocate_relocs): Use Default_classify_reloc.
881 * s390.cc (Target_s390::emit_relocs_scan): New method.
882 (Target_s390::Relocatable_size_for_reloc): Remove.
883 (Target_s390::gc_process_relocs): Use Default_classify_reloc.
884 (Target_s390::scan_relocs): Likewise.
885 (Target_s390::relocate_section): Likewise.
886 (Target_s390::Relocatable_size_for_reloc::get_size_for_reloc):
887 Remove.
888 (Target_s390::scan_relocatable_relocs): Use Default_classify_reloc.
889 (Target_s390::relocate_relocs): Use Default_classify_reloc.
890 * sparc.cc (Target_sparc::emit_relocs_scan): New method.
891 (Target_sparc::Relocatable_size_for_reloc): Remove.
892 (Target_sparc::gc_process_relocs): Use Default_classify_reloc.
893 (Target_sparc::scan_relocs): Likewise.
894 (Target_sparc::relocate_section): Likewise.
895 (Target_sparc::Relocatable_size_for_reloc::get_size_for_reloc):
896 Remove.
897 (Target_sparc::scan_relocatable_relocs): Use Default_classify_reloc.
898 (Target_sparc::relocate_relocs): Use Default_classify_reloc.
899 * tilegx.cc (Target_tilegx::emit_relocs_scan): New method.
900 (Target_tilegx::Relocatable_size_for_reloc): Remove.
901 (Target_tilegx::gc_process_relocs): Use Default_classify_reloc.
902 (Target_tilegx::scan_relocs): Likewise.
903 (Target_tilegx::relocate_section): Likewise.
904 (Target_tilegx::Relocatable_size_for_reloc::get_size_for_reloc):
905 Remove.
906 (Target_tilegx::scan_relocatable_relocs): Use Default_classify_reloc.
907 (Target_tilegx::relocate_relocs): Use Default_classify_reloc.
908 * x86_64.cc (Target_x86_64::emit_relocs_scan): New method.
909 (Target_x86_64::Relocatable_size_for_reloc): Remove.
910 (Target_x86_64::gc_process_relocs): Use Default_classify_reloc.
911 (Target_x86_64::scan_relocs): Likewise.
912 (Target_x86_64::relocate_section): Likewise.
913 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
914 Remove.
915 (Target_x86_64::scan_relocatable_relocs): Use Default_classify_reloc.
916 (Target_x86_64::relocate_relocs): Use Default_classify_reloc.
917
918 * testsuite/testfile.cc (Target_test::emit_relocs_scan): New method.
919
920 2016-01-01 Alan Modra <amodra@gmail.com>
921
922 Update year range in copyright notice of all files.
923
924 For older changes see ChangeLog-0815
925 \f
926 Copyright (C) 2016 Free Software Foundation, Inc.
927
928 Copying and distribution of this file, with or without modification,
929 are permitted in any medium without royalty provided the copyright
930 notice and this notice are preserved.
931
932 Local Variables:
933 mode: change-log
934 left-margin: 8
935 fill-column: 74
936 version-control: never
937 End:
This page took 0.055426 seconds and 4 git commands to generate.