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