1 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
3 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
6 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
8 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
9 .interp section with "ld --no-dynamic-linker".
11 2017-10-09 Alan Modra <amodra@gmail.com>
14 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
15 funcinfo_hash_table and varinfo_hash_table.
17 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
19 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
20 in read-only section with minfo.
21 (sh_elf_size_dynamic_sections): Likewise.
23 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
25 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
28 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
30 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
31 this_hdr.sh_entsize only if section size > 0.
33 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
35 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
37 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
39 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
40 in read-only section with minfo.
41 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
43 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
45 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
48 2017-10-06 John Baldwin <jhb@FreeBSD.org>
50 * elf-bfd.h (struct elf_backend_data): Add
51 `elf_backend_grok_freebsd_prstatus'.
52 * elf.c (elfcore_grok_freebsd_note): Call
53 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
55 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
57 (elf_backend_grok_freebsd_prstatus): Define.
58 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
59 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
61 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
63 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
64 and has_non_got_reloc with zero_undefweak.
65 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
66 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
68 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
69 has_non_got_reloc with zero_undefweak.
70 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
71 has_got_reloc and has_non_got_reloc with zero_undefweak.
72 (elf_x86_link_hash_entry): Likewise.
74 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
76 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
77 (VERIFY_COPY_RELOC): Likewise.
79 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
81 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
82 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
83 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
85 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
87 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
88 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
89 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
91 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
93 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
94 * elf32-i386.c (elf_i386_relocate_section): Use it.
95 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
97 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
99 * elf32-i386.c (X86_SIZE_TYPE_P): New.
100 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
101 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
102 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
103 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
105 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
107 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
108 (PLT_LOCAL_IFUNC_P): Likewise.
109 * elf32-i386.c (elf_i386_relocate_section): Use them.
110 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
112 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
114 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
115 * elf32-i386.c (elf_i386_relocate_section): Use it.
116 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
118 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
120 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
121 * elf32-i386.c (elf_i386_relocate_section): Use it.
122 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
124 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
126 * elf32-i386.c (X86_PCREL_TYPE_P): New.
127 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
128 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
129 (X86_PCREL_TYPE_P): This.
130 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
131 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
132 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
134 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
136 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
138 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
139 * elf32-i386.c (elf_i386_tls_transition): Use it.
140 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
142 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
144 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
145 Dump dynamic relocation in read-only section with minfo if
147 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
148 (maybe_set_textrel): Likewise.
149 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
150 read-only section with minfo.
152 2017-10-05 John Baldwin <jhb@FreeBSD.org>
154 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
156 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
158 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
159 in read-only section with minfo.
160 (tilepro_elf_size_dynamic_sections): Likewise.
161 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
162 (tilegx_elf_size_dynamic_sections): Likewise.
164 2017-10-05 Pedro Alves <palves@redhat.com>
167 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
168 ellipsis parameter. Split out bfd_error_on_input code to..
169 (bfd_set_input_error): .. New function.
170 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
171 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
172 * bfd-in2.h: Regenerate.
174 2017-10-05 Alan Modra <amodra@gmail.com>
176 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
177 fini_array error value.
179 2017-10-05 Alan Modra <amodra@gmail.com>
182 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
184 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
186 (elf_fake_sections): Adjust calls. Exit immediately on failure.
187 (bfd_elf_set_group_contents): Add associated reloc section indices
190 2017-10-04 Alan Modra <amodra@gmail.com>
192 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
193 classify symbols for ELFv2.
195 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
198 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
199 undergoes default promotion.
200 * bfd-in2.h: Regenerate.
202 2017-10-02 Alan Modra <amodra@gmail.com>
204 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
205 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
207 2017-10-01 Alan Modra <amodra@gmail.com>
210 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
211 (add_line_info): Always put end_sequence last.
213 2017-10-01 Alan Modra <amodra@gmail.com>
216 * dwarf2.c (read_section): Allocate buffer with extra byte for
217 bfd_simple_get_relocated_section_contents rather than copying
220 2017-09-29 Alan Modra <amodra@gmail.com>
222 * merge.c (merge_strings): Return FALSE on malloc failure.
223 (_bfd_merge_sections): Return failures from record_section and
226 2017-09-28 Alan Modra <amodra@gmail.com>
229 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
230 a case where plugin_notice isn't called.
232 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
234 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
237 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
240 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
241 output_bfd to info->callbacks->minfo.
243 2017-09-26 Nick Clifton <nickc@redhat.com>
246 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
247 assertion failure if elf_x86_64_rtype_to_howto has already issued
250 2017-09-26 Alan Modra <amodra@gmail.com>
253 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
256 2017-09-26 Nick Clifton <nickc@redhat.com>
259 * dwarf2.c (read_formatted_entries): Fail early if we know that
260 the loop parsing data entries will overflow the end of the
263 2017-09-26 Alan Modra <amodra@gmail.com>
266 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
267 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
268 to stash->info_ptr_memory, and check die_ref is within that memory.
269 Set info_ptr_end correctly when another CU is refd. Check die_ref
270 for DW_FORM_ref4 etc. is within CU.
272 2017-09-26 Alan Modra <amodra@gmail.com>
275 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
276 (read_formatted_entries): Init "fe".
277 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
279 2017-09-26 Alan Modra <amodra@gmail.com>
282 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
283 bounds in inner loop.
285 2017-09-25 Alan Modra <amodra@gmail.com>
288 * dwarf1.c (parse_die): Sanity check pointer against section limit
289 before dereferencing.
290 (parse_line_table): Likewise.
292 2017-09-25 Alan Modra <amodra@gmail.com>
295 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
297 (parse_comp_unit): Likewise.
299 2017-09-25 Alan Modra <amodra@gmail.com>
302 * dwarf2.c (read_formatted_entries): Error on format_count zero.
304 2017-09-24 Alan Modra <amodra@gmail.com>
307 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
308 within section bounds.
310 2017-09-24 Alan Modra <amodra@gmail.com>
313 * dwarf2.c (decode_line_info): Properly free line sequences on error.
315 2017-09-24 Alan Modra <amodra@gmail.com>
318 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
319 pname param. Return status. Make name const. Don't abort,
320 return an error. Formatting. Exit if current info_ptr matches
321 orig_info_ptr. Update callers.
322 (scan_unit_for_symbols): Start at nesting_level of zero. Make
323 nested_funcs an array of structs for extensibility. Formatting.
325 2017-09-24 Alan Modra <amodra@gmail.com>
328 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
329 rather than dividing by zero.
331 2017-09-24 Alan Modra <amodra@gmail.com>
334 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
336 2017-09-24 Alan Modra <amodra@gmail.com>
339 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
341 2017-09-24 Alan Modra <amodra@gmail.com>
344 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
345 SHT_GNU_verneed section for sanity. Don't zalloc memory for
348 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
351 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
354 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
357 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
358 -1 if bfd_canonicalize_dynamic_reloc returns 0.
360 2017-09-22 Pedro Alves <palves@redhat.com>
361 Alan Modra <amodra@gmail.com>
363 * version.h: Add comment.
365 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
367 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
368 NT_S390_GS_BC, correct the previously swapped invocations of
369 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
371 2017-09-19 Alan Modra <amodra@gmail.com>
374 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
377 2017-09-19 Alan Modra <amodra@gmail.com>
380 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
381 symbols before calculating verrefs. Don't renumber dynsyms
382 after gc. Exclude .gnu.version when zero or one dynsym.
383 Localize some vars and reindent.
385 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
388 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
389 return from bfd_canonicalize_dynamic_reloc.
391 2017-09-15 Alan Modra <amodra@gmail.com>
394 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
395 overflows bfd_size_type.
397 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
400 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
401 to indicate if conversion is performed.
402 (elf_i386_check_relocs): Cache section contents and relocations
403 if conversion is performed.
404 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
405 contents and relocations if conversion is performed.
407 2017-09-14 Nick Clifton <nickc@redhat.com>
410 * peXXigen.c (pe_print_idata): Extend check for HintName vector
413 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
415 * elfxx-x86.h: Fix a typo in comments.
417 2017-09-09 Kamil Rytarowski <n54@gmx.com>
419 * elf32-nds32.c: Rename __BIT() to N32_BIT().
421 2017-09-09 Alan Modra <amodra@gmail.com>
423 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
426 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
428 * elf32-i386.c (elf_i386_relocate_section): Update usage of
429 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
430 (elf_i386_finish_dynamic_symbol): Likewise.
431 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
432 (elf_x86_64_finish_dynamic_symbol): Likewise.
433 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
434 (_bfd_x86_elf_fixup_symbol): Likewise.
436 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
438 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
439 check has_non_got_reloc.
441 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
444 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
445 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
446 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
447 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
448 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
449 and linker_def on __ehdr_start if it is referenced and not
451 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
452 and return TRUE when building executable, if a symbol has
453 non-GOT/non-PLT relocations in text section or there is no
455 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
457 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
459 * elfxx-x86.h: Update comments.
461 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
463 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
464 elf_x86_plt_layout_table with elf_x86_init_table.
465 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
467 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
469 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
470 (elf_x86_init_table): This.
471 (_bfd_x86_elf_link_setup_gnu_properties): Replace
472 elf_x86_plt_layout_table with elf_x86_init_table.
474 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
476 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
477 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
478 * configure: Regenerated.
479 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
480 and r_sym fields of plt_layout.
481 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
483 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
484 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
485 r_info nor r_sym fields.
486 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
488 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
490 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
492 * (_bfd_riscv_relax_align): Call bfd_set_error and
493 print an error message when unable to relax a .align directive.
495 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
497 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
498 (riscv_record_pcrel_hi_reloc): Add absolute argument.
499 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
500 R_RISCV_PCREL_HI20 relocs, and pass the result to
501 riscv_record_pcrel_hi_reloc.
503 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
505 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
506 r_type_p. Remove the converted argument. Replace
507 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
508 the new relocation type via r_type_p.
509 (elf_i386_relocate_section): Likewise.
510 (elf_i386_finish_dynamic_symbol): Likewise.
511 (need_convert_load): Removed.
512 (check_relocs_failed): Updated.
513 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
514 instead of setting need_convert_load.
515 (_bfd_i386_elf_convert_load): Removed.
516 * elf64-x86-64.c (need_convert_load): Removed.
517 (check_relocs_failed): Updated.
518 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
519 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
520 Return the new relocation type via r_type_p.
521 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
522 instead of setting need_convert_load.
523 (elf_x86_64_check_relocs): Don't check PIC if relocation has
525 (_bfd_x86_64_elf_convert_load): Removed.
526 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
527 with SYMBOL_REFERENCES_LOCAL_P.
528 (elf_x86_64_finish_dynamic_symbol): Likewise.
529 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
531 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
532 (_bfd_x86_elf_link_symbol_references_local): New function.
533 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
534 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
535 SYMBOL_REFERENCES_LOCAL_P.
536 (elf_x86_link_hash_entry): Add local_ref.
537 (elf_x86_link_hash_table): Remove convert_load.
538 (_bfd_i386_elf_convert_load): Removed.
539 (_bfd_x86_64_elf_convert_load): Likewise.
540 (_bfd_x86_elf_link_symbol_references_local): New.
542 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
544 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
545 (elf_x86_64_info_to_howto): Get the real relocation type by
546 masking out R_X86_64_converted_reloc_bit.
547 (elf_x86_64_check_tls_transition): Get the real relocation type
548 by masking out R_X86_64_converted_reloc_bit.
549 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
550 instead of setting converted_reloc.
551 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
552 instead of converted_reloc. Get the real relocation type by
553 masking out R_X86_64_converted_reloc_bit.
554 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
555 R_X86_64_converted_reloc_bit is valid.
556 * elfxx-x86.h (converted_reloc): Removed.
558 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
560 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
561 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
562 to get the relocation type again.
563 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
564 r_type when calling elf_x86_64_tls_transition. Don't use
565 ELF32_R_TYPE to get the relocation type again.
567 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
569 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
572 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
574 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
575 argument. Don't check relocation overflow. Avoid relocation
576 overflow if --no-relax is used. Set converted_reloc on symbol
577 if a GOTPCREL relocation is converted.
578 (elf_x86_64_relocate_section): Issue a fatal error and suggest
579 --no-relax if GOTPCREL relocation conversion leads to relocation
581 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
583 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
584 Edmar Wienskoski <edmar.wienskoski@nxp.com
586 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
587 (ppc_elf_check_relocs): Handle it.
588 (ppc_elf_vle_split20): New function.
589 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
591 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
594 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
595 for x86-64 if GOT_TLS_GDESC_P is true.
597 2017-09-03 Alan Modra <amodra@gmail.com>
600 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
602 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
604 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
605 tls_get_addr for x86-64 in one place.
607 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
609 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
610 with elfxx-x86.lo for 64-bit BFD.
611 * configure: Regenerated.
613 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
615 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
616 (_bfd_i386_elf_convert_load): This. Remove static.
617 (elf_i386_size_dynamic_sections): Removed.
618 (elf_backend_size_dynamic_sections): Likewise.
619 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
620 (_bfd_x86_64_elf_convert_load): This. Remove static.
621 (elf_x86_64_size_dynamic_sections): Removed.
622 (elf_backend_size_dynamic_sections): Likewise.
623 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
624 (elf_x86_allocate_dynrelocs): This. Make it static.
625 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
626 (elf_x86_allocate_local_dynreloc): This. Make it static.
627 (elf_i386_is_reloc_section): New function.
628 (elf_x86_64_is_reloc_section): Likewise.
629 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
630 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
631 Rearrange got_entry_size initialization.
632 (_bfd_x86_elf_size_dynamic_sections): New function.
633 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
634 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
635 (_bfd_i386_elf_convert_load): New.
636 (_bfd_x86_64_elf_convert_load): Likewise.
637 (_bfd_x86_elf_size_dynamic_sections): Likewise.
638 (elf_backend_size_dynamic_sections): Likewise.
639 (_bfd_x86_elf_allocate_dynrelocs): Removed.
640 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
642 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
644 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
647 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
649 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
650 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
652 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
654 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
655 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
656 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
657 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
658 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
659 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
661 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
663 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
664 (elf_i386_allocate_local_dynrelocs): Likewise.
665 (elf_i386_size_dynamic_sections): Replace
666 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
667 with _bfd_x86_elf_allocate_dynrelocs and
668 _bfd_x86_elf_allocate_local_dynrelocs.
669 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
670 (elf_x86_64_allocate_local_dynrelocs): Likewise.
671 (elf_x86_64_size_dynamic_sections): Replace
672 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
673 with _bfd_x86_elf_allocate_dynrelocs and
674 _bfd_x86_elf_allocate_local_dynrelocs.
675 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
676 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
677 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
678 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
680 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
682 * elf32-i386.c (is_i386_elf): Removed.
683 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
684 (elf_i386_size_dynamic_sections): Likewise.
685 (elf_i386_relocate_section): Likewise.
686 * elf64-x86-64.c (is_x86_64_elf): Removed.
687 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
689 (elf_x86_64_size_dynamic_sections): Likewise.
690 (elf_x86_64_relocate_section): Likewise.
691 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
693 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
696 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
698 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
699 (elf_i386_allocate_dynrelocs): Replace
700 elf_i386_compute_jump_table_size with
701 elf_x86_compute_jump_table_size.
702 (elf_i386_size_dynamic_sections): Likewise.
703 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
704 (elf_x86_64_allocate_dynrelocs): Replace
705 elf_x86_64_compute_jump_table_size with
706 elf_x86_compute_jump_table_size.
707 (elf_x86_64_size_dynamic_sections): Likewise.
708 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
710 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
711 (elf_x86_compute_jump_table_size): New.
713 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
715 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
717 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
718 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
720 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
722 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
723 with htab->is_vxworks.
724 (elf_i386_size_dynamic_sections): Likewise.
725 (elf_i386_relocate_section): Likewise.
726 (elf_i386_finish_dynamic_symbol): Likewise.
727 (elf_i386_finish_dynamic_sections): Likewise.
729 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
731 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
732 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
733 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
734 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
735 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
736 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
737 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
738 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
740 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
743 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
744 ELF_COMMON_DEF_P for common symbols.
746 2017-09-02 Alan Modra <amodra@gmail.com>
748 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
749 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
750 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
752 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
754 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
755 (elf_backend_gc_mark_hook): Likewise.
756 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
757 (elf_backend_gc_mark_hook): Likewise.
758 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
759 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
760 (elf_backend_gc_mark_hook): Likewise.
762 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
764 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
765 (elf_backend_adjust_dynamic_symbol): Likewise.
766 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
767 (elf_backend_adjust_dynamic_symbol): Likewise.
768 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
769 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
770 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
771 (_bfd_x86_elf_adjust_dynamic_symbol): New.
772 (elf_backend_adjust_dynamic_symbol): Likewise.
774 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
776 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
779 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
781 * elf32-i386.c (elf_i386_mkobject): Removed.
782 (bfd_elf32_mkobject): Likewise.
783 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
784 (bfd_elf64_mkobject): Likewise.
785 (bfd_elf32_mkobject): Likewise.
786 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
787 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
788 (bfd_elf64_mkobject): Likewise.
789 (bfd_elf32_mkobject): Likewise.
791 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
793 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
794 Call _bfd_x86_elf_link_setup_gnu_properties.
795 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
796 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
798 (elf_x86_64_non_lazy_plt): Likewise.
799 (elf_x86_64_lazy_bnd_plt): Likewise.
800 (elf_x86_64_non_lazy_bnd_plt): Likewise.
801 (elf_x86_64_lazy_ibt_plt): Likewise.
802 (elf_x32_lazy_ibt_plt): Likewise.
803 (elf_x86_64_non_lazy_ibt_plt): Likewise.
804 (elf_x32_non_lazy_ibt_plt): Likewise.
805 (elf_x86_64_nacl_plt): Likewise.
806 (elf_x86_64_link_setup_gnu_properties): Updated. Call
807 _bfd_x86_elf_link_setup_gnu_properties.
808 * elfxx-x86.c: Include elf-vxworks.h".
809 (_bfd_x86_elf_link_setup_gnu_properties): New function.
810 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
811 comments for pic_plt0_entry and pic_plt_entry.
812 (elf_x86_non_lazy_plt_layout): Likewise.
813 (elf_x86_plt_layout_table): New.
814 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
816 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
819 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
820 .eh_frame section for the second PLT.
821 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
822 alignment of .eh_frame section for the second PLT.
824 2017-09-01 Nick Clifton <nickc@redhat.com>
827 * dwarf2.c (decode_line_info): Fix test for an overlong line info
830 2017-09-01 Nick Clifton <nickc@redhat.com>
833 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
834 attribute buffer is NUL terminated.
836 2017-08-31 Nick Clifton <nickc@redhat.com>
839 * dwarf2.c (read_section): If necessary add a terminating NUL byte
840 to dwarf string sections.
842 2017-08-31 Alan Modra <amodra@gmail.com>
844 * po/SRC-POTFILES.in: Regenerate.
846 2017-08-31 Alan Modra <amodra@gmail.com>
848 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
849 for a section containing just a terminator. Allow multiple
850 terminators at end of section.
851 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
852 sections when not adding alignment. Assert on terminator in
855 2017-08-31 Alan Modra <amodra@gmail.com>
859 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
862 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
864 * configure.ac (bfd_backends): Add elf64.lo together with
865 elfxx-x86.lo for 64-bit BFD.
866 * configure: Regenerated.
868 2017-08-31 James Bowman <james.bowman@ftdichip.com>
870 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
873 2017-08-31 Alan Modra <amodra@gmail.com>
876 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
877 before _close_and_cleanup. Call iovec->bclose after.
878 (bfd_close): Remove code common to, and call, bfd_close_all_done.
880 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
882 * elf32-i386.c (elf_i386_plt_type): Removed.
883 (elf_i386_plt): Likewise.
884 (elf_i386_get_synthetic_symtab): Updated. Call
885 _bfd_x86_elf_get_synthetic_symtab.
886 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
887 (elf_x86_64_plt): Likewise.
888 (elf_x86_64_get_synthetic_symtab): Updated. Call
889 _bfd_x86_elf_get_synthetic_symtab.
890 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
891 (elf_x86_64_get_plt_got_vma): Likewise.
892 (elf_i386_valid_plt_reloc_p): Likewise.
893 (elf_x86_64_valid_plt_reloc_p): Likewise.
894 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
895 * elfxx-x86.h (elf_x86_plt_type): New.
896 (elf_x86_plt): Likewise.
897 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
899 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
901 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
902 target_id instead of elf_machine_code.
904 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
906 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
907 (elf_i386_lazy_plt_layout): Likewise.
908 (elf_i386_non_lazy_plt_layout): Likewise.
909 (elf_i386_plt_layout): Likewise.
910 (elf_i386_link_hash_table): Likewise.
911 (elf_i386_next_tls_desc_index): Likewise.
912 (elf_i386_srelplt2): Likewise.
913 (elf_i386_plt): Likewise.
914 (elf_i386_lazy_plt): Likewise.
915 (elf_i386_non_lazy_plt): Likewise.
916 (elf_i386_link_hash_table_create): Likewise.
917 (bfd_elf32_bfd_link_hash_table_create): Likewise.
918 (elf_i386_lazy_plt): Updated.
919 (elf_i386_non_lazy_plt): Likewise.
920 (elf_i386_lazy_ibt_plt): Likewise.
921 (elf_i386_non_lazy_ibt_plt): Likewise.
922 (elf_i386_allocate_dynrelocs): Likewise.
923 (elf_i386_size_dynamic_sections): Likewise.
924 (elf_i386_relocate_section): Likewise.
925 (elf_i386_finish_dynamic_symbol): Likewise.
926 (elf_i386_finish_dynamic_sections): Likewise.
927 (elf_i386_get_synthetic_symtab): Likewise.
928 (elf_i386_link_setup_gnu_properties): Likewise.
929 (elf_i386_nacl_plt): Likewise.
930 * elf64-x86-64.c (ABI_64_P): Removed.
931 (ELF64_DYNAMIC_INTERPRETER): Likewise.
932 (ELF32_DYNAMIC_INTERPRETER): Likewise.
933 (elf_x86_64_lazy_plt_layout): Likewise.
934 (elf_x86_64_non_lazy_plt_layout): Likewise.
935 (elf_x86_64_plt_layout): Likewise.
936 (elf_x86_64_link_hash_table): Likewise.
937 (elf_x86_64_plt): Likewise.
938 (elf_x86_64_lazy_plt): Likewise.
939 (elf_x86_64_non_lazy_plt): Likewise.
940 (elf_x86_64_link_hash_table_create): Likewise.
941 (bfd_elf64_bfd_link_hash_table_create): Likewise.
942 (bfd_elf32_bfd_link_hash_table_create): Likewise.
943 (elf_x86_64_lazy_plt): Updated.
944 (elf_x86_64_non_lazy_plt): Likewise.
945 (elf_x86_64_lazy_bnd_plt): Likewise.
946 (elf_x86_64_non_lazy_bnd_plt): Likewise.
947 (elf_x86_64_lazy_ibt_plt): Likewise.
948 (elf_x32_lazy_ibt_plt): Likewise.
949 (elf_x86_64_non_lazy_ibt_plt): Likewise.
950 (elf_x32_non_lazy_ibt_plt): Likewise.
951 (elf_x86_64_allocate_dynrelocs): Likewise.
952 (elf_x86_64_size_dynamic_sections): Likewise.
953 (elf_x86_64_relocate_section): Likewise.
954 (elf_x86_64_finish_dynamic_symbol): Likewise.
955 (elf_x86_64_finish_dynamic_sections): Likewise.
956 (elf_x86_64_get_synthetic_symtab): Likewise.
957 (elf_x86_64_link_setup_gnu_properties): Likewise.
958 (elf_x86_64_nacl_plt): Likewise.
959 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
961 (ELF32_DYNAMIC_INTERPRETER): New.
962 (ELF64_DYNAMIC_INTERPRETER): Likewise.
963 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
964 (_bfd_x86_elf_link_hash_table_create): Likewise.
965 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
966 (elf_x86_link_hash_table_free): This. Make it static.
967 * elfxx-x86.h: Don't include "objalloc.h".
969 (elf_x86_lazy_plt_layout): Likewise.
970 (elf_x86_non_lazy_plt_layout): Likewise.
971 (elf_x86_plt_layout): Likewise.
972 (_bfd_x86_elf_link_hash_table_create): Likewise.
973 (bfd_elf64_bfd_link_hash_table_create): Likewise.
974 (bfd_elf32_bfd_link_hash_table_create): Likewise.
975 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
976 srelplt2 and next_tls_desc_index.
977 (_bfd_x86_elf_link_hash_table_free): Removed.
979 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
981 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
982 branch offset interpretation.
984 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
987 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
989 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
991 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
992 (elf_x86_64_srelplt2): Likewise.
994 2017-08-30 Alan Modra <amodra@gmail.com>
996 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
997 (ppc64_elf_tls_optimize): Set it.
998 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
999 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1000 addis would add zero.
1001 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1002 (ppc_elf_tls_optimize): Set it.
1003 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1004 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1006 2017-08-30 Alan Modra <amodra@gmail.com>
1008 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1009 __tls_get_addr call sequences to LE, don't move the addi down
1010 to the nop. Replace the bl with addi and leave the nop alone.
1012 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1014 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1016 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1018 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1020 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1022 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1023 (BFD64_BACKENDS): Likewise.
1024 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1025 (BFD64_BACKENDS_CFILES): Likewise.
1026 * Makefile.in: Regenerated.
1027 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1028 elf32-i386.lo and elf64-x86-64.lo.
1029 * configure: Regenerated.
1030 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1031 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1032 "objalloc.h" and "hashtab.h".
1033 (ELIMINATE_COPY_RELOCS): Removed.
1034 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1035 (SYMBOL_NO_COPYRELOC): Likewise.
1036 (elf_i386_link_hash_entry): Likewise.
1037 (GOT_UNKNOWN): Likewise.
1038 (GOT_NORMAL): Likewise.
1039 (GOT_TLS_GD): Likewise.
1040 (elf_i386_hash_entry): Likewise.
1041 (elf_i386_obj_tdata): Likewise.
1042 (elf_i386_tdata): Likewise.
1043 (elf_i386_local_got_tls_type): Likewise.
1044 (elf_i386_local_tlsdesc_gotent): Likewise.
1045 (elf_i386_hash_table): Likewise.
1046 (elf_i386_link_hash_newfunc): Likewise.
1047 (elf_i386_local_htab_hash): Likewise.
1048 (elf_i386_local_htab_eq): Likewise.
1049 (elf_i386_get_local_sym_hash): Likewise.
1050 (elf_i386_link_hash_table_free): Likewise.
1051 (elf_i386_copy_indirect_symbol): Likewise.
1052 (elf_i386_fixup_symbol): Likewise.
1053 (elf_i386_readonly_dynrelocs): Likewise.
1054 (elf_i386_always_size_sections): Likewise.
1055 (elf_i386_set_tls_module_base): Likewise.
1056 (elf_i386_dtpoff_base): Likewise.
1057 (compare_relocs): Likewise.
1058 (elf_i386_hash_symbol): Likewise.
1059 (elf_i386_parse_gnu_properties): Likewise.
1060 (elf_i386_merge_gnu_properties): Likewise.
1061 (elf_i386_link_check_relocs): Likewise.
1062 (elf_i386_merge_symbol_attribute): Likewise.
1063 (bfd_elf32_bfd_link_check_relocs): Likewise.
1064 (elf_backend_copy_indirect_symbol): Likewise.
1065 (elf_backend_always_size_sections): Likewise.
1066 (elf_backend_omit_section_dynsym): Likewise.
1067 (elf_backend_hash_symbol): Likewise.
1068 (elf_backend_fixup_symbol): Likewise.
1069 (elf_backend_parse_gnu_properties): Likewise.
1070 (elf_backend_merge_gnu_properties): Likewise.
1071 (elf_backend_merge_symbol_attribute): Likewise.
1072 (elf_i386_mkobject): Updated.
1073 (elf_i386_link_hash_table_create): Likewise.
1074 (elf_i386_check_tls_transition): Likewise.
1075 (elf_i386_tls_transition): Likewise.
1076 (elf_i386_convert_load_reloc): Likewise.
1077 (elf_i386_check_relocs): Likewise.
1078 (elf_i386_adjust_dynamic_symbol): Likewise.
1079 (elf_i386_allocate_dynrelocs): Likewise.
1080 (elf_i386_convert_load): Likewise.
1081 (elf_i386_size_dynamic_sections): Likewise.
1082 (elf_i386_relocate_section): Likewise.
1083 (elf_i386_finish_dynamic_symbol ): Likewise.
1084 (elf_i386_finish_dynamic_sections): Likewise.
1085 (elf_i386_output_arch_local_syms): Likewise.
1086 (elf_i386_get_synthetic_symtab): Likewise.
1087 (elf_i386_link_setup_gnu_properties): Likewise.
1088 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1089 of elf_link_hash_table, as base.
1090 (elf_i386_next_tls_desc_index): New.
1091 (elf_i386_srelplt2): Likewise.
1092 (elf_i386_plt): Likewise.
1093 (elf_i386_lazy_plt): Likewise.
1094 (elf_i386_non_lazy_plt): Likewise.
1095 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1096 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1097 "objalloc.h" and "hashtab.h".
1098 (ELIMINATE_COPY_RELOCS): Removed.
1099 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1100 (SYMBOL_NO_COPYRELOC): Likewise.
1101 (elf_x86_64_link_hash_entry): Likewise.
1102 (GOT_UNKNOWN): Likewise.
1103 (GOT_NORMAL): Likewise.
1104 (GOT_TLS_GD): Likewise.
1105 (elf_x86_64_hash_entry): Likewise.
1106 (elf_x86_64_obj_tdata): Likewise.
1107 (elf_x86_64_tdata): Likewise.
1108 (elf_x86_64_local_got_tls_type): Likewise.
1109 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1110 (elf_x86_64_hash_table): Likewise.
1111 (elf_x86_64_link_hash_newfunc): Likewise.
1112 (elf_x86_64_local_htab_hash): Likewise.
1113 (elf_x86_64_local_htab_eq): Likewise.
1114 (elf_x86_64_get_local_sym_hash): Likewise.
1115 (elf_x86_64_link_hash_table_free): Likewise.
1116 (elf_x86_64_copy_indirect_symbol): Likewise.
1117 (elf_x86_64_fixup_symbol): Likewise.
1118 (elf_x86_64_readonly_dynrelocs): Likewise.
1119 (elf_x86_64_always_size_sections): Likewise.
1120 (elf_x86_64_set_tls_module_base): Likewise.
1121 (elf_x86_64_dtpoff_base): Likewise.
1122 (compare_relocs): Likewise.
1123 (elf_x86_64_merge_symbol_attribute): Likewise.
1124 (elf_x86_64_hash_symbol): Likewise.
1125 (elf_x86_64_parse_gnu_properties): Likewise.
1126 (elf_x86_64_merge_gnu_properties): Likewise.
1127 (elf_x86_64_link_check_relocs): Likewise.
1128 (elf_backend_copy_indirect_symbol): Likewise.
1129 (elf_backend_always_size_sections): Likewise.
1130 (bfd_elf64_bfd_link_check_relocs): Likewise.
1131 (elf_backend_merge_symbol_attribute): Likewise.
1132 (elf_backend_hash_symbol): Likewise.
1133 (elf_backend_omit_section_dynsym): Likewise.
1134 (elf_backend_fixup_symbol): Likewise.
1135 (elf_backend_parse_gnu_properties): Likewise.
1136 (elf_backend_merge_gnu_properties): Likewise.
1137 (bfd_elf32_bfd_link_check_relocs): Likewise.
1138 (elf_x86_64_mkobject): Updated.
1139 (elf_x86_64_link_hash_table_create): Likewise.
1140 (elf_x86_64_check_tls_transition): Likewise.
1141 (elf_x86_64_tls_transition): Likewise.
1142 (elf_x86_64_convert_load_reloc): Likewise.
1143 (elf_x86_64_check_relocs): Likewise.
1144 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1145 (elf_x86_64_allocate_dynrelocs): Likewise.
1146 (elf_x86_64_convert_load): Likewise.
1147 (elf_x86_64_size_dynamic_sections): Likewise.
1148 (elf_x86_64_relocate_section): Likewise.
1149 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1150 (elf_x86_64_finish_dynamic_sections): Likewise.
1151 (elf_x86_64_output_arch_local_syms): Likewise.
1152 (elf_x86_64_get_synthetic_symtab): Likewise.
1153 (elf_x86_64_link_setup_gnu_properties): Likewise.
1154 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1155 instead of elf_link_hash_table, as base.
1156 (elf_x86_64_next_tls_desc_index): New.
1157 (elf_x86_64_srelplt2): Likewise.
1158 (elf_x86_64_plt): Likewise.
1159 (elf_x86_64_lazy_plt): Likewise.
1160 (elf_x86_64_non_lazy_plt): Likewise.
1161 * elfxx-x86.c: New file.
1162 * elfxx-x86.h: Likewise.
1164 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1166 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1168 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1170 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1172 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1173 sections before checking dynamic relocations and free invalid
1174 PLT section contents.
1175 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1177 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1179 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1180 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1182 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1185 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1187 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1189 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1191 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1193 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1195 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1198 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1199 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1200 Add a has_no_copy_on_protected bitfield.
1201 (elf_has_no_copy_on_protected): New.
1202 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1203 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1204 (elf_merge_gnu_property_list): Likewise.
1205 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1206 to FALSE for elf_has_no_copy_on_protected.
1207 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1208 (elf_i386_link_hash_entry): Add def_protected.
1209 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1210 when checking info->nocopyreloc.
1211 (elf_i386_link_setup_gnu_properties): Don't set
1212 extern_protected_data here.
1213 (elf_i386_merge_symbol_attribute): New function.
1214 (elf_backend_merge_symbol_attribute): New.
1215 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1216 (elf_x86_64_link_hash_entry): Add def_protected.
1217 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1218 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1219 when checking info->nocopyreloc.
1220 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1221 relocation run-time overflow and unresolvable R_X86_64_32S
1222 relocation against protected data symbol defined in shared object
1223 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1224 (elf_x86_64_link_setup_gnu_properties): Don't set
1225 extern_protected_data here.
1226 (elf_x86_64_merge_symbol_attribute): New function.
1227 (elf_backend_merge_symbol_attribute): New.
1229 2017-08-26 Alan Modra <amodra@gmail.com>
1231 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1232 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1233 (ppc_elf_relocate_section): Comment fix.
1234 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1235 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1236 Support dynamic relocs for TPREL16 when non-pic too.
1237 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1238 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1241 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1243 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1244 "symbol" in comments.
1245 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1247 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1250 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1251 R_X86_64_PC32 relocation run-time overflow and unresolvable
1252 R_X86_64_32S relocation with -z nocopyreloc.
1254 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1256 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1257 Undefined symbols may not have a type.
1258 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1260 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1262 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1263 bfd_link_info. Report shared, PIE or PDE object based on
1265 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1266 (elf_x86_64_relocate_section): Likewise.
1268 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1270 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1271 for function symbols.
1272 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1274 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1276 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1277 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1278 is set on any input relocatable file.
1279 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1281 2017-08-23 Alan Modra <amodra@gmail.com>
1284 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1285 ensure_undefweak_dynamic. Handle undefined too.
1286 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1287 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1288 (allocate_dynrelocs): Discard undefined non-default visibility
1289 relocs first. Make undefined syms dynamic. Tidy goto.
1291 2017-08-21 Alan Modra <amodra@gmail.com>
1292 H.J. Lu <hongjiu.lu@intel.com>
1295 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1296 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1298 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1301 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1302 undefined weak symbols.
1304 2017-08-18 Nick Clifton <nickc@redhat.com>
1307 * tekhex.c (getsym): Fix check for source pointer walking off the
1308 end of the input buffer.
1310 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1313 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1314 relocations in debug sections, change abort to _bfd_error_handler.
1316 2017-08-14 Nick Clifton <nickc@redhat.com>
1319 * elf.c (setup_group): Check for an empty or very small group
1321 * po/bfd.pot: Regenerate.
1323 2017-08-14 Alan Modra <amodra@gmail.com>
1326 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1327 alignment padding here.
1328 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1329 in a reverse pass over sections.
1331 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1334 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1335 for @plt suffixes first.
1336 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1338 2017-08-08 Nick Clifton <nickc@redhat.com>
1341 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1342 small section lengths.
1343 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1345 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1346 there is enough data present in the note.
1348 2017-08-08 Alan Modra <amodra@gmail.com>
1351 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1352 got.refcount for GOTOFF relocs, just create .got section.
1354 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1356 * elflink.c (elf_link_add_object_symbols): Move common symbol
1357 check after bed->common_definition.
1359 2017-08-07 Alan Modra <amodra@gmail.com>
1362 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1363 needed to define various dynamic tags have been discarded.
1365 2017-08-07 Nick Clifton <nickc@redhat.com>
1368 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1369 has not been set then use the bfd returned by
1370 _bfd_elf_link_setup_gnu_properties. If that is null then search
1371 through all the input bfds selecting the first normal, ELF format
1373 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1375 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1377 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1379 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1380 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1381 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1382 (elf_i386_link_check_relocs): New function.
1383 (bfd_elf32_bfd_link_check_relocs): New.
1384 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1386 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1387 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1388 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1389 (elf_x86_64_link_check_relocs): New function.
1390 (bfd_elf64_bfd_link_check_relocs): New.
1391 (bfd_elf32_bfd_link_check_relocs): Likewise.
1393 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1396 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1397 as undefined for --no-define-common.
1399 2017-08-05 Alan Modra <amodra@gmail.com>
1401 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1402 hppa_link_hash_table.
1404 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1406 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1407 entries for sysregs with negative indices.
1409 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1411 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1412 isn't the S/390 specific elf data.
1413 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1415 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1417 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1418 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1419 [R_RISCV_ADD16]: Likewise.
1420 [R_RISCV_ADD32]: Likewise.
1421 [R_RISCV_ADD64]: Likewise.
1422 [R_RISCV_SUB6]: Likewise.
1423 [R_RISCV_SUB8]: Likewise.
1424 [R_RISCV_SUB16]: Likewise.
1425 [R_RISCV_SUB32]: Likewise.
1426 [R_RISCV_SUB64]: Likewise.
1428 2017-07-31 Alan Modra <amodra@gmail.com>
1430 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1431 without ld.so checks.
1433 2017-07-29 Alan Modra <amodra@gmail.com>
1436 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1437 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1438 (is_elfv2_localentry0): Test non_zero_localentry.
1439 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1441 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1443 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1444 pointer check for htab->elf.irelplt.
1445 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1447 2017-07-27 Nick Clifton <nickc@redhat.com>
1450 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1452 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1454 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1456 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1458 (evax_bfd_print_emh): Check for invalid string lengths.
1460 2017-07-25 Nick Clifton <nickc@redhat.com>
1462 * po/fr.po: Updated French translation.
1464 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1467 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1468 16-bit absolute branches into 10-bit pc-relative branches on the
1469 MSP430 as well as the MSP430X.
1471 2017-07-25 Alan Modra <amodra@gmail.com>
1473 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1474 (stub_eh_frame_size): New function.
1475 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1476 (group_sections): Init group tls_get_addr_opt_bctrl.
1477 (ppc64_elf_size_stubs): Update sizing and initialization of
1478 .eh_frame. Iteration over stubs via group list.
1479 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1480 (ppc64_elf_finish_dynamic_sections): Update finalization of
1483 2017-07-24 Nick Clifton <nickc@redhat.com>
1486 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1487 of the relocs to the canonicalize_one_reloc routine.
1488 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1489 for the _bfd_mach_o_canonicalize_one_reloc field.
1490 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1491 res_base parameter. Use to check for corrupt pair relocs.
1492 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1494 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1496 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1499 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1500 enough data in the record before attempting to parse it.
1501 (_bfd_vms_slurp_eeom): Likewise.
1503 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1504 (image_set_ptr): Likewise.
1505 (alpha_vms_slurp_relocs): Likewise.
1507 (alpha_vms_object_p): Check for a truncated record.
1509 2017-07-24 Nick Clifton <nickc@redhat.com>
1512 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1513 an unrecognized reloc and sets the bfd_error value.
1514 * libbfd.h: Regenerate.
1515 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1517 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1518 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1519 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1520 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1521 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1523 2017-07-23 Alan Modra <amodra@gmail.com>
1525 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1528 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1531 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1532 reloc_class_ifunc for ifunc symbols.
1534 2017-07-19 Nick Clifton <nickc@redhat.com>
1537 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1538 correct magic bytes at the start, set the error to wrong format
1539 and clear the format selector before returning NULL.
1541 2017-07-19 Nick Clifton <nickc@redhat.com>
1544 * coff-rs6000.c (_bfd_strntol): New function.
1545 (_bfd_strntoll): New function.
1546 (GET_VALUE_IN_FIELD): New macro.
1547 (EQ_VALUE_IN_FIELD): new macro.
1548 (_bfd_xcoff_slurp_armap): Use new macros.
1549 (_bfd_xcoff_archive_p): Likewise.
1550 (_bfd_xcoff_read_ar_hdr): Likewise.
1551 (_bfd_xcoff_openr_next_archived_file): Likewise.
1552 (_bfd_xcoff_stat_arch_elt): Likewise.
1553 * coff64-rs6000.c (_bfd_strntol): New function.
1554 (_bfd_strntoll): New function.
1555 (GET_VALUE_IN_FIELD): New macro.
1556 (xcoff64_slurp_armap): Use new macros.
1558 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1559 John Eric Martin <John.Martin@emmicro-us.com>
1561 * bfd-in2.h: Regenerate.
1562 * libbfd.h: Regenerate.
1563 * elf32-arc.c (JLI): Define.
1564 * reloc.c: Add JLI relocations.
1566 2017-07-18 Nick Clifton <nickc@redhat.com>
1569 * coff-sh.c: Fix spelling typos.
1570 * compress.c: Likewise.
1571 * cpu-pdp11.c: Likewise.
1572 * ecofflink.c: Likewise.
1573 * elf-m10300.c: Likewise.
1575 * elf32-arm.c: Likewise.
1576 * elf32-m68k.c: Likewise.
1577 * elf32-nds32.c: Likewise.
1578 * elf32-ppc.c: Likewise.
1579 * elf32-sh.c: Likewise.
1580 * elf32-v850.c: Likewise.
1581 * elf64-ppc.c: Likewise.
1582 * elf64-x86-64.c: Likewise.
1583 * elflink.c: Likewise.
1584 * elfnn-aarch64.c: Likewise.
1585 * elfxx-mips.c: Likewise.
1587 * sunos.c: Likewise.
1588 * vms-alpha.c: Likewise.
1589 * xcofflink.c: Likewise.
1591 2017-07-18 Nick Clifton <nickc@redhat.com>
1594 * coffcode.h (handle_COMDAT): Replace abort with an error message
1597 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1600 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1603 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1605 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1607 2017-07-16 Alan Modra <amodra@gmail.com>
1609 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1610 __tls_index GOT entries when using __tls_get_addr_opt stub.
1611 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1613 2017-07-12 Alan Modra <amodra@gmail.com>
1615 * po/es.po: Update from translationproject.org/latest/bfd/.
1616 * po/fi.po: Likewise.
1617 * po/fr.po: Likewise.
1618 * po/id.po: Likewise.
1619 * po/ja.po: Likewise.
1620 * po/ro.po: Likewise.
1621 * po/ru.po: Likewise.
1622 * po/sr.po: Likewise.
1623 * po/sv.po: Likewise.
1624 * po/tr.po: Likewise.
1625 * po/uk.po: Likewise.
1626 * po/vi.po: Likewise.
1627 * po/zh_CN.po: Likewise.
1628 * po/hr.po: New file from translationproject.org.
1629 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1630 * configure: Regenerate.
1632 2017-07-12 Nick Clifton <nickc@redhat.com>
1634 Fix compile time warnings using gcc 7.1.1.
1635 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1637 (elf_xtensa_get_gotplt_section): Increase length of got_name
1639 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1640 default return of FALSE.
1641 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1642 default return of FALSE.
1644 2017-07-12 Alan Modra <amodra@gmail.com>
1646 * binary.c (binary_set_section_contents): Don't print filepos in
1648 (coff_write_object_contents): Cast size_t for error message.
1649 (coff_slurp_line_table): Don't use bfd_vma symndx.
1650 (coff_slurp_reloc_table): Remove unneeded cast.
1651 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1653 (find_abstract_instance_name): Likewise.
1654 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1655 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1656 (elf32_arm_check_relocs): Make r_symndx an int.
1657 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1659 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1661 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1663 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1664 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1665 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1666 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1667 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1668 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1669 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1670 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1671 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1672 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1673 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1674 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1675 and use %lu for error message.
1676 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1677 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1680 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1682 (elf32_arm_final_link_relocate): Likewise.
1683 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1684 * coffcode.h (styp_to_sec_flags): Likewise.
1685 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1686 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1687 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1688 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1689 (elf32_bfin_merge_private_bfd_data): Likewise.
1690 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1691 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1692 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1693 (i370_elf_relocate_section): Likewise.
1694 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1695 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1696 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1697 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1698 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1699 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1700 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1701 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1702 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1703 * ieee.c (ieee_write_id, read_id): Likewise.
1704 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1705 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1706 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1707 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1708 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1709 * stabs.c (_bfd_link_section_stabs): Likewise.
1711 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1713 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1714 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1715 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1716 * coff-sh.c (sh_relax_section): Likewise.
1717 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1718 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1719 * coffcode.h (coff_slurp_reloc_table): Likewise.
1720 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1721 (_bfd_coff_read_string_table): Likewise.
1722 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1723 * compress.c (bfd_get_full_section_contents): Likewise.
1724 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1725 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1726 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1727 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1728 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1729 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1730 (elf32_arm_write_section): Likewise.
1731 * elf32-bfin.c (bfin_relocate_section): Likewise.
1732 (bfinfdpic_relocate_section): Likewise.
1733 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1734 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1735 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1736 (elf_i386_relocate_section): Likewise.
1737 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1738 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1739 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1740 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1741 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1742 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1743 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1744 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1745 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1746 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1747 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1748 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1749 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1750 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1751 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1752 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1753 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1754 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1755 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1756 * elf32-sh.c (sh_elf_relax_section): Likewise.
1757 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1758 (sh_elf_relocate_section): Likewise.
1759 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1760 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1761 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1762 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1763 * elf32-v850.c (v850_elf_relax_section): Likewise.
1764 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1765 (elf_vax_relocate_section): Likewise.
1766 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1767 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1768 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1769 (do_fix_for_relocatable_link): Likewise.
1770 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1771 (elf64_alpha_relax_with_lituse): Likewise.
1772 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1773 (elf_hppa_final_link_relocate): Likewise.
1774 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1775 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1776 (elf64_vms_link_add_object_symbols): Likewise.
1777 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1778 (mmix_final_link_relocate): Likewise.
1779 * elf64-s390.c (invalid_tls_insn): Likewise.
1780 (elf_s390_relocate_section): Likewise.
1781 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1782 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1783 (elf_x86_64_relocate_section): Likewise.
1784 * elfcode.h (elf_slurp_symbol_table): Likewise.
1785 * elfcore.h (elf_core_file_p): Likewise.
1786 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1787 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1788 (elfNN_aarch64_relocate_section): Likewise.
1789 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1790 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1791 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1792 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1793 (_bfd_mips_elf_relocate_section): Likewise.
1794 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1795 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1796 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1797 * ieee.c (ieee_slurp_external_symbols): Likewise.
1798 * ihex.c (ihex_write_object_content): Likewise.
1799 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1800 * merge.c (_bfd_merged_section_offset): Likewise.
1801 * mmo.c (mmo_write_loc_chunk): Likewise.
1802 (mmo_write_object_contents): Likewise.
1803 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1804 * stabs.c (_bfd_link_section_stabs): Likewise.
1805 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1807 2017-07-11 Alan Modra <amodra@gmail.com>
1809 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1811 2017-07-11 Alan Modra <amodra@gmail.com>
1813 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1814 instruction" error using _bfd_error_handler, not einfo.
1816 2017-07-10 Nick Clifton <nickc@redhat.com>
1818 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1819 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1821 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1823 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1825 2017-07-07 Alan Modra <amodra@gmail.com>
1827 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1829 2017-07-07 Alan Modra <amodra@gmail.com>
1831 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1832 as long long. Move code replacing "ll" with "I64", and simplify.
1834 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1836 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1839 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1841 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1843 (line_info_add_file_name): Likewise.
1844 (decode_line_info): Likewise.
1846 2017-07-04 Tristan Gingold <gingold@adacore.com>
1848 * version.m4: Bump version to 2.29.51
1849 * configure: Regenerate.
1851 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1853 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1854 sanity check at the head of this function.
1856 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1858 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1859 dwarf_line_str_size.
1860 (struct attr_abbrev): Add field implicit_const.
1861 (dwarf_debug_sections): Add .debug_line_str.
1862 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1863 (dwarf_debug_section_assert): Add static assertion.
1864 (read_indirect_line_string): New.
1865 (read_abbrevs): Support DW_FORM_implicit_const.
1866 (is_str_attr): Support DW_FORM_line_strp.
1867 (read_attribute_value): Support DW_FORM_line_strp and
1868 DW_FORM_implicit_const.
1869 (read_attribute): Support DW_FORM_implicit_const.
1870 (line_info_add_include_dir, line_info_add_include_dir_stub):
1871 (line_info_add_file_name, read_formatted_entries): New.
1872 (decode_line_info, parse_comp_unit): Support DWARF 5.
1873 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1875 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1877 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1878 abort statement that was put for symbols that are not dynamic.
1880 2017-07-03 Tristan Gingold <gingold@adacore.com>
1882 * po/bfd.pot: Regenerate
1884 2017-07-03 Alan Modra <amodra@gmail.com>
1886 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1887 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1888 * elf.c (setup_group): Use "Lx" to print sh_size.
1889 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1890 unknown section type in hex.
1891 (copy_special_section_fields): Style fix.
1892 (bfd_section_from_shdr): Correct format for sh_link. Use a
1893 common error message for all the variants of unrecognized
1895 (assign_file_positions_for_load_sections): Use "Lx" for lma
1896 adjust error message.
1897 (assign_file_positions_for_non_load_sections): Formatting.
1898 (rewrite_elf_program_header): Formatting. Use "Lx" for
1899 bfd_vma values in error messages.
1900 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1901 ELF_R_SYM value to type expected by format.
1902 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1904 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1905 (elf_link_input_bfd): Use "Lx" for r_info.
1906 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1908 2017-07-03 Alan Modra <amodra@gmail.com>
1910 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1911 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1912 Microsoft C library variant of long long format specifier.
1913 (PRINT20): Cast value to bfd_uint64_t not long long.
1914 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1915 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1916 long long. Don't cast to bfd_vma.
1917 * elf32-score.c (score3_bfd_getl48): Likewise.
1918 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1920 2017-07-03 Alan Modra <amodra@gmail.com>
1922 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1924 (bfd_elf_print_symbol): Don't cast symbol->flags.
1925 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1926 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1927 _bfd_error_handler argument order.
1928 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1930 2017-07-03 Alan Modra <amodra@gmail.com>
1932 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1933 AC_TYPE_LONG_DOUBLE.
1934 * configure: Regenerate.
1935 * config.in: Regenerate.
1937 2017-06-29 Andrew Waterman <andrew@sifive.com>
1939 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1942 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1944 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1945 unless it is undefined weak.
1946 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1947 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1949 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1950 is not dynamic in PIC, abort.
1952 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1955 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1956 undefined weak symbols into dynamic.
1957 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1958 relocation for non-dynamic symbols.
1959 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1961 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1963 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1964 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1965 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1966 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1967 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1970 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1972 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1973 (elfcore_write_s390_gs_bc): Likewise.
1974 * elf.c (elfcore_grok_s390_gs_cb): New function.
1975 (elfcore_grok_s390_gs_bc): New function.
1976 (elfcore_grok_note): Call them.
1977 (elfcore_write_s390_gs_cb): New function.
1978 (elfcore_write_s390_gs_bc): New function.
1979 (elfcore_write_register_note): Call them.
1981 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1983 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1984 bfd_get_file_size. Check archive element size.
1985 (_bfd_generic_get_section_contents_in_window): Likewise.
1987 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1989 * bfd-in2.h: Regenerated.
1990 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1991 (bfd_get_file_size): Likewise.
1993 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1994 Matthew Fortune <matthew.fortune@imgtec.com>
1996 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1997 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1998 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1999 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2001 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2002 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2003 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2004 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2005 `bfd_mach_mips_interaptiv_mr2' entries.
2006 * bfd-in2.h: Regenerate.
2008 2017-06-27 Nick Clifton <nickc@redhat.com>
2010 * tekhex.c (pass_over): Revert accidental conversion of a local
2011 array to a static array.
2013 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2016 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2017 reloc addend if necessary. Adjust diff only if
2018 shrinked_insn_address < end_address.
2020 2017-06-27 Alan Modra <amodra@gmail.com>
2023 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2024 (_bfd_generic_get_section_contents_in_window): Likewise.
2026 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2028 * elfnn-riscv.c (perform_relocation): Support the new
2029 R_RISCV_32_PCREL relocation.
2030 (riscv_elf_relocate_section): Likewise.
2031 * elfxx-riscv.c (howto_table): Likewise.
2032 (riscv_reloc_map): Likewise.
2033 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2034 * libbfd.h: Regenerate.
2036 2017-06-27 Alan Modra <amodra@gmail.com>
2039 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2040 Use unsigned file pointer type, and remove cast.
2041 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2042 Add "count", not "sz".
2044 2017-06-26 Pedro Alves <palves@redhat.com>
2047 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2050 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2053 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2056 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2058 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2059 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2060 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2061 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2062 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2064 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2067 * compress.c (bfd_get_full_section_contents): Don't check the
2069 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2070 reject a section whose size + offset is greater than the size
2072 (_bfd_generic_get_section_contents_in_window): Likewise.
2074 2017-06-26 Nick Clifton <nickc@redhat.com>
2077 * tekhex.c (getvalue): Check for the source pointer exceeding the
2078 end pointer before the first byte is read.
2080 2017-06-26 Nick Clifton <nickc@redhat.com>
2083 * opncls.c (get_build_id): Check that the section is big enough
2084 to contain the whole note.
2085 * compress.c (bfd_get_full_section_contents): Check for and reject
2086 a section whose size is greater than the size of the entire file.
2087 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2088 contain a notes section.
2090 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2092 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2094 (elf_s390_modify_segment_map): Likewise.
2095 (bfd_elf_s390_set_options): Lisewise.
2097 2017-06-26 Alan Modra <amodra@gmail.com>
2099 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2101 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2102 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2103 .preinit_array on --just-syms bfds.
2104 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2105 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2106 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2108 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2110 * elf.c (find_link): Bounds check "hint".
2112 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2114 * elf32-arm.c (using_thumb_only): Update list of architectures in
2115 BFD_ASSERT for which the logic is valid.
2116 (using_thumb2_bl): Likewise.
2117 (using_thumb2): Likewise and return true for ARMv8-R.
2118 (arch_has_arm_nop): Likewise.
2119 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2120 merging logic. Update commentis for value 15 of v8m_baseline,
2121 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2122 merging of value 15 of Tag_CPU_arch.
2124 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2126 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2127 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2128 * bfd-in2.h: Regenerate.
2130 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2132 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2133 the error_alignment label forward. Properly align program
2134 property note section.
2136 2017-06-22 Eric Christopher <echristo@gmail.com>
2138 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2139 abs to fix a truncation warning.
2141 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2143 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2144 local undefined weak symbol to 0.
2145 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2147 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2149 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2150 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2151 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2152 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2153 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2154 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2155 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2156 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2158 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2160 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2161 (elf_i386_lazy_ibt_plt_entry): Likewise.
2162 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2163 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2164 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2165 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2166 (elf_i386_lazy_plt_layout): Likewise.
2167 (elf_i386_non_lazy_plt_layout): Likewise.
2168 (elf_i386_link_hash_entry): Add plt_second.
2169 (elf_i386_link_hash_table): Add plt_second and
2170 plt_second_eh_frame.
2171 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2172 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2173 the second PLT. Check the second PLT.
2174 (elf_i386_relocate_section): Use the second PLT to resolve
2175 PLT reference if needed.
2176 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2178 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2179 second PLT. Generate unwind info for the second PLT.
2180 (elf_i386_plt_type): Add plt_second.
2181 (elf_i386_get_synthetic_symtab): Support the second PLT.
2182 (elf_i386_parse_gnu_properties): Support
2183 GNU_PROPERTY_X86_FEATURE_1_AND.
2184 (elf_i386_merge_gnu_properties): Support
2185 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2186 on GNU_PROPERTY_X86_FEATURE_1_IBT
2187 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2188 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2189 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2190 is set on all relocatable inputs.
2191 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2192 (elf_x32_lazy_ibt_plt_entry): Likewise.
2193 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2194 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2195 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2196 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2197 (elf_x86_64_lazy_ibt_plt): Likewise.
2198 (elf_x32_lazy_ibt_plt): Likewise.
2199 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2200 (elf_x32_non_lazy_ibt_plt): Likewise.
2201 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2202 (elf_x86_64_parse_gnu_properties): Support
2203 GNU_PROPERTY_X86_FEATURE_1_AND.
2204 (elf_x86_64_merge_gnu_properties): Support
2205 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2206 on GNU_PROPERTY_X86_FEATURE_1_IBT
2207 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2208 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2209 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2210 is set on all relocatable inputs.
2212 2017-06-22 Nick Clifton <nickc@redhat.com>
2215 * som.c (setup_sections): NUL terminate the space_strings buffer.
2216 Check that the space.name field does not index beyond the end of
2217 the space_strings buffer.
2219 2017-06-21 Nick Clifton <nickc@redhat.com>
2222 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2224 2017-06-21 Nick Clifton <nickc@redhat.com>
2227 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2228 type of the size parameter.
2229 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2230 length of the counted string.
2231 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2232 (_bfd_vms_save_counted_string): Likewise.
2233 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2234 _bfd_vms_save_counted_string.
2235 (_bfd_vms_slurp_ehdr): Likewise.
2236 (_bfd_vms_slurp_egsd): Likewise.
2237 (Parse_module): Likewise.
2239 2017-06-21 Alan Modra <amodra@gmail.com>
2241 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2242 calls before tocsave calls.
2243 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2246 2017-06-21 Nick Clifton <nickc@redhat.com>
2249 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2250 bfd_get_full_section_contents returns no contents.
2252 2017-06-21 Nick Clifton <nickc@redhat.com>
2255 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2258 2017-06-21 Nick Clifton <nickc@redhat.com>
2261 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2263 (image_set_ptr): Likewise.
2264 (alpha_vms_fix_sec_rel): Likewise.
2265 (alpha_vms_slurp_relocs): Likewise.
2267 2017-06-21 Nick Clifton <nickc@redhat.com>
2270 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2272 (ieee_archive_p): Likewise.
2273 (ieee_object_p): Likewise.
2275 2017-06-21 Nick Clifton <nickc@redhat.com>
2278 * elf.c (setup_group): Zero the group section pointer list after
2279 allocation so that loops can be caught. Check for NULL pointers
2280 when processing a group list.
2282 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2284 * elf-s390.h: New file.
2285 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2287 (elf_s390_additional_program_headers): New function.
2288 (elf_s390_modify_segment_map): New function.
2289 (bfd_elf_s390_set_options): New function.
2290 (elf_backend_additional_program_headers)
2291 (elf_backend_modify_segment_map): Add macro definitions.
2293 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2296 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2297 the DYNAMIC bit instead of bfd_count_sections.
2299 2017-06-19 Nick Clifton <nickc@redhat.com>
2302 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2304 (evax_bfd_print_eeom): Likewise.
2305 (evax_bfd_print_egsd): Check for an overlarge record length.
2306 (evax_bfd_print_etir): Likewise.
2308 2017-06-19 Nick Clifton <nickc@redhat.com>
2311 * libieee.h (struct common_header_type): Add end_p field.
2312 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2314 (read_id): Check for a length that exceeds the remaining bytes in
2316 (ieee_seek): Initialise end_p.
2317 (ieee_archive_p): Likewise.
2318 (ieee_object_p): Likewise.
2320 2017-06-19 Nick Clifton <nickc@redhat.com>
2323 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2324 before reading the EIHS structure entries.
2326 2017-06-19 Nick Clifton <nickc@redhat.com>
2329 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2330 gsd_size. Check that there are enough bytes remaining to read the
2331 type and size of the next egsd. Check that the size of the egsd
2332 does not exceed the size of the record.
2334 2017-06-19 Alan Modra <amodra@gmail.com>
2336 * config.bfd: Correct targ_underscore for cris.
2338 2017-06-18 Alan Modra <amodra@gmail.com>
2340 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2341 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2343 2017-06-16 Nick Clifton <nickc@redhat.com>
2345 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2346 bucketlist is empty because there are no symbols to add to the
2349 2017-06-16 Alan Modra <amodra@gmail.com>
2355 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2356 (BFD_JUMP_TABLE_LINK): Likewise.
2357 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2358 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2359 (bfd_elf_define_start_stop): New function.
2360 * linker.c (bfd_generic_define_start_stop): New function.
2361 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2363 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2364 * aout-target.h (MY_bfd_define_start_stop): Define.
2365 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2366 * binary.c (binary_bfd_define_start_stop): Define.
2367 * bout.c (b_out_bfd_define_start_stop): Define.
2368 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2369 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2370 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2371 * coffcode.h (coff_bfd_define_start_stop): Define.
2372 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2373 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2374 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2375 * ieee.c (ieee_bfd_define_start_stop): Define.
2376 * ihex.c (ihex_bfd_define_start_stop): Define.
2377 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2378 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2379 * mmo.c (mmo_bfd_define_start_stop): Define.
2380 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2381 * oasys.c (oasys_bfd_define_start_stop): Define.
2382 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2383 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2384 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2385 * som.c (som_bfd_define_start_stop): Define.
2386 * srec.c (srec_bfd_define_start_stop): Define.
2387 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2388 * versados.c (versados_bfd_define_start_stop): Define.
2389 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2390 (alpha_vms_bfd_define_start_stop): Define.
2391 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2392 * bfd-in2.h: Regenerate.
2393 * libbfd.h: Regenerate.
2395 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2397 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2398 SYMBOL_REFERENCES_LOCAL.
2400 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2403 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2404 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2405 runtime for if there needs copy relocation elimination.
2406 (need_copy_relocation_p): New function. Return true for symbol with
2407 pc-relative references and if it's against read-only sections.
2408 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2409 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2410 that are related with accessing external objects.
2411 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2412 in elfNN_aarch64_check_relocs.
2414 2017-06-15 Nick Clifton <nickc@redhat.com>
2417 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2420 (ieee_archive_p): Likewise.
2422 2017-06-15 Nick Clifton <nickc@redhat.com>
2425 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2427 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2429 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2430 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2431 keep both windowed and call0 ABI PLT definitions.
2432 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2433 elf_xtensa_*_plt_entry endex.
2434 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2436 2017-06-14 Nick Clifton <nickc@redhat.com>
2439 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2442 2017-06-14 Nick Clifton <nickc@redhat.com>
2445 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2446 maximum value for the ascic pointer. Check that name processing
2447 does not read beyond this value.
2448 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2451 2017-06-14 Nick Clifton <nickc@redhat.com>
2454 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2455 (process_otr): Check for an invalid offset in the otr structure.
2457 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2459 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2461 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2467 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2468 vtable field to a union.
2469 (_bfd_elf_is_start_stop): Removed.
2470 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2471 __start_SECNAME and __stop_SECNAME symbols.
2472 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2473 * elflink.c (_bfd_elf_is_start_stop): Removed.
2474 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2475 _bfd_elf_is_start_stop.
2476 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2477 __stop_SECNAME symbols. Updated.
2478 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2479 (bfd_elf_gc_record_vtinherit): Likewise.
2480 (bfd_elf_gc_record_vtentry): Likewise.
2482 2017-06-13 Nick Clifton <nickc@redhat.com>
2485 * elflink.c (elf_link_adjust_relocs): Generate an error when
2486 encountering a reloc against a symbol removed by garbage
2489 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2491 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2492 to merge_gnu_properties.
2493 * elf-properties.c (elf_merge_gnu_properties): Add struct
2494 bfd_link_info * and pass it to merge_gnu_properties.
2495 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2496 and pass it to elf_merge_gnu_properties.
2497 (_bfd_elf_link_setup_gnu_properties): Pass info to
2498 elf_merge_gnu_property_list.
2499 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2501 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2503 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2506 * binary.c (binary_set_section_contents): Scale lma by octets
2507 per byte to set filepos.
2509 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2511 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2514 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2516 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2519 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2521 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2522 patched section contents for TLS IE reloc.
2523 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2525 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2527 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2528 RELOC_FOR_GLOBAL_SYMBOL macro.
2530 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2532 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2535 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2537 * config/tc-arc.c (md_undefined_symbol): Changed.
2538 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2540 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2542 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2545 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2547 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2548 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2550 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2552 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2555 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2557 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2558 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2559 is non-zero. Add clarifying comments.
2561 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2563 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2564 name. Use local IFUNC symbol name string to report unsupported
2565 non-PIC call to IFUNC function.
2566 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2567 when generating R_386_IRELATIVE relocation.
2568 (elf_i386_finish_dynamic_symbol): Likewise.
2569 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2571 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2572 when generating R_X86_64_IRELATIVE relocation.
2573 (elf_x86_64_finish_dynamic_symbol): Likewise.
2575 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2577 * elf.c (setup_group): Make sure BFD sections are created for all
2578 group sections in the input file when processing SHF_GROUP
2580 (bfd_section_from_shdr): Avoid duplicating logic already
2581 implemented in `setup_group'.
2583 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2586 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2587 if the hint address is zero.
2589 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2592 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2593 ELF_COMMON_DEF_P for common symbols.
2595 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2597 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2598 SEC_GROUP sections as SEC_EXCLUDE.
2599 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2600 (assign_section_numbers): Use resolve_section_groups flag instead
2601 of relocatable link type.
2602 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2603 flag instead of checking the final_link flag for part of the
2604 checks in here. Fix white space as a result.
2605 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2606 instead of relocatable link type.
2607 (bfd_elf_final_link): Likewise.
2609 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2611 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2613 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2614 (s3_bfd_score_elf_check_relocs): Likewise.
2615 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2616 (score_elf_final_link_relocate): Likewise.
2617 (s7_bfd_score_elf_check_relocs): Likewise.
2619 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2621 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2624 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2626 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2627 from `reloc_count' rather than decrementing it.
2628 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2629 `reloc_count' by `int_rels_per_ext_rel'.
2630 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2631 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2632 entry determination.
2633 (s3_bfd_score_elf_check_relocs): Likewise.
2634 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2635 (s7_bfd_score_elf_relocate_section): Likewise.
2636 (s7_bfd_score_elf_check_relocs): Likewise.
2637 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2638 prototype and function.
2639 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2640 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2641 triple rather than once the sum of REL and RELA relocation entry
2643 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2644 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2645 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2646 storage allocation size determination.
2647 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2648 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2649 by `int_rels_per_ext_rel' for last relocation entry
2651 (bfd_elf_final_link): Do not multiply `reloc_count' by
2652 `int_rels_per_ext_rel' for internal relocation storage
2653 allocation size determination.
2654 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2655 `int_rels_per_ext_rel' for last relocation entry determination.
2656 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2657 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2658 (_bfd_mips_elf_relocate_section): Likewise.
2660 2017-06-05 Alan Modra <amodra@gmail.com>
2663 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2665 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2667 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2668 determine structure sizes.
2669 (elfcore_grok_freebsd_prstatus): Likewise.
2671 2017-06-01 Alan Modra <amodra@gmail.com>
2673 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2674 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2676 (is_elfv2_localentry0): New function.
2677 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2678 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2679 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2680 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2681 optimized localentry:0 stubs.
2682 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2683 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2685 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2687 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2689 2017-05-30 Casey Smith <clegg89@gmail.com>
2692 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2693 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2695 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2697 * cpu-arc.c (arc_compatible): New function.
2699 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2701 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2703 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2706 * bfdio.c (bfd_get_file_size): New function.
2707 * bfd-in2.h: Regenerated.
2709 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2711 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2714 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2716 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2717 dynobj instead of htab->elf.dynobj.
2719 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2721 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2723 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2724 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2725 actual number of internal relocations retrieved. Adjust
2726 function description.
2727 (bfd_elf64_canonicalize_reloc): Remove macro.
2728 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2730 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2732 * archures.c (bfd_mach_sparc_v9m8): Define.
2733 (bfd_mach_sparc_v8plusm8): Likewise.
2734 (bfd_mach_sparc_v9_p): Adjust to M8.
2735 (bfd_mach_sparc_64bit_p): Likewise.
2736 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2737 bfd_mach_sparc_v8plusm8.
2738 * bfd-in2.h: Regenerated.
2739 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2741 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2742 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2743 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2745 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2746 bfd_mach_sparc_v8plusm8.
2748 2017-05-19 Alan Modra <amodra@gmail.com>
2750 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2751 debug and special sections when no non-note alloc sections in an
2754 2017-05-18 Alan Modra <amodra@gmail.com>
2756 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2757 * elf-m10300.c: Likewise.
2759 * elf32-arc.c: Likewise.
2760 * elf32-bfin.c: Likewise.
2761 * elf32-m68k.c: Likewise.
2762 * elf32-nds32.c: Likewise.
2763 * elf32-tilepro.c: Likewise.
2764 * elflink.c: Likewise.
2765 * elfnn-aarch64.c: Likewise.
2766 * elfnn-riscv.c: Likewise.
2767 * elfxx-tilegx.c: Likewise.
2768 * mach-o.c: Likewise.
2769 * peXXigen.c: Likewise.
2770 * vms-alpha.c: Likewise.
2771 * vms-lib.c: Likewise.
2773 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2776 * elflink.c (elf_gc_mark_debug_section): New function.
2777 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2778 referenced by kept debug sections.
2780 2017-05-16 Alan Modra <amodra@gmail.com>
2782 * elf-m10300.c: Rename occurrences of non_ir_ref.
2783 * elf32-arm.c: Likewise.
2784 * elf32-bfin.c: Likewise.
2785 * elf32-cr16.c: Likewise.
2786 * elf32-cris.c: Likewise.
2787 * elf32-d10v.c: Likewise.
2788 * elf32-dlx.c: Likewise.
2789 * elf32-fr30.c: Likewise.
2790 * elf32-frv.c: Likewise.
2791 * elf32-hppa.c: Likewise.
2792 * elf32-i370.c: Likewise.
2793 * elf32-i386.c: Likewise.
2794 * elf32-iq2000.c: Likewise.
2795 * elf32-lm32.c: Likewise.
2796 * elf32-m32c.c: Likewise.
2797 * elf32-m32r.c: Likewise.
2798 * elf32-m68hc1x.c: Likewise.
2799 * elf32-m68k.c: Likewise.
2800 * elf32-mcore.c: Likewise.
2801 * elf32-metag.c: Likewise.
2802 * elf32-microblaze.c: Likewise.
2803 * elf32-moxie.c: Likewise.
2804 * elf32-msp430.c: Likewise.
2805 * elf32-mt.c: Likewise.
2806 * elf32-nios2.c: Likewise.
2807 * elf32-or1k.c: Likewise.
2808 * elf32-ppc.c: Likewise.
2809 * elf32-rl78.c: Likewise.
2810 * elf32-s390.c: Likewise.
2811 * elf32-score.c: Likewise.
2812 * elf32-score7.c: Likewise.
2813 * elf32-sh.c: Likewise.
2814 * elf32-tic6x.c: Likewise.
2815 * elf32-tilepro.c: Likewise.
2816 * elf32-v850.c: Likewise.
2817 * elf32-vax.c: Likewise.
2818 * elf32-xstormy16.c: Likewise.
2819 * elf32-xtensa.c: Likewise.
2820 * elf64-alpha.c: Likewise.
2821 * elf64-hppa.c: Likewise.
2822 * elf64-ia64-vms.c: Likewise.
2823 * elf64-mmix.c: Likewise.
2824 * elf64-ppc.c: Likewise.
2825 * elf64-s390.c: Likewise.
2826 * elf64-sh64.c: Likewise.
2827 * elf64-x86-64.c: Likewise.
2828 * elflink.c: Likewise.
2829 * elfnn-aarch64.c: Likewise.
2830 * elfnn-ia64.c: Likewise.
2831 * elfnn-riscv.c: Likewise.
2832 * elfxx-mips.c: Likewise.
2833 * elfxx-sparc.c: Likewise.
2834 * elfxx-tilegx.c: Likewise.
2835 * linker.c: Likewise.
2837 2017-05-16 Alan Modra <amodra@gmail.com>
2839 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2840 * elflink.c (elf_link_add_object_symbols): Update to use
2842 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2844 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2846 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2848 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2850 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2852 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2853 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2855 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2857 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2859 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2861 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2862 to plt_second/plt_second_eh_frame.
2863 (elf_x86_64_link_hash_newfunc): Updated.
2864 (elf_x86_64_allocate_dynrelocs): Likewise.
2865 (elf_x86_64_size_dynamic_sections): Likewise.
2866 (elf_x86_64_relocate_section): Likewise.
2867 (elf_x86_64_finish_dynamic_symbol): Likewise.
2868 (elf_x86_64_finish_dynamic_sections): Likewise.
2869 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2870 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2872 (elf_backend_setup_gnu_properties): Updated. Create the
2873 .plt.sec section instead of the .plt.sec section.
2875 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2877 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2878 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2879 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2881 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2883 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2884 (bfd_elf64_set_reloc): Define.
2885 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2887 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2889 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2890 (struct bfd_target): New field _bfd_set_reloc.
2891 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2892 * reloc.c (_bfd_generic_set_reloc): New function.
2893 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2894 * nlm-target.h (nlm_set_reloc): Likewise.
2895 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2896 * aout-tic30.c (MY_set_reloc): Likewise.
2897 * aout-target.h (MY_set_reloc): Likewise.
2898 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2899 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2900 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2901 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2902 * aout-adobe.c (aout_32_set_reloc): Likewise.
2903 * bout.c (b_out_set_reloc): Likewise.
2904 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2905 * i386os9k.c (aout_32_set_reloc): Likewise.
2906 * ieee.c (ieee_set_reloc): Likewise.
2907 * oasys.c (oasys_set_reloc): Likewise.
2908 * som.c (som_set_reloc): Likewise.
2909 * versados.c (versados_set_reloc): Likewise.
2910 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2911 _bfd_generic_set_reloc.
2912 (rs6000_xcoff64_aix_vec): LIkewise.
2913 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2914 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2915 * i386msdos.c (msdos_set_reloc): Define to
2916 _bfd_norelocs_set_reloc.
2917 * elfcode.h (elf_set_reloc): Define.
2918 * bfd-in2.h: Regenerated.
2920 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2923 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2924 for IFUNC function address.
2926 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2928 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2929 (CONFLICT_LIST): Likewise.
2930 (opcode/arc-attrs.h): Include.
2931 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2932 (arc_extract_features): New file.
2933 (arc_stralloc): Likewise.
2934 (arc_elf_merge_attributes): Likewise.
2935 (arc_elf_merge_private_bfd_data): Use object attributes.
2936 (bfd_arc_get_mach_from_attributes): New function.
2937 (arc_elf_object_p): Use object attributes.
2938 (arc_elf_final_write_processing): Likewise.
2939 (elf32_arc_obj_attrs_arg_type): New function.
2940 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2941 (elf32_arc_section_from_shdr): Likewise.
2942 (elf_backend_obj_attrs_vendor): Define.
2943 (elf_backend_obj_attrs_section): Likewise.
2944 (elf_backend_obj_attrs_arg_type): Likewise.
2945 (elf_backend_obj_attrs_section_type): Likewise.
2946 (elf_backend_obj_attrs_handle_unknown): Likewise.
2947 (elf_backend_section_from_shdr): Likewise.
2949 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2952 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2953 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2954 and the destination is a Thumb symbol.
2956 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2958 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2959 initializer to silence GCC 4.2.
2960 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2962 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2964 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2965 (LAZY_PLT_ENTRY_SIZE): This.
2966 (NON_LAZY_PLT_ENTRY_SIZE): New.
2967 (elf_x86_64_plt0_entry): Renamed to ...
2968 (elf_x86_64_lazy_plt0_entry): This.
2969 (elf_x86_64_plt_entry): Renamed to ...
2970 (elf_x86_64_lazy_plt_entry): This.
2971 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2972 (elf_x86_64_lazy_bnd_plt0_entry): This.
2973 (elf_x86_64_legacy_plt_entry): Removed.
2974 (elf_x86_64_bnd_plt_entry): Renamed to ...
2975 (elf_x86_64_lazy_bnd_plt_entry): This.
2976 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2977 (elf_x86_64_non_lazy_plt_entry): This.
2978 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2979 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2980 (elf_x86_64_eh_frame_plt): Renamed to ...
2981 (elf_x86_64_eh_frame_lazy_plt): This.
2982 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2983 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2984 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2985 (elf_x86_64_eh_frame_non_lazy_plt): This.
2986 (elf_x86_64_lazy_plt_layout): New.
2987 (elf_x86_64_non_lazy_plt_layout): Likewise.
2988 (elf_x86_64_plt_layout): Likewise.
2989 (elf_x86_64_backend_data): Remove PLT layout information. Add
2990 os for target system.
2991 (GET_PLT_ENTRY_SIZE): Removed.
2992 (elf_x86_64_lazy_plt): New.
2993 (elf_x86_64_non_lazy_plt): Likewise.
2994 (elf_x86_64_lazy_bnd_plt): Likewise.
2995 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2996 (elf_x86-64_arch_bed): Updated.
2997 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2998 (elf_x86_64_create_dynamic_sections): Removed.
2999 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3000 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3001 (elf_x86-64_adjust_dynamic_symbol): Updated.
3002 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3003 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3004 size for PLT0 if there is no PLT0. Get plt_entry_size from
3005 non_lazy_plt for non-lazy PLT entries.
3006 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3007 from non_lazy_plt for non-lazy PLT entries.
3008 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3009 if there is no PLT0.
3010 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3011 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3012 entries with non-lazy PLT layout. Don't fill the second and third
3013 slots in the PLT entry if there is no PLT0.
3014 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3015 if there is no PLT0. Set sh_entsize on the .plt.got section.
3016 (compare_relocs): New.
3017 (elf_x86_64_plt_type): Likewise.
3018 (elf_x86_64_plt): Likewise.
3019 (elf_x86_64_nacl_plt): New. Forward declaration.
3020 (elf_x86_64_get_plt_sym_val): Removed.
3021 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3022 against all dynamic relocations.
3023 (elf_x86_64_link_setup_gnu_properties): New function.
3024 (elf_backend_create_dynamic_sections): Updated.
3025 (elf_backend_setup_gnu_properties): New.
3026 (elf_x86_64_nacl_plt): New.
3027 (elf_x86_64_nacl_arch_bed): Updated.
3029 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3031 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3032 (LAZY_PLT_ENTRY_SIZE): This.
3033 (NON_LAZY_PLT_ENTRY_SIZE): New.
3034 (elf_i386_plt0_entry): Renamed to ...
3035 (elf_i386_lazy_plt0_entry): This.
3036 (elf_i386_plt_entry): Renamed to ...
3037 (elf_i386_lazy_plt_entry): This.
3038 (elf_i386_pic_plt0_entry): Renamed to ...
3039 (elf_i386_pic_lazy_plt0_entry): This.
3040 (elf_i386_pic_plt_entry): Renamed to ...
3041 (elf_i386_pic_lazy_plt_entry): This.
3042 (elf_i386_got_plt_entry): Renamed to ...
3043 (elf_i386_non_lazy_plt_entry): This.
3044 (elf_i386_pic_got_plt_entry): Renamed to ...
3045 (elf_i386_pic_non_lazy_plt_entry): This.
3046 (elf_i386_eh_frame_plt): Renamed to ...
3047 (elf_i386_eh_frame_lazy_plt): This.
3048 (elf_i386_eh_frame_plt_got): Renamed to ...
3049 (elf_i386_eh_frame_non_lazy_plt): This.
3050 (elf_i386_plt_layout): Renamed to ...
3051 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3052 eh_frame_plt_got_size.
3053 (elf_i386_non_lazy_plt_layout): New.
3054 (elf_i386_plt_layout): Likewise.
3055 (elf_i386_non_lazy_plt): Likewise.
3056 (GET_PLT_ENTRY_SIZE): Removed.
3057 (elf_i386_plt): Renamed to ...
3058 (elf_i386_lazy_plt): This.
3059 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3060 (elf_i386_arch_bed): Updated.
3061 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3062 (elf_i386_create_dynamic_sections): Removed.
3063 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3064 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3065 (elf_i386_adjust_dynamic_symbol): Updated.
3066 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3067 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3068 size for PLT0 if there is no PLT0.
3069 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3070 output section is discarded only if GOT isn't empty.
3071 (elf_i386_relocate_section): Updated. Properly get PLT index
3072 if there is no PLT0.
3073 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3074 second and third slots in the PLT entry if there is no PLT0.
3075 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3076 if there is no PLT0. Set sh_entsize on the .plt.got section.
3077 (elf_i386_nacl_plt): Forward declaration.
3078 (elf_i386_get_plt_sym_val): Removed.
3079 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3080 against all dynamic relocations.
3081 (elf_i386_link_setup_gnu_properties): New function.
3082 (elf_backend_create_dynamic_sections): Updated.
3083 (elf_backend_setup_gnu_properties): New.
3084 (elf_i386_nacl_plt): Updated.
3085 (elf_i386_nacl_arch_bed): Likewise.
3086 (elf_i386_vxworks_arch_bed): Likewise.
3088 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3090 * elflink.c (elf_output_implib): Remove executable flag from import
3092 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3093 library is a relocatable object file.
3095 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3098 * elf32-avr.c (avr_should_move_sym): New function.
3099 (avr_should_reduce_sym_size): Likewise.
3100 (avr_should_increase_sym_size): Likewise.
3101 (elf32_avr_relax_delete_bytes): Adjust symbol values
3102 and sizes by calling new functions.
3104 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3106 * config.bfd (riscv32-*): Enable rv64.
3108 2017-05-02 Alan Modra <amodra@gmail.com>
3111 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3112 rather than h->root.type == bfd_link_hash_new.
3113 (bfd_elf_record_link_assignment): Similarly, call
3114 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3116 2017-04-29 Alan Modra <amodra@gmail.com>
3119 * reloc.c (reloc_offset_in_range): New function.
3120 (bfd_perform_relocation, bfd_install_relocation): Use it.
3121 (_bfd_final_link_relocate): Likewise.
3123 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3125 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3126 before using .plt.got.
3127 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3129 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3131 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3132 instead of "+=" to update 0.
3134 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3136 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3137 .plt.got section here.
3138 (elf_i386_check_relocs): Don't create the .plt.got section.
3139 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3140 the .plt.got and .plt.bnd sections here.
3141 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3144 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3146 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3148 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3149 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3150 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3151 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3154 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3156 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3158 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3159 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3160 the first relocatable ELF input with GNU properties.
3162 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3164 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3165 VxWorks for non-PIC.
3167 2017-04-27 Alan Modra <amodra@gmail.com>
3169 * elf-bfd.h (struct elf_backend_data): Make asection param of
3170 elf_backend_eh_frame_address_size const.
3171 (_bfd_elf_eh_frame_address_size): Likewise.
3172 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3173 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3174 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3175 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3176 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3177 (next_cie_fde_offset): Constify params.
3178 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3180 2017-04-27 Alan Modra <amodra@gmail.com>
3182 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3183 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3184 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3186 (offset_adjust): New function.
3187 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3188 (adjust_eh_frame_local_symbols): Likewise.
3189 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3190 after changing anything. Return true if anything changed.
3191 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3192 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3194 2017-04-27 Alan Modra <amodra@gmail.com>
3196 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3199 2017-04-27 Alan Modra <amodra@gmail.com>
3201 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3202 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3203 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3204 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3205 for undef and undefweak dyn_relocs.
3206 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3207 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3208 (allocate_got, allocate_dynrelocs): Likewise.
3209 (ppc64_elf_relocate_section): Likewise.
3211 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3213 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3214 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3215 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3216 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3218 2017-04-26 Nick Clifton <nickc@redhat.com>
3221 * reloc.c (bfd_perform_relocation): Check for a negative address
3224 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3227 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3229 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3230 (elf_backend_always_renumber_dynsyms): Define.
3231 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3232 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3233 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3234 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3236 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3238 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3240 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3241 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3242 sections have been created.
3244 2017-04-26 Nick Clifton <nickc@redhat.com>
3247 * compress.c (bfd_init_section_compress_status): Check the return
3248 value from bfd_malloc.
3250 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3252 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3253 no_finish_dynamic_symbol.
3254 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3256 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3257 weak symbol, don't make it dynamic.
3258 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3259 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3260 relocation for GOT reference.
3261 (elf_x86_64_finish_dynamic_symbol): Abort if
3262 no_finish_dynamic_symbol isn't 0.
3264 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3267 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3268 undefined weak symbol, don't make it dynamic.
3269 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3270 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3271 relocation for R_386_GOT32.
3273 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3276 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3278 2017-04-23 Alan Modra <amodra@gmail.com>
3281 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3282 * elf.c (lcomm_sym): New.
3283 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3284 * bfd-in2.h: Regenerate.
3286 2017-04-23 Alan Modra <amodra@gmail.com>
3289 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3290 parameters and comment.
3291 (_bfd_elf_get_reloc_section): Delete.
3292 (_bfd_elf_plt_get_reloc_section): Declare.
3293 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3294 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3296 (_bfd_elf_get_reloc_section): ..here. Delete.
3297 (assign_section_numbers): Call elf_get_reloc_section.
3298 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3299 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3301 2017-04-23 Alan Modra <amodra@gmail.com>
3304 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3307 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3310 * elf32-i386.c (elf_i386_link_hash_entry): Add
3311 no_finish_dynamic_symbol.
3312 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3313 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3314 symbol, don't make it dynamic in PIE.
3315 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3316 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3317 relocation for R_386_GOT32
3318 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3321 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3325 * elflink.c (elf_link_add_object_symbols): Require
3326 --no-dynamic-linker with -E/--dynamic-list when creating
3329 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3331 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3334 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3336 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3337 dynamic symbol sorting.
3339 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3342 * elflink.c (elf_link_add_object_symbols): Preserve
3343 dynamic_ref_after_ir_def when restoring the symbol table for
3344 unneeded dynamic object.
3346 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3349 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3350 on on undefined IFUNC symbol in the second PLT.
3352 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3354 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3356 2017-04-19 Alan Modra <amodra@gmail.com>
3358 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3359 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3360 * elf32-ppc.c:Formatting.
3361 (ensure_undefweak_dynamic): Don't make dynamic when
3362 info->dynamic_undefined_weak is zero.
3363 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3364 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3365 not default visibility. Discard undef and undefweak
3367 (ppc_elf_relocate_section): Adjust to suit.
3368 * elf64-ppc.c: Formatting.
3369 (ensure_undefweak_dynamic): Don't make dynamic when
3370 info->dynamic_undefined_weak is zero.
3371 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3372 info->dynamic_undefined_weak. Discard them earlier.
3374 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3377 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3378 before generating the version definition section.
3380 2017-04-17 Alan Modra <amodra@gmail.com>
3382 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3383 state when a regular object file defines a symbol with
3384 incompatible type to that defined by an earlier shared lib.
3386 2017-04-13 Alan Modra <amodra@gmail.com>
3388 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3390 * elf32-arm.c: Likewise.
3391 * elf32-i386.c: Likewise.
3392 * elf32-mep.c: Likewise.
3393 * elf64-ia64-vms.c: Likewise.
3394 * elf64-x86-64.c: Likewise.
3395 * elflink.c: Likewise.
3396 * elfnn-ia64.c: Likewise.
3397 * elfxx-mips.c: Likewise.
3399 2017-04-13 Alan Modra <amodra@gmail.com>
3401 * aoutx.h: Use %B and %A in error messages throughout file.
3402 * aout-cris.c: Likewise.
3403 * archive.c: Likewise.
3404 * binary.c: Likewise.
3405 * coff-rs6000.c: Likewise.
3406 * coff-tic4x.c: Likewise.
3407 * coffcode.h: Likewise.
3408 * coffgen.c: Likewise.
3409 * cofflink.c: Likewise.
3410 * coffswap.h: Likewise.
3411 * cpu-arm.c: Likewise.
3412 * elf-eh-frame.c: Likewise.
3413 * elf-m10300.c: Likewise.
3415 * elf32-arc.c: Likewise.
3416 * elf32-arm.c: Likewise.
3417 * elf32-bfin.c: Likewise.
3418 * elf32-frv.c: Likewise.
3419 * elf32-iq2000.c: Likewise.
3420 * elf32-m32c.c: Likewise.
3421 * elf32-microblaze.c: Likewise.
3422 * elf32-nds32.c: Likewise.
3423 * elf32-rl78.c: Likewise.
3424 * elf32-rx.c: Likewise.
3425 * elf32-score.c: Likewise.
3426 * elf32-score7.c: Likewise.
3427 * elf32-sh64.c: Likewise.
3428 * elf32-v850.c: Likewise.
3429 * elf32-vax.c: Likewise.
3430 * elf32-visium.c: Likewise.
3431 * elf64-ia64-vms.c: Likewise.
3432 * elf64-mmix.c: Likewise.
3433 * elf64-sh64.c: Likewise.
3434 * elfcode.h: Likewise.
3435 * elfnn-aarch64.c: Likewise.
3436 * elfnn-ia64.c: Likewise.
3437 * elfxx-mips.c: Likewise.
3438 * hpux-core.c: Likewise.
3441 * linker.c: Likewise.
3442 * merge.c: Likewise.
3444 * oasys.c: Likewise.
3445 * pdp11.c: Likewise.
3446 * peXXigen.c: Likewise.
3447 * rs6000-core.c: Likewise.
3448 * vms-alpha.c: Likewise.
3449 * xcofflink.c: Likewise.
3451 2017-04-13 Alan Modra <amodra@gmail.com>
3453 * bfd.c (PRINT_TYPE): Define.
3454 (_doprnt): New function.
3455 (error_handler_internal): Use _doprnt.
3456 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3457 calls in their natural order, throughout file.
3458 * coff-mcore.c: Likewise.
3459 * coff-ppc.c: Likewise.
3460 * coff-tic80.c: Likewise.
3461 * cofflink.c: Likewise.
3462 * elf-s390-common.c: Likewise.
3464 * elf32-arm.c: Likewise.
3465 * elf32-i386.c: Likewise.
3466 * elf32-m32r.c: Likewise.
3467 * elf32-msp430.c: Likewise.
3468 * elf32-spu.c: Likewise.
3469 * elf64-ia64-vms.c: Likewise.
3470 * elf64-sparc.c: Likewise.
3471 * elf64-x86-64.c: Likewise.
3472 * elflink.c: Likewise.
3473 * elfnn-aarch64.c: Likewise.
3474 * elfnn-ia64.c: Likewise.
3475 * elfxx-mips.c: Likewise.
3477 2017-04-13 Alan Modra <amodra@gmail.com>
3479 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3480 branch veneers" error. Fix double space and format message.
3481 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3482 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3484 2017-04-13 Alan Modra <amodra@gmail.com>
3486 * bfd-in2.h: Regenerate.
3488 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3490 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3491 extra `\n' in warning/error messages.
3492 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3493 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3495 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3497 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3498 processor-specific properties with generic ELF target vector.
3500 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3502 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3503 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3504 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3505 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3507 (link_hash_newfunc): Initialize has_got_reloc and
3509 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3511 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3513 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3515 (_bfd_sparc_elf_fixup_symbol): New function.
3516 (allocate_dynrelocs): Don't allocate space for dynamic
3517 relocations and discard relocations against resolved undefined
3518 weak symbols in executable. Don't make resolved undefined weak
3519 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3520 relocation against undefined weak symbols in PIE.
3521 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3522 relocations against resolved undefined weak symbols in PIE
3523 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3524 without ynamic PLT/GOT relocations for resolved undefined weak
3526 Don't generate dynamic relocation against resolved undefined
3527 weak symbol in executable.
3528 (pie_finish_undefweak_symbol): New function.
3529 (_bfd_sparc_elf_finish_dynamic_sections): Call
3530 pie_finish_undefweak_symbol on all symbols in PIE.
3531 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3532 (_bfd_sparc_elf_fixup_symbol): New function.
3534 2017-04-10 Nick Clifton <nickc@redhat.com>
3536 * config.bfd: Remove ns32k from obsolete list.
3538 2017-04-10 Alan Modra <amodra@gmail.com>
3541 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3542 (special_sections_i): Likewise for .init_array.
3543 (special_sections_p): Likewise for .preinit_array.
3545 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3549 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3550 ELF_COMMON_DEF_P for common symbols.
3551 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3552 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3553 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3554 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3555 07492f668d2173da7a2bda3707ff0985e0f460b6.
3557 2017-04-07 Pedro Alves <palves@redhat.com>
3559 * opncls.c (bfd_get_debug_link_info): Rename to...
3560 (bfd_get_debug_link_info_1): ... this. Change type of second
3561 parameter to void pointer. Adjust.
3562 (bfd_get_debug_link_info): Reimplement on top of
3563 bfd_get_debug_link_info_1.
3564 (separate_debug_file_exists, separate_alt_debug_file_exists):
3565 Change type of second parameter to void pointer. Adjust.
3566 (get_func_type, check_func_type): Change type of second parameter
3568 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3569 the callback functions instead of passing the address of a local.
3570 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3571 find_separate_debug_file.
3572 (get_alt_debug_link_info_shim): Change type of second parameter to
3573 void pointer. Adjust.
3574 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3575 find_separate_debug_file.
3576 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3577 of second parameter to void pointer. Adjust.
3578 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3579 pointer local to find_separate_debug_file.
3581 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3583 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3584 external symbols with a definition.
3585 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3587 2017-04-07 Alan Modra <amodra@gmail.com>
3589 * po/SRC-POTFILES.in: Regenerate.
3591 2017-04-05 Alan Modra <amodra@gmail.com>
3593 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3596 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3598 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3599 numbers for DataDirectory entry indicies passed to
3602 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3604 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3605 each GNU_MBIND section and align GNU_MBIND section to page size.
3606 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3607 segment for each GNU_MBIND section.
3608 (_bfd_elf_init_private_section_data): Copy sh_info from input
3609 for GNU_MBIND section.
3611 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3613 * elfnn-riscv.c (GP_NAME): Delete.
3614 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3615 (_bfd_riscv_relax_lui): Likewise.
3617 2017-04-04 Nick Clifton <nickc@redhat.com>
3620 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3622 (bfd_elf_final_link): Only initialize the extended symbol index
3623 section if there are extended symbol tables to list.
3625 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3627 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3628 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3629 * configure.ac (elf): Add elf-properties.lo.
3630 * Makefile.in: Regenerated.
3631 * configure: Likewise.
3632 * elf-bfd.h (elf_property_kind): New.
3633 (elf_property): Likewise.
3634 (elf_property_list): Likewise.
3635 (elf_properties): Likewise.
3636 (_bfd_elf_parse_gnu_properties): Likewise.
3637 (_bfd_elf_get_property): Likewise.
3638 (_bfd_elf_link_setup_gnu_properties): Likewise.
3639 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3640 and setup_gnu_properties.
3641 (elf_obj_tdata): Add properties.
3642 * elf-properties.c: New file.
3643 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3644 (elf_i386_merge_gnu_properties): Likewise.
3645 (elf_backend_parse_gnu_properties): Likewise.
3646 (elf_backend_merge_gnu_properties): Likewise.
3647 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3648 (elf_x86_64_merge_gnu_properties): Likewise.
3649 (elf_backend_parse_gnu_properties): Likewise.
3650 (elf_backend_merge_gnu_properties): Likewise.
3651 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3652 (elf_backend_parse_gnu_properties): Likewise.
3653 (elf_backend_setup_gnu_properties): Likewise.
3654 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3655 elf_backend_merge_gnu_properties and
3656 elf_backend_setup_gnu_properties.
3658 2017-03-30 Pip Cet <pipcet@gmail.com>
3660 * elf32-wasm32.c: Add relocation code, two relocs.
3661 * reloc.c: Add wasm32 relocations.
3662 * libbfd.h: Regenerate.
3663 * bfd-in2.h: Regenerate.
3664 * bfd/po/bfd.pot: Regenerate.
3666 2017-03-29 Nick Clifton <nickc@redhat.com>
3669 * coff-bfd.h (struct coff_section_data): Add new fields:
3670 saved_bias and bias.
3671 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3672 computed for PE binaries.
3673 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3676 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3679 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3680 to handle a local symbol with a hash-symbol-entry; without PLT.
3681 Add BFD_ASSERT for an incidental case with GOT entry present.
3682 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3683 isn't forced-or-set local.
3685 2017-03-27 Pip Cet <pipcet@gmail.com>
3687 * wasm-module.c: New file to support WebAssembly modules.
3688 * wasm-module.h: New file to support WebAssembly modules.
3689 * doc/webassembly.texi: Start documenting wasm-module.c.
3690 * config.bfd: Add wasm_vec.
3691 * targets.c: Likewise.
3692 * configure.ac: Likewise.
3693 * Makefile.am: Add entries for wasm-module.c.
3694 * Makefile.in: Regenerate.
3695 * configure: Regenerate.
3696 * po/SRC-POTFILES.in: Regenerate.
3698 2017-03-27 Pip Cet <pipcet@gmail.com>
3700 * cpu-wasm32.c: New file to support wasm32 architecture.
3701 * elf32-wasm32.c: New file to support wasm32 architecture.
3702 * Makefile.am: Add wasm32 architecture.
3703 * archures.c: Likewise.
3704 * config.bfd: Likewise.
3705 * configure.ac: Likewise.
3706 * targets.c: Likewise.
3707 * Makefile.in: Regenerate.
3708 * bfd-in2.h: Regenerate.
3709 * configure: Regenerate.
3710 * po/SRC-POTFILES.in: Regenerate.
3712 2017-03-20 Alan Modra <amodra@gmail.com>
3715 * elf64-ppc.c (compare_symbols): Stabilize sort.
3717 2017-03-18 Alan Modra <amodra@gmail.com>
3719 * elf64-ppc.c (struct ppc_link_hash_table): Add
3720 local_ifunc_resolver and maybe_local_ifunc_resolver.
3721 (ppc_build_one_stub): Set flags on emitting dynamic
3722 relocation to ifunc.
3723 (ppc64_elf_relocate_section): Likewise.
3724 (ppc64_elf_finish_dynamic_symbol): Likewise.
3725 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3726 local dynamic relocs to ifuncs.
3727 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3728 local_ifunc_resolver and maybe_local_ifunc_resolver.
3729 (ppc_elf_relocate_section): Set flag on emitting dynamic
3730 relocation to ifuncs.
3731 (ppc_elf_finish_dynamic_symbol): Likewise.
3732 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3733 dynamic relocs to ifuncs.
3735 2017-03-13 Nick Clifton <nickc@redhat.com>
3738 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3739 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3740 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3741 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3742 * bfd-in2.h: Regenerate.
3743 * libbfd.h: Regenerate.
3744 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3746 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3747 (elfNN_aarch64_howto_table): Likewise.
3748 (aarch64_tls_transition_without_check): Likewise.
3749 (aarch64_reloc_got_type): Likewise.
3750 (elfNN_aarch64_final_link_relocate): Likewise.
3751 (elfNN_aarch64_tls_relax): Likewise.
3752 (elfNN_aarch64_relocate_section): Likewise.
3753 (elfNN_aarch64_gc_sweep_hook): Likewise.
3754 (elfNN_aarch64_check_relocs): Likewise.
3755 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3756 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3758 2017-03-11 Alan Modra <amodra@gmail.com>
3760 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3761 parameter is in fact used. Whitespace fixes.
3762 * elf64-ppc.c: Likewise.
3764 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3766 * rs6000-core.c (CORE_NEW): Simplify macro when
3767 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3769 2017-03-07 Alan Modra <amodra@gmail.com>
3773 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3776 2017-03-05 Alan Modra <amodra@gmail.com>
3778 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3779 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3780 (next_cie_fde_offset): New function.
3781 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3782 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3783 four bytes. Align CIEs to four or eight bytes depending on
3784 per_encoding_aligned8. Align FDEs according to their encoding.
3785 Pad last FDE to output section alignment.
3786 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3788 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3789 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3790 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3792 2017-03-02 Martin Bickel <binutils@ineranves.de>
3795 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3796 empty segments which have a zero filesz, but a non-zero memsz.
3798 2017-03-02 Alan Modra <amodra@gmail.com>
3800 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3802 2017-02-28 Alan Modra <amodra@gmail.com>
3804 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3805 (ppc64_elf_relocate_section): Likewise.
3807 2017-02-28 Alan Modra <amodra@gmail.com>
3810 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3811 rather than elf32_nios2_hash_table or elf_hash_table.
3812 (create_got_section): Likewise.
3813 (nios2_elf32_finish_dynamic_symbol): Likewise.
3814 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3815 (nios2_elf32_size_dynamic_sections): Likewise.
3816 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3817 vars. Use htab equivalents directly instead. Don't create
3818 all dynamic sections on needing just the GOT. Use a goto
3819 rather than a fall-through with reloc test. Ensure
3820 htab->dynobj is set when making dynamic sreloc section.
3821 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3822 equivalent directly instead. Don't segfault on looking for
3823 .dynamic when dynamic sections have not been created. Don't
3824 segfault on .got.plt being discarded.
3825 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3826 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3827 fixme and another not so relevant comment.
3828 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3829 already set, set hash table dynobj on creating .sbss.
3831 2017-02-28 Alan Modra <amodra@gmail.com>
3833 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3834 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3835 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3836 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3837 (ppc64_elf_relocate_section): Likewise.
3838 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3839 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3840 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3841 * libbfd.h: Regenerate.
3842 * bfd-in2.h: Regenerate.
3844 2017-02-28 Alan Modra <amodra@gmail.com>
3846 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3847 dynamic .data.rel.ro read-only.
3848 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3849 rather than section flags when deciding where copy reloc goes.
3850 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3851 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3852 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3853 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3854 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3855 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3856 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3857 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3858 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3859 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3860 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3861 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3862 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3863 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3864 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3865 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3866 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3867 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3868 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3870 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3872 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3873 `jalr $0, $25' instruction encoding.
3875 2017-02-27 Nick Clifton <nickc@redhat.com>
3878 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3879 generating a seg-fault when encountering a symbol that has been
3880 deleted by garbage collection.
3882 2017-02-25 Alan Modra <amodra@gmail.com>
3884 * elf32-arc.c (struct dynamic_sections): Delete.
3885 (enum dyn_section_types): Delete.
3886 (dyn_section_names): Delete.
3887 (arc_create_dynamic_sections): Delete.
3888 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3889 segfault on discarded .rela.plt section.
3890 (elf_arc_size_dynamic_sections): Formatting. Don't call
3891 arc_create_dynamic_sections. Don't allocate memory for sections
3892 handled by the generic linker. Correct code finding relocs in
3893 read-only sections. Set SEC_EXCLUDE on zero size .got,
3894 .got.plt, and .dynbss sections. Do set .interp for pies.
3896 2017-02-24 Andrew Waterman <andrew@sifive.com>
3898 * elfnn-riscv.c (GP_NAME): New macro.
3899 (riscv_global_pointer_value): Use it.
3900 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3901 output section, consider only that section's alignment.
3903 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3905 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3906 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3907 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3908 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3910 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3912 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3913 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3916 2017-02-23 Alan Modra <amodra@gmail.com>
3919 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3921 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3922 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3925 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3928 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3929 processing ahead of the call to `elf_gc_sweep_symbol'.
3931 2017-02-22 Nick Clifton <nickc@redhat.com>
3934 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3935 created section 4-byte alignment.
3937 2017-02-22 Alan Modra <amodra@gmail.com>
3939 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3940 on .got or .plt output section being discarded by script.
3941 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3944 2017-02-21 Alan Modra <amodra@gmail.com>
3946 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3947 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3949 2017-02-20 Alan Modra <amodra@gmail.com>
3952 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3953 if DT_RELSZ/DT_RELASZ is zero.
3955 2017-02-17 Nick Clifton <nickc@redhat.com>
3957 * compress.c (bfd_get_full_section_contents): Remember to reduce
3958 compressed size by the sizeof the compression header when
3959 decompressing the contents.
3961 2017-02-17 Pedro Alves <palves@redhat.com>
3963 * srec.c (Chunk): Rename to ...
3964 (_bfd_srec_len): ... this.
3965 (S3Forced): Rename to ...
3966 (_bfd_srec_forceS3): ... this.
3967 * objcopy.c: Adjust all references.
3969 2017-02-17 Pedro Alves <palves@redhat.com>
3971 * archive.c (bsd_write_armap): Rename to ...
3972 (_bfd_bsd_write_armap): ... this.
3973 (coff_write_armap): Rename to ...
3974 (_bfd_coff_write_armap): ... this.
3975 * libbfd-in.h (bsd_write_armap): Rename to ...
3976 (_bfd_bsd_write_armap): ... this.
3977 (coff_write_armap): Rename to ...
3978 (_bfd_coff_write_armap): ... this.
3979 * aout-target.h, aout-tic30.c: Adjust all users.
3980 * libbfd.h: Regenerate.
3982 2017-02-17 Pedro Alves <palves@redhat.com>
3984 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3985 (warn_deprecated): Rename to ...
3986 (_bfd_warn_deprecated): ... this.
3987 * libbfd.c (warn_deprecated): Rename to ...
3988 (_bfd_warn_deprecated): ... this.
3989 * bfd-in2.h: Regenerate.
3991 2017-02-17 Pedro Alves <palves@redhat.com>
3993 * bfdio.c (real_ftell): Rename to ...
3994 (_bfd_real_ftell): ... this.
3995 (real_fseek): Rename to ...
3996 (_bfd_real_fseek): ... this.
3997 (real_fopen): Rename to ...
3998 (_bfd_real_fopen): ... this.
3999 * libbfd-in.h (real_ftell): Rename to ...
4000 (_bfd_real_ftell): ... this.
4001 (real_fseek): Rename to ...
4002 (_bfd_real_fseek): ... this.
4003 (real_fopen): Rename to ...
4004 (_bfd_real_fopen): ... this.
4005 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4006 * libbfd.h: Regenerate.
4008 2017-02-17 Pedro Alves <palves@redhat.com>
4010 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4011 * libbfd.c (read_unsigned_leb128): Rename to ...
4012 (_bfd_read_unsigned_leb128): ... this.
4013 (read_signed_leb128): Rename to ...
4014 (_bfd_read_signed_leb128): ... this.
4015 (safe_read_leb128): Rename to ...
4016 (_bfd_safe_read_leb128): ... this.
4017 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4018 (_bfd_read_unsigned_leb128): ... this.
4019 (read_signed_leb128): Rename to ...
4020 (_bfd_read_signed_leb128): ... this.
4021 (safe_read_leb128): Rename to ...
4022 (_bfd_safe_read_leb128): ... this.
4023 * libbfd.h: Renegerate.
4025 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4027 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4028 before trying to fine matching file and line information.
4030 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4032 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4033 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4034 not match current bfd, then reload debug information. Record bfd
4035 we're loading debug info for in the stash. If we have debug
4036 informatin in the cache then perform section placement before
4039 2017-02-16 Alan Modra <amodra@gmail.com>
4042 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4043 * elfxx-target.h (elf_backend_no_page_alias): Define.
4044 (elfNN_bed): Init new field.
4045 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4046 ensure PT_LOAD segment starts on a new page.
4047 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4049 2017-02-16 Alan Modra <amodra@gmail.com>
4052 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4055 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4057 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4058 * bfd-in2.h: Regenerated.
4060 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4063 * elf32-i386.c (elf_i386_relocate_section): Allow
4064 "lea foo@GOT, %reg" in PIC.
4066 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4069 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4070 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4071 error against local IFUNC symbol without a base register for
4074 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4076 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4077 `%P: %H:' with `info->callbacks->einfo'.
4078 (ppc_elf_relocate_section): Likewise.
4079 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4080 (ppc64_elf_edit_toc): Likewise.
4081 (ppc64_elf_relocate_section): Likewise.
4083 2017-02-14 Alan Modra <amodra@gmail.com>
4085 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4086 --gc-keep-exported, and test versioned field of sym rather than
4087 looking for @ in name.
4089 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4091 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4094 2017-02-13 Nick Clifton <nickc@redhat.com>
4097 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4100 2017-02-07 Andrew Waterman <andrew@sifive.com>
4102 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4103 entry size if PLT header is written.
4105 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4107 Fix sparc64 dynamic relocation processing to use the dynamic
4109 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4110 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4113 2017-02-03 Nick Clifton <nickc@redhat.com>
4116 * coffcode.h (coff_write_object_contents): Enlarge size of
4117 s_name_buf in order to avoid compile time warning about possible
4119 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4120 32-bits of insn value before printing into buffer.
4122 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4124 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4125 `max_local_dynindx'.
4126 (mips_elf_sort_hash_table): Handle it.
4127 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4128 symbols bump up `max_local_dynindx' rather than
4129 `max_non_got_dynindx'.
4131 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4133 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4134 `min_got_dynindx', `max_unref_got_dynindx' and
4135 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4136 (mips_elf_sort_hash_table): Adjust accordingly.
4138 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4140 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4141 to access the hash table.
4143 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4145 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4146 non-NULL `htab' to the beginning.
4148 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4150 * elflink.c (elf_gc_sweep): Wrap overlong line.
4152 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4154 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4155 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4156 * elfxx-mips.c (mips_elf_link_hash_table): Add
4157 `ignore_branch_isa' member.
4158 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4159 in branch relocation calculation as an error if
4160 `ignore_branch_isa' has been set.
4161 (_bfd_mips_elf_insn32): Rename to...
4162 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4163 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4164 Handle the new parameter.
4166 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4168 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4169 local variable dynobj.
4172 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4173 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4174 executable from read-only sections into sdynrelro.
4175 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4176 dynamic relocs in sdynrelro.
4177 (elf_backend_want_dynrelro): Define.
4179 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4181 * config.bfd (*-*-rtemsaout*): Mark as removed.
4183 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4185 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4186 (arm-*-rtems*): Move to (arm*-*-eabi*).
4187 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4188 (m68-*-rtems*): Move to (m68*-*-elf*).
4190 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4192 * config.bfd (*-*-rtemscoff*): Mark as removed.
4194 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4197 * elflink.c (bfd_elf_record_link_assignment): Revert last
4198 change and don't ever clear `forced_local'. Set `mark'
4200 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4202 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4203 (bfd_elf_size_dynamic_sections): ... here.
4204 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4205 and set `mark' instead in `__tls_get_addr_opt' processing.
4206 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4208 2017-01-24 Alan Modra <amodra@gmail.com>
4210 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4211 where dynamic relocs are preferable. Allow ifunc too.
4212 (ensure_undefweak_dynamic): New function.
4213 (allocate_dynrelocs): Use it here. Move plt handling last and
4214 don't make symbols dynamic, simplifying loop. Only make undef
4215 weak symbols with GOT entries dynamic. Correct condition
4216 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4217 comments. Remove goto.
4218 (ppc_elf_relocate_section): Correct test for using dynamic
4219 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4220 to suit. Set up explicit tls_index entries and implicit GOT
4221 tls_index entries resolvable at link time for
4222 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4223 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4224 (ensure_undefweak_dynamic): New function.
4225 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4226 with GOT entries dynamic. Remove unnecessary test of
4227 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4228 (ppc64_elf_relocate_section): Correct test for using dynamic
4229 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4230 to suit. Set up explicit tls_index entries and implicit GOT
4231 tls_index entries resolvable at link time for __tls_get_addr_opt.
4232 Simplify expression to clear mem for prelink.
4234 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4236 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4238 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4240 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4241 (elf_backend_hash_symbol): Define.
4243 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4246 * elflink.c (bfd_elf_record_link_assignment): Clear any
4247 `forced_local' marking for DSO symbols that are not being
4250 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4252 * elfnn-riscv.c (riscv_elf_object_p): New function.
4254 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4257 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4259 (elf_x86_64_check_relocs): Create .eh_frame section for the
4261 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4262 .eh_frame section for the .plt.bnd section.
4263 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4264 for the .plt.bnd section.
4266 2017-01-12 Nick Clifton <nickc@redhat.com>
4269 * opncls.c (find_separate_debug_file): Add include_dirs
4270 parameter. Only include the directory part of the bfd's filename
4271 in search paths if include_dirs is true. Add a couple of extra
4272 locations for looking for debug files.
4273 ( bfd_follow_gnu_debuglink): Update invocation of
4274 find_separate_debug_file.
4275 (bfd_follow_gnu_debugaltlink): Likewise.
4276 (get_build_id): New function: Finds the build-id of the given bfd.
4277 (get_build_id_name): New function: Computes the name of the
4278 separate debug info file for a bfd, based upon its build-id.
4279 (check_build_id_file): New function: Checks to see if a separate
4280 debug info file exists at the given location, and that its
4281 build-id matches that of the original bfd.
4282 (bfd_follow_build_id_debuglink): New function: Finds a separate
4283 debug info file for a given bfd by using the build-id method.
4284 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4285 method of locating a separate debug info file before using the
4287 * bfd-in2.h: Regenerate.
4289 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4292 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4293 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4294 elf_x86_64_eh_frame_plt_got.
4295 (elf_x86_64_size_dynamic_sections): Get unwind info from
4296 elf_x86_64_bnd_arch_bed for the BND PLT.
4298 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4300 * config.bfd: Add entries for i686-redox and x86_64-redox.
4302 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4304 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4306 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4307 .eh_frame section to 4 bytes for x32.
4308 (elf_x86_64_check_relocs): Likewise.
4310 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4313 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4314 (PLT_GOT_FDE_LENGTH): Likewise.
4315 (elf_i386_plt_layout): Add eh_frame_plt_got and
4316 eh_frame_plt_got_size.
4317 (elf_i386_plt): Updated.
4318 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4319 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4320 (elf_i386_size_dynamic_sections): Allocate and initialize
4321 .eh_frame section for .plt.got.
4322 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4324 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4325 eh_frame_plt_got_size.
4326 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4327 (PLT_GOT_FDE_LENGTH): Likewise.
4328 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4329 eh_frame_plt_got_size.
4330 (elf_x86_64_arch_bed): Updated.
4331 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4332 eh_frame_plt_got_size.
4333 (elf_x86_64_nacl_arch_bed): Likewise.
4334 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4335 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4336 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4337 .eh_frame section for .plt.got.
4338 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4341 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4343 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4344 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4346 2017-01-09 Nick Clifton <nickc@redhat.com>
4348 * dwarf2.c (lookup_address_in_function_table): Return early if
4349 there are no functions in the given comp unit, or if the high
4350 address of the last function in the comp unit is less than the
4353 2017-01-09 Nick Clifton <nickc@redhat.com>
4356 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4357 message if there are too many symbols to load.
4359 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4361 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4362 if relocs are cached.
4364 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4367 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4368 for R_MICROBLAZE_GOTOFF_64.
4370 2017-01-03 Nick Clifton <nickc@redhat.com>
4372 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4373 warning about using a possibly uninitialised variable.
4375 2017-01-02 Alan Modra <amodra@gmail.com>
4377 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4378 (allocate_plt_static, allocate_dynrelocs): Use it.
4380 2017-01-02 Alan Modra <amodra@gmail.com>
4382 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4383 .PARISC.unwind section.
4385 2017-01-02 Alan Modra <amodra@gmail.com>
4388 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4389 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4390 indirect to GOT pointer relative code edit.
4392 2017-01-02 Alan Modra <amodra@gmail.com>
4394 Update year range in copyright notice of all files.
4396 For older changes see ChangeLog-2016
4398 Copyright (C) 2017 Free Software Foundation, Inc.
4400 Copying and distribution of this file, with or without modification,
4401 are permitted in any medium without royalty provided the copyright
4402 notice and this notice are preserved.
4408 version-control: never