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