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