1 2017-10-10 Alan Modra <amodra@gmail.com>
3 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
4 .opd whenever .opd is present and non-zero size. Move code
5 setting abiversion to/from output file earlier. Only set
6 u.opd.func_sec when --gc-sections. Read relocs and set up
7 u.opd.func_sec values here..
8 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
10 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
12 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
14 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
17 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
19 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
20 .interp section with "ld --no-dynamic-linker".
22 2017-10-09 Alan Modra <amodra@gmail.com>
25 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
26 funcinfo_hash_table and varinfo_hash_table.
28 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
30 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
31 in read-only section with minfo.
32 (sh_elf_size_dynamic_sections): Likewise.
34 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
36 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
39 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
41 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
42 this_hdr.sh_entsize only if section size > 0.
44 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
46 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
48 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
50 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
51 in read-only section with minfo.
52 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
54 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
56 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
59 2017-10-06 John Baldwin <jhb@FreeBSD.org>
61 * elf-bfd.h (struct elf_backend_data): Add
62 `elf_backend_grok_freebsd_prstatus'.
63 * elf.c (elfcore_grok_freebsd_note): Call
64 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
66 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
68 (elf_backend_grok_freebsd_prstatus): Define.
69 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
70 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
72 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
74 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
75 and has_non_got_reloc with zero_undefweak.
76 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
77 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
79 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
80 has_non_got_reloc with zero_undefweak.
81 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
82 has_got_reloc and has_non_got_reloc with zero_undefweak.
83 (elf_x86_link_hash_entry): Likewise.
85 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
87 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
88 (VERIFY_COPY_RELOC): Likewise.
90 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
92 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
93 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
94 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
96 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
98 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
99 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
100 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
102 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
104 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
105 * elf32-i386.c (elf_i386_relocate_section): Use it.
106 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
108 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
110 * elf32-i386.c (X86_SIZE_TYPE_P): New.
111 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
112 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
113 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
114 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
116 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
118 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
119 (PLT_LOCAL_IFUNC_P): Likewise.
120 * elf32-i386.c (elf_i386_relocate_section): Use them.
121 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
123 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
125 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
126 * elf32-i386.c (elf_i386_relocate_section): Use it.
127 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
129 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
131 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
132 * elf32-i386.c (elf_i386_relocate_section): Use it.
133 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
135 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
137 * elf32-i386.c (X86_PCREL_TYPE_P): New.
138 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
139 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
140 (X86_PCREL_TYPE_P): This.
141 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
142 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
143 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
145 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
147 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
149 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
150 * elf32-i386.c (elf_i386_tls_transition): Use it.
151 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
153 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
155 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
156 Dump dynamic relocation in read-only section with minfo if
158 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
159 (maybe_set_textrel): Likewise.
160 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
161 read-only section with minfo.
163 2017-10-05 John Baldwin <jhb@FreeBSD.org>
165 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
167 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
169 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
170 in read-only section with minfo.
171 (tilepro_elf_size_dynamic_sections): Likewise.
172 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
173 (tilegx_elf_size_dynamic_sections): Likewise.
175 2017-10-05 Pedro Alves <palves@redhat.com>
178 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
179 ellipsis parameter. Split out bfd_error_on_input code to..
180 (bfd_set_input_error): .. New function.
181 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
182 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
183 * bfd-in2.h: Regenerate.
185 2017-10-05 Alan Modra <amodra@gmail.com>
187 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
188 fini_array error value.
190 2017-10-05 Alan Modra <amodra@gmail.com>
193 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
195 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
197 (elf_fake_sections): Adjust calls. Exit immediately on failure.
198 (bfd_elf_set_group_contents): Add associated reloc section indices
201 2017-10-04 Alan Modra <amodra@gmail.com>
203 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
204 classify symbols for ELFv2.
206 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
209 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
210 undergoes default promotion.
211 * bfd-in2.h: Regenerate.
213 2017-10-02 Alan Modra <amodra@gmail.com>
215 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
216 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
218 2017-10-01 Alan Modra <amodra@gmail.com>
221 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
222 (add_line_info): Always put end_sequence last.
224 2017-10-01 Alan Modra <amodra@gmail.com>
227 * dwarf2.c (read_section): Allocate buffer with extra byte for
228 bfd_simple_get_relocated_section_contents rather than copying
231 2017-09-29 Alan Modra <amodra@gmail.com>
233 * merge.c (merge_strings): Return FALSE on malloc failure.
234 (_bfd_merge_sections): Return failures from record_section and
237 2017-09-28 Alan Modra <amodra@gmail.com>
240 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
241 a case where plugin_notice isn't called.
243 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
245 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
248 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
251 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
252 output_bfd to info->callbacks->minfo.
254 2017-09-26 Nick Clifton <nickc@redhat.com>
257 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
258 assertion failure if elf_x86_64_rtype_to_howto has already issued
261 2017-09-26 Alan Modra <amodra@gmail.com>
264 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
267 2017-09-26 Nick Clifton <nickc@redhat.com>
270 * dwarf2.c (read_formatted_entries): Fail early if we know that
271 the loop parsing data entries will overflow the end of the
274 2017-09-26 Alan Modra <amodra@gmail.com>
277 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
278 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
279 to stash->info_ptr_memory, and check die_ref is within that memory.
280 Set info_ptr_end correctly when another CU is refd. Check die_ref
281 for DW_FORM_ref4 etc. is within CU.
283 2017-09-26 Alan Modra <amodra@gmail.com>
286 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
287 (read_formatted_entries): Init "fe".
288 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
290 2017-09-26 Alan Modra <amodra@gmail.com>
293 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
294 bounds in inner loop.
296 2017-09-25 Alan Modra <amodra@gmail.com>
299 * dwarf1.c (parse_die): Sanity check pointer against section limit
300 before dereferencing.
301 (parse_line_table): Likewise.
303 2017-09-25 Alan Modra <amodra@gmail.com>
306 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
308 (parse_comp_unit): Likewise.
310 2017-09-25 Alan Modra <amodra@gmail.com>
313 * dwarf2.c (read_formatted_entries): Error on format_count zero.
315 2017-09-24 Alan Modra <amodra@gmail.com>
318 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
319 within section bounds.
321 2017-09-24 Alan Modra <amodra@gmail.com>
324 * dwarf2.c (decode_line_info): Properly free line sequences on error.
326 2017-09-24 Alan Modra <amodra@gmail.com>
329 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
330 pname param. Return status. Make name const. Don't abort,
331 return an error. Formatting. Exit if current info_ptr matches
332 orig_info_ptr. Update callers.
333 (scan_unit_for_symbols): Start at nesting_level of zero. Make
334 nested_funcs an array of structs for extensibility. Formatting.
336 2017-09-24 Alan Modra <amodra@gmail.com>
339 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
340 rather than dividing by zero.
342 2017-09-24 Alan Modra <amodra@gmail.com>
345 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
347 2017-09-24 Alan Modra <amodra@gmail.com>
350 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
352 2017-09-24 Alan Modra <amodra@gmail.com>
355 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
356 SHT_GNU_verneed section for sanity. Don't zalloc memory for
359 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
362 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
365 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
368 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
369 -1 if bfd_canonicalize_dynamic_reloc returns 0.
371 2017-09-22 Pedro Alves <palves@redhat.com>
372 Alan Modra <amodra@gmail.com>
374 * version.h: Add comment.
376 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
378 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
379 NT_S390_GS_BC, correct the previously swapped invocations of
380 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
382 2017-09-19 Alan Modra <amodra@gmail.com>
385 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
388 2017-09-19 Alan Modra <amodra@gmail.com>
391 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
392 symbols before calculating verrefs. Don't renumber dynsyms
393 after gc. Exclude .gnu.version when zero or one dynsym.
394 Localize some vars and reindent.
396 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
399 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
400 return from bfd_canonicalize_dynamic_reloc.
402 2017-09-15 Alan Modra <amodra@gmail.com>
405 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
406 overflows bfd_size_type.
408 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
411 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
412 to indicate if conversion is performed.
413 (elf_i386_check_relocs): Cache section contents and relocations
414 if conversion is performed.
415 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
416 contents and relocations if conversion is performed.
418 2017-09-14 Nick Clifton <nickc@redhat.com>
421 * peXXigen.c (pe_print_idata): Extend check for HintName vector
424 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
426 * elfxx-x86.h: Fix a typo in comments.
428 2017-09-09 Kamil Rytarowski <n54@gmx.com>
430 * elf32-nds32.c: Rename __BIT() to N32_BIT().
432 2017-09-09 Alan Modra <amodra@gmail.com>
434 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
437 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
439 * elf32-i386.c (elf_i386_relocate_section): Update usage of
440 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
441 (elf_i386_finish_dynamic_symbol): Likewise.
442 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
443 (elf_x86_64_finish_dynamic_symbol): Likewise.
444 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
445 (_bfd_x86_elf_fixup_symbol): Likewise.
447 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
449 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
450 check has_non_got_reloc.
452 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
455 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
456 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
457 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
458 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
459 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
460 and linker_def on __ehdr_start if it is referenced and not
462 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
463 and return TRUE when building executable, if a symbol has
464 non-GOT/non-PLT relocations in text section or there is no
466 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
468 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
470 * elfxx-x86.h: Update comments.
472 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
474 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
475 elf_x86_plt_layout_table with elf_x86_init_table.
476 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
478 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
480 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
481 (elf_x86_init_table): This.
482 (_bfd_x86_elf_link_setup_gnu_properties): Replace
483 elf_x86_plt_layout_table with elf_x86_init_table.
485 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
487 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
488 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
489 * configure: Regenerated.
490 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
491 and r_sym fields of plt_layout.
492 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
494 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
495 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
496 r_info nor r_sym fields.
497 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
499 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
501 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
503 * (_bfd_riscv_relax_align): Call bfd_set_error and
504 print an error message when unable to relax a .align directive.
506 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
508 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
509 (riscv_record_pcrel_hi_reloc): Add absolute argument.
510 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
511 R_RISCV_PCREL_HI20 relocs, and pass the result to
512 riscv_record_pcrel_hi_reloc.
514 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
516 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
517 r_type_p. Remove the converted argument. Replace
518 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
519 the new relocation type via r_type_p.
520 (elf_i386_relocate_section): Likewise.
521 (elf_i386_finish_dynamic_symbol): Likewise.
522 (need_convert_load): Removed.
523 (check_relocs_failed): Updated.
524 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
525 instead of setting need_convert_load.
526 (_bfd_i386_elf_convert_load): Removed.
527 * elf64-x86-64.c (need_convert_load): Removed.
528 (check_relocs_failed): Updated.
529 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
530 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
531 Return the new relocation type via r_type_p.
532 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
533 instead of setting need_convert_load.
534 (elf_x86_64_check_relocs): Don't check PIC if relocation has
536 (_bfd_x86_64_elf_convert_load): Removed.
537 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
538 with SYMBOL_REFERENCES_LOCAL_P.
539 (elf_x86_64_finish_dynamic_symbol): Likewise.
540 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
542 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
543 (_bfd_x86_elf_link_symbol_references_local): New function.
544 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
545 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
546 SYMBOL_REFERENCES_LOCAL_P.
547 (elf_x86_link_hash_entry): Add local_ref.
548 (elf_x86_link_hash_table): Remove convert_load.
549 (_bfd_i386_elf_convert_load): Removed.
550 (_bfd_x86_64_elf_convert_load): Likewise.
551 (_bfd_x86_elf_link_symbol_references_local): New.
553 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
555 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
556 (elf_x86_64_info_to_howto): Get the real relocation type by
557 masking out R_X86_64_converted_reloc_bit.
558 (elf_x86_64_check_tls_transition): Get the real relocation type
559 by masking out R_X86_64_converted_reloc_bit.
560 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
561 instead of setting converted_reloc.
562 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
563 instead of converted_reloc. Get the real relocation type by
564 masking out R_X86_64_converted_reloc_bit.
565 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
566 R_X86_64_converted_reloc_bit is valid.
567 * elfxx-x86.h (converted_reloc): Removed.
569 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
571 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
572 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
573 to get the relocation type again.
574 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
575 r_type when calling elf_x86_64_tls_transition. Don't use
576 ELF32_R_TYPE to get the relocation type again.
578 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
580 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
583 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
585 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
586 argument. Don't check relocation overflow. Avoid relocation
587 overflow if --no-relax is used. Set converted_reloc on symbol
588 if a GOTPCREL relocation is converted.
589 (elf_x86_64_relocate_section): Issue a fatal error and suggest
590 --no-relax if GOTPCREL relocation conversion leads to relocation
592 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
594 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
595 Edmar Wienskoski <edmar.wienskoski@nxp.com
597 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
598 (ppc_elf_check_relocs): Handle it.
599 (ppc_elf_vle_split20): New function.
600 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
602 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
605 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
606 for x86-64 if GOT_TLS_GDESC_P is true.
608 2017-09-03 Alan Modra <amodra@gmail.com>
611 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
613 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
615 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
616 tls_get_addr for x86-64 in one place.
618 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
620 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
621 with elfxx-x86.lo for 64-bit BFD.
622 * configure: Regenerated.
624 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
626 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
627 (_bfd_i386_elf_convert_load): This. Remove static.
628 (elf_i386_size_dynamic_sections): Removed.
629 (elf_backend_size_dynamic_sections): Likewise.
630 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
631 (_bfd_x86_64_elf_convert_load): This. Remove static.
632 (elf_x86_64_size_dynamic_sections): Removed.
633 (elf_backend_size_dynamic_sections): Likewise.
634 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
635 (elf_x86_allocate_dynrelocs): This. Make it static.
636 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
637 (elf_x86_allocate_local_dynreloc): This. Make it static.
638 (elf_i386_is_reloc_section): New function.
639 (elf_x86_64_is_reloc_section): Likewise.
640 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
641 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
642 Rearrange got_entry_size initialization.
643 (_bfd_x86_elf_size_dynamic_sections): New function.
644 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
645 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
646 (_bfd_i386_elf_convert_load): New.
647 (_bfd_x86_64_elf_convert_load): Likewise.
648 (_bfd_x86_elf_size_dynamic_sections): Likewise.
649 (elf_backend_size_dynamic_sections): Likewise.
650 (_bfd_x86_elf_allocate_dynrelocs): Removed.
651 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
653 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
655 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
658 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
660 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
661 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
663 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
665 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
666 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
667 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
668 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
669 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
670 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
672 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
674 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
675 (elf_i386_allocate_local_dynrelocs): Likewise.
676 (elf_i386_size_dynamic_sections): Replace
677 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
678 with _bfd_x86_elf_allocate_dynrelocs and
679 _bfd_x86_elf_allocate_local_dynrelocs.
680 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
681 (elf_x86_64_allocate_local_dynrelocs): Likewise.
682 (elf_x86_64_size_dynamic_sections): Replace
683 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
684 with _bfd_x86_elf_allocate_dynrelocs and
685 _bfd_x86_elf_allocate_local_dynrelocs.
686 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
687 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
688 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
689 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
691 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
693 * elf32-i386.c (is_i386_elf): Removed.
694 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
695 (elf_i386_size_dynamic_sections): Likewise.
696 (elf_i386_relocate_section): Likewise.
697 * elf64-x86-64.c (is_x86_64_elf): Removed.
698 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
700 (elf_x86_64_size_dynamic_sections): Likewise.
701 (elf_x86_64_relocate_section): Likewise.
702 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
704 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
707 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
709 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
710 (elf_i386_allocate_dynrelocs): Replace
711 elf_i386_compute_jump_table_size with
712 elf_x86_compute_jump_table_size.
713 (elf_i386_size_dynamic_sections): Likewise.
714 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
715 (elf_x86_64_allocate_dynrelocs): Replace
716 elf_x86_64_compute_jump_table_size with
717 elf_x86_compute_jump_table_size.
718 (elf_x86_64_size_dynamic_sections): Likewise.
719 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
721 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
722 (elf_x86_compute_jump_table_size): New.
724 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
726 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
728 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
729 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
731 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
733 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
734 with htab->is_vxworks.
735 (elf_i386_size_dynamic_sections): Likewise.
736 (elf_i386_relocate_section): Likewise.
737 (elf_i386_finish_dynamic_symbol): Likewise.
738 (elf_i386_finish_dynamic_sections): Likewise.
740 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
742 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
743 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
744 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
745 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
746 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
747 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
748 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
749 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
751 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
754 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
755 ELF_COMMON_DEF_P for common symbols.
757 2017-09-02 Alan Modra <amodra@gmail.com>
759 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
760 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
761 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
763 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
765 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
766 (elf_backend_gc_mark_hook): Likewise.
767 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
768 (elf_backend_gc_mark_hook): Likewise.
769 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
770 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
771 (elf_backend_gc_mark_hook): Likewise.
773 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
775 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
776 (elf_backend_adjust_dynamic_symbol): Likewise.
777 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
778 (elf_backend_adjust_dynamic_symbol): Likewise.
779 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
780 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
781 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
782 (_bfd_x86_elf_adjust_dynamic_symbol): New.
783 (elf_backend_adjust_dynamic_symbol): Likewise.
785 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
787 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
790 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
792 * elf32-i386.c (elf_i386_mkobject): Removed.
793 (bfd_elf32_mkobject): Likewise.
794 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
795 (bfd_elf64_mkobject): Likewise.
796 (bfd_elf32_mkobject): Likewise.
797 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
798 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
799 (bfd_elf64_mkobject): Likewise.
800 (bfd_elf32_mkobject): Likewise.
802 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
804 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
805 Call _bfd_x86_elf_link_setup_gnu_properties.
806 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
807 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
809 (elf_x86_64_non_lazy_plt): Likewise.
810 (elf_x86_64_lazy_bnd_plt): Likewise.
811 (elf_x86_64_non_lazy_bnd_plt): Likewise.
812 (elf_x86_64_lazy_ibt_plt): Likewise.
813 (elf_x32_lazy_ibt_plt): Likewise.
814 (elf_x86_64_non_lazy_ibt_plt): Likewise.
815 (elf_x32_non_lazy_ibt_plt): Likewise.
816 (elf_x86_64_nacl_plt): Likewise.
817 (elf_x86_64_link_setup_gnu_properties): Updated. Call
818 _bfd_x86_elf_link_setup_gnu_properties.
819 * elfxx-x86.c: Include elf-vxworks.h".
820 (_bfd_x86_elf_link_setup_gnu_properties): New function.
821 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
822 comments for pic_plt0_entry and pic_plt_entry.
823 (elf_x86_non_lazy_plt_layout): Likewise.
824 (elf_x86_plt_layout_table): New.
825 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
827 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
830 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
831 .eh_frame section for the second PLT.
832 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
833 alignment of .eh_frame section for the second PLT.
835 2017-09-01 Nick Clifton <nickc@redhat.com>
838 * dwarf2.c (decode_line_info): Fix test for an overlong line info
841 2017-09-01 Nick Clifton <nickc@redhat.com>
844 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
845 attribute buffer is NUL terminated.
847 2017-08-31 Nick Clifton <nickc@redhat.com>
850 * dwarf2.c (read_section): If necessary add a terminating NUL byte
851 to dwarf string sections.
853 2017-08-31 Alan Modra <amodra@gmail.com>
855 * po/SRC-POTFILES.in: Regenerate.
857 2017-08-31 Alan Modra <amodra@gmail.com>
859 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
860 for a section containing just a terminator. Allow multiple
861 terminators at end of section.
862 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
863 sections when not adding alignment. Assert on terminator in
866 2017-08-31 Alan Modra <amodra@gmail.com>
870 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
873 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
875 * configure.ac (bfd_backends): Add elf64.lo together with
876 elfxx-x86.lo for 64-bit BFD.
877 * configure: Regenerated.
879 2017-08-31 James Bowman <james.bowman@ftdichip.com>
881 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
884 2017-08-31 Alan Modra <amodra@gmail.com>
887 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
888 before _close_and_cleanup. Call iovec->bclose after.
889 (bfd_close): Remove code common to, and call, bfd_close_all_done.
891 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
893 * elf32-i386.c (elf_i386_plt_type): Removed.
894 (elf_i386_plt): Likewise.
895 (elf_i386_get_synthetic_symtab): Updated. Call
896 _bfd_x86_elf_get_synthetic_symtab.
897 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
898 (elf_x86_64_plt): Likewise.
899 (elf_x86_64_get_synthetic_symtab): Updated. Call
900 _bfd_x86_elf_get_synthetic_symtab.
901 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
902 (elf_x86_64_get_plt_got_vma): Likewise.
903 (elf_i386_valid_plt_reloc_p): Likewise.
904 (elf_x86_64_valid_plt_reloc_p): Likewise.
905 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
906 * elfxx-x86.h (elf_x86_plt_type): New.
907 (elf_x86_plt): Likewise.
908 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
910 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
912 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
913 target_id instead of elf_machine_code.
915 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
917 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
918 (elf_i386_lazy_plt_layout): Likewise.
919 (elf_i386_non_lazy_plt_layout): Likewise.
920 (elf_i386_plt_layout): Likewise.
921 (elf_i386_link_hash_table): Likewise.
922 (elf_i386_next_tls_desc_index): Likewise.
923 (elf_i386_srelplt2): Likewise.
924 (elf_i386_plt): Likewise.
925 (elf_i386_lazy_plt): Likewise.
926 (elf_i386_non_lazy_plt): Likewise.
927 (elf_i386_link_hash_table_create): Likewise.
928 (bfd_elf32_bfd_link_hash_table_create): Likewise.
929 (elf_i386_lazy_plt): Updated.
930 (elf_i386_non_lazy_plt): Likewise.
931 (elf_i386_lazy_ibt_plt): Likewise.
932 (elf_i386_non_lazy_ibt_plt): Likewise.
933 (elf_i386_allocate_dynrelocs): Likewise.
934 (elf_i386_size_dynamic_sections): Likewise.
935 (elf_i386_relocate_section): Likewise.
936 (elf_i386_finish_dynamic_symbol): Likewise.
937 (elf_i386_finish_dynamic_sections): Likewise.
938 (elf_i386_get_synthetic_symtab): Likewise.
939 (elf_i386_link_setup_gnu_properties): Likewise.
940 (elf_i386_nacl_plt): Likewise.
941 * elf64-x86-64.c (ABI_64_P): Removed.
942 (ELF64_DYNAMIC_INTERPRETER): Likewise.
943 (ELF32_DYNAMIC_INTERPRETER): Likewise.
944 (elf_x86_64_lazy_plt_layout): Likewise.
945 (elf_x86_64_non_lazy_plt_layout): Likewise.
946 (elf_x86_64_plt_layout): Likewise.
947 (elf_x86_64_link_hash_table): Likewise.
948 (elf_x86_64_plt): Likewise.
949 (elf_x86_64_lazy_plt): Likewise.
950 (elf_x86_64_non_lazy_plt): Likewise.
951 (elf_x86_64_link_hash_table_create): Likewise.
952 (bfd_elf64_bfd_link_hash_table_create): Likewise.
953 (bfd_elf32_bfd_link_hash_table_create): Likewise.
954 (elf_x86_64_lazy_plt): Updated.
955 (elf_x86_64_non_lazy_plt): Likewise.
956 (elf_x86_64_lazy_bnd_plt): Likewise.
957 (elf_x86_64_non_lazy_bnd_plt): Likewise.
958 (elf_x86_64_lazy_ibt_plt): Likewise.
959 (elf_x32_lazy_ibt_plt): Likewise.
960 (elf_x86_64_non_lazy_ibt_plt): Likewise.
961 (elf_x32_non_lazy_ibt_plt): Likewise.
962 (elf_x86_64_allocate_dynrelocs): Likewise.
963 (elf_x86_64_size_dynamic_sections): Likewise.
964 (elf_x86_64_relocate_section): Likewise.
965 (elf_x86_64_finish_dynamic_symbol): Likewise.
966 (elf_x86_64_finish_dynamic_sections): Likewise.
967 (elf_x86_64_get_synthetic_symtab): Likewise.
968 (elf_x86_64_link_setup_gnu_properties): Likewise.
969 (elf_x86_64_nacl_plt): Likewise.
970 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
972 (ELF32_DYNAMIC_INTERPRETER): New.
973 (ELF64_DYNAMIC_INTERPRETER): Likewise.
974 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
975 (_bfd_x86_elf_link_hash_table_create): Likewise.
976 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
977 (elf_x86_link_hash_table_free): This. Make it static.
978 * elfxx-x86.h: Don't include "objalloc.h".
980 (elf_x86_lazy_plt_layout): Likewise.
981 (elf_x86_non_lazy_plt_layout): Likewise.
982 (elf_x86_plt_layout): Likewise.
983 (_bfd_x86_elf_link_hash_table_create): Likewise.
984 (bfd_elf64_bfd_link_hash_table_create): Likewise.
985 (bfd_elf32_bfd_link_hash_table_create): Likewise.
986 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
987 srelplt2 and next_tls_desc_index.
988 (_bfd_x86_elf_link_hash_table_free): Removed.
990 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
992 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
993 branch offset interpretation.
995 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
998 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1000 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1002 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1003 (elf_x86_64_srelplt2): Likewise.
1005 2017-08-30 Alan Modra <amodra@gmail.com>
1007 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1008 (ppc64_elf_tls_optimize): Set it.
1009 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1010 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1011 addis would add zero.
1012 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1013 (ppc_elf_tls_optimize): Set it.
1014 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1015 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1017 2017-08-30 Alan Modra <amodra@gmail.com>
1019 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1020 __tls_get_addr call sequences to LE, don't move the addi down
1021 to the nop. Replace the bl with addi and leave the nop alone.
1023 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1025 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1027 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1029 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1031 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1033 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1034 (BFD64_BACKENDS): Likewise.
1035 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1036 (BFD64_BACKENDS_CFILES): Likewise.
1037 * Makefile.in: Regenerated.
1038 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1039 elf32-i386.lo and elf64-x86-64.lo.
1040 * configure: Regenerated.
1041 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1042 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1043 "objalloc.h" and "hashtab.h".
1044 (ELIMINATE_COPY_RELOCS): Removed.
1045 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1046 (SYMBOL_NO_COPYRELOC): Likewise.
1047 (elf_i386_link_hash_entry): Likewise.
1048 (GOT_UNKNOWN): Likewise.
1049 (GOT_NORMAL): Likewise.
1050 (GOT_TLS_GD): Likewise.
1051 (elf_i386_hash_entry): Likewise.
1052 (elf_i386_obj_tdata): Likewise.
1053 (elf_i386_tdata): Likewise.
1054 (elf_i386_local_got_tls_type): Likewise.
1055 (elf_i386_local_tlsdesc_gotent): Likewise.
1056 (elf_i386_hash_table): Likewise.
1057 (elf_i386_link_hash_newfunc): Likewise.
1058 (elf_i386_local_htab_hash): Likewise.
1059 (elf_i386_local_htab_eq): Likewise.
1060 (elf_i386_get_local_sym_hash): Likewise.
1061 (elf_i386_link_hash_table_free): Likewise.
1062 (elf_i386_copy_indirect_symbol): Likewise.
1063 (elf_i386_fixup_symbol): Likewise.
1064 (elf_i386_readonly_dynrelocs): Likewise.
1065 (elf_i386_always_size_sections): Likewise.
1066 (elf_i386_set_tls_module_base): Likewise.
1067 (elf_i386_dtpoff_base): Likewise.
1068 (compare_relocs): Likewise.
1069 (elf_i386_hash_symbol): Likewise.
1070 (elf_i386_parse_gnu_properties): Likewise.
1071 (elf_i386_merge_gnu_properties): Likewise.
1072 (elf_i386_link_check_relocs): Likewise.
1073 (elf_i386_merge_symbol_attribute): Likewise.
1074 (bfd_elf32_bfd_link_check_relocs): Likewise.
1075 (elf_backend_copy_indirect_symbol): Likewise.
1076 (elf_backend_always_size_sections): Likewise.
1077 (elf_backend_omit_section_dynsym): Likewise.
1078 (elf_backend_hash_symbol): Likewise.
1079 (elf_backend_fixup_symbol): Likewise.
1080 (elf_backend_parse_gnu_properties): Likewise.
1081 (elf_backend_merge_gnu_properties): Likewise.
1082 (elf_backend_merge_symbol_attribute): Likewise.
1083 (elf_i386_mkobject): Updated.
1084 (elf_i386_link_hash_table_create): Likewise.
1085 (elf_i386_check_tls_transition): Likewise.
1086 (elf_i386_tls_transition): Likewise.
1087 (elf_i386_convert_load_reloc): Likewise.
1088 (elf_i386_check_relocs): Likewise.
1089 (elf_i386_adjust_dynamic_symbol): Likewise.
1090 (elf_i386_allocate_dynrelocs): Likewise.
1091 (elf_i386_convert_load): Likewise.
1092 (elf_i386_size_dynamic_sections): Likewise.
1093 (elf_i386_relocate_section): Likewise.
1094 (elf_i386_finish_dynamic_symbol ): Likewise.
1095 (elf_i386_finish_dynamic_sections): Likewise.
1096 (elf_i386_output_arch_local_syms): Likewise.
1097 (elf_i386_get_synthetic_symtab): Likewise.
1098 (elf_i386_link_setup_gnu_properties): Likewise.
1099 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1100 of elf_link_hash_table, as base.
1101 (elf_i386_next_tls_desc_index): New.
1102 (elf_i386_srelplt2): Likewise.
1103 (elf_i386_plt): Likewise.
1104 (elf_i386_lazy_plt): Likewise.
1105 (elf_i386_non_lazy_plt): Likewise.
1106 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1107 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1108 "objalloc.h" and "hashtab.h".
1109 (ELIMINATE_COPY_RELOCS): Removed.
1110 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1111 (SYMBOL_NO_COPYRELOC): Likewise.
1112 (elf_x86_64_link_hash_entry): Likewise.
1113 (GOT_UNKNOWN): Likewise.
1114 (GOT_NORMAL): Likewise.
1115 (GOT_TLS_GD): Likewise.
1116 (elf_x86_64_hash_entry): Likewise.
1117 (elf_x86_64_obj_tdata): Likewise.
1118 (elf_x86_64_tdata): Likewise.
1119 (elf_x86_64_local_got_tls_type): Likewise.
1120 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1121 (elf_x86_64_hash_table): Likewise.
1122 (elf_x86_64_link_hash_newfunc): Likewise.
1123 (elf_x86_64_local_htab_hash): Likewise.
1124 (elf_x86_64_local_htab_eq): Likewise.
1125 (elf_x86_64_get_local_sym_hash): Likewise.
1126 (elf_x86_64_link_hash_table_free): Likewise.
1127 (elf_x86_64_copy_indirect_symbol): Likewise.
1128 (elf_x86_64_fixup_symbol): Likewise.
1129 (elf_x86_64_readonly_dynrelocs): Likewise.
1130 (elf_x86_64_always_size_sections): Likewise.
1131 (elf_x86_64_set_tls_module_base): Likewise.
1132 (elf_x86_64_dtpoff_base): Likewise.
1133 (compare_relocs): Likewise.
1134 (elf_x86_64_merge_symbol_attribute): Likewise.
1135 (elf_x86_64_hash_symbol): Likewise.
1136 (elf_x86_64_parse_gnu_properties): Likewise.
1137 (elf_x86_64_merge_gnu_properties): Likewise.
1138 (elf_x86_64_link_check_relocs): Likewise.
1139 (elf_backend_copy_indirect_symbol): Likewise.
1140 (elf_backend_always_size_sections): Likewise.
1141 (bfd_elf64_bfd_link_check_relocs): Likewise.
1142 (elf_backend_merge_symbol_attribute): Likewise.
1143 (elf_backend_hash_symbol): Likewise.
1144 (elf_backend_omit_section_dynsym): Likewise.
1145 (elf_backend_fixup_symbol): Likewise.
1146 (elf_backend_parse_gnu_properties): Likewise.
1147 (elf_backend_merge_gnu_properties): Likewise.
1148 (bfd_elf32_bfd_link_check_relocs): Likewise.
1149 (elf_x86_64_mkobject): Updated.
1150 (elf_x86_64_link_hash_table_create): Likewise.
1151 (elf_x86_64_check_tls_transition): Likewise.
1152 (elf_x86_64_tls_transition): Likewise.
1153 (elf_x86_64_convert_load_reloc): Likewise.
1154 (elf_x86_64_check_relocs): Likewise.
1155 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1156 (elf_x86_64_allocate_dynrelocs): Likewise.
1157 (elf_x86_64_convert_load): Likewise.
1158 (elf_x86_64_size_dynamic_sections): Likewise.
1159 (elf_x86_64_relocate_section): Likewise.
1160 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1161 (elf_x86_64_finish_dynamic_sections): Likewise.
1162 (elf_x86_64_output_arch_local_syms): Likewise.
1163 (elf_x86_64_get_synthetic_symtab): Likewise.
1164 (elf_x86_64_link_setup_gnu_properties): Likewise.
1165 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1166 instead of elf_link_hash_table, as base.
1167 (elf_x86_64_next_tls_desc_index): New.
1168 (elf_x86_64_srelplt2): Likewise.
1169 (elf_x86_64_plt): Likewise.
1170 (elf_x86_64_lazy_plt): Likewise.
1171 (elf_x86_64_non_lazy_plt): Likewise.
1172 * elfxx-x86.c: New file.
1173 * elfxx-x86.h: Likewise.
1175 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1177 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1179 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1181 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1183 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1184 sections before checking dynamic relocations and free invalid
1185 PLT section contents.
1186 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1188 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1190 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1191 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1193 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1196 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1198 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1200 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1202 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1204 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1206 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1209 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1210 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1211 Add a has_no_copy_on_protected bitfield.
1212 (elf_has_no_copy_on_protected): New.
1213 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1214 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1215 (elf_merge_gnu_property_list): Likewise.
1216 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1217 to FALSE for elf_has_no_copy_on_protected.
1218 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1219 (elf_i386_link_hash_entry): Add def_protected.
1220 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1221 when checking info->nocopyreloc.
1222 (elf_i386_link_setup_gnu_properties): Don't set
1223 extern_protected_data here.
1224 (elf_i386_merge_symbol_attribute): New function.
1225 (elf_backend_merge_symbol_attribute): New.
1226 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1227 (elf_x86_64_link_hash_entry): Add def_protected.
1228 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1229 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1230 when checking info->nocopyreloc.
1231 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1232 relocation run-time overflow and unresolvable R_X86_64_32S
1233 relocation against protected data symbol defined in shared object
1234 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1235 (elf_x86_64_link_setup_gnu_properties): Don't set
1236 extern_protected_data here.
1237 (elf_x86_64_merge_symbol_attribute): New function.
1238 (elf_backend_merge_symbol_attribute): New.
1240 2017-08-26 Alan Modra <amodra@gmail.com>
1242 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1243 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1244 (ppc_elf_relocate_section): Comment fix.
1245 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1246 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1247 Support dynamic relocs for TPREL16 when non-pic too.
1248 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1249 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1252 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1254 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1255 "symbol" in comments.
1256 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1258 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1261 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1262 R_X86_64_PC32 relocation run-time overflow and unresolvable
1263 R_X86_64_32S relocation with -z nocopyreloc.
1265 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1267 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1268 Undefined symbols may not have a type.
1269 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1271 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1273 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1274 bfd_link_info. Report shared, PIE or PDE object based on
1276 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1277 (elf_x86_64_relocate_section): Likewise.
1279 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1281 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1282 for function symbols.
1283 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1285 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1287 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1288 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1289 is set on any input relocatable file.
1290 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1292 2017-08-23 Alan Modra <amodra@gmail.com>
1295 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1296 ensure_undefweak_dynamic. Handle undefined too.
1297 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1298 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1299 (allocate_dynrelocs): Discard undefined non-default visibility
1300 relocs first. Make undefined syms dynamic. Tidy goto.
1302 2017-08-21 Alan Modra <amodra@gmail.com>
1303 H.J. Lu <hongjiu.lu@intel.com>
1306 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1307 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1309 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1312 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1313 undefined weak symbols.
1315 2017-08-18 Nick Clifton <nickc@redhat.com>
1318 * tekhex.c (getsym): Fix check for source pointer walking off the
1319 end of the input buffer.
1321 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1324 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1325 relocations in debug sections, change abort to _bfd_error_handler.
1327 2017-08-14 Nick Clifton <nickc@redhat.com>
1330 * elf.c (setup_group): Check for an empty or very small group
1332 * po/bfd.pot: Regenerate.
1334 2017-08-14 Alan Modra <amodra@gmail.com>
1337 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1338 alignment padding here.
1339 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1340 in a reverse pass over sections.
1342 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1345 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1346 for @plt suffixes first.
1347 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1349 2017-08-08 Nick Clifton <nickc@redhat.com>
1352 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1353 small section lengths.
1354 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1356 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1357 there is enough data present in the note.
1359 2017-08-08 Alan Modra <amodra@gmail.com>
1362 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1363 got.refcount for GOTOFF relocs, just create .got section.
1365 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1367 * elflink.c (elf_link_add_object_symbols): Move common symbol
1368 check after bed->common_definition.
1370 2017-08-07 Alan Modra <amodra@gmail.com>
1373 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1374 needed to define various dynamic tags have been discarded.
1376 2017-08-07 Nick Clifton <nickc@redhat.com>
1379 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1380 has not been set then use the bfd returned by
1381 _bfd_elf_link_setup_gnu_properties. If that is null then search
1382 through all the input bfds selecting the first normal, ELF format
1384 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1386 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1388 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1390 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1391 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1392 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1393 (elf_i386_link_check_relocs): New function.
1394 (bfd_elf32_bfd_link_check_relocs): New.
1395 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1397 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1398 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1399 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1400 (elf_x86_64_link_check_relocs): New function.
1401 (bfd_elf64_bfd_link_check_relocs): New.
1402 (bfd_elf32_bfd_link_check_relocs): Likewise.
1404 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1407 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1408 as undefined for --no-define-common.
1410 2017-08-05 Alan Modra <amodra@gmail.com>
1412 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1413 hppa_link_hash_table.
1415 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1417 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1418 entries for sysregs with negative indices.
1420 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1422 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1423 isn't the S/390 specific elf data.
1424 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1426 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1428 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1429 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1430 [R_RISCV_ADD16]: Likewise.
1431 [R_RISCV_ADD32]: Likewise.
1432 [R_RISCV_ADD64]: Likewise.
1433 [R_RISCV_SUB6]: Likewise.
1434 [R_RISCV_SUB8]: Likewise.
1435 [R_RISCV_SUB16]: Likewise.
1436 [R_RISCV_SUB32]: Likewise.
1437 [R_RISCV_SUB64]: Likewise.
1439 2017-07-31 Alan Modra <amodra@gmail.com>
1441 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1442 without ld.so checks.
1444 2017-07-29 Alan Modra <amodra@gmail.com>
1447 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1448 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1449 (is_elfv2_localentry0): Test non_zero_localentry.
1450 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1452 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1454 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1455 pointer check for htab->elf.irelplt.
1456 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1458 2017-07-27 Nick Clifton <nickc@redhat.com>
1461 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1463 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1465 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1467 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1469 (evax_bfd_print_emh): Check for invalid string lengths.
1471 2017-07-25 Nick Clifton <nickc@redhat.com>
1473 * po/fr.po: Updated French translation.
1475 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1478 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1479 16-bit absolute branches into 10-bit pc-relative branches on the
1480 MSP430 as well as the MSP430X.
1482 2017-07-25 Alan Modra <amodra@gmail.com>
1484 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1485 (stub_eh_frame_size): New function.
1486 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1487 (group_sections): Init group tls_get_addr_opt_bctrl.
1488 (ppc64_elf_size_stubs): Update sizing and initialization of
1489 .eh_frame. Iteration over stubs via group list.
1490 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1491 (ppc64_elf_finish_dynamic_sections): Update finalization of
1494 2017-07-24 Nick Clifton <nickc@redhat.com>
1497 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1498 of the relocs to the canonicalize_one_reloc routine.
1499 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1500 for the _bfd_mach_o_canonicalize_one_reloc field.
1501 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1502 res_base parameter. Use to check for corrupt pair relocs.
1503 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1505 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1507 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1510 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1511 enough data in the record before attempting to parse it.
1512 (_bfd_vms_slurp_eeom): Likewise.
1514 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1515 (image_set_ptr): Likewise.
1516 (alpha_vms_slurp_relocs): Likewise.
1518 (alpha_vms_object_p): Check for a truncated record.
1520 2017-07-24 Nick Clifton <nickc@redhat.com>
1523 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1524 an unrecognized reloc and sets the bfd_error value.
1525 * libbfd.h: Regenerate.
1526 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1528 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1529 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1530 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1531 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1532 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1534 2017-07-23 Alan Modra <amodra@gmail.com>
1536 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1539 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1542 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1543 reloc_class_ifunc for ifunc symbols.
1545 2017-07-19 Nick Clifton <nickc@redhat.com>
1548 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1549 correct magic bytes at the start, set the error to wrong format
1550 and clear the format selector before returning NULL.
1552 2017-07-19 Nick Clifton <nickc@redhat.com>
1555 * coff-rs6000.c (_bfd_strntol): New function.
1556 (_bfd_strntoll): New function.
1557 (GET_VALUE_IN_FIELD): New macro.
1558 (EQ_VALUE_IN_FIELD): new macro.
1559 (_bfd_xcoff_slurp_armap): Use new macros.
1560 (_bfd_xcoff_archive_p): Likewise.
1561 (_bfd_xcoff_read_ar_hdr): Likewise.
1562 (_bfd_xcoff_openr_next_archived_file): Likewise.
1563 (_bfd_xcoff_stat_arch_elt): Likewise.
1564 * coff64-rs6000.c (_bfd_strntol): New function.
1565 (_bfd_strntoll): New function.
1566 (GET_VALUE_IN_FIELD): New macro.
1567 (xcoff64_slurp_armap): Use new macros.
1569 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1570 John Eric Martin <John.Martin@emmicro-us.com>
1572 * bfd-in2.h: Regenerate.
1573 * libbfd.h: Regenerate.
1574 * elf32-arc.c (JLI): Define.
1575 * reloc.c: Add JLI relocations.
1577 2017-07-18 Nick Clifton <nickc@redhat.com>
1580 * coff-sh.c: Fix spelling typos.
1581 * compress.c: Likewise.
1582 * cpu-pdp11.c: Likewise.
1583 * ecofflink.c: Likewise.
1584 * elf-m10300.c: Likewise.
1586 * elf32-arm.c: Likewise.
1587 * elf32-m68k.c: Likewise.
1588 * elf32-nds32.c: Likewise.
1589 * elf32-ppc.c: Likewise.
1590 * elf32-sh.c: Likewise.
1591 * elf32-v850.c: Likewise.
1592 * elf64-ppc.c: Likewise.
1593 * elf64-x86-64.c: Likewise.
1594 * elflink.c: Likewise.
1595 * elfnn-aarch64.c: Likewise.
1596 * elfxx-mips.c: Likewise.
1598 * sunos.c: Likewise.
1599 * vms-alpha.c: Likewise.
1600 * xcofflink.c: Likewise.
1602 2017-07-18 Nick Clifton <nickc@redhat.com>
1605 * coffcode.h (handle_COMDAT): Replace abort with an error message
1608 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1611 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1614 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1616 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1618 2017-07-16 Alan Modra <amodra@gmail.com>
1620 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1621 __tls_index GOT entries when using __tls_get_addr_opt stub.
1622 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1624 2017-07-12 Alan Modra <amodra@gmail.com>
1626 * po/es.po: Update from translationproject.org/latest/bfd/.
1627 * po/fi.po: Likewise.
1628 * po/fr.po: Likewise.
1629 * po/id.po: Likewise.
1630 * po/ja.po: Likewise.
1631 * po/ro.po: Likewise.
1632 * po/ru.po: Likewise.
1633 * po/sr.po: Likewise.
1634 * po/sv.po: Likewise.
1635 * po/tr.po: Likewise.
1636 * po/uk.po: Likewise.
1637 * po/vi.po: Likewise.
1638 * po/zh_CN.po: Likewise.
1639 * po/hr.po: New file from translationproject.org.
1640 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1641 * configure: Regenerate.
1643 2017-07-12 Nick Clifton <nickc@redhat.com>
1645 Fix compile time warnings using gcc 7.1.1.
1646 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1648 (elf_xtensa_get_gotplt_section): Increase length of got_name
1650 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1651 default return of FALSE.
1652 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1653 default return of FALSE.
1655 2017-07-12 Alan Modra <amodra@gmail.com>
1657 * binary.c (binary_set_section_contents): Don't print filepos in
1659 (coff_write_object_contents): Cast size_t for error message.
1660 (coff_slurp_line_table): Don't use bfd_vma symndx.
1661 (coff_slurp_reloc_table): Remove unneeded cast.
1662 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1664 (find_abstract_instance_name): Likewise.
1665 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1666 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1667 (elf32_arm_check_relocs): Make r_symndx an int.
1668 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1670 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1672 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1674 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1675 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1676 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1677 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1678 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1679 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1680 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1681 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1682 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1683 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1684 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1685 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1686 and use %lu for error message.
1687 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1688 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1691 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1693 (elf32_arm_final_link_relocate): Likewise.
1694 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1695 * coffcode.h (styp_to_sec_flags): Likewise.
1696 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1697 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1698 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1699 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1700 (elf32_bfin_merge_private_bfd_data): Likewise.
1701 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1702 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1703 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1704 (i370_elf_relocate_section): Likewise.
1705 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1706 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1707 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1708 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1709 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1710 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1711 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1712 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1713 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1714 * ieee.c (ieee_write_id, read_id): Likewise.
1715 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1716 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1717 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1718 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1719 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1720 * stabs.c (_bfd_link_section_stabs): Likewise.
1722 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1724 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1725 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1726 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1727 * coff-sh.c (sh_relax_section): Likewise.
1728 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1729 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1730 * coffcode.h (coff_slurp_reloc_table): Likewise.
1731 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1732 (_bfd_coff_read_string_table): Likewise.
1733 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1734 * compress.c (bfd_get_full_section_contents): Likewise.
1735 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1736 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1737 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1738 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1739 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1740 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1741 (elf32_arm_write_section): Likewise.
1742 * elf32-bfin.c (bfin_relocate_section): Likewise.
1743 (bfinfdpic_relocate_section): Likewise.
1744 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1745 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1746 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1747 (elf_i386_relocate_section): Likewise.
1748 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1749 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1750 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1751 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1752 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1753 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1754 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1755 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1756 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1757 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1758 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1759 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1760 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1761 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1762 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1763 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1764 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1765 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1766 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1767 * elf32-sh.c (sh_elf_relax_section): Likewise.
1768 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1769 (sh_elf_relocate_section): Likewise.
1770 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1771 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1772 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1773 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1774 * elf32-v850.c (v850_elf_relax_section): Likewise.
1775 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1776 (elf_vax_relocate_section): Likewise.
1777 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1778 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1779 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1780 (do_fix_for_relocatable_link): Likewise.
1781 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1782 (elf64_alpha_relax_with_lituse): Likewise.
1783 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1784 (elf_hppa_final_link_relocate): Likewise.
1785 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1786 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1787 (elf64_vms_link_add_object_symbols): Likewise.
1788 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1789 (mmix_final_link_relocate): Likewise.
1790 * elf64-s390.c (invalid_tls_insn): Likewise.
1791 (elf_s390_relocate_section): Likewise.
1792 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1793 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1794 (elf_x86_64_relocate_section): Likewise.
1795 * elfcode.h (elf_slurp_symbol_table): Likewise.
1796 * elfcore.h (elf_core_file_p): Likewise.
1797 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1798 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1799 (elfNN_aarch64_relocate_section): Likewise.
1800 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1801 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1802 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1803 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1804 (_bfd_mips_elf_relocate_section): Likewise.
1805 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1806 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1807 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1808 * ieee.c (ieee_slurp_external_symbols): Likewise.
1809 * ihex.c (ihex_write_object_content): Likewise.
1810 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1811 * merge.c (_bfd_merged_section_offset): Likewise.
1812 * mmo.c (mmo_write_loc_chunk): Likewise.
1813 (mmo_write_object_contents): Likewise.
1814 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1815 * stabs.c (_bfd_link_section_stabs): Likewise.
1816 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1818 2017-07-11 Alan Modra <amodra@gmail.com>
1820 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1822 2017-07-11 Alan Modra <amodra@gmail.com>
1824 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1825 instruction" error using _bfd_error_handler, not einfo.
1827 2017-07-10 Nick Clifton <nickc@redhat.com>
1829 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1830 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1832 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1834 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1836 2017-07-07 Alan Modra <amodra@gmail.com>
1838 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1840 2017-07-07 Alan Modra <amodra@gmail.com>
1842 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1843 as long long. Move code replacing "ll" with "I64", and simplify.
1845 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1847 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1850 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1852 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1854 (line_info_add_file_name): Likewise.
1855 (decode_line_info): Likewise.
1857 2017-07-04 Tristan Gingold <gingold@adacore.com>
1859 * version.m4: Bump version to 2.29.51
1860 * configure: Regenerate.
1862 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1864 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1865 sanity check at the head of this function.
1867 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1869 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1870 dwarf_line_str_size.
1871 (struct attr_abbrev): Add field implicit_const.
1872 (dwarf_debug_sections): Add .debug_line_str.
1873 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1874 (dwarf_debug_section_assert): Add static assertion.
1875 (read_indirect_line_string): New.
1876 (read_abbrevs): Support DW_FORM_implicit_const.
1877 (is_str_attr): Support DW_FORM_line_strp.
1878 (read_attribute_value): Support DW_FORM_line_strp and
1879 DW_FORM_implicit_const.
1880 (read_attribute): Support DW_FORM_implicit_const.
1881 (line_info_add_include_dir, line_info_add_include_dir_stub):
1882 (line_info_add_file_name, read_formatted_entries): New.
1883 (decode_line_info, parse_comp_unit): Support DWARF 5.
1884 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1886 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1888 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1889 abort statement that was put for symbols that are not dynamic.
1891 2017-07-03 Tristan Gingold <gingold@adacore.com>
1893 * po/bfd.pot: Regenerate
1895 2017-07-03 Alan Modra <amodra@gmail.com>
1897 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1898 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1899 * elf.c (setup_group): Use "Lx" to print sh_size.
1900 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1901 unknown section type in hex.
1902 (copy_special_section_fields): Style fix.
1903 (bfd_section_from_shdr): Correct format for sh_link. Use a
1904 common error message for all the variants of unrecognized
1906 (assign_file_positions_for_load_sections): Use "Lx" for lma
1907 adjust error message.
1908 (assign_file_positions_for_non_load_sections): Formatting.
1909 (rewrite_elf_program_header): Formatting. Use "Lx" for
1910 bfd_vma values in error messages.
1911 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1912 ELF_R_SYM value to type expected by format.
1913 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1915 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1916 (elf_link_input_bfd): Use "Lx" for r_info.
1917 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1919 2017-07-03 Alan Modra <amodra@gmail.com>
1921 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1922 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1923 Microsoft C library variant of long long format specifier.
1924 (PRINT20): Cast value to bfd_uint64_t not long long.
1925 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1926 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1927 long long. Don't cast to bfd_vma.
1928 * elf32-score.c (score3_bfd_getl48): Likewise.
1929 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1931 2017-07-03 Alan Modra <amodra@gmail.com>
1933 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1935 (bfd_elf_print_symbol): Don't cast symbol->flags.
1936 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1937 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1938 _bfd_error_handler argument order.
1939 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1941 2017-07-03 Alan Modra <amodra@gmail.com>
1943 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1944 AC_TYPE_LONG_DOUBLE.
1945 * configure: Regenerate.
1946 * config.in: Regenerate.
1948 2017-06-29 Andrew Waterman <andrew@sifive.com>
1950 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1953 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1955 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1956 unless it is undefined weak.
1957 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1958 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1960 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1961 is not dynamic in PIC, abort.
1963 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1966 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1967 undefined weak symbols into dynamic.
1968 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1969 relocation for non-dynamic symbols.
1970 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1972 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1974 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1975 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1976 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1977 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1978 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1981 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1983 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1984 (elfcore_write_s390_gs_bc): Likewise.
1985 * elf.c (elfcore_grok_s390_gs_cb): New function.
1986 (elfcore_grok_s390_gs_bc): New function.
1987 (elfcore_grok_note): Call them.
1988 (elfcore_write_s390_gs_cb): New function.
1989 (elfcore_write_s390_gs_bc): New function.
1990 (elfcore_write_register_note): Call them.
1992 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1994 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1995 bfd_get_file_size. Check archive element size.
1996 (_bfd_generic_get_section_contents_in_window): Likewise.
1998 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2000 * bfd-in2.h: Regenerated.
2001 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2002 (bfd_get_file_size): Likewise.
2004 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2005 Matthew Fortune <matthew.fortune@imgtec.com>
2007 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2008 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2009 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2010 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2012 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2013 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2014 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2015 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2016 `bfd_mach_mips_interaptiv_mr2' entries.
2017 * bfd-in2.h: Regenerate.
2019 2017-06-27 Nick Clifton <nickc@redhat.com>
2021 * tekhex.c (pass_over): Revert accidental conversion of a local
2022 array to a static array.
2024 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2027 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2028 reloc addend if necessary. Adjust diff only if
2029 shrinked_insn_address < end_address.
2031 2017-06-27 Alan Modra <amodra@gmail.com>
2034 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2035 (_bfd_generic_get_section_contents_in_window): Likewise.
2037 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2039 * elfnn-riscv.c (perform_relocation): Support the new
2040 R_RISCV_32_PCREL relocation.
2041 (riscv_elf_relocate_section): Likewise.
2042 * elfxx-riscv.c (howto_table): Likewise.
2043 (riscv_reloc_map): Likewise.
2044 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2045 * libbfd.h: Regenerate.
2047 2017-06-27 Alan Modra <amodra@gmail.com>
2050 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2051 Use unsigned file pointer type, and remove cast.
2052 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2053 Add "count", not "sz".
2055 2017-06-26 Pedro Alves <palves@redhat.com>
2058 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2061 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2064 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2067 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2069 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2070 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2071 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2072 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2073 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2075 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2078 * compress.c (bfd_get_full_section_contents): Don't check the
2080 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2081 reject a section whose size + offset is greater than the size
2083 (_bfd_generic_get_section_contents_in_window): Likewise.
2085 2017-06-26 Nick Clifton <nickc@redhat.com>
2088 * tekhex.c (getvalue): Check for the source pointer exceeding the
2089 end pointer before the first byte is read.
2091 2017-06-26 Nick Clifton <nickc@redhat.com>
2094 * opncls.c (get_build_id): Check that the section is big enough
2095 to contain the whole note.
2096 * compress.c (bfd_get_full_section_contents): Check for and reject
2097 a section whose size is greater than the size of the entire file.
2098 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2099 contain a notes section.
2101 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2103 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2105 (elf_s390_modify_segment_map): Likewise.
2106 (bfd_elf_s390_set_options): Lisewise.
2108 2017-06-26 Alan Modra <amodra@gmail.com>
2110 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2112 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2113 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2114 .preinit_array on --just-syms bfds.
2115 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2116 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2117 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2119 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2121 * elf.c (find_link): Bounds check "hint".
2123 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2125 * elf32-arm.c (using_thumb_only): Update list of architectures in
2126 BFD_ASSERT for which the logic is valid.
2127 (using_thumb2_bl): Likewise.
2128 (using_thumb2): Likewise and return true for ARMv8-R.
2129 (arch_has_arm_nop): Likewise.
2130 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2131 merging logic. Update commentis for value 15 of v8m_baseline,
2132 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2133 merging of value 15 of Tag_CPU_arch.
2135 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2137 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2138 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2139 * bfd-in2.h: Regenerate.
2141 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2143 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2144 the error_alignment label forward. Properly align program
2145 property note section.
2147 2017-06-22 Eric Christopher <echristo@gmail.com>
2149 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2150 abs to fix a truncation warning.
2152 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2154 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2155 local undefined weak symbol to 0.
2156 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2158 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2160 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2161 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2162 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2163 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2164 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2165 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2166 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2167 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2169 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2171 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2172 (elf_i386_lazy_ibt_plt_entry): Likewise.
2173 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2174 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2175 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2176 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2177 (elf_i386_lazy_plt_layout): Likewise.
2178 (elf_i386_non_lazy_plt_layout): Likewise.
2179 (elf_i386_link_hash_entry): Add plt_second.
2180 (elf_i386_link_hash_table): Add plt_second and
2181 plt_second_eh_frame.
2182 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2183 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2184 the second PLT. Check the second PLT.
2185 (elf_i386_relocate_section): Use the second PLT to resolve
2186 PLT reference if needed.
2187 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2189 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2190 second PLT. Generate unwind info for the second PLT.
2191 (elf_i386_plt_type): Add plt_second.
2192 (elf_i386_get_synthetic_symtab): Support the second PLT.
2193 (elf_i386_parse_gnu_properties): Support
2194 GNU_PROPERTY_X86_FEATURE_1_AND.
2195 (elf_i386_merge_gnu_properties): Support
2196 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2197 on GNU_PROPERTY_X86_FEATURE_1_IBT
2198 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2199 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2200 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2201 is set on all relocatable inputs.
2202 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2203 (elf_x32_lazy_ibt_plt_entry): Likewise.
2204 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2205 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2206 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2207 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2208 (elf_x86_64_lazy_ibt_plt): Likewise.
2209 (elf_x32_lazy_ibt_plt): Likewise.
2210 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2211 (elf_x32_non_lazy_ibt_plt): Likewise.
2212 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2213 (elf_x86_64_parse_gnu_properties): Support
2214 GNU_PROPERTY_X86_FEATURE_1_AND.
2215 (elf_x86_64_merge_gnu_properties): Support
2216 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2217 on GNU_PROPERTY_X86_FEATURE_1_IBT
2218 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2219 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2220 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2221 is set on all relocatable inputs.
2223 2017-06-22 Nick Clifton <nickc@redhat.com>
2226 * som.c (setup_sections): NUL terminate the space_strings buffer.
2227 Check that the space.name field does not index beyond the end of
2228 the space_strings buffer.
2230 2017-06-21 Nick Clifton <nickc@redhat.com>
2233 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2235 2017-06-21 Nick Clifton <nickc@redhat.com>
2238 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2239 type of the size parameter.
2240 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2241 length of the counted string.
2242 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2243 (_bfd_vms_save_counted_string): Likewise.
2244 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2245 _bfd_vms_save_counted_string.
2246 (_bfd_vms_slurp_ehdr): Likewise.
2247 (_bfd_vms_slurp_egsd): Likewise.
2248 (Parse_module): Likewise.
2250 2017-06-21 Alan Modra <amodra@gmail.com>
2252 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2253 calls before tocsave calls.
2254 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2257 2017-06-21 Nick Clifton <nickc@redhat.com>
2260 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2261 bfd_get_full_section_contents returns no contents.
2263 2017-06-21 Nick Clifton <nickc@redhat.com>
2266 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2269 2017-06-21 Nick Clifton <nickc@redhat.com>
2272 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2274 (image_set_ptr): Likewise.
2275 (alpha_vms_fix_sec_rel): Likewise.
2276 (alpha_vms_slurp_relocs): Likewise.
2278 2017-06-21 Nick Clifton <nickc@redhat.com>
2281 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2283 (ieee_archive_p): Likewise.
2284 (ieee_object_p): Likewise.
2286 2017-06-21 Nick Clifton <nickc@redhat.com>
2289 * elf.c (setup_group): Zero the group section pointer list after
2290 allocation so that loops can be caught. Check for NULL pointers
2291 when processing a group list.
2293 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2295 * elf-s390.h: New file.
2296 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2298 (elf_s390_additional_program_headers): New function.
2299 (elf_s390_modify_segment_map): New function.
2300 (bfd_elf_s390_set_options): New function.
2301 (elf_backend_additional_program_headers)
2302 (elf_backend_modify_segment_map): Add macro definitions.
2304 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2307 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2308 the DYNAMIC bit instead of bfd_count_sections.
2310 2017-06-19 Nick Clifton <nickc@redhat.com>
2313 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2315 (evax_bfd_print_eeom): Likewise.
2316 (evax_bfd_print_egsd): Check for an overlarge record length.
2317 (evax_bfd_print_etir): Likewise.
2319 2017-06-19 Nick Clifton <nickc@redhat.com>
2322 * libieee.h (struct common_header_type): Add end_p field.
2323 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2325 (read_id): Check for a length that exceeds the remaining bytes in
2327 (ieee_seek): Initialise end_p.
2328 (ieee_archive_p): Likewise.
2329 (ieee_object_p): Likewise.
2331 2017-06-19 Nick Clifton <nickc@redhat.com>
2334 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2335 before reading the EIHS structure entries.
2337 2017-06-19 Nick Clifton <nickc@redhat.com>
2340 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2341 gsd_size. Check that there are enough bytes remaining to read the
2342 type and size of the next egsd. Check that the size of the egsd
2343 does not exceed the size of the record.
2345 2017-06-19 Alan Modra <amodra@gmail.com>
2347 * config.bfd: Correct targ_underscore for cris.
2349 2017-06-18 Alan Modra <amodra@gmail.com>
2351 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2352 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2354 2017-06-16 Nick Clifton <nickc@redhat.com>
2356 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2357 bucketlist is empty because there are no symbols to add to the
2360 2017-06-16 Alan Modra <amodra@gmail.com>
2366 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2367 (BFD_JUMP_TABLE_LINK): Likewise.
2368 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2369 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2370 (bfd_elf_define_start_stop): New function.
2371 * linker.c (bfd_generic_define_start_stop): New function.
2372 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2374 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2375 * aout-target.h (MY_bfd_define_start_stop): Define.
2376 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2377 * binary.c (binary_bfd_define_start_stop): Define.
2378 * bout.c (b_out_bfd_define_start_stop): Define.
2379 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2380 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2381 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2382 * coffcode.h (coff_bfd_define_start_stop): Define.
2383 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2384 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2385 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2386 * ieee.c (ieee_bfd_define_start_stop): Define.
2387 * ihex.c (ihex_bfd_define_start_stop): Define.
2388 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2389 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2390 * mmo.c (mmo_bfd_define_start_stop): Define.
2391 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2392 * oasys.c (oasys_bfd_define_start_stop): Define.
2393 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2394 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2395 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2396 * som.c (som_bfd_define_start_stop): Define.
2397 * srec.c (srec_bfd_define_start_stop): Define.
2398 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2399 * versados.c (versados_bfd_define_start_stop): Define.
2400 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2401 (alpha_vms_bfd_define_start_stop): Define.
2402 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2403 * bfd-in2.h: Regenerate.
2404 * libbfd.h: Regenerate.
2406 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2408 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2409 SYMBOL_REFERENCES_LOCAL.
2411 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2414 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2415 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2416 runtime for if there needs copy relocation elimination.
2417 (need_copy_relocation_p): New function. Return true for symbol with
2418 pc-relative references and if it's against read-only sections.
2419 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2420 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2421 that are related with accessing external objects.
2422 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2423 in elfNN_aarch64_check_relocs.
2425 2017-06-15 Nick Clifton <nickc@redhat.com>
2428 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2431 (ieee_archive_p): Likewise.
2433 2017-06-15 Nick Clifton <nickc@redhat.com>
2436 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2438 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2440 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2441 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2442 keep both windowed and call0 ABI PLT definitions.
2443 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2444 elf_xtensa_*_plt_entry endex.
2445 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2447 2017-06-14 Nick Clifton <nickc@redhat.com>
2450 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2453 2017-06-14 Nick Clifton <nickc@redhat.com>
2456 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2457 maximum value for the ascic pointer. Check that name processing
2458 does not read beyond this value.
2459 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2462 2017-06-14 Nick Clifton <nickc@redhat.com>
2465 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2466 (process_otr): Check for an invalid offset in the otr structure.
2468 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2470 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2472 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2478 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2479 vtable field to a union.
2480 (_bfd_elf_is_start_stop): Removed.
2481 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2482 __start_SECNAME and __stop_SECNAME symbols.
2483 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2484 * elflink.c (_bfd_elf_is_start_stop): Removed.
2485 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2486 _bfd_elf_is_start_stop.
2487 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2488 __stop_SECNAME symbols. Updated.
2489 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2490 (bfd_elf_gc_record_vtinherit): Likewise.
2491 (bfd_elf_gc_record_vtentry): Likewise.
2493 2017-06-13 Nick Clifton <nickc@redhat.com>
2496 * elflink.c (elf_link_adjust_relocs): Generate an error when
2497 encountering a reloc against a symbol removed by garbage
2500 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2502 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2503 to merge_gnu_properties.
2504 * elf-properties.c (elf_merge_gnu_properties): Add struct
2505 bfd_link_info * and pass it to merge_gnu_properties.
2506 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2507 and pass it to elf_merge_gnu_properties.
2508 (_bfd_elf_link_setup_gnu_properties): Pass info to
2509 elf_merge_gnu_property_list.
2510 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2512 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2514 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2517 * binary.c (binary_set_section_contents): Scale lma by octets
2518 per byte to set filepos.
2520 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2522 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2525 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2527 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2530 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2532 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2533 patched section contents for TLS IE reloc.
2534 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2536 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2538 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2539 RELOC_FOR_GLOBAL_SYMBOL macro.
2541 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2543 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2546 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2548 * config/tc-arc.c (md_undefined_symbol): Changed.
2549 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2551 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2553 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2556 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2558 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2559 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2561 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2563 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2566 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2568 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2569 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2570 is non-zero. Add clarifying comments.
2572 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2574 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2575 name. Use local IFUNC symbol name string to report unsupported
2576 non-PIC call to IFUNC function.
2577 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2578 when generating R_386_IRELATIVE relocation.
2579 (elf_i386_finish_dynamic_symbol): Likewise.
2580 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2582 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2583 when generating R_X86_64_IRELATIVE relocation.
2584 (elf_x86_64_finish_dynamic_symbol): Likewise.
2586 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2588 * elf.c (setup_group): Make sure BFD sections are created for all
2589 group sections in the input file when processing SHF_GROUP
2591 (bfd_section_from_shdr): Avoid duplicating logic already
2592 implemented in `setup_group'.
2594 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2597 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2598 if the hint address is zero.
2600 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2603 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2604 ELF_COMMON_DEF_P for common symbols.
2606 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2608 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2609 SEC_GROUP sections as SEC_EXCLUDE.
2610 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2611 (assign_section_numbers): Use resolve_section_groups flag instead
2612 of relocatable link type.
2613 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2614 flag instead of checking the final_link flag for part of the
2615 checks in here. Fix white space as a result.
2616 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2617 instead of relocatable link type.
2618 (bfd_elf_final_link): Likewise.
2620 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2622 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2624 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2625 (s3_bfd_score_elf_check_relocs): Likewise.
2626 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2627 (score_elf_final_link_relocate): Likewise.
2628 (s7_bfd_score_elf_check_relocs): Likewise.
2630 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2632 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2635 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2637 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2638 from `reloc_count' rather than decrementing it.
2639 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2640 `reloc_count' by `int_rels_per_ext_rel'.
2641 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2642 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2643 entry determination.
2644 (s3_bfd_score_elf_check_relocs): Likewise.
2645 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2646 (s7_bfd_score_elf_relocate_section): Likewise.
2647 (s7_bfd_score_elf_check_relocs): Likewise.
2648 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2649 prototype and function.
2650 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2651 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2652 triple rather than once the sum of REL and RELA relocation entry
2654 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2655 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2656 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2657 storage allocation size determination.
2658 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2659 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2660 by `int_rels_per_ext_rel' for last relocation entry
2662 (bfd_elf_final_link): Do not multiply `reloc_count' by
2663 `int_rels_per_ext_rel' for internal relocation storage
2664 allocation size determination.
2665 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2666 `int_rels_per_ext_rel' for last relocation entry determination.
2667 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2668 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2669 (_bfd_mips_elf_relocate_section): Likewise.
2671 2017-06-05 Alan Modra <amodra@gmail.com>
2674 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2676 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2678 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2679 determine structure sizes.
2680 (elfcore_grok_freebsd_prstatus): Likewise.
2682 2017-06-01 Alan Modra <amodra@gmail.com>
2684 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2685 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2687 (is_elfv2_localentry0): New function.
2688 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2689 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2690 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2691 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2692 optimized localentry:0 stubs.
2693 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2694 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2696 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2698 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2700 2017-05-30 Casey Smith <clegg89@gmail.com>
2703 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2704 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2706 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2708 * cpu-arc.c (arc_compatible): New function.
2710 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2712 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2714 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2717 * bfdio.c (bfd_get_file_size): New function.
2718 * bfd-in2.h: Regenerated.
2720 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2722 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2725 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2727 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2728 dynobj instead of htab->elf.dynobj.
2730 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2732 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2734 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2735 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2736 actual number of internal relocations retrieved. Adjust
2737 function description.
2738 (bfd_elf64_canonicalize_reloc): Remove macro.
2739 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2741 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2743 * archures.c (bfd_mach_sparc_v9m8): Define.
2744 (bfd_mach_sparc_v8plusm8): Likewise.
2745 (bfd_mach_sparc_v9_p): Adjust to M8.
2746 (bfd_mach_sparc_64bit_p): Likewise.
2747 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2748 bfd_mach_sparc_v8plusm8.
2749 * bfd-in2.h: Regenerated.
2750 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2752 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2753 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2754 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2756 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2757 bfd_mach_sparc_v8plusm8.
2759 2017-05-19 Alan Modra <amodra@gmail.com>
2761 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2762 debug and special sections when no non-note alloc sections in an
2765 2017-05-18 Alan Modra <amodra@gmail.com>
2767 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2768 * elf-m10300.c: Likewise.
2770 * elf32-arc.c: Likewise.
2771 * elf32-bfin.c: Likewise.
2772 * elf32-m68k.c: Likewise.
2773 * elf32-nds32.c: Likewise.
2774 * elf32-tilepro.c: Likewise.
2775 * elflink.c: Likewise.
2776 * elfnn-aarch64.c: Likewise.
2777 * elfnn-riscv.c: Likewise.
2778 * elfxx-tilegx.c: Likewise.
2779 * mach-o.c: Likewise.
2780 * peXXigen.c: Likewise.
2781 * vms-alpha.c: Likewise.
2782 * vms-lib.c: Likewise.
2784 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2787 * elflink.c (elf_gc_mark_debug_section): New function.
2788 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2789 referenced by kept debug sections.
2791 2017-05-16 Alan Modra <amodra@gmail.com>
2793 * elf-m10300.c: Rename occurrences of non_ir_ref.
2794 * elf32-arm.c: Likewise.
2795 * elf32-bfin.c: Likewise.
2796 * elf32-cr16.c: Likewise.
2797 * elf32-cris.c: Likewise.
2798 * elf32-d10v.c: Likewise.
2799 * elf32-dlx.c: Likewise.
2800 * elf32-fr30.c: Likewise.
2801 * elf32-frv.c: Likewise.
2802 * elf32-hppa.c: Likewise.
2803 * elf32-i370.c: Likewise.
2804 * elf32-i386.c: Likewise.
2805 * elf32-iq2000.c: Likewise.
2806 * elf32-lm32.c: Likewise.
2807 * elf32-m32c.c: Likewise.
2808 * elf32-m32r.c: Likewise.
2809 * elf32-m68hc1x.c: Likewise.
2810 * elf32-m68k.c: Likewise.
2811 * elf32-mcore.c: Likewise.
2812 * elf32-metag.c: Likewise.
2813 * elf32-microblaze.c: Likewise.
2814 * elf32-moxie.c: Likewise.
2815 * elf32-msp430.c: Likewise.
2816 * elf32-mt.c: Likewise.
2817 * elf32-nios2.c: Likewise.
2818 * elf32-or1k.c: Likewise.
2819 * elf32-ppc.c: Likewise.
2820 * elf32-rl78.c: Likewise.
2821 * elf32-s390.c: Likewise.
2822 * elf32-score.c: Likewise.
2823 * elf32-score7.c: Likewise.
2824 * elf32-sh.c: Likewise.
2825 * elf32-tic6x.c: Likewise.
2826 * elf32-tilepro.c: Likewise.
2827 * elf32-v850.c: Likewise.
2828 * elf32-vax.c: Likewise.
2829 * elf32-xstormy16.c: Likewise.
2830 * elf32-xtensa.c: Likewise.
2831 * elf64-alpha.c: Likewise.
2832 * elf64-hppa.c: Likewise.
2833 * elf64-ia64-vms.c: Likewise.
2834 * elf64-mmix.c: Likewise.
2835 * elf64-ppc.c: Likewise.
2836 * elf64-s390.c: Likewise.
2837 * elf64-sh64.c: Likewise.
2838 * elf64-x86-64.c: Likewise.
2839 * elflink.c: Likewise.
2840 * elfnn-aarch64.c: Likewise.
2841 * elfnn-ia64.c: Likewise.
2842 * elfnn-riscv.c: Likewise.
2843 * elfxx-mips.c: Likewise.
2844 * elfxx-sparc.c: Likewise.
2845 * elfxx-tilegx.c: Likewise.
2846 * linker.c: Likewise.
2848 2017-05-16 Alan Modra <amodra@gmail.com>
2850 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2851 * elflink.c (elf_link_add_object_symbols): Update to use
2853 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2855 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2857 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2859 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2861 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2863 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2864 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2866 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2868 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2870 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2872 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2873 to plt_second/plt_second_eh_frame.
2874 (elf_x86_64_link_hash_newfunc): Updated.
2875 (elf_x86_64_allocate_dynrelocs): Likewise.
2876 (elf_x86_64_size_dynamic_sections): Likewise.
2877 (elf_x86_64_relocate_section): Likewise.
2878 (elf_x86_64_finish_dynamic_symbol): Likewise.
2879 (elf_x86_64_finish_dynamic_sections): Likewise.
2880 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2881 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2883 (elf_backend_setup_gnu_properties): Updated. Create the
2884 .plt.sec section instead of the .plt.sec section.
2886 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2888 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2889 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2890 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2892 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2894 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2895 (bfd_elf64_set_reloc): Define.
2896 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2898 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2900 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2901 (struct bfd_target): New field _bfd_set_reloc.
2902 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2903 * reloc.c (_bfd_generic_set_reloc): New function.
2904 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2905 * nlm-target.h (nlm_set_reloc): Likewise.
2906 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2907 * aout-tic30.c (MY_set_reloc): Likewise.
2908 * aout-target.h (MY_set_reloc): Likewise.
2909 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2910 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2911 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2912 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2913 * aout-adobe.c (aout_32_set_reloc): Likewise.
2914 * bout.c (b_out_set_reloc): Likewise.
2915 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2916 * i386os9k.c (aout_32_set_reloc): Likewise.
2917 * ieee.c (ieee_set_reloc): Likewise.
2918 * oasys.c (oasys_set_reloc): Likewise.
2919 * som.c (som_set_reloc): Likewise.
2920 * versados.c (versados_set_reloc): Likewise.
2921 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2922 _bfd_generic_set_reloc.
2923 (rs6000_xcoff64_aix_vec): LIkewise.
2924 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2925 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2926 * i386msdos.c (msdos_set_reloc): Define to
2927 _bfd_norelocs_set_reloc.
2928 * elfcode.h (elf_set_reloc): Define.
2929 * bfd-in2.h: Regenerated.
2931 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2934 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2935 for IFUNC function address.
2937 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2939 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2940 (CONFLICT_LIST): Likewise.
2941 (opcode/arc-attrs.h): Include.
2942 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2943 (arc_extract_features): New file.
2944 (arc_stralloc): Likewise.
2945 (arc_elf_merge_attributes): Likewise.
2946 (arc_elf_merge_private_bfd_data): Use object attributes.
2947 (bfd_arc_get_mach_from_attributes): New function.
2948 (arc_elf_object_p): Use object attributes.
2949 (arc_elf_final_write_processing): Likewise.
2950 (elf32_arc_obj_attrs_arg_type): New function.
2951 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2952 (elf32_arc_section_from_shdr): Likewise.
2953 (elf_backend_obj_attrs_vendor): Define.
2954 (elf_backend_obj_attrs_section): Likewise.
2955 (elf_backend_obj_attrs_arg_type): Likewise.
2956 (elf_backend_obj_attrs_section_type): Likewise.
2957 (elf_backend_obj_attrs_handle_unknown): Likewise.
2958 (elf_backend_section_from_shdr): Likewise.
2960 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2963 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2964 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2965 and the destination is a Thumb symbol.
2967 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2969 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2970 initializer to silence GCC 4.2.
2971 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2973 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2975 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2976 (LAZY_PLT_ENTRY_SIZE): This.
2977 (NON_LAZY_PLT_ENTRY_SIZE): New.
2978 (elf_x86_64_plt0_entry): Renamed to ...
2979 (elf_x86_64_lazy_plt0_entry): This.
2980 (elf_x86_64_plt_entry): Renamed to ...
2981 (elf_x86_64_lazy_plt_entry): This.
2982 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2983 (elf_x86_64_lazy_bnd_plt0_entry): This.
2984 (elf_x86_64_legacy_plt_entry): Removed.
2985 (elf_x86_64_bnd_plt_entry): Renamed to ...
2986 (elf_x86_64_lazy_bnd_plt_entry): This.
2987 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2988 (elf_x86_64_non_lazy_plt_entry): This.
2989 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2990 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2991 (elf_x86_64_eh_frame_plt): Renamed to ...
2992 (elf_x86_64_eh_frame_lazy_plt): This.
2993 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2994 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2995 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2996 (elf_x86_64_eh_frame_non_lazy_plt): This.
2997 (elf_x86_64_lazy_plt_layout): New.
2998 (elf_x86_64_non_lazy_plt_layout): Likewise.
2999 (elf_x86_64_plt_layout): Likewise.
3000 (elf_x86_64_backend_data): Remove PLT layout information. Add
3001 os for target system.
3002 (GET_PLT_ENTRY_SIZE): Removed.
3003 (elf_x86_64_lazy_plt): New.
3004 (elf_x86_64_non_lazy_plt): Likewise.
3005 (elf_x86_64_lazy_bnd_plt): Likewise.
3006 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3007 (elf_x86-64_arch_bed): Updated.
3008 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3009 (elf_x86_64_create_dynamic_sections): Removed.
3010 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3011 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3012 (elf_x86-64_adjust_dynamic_symbol): Updated.
3013 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3014 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3015 size for PLT0 if there is no PLT0. Get plt_entry_size from
3016 non_lazy_plt for non-lazy PLT entries.
3017 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3018 from non_lazy_plt for non-lazy PLT entries.
3019 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3020 if there is no PLT0.
3021 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3022 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3023 entries with non-lazy PLT layout. Don't fill the second and third
3024 slots in the PLT entry if there is no PLT0.
3025 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3026 if there is no PLT0. Set sh_entsize on the .plt.got section.
3027 (compare_relocs): New.
3028 (elf_x86_64_plt_type): Likewise.
3029 (elf_x86_64_plt): Likewise.
3030 (elf_x86_64_nacl_plt): New. Forward declaration.
3031 (elf_x86_64_get_plt_sym_val): Removed.
3032 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3033 against all dynamic relocations.
3034 (elf_x86_64_link_setup_gnu_properties): New function.
3035 (elf_backend_create_dynamic_sections): Updated.
3036 (elf_backend_setup_gnu_properties): New.
3037 (elf_x86_64_nacl_plt): New.
3038 (elf_x86_64_nacl_arch_bed): Updated.
3040 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3042 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3043 (LAZY_PLT_ENTRY_SIZE): This.
3044 (NON_LAZY_PLT_ENTRY_SIZE): New.
3045 (elf_i386_plt0_entry): Renamed to ...
3046 (elf_i386_lazy_plt0_entry): This.
3047 (elf_i386_plt_entry): Renamed to ...
3048 (elf_i386_lazy_plt_entry): This.
3049 (elf_i386_pic_plt0_entry): Renamed to ...
3050 (elf_i386_pic_lazy_plt0_entry): This.
3051 (elf_i386_pic_plt_entry): Renamed to ...
3052 (elf_i386_pic_lazy_plt_entry): This.
3053 (elf_i386_got_plt_entry): Renamed to ...
3054 (elf_i386_non_lazy_plt_entry): This.
3055 (elf_i386_pic_got_plt_entry): Renamed to ...
3056 (elf_i386_pic_non_lazy_plt_entry): This.
3057 (elf_i386_eh_frame_plt): Renamed to ...
3058 (elf_i386_eh_frame_lazy_plt): This.
3059 (elf_i386_eh_frame_plt_got): Renamed to ...
3060 (elf_i386_eh_frame_non_lazy_plt): This.
3061 (elf_i386_plt_layout): Renamed to ...
3062 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3063 eh_frame_plt_got_size.
3064 (elf_i386_non_lazy_plt_layout): New.
3065 (elf_i386_plt_layout): Likewise.
3066 (elf_i386_non_lazy_plt): Likewise.
3067 (GET_PLT_ENTRY_SIZE): Removed.
3068 (elf_i386_plt): Renamed to ...
3069 (elf_i386_lazy_plt): This.
3070 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3071 (elf_i386_arch_bed): Updated.
3072 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3073 (elf_i386_create_dynamic_sections): Removed.
3074 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3075 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3076 (elf_i386_adjust_dynamic_symbol): Updated.
3077 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3078 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3079 size for PLT0 if there is no PLT0.
3080 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3081 output section is discarded only if GOT isn't empty.
3082 (elf_i386_relocate_section): Updated. Properly get PLT index
3083 if there is no PLT0.
3084 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3085 second and third slots in the PLT entry if there is no PLT0.
3086 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3087 if there is no PLT0. Set sh_entsize on the .plt.got section.
3088 (elf_i386_nacl_plt): Forward declaration.
3089 (elf_i386_get_plt_sym_val): Removed.
3090 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3091 against all dynamic relocations.
3092 (elf_i386_link_setup_gnu_properties): New function.
3093 (elf_backend_create_dynamic_sections): Updated.
3094 (elf_backend_setup_gnu_properties): New.
3095 (elf_i386_nacl_plt): Updated.
3096 (elf_i386_nacl_arch_bed): Likewise.
3097 (elf_i386_vxworks_arch_bed): Likewise.
3099 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3101 * elflink.c (elf_output_implib): Remove executable flag from import
3103 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3104 library is a relocatable object file.
3106 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3109 * elf32-avr.c (avr_should_move_sym): New function.
3110 (avr_should_reduce_sym_size): Likewise.
3111 (avr_should_increase_sym_size): Likewise.
3112 (elf32_avr_relax_delete_bytes): Adjust symbol values
3113 and sizes by calling new functions.
3115 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3117 * config.bfd (riscv32-*): Enable rv64.
3119 2017-05-02 Alan Modra <amodra@gmail.com>
3122 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3123 rather than h->root.type == bfd_link_hash_new.
3124 (bfd_elf_record_link_assignment): Similarly, call
3125 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3127 2017-04-29 Alan Modra <amodra@gmail.com>
3130 * reloc.c (reloc_offset_in_range): New function.
3131 (bfd_perform_relocation, bfd_install_relocation): Use it.
3132 (_bfd_final_link_relocate): Likewise.
3134 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3136 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3137 before using .plt.got.
3138 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3140 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3142 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3143 instead of "+=" to update 0.
3145 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3147 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3148 .plt.got section here.
3149 (elf_i386_check_relocs): Don't create the .plt.got section.
3150 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3151 the .plt.got and .plt.bnd sections here.
3152 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3155 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3157 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3159 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3160 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3161 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3162 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3165 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3167 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3169 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3170 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3171 the first relocatable ELF input with GNU properties.
3173 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3175 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3176 VxWorks for non-PIC.
3178 2017-04-27 Alan Modra <amodra@gmail.com>
3180 * elf-bfd.h (struct elf_backend_data): Make asection param of
3181 elf_backend_eh_frame_address_size const.
3182 (_bfd_elf_eh_frame_address_size): Likewise.
3183 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3184 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3185 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3186 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3187 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3188 (next_cie_fde_offset): Constify params.
3189 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3191 2017-04-27 Alan Modra <amodra@gmail.com>
3193 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3194 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3195 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3197 (offset_adjust): New function.
3198 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3199 (adjust_eh_frame_local_symbols): Likewise.
3200 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3201 after changing anything. Return true if anything changed.
3202 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3203 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3205 2017-04-27 Alan Modra <amodra@gmail.com>
3207 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3210 2017-04-27 Alan Modra <amodra@gmail.com>
3212 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3213 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3214 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3215 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3216 for undef and undefweak dyn_relocs.
3217 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3218 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3219 (allocate_got, allocate_dynrelocs): Likewise.
3220 (ppc64_elf_relocate_section): Likewise.
3222 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3224 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3225 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3226 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3227 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3229 2017-04-26 Nick Clifton <nickc@redhat.com>
3232 * reloc.c (bfd_perform_relocation): Check for a negative address
3235 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3238 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3240 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3241 (elf_backend_always_renumber_dynsyms): Define.
3242 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3243 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3244 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3245 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3247 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3249 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3251 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3252 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3253 sections have been created.
3255 2017-04-26 Nick Clifton <nickc@redhat.com>
3258 * compress.c (bfd_init_section_compress_status): Check the return
3259 value from bfd_malloc.
3261 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3263 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3264 no_finish_dynamic_symbol.
3265 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3267 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3268 weak symbol, don't make it dynamic.
3269 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3270 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3271 relocation for GOT reference.
3272 (elf_x86_64_finish_dynamic_symbol): Abort if
3273 no_finish_dynamic_symbol isn't 0.
3275 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3278 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3279 undefined weak symbol, don't make it dynamic.
3280 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3281 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3282 relocation for R_386_GOT32.
3284 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3287 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3289 2017-04-23 Alan Modra <amodra@gmail.com>
3292 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3293 * elf.c (lcomm_sym): New.
3294 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3295 * bfd-in2.h: Regenerate.
3297 2017-04-23 Alan Modra <amodra@gmail.com>
3300 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3301 parameters and comment.
3302 (_bfd_elf_get_reloc_section): Delete.
3303 (_bfd_elf_plt_get_reloc_section): Declare.
3304 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3305 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3307 (_bfd_elf_get_reloc_section): ..here. Delete.
3308 (assign_section_numbers): Call elf_get_reloc_section.
3309 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3310 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3312 2017-04-23 Alan Modra <amodra@gmail.com>
3315 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3318 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3321 * elf32-i386.c (elf_i386_link_hash_entry): Add
3322 no_finish_dynamic_symbol.
3323 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3324 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3325 symbol, don't make it dynamic in PIE.
3326 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3327 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3328 relocation for R_386_GOT32
3329 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3332 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3336 * elflink.c (elf_link_add_object_symbols): Require
3337 --no-dynamic-linker with -E/--dynamic-list when creating
3340 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3342 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3345 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3347 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3348 dynamic symbol sorting.
3350 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3353 * elflink.c (elf_link_add_object_symbols): Preserve
3354 dynamic_ref_after_ir_def when restoring the symbol table for
3355 unneeded dynamic object.
3357 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3360 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3361 on on undefined IFUNC symbol in the second PLT.
3363 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3365 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3367 2017-04-19 Alan Modra <amodra@gmail.com>
3369 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3370 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3371 * elf32-ppc.c:Formatting.
3372 (ensure_undefweak_dynamic): Don't make dynamic when
3373 info->dynamic_undefined_weak is zero.
3374 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3375 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3376 not default visibility. Discard undef and undefweak
3378 (ppc_elf_relocate_section): Adjust to suit.
3379 * elf64-ppc.c: Formatting.
3380 (ensure_undefweak_dynamic): Don't make dynamic when
3381 info->dynamic_undefined_weak is zero.
3382 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3383 info->dynamic_undefined_weak. Discard them earlier.
3385 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3388 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3389 before generating the version definition section.
3391 2017-04-17 Alan Modra <amodra@gmail.com>
3393 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3394 state when a regular object file defines a symbol with
3395 incompatible type to that defined by an earlier shared lib.
3397 2017-04-13 Alan Modra <amodra@gmail.com>
3399 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3401 * elf32-arm.c: Likewise.
3402 * elf32-i386.c: Likewise.
3403 * elf32-mep.c: Likewise.
3404 * elf64-ia64-vms.c: Likewise.
3405 * elf64-x86-64.c: Likewise.
3406 * elflink.c: Likewise.
3407 * elfnn-ia64.c: Likewise.
3408 * elfxx-mips.c: Likewise.
3410 2017-04-13 Alan Modra <amodra@gmail.com>
3412 * aoutx.h: Use %B and %A in error messages throughout file.
3413 * aout-cris.c: Likewise.
3414 * archive.c: Likewise.
3415 * binary.c: Likewise.
3416 * coff-rs6000.c: Likewise.
3417 * coff-tic4x.c: Likewise.
3418 * coffcode.h: Likewise.
3419 * coffgen.c: Likewise.
3420 * cofflink.c: Likewise.
3421 * coffswap.h: Likewise.
3422 * cpu-arm.c: Likewise.
3423 * elf-eh-frame.c: Likewise.
3424 * elf-m10300.c: Likewise.
3426 * elf32-arc.c: Likewise.
3427 * elf32-arm.c: Likewise.
3428 * elf32-bfin.c: Likewise.
3429 * elf32-frv.c: Likewise.
3430 * elf32-iq2000.c: Likewise.
3431 * elf32-m32c.c: Likewise.
3432 * elf32-microblaze.c: Likewise.
3433 * elf32-nds32.c: Likewise.
3434 * elf32-rl78.c: Likewise.
3435 * elf32-rx.c: Likewise.
3436 * elf32-score.c: Likewise.
3437 * elf32-score7.c: Likewise.
3438 * elf32-sh64.c: Likewise.
3439 * elf32-v850.c: Likewise.
3440 * elf32-vax.c: Likewise.
3441 * elf32-visium.c: Likewise.
3442 * elf64-ia64-vms.c: Likewise.
3443 * elf64-mmix.c: Likewise.
3444 * elf64-sh64.c: Likewise.
3445 * elfcode.h: Likewise.
3446 * elfnn-aarch64.c: Likewise.
3447 * elfnn-ia64.c: Likewise.
3448 * elfxx-mips.c: Likewise.
3449 * hpux-core.c: Likewise.
3452 * linker.c: Likewise.
3453 * merge.c: Likewise.
3455 * oasys.c: Likewise.
3456 * pdp11.c: Likewise.
3457 * peXXigen.c: Likewise.
3458 * rs6000-core.c: Likewise.
3459 * vms-alpha.c: Likewise.
3460 * xcofflink.c: Likewise.
3462 2017-04-13 Alan Modra <amodra@gmail.com>
3464 * bfd.c (PRINT_TYPE): Define.
3465 (_doprnt): New function.
3466 (error_handler_internal): Use _doprnt.
3467 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3468 calls in their natural order, throughout file.
3469 * coff-mcore.c: Likewise.
3470 * coff-ppc.c: Likewise.
3471 * coff-tic80.c: Likewise.
3472 * cofflink.c: Likewise.
3473 * elf-s390-common.c: Likewise.
3475 * elf32-arm.c: Likewise.
3476 * elf32-i386.c: Likewise.
3477 * elf32-m32r.c: Likewise.
3478 * elf32-msp430.c: Likewise.
3479 * elf32-spu.c: Likewise.
3480 * elf64-ia64-vms.c: Likewise.
3481 * elf64-sparc.c: Likewise.
3482 * elf64-x86-64.c: Likewise.
3483 * elflink.c: Likewise.
3484 * elfnn-aarch64.c: Likewise.
3485 * elfnn-ia64.c: Likewise.
3486 * elfxx-mips.c: Likewise.
3488 2017-04-13 Alan Modra <amodra@gmail.com>
3490 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3491 branch veneers" error. Fix double space and format message.
3492 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3493 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3495 2017-04-13 Alan Modra <amodra@gmail.com>
3497 * bfd-in2.h: Regenerate.
3499 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3501 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3502 extra `\n' in warning/error messages.
3503 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3504 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3506 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3508 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3509 processor-specific properties with generic ELF target vector.
3511 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3513 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3514 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3515 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3516 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3518 (link_hash_newfunc): Initialize has_got_reloc and
3520 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3522 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3524 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3526 (_bfd_sparc_elf_fixup_symbol): New function.
3527 (allocate_dynrelocs): Don't allocate space for dynamic
3528 relocations and discard relocations against resolved undefined
3529 weak symbols in executable. Don't make resolved undefined weak
3530 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3531 relocation against undefined weak symbols in PIE.
3532 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3533 relocations against resolved undefined weak symbols in PIE
3534 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3535 without ynamic PLT/GOT relocations for resolved undefined weak
3537 Don't generate dynamic relocation against resolved undefined
3538 weak symbol in executable.
3539 (pie_finish_undefweak_symbol): New function.
3540 (_bfd_sparc_elf_finish_dynamic_sections): Call
3541 pie_finish_undefweak_symbol on all symbols in PIE.
3542 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3543 (_bfd_sparc_elf_fixup_symbol): New function.
3545 2017-04-10 Nick Clifton <nickc@redhat.com>
3547 * config.bfd: Remove ns32k from obsolete list.
3549 2017-04-10 Alan Modra <amodra@gmail.com>
3552 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3553 (special_sections_i): Likewise for .init_array.
3554 (special_sections_p): Likewise for .preinit_array.
3556 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3560 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3561 ELF_COMMON_DEF_P for common symbols.
3562 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3563 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3564 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3565 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3566 07492f668d2173da7a2bda3707ff0985e0f460b6.
3568 2017-04-07 Pedro Alves <palves@redhat.com>
3570 * opncls.c (bfd_get_debug_link_info): Rename to...
3571 (bfd_get_debug_link_info_1): ... this. Change type of second
3572 parameter to void pointer. Adjust.
3573 (bfd_get_debug_link_info): Reimplement on top of
3574 bfd_get_debug_link_info_1.
3575 (separate_debug_file_exists, separate_alt_debug_file_exists):
3576 Change type of second parameter to void pointer. Adjust.
3577 (get_func_type, check_func_type): Change type of second parameter
3579 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3580 the callback functions instead of passing the address of a local.
3581 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3582 find_separate_debug_file.
3583 (get_alt_debug_link_info_shim): Change type of second parameter to
3584 void pointer. Adjust.
3585 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3586 find_separate_debug_file.
3587 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3588 of second parameter to void pointer. Adjust.
3589 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3590 pointer local to find_separate_debug_file.
3592 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3594 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3595 external symbols with a definition.
3596 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3598 2017-04-07 Alan Modra <amodra@gmail.com>
3600 * po/SRC-POTFILES.in: Regenerate.
3602 2017-04-05 Alan Modra <amodra@gmail.com>
3604 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3607 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3609 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3610 numbers for DataDirectory entry indicies passed to
3613 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3615 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3616 each GNU_MBIND section and align GNU_MBIND section to page size.
3617 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3618 segment for each GNU_MBIND section.
3619 (_bfd_elf_init_private_section_data): Copy sh_info from input
3620 for GNU_MBIND section.
3622 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3624 * elfnn-riscv.c (GP_NAME): Delete.
3625 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3626 (_bfd_riscv_relax_lui): Likewise.
3628 2017-04-04 Nick Clifton <nickc@redhat.com>
3631 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3633 (bfd_elf_final_link): Only initialize the extended symbol index
3634 section if there are extended symbol tables to list.
3636 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3638 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3639 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3640 * configure.ac (elf): Add elf-properties.lo.
3641 * Makefile.in: Regenerated.
3642 * configure: Likewise.
3643 * elf-bfd.h (elf_property_kind): New.
3644 (elf_property): Likewise.
3645 (elf_property_list): Likewise.
3646 (elf_properties): Likewise.
3647 (_bfd_elf_parse_gnu_properties): Likewise.
3648 (_bfd_elf_get_property): Likewise.
3649 (_bfd_elf_link_setup_gnu_properties): Likewise.
3650 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3651 and setup_gnu_properties.
3652 (elf_obj_tdata): Add properties.
3653 * elf-properties.c: New file.
3654 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3655 (elf_i386_merge_gnu_properties): Likewise.
3656 (elf_backend_parse_gnu_properties): Likewise.
3657 (elf_backend_merge_gnu_properties): Likewise.
3658 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3659 (elf_x86_64_merge_gnu_properties): Likewise.
3660 (elf_backend_parse_gnu_properties): Likewise.
3661 (elf_backend_merge_gnu_properties): Likewise.
3662 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3663 (elf_backend_parse_gnu_properties): Likewise.
3664 (elf_backend_setup_gnu_properties): Likewise.
3665 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3666 elf_backend_merge_gnu_properties and
3667 elf_backend_setup_gnu_properties.
3669 2017-03-30 Pip Cet <pipcet@gmail.com>
3671 * elf32-wasm32.c: Add relocation code, two relocs.
3672 * reloc.c: Add wasm32 relocations.
3673 * libbfd.h: Regenerate.
3674 * bfd-in2.h: Regenerate.
3675 * bfd/po/bfd.pot: Regenerate.
3677 2017-03-29 Nick Clifton <nickc@redhat.com>
3680 * coff-bfd.h (struct coff_section_data): Add new fields:
3681 saved_bias and bias.
3682 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3683 computed for PE binaries.
3684 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3687 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3690 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3691 to handle a local symbol with a hash-symbol-entry; without PLT.
3692 Add BFD_ASSERT for an incidental case with GOT entry present.
3693 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3694 isn't forced-or-set local.
3696 2017-03-27 Pip Cet <pipcet@gmail.com>
3698 * wasm-module.c: New file to support WebAssembly modules.
3699 * wasm-module.h: New file to support WebAssembly modules.
3700 * doc/webassembly.texi: Start documenting wasm-module.c.
3701 * config.bfd: Add wasm_vec.
3702 * targets.c: Likewise.
3703 * configure.ac: Likewise.
3704 * Makefile.am: Add entries for wasm-module.c.
3705 * Makefile.in: Regenerate.
3706 * configure: Regenerate.
3707 * po/SRC-POTFILES.in: Regenerate.
3709 2017-03-27 Pip Cet <pipcet@gmail.com>
3711 * cpu-wasm32.c: New file to support wasm32 architecture.
3712 * elf32-wasm32.c: New file to support wasm32 architecture.
3713 * Makefile.am: Add wasm32 architecture.
3714 * archures.c: Likewise.
3715 * config.bfd: Likewise.
3716 * configure.ac: Likewise.
3717 * targets.c: Likewise.
3718 * Makefile.in: Regenerate.
3719 * bfd-in2.h: Regenerate.
3720 * configure: Regenerate.
3721 * po/SRC-POTFILES.in: Regenerate.
3723 2017-03-20 Alan Modra <amodra@gmail.com>
3726 * elf64-ppc.c (compare_symbols): Stabilize sort.
3728 2017-03-18 Alan Modra <amodra@gmail.com>
3730 * elf64-ppc.c (struct ppc_link_hash_table): Add
3731 local_ifunc_resolver and maybe_local_ifunc_resolver.
3732 (ppc_build_one_stub): Set flags on emitting dynamic
3733 relocation to ifunc.
3734 (ppc64_elf_relocate_section): Likewise.
3735 (ppc64_elf_finish_dynamic_symbol): Likewise.
3736 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3737 local dynamic relocs to ifuncs.
3738 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3739 local_ifunc_resolver and maybe_local_ifunc_resolver.
3740 (ppc_elf_relocate_section): Set flag on emitting dynamic
3741 relocation to ifuncs.
3742 (ppc_elf_finish_dynamic_symbol): Likewise.
3743 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3744 dynamic relocs to ifuncs.
3746 2017-03-13 Nick Clifton <nickc@redhat.com>
3749 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3750 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3751 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3752 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3753 * bfd-in2.h: Regenerate.
3754 * libbfd.h: Regenerate.
3755 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3757 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3758 (elfNN_aarch64_howto_table): Likewise.
3759 (aarch64_tls_transition_without_check): Likewise.
3760 (aarch64_reloc_got_type): Likewise.
3761 (elfNN_aarch64_final_link_relocate): Likewise.
3762 (elfNN_aarch64_tls_relax): Likewise.
3763 (elfNN_aarch64_relocate_section): Likewise.
3764 (elfNN_aarch64_gc_sweep_hook): Likewise.
3765 (elfNN_aarch64_check_relocs): Likewise.
3766 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3767 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3769 2017-03-11 Alan Modra <amodra@gmail.com>
3771 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3772 parameter is in fact used. Whitespace fixes.
3773 * elf64-ppc.c: Likewise.
3775 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3777 * rs6000-core.c (CORE_NEW): Simplify macro when
3778 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3780 2017-03-07 Alan Modra <amodra@gmail.com>
3784 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3787 2017-03-05 Alan Modra <amodra@gmail.com>
3789 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3790 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3791 (next_cie_fde_offset): New function.
3792 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3793 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3794 four bytes. Align CIEs to four or eight bytes depending on
3795 per_encoding_aligned8. Align FDEs according to their encoding.
3796 Pad last FDE to output section alignment.
3797 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3799 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3800 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3801 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3803 2017-03-02 Martin Bickel <binutils@ineranves.de>
3806 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3807 empty segments which have a zero filesz, but a non-zero memsz.
3809 2017-03-02 Alan Modra <amodra@gmail.com>
3811 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3813 2017-02-28 Alan Modra <amodra@gmail.com>
3815 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3816 (ppc64_elf_relocate_section): Likewise.
3818 2017-02-28 Alan Modra <amodra@gmail.com>
3821 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3822 rather than elf32_nios2_hash_table or elf_hash_table.
3823 (create_got_section): Likewise.
3824 (nios2_elf32_finish_dynamic_symbol): Likewise.
3825 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3826 (nios2_elf32_size_dynamic_sections): Likewise.
3827 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3828 vars. Use htab equivalents directly instead. Don't create
3829 all dynamic sections on needing just the GOT. Use a goto
3830 rather than a fall-through with reloc test. Ensure
3831 htab->dynobj is set when making dynamic sreloc section.
3832 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3833 equivalent directly instead. Don't segfault on looking for
3834 .dynamic when dynamic sections have not been created. Don't
3835 segfault on .got.plt being discarded.
3836 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3837 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3838 fixme and another not so relevant comment.
3839 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3840 already set, set hash table dynobj on creating .sbss.
3842 2017-02-28 Alan Modra <amodra@gmail.com>
3844 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3845 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3846 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3847 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3848 (ppc64_elf_relocate_section): Likewise.
3849 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3850 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3851 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3852 * libbfd.h: Regenerate.
3853 * bfd-in2.h: Regenerate.
3855 2017-02-28 Alan Modra <amodra@gmail.com>
3857 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3858 dynamic .data.rel.ro read-only.
3859 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3860 rather than section flags when deciding where copy reloc goes.
3861 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3862 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3863 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3864 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3865 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3866 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3867 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3868 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3869 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3870 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3871 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3872 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3873 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3874 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3875 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3876 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3877 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3878 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3879 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3881 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3883 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3884 `jalr $0, $25' instruction encoding.
3886 2017-02-27 Nick Clifton <nickc@redhat.com>
3889 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3890 generating a seg-fault when encountering a symbol that has been
3891 deleted by garbage collection.
3893 2017-02-25 Alan Modra <amodra@gmail.com>
3895 * elf32-arc.c (struct dynamic_sections): Delete.
3896 (enum dyn_section_types): Delete.
3897 (dyn_section_names): Delete.
3898 (arc_create_dynamic_sections): Delete.
3899 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3900 segfault on discarded .rela.plt section.
3901 (elf_arc_size_dynamic_sections): Formatting. Don't call
3902 arc_create_dynamic_sections. Don't allocate memory for sections
3903 handled by the generic linker. Correct code finding relocs in
3904 read-only sections. Set SEC_EXCLUDE on zero size .got,
3905 .got.plt, and .dynbss sections. Do set .interp for pies.
3907 2017-02-24 Andrew Waterman <andrew@sifive.com>
3909 * elfnn-riscv.c (GP_NAME): New macro.
3910 (riscv_global_pointer_value): Use it.
3911 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3912 output section, consider only that section's alignment.
3914 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3916 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3917 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3918 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3919 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3921 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3923 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3924 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3927 2017-02-23 Alan Modra <amodra@gmail.com>
3930 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3932 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3933 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3936 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3939 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3940 processing ahead of the call to `elf_gc_sweep_symbol'.
3942 2017-02-22 Nick Clifton <nickc@redhat.com>
3945 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3946 created section 4-byte alignment.
3948 2017-02-22 Alan Modra <amodra@gmail.com>
3950 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3951 on .got or .plt output section being discarded by script.
3952 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3955 2017-02-21 Alan Modra <amodra@gmail.com>
3957 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3958 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3960 2017-02-20 Alan Modra <amodra@gmail.com>
3963 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3964 if DT_RELSZ/DT_RELASZ is zero.
3966 2017-02-17 Nick Clifton <nickc@redhat.com>
3968 * compress.c (bfd_get_full_section_contents): Remember to reduce
3969 compressed size by the sizeof the compression header when
3970 decompressing the contents.
3972 2017-02-17 Pedro Alves <palves@redhat.com>
3974 * srec.c (Chunk): Rename to ...
3975 (_bfd_srec_len): ... this.
3976 (S3Forced): Rename to ...
3977 (_bfd_srec_forceS3): ... this.
3978 * objcopy.c: Adjust all references.
3980 2017-02-17 Pedro Alves <palves@redhat.com>
3982 * archive.c (bsd_write_armap): Rename to ...
3983 (_bfd_bsd_write_armap): ... this.
3984 (coff_write_armap): Rename to ...
3985 (_bfd_coff_write_armap): ... this.
3986 * libbfd-in.h (bsd_write_armap): Rename to ...
3987 (_bfd_bsd_write_armap): ... this.
3988 (coff_write_armap): Rename to ...
3989 (_bfd_coff_write_armap): ... this.
3990 * aout-target.h, aout-tic30.c: Adjust all users.
3991 * libbfd.h: Regenerate.
3993 2017-02-17 Pedro Alves <palves@redhat.com>
3995 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3996 (warn_deprecated): Rename to ...
3997 (_bfd_warn_deprecated): ... this.
3998 * libbfd.c (warn_deprecated): Rename to ...
3999 (_bfd_warn_deprecated): ... this.
4000 * bfd-in2.h: Regenerate.
4002 2017-02-17 Pedro Alves <palves@redhat.com>
4004 * bfdio.c (real_ftell): Rename to ...
4005 (_bfd_real_ftell): ... this.
4006 (real_fseek): Rename to ...
4007 (_bfd_real_fseek): ... this.
4008 (real_fopen): Rename to ...
4009 (_bfd_real_fopen): ... this.
4010 * libbfd-in.h (real_ftell): Rename to ...
4011 (_bfd_real_ftell): ... this.
4012 (real_fseek): Rename to ...
4013 (_bfd_real_fseek): ... this.
4014 (real_fopen): Rename to ...
4015 (_bfd_real_fopen): ... this.
4016 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4017 * libbfd.h: Regenerate.
4019 2017-02-17 Pedro Alves <palves@redhat.com>
4021 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4022 * libbfd.c (read_unsigned_leb128): Rename to ...
4023 (_bfd_read_unsigned_leb128): ... this.
4024 (read_signed_leb128): Rename to ...
4025 (_bfd_read_signed_leb128): ... this.
4026 (safe_read_leb128): Rename to ...
4027 (_bfd_safe_read_leb128): ... this.
4028 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4029 (_bfd_read_unsigned_leb128): ... this.
4030 (read_signed_leb128): Rename to ...
4031 (_bfd_read_signed_leb128): ... this.
4032 (safe_read_leb128): Rename to ...
4033 (_bfd_safe_read_leb128): ... this.
4034 * libbfd.h: Renegerate.
4036 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4038 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4039 before trying to fine matching file and line information.
4041 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4043 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4044 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4045 not match current bfd, then reload debug information. Record bfd
4046 we're loading debug info for in the stash. If we have debug
4047 informatin in the cache then perform section placement before
4050 2017-02-16 Alan Modra <amodra@gmail.com>
4053 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4054 * elfxx-target.h (elf_backend_no_page_alias): Define.
4055 (elfNN_bed): Init new field.
4056 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4057 ensure PT_LOAD segment starts on a new page.
4058 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4060 2017-02-16 Alan Modra <amodra@gmail.com>
4063 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4066 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4068 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4069 * bfd-in2.h: Regenerated.
4071 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4074 * elf32-i386.c (elf_i386_relocate_section): Allow
4075 "lea foo@GOT, %reg" in PIC.
4077 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4080 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4081 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4082 error against local IFUNC symbol without a base register for
4085 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4087 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4088 `%P: %H:' with `info->callbacks->einfo'.
4089 (ppc_elf_relocate_section): Likewise.
4090 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4091 (ppc64_elf_edit_toc): Likewise.
4092 (ppc64_elf_relocate_section): Likewise.
4094 2017-02-14 Alan Modra <amodra@gmail.com>
4096 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4097 --gc-keep-exported, and test versioned field of sym rather than
4098 looking for @ in name.
4100 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4102 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4105 2017-02-13 Nick Clifton <nickc@redhat.com>
4108 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4111 2017-02-07 Andrew Waterman <andrew@sifive.com>
4113 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4114 entry size if PLT header is written.
4116 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4118 Fix sparc64 dynamic relocation processing to use the dynamic
4120 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4121 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4124 2017-02-03 Nick Clifton <nickc@redhat.com>
4127 * coffcode.h (coff_write_object_contents): Enlarge size of
4128 s_name_buf in order to avoid compile time warning about possible
4130 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4131 32-bits of insn value before printing into buffer.
4133 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4135 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4136 `max_local_dynindx'.
4137 (mips_elf_sort_hash_table): Handle it.
4138 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4139 symbols bump up `max_local_dynindx' rather than
4140 `max_non_got_dynindx'.
4142 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4144 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4145 `min_got_dynindx', `max_unref_got_dynindx' and
4146 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4147 (mips_elf_sort_hash_table): Adjust accordingly.
4149 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4151 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4152 to access the hash table.
4154 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4156 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4157 non-NULL `htab' to the beginning.
4159 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4161 * elflink.c (elf_gc_sweep): Wrap overlong line.
4163 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4165 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4166 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4167 * elfxx-mips.c (mips_elf_link_hash_table): Add
4168 `ignore_branch_isa' member.
4169 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4170 in branch relocation calculation as an error if
4171 `ignore_branch_isa' has been set.
4172 (_bfd_mips_elf_insn32): Rename to...
4173 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4174 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4175 Handle the new parameter.
4177 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4179 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4180 local variable dynobj.
4183 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4184 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4185 executable from read-only sections into sdynrelro.
4186 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4187 dynamic relocs in sdynrelro.
4188 (elf_backend_want_dynrelro): Define.
4190 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4192 * config.bfd (*-*-rtemsaout*): Mark as removed.
4194 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4196 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4197 (arm-*-rtems*): Move to (arm*-*-eabi*).
4198 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4199 (m68-*-rtems*): Move to (m68*-*-elf*).
4201 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4203 * config.bfd (*-*-rtemscoff*): Mark as removed.
4205 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4208 * elflink.c (bfd_elf_record_link_assignment): Revert last
4209 change and don't ever clear `forced_local'. Set `mark'
4211 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4213 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4214 (bfd_elf_size_dynamic_sections): ... here.
4215 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4216 and set `mark' instead in `__tls_get_addr_opt' processing.
4217 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4219 2017-01-24 Alan Modra <amodra@gmail.com>
4221 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4222 where dynamic relocs are preferable. Allow ifunc too.
4223 (ensure_undefweak_dynamic): New function.
4224 (allocate_dynrelocs): Use it here. Move plt handling last and
4225 don't make symbols dynamic, simplifying loop. Only make undef
4226 weak symbols with GOT entries dynamic. Correct condition
4227 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4228 comments. Remove goto.
4229 (ppc_elf_relocate_section): Correct test for using dynamic
4230 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4231 to suit. Set up explicit tls_index entries and implicit GOT
4232 tls_index entries resolvable at link time for
4233 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4234 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4235 (ensure_undefweak_dynamic): New function.
4236 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4237 with GOT entries dynamic. Remove unnecessary test of
4238 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4239 (ppc64_elf_relocate_section): Correct test for using dynamic
4240 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4241 to suit. Set up explicit tls_index entries and implicit GOT
4242 tls_index entries resolvable at link time for __tls_get_addr_opt.
4243 Simplify expression to clear mem for prelink.
4245 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4247 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4249 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4251 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4252 (elf_backend_hash_symbol): Define.
4254 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4257 * elflink.c (bfd_elf_record_link_assignment): Clear any
4258 `forced_local' marking for DSO symbols that are not being
4261 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4263 * elfnn-riscv.c (riscv_elf_object_p): New function.
4265 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4268 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4270 (elf_x86_64_check_relocs): Create .eh_frame section for the
4272 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4273 .eh_frame section for the .plt.bnd section.
4274 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4275 for the .plt.bnd section.
4277 2017-01-12 Nick Clifton <nickc@redhat.com>
4280 * opncls.c (find_separate_debug_file): Add include_dirs
4281 parameter. Only include the directory part of the bfd's filename
4282 in search paths if include_dirs is true. Add a couple of extra
4283 locations for looking for debug files.
4284 ( bfd_follow_gnu_debuglink): Update invocation of
4285 find_separate_debug_file.
4286 (bfd_follow_gnu_debugaltlink): Likewise.
4287 (get_build_id): New function: Finds the build-id of the given bfd.
4288 (get_build_id_name): New function: Computes the name of the
4289 separate debug info file for a bfd, based upon its build-id.
4290 (check_build_id_file): New function: Checks to see if a separate
4291 debug info file exists at the given location, and that its
4292 build-id matches that of the original bfd.
4293 (bfd_follow_build_id_debuglink): New function: Finds a separate
4294 debug info file for a given bfd by using the build-id method.
4295 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4296 method of locating a separate debug info file before using the
4298 * bfd-in2.h: Regenerate.
4300 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4303 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4304 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4305 elf_x86_64_eh_frame_plt_got.
4306 (elf_x86_64_size_dynamic_sections): Get unwind info from
4307 elf_x86_64_bnd_arch_bed for the BND PLT.
4309 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4311 * config.bfd: Add entries for i686-redox and x86_64-redox.
4313 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4315 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4317 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4318 .eh_frame section to 4 bytes for x32.
4319 (elf_x86_64_check_relocs): Likewise.
4321 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4324 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4325 (PLT_GOT_FDE_LENGTH): Likewise.
4326 (elf_i386_plt_layout): Add eh_frame_plt_got and
4327 eh_frame_plt_got_size.
4328 (elf_i386_plt): Updated.
4329 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4330 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4331 (elf_i386_size_dynamic_sections): Allocate and initialize
4332 .eh_frame section for .plt.got.
4333 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4335 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4336 eh_frame_plt_got_size.
4337 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4338 (PLT_GOT_FDE_LENGTH): Likewise.
4339 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4340 eh_frame_plt_got_size.
4341 (elf_x86_64_arch_bed): Updated.
4342 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4343 eh_frame_plt_got_size.
4344 (elf_x86_64_nacl_arch_bed): Likewise.
4345 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4346 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4347 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4348 .eh_frame section for .plt.got.
4349 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4352 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4354 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4355 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4357 2017-01-09 Nick Clifton <nickc@redhat.com>
4359 * dwarf2.c (lookup_address_in_function_table): Return early if
4360 there are no functions in the given comp unit, or if the high
4361 address of the last function in the comp unit is less than the
4364 2017-01-09 Nick Clifton <nickc@redhat.com>
4367 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4368 message if there are too many symbols to load.
4370 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4372 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4373 if relocs are cached.
4375 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4378 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4379 for R_MICROBLAZE_GOTOFF_64.
4381 2017-01-03 Nick Clifton <nickc@redhat.com>
4383 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4384 warning about using a possibly uninitialised variable.
4386 2017-01-02 Alan Modra <amodra@gmail.com>
4388 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4389 (allocate_plt_static, allocate_dynrelocs): Use it.
4391 2017-01-02 Alan Modra <amodra@gmail.com>
4393 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4394 .PARISC.unwind section.
4396 2017-01-02 Alan Modra <amodra@gmail.com>
4399 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4400 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4401 indirect to GOT pointer relative code edit.
4403 2017-01-02 Alan Modra <amodra@gmail.com>
4405 Update year range in copyright notice of all files.
4407 For older changes see ChangeLog-2016
4409 Copyright (C) 2017 Free Software Foundation, Inc.
4411 Copying and distribution of this file, with or without modification,
4412 are permitted in any medium without royalty provided the copyright
4413 notice and this notice are preserved.
4419 version-control: never