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