Add some missing xcoff support
[binutils-gdb.git] / bfd / ChangeLog
1 2017-07-07 Alan Modra <amodra@gmail.com>
2
3 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
4
5 2017-07-07 Alan Modra <amodra@gmail.com>
6
7 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
8 as long long. Move code replacing "ll" with "I64", and simplify.
9
10 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
11
12 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
13 to 1.
14
15 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
16
17 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
18 xtime.
19 (line_info_add_file_name): Likewise.
20 (decode_line_info): Likewise.
21
22 2017-07-04 Tristan Gingold <gingold@adacore.com>
23
24 * version.m4: Bump version to 2.29.51
25 * configure: Regenerate.
26
27 2017-07-04 Jiong Wang <jiong.wang@arm.com>
28
29 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
30 sanity check at the head of this function.
31
32 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
33
34 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
35 dwarf_line_str_size.
36 (struct attr_abbrev): Add field implicit_const.
37 (dwarf_debug_sections): Add .debug_line_str.
38 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
39 (dwarf_debug_section_assert): Add static assertion.
40 (read_indirect_line_string): New.
41 (read_abbrevs): Support DW_FORM_implicit_const.
42 (is_str_attr): Support DW_FORM_line_strp.
43 (read_attribute_value): Support DW_FORM_line_strp and
44 DW_FORM_implicit_const.
45 (read_attribute): Support DW_FORM_implicit_const.
46 (line_info_add_include_dir, line_info_add_include_dir_stub):
47 (line_info_add_file_name, read_formatted_entries): New.
48 (decode_line_info, parse_comp_unit): Support DWARF 5.
49 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
50
51 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
52
53 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
54 abort statement that was put for symbols that are not dynamic.
55
56 2017-07-03 Tristan Gingold <gingold@adacore.com>
57
58 * po/bfd.pot: Regenerate
59
60 2017-07-03 Alan Modra <amodra@gmail.com>
61
62 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
63 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
64 * elf.c (setup_group): Use "Lx" to print sh_size.
65 (_bfd_elf_setup_sections): Remove unnecessary cast and print
66 unknown section type in hex.
67 (copy_special_section_fields): Style fix.
68 (bfd_section_from_shdr): Correct format for sh_link. Use a
69 common error message for all the variants of unrecognized
70 section types.
71 (assign_file_positions_for_load_sections): Use "Lx" for lma
72 adjust error message.
73 (assign_file_positions_for_non_load_sections): Formatting.
74 (rewrite_elf_program_header): Formatting. Use "Lx" for
75 bfd_vma values in error messages.
76 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
77 ELF_R_SYM value to type expected by format.
78 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
79 in error messages.
80 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
81 (elf_link_input_bfd): Use "Lx" for r_info.
82 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
83
84 2017-07-03 Alan Modra <amodra@gmail.com>
85
86 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
87 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
88 Microsoft C library variant of long long format specifier.
89 (PRINT20): Cast value to bfd_uint64_t not long long.
90 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
91 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
92 long long. Don't cast to bfd_vma.
93 * elf32-score.c (score3_bfd_getl48): Likewise.
94 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
95
96 2017-07-03 Alan Modra <amodra@gmail.com>
97
98 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
99 print d_tag.
100 (bfd_elf_print_symbol): Don't cast symbol->flags.
101 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
102 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
103 _bfd_error_handler argument order.
104 (ppc_elf_merge_private_bfd_data): Don't cast flags.
105
106 2017-07-03 Alan Modra <amodra@gmail.com>
107
108 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
109 AC_TYPE_LONG_DOUBLE.
110 * configure: Regenerate.
111 * config.in: Regenerate.
112
113 2017-06-29 Andrew Waterman <andrew@sifive.com>
114
115 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
116 relocs.
117
118 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
119
120 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
121 unless it is undefined weak.
122 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
123 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
124 relocation.
125 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
126 is not dynamic in PIC, abort.
127
128 2017-06-29 Jiong Wang <jiong.wang@arm.com>
129
130 PR ld/21402
131 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
132 undefined weak symbols into dynamic.
133 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
134 relocation for non-dynamic symbols.
135 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
136
137 2017-06-29 Jiong Wang <jiong.wang@arm.com>
138
139 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
140 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
141 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
142 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
143 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
144 support for them.
145
146 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
147
148 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
149 (elfcore_write_s390_gs_bc): Likewise.
150 * elf.c (elfcore_grok_s390_gs_cb): New function.
151 (elfcore_grok_s390_gs_bc): New function.
152 (elfcore_grok_note): Call them.
153 (elfcore_write_s390_gs_cb): New function.
154 (elfcore_write_s390_gs_bc): New function.
155 (elfcore_write_register_note): Call them.
156
157 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
158
159 * libbfd.c (_bfd_generic_get_section_contents): Don't call
160 bfd_get_file_size. Check archive element size.
161 (_bfd_generic_get_section_contents_in_window): Likewise.
162
163 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
164
165 * bfd-in2.h: Regenerated.
166 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
167 (bfd_get_file_size): Likewise.
168
169 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
170 Matthew Fortune <matthew.fortune@imgtec.com>
171
172 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
173 * cpu-mips.c (I_interaptiv_mr2): New enum value.
174 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
175 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
176 case.
177 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
178 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
179 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
180 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
181 `bfd_mach_mips_interaptiv_mr2' entries.
182 * bfd-in2.h: Regenerate.
183
184 2017-06-27 Nick Clifton <nickc@redhat.com>
185
186 * tekhex.c (pass_over): Revert accidental conversion of a local
187 array to a static array.
188
189 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
190
191 PR ld/13402
192 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
193 reloc addend if necessary. Adjust diff only if
194 shrinked_insn_address < end_address.
195
196 2017-06-27 Alan Modra <amodra@gmail.com>
197
198 PR binutils/21665
199 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
200 (_bfd_generic_get_section_contents_in_window): Likewise.
201
202 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
203
204 * elfnn-riscv.c (perform_relocation): Support the new
205 R_RISCV_32_PCREL relocation.
206 (riscv_elf_relocate_section): Likewise.
207 * elfxx-riscv.c (howto_table): Likewise.
208 (riscv_reloc_map): Likewise.
209 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
210 * libbfd.h: Regenerate.
211
212 2017-06-27 Alan Modra <amodra@gmail.com>
213
214 PR binutils/21665
215 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
216 Use unsigned file pointer type, and remove cast.
217 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
218 Add "count", not "sz".
219
220 2017-06-26 Pedro Alves <palves@redhat.com>
221
222 PR binutils/21665
223 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
224 "sz".
225
226 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
227
228 PR binutils/21665
229 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
230 a missing line.
231
232 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
233
234 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
235 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
236 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
237 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
238 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
239
240 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
241
242 PR binutils/21665
243 * compress.c (bfd_get_full_section_contents): Don't check the
244 file size here.
245 * libbfd.c (_bfd_generic_get_section_contents): Check for and
246 reject a section whose size + offset is greater than the size
247 of the entire file.
248 (_bfd_generic_get_section_contents_in_window): Likewise.
249
250 2017-06-26 Nick Clifton <nickc@redhat.com>
251
252 PR binutils/21670
253 * tekhex.c (getvalue): Check for the source pointer exceeding the
254 end pointer before the first byte is read.
255
256 2017-06-26 Nick Clifton <nickc@redhat.com>
257
258 PR binutils/21665
259 * opncls.c (get_build_id): Check that the section is big enough
260 to contain the whole note.
261 * compress.c (bfd_get_full_section_contents): Check for and reject
262 a section whose size is greater than the size of the entire file.
263 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
264 contain a notes section.
265
266 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
267
268 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
269 pointer checks.
270 (elf_s390_modify_segment_map): Likewise.
271 (bfd_elf_s390_set_options): Lisewise.
272
273 2017-06-26 Alan Modra <amodra@gmail.com>
274
275 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
276 a --just-syms bfd.
277 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
278 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
279 .preinit_array on --just-syms bfds.
280 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
281 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
282 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
283
284 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
285
286 * elf.c (find_link): Bounds check "hint".
287
288 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
289
290 * elf32-arm.c (using_thumb_only): Update list of architectures in
291 BFD_ASSERT for which the logic is valid.
292 (using_thumb2_bl): Likewise.
293 (using_thumb2): Likewise and return true for ARMv8-R.
294 (arch_has_arm_nop): Likewise.
295 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
296 merging logic. Update commentis for value 15 of v8m_baseline,
297 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
298 merging of value 15 of Tag_CPU_arch.
299
300 2017-06-23 Jiong Wang <jiong.wang@arm.com>
301
302 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
303 BFD_RELOC_AARCH64_ADR_GOT_PAGE
304 * bfd-in2.h: Regenerate.
305
306 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
307
308 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
309 the error_alignment label forward. Properly align program
310 property note section.
311
312 2017-06-22 Eric Christopher <echristo@gmail.com>
313
314 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
315 abs to fix a truncation warning.
316
317 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
318
319 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
320 local undefined weak symbol to 0.
321 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
322
323 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
324
325 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
326 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
327 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
328 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
329 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
330 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
331 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
332 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
333
334 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
335
336 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
337 (elf_i386_lazy_ibt_plt_entry): Likewise.
338 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
339 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
340 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
341 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
342 (elf_i386_lazy_plt_layout): Likewise.
343 (elf_i386_non_lazy_plt_layout): Likewise.
344 (elf_i386_link_hash_entry): Add plt_second.
345 (elf_i386_link_hash_table): Add plt_second and
346 plt_second_eh_frame.
347 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
348 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
349 the second PLT. Check the second PLT.
350 (elf_i386_relocate_section): Use the second PLT to resolve
351 PLT reference if needed.
352 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
353 needed.
354 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
355 second PLT. Generate unwind info for the second PLT.
356 (elf_i386_plt_type): Add plt_second.
357 (elf_i386_get_synthetic_symtab): Support the second PLT.
358 (elf_i386_parse_gnu_properties): Support
359 GNU_PROPERTY_X86_FEATURE_1_AND.
360 (elf_i386_merge_gnu_properties): Support
361 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
362 on GNU_PROPERTY_X86_FEATURE_1_IBT
363 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
364 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
365 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
366 is set on all relocatable inputs.
367 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
368 (elf_x32_lazy_ibt_plt_entry): Likewise.
369 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
370 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
371 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
372 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
373 (elf_x86_64_lazy_ibt_plt): Likewise.
374 (elf_x32_lazy_ibt_plt): Likewise.
375 (elf_x86_64_non_lazy_ibt_plt): Likewise.
376 (elf_x32_non_lazy_ibt_plt): Likewise.
377 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
378 (elf_x86_64_parse_gnu_properties): Support
379 GNU_PROPERTY_X86_FEATURE_1_AND.
380 (elf_x86_64_merge_gnu_properties): Support
381 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
382 on GNU_PROPERTY_X86_FEATURE_1_IBT
383 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
384 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
385 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
386 is set on all relocatable inputs.
387
388 2017-06-22 Nick Clifton <nickc@redhat.com>
389
390 PR binutils/21649
391 * som.c (setup_sections): NUL terminate the space_strings buffer.
392 Check that the space.name field does not index beyond the end of
393 the space_strings buffer.
394
395 2017-06-21 Nick Clifton <nickc@redhat.com>
396
397 PR binutils/21646
398 * coff-sh.c (sh_reloc): Check for an out of range reloc.
399
400 2017-06-21 Nick Clifton <nickc@redhat.com>
401
402 PR binutils/21639
403 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
404 type of the size parameter.
405 (_bfd_vms_save_counted_string): Add second parameter - the maximum
406 length of the counted string.
407 * vms.h (_bfd_vms_save_sized_string): Update prototype.
408 (_bfd_vms_save_counted_string): Likewise.
409 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
410 _bfd_vms_save_counted_string.
411 (_bfd_vms_slurp_ehdr): Likewise.
412 (_bfd_vms_slurp_egsd): Likewise.
413 (Parse_module): Likewise.
414
415 2017-06-21 Alan Modra <amodra@gmail.com>
416
417 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
418 calls before tocsave calls.
419 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
420 following nop.
421
422 2017-06-21 Nick Clifton <nickc@redhat.com>
423
424 PR binutils/21645
425 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
426 bfd_get_full_section_contents returns no contents.
427
428 2017-06-21 Nick Clifton <nickc@redhat.com>
429
430 PR binutils/21638
431 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
432 record.
433
434 2017-06-21 Nick Clifton <nickc@redhat.com>
435
436 PR binutils/21637
437 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
438 list.
439 (image_set_ptr): Likewise.
440 (alpha_vms_fix_sec_rel): Likewise.
441 (alpha_vms_slurp_relocs): Likewise.
442
443 2017-06-21 Nick Clifton <nickc@redhat.com>
444
445 PR binutils/21633
446 * ieee.c (ieee_slurp_sections): Check for a NULL return from
447 read_id.
448 (ieee_archive_p): Likewise.
449 (ieee_object_p): Likewise.
450
451 2017-06-21 Nick Clifton <nickc@redhat.com>
452
453 PR binutils/21640
454 * elf.c (setup_group): Zero the group section pointer list after
455 allocation so that loops can be caught. Check for NULL pointers
456 when processing a group list.
457
458 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
459
460 * elf-s390.h: New file.
461 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
462 field.
463 (elf_s390_additional_program_headers): New function.
464 (elf_s390_modify_segment_map): New function.
465 (bfd_elf_s390_set_options): New function.
466 (elf_backend_additional_program_headers)
467 (elf_backend_modify_segment_map): Add macro definitions.
468
469 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
470
471 PR ld/21626
472 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
473 the DYNAMIC bit instead of bfd_count_sections.
474
475 2017-06-19 Nick Clifton <nickc@redhat.com>
476
477 PR binutils/21618
478 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
479 length.
480 (evax_bfd_print_eeom): Likewise.
481 (evax_bfd_print_egsd): Check for an overlarge record length.
482 (evax_bfd_print_etir): Likewise.
483
484 2017-06-19 Nick Clifton <nickc@redhat.com>
485
486 PR binutils/21612
487 * libieee.h (struct common_header_type): Add end_p field.
488 * ieee.c (this_byte_and_next): Do not advance input_p beyond
489 end_p.
490 (read_id): Check for a length that exceeds the remaining bytes in
491 the input buffer.
492 (ieee_seek): Initialise end_p.
493 (ieee_archive_p): Likewise.
494 (ieee_object_p): Likewise.
495
496 2017-06-19 Nick Clifton <nickc@redhat.com>
497
498 PR binutils/21611
499 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
500 before reading the EIHS structure entries.
501
502 2017-06-19 Nick Clifton <nickc@redhat.com>
503
504 PR binutils/21615
505 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
506 gsd_size. Check that there are enough bytes remaining to read the
507 type and size of the next egsd. Check that the size of the egsd
508 does not exceed the size of the record.
509
510 2017-06-19 Alan Modra <amodra@gmail.com>
511
512 * config.bfd: Correct targ_underscore for cris.
513
514 2017-06-18 Alan Modra <amodra@gmail.com>
515
516 * config.bfd: Correct targ_underscore for epiphany, ip2k,
517 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
518
519 2017-06-16 Nick Clifton <nickc@redhat.com>
520
521 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
522 bucketlist is empty because there are no symbols to add to the
523 list.
524
525 2017-06-16 Alan Modra <amodra@gmail.com>
526
527 PR ld/20022
528 PR ld/21557
529 PR ld/21562
530 PR ld/21571
531 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
532 (BFD_JUMP_TABLE_LINK): Likewise.
533 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
534 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
535 (bfd_elf_define_start_stop): New function.
536 * linker.c (bfd_generic_define_start_stop): New function.
537 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
538 new field.
539 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
540 * aout-target.h (MY_bfd_define_start_stop): Define.
541 * aout-tic30.c (MY_bfd_define_start_stop): Define.
542 * binary.c (binary_bfd_define_start_stop): Define.
543 * bout.c (b_out_bfd_define_start_stop): Define.
544 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
545 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
546 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
547 * coffcode.h (coff_bfd_define_start_stop): Define.
548 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
549 * i386msdos.c (msdos_bfd_define_start_stop): Define.
550 * i386os9k.c (os9k_bfd_define_start_stop): Define.
551 * ieee.c (ieee_bfd_define_start_stop): Define.
552 * ihex.c (ihex_bfd_define_start_stop): Define.
553 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
554 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
555 * mmo.c (mmo_bfd_define_start_stop): Define.
556 * nlm-target.h (nlm_bfd_define_start_stop): Define.
557 * oasys.c (oasys_bfd_define_start_stop): Define.
558 * pef.c (bfd_pef_bfd_define_start_stop): Define.
559 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
560 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
561 * som.c (som_bfd_define_start_stop): Define.
562 * srec.c (srec_bfd_define_start_stop): Define.
563 * tekhex.c (tekhex_bfd_define_start_stop): Define.
564 * versados.c (versados_bfd_define_start_stop): Define.
565 * vms-alpha.c (vms_bfd_define_start_stop): Define.
566 (alpha_vms_bfd_define_start_stop): Define.
567 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
568 * bfd-in2.h: Regenerate.
569 * libbfd.h: Regenerate.
570
571 2017-06-16 Jiong Wang <jiong.wang@arm.com>
572
573 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
574 SYMBOL_REFERENCES_LOCAL.
575
576 2017-06-15 Jiong Wang <jiong.wang@arm.com>
577
578 PR ld/21532
579 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
580 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
581 runtime for if there needs copy relocation elimination.
582 (need_copy_relocation_p): New function. Return true for symbol with
583 pc-relative references and if it's against read-only sections.
584 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
585 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
586 that are related with accessing external objects.
587 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
588 in elfNN_aarch64_check_relocs.
589
590 2017-06-15 Nick Clifton <nickc@redhat.com>
591
592 PR binutils/21582
593 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
594 bugs.
595 PR binutils/21581
596 (ieee_archive_p): Likewise.
597
598 2017-06-15 Nick Clifton <nickc@redhat.com>
599
600 PR binutils/21579
601 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
602
603 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
604
605 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
606 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
607 keep both windowed and call0 ABI PLT definitions.
608 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
609 elf_xtensa_*_plt_entry endex.
610 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
611
612 2017-06-14 Nick Clifton <nickc@redhat.com>
613
614 PR binutils/21578
615 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
616 flag value.
617
618 2017-06-14 Nick Clifton <nickc@redhat.com>
619
620 PR binutils/21589
621 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
622 maximum value for the ascic pointer. Check that name processing
623 does not read beyond this value.
624 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
625 end of etir record.
626
627 2017-06-14 Nick Clifton <nickc@redhat.com>
628
629 PR binutils/21591
630 * versados.c (versados_mkobject): Zero the allocated tdata structure.
631 (process_otr): Check for an invalid offset in the otr structure.
632
633 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
634
635 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
636
637 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
638
639 PR ld/20022
640 PR ld/21557
641 PR ld/21562
642 PR ld/21571
643 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
644 vtable field to a union.
645 (_bfd_elf_is_start_stop): Removed.
646 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
647 __start_SECNAME and __stop_SECNAME symbols.
648 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
649 * elflink.c (_bfd_elf_is_start_stop): Removed.
650 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
651 _bfd_elf_is_start_stop.
652 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
653 __stop_SECNAME symbols. Updated.
654 (elf_gc_smash_unused_vtentry_relocs): Likewise.
655 (bfd_elf_gc_record_vtinherit): Likewise.
656 (bfd_elf_gc_record_vtentry): Likewise.
657
658 2017-06-13 Nick Clifton <nickc@redhat.com>
659
660 PR ld/21524
661 * elflink.c (elf_link_adjust_relocs): Generate an error when
662 encountering a reloc against a symbol removed by garbage
663 collection.
664
665 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
666
667 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
668 to merge_gnu_properties.
669 * elf-properties.c (elf_merge_gnu_properties): Add struct
670 bfd_link_info * and pass it to merge_gnu_properties.
671 (elf_merge_gnu_property_list): Add struct bfd_link_info *
672 and pass it to elf_merge_gnu_properties.
673 (_bfd_elf_link_setup_gnu_properties): Pass info to
674 elf_merge_gnu_property_list.
675 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
676 bfd_link_info *.
677 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
678
679 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
680
681 PR 21564
682 * binary.c (binary_set_section_contents): Scale lma by octets
683 per byte to set filepos.
684
685 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
686
687 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
688 dynamic sections.
689
690 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
691
692 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
693 require TEXTREL.
694
695 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
696
697 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
698 patched section contents for TLS IE reloc.
699 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
700
701 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
702
703 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
704 RELOC_FOR_GLOBAL_SYMBOL macro.
705
706 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
707
708 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
709 changes.
710
711 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
712
713 * config/tc-arc.c (md_undefined_symbol): Changed.
714 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
715
716 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
717
718 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
719 symbols.
720
721 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
722
723 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
724 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
725
726 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
727
728 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
729 object is created.
730
731 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
732
733 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
734 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
735 is non-zero. Add clarifying comments.
736
737 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
738
739 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
740 name. Use local IFUNC symbol name string to report unsupported
741 non-PIC call to IFUNC function.
742 (elf_i386_relocate_section): Dump local IFUNC name with minfo
743 when generating R_386_IRELATIVE relocation.
744 (elf_i386_finish_dynamic_symbol): Likewise.
745 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
746 IFUNC symbol name.
747 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
748 when generating R_X86_64_IRELATIVE relocation.
749 (elf_x86_64_finish_dynamic_symbol): Likewise.
750
751 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
752
753 * elf.c (setup_group): Make sure BFD sections are created for all
754 group sections in the input file when processing SHF_GROUP
755 sections.
756 (bfd_section_from_shdr): Avoid duplicating logic already
757 implemented in `setup_group'.
758
759 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
760
761 PR binutils/21546
762 * peXXigen.c (pe_print_idata): Use the address of the first thunk
763 if the hint address is zero.
764
765 2017-06-06 James Clarke <jrtc27@jrtc27.com>
766
767 PR ld/19579
768 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
769 ELF_COMMON_DEF_P for common symbols.
770
771 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
772
773 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
774 SEC_GROUP sections as SEC_EXCLUDE.
775 (bfd_elf_set_group_contents): Replace use of abort with an assert.
776 (assign_section_numbers): Use resolve_section_groups flag instead
777 of relocatable link type.
778 (_bfd_elf_init_private_section_data): Use resolve_section_groups
779 flag instead of checking the final_link flag for part of the
780 checks in here. Fix white space as a result.
781 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
782 instead of relocatable link type.
783 (bfd_elf_final_link): Likewise.
784
785 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
786
787 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
788 variable `bed'.
789 * elf32-score.c (score_elf_final_link_relocate): Likewise.
790 (s3_bfd_score_elf_check_relocs): Likewise.
791 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
792 (score_elf_final_link_relocate): Likewise.
793 (s7_bfd_score_elf_check_relocs): Likewise.
794
795 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
796
797 * elflink.c (init_reloc_cookie_rels): Remove unused variable
798 `bed'.
799
800 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
801
802 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
803 from `reloc_count' rather than decrementing it.
804 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
805 `reloc_count' by `int_rels_per_ext_rel'.
806 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
807 `reloc_count' by `int_rels_per_ext_rel' for last relocation
808 entry determination.
809 (s3_bfd_score_elf_check_relocs): Likewise.
810 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
811 (s7_bfd_score_elf_relocate_section): Likewise.
812 (s7_bfd_score_elf_check_relocs): Likewise.
813 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
814 prototype and function.
815 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
816 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
817 triple rather than once the sum of REL and RELA relocation entry
818 counts.
819 (bfd_elf64_get_reloc_upper_bound): Remove macro.
820 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
821 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
822 storage allocation size determination.
823 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
824 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
825 by `int_rels_per_ext_rel' for last relocation entry
826 determination.
827 (bfd_elf_final_link): Do not multiply `reloc_count' by
828 `int_rels_per_ext_rel' for internal relocation storage
829 allocation size determination.
830 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
831 `int_rels_per_ext_rel' for last relocation entry determination.
832 (elf_gc_smash_unused_vtentry_relocs): Likewise.
833 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
834 (_bfd_mips_elf_relocate_section): Likewise.
835
836 2017-06-05 Alan Modra <amodra@gmail.com>
837
838 PR 21529
839 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
840
841 2017-06-01 John Baldwin <jhb@FreeBSD.org>
842
843 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
844 determine structure sizes.
845 (elfcore_grok_freebsd_prstatus): Likewise.
846
847 2017-06-01 Alan Modra <amodra@gmail.com>
848
849 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
850 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
851 dynamic objects.
852 (is_elfv2_localentry0): New function.
853 (ppc64_elf_tls_setup): Default params->plt_localentry0.
854 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
855 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
856 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
857 optimized localentry:0 stubs.
858 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
859 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
860 localentry:0 stubs.
861 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
862 DT_PPC64_OPT.
863 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
864
865 2017-05-30 Casey Smith <clegg89@gmail.com>
866
867 PR ld/21523
868 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
869 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
870
871 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
872
873 * cpu-arc.c (arc_compatible): New function.
874
875 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
876
877 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
878
879 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
880
881 PR binutils/21519
882 * bfdio.c (bfd_get_file_size): New function.
883 * bfd-in2.h: Regenerated.
884
885 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
886
887 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
888 comments.
889
890 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
891
892 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
893 dynobj instead of htab->elf.dynobj.
894
895 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
896
897 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
898 and function.
899 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
900 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
901 actual number of internal relocations retrieved. Adjust
902 function description.
903 (bfd_elf64_canonicalize_reloc): Remove macro.
904 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
905
906 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
907
908 * archures.c (bfd_mach_sparc_v9m8): Define.
909 (bfd_mach_sparc_v8plusm8): Likewise.
910 (bfd_mach_sparc_v9_p): Adjust to M8.
911 (bfd_mach_sparc_64bit_p): Likewise.
912 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
913 bfd_mach_sparc_v8plusm8.
914 * bfd-in2.h: Regenerated.
915 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
916 sparc:v8plusm8.
917 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
918 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
919 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
920 SHA3.
921 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
922 bfd_mach_sparc_v8plusm8.
923
924 2017-05-19 Alan Modra <amodra@gmail.com>
925
926 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
927 debug and special sections when no non-note alloc sections in an
928 object are kept.
929
930 2017-05-18 Alan Modra <amodra@gmail.com>
931
932 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
933 * elf-m10300.c: Likewise.
934 * elf.c: Likewise.
935 * elf32-arc.c: Likewise.
936 * elf32-bfin.c: Likewise.
937 * elf32-m68k.c: Likewise.
938 * elf32-nds32.c: Likewise.
939 * elf32-tilepro.c: Likewise.
940 * elflink.c: Likewise.
941 * elfnn-aarch64.c: Likewise.
942 * elfnn-riscv.c: Likewise.
943 * elfxx-tilegx.c: Likewise.
944 * mach-o.c: Likewise.
945 * peXXigen.c: Likewise.
946 * vms-alpha.c: Likewise.
947 * vms-lib.c: Likewise.
948
949 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
950
951 PR ld/20882
952 * elflink.c (elf_gc_mark_debug_section): New function.
953 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
954 referenced by kept debug sections.
955
956 2017-05-16 Alan Modra <amodra@gmail.com>
957
958 * elf-m10300.c: Rename occurrences of non_ir_ref.
959 * elf32-arm.c: Likewise.
960 * elf32-bfin.c: Likewise.
961 * elf32-cr16.c: Likewise.
962 * elf32-cris.c: Likewise.
963 * elf32-d10v.c: Likewise.
964 * elf32-dlx.c: Likewise.
965 * elf32-fr30.c: Likewise.
966 * elf32-frv.c: Likewise.
967 * elf32-hppa.c: Likewise.
968 * elf32-i370.c: Likewise.
969 * elf32-i386.c: Likewise.
970 * elf32-iq2000.c: Likewise.
971 * elf32-lm32.c: Likewise.
972 * elf32-m32c.c: Likewise.
973 * elf32-m32r.c: Likewise.
974 * elf32-m68hc1x.c: Likewise.
975 * elf32-m68k.c: Likewise.
976 * elf32-mcore.c: Likewise.
977 * elf32-metag.c: Likewise.
978 * elf32-microblaze.c: Likewise.
979 * elf32-moxie.c: Likewise.
980 * elf32-msp430.c: Likewise.
981 * elf32-mt.c: Likewise.
982 * elf32-nios2.c: Likewise.
983 * elf32-or1k.c: Likewise.
984 * elf32-ppc.c: Likewise.
985 * elf32-rl78.c: Likewise.
986 * elf32-s390.c: Likewise.
987 * elf32-score.c: Likewise.
988 * elf32-score7.c: Likewise.
989 * elf32-sh.c: Likewise.
990 * elf32-tic6x.c: Likewise.
991 * elf32-tilepro.c: Likewise.
992 * elf32-v850.c: Likewise.
993 * elf32-vax.c: Likewise.
994 * elf32-xstormy16.c: Likewise.
995 * elf32-xtensa.c: Likewise.
996 * elf64-alpha.c: Likewise.
997 * elf64-hppa.c: Likewise.
998 * elf64-ia64-vms.c: Likewise.
999 * elf64-mmix.c: Likewise.
1000 * elf64-ppc.c: Likewise.
1001 * elf64-s390.c: Likewise.
1002 * elf64-sh64.c: Likewise.
1003 * elf64-x86-64.c: Likewise.
1004 * elflink.c: Likewise.
1005 * elfnn-aarch64.c: Likewise.
1006 * elfnn-ia64.c: Likewise.
1007 * elfnn-riscv.c: Likewise.
1008 * elfxx-mips.c: Likewise.
1009 * elfxx-sparc.c: Likewise.
1010 * elfxx-tilegx.c: Likewise.
1011 * linker.c: Likewise.
1012
1013 2017-05-16 Alan Modra <amodra@gmail.com>
1014
1015 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
1016 * elflink.c (elf_link_add_object_symbols): Update to use
1017 non_ir_ref_dynamic.
1018 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
1019 non_ir_ref.
1020 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1021
1022 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
1023
1024 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
1025
1026 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
1027
1028 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
1029 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
1030 properties.
1031 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1032
1033 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1034
1035 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
1036 to plt_second.
1037 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
1038 to plt_second/plt_second_eh_frame.
1039 (elf_x86_64_link_hash_newfunc): Updated.
1040 (elf_x86_64_allocate_dynrelocs): Likewise.
1041 (elf_x86_64_size_dynamic_sections): Likewise.
1042 (elf_x86_64_relocate_section): Likewise.
1043 (elf_x86_64_finish_dynamic_symbol): Likewise.
1044 (elf_x86_64_finish_dynamic_sections): Likewise.
1045 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
1046 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
1047 .plt.sec section.
1048 (elf_backend_setup_gnu_properties): Updated. Create the
1049 .plt.sec section instead of the .plt.sec section.
1050
1051 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
1052
1053 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
1054 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
1055 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
1056
1057 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1058
1059 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
1060 (bfd_elf64_set_reloc): Define.
1061 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
1062
1063 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
1064
1065 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
1066 (struct bfd_target): New field _bfd_set_reloc.
1067 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
1068 * reloc.c (_bfd_generic_set_reloc): New function.
1069 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
1070 * nlm-target.h (nlm_set_reloc): Likewise.
1071 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
1072 * aout-tic30.c (MY_set_reloc): Likewise.
1073 * aout-target.h (MY_set_reloc): Likewise.
1074 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
1075 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
1076 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
1077 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
1078 * aout-adobe.c (aout_32_set_reloc): Likewise.
1079 * bout.c (b_out_set_reloc): Likewise.
1080 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
1081 * i386os9k.c (aout_32_set_reloc): Likewise.
1082 * ieee.c (ieee_set_reloc): Likewise.
1083 * oasys.c (oasys_set_reloc): Likewise.
1084 * som.c (som_set_reloc): Likewise.
1085 * versados.c (versados_set_reloc): Likewise.
1086 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
1087 _bfd_generic_set_reloc.
1088 (rs6000_xcoff64_aix_vec): LIkewise.
1089 * libbfd.c (_bfd_norelocs_set_reloc): New function.
1090 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
1091 * i386msdos.c (msdos_set_reloc): Define to
1092 _bfd_norelocs_set_reloc.
1093 * elfcode.h (elf_set_reloc): Define.
1094 * bfd-in2.h: Regenerated.
1095
1096 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
1097
1098 PR ld/21481
1099 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
1100 for IFUNC function address.
1101
1102 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
1103
1104 * elf32-arc.c (FEATURE_LIST_NAME): Define.
1105 (CONFLICT_LIST): Likewise.
1106 (opcode/arc-attrs.h): Include.
1107 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
1108 (arc_extract_features): New file.
1109 (arc_stralloc): Likewise.
1110 (arc_elf_merge_attributes): Likewise.
1111 (arc_elf_merge_private_bfd_data): Use object attributes.
1112 (bfd_arc_get_mach_from_attributes): New function.
1113 (arc_elf_object_p): Use object attributes.
1114 (arc_elf_final_write_processing): Likewise.
1115 (elf32_arc_obj_attrs_arg_type): New function.
1116 (elf32_arc_obj_attrs_handle_unknown): Likewise.
1117 (elf32_arc_section_from_shdr): Likewise.
1118 (elf_backend_obj_attrs_vendor): Define.
1119 (elf_backend_obj_attrs_section): Likewise.
1120 (elf_backend_obj_attrs_arg_type): Likewise.
1121 (elf_backend_obj_attrs_section_type): Likewise.
1122 (elf_backend_obj_attrs_handle_unknown): Likewise.
1123 (elf_backend_section_from_shdr): Likewise.
1124
1125 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
1126
1127 PR ld/21458
1128 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
1129 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
1130 and the destination is a Thumb symbol.
1131
1132 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1133
1134 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
1135 initializer to silence GCC 4.2.
1136 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1137
1138 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1139
1140 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
1141 (LAZY_PLT_ENTRY_SIZE): This.
1142 (NON_LAZY_PLT_ENTRY_SIZE): New.
1143 (elf_x86_64_plt0_entry): Renamed to ...
1144 (elf_x86_64_lazy_plt0_entry): This.
1145 (elf_x86_64_plt_entry): Renamed to ...
1146 (elf_x86_64_lazy_plt_entry): This.
1147 (elf_x86_64_bnd_plt0_entry): Renamed to ...
1148 (elf_x86_64_lazy_bnd_plt0_entry): This.
1149 (elf_x86_64_legacy_plt_entry): Removed.
1150 (elf_x86_64_bnd_plt_entry): Renamed to ...
1151 (elf_x86_64_lazy_bnd_plt_entry): This.
1152 (elf_x86_64_legacy_plt2_entry): Renamed to ...
1153 (elf_x86_64_non_lazy_plt_entry): This.
1154 (elf_x86_64_bnd_plt2_entry): Renamed to ...
1155 (elf_x86_64_non_lazy_bnd_plt_entry): This.
1156 (elf_x86_64_eh_frame_plt): Renamed to ...
1157 (elf_x86_64_eh_frame_lazy_plt): This.
1158 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
1159 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
1160 (elf_x86_64_eh_frame_plt_got): Renamed to ...
1161 (elf_x86_64_eh_frame_non_lazy_plt): This.
1162 (elf_x86_64_lazy_plt_layout): New.
1163 (elf_x86_64_non_lazy_plt_layout): Likewise.
1164 (elf_x86_64_plt_layout): Likewise.
1165 (elf_x86_64_backend_data): Remove PLT layout information. Add
1166 os for target system.
1167 (GET_PLT_ENTRY_SIZE): Removed.
1168 (elf_x86_64_lazy_plt): New.
1169 (elf_x86_64_non_lazy_plt): Likewise.
1170 (elf_x86_64_lazy_bnd_plt): Likewise.
1171 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1172 (elf_x86-64_arch_bed): Updated.
1173 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1174 (elf_x86_64_create_dynamic_sections): Removed.
1175 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
1176 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1177 (elf_x86-64_adjust_dynamic_symbol): Updated.
1178 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
1179 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1180 size for PLT0 if there is no PLT0. Get plt_entry_size from
1181 non_lazy_plt for non-lazy PLT entries.
1182 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
1183 from non_lazy_plt for non-lazy PLT entries.
1184 (elf_x86-64_relocate_section): Updated. Properly get PLT index
1185 if there is no PLT0.
1186 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
1187 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
1188 entries with non-lazy PLT layout. Don't fill the second and third
1189 slots in the PLT entry if there is no PLT0.
1190 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
1191 if there is no PLT0. Set sh_entsize on the .plt.got section.
1192 (compare_relocs): New.
1193 (elf_x86_64_plt_type): Likewise.
1194 (elf_x86_64_plt): Likewise.
1195 (elf_x86_64_nacl_plt): New. Forward declaration.
1196 (elf_x86_64_get_plt_sym_val): Removed.
1197 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
1198 against all dynamic relocations.
1199 (elf_x86_64_link_setup_gnu_properties): New function.
1200 (elf_backend_create_dynamic_sections): Updated.
1201 (elf_backend_setup_gnu_properties): New.
1202 (elf_x86_64_nacl_plt): New.
1203 (elf_x86_64_nacl_arch_bed): Updated.
1204
1205 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
1206
1207 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
1208 (LAZY_PLT_ENTRY_SIZE): This.
1209 (NON_LAZY_PLT_ENTRY_SIZE): New.
1210 (elf_i386_plt0_entry): Renamed to ...
1211 (elf_i386_lazy_plt0_entry): This.
1212 (elf_i386_plt_entry): Renamed to ...
1213 (elf_i386_lazy_plt_entry): This.
1214 (elf_i386_pic_plt0_entry): Renamed to ...
1215 (elf_i386_pic_lazy_plt0_entry): This.
1216 (elf_i386_pic_plt_entry): Renamed to ...
1217 (elf_i386_pic_lazy_plt_entry): This.
1218 (elf_i386_got_plt_entry): Renamed to ...
1219 (elf_i386_non_lazy_plt_entry): This.
1220 (elf_i386_pic_got_plt_entry): Renamed to ...
1221 (elf_i386_pic_non_lazy_plt_entry): This.
1222 (elf_i386_eh_frame_plt): Renamed to ...
1223 (elf_i386_eh_frame_lazy_plt): This.
1224 (elf_i386_eh_frame_plt_got): Renamed to ...
1225 (elf_i386_eh_frame_non_lazy_plt): This.
1226 (elf_i386_plt_layout): Renamed to ...
1227 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
1228 eh_frame_plt_got_size.
1229 (elf_i386_non_lazy_plt_layout): New.
1230 (elf_i386_plt_layout): Likewise.
1231 (elf_i386_non_lazy_plt): Likewise.
1232 (GET_PLT_ENTRY_SIZE): Removed.
1233 (elf_i386_plt): Renamed to ...
1234 (elf_i386_lazy_plt): This.
1235 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
1236 (elf_i386_arch_bed): Updated.
1237 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
1238 (elf_i386_create_dynamic_sections): Removed.
1239 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
1240 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
1241 (elf_i386_adjust_dynamic_symbol): Updated.
1242 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
1243 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
1244 size for PLT0 if there is no PLT0.
1245 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
1246 output section is discarded only if GOT isn't empty.
1247 (elf_i386_relocate_section): Updated. Properly get PLT index
1248 if there is no PLT0.
1249 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
1250 second and third slots in the PLT entry if there is no PLT0.
1251 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
1252 if there is no PLT0. Set sh_entsize on the .plt.got section.
1253 (elf_i386_nacl_plt): Forward declaration.
1254 (elf_i386_get_plt_sym_val): Removed.
1255 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
1256 against all dynamic relocations.
1257 (elf_i386_link_setup_gnu_properties): New function.
1258 (elf_backend_create_dynamic_sections): Updated.
1259 (elf_backend_setup_gnu_properties): New.
1260 (elf_i386_nacl_plt): Updated.
1261 (elf_i386_nacl_arch_bed): Likewise.
1262 (elf_i386_vxworks_arch_bed): Likewise.
1263
1264 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
1265
1266 * elflink.c (elf_output_implib): Remove executable flag from import
1267 library bfd.
1268 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
1269 library is a relocatable object file.
1270
1271 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1272
1273 PR ld/21404
1274 * elf32-avr.c (avr_should_move_sym): New function.
1275 (avr_should_reduce_sym_size): Likewise.
1276 (avr_should_increase_sym_size): Likewise.
1277 (elf32_avr_relax_delete_bytes): Adjust symbol values
1278 and sizes by calling new functions.
1279
1280 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
1281
1282 * config.bfd (riscv32-*): Enable rv64.
1283
1284 2017-05-02 Alan Modra <amodra@gmail.com>
1285
1286 PR 21384
1287 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
1288 rather than h->root.type == bfd_link_hash_new.
1289 (bfd_elf_record_link_assignment): Similarly, call
1290 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
1291
1292 2017-04-29 Alan Modra <amodra@gmail.com>
1293
1294 PR 21432
1295 * reloc.c (reloc_offset_in_range): New function.
1296 (bfd_perform_relocation, bfd_install_relocation): Use it.
1297 (_bfd_final_link_relocate): Likewise.
1298
1299 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
1300
1301 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
1302 before using .plt.got.
1303 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
1304
1305 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1306
1307 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
1308 instead of "+=" to update 0.
1309
1310 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1311
1312 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
1313 .plt.got section here.
1314 (elf_i386_check_relocs): Don't create the .plt.got section.
1315 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
1316 the .plt.got and .plt.bnd sections here.
1317 (elf_x86_64_check_relocs): Don't create the .plt.got nor
1318 .plt.bnd sections.
1319
1320 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1321
1322 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
1323 has_bnd_reloc.
1324 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
1325 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
1326 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
1327 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
1328 has_bnd_reloc.
1329
1330 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1331
1332 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
1333 to return bfd *.
1334 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
1335 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
1336 the first relocatable ELF input with GNU properties.
1337
1338 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
1341 VxWorks for non-PIC.
1342
1343 2017-04-27 Alan Modra <amodra@gmail.com>
1344
1345 * elf-bfd.h (struct elf_backend_data): Make asection param of
1346 elf_backend_eh_frame_address_size const.
1347 (_bfd_elf_eh_frame_address_size): Likewise.
1348 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
1349 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
1350 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
1351 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
1352 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
1353 (next_cie_fde_offset): Constify params.
1354 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
1355
1356 2017-04-27 Alan Modra <amodra@gmail.com>
1357
1358 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
1359 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
1360 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
1361 aug_data_len.
1362 (offset_adjust): New function.
1363 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
1364 (adjust_eh_frame_local_symbols): Likewise.
1365 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
1366 after changing anything. Return true if anything changed.
1367 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
1368 _bfd_elf_adjust_eh_frame_global_symbol for globals.
1369
1370 2017-04-27 Alan Modra <amodra@gmail.com>
1371
1372 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
1373 when force_local.
1374
1375 2017-04-27 Alan Modra <amodra@gmail.com>
1376
1377 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1378 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
1379 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
1380 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
1381 for undef and undefweak dyn_relocs.
1382 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
1383 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
1384 (allocate_got, allocate_dynrelocs): Likewise.
1385 (ppc64_elf_relocate_section): Likewise.
1386
1387 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
1388
1389 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
1390 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
1391 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
1392 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
1393
1394 2017-04-26 Nick Clifton <nickc@redhat.com>
1395
1396 PR binutils/21434
1397 * reloc.c (bfd_perform_relocation): Check for a negative address
1398 in the reloc.
1399
1400 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1401
1402 PR ld/21334
1403 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
1404 member.
1405 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
1406 (elf_backend_always_renumber_dynsyms): Define.
1407 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
1408 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
1409 * elflink.c (bfd_elf_size_dynamic_sections): Also call
1410 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
1411 it.
1412 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1413
1414 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
1415
1416 * elflink.c (bfd_elf_size_dynamic_sections): Only call
1417 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
1418 sections have been created.
1419
1420 2017-04-26 Nick Clifton <nickc@redhat.com>
1421
1422 PR binutils/21431
1423 * compress.c (bfd_init_section_compress_status): Check the return
1424 value from bfd_malloc.
1425
1426 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1427
1428 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
1429 no_finish_dynamic_symbol.
1430 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
1431 0.
1432 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
1433 weak symbol, don't make it dynamic.
1434 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
1435 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
1436 relocation for GOT reference.
1437 (elf_x86_64_finish_dynamic_symbol): Abort if
1438 no_finish_dynamic_symbol isn't 0.
1439
1440 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1441
1442 PR ld/21402
1443 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
1444 undefined weak symbol, don't make it dynamic.
1445 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
1446 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1447 relocation for R_386_GOT32.
1448
1449 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
1450
1451 PR ld/21425
1452 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
1453
1454 2017-04-23 Alan Modra <amodra@gmail.com>
1455
1456 PR 21414
1457 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
1458 * elf.c (lcomm_sym): New.
1459 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
1460 * bfd-in2.h: Regenerate.
1461
1462 2017-04-23 Alan Modra <amodra@gmail.com>
1463
1464 PR 21412
1465 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
1466 parameters and comment.
1467 (_bfd_elf_get_reloc_section): Delete.
1468 (_bfd_elf_plt_get_reloc_section): Declare.
1469 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
1470 New functions. Don't blindly skip over assumed .rel/.rela prefix.
1471 Extracted from..
1472 (_bfd_elf_get_reloc_section): ..here. Delete.
1473 (assign_section_numbers): Call elf_get_reloc_section.
1474 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
1475 * elfxx-target.h (elf_backend_get_reloc_section): Update.
1476
1477 2017-04-23 Alan Modra <amodra@gmail.com>
1478
1479 PR 21409
1480 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
1481 no symbols.
1482
1483 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1484
1485 PR ld/21402
1486 * elf32-i386.c (elf_i386_link_hash_entry): Add
1487 no_finish_dynamic_symbol.
1488 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
1489 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
1490 symbol, don't make it dynamic in PIE.
1491 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
1492 set no_finish_dynamic_symbol and generate R_386_RELATIVE
1493 relocation for R_386_GOT32
1494 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
1495 isn't 0.
1496
1497 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
1498
1499 PR ld/19617
1500 PR ld/21086
1501 * elflink.c (elf_link_add_object_symbols): Require
1502 --no-dynamic-linker with -E/--dynamic-list when creating
1503 dynamic sections.
1504
1505 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1506
1507 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
1508 if forced local.
1509
1510 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
1511
1512 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
1513 dynamic symbol sorting.
1514
1515 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
1516
1517 PR ld/21382
1518 * elflink.c (elf_link_add_object_symbols): Preserve
1519 dynamic_ref_after_ir_def when restoring the symbol table for
1520 unneeded dynamic object.
1521
1522 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
1523
1524 PR ld/21401
1525 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
1526 on on undefined IFUNC symbol in the second PLT.
1527
1528 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
1529
1530 * peXXigen.c (pe_print_reloc): Correct chunk_end.
1531
1532 2017-04-19 Alan Modra <amodra@gmail.com>
1533
1534 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
1535 or make dynamic for info->dynamic_undefined_weak 0 and 1.
1536 * elf32-ppc.c:Formatting.
1537 (ensure_undefweak_dynamic): Don't make dynamic when
1538 info->dynamic_undefined_weak is zero.
1539 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1540 info->dynamic_undefined_weak. Discard undef dyn_relocs when
1541 not default visibility. Discard undef and undefweak
1542 dyn_relocs earlier.
1543 (ppc_elf_relocate_section): Adjust to suit.
1544 * elf64-ppc.c: Formatting.
1545 (ensure_undefweak_dynamic): Don't make dynamic when
1546 info->dynamic_undefined_weak is zero.
1547 (allocate_dynrelocs): Discard undefweak dyn_relocs for
1548 info->dynamic_undefined_weak. Discard them earlier.
1549
1550 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
1551
1552 PR ld/21389
1553 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
1554 before generating the version definition section.
1555
1556 2017-04-17 Alan Modra <amodra@gmail.com>
1557
1558 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
1559 state when a regular object file defines a symbol with
1560 incompatible type to that defined by an earlier shared lib.
1561
1562 2017-04-13 Alan Modra <amodra@gmail.com>
1563
1564 * coffcode.h: Wrap some overly long _bfd_error_handler args.
1565 * elf.c: Likewise.
1566 * elf32-arm.c: Likewise.
1567 * elf32-i386.c: Likewise.
1568 * elf32-mep.c: Likewise.
1569 * elf64-ia64-vms.c: Likewise.
1570 * elf64-x86-64.c: Likewise.
1571 * elflink.c: Likewise.
1572 * elfnn-ia64.c: Likewise.
1573 * elfxx-mips.c: Likewise.
1574
1575 2017-04-13 Alan Modra <amodra@gmail.com>
1576
1577 * aoutx.h: Use %B and %A in error messages throughout file.
1578 * aout-cris.c: Likewise.
1579 * archive.c: Likewise.
1580 * binary.c: Likewise.
1581 * coff-rs6000.c: Likewise.
1582 * coff-tic4x.c: Likewise.
1583 * coffcode.h: Likewise.
1584 * coffgen.c: Likewise.
1585 * cofflink.c: Likewise.
1586 * coffswap.h: Likewise.
1587 * cpu-arm.c: Likewise.
1588 * elf-eh-frame.c: Likewise.
1589 * elf-m10300.c: Likewise.
1590 * elf.c: Likewise.
1591 * elf32-arc.c: Likewise.
1592 * elf32-arm.c: Likewise.
1593 * elf32-bfin.c: Likewise.
1594 * elf32-frv.c: Likewise.
1595 * elf32-iq2000.c: Likewise.
1596 * elf32-m32c.c: Likewise.
1597 * elf32-microblaze.c: Likewise.
1598 * elf32-nds32.c: Likewise.
1599 * elf32-rl78.c: Likewise.
1600 * elf32-rx.c: Likewise.
1601 * elf32-score.c: Likewise.
1602 * elf32-score7.c: Likewise.
1603 * elf32-sh64.c: Likewise.
1604 * elf32-v850.c: Likewise.
1605 * elf32-vax.c: Likewise.
1606 * elf32-visium.c: Likewise.
1607 * elf64-ia64-vms.c: Likewise.
1608 * elf64-mmix.c: Likewise.
1609 * elf64-sh64.c: Likewise.
1610 * elfcode.h: Likewise.
1611 * elfnn-aarch64.c: Likewise.
1612 * elfnn-ia64.c: Likewise.
1613 * elfxx-mips.c: Likewise.
1614 * hpux-core.c: Likewise.
1615 * ieee.c: Likewise.
1616 * ihex.c: Likewise.
1617 * linker.c: Likewise.
1618 * merge.c: Likewise.
1619 * mmo.c: Likewise.
1620 * oasys.c: Likewise.
1621 * pdp11.c: Likewise.
1622 * peXXigen.c: Likewise.
1623 * rs6000-core.c: Likewise.
1624 * vms-alpha.c: Likewise.
1625 * xcofflink.c: Likewise.
1626
1627 2017-04-13 Alan Modra <amodra@gmail.com>
1628
1629 * bfd.c (PRINT_TYPE): Define.
1630 (_doprnt): New function.
1631 (error_handler_internal): Use _doprnt.
1632 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
1633 calls in their natural order, throughout file.
1634 * coff-mcore.c: Likewise.
1635 * coff-ppc.c: Likewise.
1636 * coff-tic80.c: Likewise.
1637 * cofflink.c: Likewise.
1638 * elf-s390-common.c: Likewise.
1639 * elf.c: Likewise.
1640 * elf32-arm.c: Likewise.
1641 * elf32-i386.c: Likewise.
1642 * elf32-m32r.c: Likewise.
1643 * elf32-msp430.c: Likewise.
1644 * elf32-spu.c: Likewise.
1645 * elf64-ia64-vms.c: Likewise.
1646 * elf64-sparc.c: Likewise.
1647 * elf64-x86-64.c: Likewise.
1648 * elflink.c: Likewise.
1649 * elfnn-aarch64.c: Likewise.
1650 * elfnn-ia64.c: Likewise.
1651 * elfxx-mips.c: Likewise.
1652
1653 2017-04-13 Alan Modra <amodra@gmail.com>
1654
1655 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
1656 branch veneers" error. Fix double space and format message.
1657 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
1658 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
1659
1660 2017-04-13 Alan Modra <amodra@gmail.com>
1661
1662 * bfd-in2.h: Regenerate.
1663
1664 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1665
1666 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
1667 extra `\n' in warning/error messages.
1668 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
1669 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1670
1671 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
1672
1673 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
1674 processor-specific properties with generic ELF target vector.
1675
1676 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
1677
1678 * elf32-sparc.c (elf_backend_fixup_symbol): New.
1679 * elf64-sparc.c (elf_backend_fixup_symbol): New.
1680 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
1681 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
1682 has_non_got_reloc.
1683 (link_hash_newfunc): Initialize has_got_reloc and
1684 has_non_got_reloc.
1685 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
1686 section.
1687 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
1688 has_non_got_reloc.
1689 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
1690 has_non_got_reloc.
1691 (_bfd_sparc_elf_fixup_symbol): New function.
1692 (allocate_dynrelocs): Don't allocate space for dynamic
1693 relocations and discard relocations against resolved undefined
1694 weak symbols in executable. Don't make resolved undefined weak
1695 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
1696 relocation against undefined weak symbols in PIE.
1697 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
1698 relocations against resolved undefined weak symbols in PIE
1699 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
1700 without ynamic PLT/GOT relocations for resolved undefined weak
1701 symbols.
1702 Don't generate dynamic relocation against resolved undefined
1703 weak symbol in executable.
1704 (pie_finish_undefweak_symbol): New function.
1705 (_bfd_sparc_elf_finish_dynamic_sections): Call
1706 pie_finish_undefweak_symbol on all symbols in PIE.
1707 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
1708 (_bfd_sparc_elf_fixup_symbol): New function.
1709
1710 2017-04-10 Nick Clifton <nickc@redhat.com>
1711
1712 * config.bfd: Remove ns32k from obsolete list.
1713
1714 2017-04-10 Alan Modra <amodra@gmail.com>
1715
1716 PR 21287
1717 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
1718 (special_sections_i): Likewise for .init_array.
1719 (special_sections_p): Likewise for .preinit_array.
1720
1721 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
1722
1723 PR ld/19579
1724 PR ld/21306
1725 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
1726 ELF_COMMON_DEF_P for common symbols.
1727 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
1728 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1729 * elflink.c (_bfd_elf_merge_symbol): Revert commits
1730 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
1731 07492f668d2173da7a2bda3707ff0985e0f460b6.
1732
1733 2017-04-07 Pedro Alves <palves@redhat.com>
1734
1735 * opncls.c (bfd_get_debug_link_info): Rename to...
1736 (bfd_get_debug_link_info_1): ... this. Change type of second
1737 parameter to void pointer. Adjust.
1738 (bfd_get_debug_link_info): Reimplement on top of
1739 bfd_get_debug_link_info_1.
1740 (separate_debug_file_exists, separate_alt_debug_file_exists):
1741 Change type of second parameter to void pointer. Adjust.
1742 (get_func_type, check_func_type): Change type of second parameter
1743 to void pointer.
1744 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
1745 the callback functions instead of passing the address of a local.
1746 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
1747 find_separate_debug_file.
1748 (get_alt_debug_link_info_shim): Change type of second parameter to
1749 void pointer. Adjust.
1750 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
1751 find_separate_debug_file.
1752 (get_build_id_name, bfd_boolean check_build_id_file): Change type
1753 of second parameter to void pointer. Adjust.
1754 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
1755 pointer local to find_separate_debug_file.
1756
1757 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
1758
1759 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
1760 external symbols with a definition.
1761 (_bfd_coff_gc_mark_extra_sections): Fix typo.
1762
1763 2017-04-07 Alan Modra <amodra@gmail.com>
1764
1765 * po/SRC-POTFILES.in: Regenerate.
1766
1767 2017-04-05 Alan Modra <amodra@gmail.com>
1768
1769 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
1770 reference counting.
1771
1772 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
1773
1774 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
1775 numbers for DataDirectory entry indicies passed to
1776 add_data_entry().
1777
1778 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
1779
1780 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
1781 each GNU_MBIND section and align GNU_MBIND section to page size.
1782 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
1783 segment for each GNU_MBIND section.
1784 (_bfd_elf_init_private_section_data): Copy sh_info from input
1785 for GNU_MBIND section.
1786
1787 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
1788
1789 * elfnn-riscv.c (GP_NAME): Delete.
1790 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
1791 (_bfd_riscv_relax_lui): Likewise.
1792
1793 2017-04-04 Nick Clifton <nickc@redhat.com>
1794
1795 PR binutils/21342
1796 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
1797 dereference.
1798 (bfd_elf_final_link): Only initialize the extended symbol index
1799 section if there are extended symbol tables to list.
1800
1801 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
1802
1803 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
1804 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
1805 * configure.ac (elf): Add elf-properties.lo.
1806 * Makefile.in: Regenerated.
1807 * configure: Likewise.
1808 * elf-bfd.h (elf_property_kind): New.
1809 (elf_property): Likewise.
1810 (elf_property_list): Likewise.
1811 (elf_properties): Likewise.
1812 (_bfd_elf_parse_gnu_properties): Likewise.
1813 (_bfd_elf_get_property): Likewise.
1814 (_bfd_elf_link_setup_gnu_properties): Likewise.
1815 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
1816 and setup_gnu_properties.
1817 (elf_obj_tdata): Add properties.
1818 * elf-properties.c: New file.
1819 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
1820 (elf_i386_merge_gnu_properties): Likewise.
1821 (elf_backend_parse_gnu_properties): Likewise.
1822 (elf_backend_merge_gnu_properties): Likewise.
1823 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
1824 (elf_x86_64_merge_gnu_properties): Likewise.
1825 (elf_backend_parse_gnu_properties): Likewise.
1826 (elf_backend_merge_gnu_properties): Likewise.
1827 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
1828 (elf_backend_parse_gnu_properties): Likewise.
1829 (elf_backend_setup_gnu_properties): Likewise.
1830 (elfNN_bed): Add elf_backend_parse_gnu_properties,
1831 elf_backend_merge_gnu_properties and
1832 elf_backend_setup_gnu_properties.
1833
1834 2017-03-30 Pip Cet <pipcet@gmail.com>
1835
1836 * elf32-wasm32.c: Add relocation code, two relocs.
1837 * reloc.c: Add wasm32 relocations.
1838 * libbfd.h: Regenerate.
1839 * bfd-in2.h: Regenerate.
1840 * bfd/po/bfd.pot: Regenerate.
1841
1842 2017-03-29 Nick Clifton <nickc@redhat.com>
1843
1844 PR binutils/18025
1845 * coff-bfd.h (struct coff_section_data): Add new fields:
1846 saved_bias and bias.
1847 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
1848 computed for PE binaries.
1849 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
1850 missing abbrev.
1851
1852 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
1853
1854 PR ld/16044
1855 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
1856 to handle a local symbol with a hash-symbol-entry; without PLT.
1857 Add BFD_ASSERT for an incidental case with GOT entry present.
1858 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
1859 isn't forced-or-set local.
1860
1861 2017-03-27 Pip Cet <pipcet@gmail.com>
1862
1863 * wasm-module.c: New file to support WebAssembly modules.
1864 * wasm-module.h: New file to support WebAssembly modules.
1865 * doc/webassembly.texi: Start documenting wasm-module.c.
1866 * config.bfd: Add wasm_vec.
1867 * targets.c: Likewise.
1868 * configure.ac: Likewise.
1869 * Makefile.am: Add entries for wasm-module.c.
1870 * Makefile.in: Regenerate.
1871 * configure: Regenerate.
1872 * po/SRC-POTFILES.in: Regenerate.
1873
1874 2017-03-27 Pip Cet <pipcet@gmail.com>
1875
1876 * cpu-wasm32.c: New file to support wasm32 architecture.
1877 * elf32-wasm32.c: New file to support wasm32 architecture.
1878 * Makefile.am: Add wasm32 architecture.
1879 * archures.c: Likewise.
1880 * config.bfd: Likewise.
1881 * configure.ac: Likewise.
1882 * targets.c: Likewise.
1883 * Makefile.in: Regenerate.
1884 * bfd-in2.h: Regenerate.
1885 * configure: Regenerate.
1886 * po/SRC-POTFILES.in: Regenerate.
1887
1888 2017-03-20 Alan Modra <amodra@gmail.com>
1889
1890 PR 21266
1891 * elf64-ppc.c (compare_symbols): Stabilize sort.
1892
1893 2017-03-18 Alan Modra <amodra@gmail.com>
1894
1895 * elf64-ppc.c (struct ppc_link_hash_table): Add
1896 local_ifunc_resolver and maybe_local_ifunc_resolver.
1897 (ppc_build_one_stub): Set flags on emitting dynamic
1898 relocation to ifunc.
1899 (ppc64_elf_relocate_section): Likewise.
1900 (ppc64_elf_finish_dynamic_symbol): Likewise.
1901 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
1902 local dynamic relocs to ifuncs.
1903 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
1904 local_ifunc_resolver and maybe_local_ifunc_resolver.
1905 (ppc_elf_relocate_section): Set flag on emitting dynamic
1906 relocation to ifuncs.
1907 (ppc_elf_finish_dynamic_symbol): Likewise.
1908 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
1909 dynamic relocs to ifuncs.
1910
1911 2017-03-13 Nick Clifton <nickc@redhat.com>
1912
1913 PR binutils/21202
1914 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
1915 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
1916 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
1917 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
1918 * bfd-in2.h: Regenerate.
1919 * libbfd.h: Regenerate.
1920 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
1921 names.
1922 (IS_AARCH64_TLSDESC_RELOC): Likewise.
1923 (elfNN_aarch64_howto_table): Likewise.
1924 (aarch64_tls_transition_without_check): Likewise.
1925 (aarch64_reloc_got_type): Likewise.
1926 (elfNN_aarch64_final_link_relocate): Likewise.
1927 (elfNN_aarch64_tls_relax): Likewise.
1928 (elfNN_aarch64_relocate_section): Likewise.
1929 (elfNN_aarch64_gc_sweep_hook): Likewise.
1930 (elfNN_aarch64_check_relocs): Likewise.
1931 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
1932 (_bfd_aarch64_elf_resolve_relocation): Likewise.
1933
1934 2017-03-11 Alan Modra <amodra@gmail.com>
1935
1936 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
1937 parameter is in fact used. Whitespace fixes.
1938 * elf64-ppc.c: Likewise.
1939
1940 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
1941
1942 * rs6000-core.c (CORE_NEW): Simplify macro when
1943 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
1944
1945 2017-03-07 Alan Modra <amodra@gmail.com>
1946
1947 PR 21224
1948 PR 20519
1949 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
1950 dyn_relocs check.
1951
1952 2017-03-05 Alan Modra <amodra@gmail.com>
1953
1954 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
1955 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
1956 (next_cie_fde_offset): New function.
1957 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
1958 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
1959 four bytes. Align CIEs to four or eight bytes depending on
1960 per_encoding_aligned8. Align FDEs according to their encoding.
1961 Pad last FDE to output section alignment.
1962 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
1963 assertion.
1964 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
1965 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
1966 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
1967
1968 2017-03-02 Martin Bickel <binutils@ineranves.de>
1969
1970 PR ld/21212
1971 * elf.c (rewrite_elf_program_header): Do not issue a warning for
1972 empty segments which have a zero filesz, but a non-zero memsz.
1973
1974 2017-03-02 Alan Modra <amodra@gmail.com>
1975
1976 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
1977
1978 2017-02-28 Alan Modra <amodra@gmail.com>
1979
1980 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
1981 (ppc64_elf_relocate_section): Likewise.
1982
1983 2017-02-28 Alan Modra <amodra@gmail.com>
1984
1985 PR 20995
1986 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
1987 rather than elf32_nios2_hash_table or elf_hash_table.
1988 (create_got_section): Likewise.
1989 (nios2_elf32_finish_dynamic_symbol): Likewise.
1990 (nios2_elf32_adjust_dynamic_symbol): Likewise.
1991 (nios2_elf32_size_dynamic_sections): Likewise.
1992 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
1993 vars. Use htab equivalents directly instead. Don't create
1994 all dynamic sections on needing just the GOT. Use a goto
1995 rather than a fall-through with reloc test. Ensure
1996 htab->dynobj is set when making dynamic sreloc section.
1997 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
1998 equivalent directly instead. Don't segfault on looking for
1999 .dynamic when dynamic sections have not been created. Don't
2000 segfault on .got.plt being discarded.
2001 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
2002 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
2003 fixme and another not so relevant comment.
2004 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
2005 already set, set hash table dynobj on creating .sbss.
2006
2007 2017-02-28 Alan Modra <amodra@gmail.com>
2008
2009 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
2010 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
2011 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
2012 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
2013 (ppc64_elf_relocate_section): Likewise.
2014 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
2015 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
2016 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
2017 * libbfd.h: Regenerate.
2018 * bfd-in2.h: Regenerate.
2019
2020 2017-02-28 Alan Modra <amodra@gmail.com>
2021
2022 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
2023 dynamic .data.rel.ro read-only.
2024 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
2025 rather than section flags when deciding where copy reloc goes.
2026 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
2027 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
2028 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
2029 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
2030 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
2031 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
2032 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
2033 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
2034 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2035 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
2036 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
2037 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
2038 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2039 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
2040 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
2041 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
2042 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2043 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
2044 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
2045
2046 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
2047
2048 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
2049 `jalr $0, $25' instruction encoding.
2050
2051 2017-02-27 Nick Clifton <nickc@redhat.com>
2052
2053 PR ld/21180
2054 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
2055 generating a seg-fault when encountering a symbol that has been
2056 deleted by garbage collection.
2057
2058 2017-02-25 Alan Modra <amodra@gmail.com>
2059
2060 * elf32-arc.c (struct dynamic_sections): Delete.
2061 (enum dyn_section_types): Delete.
2062 (dyn_section_names): Delete.
2063 (arc_create_dynamic_sections): Delete.
2064 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
2065 segfault on discarded .rela.plt section.
2066 (elf_arc_size_dynamic_sections): Formatting. Don't call
2067 arc_create_dynamic_sections. Don't allocate memory for sections
2068 handled by the generic linker. Correct code finding relocs in
2069 read-only sections. Set SEC_EXCLUDE on zero size .got,
2070 .got.plt, and .dynbss sections. Do set .interp for pies.
2071
2072 2017-02-24 Andrew Waterman <andrew@sifive.com>
2073
2074 * elfnn-riscv.c (GP_NAME): New macro.
2075 (riscv_global_pointer_value): Use it.
2076 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
2077 output section, consider only that section's alignment.
2078
2079 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2080
2081 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
2082 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
2083 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
2084 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
2085
2086 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
2087
2088 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
2089 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
2090 or misaligned.
2091
2092 2017-02-23 Alan Modra <amodra@gmail.com>
2093
2094 PR 20744
2095 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
2096 16D relocations.
2097 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
2098 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
2099 relocs.
2100
2101 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
2102
2103 PR ld/20828
2104 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
2105 processing ahead of the call to `elf_gc_sweep_symbol'.
2106
2107 2017-02-22 Nick Clifton <nickc@redhat.com>
2108
2109 PR binutils/21193
2110 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
2111 created section 4-byte alignment.
2112
2113 2017-02-22 Alan Modra <amodra@gmail.com>
2114
2115 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
2116 on .got or .plt output section being discarded by script.
2117 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
2118 vxworks splt temp.
2119
2120 2017-02-21 Alan Modra <amodra@gmail.com>
2121
2122 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
2123 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
2124
2125 2017-02-20 Alan Modra <amodra@gmail.com>
2126
2127 PR 21181
2128 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
2129 if DT_RELSZ/DT_RELASZ is zero.
2130
2131 2017-02-17 Nick Clifton <nickc@redhat.com>
2132
2133 * compress.c (bfd_get_full_section_contents): Remember to reduce
2134 compressed size by the sizeof the compression header when
2135 decompressing the contents.
2136
2137 2017-02-17 Pedro Alves <palves@redhat.com>
2138
2139 * srec.c (Chunk): Rename to ...
2140 (_bfd_srec_len): ... this.
2141 (S3Forced): Rename to ...
2142 (_bfd_srec_forceS3): ... this.
2143 * objcopy.c: Adjust all references.
2144
2145 2017-02-17 Pedro Alves <palves@redhat.com>
2146
2147 * archive.c (bsd_write_armap): Rename to ...
2148 (_bfd_bsd_write_armap): ... this.
2149 (coff_write_armap): Rename to ...
2150 (_bfd_coff_write_armap): ... this.
2151 * libbfd-in.h (bsd_write_armap): Rename to ...
2152 (_bfd_bsd_write_armap): ... this.
2153 (coff_write_armap): Rename to ...
2154 (_bfd_coff_write_armap): ... this.
2155 * aout-target.h, aout-tic30.c: Adjust all users.
2156 * libbfd.h: Regenerate.
2157
2158 2017-02-17 Pedro Alves <palves@redhat.com>
2159
2160 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
2161 (warn_deprecated): Rename to ...
2162 (_bfd_warn_deprecated): ... this.
2163 * libbfd.c (warn_deprecated): Rename to ...
2164 (_bfd_warn_deprecated): ... this.
2165 * bfd-in2.h: Regenerate.
2166
2167 2017-02-17 Pedro Alves <palves@redhat.com>
2168
2169 * bfdio.c (real_ftell): Rename to ...
2170 (_bfd_real_ftell): ... this.
2171 (real_fseek): Rename to ...
2172 (_bfd_real_fseek): ... this.
2173 (real_fopen): Rename to ...
2174 (_bfd_real_fopen): ... this.
2175 * libbfd-in.h (real_ftell): Rename to ...
2176 (_bfd_real_ftell): ... this.
2177 (real_fseek): Rename to ...
2178 (_bfd_real_fseek): ... this.
2179 (real_fopen): Rename to ...
2180 (_bfd_real_fopen): ... this.
2181 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
2182 * libbfd.h: Regenerate.
2183
2184 2017-02-17 Pedro Alves <palves@redhat.com>
2185
2186 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
2187 * libbfd.c (read_unsigned_leb128): Rename to ...
2188 (_bfd_read_unsigned_leb128): ... this.
2189 (read_signed_leb128): Rename to ...
2190 (_bfd_read_signed_leb128): ... this.
2191 (safe_read_leb128): Rename to ...
2192 (_bfd_safe_read_leb128): ... this.
2193 * libbfd-in.h (read_unsigned_leb128): Rename to ...
2194 (_bfd_read_unsigned_leb128): ... this.
2195 (read_signed_leb128): Rename to ...
2196 (_bfd_read_signed_leb128): ... this.
2197 (safe_read_leb128): Rename to ...
2198 (_bfd_safe_read_leb128): ... this.
2199 * libbfd.h: Renegerate.
2200
2201 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2202
2203 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
2204 before trying to fine matching file and line information.
2205
2206 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
2207
2208 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
2209 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
2210 not match current bfd, then reload debug information. Record bfd
2211 we're loading debug info for in the stash. If we have debug
2212 informatin in the cache then perform section placement before
2213 returning.
2214
2215 2017-02-16 Alan Modra <amodra@gmail.com>
2216
2217 PR 21000
2218 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
2219 * elfxx-target.h (elf_backend_no_page_alias): Define.
2220 (elfNN_bed): Init new field.
2221 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
2222 ensure PT_LOAD segment starts on a new page.
2223 * elf32-hppa.c (elf_backend_no_page_alias): Define.
2224
2225 2017-02-16 Alan Modra <amodra@gmail.com>
2226
2227 PR 21132
2228 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
2229 if pic.
2230
2231 2017-02-16 Jiong Wang <jiong.wang@arm.com>
2232
2233 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
2234 * bfd-in2.h: Regenerated.
2235
2236 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2237
2238 PR ld/21168
2239 * elf32-i386.c (elf_i386_relocate_section): Allow
2240 "lea foo@GOT, %reg" in PIC.
2241
2242 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
2243
2244 PR ld/20244
2245 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
2246 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
2247 error against local IFUNC symbol without a base register for
2248 PIC.
2249
2250 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
2251
2252 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
2253 `%P: %H:' with `info->callbacks->einfo'.
2254 (ppc_elf_relocate_section): Likewise.
2255 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2256 (ppc64_elf_edit_toc): Likewise.
2257 (ppc64_elf_relocate_section): Likewise.
2258
2259 2017-02-14 Alan Modra <amodra@gmail.com>
2260
2261 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
2262 --gc-keep-exported, and test versioned field of sym rather than
2263 looking for @ in name.
2264
2265 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
2266
2267 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
2268 __global_pointer$.
2269
2270 2017-02-13 Nick Clifton <nickc@redhat.com>
2271
2272 PR binutils/21151
2273 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
2274 unit length field.
2275
2276 2017-02-07 Andrew Waterman <andrew@sifive.com>
2277
2278 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
2279 entry size if PLT header is written.
2280
2281 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
2282
2283 Fix sparc64 dynamic relocation processing to use the dynamic
2284 symbol count.
2285 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
2286 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
2287 should be used.
2288
2289 2017-02-03 Nick Clifton <nickc@redhat.com>
2290
2291 PR 21096
2292 * coffcode.h (coff_write_object_contents): Enlarge size of
2293 s_name_buf in order to avoid compile time warning about possible
2294 integer truncation.
2295 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
2296 32-bits of insn value before printing into buffer.
2297
2298 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2299
2300 * elfxx-mips.c (mips_elf_hash_sort_data): Add
2301 `max_local_dynindx'.
2302 (mips_elf_sort_hash_table): Handle it.
2303 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
2304 symbols bump up `max_local_dynindx' rather than
2305 `max_non_got_dynindx'.
2306
2307 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2308
2309 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
2310 `min_got_dynindx', `max_unref_got_dynindx' and
2311 `max_non_got_dynindx' members to the `bfd_size_type' data type.
2312 (mips_elf_sort_hash_table): Adjust accordingly.
2313
2314 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2315
2316 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
2317 to access the hash table.
2318
2319 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2320
2321 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
2322 non-NULL `htab' to the beginning.
2323
2324 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
2325
2326 * elflink.c (elf_gc_sweep): Wrap overlong line.
2327
2328 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
2329
2330 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
2331 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
2332 * elfxx-mips.c (mips_elf_link_hash_table): Add
2333 `ignore_branch_isa' member.
2334 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
2335 in branch relocation calculation as an error if
2336 `ignore_branch_isa' has been set.
2337 (_bfd_mips_elf_insn32): Rename to...
2338 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
2339 parameter to `insn32' and add an `ignore_branch_isa' parameter.
2340 Handle the new parameter.
2341
2342 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
2343
2344 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
2345 local variable dynobj.
2346
2347 PR ld/20995
2348 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
2349 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
2350 executable from read-only sections into sdynrelro.
2351 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
2352 dynamic relocs in sdynrelro.
2353 (elf_backend_want_dynrelro): Define.
2354
2355 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2356
2357 * config.bfd (*-*-rtemsaout*): Mark as removed.
2358
2359 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2360
2361 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
2362 (arm-*-rtems*): Move to (arm*-*-eabi*).
2363 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
2364 (m68-*-rtems*): Move to (m68*-*-elf*).
2365
2366 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
2367
2368 * config.bfd (*-*-rtemscoff*): Mark as removed.
2369
2370 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
2371
2372 PR ld/20828
2373 * elflink.c (bfd_elf_record_link_assignment): Revert last
2374 change and don't ever clear `forced_local'. Set `mark'
2375 unconditionally.
2376 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
2377 file.
2378 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
2379 (bfd_elf_size_dynamic_sections): ... here.
2380 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
2381 and set `mark' instead in `__tls_get_addr_opt' processing.
2382 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
2383
2384 2017-01-24 Alan Modra <amodra@gmail.com>
2385
2386 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
2387 where dynamic relocs are preferable. Allow ifunc too.
2388 (ensure_undefweak_dynamic): New function.
2389 (allocate_dynrelocs): Use it here. Move plt handling last and
2390 don't make symbols dynamic, simplifying loop. Only make undef
2391 weak symbols with GOT entries dynamic. Correct condition
2392 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
2393 comments. Remove goto.
2394 (ppc_elf_relocate_section): Correct test for using dynamic
2395 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2396 to suit. Set up explicit tls_index entries and implicit GOT
2397 tls_index entries resolvable at link time for
2398 __tls_get_addr_opt. Simplify test to clear mem for prelink.
2399 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
2400 (ensure_undefweak_dynamic): New function.
2401 (allocate_dynrelocs): Use it here. Only make undef weak symbols
2402 with GOT entries dynamic. Remove unnecessary test of
2403 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
2404 (ppc64_elf_relocate_section): Correct test for using dynamic
2405 symbol on GOT relocs. Rearrange test for emitting GOT relocs
2406 to suit. Set up explicit tls_index entries and implicit GOT
2407 tls_index entries resolvable at link time for __tls_get_addr_opt.
2408 Simplify expression to clear mem for prelink.
2409
2410 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
2411
2412 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
2413
2414 2017-01-20 Jiong Wang <jiong.wang@arm.com>
2415
2416 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
2417 (elf_backend_hash_symbol): Define.
2418
2419 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
2420
2421 PR ld/20828
2422 * elflink.c (bfd_elf_record_link_assignment): Clear any
2423 `forced_local' marking for DSO symbols that are not being
2424 provided.
2425
2426 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
2427
2428 * elfnn-riscv.c (riscv_elf_object_p): New function.
2429
2430 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
2431
2432 PR ld/21038
2433 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
2434 plt_bnd_eh_frame.
2435 (elf_x86_64_check_relocs): Create .eh_frame section for the
2436 .plt.bnd section.
2437 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2438 .eh_frame section for the .plt.bnd section.
2439 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2440 for the .plt.bnd section.
2441
2442 2017-01-12 Nick Clifton <nickc@redhat.com>
2443
2444 PR binutils/20876
2445 * opncls.c (find_separate_debug_file): Add include_dirs
2446 parameter. Only include the directory part of the bfd's filename
2447 in search paths if include_dirs is true. Add a couple of extra
2448 locations for looking for debug files.
2449 ( bfd_follow_gnu_debuglink): Update invocation of
2450 find_separate_debug_file.
2451 (bfd_follow_gnu_debugaltlink): Likewise.
2452 (get_build_id): New function: Finds the build-id of the given bfd.
2453 (get_build_id_name): New function: Computes the name of the
2454 separate debug info file for a bfd, based upon its build-id.
2455 (check_build_id_file): New function: Checks to see if a separate
2456 debug info file exists at the given location, and that its
2457 build-id matches that of the original bfd.
2458 (bfd_follow_build_id_debuglink): New function: Finds a separate
2459 debug info file for a given bfd by using the build-id method.
2460 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
2461 method of locating a separate debug info file before using the
2462 debuglink method.
2463 * bfd-in2.h: Regenerate.
2464
2465 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
2466
2467 PR ld/21038
2468 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
2469 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
2470 elf_x86_64_eh_frame_plt_got.
2471 (elf_x86_64_size_dynamic_sections): Get unwind info from
2472 elf_x86_64_bnd_arch_bed for the BND PLT.
2473
2474 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
2475
2476 * config.bfd: Add entries for i686-redox and x86_64-redox.
2477
2478 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2479
2480 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
2481 to 4 bytes.
2482 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
2483 .eh_frame section to 4 bytes for x32.
2484 (elf_x86_64_check_relocs): Likewise.
2485
2486 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2487
2488 PR ld/20830
2489 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
2490 (PLT_GOT_FDE_LENGTH): Likewise.
2491 (elf_i386_plt_layout): Add eh_frame_plt_got and
2492 eh_frame_plt_got_size.
2493 (elf_i386_plt): Updated.
2494 (elf_i386_link_hash_table): Add plt_got_eh_frame.
2495 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
2496 (elf_i386_size_dynamic_sections): Allocate and initialize
2497 .eh_frame section for .plt.got.
2498 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
2499 .plt.got.
2500 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
2501 eh_frame_plt_got_size.
2502 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
2503 (PLT_GOT_FDE_LENGTH): Likewise.
2504 (elf_x86_64_backend_data): Add eh_frame_plt_got and
2505 eh_frame_plt_got_size.
2506 (elf_x86_64_arch_bed): Updated.
2507 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
2508 eh_frame_plt_got_size.
2509 (elf_x86_64_nacl_arch_bed): Likewise.
2510 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
2511 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
2512 (elf_x86_64_size_dynamic_sections): Allocate and initialize
2513 .eh_frame section for .plt.got.
2514 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
2515 for .plt.got.
2516
2517 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
2518
2519 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
2520 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
2521
2522 2017-01-09 Nick Clifton <nickc@redhat.com>
2523
2524 * dwarf2.c (lookup_address_in_function_table): Return early if
2525 there are no functions in the given comp unit, or if the high
2526 address of the last function in the comp unit is less than the
2527 desired address.
2528
2529 2017-01-09 Nick Clifton <nickc@redhat.com>
2530
2531 PR binutils/21013
2532 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
2533 message if there are too many symbols to load.
2534
2535 2017-01-04 James Clarke <jrtc27@jrtc27.com>
2536
2537 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
2538 if relocs are cached.
2539
2540 2017-01-03 Rich Felker <bugdal@aerifal.cx>
2541
2542 PR ld/21017
2543 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
2544 for R_MICROBLAZE_GOTOFF_64.
2545
2546 2017-01-03 Nick Clifton <nickc@redhat.com>
2547
2548 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
2549 warning about using a possibly uninitialised variable.
2550
2551 2017-01-02 Alan Modra <amodra@gmail.com>
2552
2553 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
2554 (allocate_plt_static, allocate_dynrelocs): Use it.
2555
2556 2017-01-02 Alan Modra <amodra@gmail.com>
2557
2558 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
2559 .PARISC.unwind section.
2560
2561 2017-01-02 Alan Modra <amodra@gmail.com>
2562
2563 PR ld/20989
2564 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
2565 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
2566 indirect to GOT pointer relative code edit.
2567
2568 2017-01-02 Alan Modra <amodra@gmail.com>
2569
2570 Update year range in copyright notice of all files.
2571
2572 For older changes see ChangeLog-2016
2573 \f
2574 Copyright (C) 2017 Free Software Foundation, Inc.
2575
2576 Copying and distribution of this file, with or without modification,
2577 are permitted in any medium without royalty provided the copyright
2578 notice and this notice are preserved.
2579
2580 Local Variables:
2581 mode: change-log
2582 left-margin: 8
2583 fill-column: 74
2584 version-control: never
2585 End: