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