1 2017-10-06 John Baldwin <jhb@FreeBSD.org>
3 * elf-bfd.h (struct elf_backend_data): Add
4 `elf_backend_grok_freebsd_prstatus'.
5 * elf.c (elfcore_grok_freebsd_note): Call
6 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
8 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
10 (elf_backend_grok_freebsd_prstatus): Define.
11 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
12 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
14 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
16 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
17 and has_non_got_reloc with zero_undefweak.
18 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
19 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
21 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
22 has_non_got_reloc with zero_undefweak.
23 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
24 has_got_reloc and has_non_got_reloc with zero_undefweak.
25 (elf_x86_link_hash_entry): Likewise.
27 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
29 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
30 (VERIFY_COPY_RELOC): Likewise.
32 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
34 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
35 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
36 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
38 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
40 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
41 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
42 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
44 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
46 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
47 * elf32-i386.c (elf_i386_relocate_section): Use it.
48 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
50 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
52 * elf32-i386.c (X86_SIZE_TYPE_P): New.
53 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
54 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
55 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
56 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
58 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
60 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
61 (PLT_LOCAL_IFUNC_P): Likewise.
62 * elf32-i386.c (elf_i386_relocate_section): Use them.
63 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
65 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
67 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
68 * elf32-i386.c (elf_i386_relocate_section): Use it.
69 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
71 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
73 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
74 * elf32-i386.c (elf_i386_relocate_section): Use it.
75 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
77 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
79 * elf32-i386.c (X86_PCREL_TYPE_P): New.
80 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
81 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
82 (X86_PCREL_TYPE_P): This.
83 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
84 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
85 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
87 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
89 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
91 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
92 * elf32-i386.c (elf_i386_tls_transition): Use it.
93 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
95 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
97 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
98 Dump dynamic relocation in read-only section with minfo if
100 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
101 (maybe_set_textrel): Likewise.
102 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
103 read-only section with minfo.
105 2017-10-05 John Baldwin <jhb@FreeBSD.org>
107 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
109 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
111 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
112 in read-only section with minfo.
113 (tilepro_elf_size_dynamic_sections): Likewise.
114 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
115 (tilegx_elf_size_dynamic_sections): Likewise.
117 2017-10-05 Pedro Alves <palves@redhat.com>
120 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
121 ellipsis parameter. Split out bfd_error_on_input code to..
122 (bfd_set_input_error): .. New function.
123 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
124 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
125 * bfd-in2.h: Regenerate.
127 2017-10-05 Alan Modra <amodra@gmail.com>
129 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
130 fini_array error value.
132 2017-10-05 Alan Modra <amodra@gmail.com>
135 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
137 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
139 (elf_fake_sections): Adjust calls. Exit immediately on failure.
140 (bfd_elf_set_group_contents): Add associated reloc section indices
143 2017-10-04 Alan Modra <amodra@gmail.com>
145 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
146 classify symbols for ELFv2.
148 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
151 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
152 undergoes default promotion.
153 * bfd-in2.h: Regenerate.
155 2017-10-02 Alan Modra <amodra@gmail.com>
157 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
158 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
160 2017-10-01 Alan Modra <amodra@gmail.com>
163 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
164 (add_line_info): Always put end_sequence last.
166 2017-10-01 Alan Modra <amodra@gmail.com>
169 * dwarf2.c (read_section): Allocate buffer with extra byte for
170 bfd_simple_get_relocated_section_contents rather than copying
173 2017-09-29 Alan Modra <amodra@gmail.com>
175 * merge.c (merge_strings): Return FALSE on malloc failure.
176 (_bfd_merge_sections): Return failures from record_section and
179 2017-09-28 Alan Modra <amodra@gmail.com>
182 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
183 a case where plugin_notice isn't called.
185 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
187 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
190 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
193 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
194 output_bfd to info->callbacks->minfo.
196 2017-09-26 Nick Clifton <nickc@redhat.com>
199 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
200 assertion failure if elf_x86_64_rtype_to_howto has already issued
203 2017-09-26 Alan Modra <amodra@gmail.com>
206 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
209 2017-09-26 Nick Clifton <nickc@redhat.com>
212 * dwarf2.c (read_formatted_entries): Fail early if we know that
213 the loop parsing data entries will overflow the end of the
216 2017-09-26 Alan Modra <amodra@gmail.com>
219 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
220 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
221 to stash->info_ptr_memory, and check die_ref is within that memory.
222 Set info_ptr_end correctly when another CU is refd. Check die_ref
223 for DW_FORM_ref4 etc. is within CU.
225 2017-09-26 Alan Modra <amodra@gmail.com>
228 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
229 (read_formatted_entries): Init "fe".
230 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
232 2017-09-26 Alan Modra <amodra@gmail.com>
235 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
236 bounds in inner loop.
238 2017-09-25 Alan Modra <amodra@gmail.com>
241 * dwarf1.c (parse_die): Sanity check pointer against section limit
242 before dereferencing.
243 (parse_line_table): Likewise.
245 2017-09-25 Alan Modra <amodra@gmail.com>
248 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
250 (parse_comp_unit): Likewise.
252 2017-09-25 Alan Modra <amodra@gmail.com>
255 * dwarf2.c (read_formatted_entries): Error on format_count zero.
257 2017-09-24 Alan Modra <amodra@gmail.com>
260 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
261 within section bounds.
263 2017-09-24 Alan Modra <amodra@gmail.com>
266 * dwarf2.c (decode_line_info): Properly free line sequences on error.
268 2017-09-24 Alan Modra <amodra@gmail.com>
271 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
272 pname param. Return status. Make name const. Don't abort,
273 return an error. Formatting. Exit if current info_ptr matches
274 orig_info_ptr. Update callers.
275 (scan_unit_for_symbols): Start at nesting_level of zero. Make
276 nested_funcs an array of structs for extensibility. Formatting.
278 2017-09-24 Alan Modra <amodra@gmail.com>
281 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
282 rather than dividing by zero.
284 2017-09-24 Alan Modra <amodra@gmail.com>
287 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
289 2017-09-24 Alan Modra <amodra@gmail.com>
292 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
294 2017-09-24 Alan Modra <amodra@gmail.com>
297 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
298 SHT_GNU_verneed section for sanity. Don't zalloc memory for
301 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
304 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
307 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
310 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
311 -1 if bfd_canonicalize_dynamic_reloc returns 0.
313 2017-09-22 Pedro Alves <palves@redhat.com>
314 Alan Modra <amodra@gmail.com>
316 * version.h: Add comment.
318 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
320 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
321 NT_S390_GS_BC, correct the previously swapped invocations of
322 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
324 2017-09-19 Alan Modra <amodra@gmail.com>
327 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
330 2017-09-19 Alan Modra <amodra@gmail.com>
333 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
334 symbols before calculating verrefs. Don't renumber dynsyms
335 after gc. Exclude .gnu.version when zero or one dynsym.
336 Localize some vars and reindent.
338 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
341 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
342 return from bfd_canonicalize_dynamic_reloc.
344 2017-09-15 Alan Modra <amodra@gmail.com>
347 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
348 overflows bfd_size_type.
350 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
353 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
354 to indicate if conversion is performed.
355 (elf_i386_check_relocs): Cache section contents and relocations
356 if conversion is performed.
357 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
358 contents and relocations if conversion is performed.
360 2017-09-14 Nick Clifton <nickc@redhat.com>
363 * peXXigen.c (pe_print_idata): Extend check for HintName vector
366 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
368 * elfxx-x86.h: Fix a typo in comments.
370 2017-09-09 Kamil Rytarowski <n54@gmx.com>
372 * elf32-nds32.c: Rename __BIT() to N32_BIT().
374 2017-09-09 Alan Modra <amodra@gmail.com>
376 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
379 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
381 * elf32-i386.c (elf_i386_relocate_section): Update usage of
382 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
383 (elf_i386_finish_dynamic_symbol): Likewise.
384 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
385 (elf_x86_64_finish_dynamic_symbol): Likewise.
386 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
387 (_bfd_x86_elf_fixup_symbol): Likewise.
389 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
391 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
392 check has_non_got_reloc.
394 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
397 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
398 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
399 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
400 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
401 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
402 and linker_def on __ehdr_start if it is referenced and not
404 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
405 and return TRUE when building executable, if a symbol has
406 non-GOT/non-PLT relocations in text section or there is no
408 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
410 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
412 * elfxx-x86.h: Update comments.
414 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
416 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
417 elf_x86_plt_layout_table with elf_x86_init_table.
418 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
420 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
422 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
423 (elf_x86_init_table): This.
424 (_bfd_x86_elf_link_setup_gnu_properties): Replace
425 elf_x86_plt_layout_table with elf_x86_init_table.
427 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
429 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
430 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
431 * configure: Regenerated.
432 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
433 and r_sym fields of plt_layout.
434 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
436 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
437 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
438 r_info nor r_sym fields.
439 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
441 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
443 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
445 * (_bfd_riscv_relax_align): Call bfd_set_error and
446 print an error message when unable to relax a .align directive.
448 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
450 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
451 (riscv_record_pcrel_hi_reloc): Add absolute argument.
452 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
453 R_RISCV_PCREL_HI20 relocs, and pass the result to
454 riscv_record_pcrel_hi_reloc.
456 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
458 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
459 r_type_p. Remove the converted argument. Replace
460 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
461 the new relocation type via r_type_p.
462 (elf_i386_relocate_section): Likewise.
463 (elf_i386_finish_dynamic_symbol): Likewise.
464 (need_convert_load): Removed.
465 (check_relocs_failed): Updated.
466 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
467 instead of setting need_convert_load.
468 (_bfd_i386_elf_convert_load): Removed.
469 * elf64-x86-64.c (need_convert_load): Removed.
470 (check_relocs_failed): Updated.
471 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
472 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
473 Return the new relocation type via r_type_p.
474 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
475 instead of setting need_convert_load.
476 (elf_x86_64_check_relocs): Don't check PIC if relocation has
478 (_bfd_x86_64_elf_convert_load): Removed.
479 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
480 with SYMBOL_REFERENCES_LOCAL_P.
481 (elf_x86_64_finish_dynamic_symbol): Likewise.
482 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
484 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
485 (_bfd_x86_elf_link_symbol_references_local): New function.
486 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
487 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
488 SYMBOL_REFERENCES_LOCAL_P.
489 (elf_x86_link_hash_entry): Add local_ref.
490 (elf_x86_link_hash_table): Remove convert_load.
491 (_bfd_i386_elf_convert_load): Removed.
492 (_bfd_x86_64_elf_convert_load): Likewise.
493 (_bfd_x86_elf_link_symbol_references_local): New.
495 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
497 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
498 (elf_x86_64_info_to_howto): Get the real relocation type by
499 masking out R_X86_64_converted_reloc_bit.
500 (elf_x86_64_check_tls_transition): Get the real relocation type
501 by masking out R_X86_64_converted_reloc_bit.
502 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
503 instead of setting converted_reloc.
504 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
505 instead of converted_reloc. Get the real relocation type by
506 masking out R_X86_64_converted_reloc_bit.
507 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
508 R_X86_64_converted_reloc_bit is valid.
509 * elfxx-x86.h (converted_reloc): Removed.
511 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
513 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
514 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
515 to get the relocation type again.
516 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
517 r_type when calling elf_x86_64_tls_transition. Don't use
518 ELF32_R_TYPE to get the relocation type again.
520 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
522 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
525 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
527 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
528 argument. Don't check relocation overflow. Avoid relocation
529 overflow if --no-relax is used. Set converted_reloc on symbol
530 if a GOTPCREL relocation is converted.
531 (elf_x86_64_relocate_section): Issue a fatal error and suggest
532 --no-relax if GOTPCREL relocation conversion leads to relocation
534 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
536 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
537 Edmar Wienskoski <edmar.wienskoski@nxp.com
539 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
540 (ppc_elf_check_relocs): Handle it.
541 (ppc_elf_vle_split20): New function.
542 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
544 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
547 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
548 for x86-64 if GOT_TLS_GDESC_P is true.
550 2017-09-03 Alan Modra <amodra@gmail.com>
553 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
555 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
557 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
558 tls_get_addr for x86-64 in one place.
560 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
562 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
563 with elfxx-x86.lo for 64-bit BFD.
564 * configure: Regenerated.
566 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
568 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
569 (_bfd_i386_elf_convert_load): This. Remove static.
570 (elf_i386_size_dynamic_sections): Removed.
571 (elf_backend_size_dynamic_sections): Likewise.
572 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
573 (_bfd_x86_64_elf_convert_load): This. Remove static.
574 (elf_x86_64_size_dynamic_sections): Removed.
575 (elf_backend_size_dynamic_sections): Likewise.
576 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
577 (elf_x86_allocate_dynrelocs): This. Make it static.
578 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
579 (elf_x86_allocate_local_dynreloc): This. Make it static.
580 (elf_i386_is_reloc_section): New function.
581 (elf_x86_64_is_reloc_section): Likewise.
582 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
583 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
584 Rearrange got_entry_size initialization.
585 (_bfd_x86_elf_size_dynamic_sections): New function.
586 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
587 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
588 (_bfd_i386_elf_convert_load): New.
589 (_bfd_x86_64_elf_convert_load): Likewise.
590 (_bfd_x86_elf_size_dynamic_sections): Likewise.
591 (elf_backend_size_dynamic_sections): Likewise.
592 (_bfd_x86_elf_allocate_dynrelocs): Removed.
593 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
595 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
597 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
600 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
602 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
603 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
605 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
607 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
608 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
609 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
610 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
611 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
612 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
614 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
616 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
617 (elf_i386_allocate_local_dynrelocs): Likewise.
618 (elf_i386_size_dynamic_sections): Replace
619 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
620 with _bfd_x86_elf_allocate_dynrelocs and
621 _bfd_x86_elf_allocate_local_dynrelocs.
622 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
623 (elf_x86_64_allocate_local_dynrelocs): Likewise.
624 (elf_x86_64_size_dynamic_sections): Replace
625 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
626 with _bfd_x86_elf_allocate_dynrelocs and
627 _bfd_x86_elf_allocate_local_dynrelocs.
628 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
629 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
630 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
631 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
633 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
635 * elf32-i386.c (is_i386_elf): Removed.
636 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
637 (elf_i386_size_dynamic_sections): Likewise.
638 (elf_i386_relocate_section): Likewise.
639 * elf64-x86-64.c (is_x86_64_elf): Removed.
640 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
642 (elf_x86_64_size_dynamic_sections): Likewise.
643 (elf_x86_64_relocate_section): Likewise.
644 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
646 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
649 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
651 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
652 (elf_i386_allocate_dynrelocs): Replace
653 elf_i386_compute_jump_table_size with
654 elf_x86_compute_jump_table_size.
655 (elf_i386_size_dynamic_sections): Likewise.
656 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
657 (elf_x86_64_allocate_dynrelocs): Replace
658 elf_x86_64_compute_jump_table_size with
659 elf_x86_compute_jump_table_size.
660 (elf_x86_64_size_dynamic_sections): Likewise.
661 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
663 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
664 (elf_x86_compute_jump_table_size): New.
666 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
668 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
670 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
671 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
673 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
675 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
676 with htab->is_vxworks.
677 (elf_i386_size_dynamic_sections): Likewise.
678 (elf_i386_relocate_section): Likewise.
679 (elf_i386_finish_dynamic_symbol): Likewise.
680 (elf_i386_finish_dynamic_sections): Likewise.
682 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
684 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
685 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
686 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
687 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
688 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
689 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
690 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
691 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
693 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
696 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
697 ELF_COMMON_DEF_P for common symbols.
699 2017-09-02 Alan Modra <amodra@gmail.com>
701 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
702 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
703 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
705 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
707 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
708 (elf_backend_gc_mark_hook): Likewise.
709 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
710 (elf_backend_gc_mark_hook): Likewise.
711 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
712 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
713 (elf_backend_gc_mark_hook): Likewise.
715 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
717 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
718 (elf_backend_adjust_dynamic_symbol): Likewise.
719 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
720 (elf_backend_adjust_dynamic_symbol): Likewise.
721 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
722 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
723 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
724 (_bfd_x86_elf_adjust_dynamic_symbol): New.
725 (elf_backend_adjust_dynamic_symbol): Likewise.
727 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
729 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
732 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
734 * elf32-i386.c (elf_i386_mkobject): Removed.
735 (bfd_elf32_mkobject): Likewise.
736 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
737 (bfd_elf64_mkobject): Likewise.
738 (bfd_elf32_mkobject): Likewise.
739 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
740 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
741 (bfd_elf64_mkobject): Likewise.
742 (bfd_elf32_mkobject): Likewise.
744 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
746 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
747 Call _bfd_x86_elf_link_setup_gnu_properties.
748 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
749 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
751 (elf_x86_64_non_lazy_plt): Likewise.
752 (elf_x86_64_lazy_bnd_plt): Likewise.
753 (elf_x86_64_non_lazy_bnd_plt): Likewise.
754 (elf_x86_64_lazy_ibt_plt): Likewise.
755 (elf_x32_lazy_ibt_plt): Likewise.
756 (elf_x86_64_non_lazy_ibt_plt): Likewise.
757 (elf_x32_non_lazy_ibt_plt): Likewise.
758 (elf_x86_64_nacl_plt): Likewise.
759 (elf_x86_64_link_setup_gnu_properties): Updated. Call
760 _bfd_x86_elf_link_setup_gnu_properties.
761 * elfxx-x86.c: Include elf-vxworks.h".
762 (_bfd_x86_elf_link_setup_gnu_properties): New function.
763 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
764 comments for pic_plt0_entry and pic_plt_entry.
765 (elf_x86_non_lazy_plt_layout): Likewise.
766 (elf_x86_plt_layout_table): New.
767 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
769 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
772 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
773 .eh_frame section for the second PLT.
774 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
775 alignment of .eh_frame section for the second PLT.
777 2017-09-01 Nick Clifton <nickc@redhat.com>
780 * dwarf2.c (decode_line_info): Fix test for an overlong line info
783 2017-09-01 Nick Clifton <nickc@redhat.com>
786 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
787 attribute buffer is NUL terminated.
789 2017-08-31 Nick Clifton <nickc@redhat.com>
792 * dwarf2.c (read_section): If necessary add a terminating NUL byte
793 to dwarf string sections.
795 2017-08-31 Alan Modra <amodra@gmail.com>
797 * po/SRC-POTFILES.in: Regenerate.
799 2017-08-31 Alan Modra <amodra@gmail.com>
801 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
802 for a section containing just a terminator. Allow multiple
803 terminators at end of section.
804 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
805 sections when not adding alignment. Assert on terminator in
808 2017-08-31 Alan Modra <amodra@gmail.com>
812 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
815 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
817 * configure.ac (bfd_backends): Add elf64.lo together with
818 elfxx-x86.lo for 64-bit BFD.
819 * configure: Regenerated.
821 2017-08-31 James Bowman <james.bowman@ftdichip.com>
823 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
826 2017-08-31 Alan Modra <amodra@gmail.com>
829 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
830 before _close_and_cleanup. Call iovec->bclose after.
831 (bfd_close): Remove code common to, and call, bfd_close_all_done.
833 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
835 * elf32-i386.c (elf_i386_plt_type): Removed.
836 (elf_i386_plt): Likewise.
837 (elf_i386_get_synthetic_symtab): Updated. Call
838 _bfd_x86_elf_get_synthetic_symtab.
839 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
840 (elf_x86_64_plt): Likewise.
841 (elf_x86_64_get_synthetic_symtab): Updated. Call
842 _bfd_x86_elf_get_synthetic_symtab.
843 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
844 (elf_x86_64_get_plt_got_vma): Likewise.
845 (elf_i386_valid_plt_reloc_p): Likewise.
846 (elf_x86_64_valid_plt_reloc_p): Likewise.
847 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
848 * elfxx-x86.h (elf_x86_plt_type): New.
849 (elf_x86_plt): Likewise.
850 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
852 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
854 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
855 target_id instead of elf_machine_code.
857 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
859 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
860 (elf_i386_lazy_plt_layout): Likewise.
861 (elf_i386_non_lazy_plt_layout): Likewise.
862 (elf_i386_plt_layout): Likewise.
863 (elf_i386_link_hash_table): Likewise.
864 (elf_i386_next_tls_desc_index): Likewise.
865 (elf_i386_srelplt2): Likewise.
866 (elf_i386_plt): Likewise.
867 (elf_i386_lazy_plt): Likewise.
868 (elf_i386_non_lazy_plt): Likewise.
869 (elf_i386_link_hash_table_create): Likewise.
870 (bfd_elf32_bfd_link_hash_table_create): Likewise.
871 (elf_i386_lazy_plt): Updated.
872 (elf_i386_non_lazy_plt): Likewise.
873 (elf_i386_lazy_ibt_plt): Likewise.
874 (elf_i386_non_lazy_ibt_plt): Likewise.
875 (elf_i386_allocate_dynrelocs): Likewise.
876 (elf_i386_size_dynamic_sections): Likewise.
877 (elf_i386_relocate_section): Likewise.
878 (elf_i386_finish_dynamic_symbol): Likewise.
879 (elf_i386_finish_dynamic_sections): Likewise.
880 (elf_i386_get_synthetic_symtab): Likewise.
881 (elf_i386_link_setup_gnu_properties): Likewise.
882 (elf_i386_nacl_plt): Likewise.
883 * elf64-x86-64.c (ABI_64_P): Removed.
884 (ELF64_DYNAMIC_INTERPRETER): Likewise.
885 (ELF32_DYNAMIC_INTERPRETER): Likewise.
886 (elf_x86_64_lazy_plt_layout): Likewise.
887 (elf_x86_64_non_lazy_plt_layout): Likewise.
888 (elf_x86_64_plt_layout): Likewise.
889 (elf_x86_64_link_hash_table): Likewise.
890 (elf_x86_64_plt): Likewise.
891 (elf_x86_64_lazy_plt): Likewise.
892 (elf_x86_64_non_lazy_plt): Likewise.
893 (elf_x86_64_link_hash_table_create): Likewise.
894 (bfd_elf64_bfd_link_hash_table_create): Likewise.
895 (bfd_elf32_bfd_link_hash_table_create): Likewise.
896 (elf_x86_64_lazy_plt): Updated.
897 (elf_x86_64_non_lazy_plt): Likewise.
898 (elf_x86_64_lazy_bnd_plt): Likewise.
899 (elf_x86_64_non_lazy_bnd_plt): Likewise.
900 (elf_x86_64_lazy_ibt_plt): Likewise.
901 (elf_x32_lazy_ibt_plt): Likewise.
902 (elf_x86_64_non_lazy_ibt_plt): Likewise.
903 (elf_x32_non_lazy_ibt_plt): Likewise.
904 (elf_x86_64_allocate_dynrelocs): Likewise.
905 (elf_x86_64_size_dynamic_sections): Likewise.
906 (elf_x86_64_relocate_section): Likewise.
907 (elf_x86_64_finish_dynamic_symbol): Likewise.
908 (elf_x86_64_finish_dynamic_sections): Likewise.
909 (elf_x86_64_get_synthetic_symtab): Likewise.
910 (elf_x86_64_link_setup_gnu_properties): Likewise.
911 (elf_x86_64_nacl_plt): Likewise.
912 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
914 (ELF32_DYNAMIC_INTERPRETER): New.
915 (ELF64_DYNAMIC_INTERPRETER): Likewise.
916 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
917 (_bfd_x86_elf_link_hash_table_create): Likewise.
918 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
919 (elf_x86_link_hash_table_free): This. Make it static.
920 * elfxx-x86.h: Don't include "objalloc.h".
922 (elf_x86_lazy_plt_layout): Likewise.
923 (elf_x86_non_lazy_plt_layout): Likewise.
924 (elf_x86_plt_layout): Likewise.
925 (_bfd_x86_elf_link_hash_table_create): Likewise.
926 (bfd_elf64_bfd_link_hash_table_create): Likewise.
927 (bfd_elf32_bfd_link_hash_table_create): Likewise.
928 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
929 srelplt2 and next_tls_desc_index.
930 (_bfd_x86_elf_link_hash_table_free): Removed.
932 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
934 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
935 branch offset interpretation.
937 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
940 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
942 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
944 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
945 (elf_x86_64_srelplt2): Likewise.
947 2017-08-30 Alan Modra <amodra@gmail.com>
949 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
950 (ppc64_elf_tls_optimize): Set it.
951 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
952 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
953 addis would add zero.
954 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
955 (ppc_elf_tls_optimize): Set it.
956 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
957 insn on TPREL16_LO relocs to use r2 when addis would add zero.
959 2017-08-30 Alan Modra <amodra@gmail.com>
961 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
962 __tls_get_addr call sequences to LE, don't move the addi down
963 to the nop. Replace the bl with addi and leave the nop alone.
965 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
967 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
969 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
971 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
973 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
975 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
976 (BFD64_BACKENDS): Likewise.
977 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
978 (BFD64_BACKENDS_CFILES): Likewise.
979 * Makefile.in: Regenerated.
980 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
981 elf32-i386.lo and elf64-x86-64.lo.
982 * configure: Regenerated.
983 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
984 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
985 "objalloc.h" and "hashtab.h".
986 (ELIMINATE_COPY_RELOCS): Removed.
987 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
988 (SYMBOL_NO_COPYRELOC): Likewise.
989 (elf_i386_link_hash_entry): Likewise.
990 (GOT_UNKNOWN): Likewise.
991 (GOT_NORMAL): Likewise.
992 (GOT_TLS_GD): Likewise.
993 (elf_i386_hash_entry): Likewise.
994 (elf_i386_obj_tdata): Likewise.
995 (elf_i386_tdata): Likewise.
996 (elf_i386_local_got_tls_type): Likewise.
997 (elf_i386_local_tlsdesc_gotent): Likewise.
998 (elf_i386_hash_table): Likewise.
999 (elf_i386_link_hash_newfunc): Likewise.
1000 (elf_i386_local_htab_hash): Likewise.
1001 (elf_i386_local_htab_eq): Likewise.
1002 (elf_i386_get_local_sym_hash): Likewise.
1003 (elf_i386_link_hash_table_free): Likewise.
1004 (elf_i386_copy_indirect_symbol): Likewise.
1005 (elf_i386_fixup_symbol): Likewise.
1006 (elf_i386_readonly_dynrelocs): Likewise.
1007 (elf_i386_always_size_sections): Likewise.
1008 (elf_i386_set_tls_module_base): Likewise.
1009 (elf_i386_dtpoff_base): Likewise.
1010 (compare_relocs): Likewise.
1011 (elf_i386_hash_symbol): Likewise.
1012 (elf_i386_parse_gnu_properties): Likewise.
1013 (elf_i386_merge_gnu_properties): Likewise.
1014 (elf_i386_link_check_relocs): Likewise.
1015 (elf_i386_merge_symbol_attribute): Likewise.
1016 (bfd_elf32_bfd_link_check_relocs): Likewise.
1017 (elf_backend_copy_indirect_symbol): Likewise.
1018 (elf_backend_always_size_sections): Likewise.
1019 (elf_backend_omit_section_dynsym): Likewise.
1020 (elf_backend_hash_symbol): Likewise.
1021 (elf_backend_fixup_symbol): Likewise.
1022 (elf_backend_parse_gnu_properties): Likewise.
1023 (elf_backend_merge_gnu_properties): Likewise.
1024 (elf_backend_merge_symbol_attribute): Likewise.
1025 (elf_i386_mkobject): Updated.
1026 (elf_i386_link_hash_table_create): Likewise.
1027 (elf_i386_check_tls_transition): Likewise.
1028 (elf_i386_tls_transition): Likewise.
1029 (elf_i386_convert_load_reloc): Likewise.
1030 (elf_i386_check_relocs): Likewise.
1031 (elf_i386_adjust_dynamic_symbol): Likewise.
1032 (elf_i386_allocate_dynrelocs): Likewise.
1033 (elf_i386_convert_load): Likewise.
1034 (elf_i386_size_dynamic_sections): Likewise.
1035 (elf_i386_relocate_section): Likewise.
1036 (elf_i386_finish_dynamic_symbol ): Likewise.
1037 (elf_i386_finish_dynamic_sections): Likewise.
1038 (elf_i386_output_arch_local_syms): Likewise.
1039 (elf_i386_get_synthetic_symtab): Likewise.
1040 (elf_i386_link_setup_gnu_properties): Likewise.
1041 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1042 of elf_link_hash_table, as base.
1043 (elf_i386_next_tls_desc_index): New.
1044 (elf_i386_srelplt2): Likewise.
1045 (elf_i386_plt): Likewise.
1046 (elf_i386_lazy_plt): Likewise.
1047 (elf_i386_non_lazy_plt): Likewise.
1048 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1049 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1050 "objalloc.h" and "hashtab.h".
1051 (ELIMINATE_COPY_RELOCS): Removed.
1052 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1053 (SYMBOL_NO_COPYRELOC): Likewise.
1054 (elf_x86_64_link_hash_entry): Likewise.
1055 (GOT_UNKNOWN): Likewise.
1056 (GOT_NORMAL): Likewise.
1057 (GOT_TLS_GD): Likewise.
1058 (elf_x86_64_hash_entry): Likewise.
1059 (elf_x86_64_obj_tdata): Likewise.
1060 (elf_x86_64_tdata): Likewise.
1061 (elf_x86_64_local_got_tls_type): Likewise.
1062 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1063 (elf_x86_64_hash_table): Likewise.
1064 (elf_x86_64_link_hash_newfunc): Likewise.
1065 (elf_x86_64_local_htab_hash): Likewise.
1066 (elf_x86_64_local_htab_eq): Likewise.
1067 (elf_x86_64_get_local_sym_hash): Likewise.
1068 (elf_x86_64_link_hash_table_free): Likewise.
1069 (elf_x86_64_copy_indirect_symbol): Likewise.
1070 (elf_x86_64_fixup_symbol): Likewise.
1071 (elf_x86_64_readonly_dynrelocs): Likewise.
1072 (elf_x86_64_always_size_sections): Likewise.
1073 (elf_x86_64_set_tls_module_base): Likewise.
1074 (elf_x86_64_dtpoff_base): Likewise.
1075 (compare_relocs): Likewise.
1076 (elf_x86_64_merge_symbol_attribute): Likewise.
1077 (elf_x86_64_hash_symbol): Likewise.
1078 (elf_x86_64_parse_gnu_properties): Likewise.
1079 (elf_x86_64_merge_gnu_properties): Likewise.
1080 (elf_x86_64_link_check_relocs): Likewise.
1081 (elf_backend_copy_indirect_symbol): Likewise.
1082 (elf_backend_always_size_sections): Likewise.
1083 (bfd_elf64_bfd_link_check_relocs): Likewise.
1084 (elf_backend_merge_symbol_attribute): Likewise.
1085 (elf_backend_hash_symbol): Likewise.
1086 (elf_backend_omit_section_dynsym): Likewise.
1087 (elf_backend_fixup_symbol): Likewise.
1088 (elf_backend_parse_gnu_properties): Likewise.
1089 (elf_backend_merge_gnu_properties): Likewise.
1090 (bfd_elf32_bfd_link_check_relocs): Likewise.
1091 (elf_x86_64_mkobject): Updated.
1092 (elf_x86_64_link_hash_table_create): Likewise.
1093 (elf_x86_64_check_tls_transition): Likewise.
1094 (elf_x86_64_tls_transition): Likewise.
1095 (elf_x86_64_convert_load_reloc): Likewise.
1096 (elf_x86_64_check_relocs): Likewise.
1097 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1098 (elf_x86_64_allocate_dynrelocs): Likewise.
1099 (elf_x86_64_convert_load): Likewise.
1100 (elf_x86_64_size_dynamic_sections): Likewise.
1101 (elf_x86_64_relocate_section): Likewise.
1102 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1103 (elf_x86_64_finish_dynamic_sections): Likewise.
1104 (elf_x86_64_output_arch_local_syms): Likewise.
1105 (elf_x86_64_get_synthetic_symtab): Likewise.
1106 (elf_x86_64_link_setup_gnu_properties): Likewise.
1107 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1108 instead of elf_link_hash_table, as base.
1109 (elf_x86_64_next_tls_desc_index): New.
1110 (elf_x86_64_srelplt2): Likewise.
1111 (elf_x86_64_plt): Likewise.
1112 (elf_x86_64_lazy_plt): Likewise.
1113 (elf_x86_64_non_lazy_plt): Likewise.
1114 * elfxx-x86.c: New file.
1115 * elfxx-x86.h: Likewise.
1117 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1119 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1121 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1123 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1125 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1126 sections before checking dynamic relocations and free invalid
1127 PLT section contents.
1128 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1130 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1132 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1133 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1135 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1138 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1140 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1142 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1144 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1146 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1148 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1151 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1152 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1153 Add a has_no_copy_on_protected bitfield.
1154 (elf_has_no_copy_on_protected): New.
1155 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1156 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1157 (elf_merge_gnu_property_list): Likewise.
1158 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1159 to FALSE for elf_has_no_copy_on_protected.
1160 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1161 (elf_i386_link_hash_entry): Add def_protected.
1162 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1163 when checking info->nocopyreloc.
1164 (elf_i386_link_setup_gnu_properties): Don't set
1165 extern_protected_data here.
1166 (elf_i386_merge_symbol_attribute): New function.
1167 (elf_backend_merge_symbol_attribute): New.
1168 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1169 (elf_x86_64_link_hash_entry): Add def_protected.
1170 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1171 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1172 when checking info->nocopyreloc.
1173 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1174 relocation run-time overflow and unresolvable R_X86_64_32S
1175 relocation against protected data symbol defined in shared object
1176 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1177 (elf_x86_64_link_setup_gnu_properties): Don't set
1178 extern_protected_data here.
1179 (elf_x86_64_merge_symbol_attribute): New function.
1180 (elf_backend_merge_symbol_attribute): New.
1182 2017-08-26 Alan Modra <amodra@gmail.com>
1184 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1185 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1186 (ppc_elf_relocate_section): Comment fix.
1187 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1188 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1189 Support dynamic relocs for TPREL16 when non-pic too.
1190 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1191 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1194 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1196 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1197 "symbol" in comments.
1198 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1200 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1203 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1204 R_X86_64_PC32 relocation run-time overflow and unresolvable
1205 R_X86_64_32S relocation with -z nocopyreloc.
1207 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1209 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1210 Undefined symbols may not have a type.
1211 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1213 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1215 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1216 bfd_link_info. Report shared, PIE or PDE object based on
1218 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1219 (elf_x86_64_relocate_section): Likewise.
1221 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1223 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1224 for function symbols.
1225 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1227 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1229 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1230 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1231 is set on any input relocatable file.
1232 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1234 2017-08-23 Alan Modra <amodra@gmail.com>
1237 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1238 ensure_undefweak_dynamic. Handle undefined too.
1239 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1240 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1241 (allocate_dynrelocs): Discard undefined non-default visibility
1242 relocs first. Make undefined syms dynamic. Tidy goto.
1244 2017-08-21 Alan Modra <amodra@gmail.com>
1245 H.J. Lu <hongjiu.lu@intel.com>
1248 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1249 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1251 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1254 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1255 undefined weak symbols.
1257 2017-08-18 Nick Clifton <nickc@redhat.com>
1260 * tekhex.c (getsym): Fix check for source pointer walking off the
1261 end of the input buffer.
1263 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1266 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1267 relocations in debug sections, change abort to _bfd_error_handler.
1269 2017-08-14 Nick Clifton <nickc@redhat.com>
1272 * elf.c (setup_group): Check for an empty or very small group
1274 * po/bfd.pot: Regenerate.
1276 2017-08-14 Alan Modra <amodra@gmail.com>
1279 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1280 alignment padding here.
1281 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1282 in a reverse pass over sections.
1284 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1287 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1288 for @plt suffixes first.
1289 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1291 2017-08-08 Nick Clifton <nickc@redhat.com>
1294 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1295 small section lengths.
1296 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1298 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1299 there is enough data present in the note.
1301 2017-08-08 Alan Modra <amodra@gmail.com>
1304 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1305 got.refcount for GOTOFF relocs, just create .got section.
1307 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1309 * elflink.c (elf_link_add_object_symbols): Move common symbol
1310 check after bed->common_definition.
1312 2017-08-07 Alan Modra <amodra@gmail.com>
1315 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1316 needed to define various dynamic tags have been discarded.
1318 2017-08-07 Nick Clifton <nickc@redhat.com>
1321 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1322 has not been set then use the bfd returned by
1323 _bfd_elf_link_setup_gnu_properties. If that is null then search
1324 through all the input bfds selecting the first normal, ELF format
1326 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1328 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1330 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1332 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1333 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1334 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1335 (elf_i386_link_check_relocs): New function.
1336 (bfd_elf32_bfd_link_check_relocs): New.
1337 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1339 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1340 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1341 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1342 (elf_x86_64_link_check_relocs): New function.
1343 (bfd_elf64_bfd_link_check_relocs): New.
1344 (bfd_elf32_bfd_link_check_relocs): Likewise.
1346 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1349 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1350 as undefined for --no-define-common.
1352 2017-08-05 Alan Modra <amodra@gmail.com>
1354 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1355 hppa_link_hash_table.
1357 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1359 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1360 entries for sysregs with negative indices.
1362 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1364 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1365 isn't the S/390 specific elf data.
1366 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1368 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1370 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1371 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1372 [R_RISCV_ADD16]: Likewise.
1373 [R_RISCV_ADD32]: Likewise.
1374 [R_RISCV_ADD64]: Likewise.
1375 [R_RISCV_SUB6]: Likewise.
1376 [R_RISCV_SUB8]: Likewise.
1377 [R_RISCV_SUB16]: Likewise.
1378 [R_RISCV_SUB32]: Likewise.
1379 [R_RISCV_SUB64]: Likewise.
1381 2017-07-31 Alan Modra <amodra@gmail.com>
1383 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1384 without ld.so checks.
1386 2017-07-29 Alan Modra <amodra@gmail.com>
1389 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1390 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1391 (is_elfv2_localentry0): Test non_zero_localentry.
1392 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1394 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1396 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1397 pointer check for htab->elf.irelplt.
1398 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1400 2017-07-27 Nick Clifton <nickc@redhat.com>
1403 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1405 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1407 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1409 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1411 (evax_bfd_print_emh): Check for invalid string lengths.
1413 2017-07-25 Nick Clifton <nickc@redhat.com>
1415 * po/fr.po: Updated French translation.
1417 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1420 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1421 16-bit absolute branches into 10-bit pc-relative branches on the
1422 MSP430 as well as the MSP430X.
1424 2017-07-25 Alan Modra <amodra@gmail.com>
1426 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1427 (stub_eh_frame_size): New function.
1428 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1429 (group_sections): Init group tls_get_addr_opt_bctrl.
1430 (ppc64_elf_size_stubs): Update sizing and initialization of
1431 .eh_frame. Iteration over stubs via group list.
1432 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1433 (ppc64_elf_finish_dynamic_sections): Update finalization of
1436 2017-07-24 Nick Clifton <nickc@redhat.com>
1439 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1440 of the relocs to the canonicalize_one_reloc routine.
1441 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1442 for the _bfd_mach_o_canonicalize_one_reloc field.
1443 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1444 res_base parameter. Use to check for corrupt pair relocs.
1445 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1447 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1449 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1452 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1453 enough data in the record before attempting to parse it.
1454 (_bfd_vms_slurp_eeom): Likewise.
1456 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1457 (image_set_ptr): Likewise.
1458 (alpha_vms_slurp_relocs): Likewise.
1460 (alpha_vms_object_p): Check for a truncated record.
1462 2017-07-24 Nick Clifton <nickc@redhat.com>
1465 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1466 an unrecognized reloc and sets the bfd_error value.
1467 * libbfd.h: Regenerate.
1468 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1470 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1471 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1472 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1473 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1474 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1476 2017-07-23 Alan Modra <amodra@gmail.com>
1478 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1481 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1484 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1485 reloc_class_ifunc for ifunc symbols.
1487 2017-07-19 Nick Clifton <nickc@redhat.com>
1490 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1491 correct magic bytes at the start, set the error to wrong format
1492 and clear the format selector before returning NULL.
1494 2017-07-19 Nick Clifton <nickc@redhat.com>
1497 * coff-rs6000.c (_bfd_strntol): New function.
1498 (_bfd_strntoll): New function.
1499 (GET_VALUE_IN_FIELD): New macro.
1500 (EQ_VALUE_IN_FIELD): new macro.
1501 (_bfd_xcoff_slurp_armap): Use new macros.
1502 (_bfd_xcoff_archive_p): Likewise.
1503 (_bfd_xcoff_read_ar_hdr): Likewise.
1504 (_bfd_xcoff_openr_next_archived_file): Likewise.
1505 (_bfd_xcoff_stat_arch_elt): Likewise.
1506 * coff64-rs6000.c (_bfd_strntol): New function.
1507 (_bfd_strntoll): New function.
1508 (GET_VALUE_IN_FIELD): New macro.
1509 (xcoff64_slurp_armap): Use new macros.
1511 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1512 John Eric Martin <John.Martin@emmicro-us.com>
1514 * bfd-in2.h: Regenerate.
1515 * libbfd.h: Regenerate.
1516 * elf32-arc.c (JLI): Define.
1517 * reloc.c: Add JLI relocations.
1519 2017-07-18 Nick Clifton <nickc@redhat.com>
1522 * coff-sh.c: Fix spelling typos.
1523 * compress.c: Likewise.
1524 * cpu-pdp11.c: Likewise.
1525 * ecofflink.c: Likewise.
1526 * elf-m10300.c: Likewise.
1528 * elf32-arm.c: Likewise.
1529 * elf32-m68k.c: Likewise.
1530 * elf32-nds32.c: Likewise.
1531 * elf32-ppc.c: Likewise.
1532 * elf32-sh.c: Likewise.
1533 * elf32-v850.c: Likewise.
1534 * elf64-ppc.c: Likewise.
1535 * elf64-x86-64.c: Likewise.
1536 * elflink.c: Likewise.
1537 * elfnn-aarch64.c: Likewise.
1538 * elfxx-mips.c: Likewise.
1540 * sunos.c: Likewise.
1541 * vms-alpha.c: Likewise.
1542 * xcofflink.c: Likewise.
1544 2017-07-18 Nick Clifton <nickc@redhat.com>
1547 * coffcode.h (handle_COMDAT): Replace abort with an error message
1550 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1553 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1556 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1558 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1560 2017-07-16 Alan Modra <amodra@gmail.com>
1562 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1563 __tls_index GOT entries when using __tls_get_addr_opt stub.
1564 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1566 2017-07-12 Alan Modra <amodra@gmail.com>
1568 * po/es.po: Update from translationproject.org/latest/bfd/.
1569 * po/fi.po: Likewise.
1570 * po/fr.po: Likewise.
1571 * po/id.po: Likewise.
1572 * po/ja.po: Likewise.
1573 * po/ro.po: Likewise.
1574 * po/ru.po: Likewise.
1575 * po/sr.po: Likewise.
1576 * po/sv.po: Likewise.
1577 * po/tr.po: Likewise.
1578 * po/uk.po: Likewise.
1579 * po/vi.po: Likewise.
1580 * po/zh_CN.po: Likewise.
1581 * po/hr.po: New file from translationproject.org.
1582 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1583 * configure: Regenerate.
1585 2017-07-12 Nick Clifton <nickc@redhat.com>
1587 Fix compile time warnings using gcc 7.1.1.
1588 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1590 (elf_xtensa_get_gotplt_section): Increase length of got_name
1592 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1593 default return of FALSE.
1594 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1595 default return of FALSE.
1597 2017-07-12 Alan Modra <amodra@gmail.com>
1599 * binary.c (binary_set_section_contents): Don't print filepos in
1601 (coff_write_object_contents): Cast size_t for error message.
1602 (coff_slurp_line_table): Don't use bfd_vma symndx.
1603 (coff_slurp_reloc_table): Remove unneeded cast.
1604 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1606 (find_abstract_instance_name): Likewise.
1607 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1608 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1609 (elf32_arm_check_relocs): Make r_symndx an int.
1610 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1612 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1614 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1616 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1617 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1618 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1619 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1620 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1621 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1622 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1623 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1624 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1625 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1626 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1627 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1628 and use %lu for error message.
1629 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1630 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1633 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1635 (elf32_arm_final_link_relocate): Likewise.
1636 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1637 * coffcode.h (styp_to_sec_flags): Likewise.
1638 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1639 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1640 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1641 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1642 (elf32_bfin_merge_private_bfd_data): Likewise.
1643 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1644 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1645 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1646 (i370_elf_relocate_section): Likewise.
1647 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1648 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1649 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1650 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1651 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1652 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1653 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1654 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1655 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1656 * ieee.c (ieee_write_id, read_id): Likewise.
1657 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1658 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1659 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1660 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1661 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1662 * stabs.c (_bfd_link_section_stabs): Likewise.
1664 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1666 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1667 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1668 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1669 * coff-sh.c (sh_relax_section): Likewise.
1670 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1671 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1672 * coffcode.h (coff_slurp_reloc_table): Likewise.
1673 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1674 (_bfd_coff_read_string_table): Likewise.
1675 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1676 * compress.c (bfd_get_full_section_contents): Likewise.
1677 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1678 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1679 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1680 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1681 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1682 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1683 (elf32_arm_write_section): Likewise.
1684 * elf32-bfin.c (bfin_relocate_section): Likewise.
1685 (bfinfdpic_relocate_section): Likewise.
1686 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1687 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1688 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1689 (elf_i386_relocate_section): Likewise.
1690 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1691 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1692 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1693 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1694 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1695 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1696 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1697 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1698 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1699 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1700 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1701 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1702 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1703 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1704 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1705 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1706 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1707 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1708 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1709 * elf32-sh.c (sh_elf_relax_section): Likewise.
1710 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1711 (sh_elf_relocate_section): Likewise.
1712 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1713 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1714 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1715 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1716 * elf32-v850.c (v850_elf_relax_section): Likewise.
1717 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1718 (elf_vax_relocate_section): Likewise.
1719 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1720 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1721 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1722 (do_fix_for_relocatable_link): Likewise.
1723 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1724 (elf64_alpha_relax_with_lituse): Likewise.
1725 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1726 (elf_hppa_final_link_relocate): Likewise.
1727 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1728 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1729 (elf64_vms_link_add_object_symbols): Likewise.
1730 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1731 (mmix_final_link_relocate): Likewise.
1732 * elf64-s390.c (invalid_tls_insn): Likewise.
1733 (elf_s390_relocate_section): Likewise.
1734 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1735 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1736 (elf_x86_64_relocate_section): Likewise.
1737 * elfcode.h (elf_slurp_symbol_table): Likewise.
1738 * elfcore.h (elf_core_file_p): Likewise.
1739 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1740 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1741 (elfNN_aarch64_relocate_section): Likewise.
1742 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1743 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1744 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1745 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1746 (_bfd_mips_elf_relocate_section): Likewise.
1747 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1748 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1749 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1750 * ieee.c (ieee_slurp_external_symbols): Likewise.
1751 * ihex.c (ihex_write_object_content): Likewise.
1752 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1753 * merge.c (_bfd_merged_section_offset): Likewise.
1754 * mmo.c (mmo_write_loc_chunk): Likewise.
1755 (mmo_write_object_contents): Likewise.
1756 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1757 * stabs.c (_bfd_link_section_stabs): Likewise.
1758 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1760 2017-07-11 Alan Modra <amodra@gmail.com>
1762 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1764 2017-07-11 Alan Modra <amodra@gmail.com>
1766 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1767 instruction" error using _bfd_error_handler, not einfo.
1769 2017-07-10 Nick Clifton <nickc@redhat.com>
1771 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1772 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1774 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1776 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1778 2017-07-07 Alan Modra <amodra@gmail.com>
1780 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1782 2017-07-07 Alan Modra <amodra@gmail.com>
1784 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1785 as long long. Move code replacing "ll" with "I64", and simplify.
1787 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1789 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1792 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1794 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1796 (line_info_add_file_name): Likewise.
1797 (decode_line_info): Likewise.
1799 2017-07-04 Tristan Gingold <gingold@adacore.com>
1801 * version.m4: Bump version to 2.29.51
1802 * configure: Regenerate.
1804 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1806 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1807 sanity check at the head of this function.
1809 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1811 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1812 dwarf_line_str_size.
1813 (struct attr_abbrev): Add field implicit_const.
1814 (dwarf_debug_sections): Add .debug_line_str.
1815 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1816 (dwarf_debug_section_assert): Add static assertion.
1817 (read_indirect_line_string): New.
1818 (read_abbrevs): Support DW_FORM_implicit_const.
1819 (is_str_attr): Support DW_FORM_line_strp.
1820 (read_attribute_value): Support DW_FORM_line_strp and
1821 DW_FORM_implicit_const.
1822 (read_attribute): Support DW_FORM_implicit_const.
1823 (line_info_add_include_dir, line_info_add_include_dir_stub):
1824 (line_info_add_file_name, read_formatted_entries): New.
1825 (decode_line_info, parse_comp_unit): Support DWARF 5.
1826 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1828 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1830 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1831 abort statement that was put for symbols that are not dynamic.
1833 2017-07-03 Tristan Gingold <gingold@adacore.com>
1835 * po/bfd.pot: Regenerate
1837 2017-07-03 Alan Modra <amodra@gmail.com>
1839 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1840 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1841 * elf.c (setup_group): Use "Lx" to print sh_size.
1842 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1843 unknown section type in hex.
1844 (copy_special_section_fields): Style fix.
1845 (bfd_section_from_shdr): Correct format for sh_link. Use a
1846 common error message for all the variants of unrecognized
1848 (assign_file_positions_for_load_sections): Use "Lx" for lma
1849 adjust error message.
1850 (assign_file_positions_for_non_load_sections): Formatting.
1851 (rewrite_elf_program_header): Formatting. Use "Lx" for
1852 bfd_vma values in error messages.
1853 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1854 ELF_R_SYM value to type expected by format.
1855 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1857 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1858 (elf_link_input_bfd): Use "Lx" for r_info.
1859 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1861 2017-07-03 Alan Modra <amodra@gmail.com>
1863 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1864 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1865 Microsoft C library variant of long long format specifier.
1866 (PRINT20): Cast value to bfd_uint64_t not long long.
1867 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1868 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1869 long long. Don't cast to bfd_vma.
1870 * elf32-score.c (score3_bfd_getl48): Likewise.
1871 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1873 2017-07-03 Alan Modra <amodra@gmail.com>
1875 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1877 (bfd_elf_print_symbol): Don't cast symbol->flags.
1878 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1879 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1880 _bfd_error_handler argument order.
1881 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1883 2017-07-03 Alan Modra <amodra@gmail.com>
1885 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1886 AC_TYPE_LONG_DOUBLE.
1887 * configure: Regenerate.
1888 * config.in: Regenerate.
1890 2017-06-29 Andrew Waterman <andrew@sifive.com>
1892 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1895 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1897 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1898 unless it is undefined weak.
1899 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1900 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1902 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1903 is not dynamic in PIC, abort.
1905 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1908 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1909 undefined weak symbols into dynamic.
1910 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1911 relocation for non-dynamic symbols.
1912 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1914 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1916 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1917 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1918 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1919 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1920 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1923 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1925 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1926 (elfcore_write_s390_gs_bc): Likewise.
1927 * elf.c (elfcore_grok_s390_gs_cb): New function.
1928 (elfcore_grok_s390_gs_bc): New function.
1929 (elfcore_grok_note): Call them.
1930 (elfcore_write_s390_gs_cb): New function.
1931 (elfcore_write_s390_gs_bc): New function.
1932 (elfcore_write_register_note): Call them.
1934 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1936 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1937 bfd_get_file_size. Check archive element size.
1938 (_bfd_generic_get_section_contents_in_window): Likewise.
1940 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1942 * bfd-in2.h: Regenerated.
1943 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1944 (bfd_get_file_size): Likewise.
1946 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1947 Matthew Fortune <matthew.fortune@imgtec.com>
1949 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1950 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1951 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1952 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1954 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1955 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1956 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1957 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1958 `bfd_mach_mips_interaptiv_mr2' entries.
1959 * bfd-in2.h: Regenerate.
1961 2017-06-27 Nick Clifton <nickc@redhat.com>
1963 * tekhex.c (pass_over): Revert accidental conversion of a local
1964 array to a static array.
1966 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1969 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1970 reloc addend if necessary. Adjust diff only if
1971 shrinked_insn_address < end_address.
1973 2017-06-27 Alan Modra <amodra@gmail.com>
1976 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1977 (_bfd_generic_get_section_contents_in_window): Likewise.
1979 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1981 * elfnn-riscv.c (perform_relocation): Support the new
1982 R_RISCV_32_PCREL relocation.
1983 (riscv_elf_relocate_section): Likewise.
1984 * elfxx-riscv.c (howto_table): Likewise.
1985 (riscv_reloc_map): Likewise.
1986 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1987 * libbfd.h: Regenerate.
1989 2017-06-27 Alan Modra <amodra@gmail.com>
1992 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1993 Use unsigned file pointer type, and remove cast.
1994 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1995 Add "count", not "sz".
1997 2017-06-26 Pedro Alves <palves@redhat.com>
2000 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2003 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2006 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2009 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2011 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2012 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2013 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2014 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2015 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2017 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2020 * compress.c (bfd_get_full_section_contents): Don't check the
2022 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2023 reject a section whose size + offset is greater than the size
2025 (_bfd_generic_get_section_contents_in_window): Likewise.
2027 2017-06-26 Nick Clifton <nickc@redhat.com>
2030 * tekhex.c (getvalue): Check for the source pointer exceeding the
2031 end pointer before the first byte is read.
2033 2017-06-26 Nick Clifton <nickc@redhat.com>
2036 * opncls.c (get_build_id): Check that the section is big enough
2037 to contain the whole note.
2038 * compress.c (bfd_get_full_section_contents): Check for and reject
2039 a section whose size is greater than the size of the entire file.
2040 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2041 contain a notes section.
2043 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2045 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2047 (elf_s390_modify_segment_map): Likewise.
2048 (bfd_elf_s390_set_options): Lisewise.
2050 2017-06-26 Alan Modra <amodra@gmail.com>
2052 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2054 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2055 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2056 .preinit_array on --just-syms bfds.
2057 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2058 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2059 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2061 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2063 * elf.c (find_link): Bounds check "hint".
2065 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2067 * elf32-arm.c (using_thumb_only): Update list of architectures in
2068 BFD_ASSERT for which the logic is valid.
2069 (using_thumb2_bl): Likewise.
2070 (using_thumb2): Likewise and return true for ARMv8-R.
2071 (arch_has_arm_nop): Likewise.
2072 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2073 merging logic. Update commentis for value 15 of v8m_baseline,
2074 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2075 merging of value 15 of Tag_CPU_arch.
2077 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2079 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2080 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2081 * bfd-in2.h: Regenerate.
2083 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2085 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2086 the error_alignment label forward. Properly align program
2087 property note section.
2089 2017-06-22 Eric Christopher <echristo@gmail.com>
2091 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2092 abs to fix a truncation warning.
2094 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2096 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2097 local undefined weak symbol to 0.
2098 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2100 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2102 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2103 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2104 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2105 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2106 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2107 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2108 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2109 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2111 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2113 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2114 (elf_i386_lazy_ibt_plt_entry): Likewise.
2115 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2116 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2117 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2118 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2119 (elf_i386_lazy_plt_layout): Likewise.
2120 (elf_i386_non_lazy_plt_layout): Likewise.
2121 (elf_i386_link_hash_entry): Add plt_second.
2122 (elf_i386_link_hash_table): Add plt_second and
2123 plt_second_eh_frame.
2124 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2125 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2126 the second PLT. Check the second PLT.
2127 (elf_i386_relocate_section): Use the second PLT to resolve
2128 PLT reference if needed.
2129 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2131 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2132 second PLT. Generate unwind info for the second PLT.
2133 (elf_i386_plt_type): Add plt_second.
2134 (elf_i386_get_synthetic_symtab): Support the second PLT.
2135 (elf_i386_parse_gnu_properties): Support
2136 GNU_PROPERTY_X86_FEATURE_1_AND.
2137 (elf_i386_merge_gnu_properties): Support
2138 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2139 on GNU_PROPERTY_X86_FEATURE_1_IBT
2140 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2141 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2142 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2143 is set on all relocatable inputs.
2144 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2145 (elf_x32_lazy_ibt_plt_entry): Likewise.
2146 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2147 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2148 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2149 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2150 (elf_x86_64_lazy_ibt_plt): Likewise.
2151 (elf_x32_lazy_ibt_plt): Likewise.
2152 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2153 (elf_x32_non_lazy_ibt_plt): Likewise.
2154 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2155 (elf_x86_64_parse_gnu_properties): Support
2156 GNU_PROPERTY_X86_FEATURE_1_AND.
2157 (elf_x86_64_merge_gnu_properties): Support
2158 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2159 on GNU_PROPERTY_X86_FEATURE_1_IBT
2160 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2161 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2162 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2163 is set on all relocatable inputs.
2165 2017-06-22 Nick Clifton <nickc@redhat.com>
2168 * som.c (setup_sections): NUL terminate the space_strings buffer.
2169 Check that the space.name field does not index beyond the end of
2170 the space_strings buffer.
2172 2017-06-21 Nick Clifton <nickc@redhat.com>
2175 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2177 2017-06-21 Nick Clifton <nickc@redhat.com>
2180 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2181 type of the size parameter.
2182 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2183 length of the counted string.
2184 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2185 (_bfd_vms_save_counted_string): Likewise.
2186 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2187 _bfd_vms_save_counted_string.
2188 (_bfd_vms_slurp_ehdr): Likewise.
2189 (_bfd_vms_slurp_egsd): Likewise.
2190 (Parse_module): Likewise.
2192 2017-06-21 Alan Modra <amodra@gmail.com>
2194 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2195 calls before tocsave calls.
2196 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2199 2017-06-21 Nick Clifton <nickc@redhat.com>
2202 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2203 bfd_get_full_section_contents returns no contents.
2205 2017-06-21 Nick Clifton <nickc@redhat.com>
2208 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2211 2017-06-21 Nick Clifton <nickc@redhat.com>
2214 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2216 (image_set_ptr): Likewise.
2217 (alpha_vms_fix_sec_rel): Likewise.
2218 (alpha_vms_slurp_relocs): Likewise.
2220 2017-06-21 Nick Clifton <nickc@redhat.com>
2223 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2225 (ieee_archive_p): Likewise.
2226 (ieee_object_p): Likewise.
2228 2017-06-21 Nick Clifton <nickc@redhat.com>
2231 * elf.c (setup_group): Zero the group section pointer list after
2232 allocation so that loops can be caught. Check for NULL pointers
2233 when processing a group list.
2235 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2237 * elf-s390.h: New file.
2238 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2240 (elf_s390_additional_program_headers): New function.
2241 (elf_s390_modify_segment_map): New function.
2242 (bfd_elf_s390_set_options): New function.
2243 (elf_backend_additional_program_headers)
2244 (elf_backend_modify_segment_map): Add macro definitions.
2246 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2249 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2250 the DYNAMIC bit instead of bfd_count_sections.
2252 2017-06-19 Nick Clifton <nickc@redhat.com>
2255 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2257 (evax_bfd_print_eeom): Likewise.
2258 (evax_bfd_print_egsd): Check for an overlarge record length.
2259 (evax_bfd_print_etir): Likewise.
2261 2017-06-19 Nick Clifton <nickc@redhat.com>
2264 * libieee.h (struct common_header_type): Add end_p field.
2265 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2267 (read_id): Check for a length that exceeds the remaining bytes in
2269 (ieee_seek): Initialise end_p.
2270 (ieee_archive_p): Likewise.
2271 (ieee_object_p): Likewise.
2273 2017-06-19 Nick Clifton <nickc@redhat.com>
2276 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2277 before reading the EIHS structure entries.
2279 2017-06-19 Nick Clifton <nickc@redhat.com>
2282 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2283 gsd_size. Check that there are enough bytes remaining to read the
2284 type and size of the next egsd. Check that the size of the egsd
2285 does not exceed the size of the record.
2287 2017-06-19 Alan Modra <amodra@gmail.com>
2289 * config.bfd: Correct targ_underscore for cris.
2291 2017-06-18 Alan Modra <amodra@gmail.com>
2293 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2294 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2296 2017-06-16 Nick Clifton <nickc@redhat.com>
2298 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2299 bucketlist is empty because there are no symbols to add to the
2302 2017-06-16 Alan Modra <amodra@gmail.com>
2308 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2309 (BFD_JUMP_TABLE_LINK): Likewise.
2310 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2311 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2312 (bfd_elf_define_start_stop): New function.
2313 * linker.c (bfd_generic_define_start_stop): New function.
2314 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2316 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2317 * aout-target.h (MY_bfd_define_start_stop): Define.
2318 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2319 * binary.c (binary_bfd_define_start_stop): Define.
2320 * bout.c (b_out_bfd_define_start_stop): Define.
2321 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2322 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2323 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2324 * coffcode.h (coff_bfd_define_start_stop): Define.
2325 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2326 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2327 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2328 * ieee.c (ieee_bfd_define_start_stop): Define.
2329 * ihex.c (ihex_bfd_define_start_stop): Define.
2330 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2331 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2332 * mmo.c (mmo_bfd_define_start_stop): Define.
2333 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2334 * oasys.c (oasys_bfd_define_start_stop): Define.
2335 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2336 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2337 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2338 * som.c (som_bfd_define_start_stop): Define.
2339 * srec.c (srec_bfd_define_start_stop): Define.
2340 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2341 * versados.c (versados_bfd_define_start_stop): Define.
2342 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2343 (alpha_vms_bfd_define_start_stop): Define.
2344 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2345 * bfd-in2.h: Regenerate.
2346 * libbfd.h: Regenerate.
2348 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2350 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2351 SYMBOL_REFERENCES_LOCAL.
2353 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2356 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2357 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2358 runtime for if there needs copy relocation elimination.
2359 (need_copy_relocation_p): New function. Return true for symbol with
2360 pc-relative references and if it's against read-only sections.
2361 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2362 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2363 that are related with accessing external objects.
2364 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2365 in elfNN_aarch64_check_relocs.
2367 2017-06-15 Nick Clifton <nickc@redhat.com>
2370 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2373 (ieee_archive_p): Likewise.
2375 2017-06-15 Nick Clifton <nickc@redhat.com>
2378 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2380 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2382 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2383 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2384 keep both windowed and call0 ABI PLT definitions.
2385 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2386 elf_xtensa_*_plt_entry endex.
2387 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2389 2017-06-14 Nick Clifton <nickc@redhat.com>
2392 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2395 2017-06-14 Nick Clifton <nickc@redhat.com>
2398 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2399 maximum value for the ascic pointer. Check that name processing
2400 does not read beyond this value.
2401 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2404 2017-06-14 Nick Clifton <nickc@redhat.com>
2407 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2408 (process_otr): Check for an invalid offset in the otr structure.
2410 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2412 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2414 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2420 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2421 vtable field to a union.
2422 (_bfd_elf_is_start_stop): Removed.
2423 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2424 __start_SECNAME and __stop_SECNAME symbols.
2425 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2426 * elflink.c (_bfd_elf_is_start_stop): Removed.
2427 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2428 _bfd_elf_is_start_stop.
2429 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2430 __stop_SECNAME symbols. Updated.
2431 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2432 (bfd_elf_gc_record_vtinherit): Likewise.
2433 (bfd_elf_gc_record_vtentry): Likewise.
2435 2017-06-13 Nick Clifton <nickc@redhat.com>
2438 * elflink.c (elf_link_adjust_relocs): Generate an error when
2439 encountering a reloc against a symbol removed by garbage
2442 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2444 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2445 to merge_gnu_properties.
2446 * elf-properties.c (elf_merge_gnu_properties): Add struct
2447 bfd_link_info * and pass it to merge_gnu_properties.
2448 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2449 and pass it to elf_merge_gnu_properties.
2450 (_bfd_elf_link_setup_gnu_properties): Pass info to
2451 elf_merge_gnu_property_list.
2452 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2454 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2456 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2459 * binary.c (binary_set_section_contents): Scale lma by octets
2460 per byte to set filepos.
2462 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2464 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2467 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2469 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2472 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2474 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2475 patched section contents for TLS IE reloc.
2476 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2478 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2480 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2481 RELOC_FOR_GLOBAL_SYMBOL macro.
2483 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2485 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2488 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2490 * config/tc-arc.c (md_undefined_symbol): Changed.
2491 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2493 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2495 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2498 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2500 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2501 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2503 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2505 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2508 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2510 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2511 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2512 is non-zero. Add clarifying comments.
2514 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2516 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2517 name. Use local IFUNC symbol name string to report unsupported
2518 non-PIC call to IFUNC function.
2519 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2520 when generating R_386_IRELATIVE relocation.
2521 (elf_i386_finish_dynamic_symbol): Likewise.
2522 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2524 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2525 when generating R_X86_64_IRELATIVE relocation.
2526 (elf_x86_64_finish_dynamic_symbol): Likewise.
2528 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2530 * elf.c (setup_group): Make sure BFD sections are created for all
2531 group sections in the input file when processing SHF_GROUP
2533 (bfd_section_from_shdr): Avoid duplicating logic already
2534 implemented in `setup_group'.
2536 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2539 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2540 if the hint address is zero.
2542 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2545 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2546 ELF_COMMON_DEF_P for common symbols.
2548 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2550 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2551 SEC_GROUP sections as SEC_EXCLUDE.
2552 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2553 (assign_section_numbers): Use resolve_section_groups flag instead
2554 of relocatable link type.
2555 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2556 flag instead of checking the final_link flag for part of the
2557 checks in here. Fix white space as a result.
2558 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2559 instead of relocatable link type.
2560 (bfd_elf_final_link): Likewise.
2562 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2564 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2566 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2567 (s3_bfd_score_elf_check_relocs): Likewise.
2568 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2569 (score_elf_final_link_relocate): Likewise.
2570 (s7_bfd_score_elf_check_relocs): Likewise.
2572 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2574 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2577 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2579 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2580 from `reloc_count' rather than decrementing it.
2581 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2582 `reloc_count' by `int_rels_per_ext_rel'.
2583 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2584 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2585 entry determination.
2586 (s3_bfd_score_elf_check_relocs): Likewise.
2587 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2588 (s7_bfd_score_elf_relocate_section): Likewise.
2589 (s7_bfd_score_elf_check_relocs): Likewise.
2590 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2591 prototype and function.
2592 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2593 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2594 triple rather than once the sum of REL and RELA relocation entry
2596 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2597 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2598 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2599 storage allocation size determination.
2600 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2601 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2602 by `int_rels_per_ext_rel' for last relocation entry
2604 (bfd_elf_final_link): Do not multiply `reloc_count' by
2605 `int_rels_per_ext_rel' for internal relocation storage
2606 allocation size determination.
2607 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2608 `int_rels_per_ext_rel' for last relocation entry determination.
2609 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2610 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2611 (_bfd_mips_elf_relocate_section): Likewise.
2613 2017-06-05 Alan Modra <amodra@gmail.com>
2616 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2618 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2620 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2621 determine structure sizes.
2622 (elfcore_grok_freebsd_prstatus): Likewise.
2624 2017-06-01 Alan Modra <amodra@gmail.com>
2626 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2627 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2629 (is_elfv2_localentry0): New function.
2630 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2631 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2632 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2633 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2634 optimized localentry:0 stubs.
2635 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2636 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2638 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2640 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2642 2017-05-30 Casey Smith <clegg89@gmail.com>
2645 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2646 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2648 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2650 * cpu-arc.c (arc_compatible): New function.
2652 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2654 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2656 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2659 * bfdio.c (bfd_get_file_size): New function.
2660 * bfd-in2.h: Regenerated.
2662 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2664 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2667 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2669 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2670 dynobj instead of htab->elf.dynobj.
2672 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2674 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2676 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2677 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2678 actual number of internal relocations retrieved. Adjust
2679 function description.
2680 (bfd_elf64_canonicalize_reloc): Remove macro.
2681 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2683 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2685 * archures.c (bfd_mach_sparc_v9m8): Define.
2686 (bfd_mach_sparc_v8plusm8): Likewise.
2687 (bfd_mach_sparc_v9_p): Adjust to M8.
2688 (bfd_mach_sparc_64bit_p): Likewise.
2689 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2690 bfd_mach_sparc_v8plusm8.
2691 * bfd-in2.h: Regenerated.
2692 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2694 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2695 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2696 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2698 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2699 bfd_mach_sparc_v8plusm8.
2701 2017-05-19 Alan Modra <amodra@gmail.com>
2703 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2704 debug and special sections when no non-note alloc sections in an
2707 2017-05-18 Alan Modra <amodra@gmail.com>
2709 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2710 * elf-m10300.c: Likewise.
2712 * elf32-arc.c: Likewise.
2713 * elf32-bfin.c: Likewise.
2714 * elf32-m68k.c: Likewise.
2715 * elf32-nds32.c: Likewise.
2716 * elf32-tilepro.c: Likewise.
2717 * elflink.c: Likewise.
2718 * elfnn-aarch64.c: Likewise.
2719 * elfnn-riscv.c: Likewise.
2720 * elfxx-tilegx.c: Likewise.
2721 * mach-o.c: Likewise.
2722 * peXXigen.c: Likewise.
2723 * vms-alpha.c: Likewise.
2724 * vms-lib.c: Likewise.
2726 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2729 * elflink.c (elf_gc_mark_debug_section): New function.
2730 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2731 referenced by kept debug sections.
2733 2017-05-16 Alan Modra <amodra@gmail.com>
2735 * elf-m10300.c: Rename occurrences of non_ir_ref.
2736 * elf32-arm.c: Likewise.
2737 * elf32-bfin.c: Likewise.
2738 * elf32-cr16.c: Likewise.
2739 * elf32-cris.c: Likewise.
2740 * elf32-d10v.c: Likewise.
2741 * elf32-dlx.c: Likewise.
2742 * elf32-fr30.c: Likewise.
2743 * elf32-frv.c: Likewise.
2744 * elf32-hppa.c: Likewise.
2745 * elf32-i370.c: Likewise.
2746 * elf32-i386.c: Likewise.
2747 * elf32-iq2000.c: Likewise.
2748 * elf32-lm32.c: Likewise.
2749 * elf32-m32c.c: Likewise.
2750 * elf32-m32r.c: Likewise.
2751 * elf32-m68hc1x.c: Likewise.
2752 * elf32-m68k.c: Likewise.
2753 * elf32-mcore.c: Likewise.
2754 * elf32-metag.c: Likewise.
2755 * elf32-microblaze.c: Likewise.
2756 * elf32-moxie.c: Likewise.
2757 * elf32-msp430.c: Likewise.
2758 * elf32-mt.c: Likewise.
2759 * elf32-nios2.c: Likewise.
2760 * elf32-or1k.c: Likewise.
2761 * elf32-ppc.c: Likewise.
2762 * elf32-rl78.c: Likewise.
2763 * elf32-s390.c: Likewise.
2764 * elf32-score.c: Likewise.
2765 * elf32-score7.c: Likewise.
2766 * elf32-sh.c: Likewise.
2767 * elf32-tic6x.c: Likewise.
2768 * elf32-tilepro.c: Likewise.
2769 * elf32-v850.c: Likewise.
2770 * elf32-vax.c: Likewise.
2771 * elf32-xstormy16.c: Likewise.
2772 * elf32-xtensa.c: Likewise.
2773 * elf64-alpha.c: Likewise.
2774 * elf64-hppa.c: Likewise.
2775 * elf64-ia64-vms.c: Likewise.
2776 * elf64-mmix.c: Likewise.
2777 * elf64-ppc.c: Likewise.
2778 * elf64-s390.c: Likewise.
2779 * elf64-sh64.c: Likewise.
2780 * elf64-x86-64.c: Likewise.
2781 * elflink.c: Likewise.
2782 * elfnn-aarch64.c: Likewise.
2783 * elfnn-ia64.c: Likewise.
2784 * elfnn-riscv.c: Likewise.
2785 * elfxx-mips.c: Likewise.
2786 * elfxx-sparc.c: Likewise.
2787 * elfxx-tilegx.c: Likewise.
2788 * linker.c: Likewise.
2790 2017-05-16 Alan Modra <amodra@gmail.com>
2792 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2793 * elflink.c (elf_link_add_object_symbols): Update to use
2795 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2797 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2799 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2801 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2803 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2805 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2806 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2808 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2810 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2812 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2814 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2815 to plt_second/plt_second_eh_frame.
2816 (elf_x86_64_link_hash_newfunc): Updated.
2817 (elf_x86_64_allocate_dynrelocs): Likewise.
2818 (elf_x86_64_size_dynamic_sections): Likewise.
2819 (elf_x86_64_relocate_section): Likewise.
2820 (elf_x86_64_finish_dynamic_symbol): Likewise.
2821 (elf_x86_64_finish_dynamic_sections): Likewise.
2822 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2823 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2825 (elf_backend_setup_gnu_properties): Updated. Create the
2826 .plt.sec section instead of the .plt.sec section.
2828 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2830 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2831 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2832 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2834 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2836 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2837 (bfd_elf64_set_reloc): Define.
2838 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2840 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2842 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2843 (struct bfd_target): New field _bfd_set_reloc.
2844 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2845 * reloc.c (_bfd_generic_set_reloc): New function.
2846 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2847 * nlm-target.h (nlm_set_reloc): Likewise.
2848 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2849 * aout-tic30.c (MY_set_reloc): Likewise.
2850 * aout-target.h (MY_set_reloc): Likewise.
2851 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2852 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2853 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2854 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2855 * aout-adobe.c (aout_32_set_reloc): Likewise.
2856 * bout.c (b_out_set_reloc): Likewise.
2857 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2858 * i386os9k.c (aout_32_set_reloc): Likewise.
2859 * ieee.c (ieee_set_reloc): Likewise.
2860 * oasys.c (oasys_set_reloc): Likewise.
2861 * som.c (som_set_reloc): Likewise.
2862 * versados.c (versados_set_reloc): Likewise.
2863 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2864 _bfd_generic_set_reloc.
2865 (rs6000_xcoff64_aix_vec): LIkewise.
2866 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2867 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2868 * i386msdos.c (msdos_set_reloc): Define to
2869 _bfd_norelocs_set_reloc.
2870 * elfcode.h (elf_set_reloc): Define.
2871 * bfd-in2.h: Regenerated.
2873 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2876 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2877 for IFUNC function address.
2879 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2881 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2882 (CONFLICT_LIST): Likewise.
2883 (opcode/arc-attrs.h): Include.
2884 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2885 (arc_extract_features): New file.
2886 (arc_stralloc): Likewise.
2887 (arc_elf_merge_attributes): Likewise.
2888 (arc_elf_merge_private_bfd_data): Use object attributes.
2889 (bfd_arc_get_mach_from_attributes): New function.
2890 (arc_elf_object_p): Use object attributes.
2891 (arc_elf_final_write_processing): Likewise.
2892 (elf32_arc_obj_attrs_arg_type): New function.
2893 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2894 (elf32_arc_section_from_shdr): Likewise.
2895 (elf_backend_obj_attrs_vendor): Define.
2896 (elf_backend_obj_attrs_section): Likewise.
2897 (elf_backend_obj_attrs_arg_type): Likewise.
2898 (elf_backend_obj_attrs_section_type): Likewise.
2899 (elf_backend_obj_attrs_handle_unknown): Likewise.
2900 (elf_backend_section_from_shdr): Likewise.
2902 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2905 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2906 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2907 and the destination is a Thumb symbol.
2909 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2911 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2912 initializer to silence GCC 4.2.
2913 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2915 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2917 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2918 (LAZY_PLT_ENTRY_SIZE): This.
2919 (NON_LAZY_PLT_ENTRY_SIZE): New.
2920 (elf_x86_64_plt0_entry): Renamed to ...
2921 (elf_x86_64_lazy_plt0_entry): This.
2922 (elf_x86_64_plt_entry): Renamed to ...
2923 (elf_x86_64_lazy_plt_entry): This.
2924 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2925 (elf_x86_64_lazy_bnd_plt0_entry): This.
2926 (elf_x86_64_legacy_plt_entry): Removed.
2927 (elf_x86_64_bnd_plt_entry): Renamed to ...
2928 (elf_x86_64_lazy_bnd_plt_entry): This.
2929 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2930 (elf_x86_64_non_lazy_plt_entry): This.
2931 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2932 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2933 (elf_x86_64_eh_frame_plt): Renamed to ...
2934 (elf_x86_64_eh_frame_lazy_plt): This.
2935 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2936 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2937 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2938 (elf_x86_64_eh_frame_non_lazy_plt): This.
2939 (elf_x86_64_lazy_plt_layout): New.
2940 (elf_x86_64_non_lazy_plt_layout): Likewise.
2941 (elf_x86_64_plt_layout): Likewise.
2942 (elf_x86_64_backend_data): Remove PLT layout information. Add
2943 os for target system.
2944 (GET_PLT_ENTRY_SIZE): Removed.
2945 (elf_x86_64_lazy_plt): New.
2946 (elf_x86_64_non_lazy_plt): Likewise.
2947 (elf_x86_64_lazy_bnd_plt): Likewise.
2948 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2949 (elf_x86-64_arch_bed): Updated.
2950 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2951 (elf_x86_64_create_dynamic_sections): Removed.
2952 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2953 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2954 (elf_x86-64_adjust_dynamic_symbol): Updated.
2955 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2956 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2957 size for PLT0 if there is no PLT0. Get plt_entry_size from
2958 non_lazy_plt for non-lazy PLT entries.
2959 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2960 from non_lazy_plt for non-lazy PLT entries.
2961 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2962 if there is no PLT0.
2963 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2964 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2965 entries with non-lazy PLT layout. Don't fill the second and third
2966 slots in the PLT entry if there is no PLT0.
2967 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2968 if there is no PLT0. Set sh_entsize on the .plt.got section.
2969 (compare_relocs): New.
2970 (elf_x86_64_plt_type): Likewise.
2971 (elf_x86_64_plt): Likewise.
2972 (elf_x86_64_nacl_plt): New. Forward declaration.
2973 (elf_x86_64_get_plt_sym_val): Removed.
2974 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2975 against all dynamic relocations.
2976 (elf_x86_64_link_setup_gnu_properties): New function.
2977 (elf_backend_create_dynamic_sections): Updated.
2978 (elf_backend_setup_gnu_properties): New.
2979 (elf_x86_64_nacl_plt): New.
2980 (elf_x86_64_nacl_arch_bed): Updated.
2982 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2984 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2985 (LAZY_PLT_ENTRY_SIZE): This.
2986 (NON_LAZY_PLT_ENTRY_SIZE): New.
2987 (elf_i386_plt0_entry): Renamed to ...
2988 (elf_i386_lazy_plt0_entry): This.
2989 (elf_i386_plt_entry): Renamed to ...
2990 (elf_i386_lazy_plt_entry): This.
2991 (elf_i386_pic_plt0_entry): Renamed to ...
2992 (elf_i386_pic_lazy_plt0_entry): This.
2993 (elf_i386_pic_plt_entry): Renamed to ...
2994 (elf_i386_pic_lazy_plt_entry): This.
2995 (elf_i386_got_plt_entry): Renamed to ...
2996 (elf_i386_non_lazy_plt_entry): This.
2997 (elf_i386_pic_got_plt_entry): Renamed to ...
2998 (elf_i386_pic_non_lazy_plt_entry): This.
2999 (elf_i386_eh_frame_plt): Renamed to ...
3000 (elf_i386_eh_frame_lazy_plt): This.
3001 (elf_i386_eh_frame_plt_got): Renamed to ...
3002 (elf_i386_eh_frame_non_lazy_plt): This.
3003 (elf_i386_plt_layout): Renamed to ...
3004 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3005 eh_frame_plt_got_size.
3006 (elf_i386_non_lazy_plt_layout): New.
3007 (elf_i386_plt_layout): Likewise.
3008 (elf_i386_non_lazy_plt): Likewise.
3009 (GET_PLT_ENTRY_SIZE): Removed.
3010 (elf_i386_plt): Renamed to ...
3011 (elf_i386_lazy_plt): This.
3012 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3013 (elf_i386_arch_bed): Updated.
3014 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3015 (elf_i386_create_dynamic_sections): Removed.
3016 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3017 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3018 (elf_i386_adjust_dynamic_symbol): Updated.
3019 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3020 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3021 size for PLT0 if there is no PLT0.
3022 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3023 output section is discarded only if GOT isn't empty.
3024 (elf_i386_relocate_section): Updated. Properly get PLT index
3025 if there is no PLT0.
3026 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3027 second and third slots in the PLT entry if there is no PLT0.
3028 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3029 if there is no PLT0. Set sh_entsize on the .plt.got section.
3030 (elf_i386_nacl_plt): Forward declaration.
3031 (elf_i386_get_plt_sym_val): Removed.
3032 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3033 against all dynamic relocations.
3034 (elf_i386_link_setup_gnu_properties): New function.
3035 (elf_backend_create_dynamic_sections): Updated.
3036 (elf_backend_setup_gnu_properties): New.
3037 (elf_i386_nacl_plt): Updated.
3038 (elf_i386_nacl_arch_bed): Likewise.
3039 (elf_i386_vxworks_arch_bed): Likewise.
3041 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3043 * elflink.c (elf_output_implib): Remove executable flag from import
3045 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3046 library is a relocatable object file.
3048 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3051 * elf32-avr.c (avr_should_move_sym): New function.
3052 (avr_should_reduce_sym_size): Likewise.
3053 (avr_should_increase_sym_size): Likewise.
3054 (elf32_avr_relax_delete_bytes): Adjust symbol values
3055 and sizes by calling new functions.
3057 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3059 * config.bfd (riscv32-*): Enable rv64.
3061 2017-05-02 Alan Modra <amodra@gmail.com>
3064 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3065 rather than h->root.type == bfd_link_hash_new.
3066 (bfd_elf_record_link_assignment): Similarly, call
3067 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3069 2017-04-29 Alan Modra <amodra@gmail.com>
3072 * reloc.c (reloc_offset_in_range): New function.
3073 (bfd_perform_relocation, bfd_install_relocation): Use it.
3074 (_bfd_final_link_relocate): Likewise.
3076 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3078 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3079 before using .plt.got.
3080 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3082 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3084 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3085 instead of "+=" to update 0.
3087 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3089 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3090 .plt.got section here.
3091 (elf_i386_check_relocs): Don't create the .plt.got section.
3092 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3093 the .plt.got and .plt.bnd sections here.
3094 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3097 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3099 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3101 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3102 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3103 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3104 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3107 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3109 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3111 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3112 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3113 the first relocatable ELF input with GNU properties.
3115 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3117 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3118 VxWorks for non-PIC.
3120 2017-04-27 Alan Modra <amodra@gmail.com>
3122 * elf-bfd.h (struct elf_backend_data): Make asection param of
3123 elf_backend_eh_frame_address_size const.
3124 (_bfd_elf_eh_frame_address_size): Likewise.
3125 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3126 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3127 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3128 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3129 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3130 (next_cie_fde_offset): Constify params.
3131 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3133 2017-04-27 Alan Modra <amodra@gmail.com>
3135 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3136 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3137 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3139 (offset_adjust): New function.
3140 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3141 (adjust_eh_frame_local_symbols): Likewise.
3142 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3143 after changing anything. Return true if anything changed.
3144 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3145 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3147 2017-04-27 Alan Modra <amodra@gmail.com>
3149 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3152 2017-04-27 Alan Modra <amodra@gmail.com>
3154 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3155 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3156 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3157 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3158 for undef and undefweak dyn_relocs.
3159 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3160 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3161 (allocate_got, allocate_dynrelocs): Likewise.
3162 (ppc64_elf_relocate_section): Likewise.
3164 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3166 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3167 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3168 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3169 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3171 2017-04-26 Nick Clifton <nickc@redhat.com>
3174 * reloc.c (bfd_perform_relocation): Check for a negative address
3177 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3180 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3182 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3183 (elf_backend_always_renumber_dynsyms): Define.
3184 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3185 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3186 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3187 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3189 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3191 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3193 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3194 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3195 sections have been created.
3197 2017-04-26 Nick Clifton <nickc@redhat.com>
3200 * compress.c (bfd_init_section_compress_status): Check the return
3201 value from bfd_malloc.
3203 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3205 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3206 no_finish_dynamic_symbol.
3207 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3209 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3210 weak symbol, don't make it dynamic.
3211 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3212 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3213 relocation for GOT reference.
3214 (elf_x86_64_finish_dynamic_symbol): Abort if
3215 no_finish_dynamic_symbol isn't 0.
3217 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3220 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3221 undefined weak symbol, don't make it dynamic.
3222 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3223 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3224 relocation for R_386_GOT32.
3226 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3229 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3231 2017-04-23 Alan Modra <amodra@gmail.com>
3234 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3235 * elf.c (lcomm_sym): New.
3236 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3237 * bfd-in2.h: Regenerate.
3239 2017-04-23 Alan Modra <amodra@gmail.com>
3242 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3243 parameters and comment.
3244 (_bfd_elf_get_reloc_section): Delete.
3245 (_bfd_elf_plt_get_reloc_section): Declare.
3246 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3247 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3249 (_bfd_elf_get_reloc_section): ..here. Delete.
3250 (assign_section_numbers): Call elf_get_reloc_section.
3251 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3252 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3254 2017-04-23 Alan Modra <amodra@gmail.com>
3257 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3260 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3263 * elf32-i386.c (elf_i386_link_hash_entry): Add
3264 no_finish_dynamic_symbol.
3265 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3266 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3267 symbol, don't make it dynamic in PIE.
3268 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3269 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3270 relocation for R_386_GOT32
3271 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3274 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3278 * elflink.c (elf_link_add_object_symbols): Require
3279 --no-dynamic-linker with -E/--dynamic-list when creating
3282 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3284 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3287 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3289 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3290 dynamic symbol sorting.
3292 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3295 * elflink.c (elf_link_add_object_symbols): Preserve
3296 dynamic_ref_after_ir_def when restoring the symbol table for
3297 unneeded dynamic object.
3299 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3302 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3303 on on undefined IFUNC symbol in the second PLT.
3305 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3307 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3309 2017-04-19 Alan Modra <amodra@gmail.com>
3311 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3312 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3313 * elf32-ppc.c:Formatting.
3314 (ensure_undefweak_dynamic): Don't make dynamic when
3315 info->dynamic_undefined_weak is zero.
3316 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3317 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3318 not default visibility. Discard undef and undefweak
3320 (ppc_elf_relocate_section): Adjust to suit.
3321 * elf64-ppc.c: Formatting.
3322 (ensure_undefweak_dynamic): Don't make dynamic when
3323 info->dynamic_undefined_weak is zero.
3324 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3325 info->dynamic_undefined_weak. Discard them earlier.
3327 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3330 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3331 before generating the version definition section.
3333 2017-04-17 Alan Modra <amodra@gmail.com>
3335 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3336 state when a regular object file defines a symbol with
3337 incompatible type to that defined by an earlier shared lib.
3339 2017-04-13 Alan Modra <amodra@gmail.com>
3341 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3343 * elf32-arm.c: Likewise.
3344 * elf32-i386.c: Likewise.
3345 * elf32-mep.c: Likewise.
3346 * elf64-ia64-vms.c: Likewise.
3347 * elf64-x86-64.c: Likewise.
3348 * elflink.c: Likewise.
3349 * elfnn-ia64.c: Likewise.
3350 * elfxx-mips.c: Likewise.
3352 2017-04-13 Alan Modra <amodra@gmail.com>
3354 * aoutx.h: Use %B and %A in error messages throughout file.
3355 * aout-cris.c: Likewise.
3356 * archive.c: Likewise.
3357 * binary.c: Likewise.
3358 * coff-rs6000.c: Likewise.
3359 * coff-tic4x.c: Likewise.
3360 * coffcode.h: Likewise.
3361 * coffgen.c: Likewise.
3362 * cofflink.c: Likewise.
3363 * coffswap.h: Likewise.
3364 * cpu-arm.c: Likewise.
3365 * elf-eh-frame.c: Likewise.
3366 * elf-m10300.c: Likewise.
3368 * elf32-arc.c: Likewise.
3369 * elf32-arm.c: Likewise.
3370 * elf32-bfin.c: Likewise.
3371 * elf32-frv.c: Likewise.
3372 * elf32-iq2000.c: Likewise.
3373 * elf32-m32c.c: Likewise.
3374 * elf32-microblaze.c: Likewise.
3375 * elf32-nds32.c: Likewise.
3376 * elf32-rl78.c: Likewise.
3377 * elf32-rx.c: Likewise.
3378 * elf32-score.c: Likewise.
3379 * elf32-score7.c: Likewise.
3380 * elf32-sh64.c: Likewise.
3381 * elf32-v850.c: Likewise.
3382 * elf32-vax.c: Likewise.
3383 * elf32-visium.c: Likewise.
3384 * elf64-ia64-vms.c: Likewise.
3385 * elf64-mmix.c: Likewise.
3386 * elf64-sh64.c: Likewise.
3387 * elfcode.h: Likewise.
3388 * elfnn-aarch64.c: Likewise.
3389 * elfnn-ia64.c: Likewise.
3390 * elfxx-mips.c: Likewise.
3391 * hpux-core.c: Likewise.
3394 * linker.c: Likewise.
3395 * merge.c: Likewise.
3397 * oasys.c: Likewise.
3398 * pdp11.c: Likewise.
3399 * peXXigen.c: Likewise.
3400 * rs6000-core.c: Likewise.
3401 * vms-alpha.c: Likewise.
3402 * xcofflink.c: Likewise.
3404 2017-04-13 Alan Modra <amodra@gmail.com>
3406 * bfd.c (PRINT_TYPE): Define.
3407 (_doprnt): New function.
3408 (error_handler_internal): Use _doprnt.
3409 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3410 calls in their natural order, throughout file.
3411 * coff-mcore.c: Likewise.
3412 * coff-ppc.c: Likewise.
3413 * coff-tic80.c: Likewise.
3414 * cofflink.c: Likewise.
3415 * elf-s390-common.c: Likewise.
3417 * elf32-arm.c: Likewise.
3418 * elf32-i386.c: Likewise.
3419 * elf32-m32r.c: Likewise.
3420 * elf32-msp430.c: Likewise.
3421 * elf32-spu.c: Likewise.
3422 * elf64-ia64-vms.c: Likewise.
3423 * elf64-sparc.c: Likewise.
3424 * elf64-x86-64.c: Likewise.
3425 * elflink.c: Likewise.
3426 * elfnn-aarch64.c: Likewise.
3427 * elfnn-ia64.c: Likewise.
3428 * elfxx-mips.c: Likewise.
3430 2017-04-13 Alan Modra <amodra@gmail.com>
3432 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3433 branch veneers" error. Fix double space and format message.
3434 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3435 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3437 2017-04-13 Alan Modra <amodra@gmail.com>
3439 * bfd-in2.h: Regenerate.
3441 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3443 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3444 extra `\n' in warning/error messages.
3445 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3446 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3448 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3450 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3451 processor-specific properties with generic ELF target vector.
3453 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3455 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3456 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3457 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3458 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3460 (link_hash_newfunc): Initialize has_got_reloc and
3462 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3464 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3466 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3468 (_bfd_sparc_elf_fixup_symbol): New function.
3469 (allocate_dynrelocs): Don't allocate space for dynamic
3470 relocations and discard relocations against resolved undefined
3471 weak symbols in executable. Don't make resolved undefined weak
3472 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3473 relocation against undefined weak symbols in PIE.
3474 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3475 relocations against resolved undefined weak symbols in PIE
3476 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3477 without ynamic PLT/GOT relocations for resolved undefined weak
3479 Don't generate dynamic relocation against resolved undefined
3480 weak symbol in executable.
3481 (pie_finish_undefweak_symbol): New function.
3482 (_bfd_sparc_elf_finish_dynamic_sections): Call
3483 pie_finish_undefweak_symbol on all symbols in PIE.
3484 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3485 (_bfd_sparc_elf_fixup_symbol): New function.
3487 2017-04-10 Nick Clifton <nickc@redhat.com>
3489 * config.bfd: Remove ns32k from obsolete list.
3491 2017-04-10 Alan Modra <amodra@gmail.com>
3494 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3495 (special_sections_i): Likewise for .init_array.
3496 (special_sections_p): Likewise for .preinit_array.
3498 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3502 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3503 ELF_COMMON_DEF_P for common symbols.
3504 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3505 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3506 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3507 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3508 07492f668d2173da7a2bda3707ff0985e0f460b6.
3510 2017-04-07 Pedro Alves <palves@redhat.com>
3512 * opncls.c (bfd_get_debug_link_info): Rename to...
3513 (bfd_get_debug_link_info_1): ... this. Change type of second
3514 parameter to void pointer. Adjust.
3515 (bfd_get_debug_link_info): Reimplement on top of
3516 bfd_get_debug_link_info_1.
3517 (separate_debug_file_exists, separate_alt_debug_file_exists):
3518 Change type of second parameter to void pointer. Adjust.
3519 (get_func_type, check_func_type): Change type of second parameter
3521 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3522 the callback functions instead of passing the address of a local.
3523 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3524 find_separate_debug_file.
3525 (get_alt_debug_link_info_shim): Change type of second parameter to
3526 void pointer. Adjust.
3527 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3528 find_separate_debug_file.
3529 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3530 of second parameter to void pointer. Adjust.
3531 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3532 pointer local to find_separate_debug_file.
3534 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3536 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3537 external symbols with a definition.
3538 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3540 2017-04-07 Alan Modra <amodra@gmail.com>
3542 * po/SRC-POTFILES.in: Regenerate.
3544 2017-04-05 Alan Modra <amodra@gmail.com>
3546 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3549 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3551 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3552 numbers for DataDirectory entry indicies passed to
3555 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3557 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3558 each GNU_MBIND section and align GNU_MBIND section to page size.
3559 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3560 segment for each GNU_MBIND section.
3561 (_bfd_elf_init_private_section_data): Copy sh_info from input
3562 for GNU_MBIND section.
3564 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3566 * elfnn-riscv.c (GP_NAME): Delete.
3567 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3568 (_bfd_riscv_relax_lui): Likewise.
3570 2017-04-04 Nick Clifton <nickc@redhat.com>
3573 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3575 (bfd_elf_final_link): Only initialize the extended symbol index
3576 section if there are extended symbol tables to list.
3578 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3580 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3581 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3582 * configure.ac (elf): Add elf-properties.lo.
3583 * Makefile.in: Regenerated.
3584 * configure: Likewise.
3585 * elf-bfd.h (elf_property_kind): New.
3586 (elf_property): Likewise.
3587 (elf_property_list): Likewise.
3588 (elf_properties): Likewise.
3589 (_bfd_elf_parse_gnu_properties): Likewise.
3590 (_bfd_elf_get_property): Likewise.
3591 (_bfd_elf_link_setup_gnu_properties): Likewise.
3592 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3593 and setup_gnu_properties.
3594 (elf_obj_tdata): Add properties.
3595 * elf-properties.c: New file.
3596 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3597 (elf_i386_merge_gnu_properties): Likewise.
3598 (elf_backend_parse_gnu_properties): Likewise.
3599 (elf_backend_merge_gnu_properties): Likewise.
3600 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3601 (elf_x86_64_merge_gnu_properties): Likewise.
3602 (elf_backend_parse_gnu_properties): Likewise.
3603 (elf_backend_merge_gnu_properties): Likewise.
3604 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3605 (elf_backend_parse_gnu_properties): Likewise.
3606 (elf_backend_setup_gnu_properties): Likewise.
3607 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3608 elf_backend_merge_gnu_properties and
3609 elf_backend_setup_gnu_properties.
3611 2017-03-30 Pip Cet <pipcet@gmail.com>
3613 * elf32-wasm32.c: Add relocation code, two relocs.
3614 * reloc.c: Add wasm32 relocations.
3615 * libbfd.h: Regenerate.
3616 * bfd-in2.h: Regenerate.
3617 * bfd/po/bfd.pot: Regenerate.
3619 2017-03-29 Nick Clifton <nickc@redhat.com>
3622 * coff-bfd.h (struct coff_section_data): Add new fields:
3623 saved_bias and bias.
3624 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3625 computed for PE binaries.
3626 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3629 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3632 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3633 to handle a local symbol with a hash-symbol-entry; without PLT.
3634 Add BFD_ASSERT for an incidental case with GOT entry present.
3635 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3636 isn't forced-or-set local.
3638 2017-03-27 Pip Cet <pipcet@gmail.com>
3640 * wasm-module.c: New file to support WebAssembly modules.
3641 * wasm-module.h: New file to support WebAssembly modules.
3642 * doc/webassembly.texi: Start documenting wasm-module.c.
3643 * config.bfd: Add wasm_vec.
3644 * targets.c: Likewise.
3645 * configure.ac: Likewise.
3646 * Makefile.am: Add entries for wasm-module.c.
3647 * Makefile.in: Regenerate.
3648 * configure: Regenerate.
3649 * po/SRC-POTFILES.in: Regenerate.
3651 2017-03-27 Pip Cet <pipcet@gmail.com>
3653 * cpu-wasm32.c: New file to support wasm32 architecture.
3654 * elf32-wasm32.c: New file to support wasm32 architecture.
3655 * Makefile.am: Add wasm32 architecture.
3656 * archures.c: Likewise.
3657 * config.bfd: Likewise.
3658 * configure.ac: Likewise.
3659 * targets.c: Likewise.
3660 * Makefile.in: Regenerate.
3661 * bfd-in2.h: Regenerate.
3662 * configure: Regenerate.
3663 * po/SRC-POTFILES.in: Regenerate.
3665 2017-03-20 Alan Modra <amodra@gmail.com>
3668 * elf64-ppc.c (compare_symbols): Stabilize sort.
3670 2017-03-18 Alan Modra <amodra@gmail.com>
3672 * elf64-ppc.c (struct ppc_link_hash_table): Add
3673 local_ifunc_resolver and maybe_local_ifunc_resolver.
3674 (ppc_build_one_stub): Set flags on emitting dynamic
3675 relocation to ifunc.
3676 (ppc64_elf_relocate_section): Likewise.
3677 (ppc64_elf_finish_dynamic_symbol): Likewise.
3678 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3679 local dynamic relocs to ifuncs.
3680 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3681 local_ifunc_resolver and maybe_local_ifunc_resolver.
3682 (ppc_elf_relocate_section): Set flag on emitting dynamic
3683 relocation to ifuncs.
3684 (ppc_elf_finish_dynamic_symbol): Likewise.
3685 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3686 dynamic relocs to ifuncs.
3688 2017-03-13 Nick Clifton <nickc@redhat.com>
3691 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3692 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3693 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3694 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3695 * bfd-in2.h: Regenerate.
3696 * libbfd.h: Regenerate.
3697 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3699 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3700 (elfNN_aarch64_howto_table): Likewise.
3701 (aarch64_tls_transition_without_check): Likewise.
3702 (aarch64_reloc_got_type): Likewise.
3703 (elfNN_aarch64_final_link_relocate): Likewise.
3704 (elfNN_aarch64_tls_relax): Likewise.
3705 (elfNN_aarch64_relocate_section): Likewise.
3706 (elfNN_aarch64_gc_sweep_hook): Likewise.
3707 (elfNN_aarch64_check_relocs): Likewise.
3708 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3709 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3711 2017-03-11 Alan Modra <amodra@gmail.com>
3713 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3714 parameter is in fact used. Whitespace fixes.
3715 * elf64-ppc.c: Likewise.
3717 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3719 * rs6000-core.c (CORE_NEW): Simplify macro when
3720 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3722 2017-03-07 Alan Modra <amodra@gmail.com>
3726 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3729 2017-03-05 Alan Modra <amodra@gmail.com>
3731 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3732 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3733 (next_cie_fde_offset): New function.
3734 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3735 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3736 four bytes. Align CIEs to four or eight bytes depending on
3737 per_encoding_aligned8. Align FDEs according to their encoding.
3738 Pad last FDE to output section alignment.
3739 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3741 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3742 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3743 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3745 2017-03-02 Martin Bickel <binutils@ineranves.de>
3748 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3749 empty segments which have a zero filesz, but a non-zero memsz.
3751 2017-03-02 Alan Modra <amodra@gmail.com>
3753 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3755 2017-02-28 Alan Modra <amodra@gmail.com>
3757 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3758 (ppc64_elf_relocate_section): Likewise.
3760 2017-02-28 Alan Modra <amodra@gmail.com>
3763 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3764 rather than elf32_nios2_hash_table or elf_hash_table.
3765 (create_got_section): Likewise.
3766 (nios2_elf32_finish_dynamic_symbol): Likewise.
3767 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3768 (nios2_elf32_size_dynamic_sections): Likewise.
3769 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3770 vars. Use htab equivalents directly instead. Don't create
3771 all dynamic sections on needing just the GOT. Use a goto
3772 rather than a fall-through with reloc test. Ensure
3773 htab->dynobj is set when making dynamic sreloc section.
3774 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3775 equivalent directly instead. Don't segfault on looking for
3776 .dynamic when dynamic sections have not been created. Don't
3777 segfault on .got.plt being discarded.
3778 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3779 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3780 fixme and another not so relevant comment.
3781 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3782 already set, set hash table dynobj on creating .sbss.
3784 2017-02-28 Alan Modra <amodra@gmail.com>
3786 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3787 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3788 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3789 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3790 (ppc64_elf_relocate_section): Likewise.
3791 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3792 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3793 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3794 * libbfd.h: Regenerate.
3795 * bfd-in2.h: Regenerate.
3797 2017-02-28 Alan Modra <amodra@gmail.com>
3799 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3800 dynamic .data.rel.ro read-only.
3801 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3802 rather than section flags when deciding where copy reloc goes.
3803 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3804 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3805 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3806 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3807 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3808 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3809 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3810 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3811 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3812 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3813 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3814 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3815 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3816 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3817 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3818 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3819 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3820 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3821 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3823 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3825 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3826 `jalr $0, $25' instruction encoding.
3828 2017-02-27 Nick Clifton <nickc@redhat.com>
3831 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3832 generating a seg-fault when encountering a symbol that has been
3833 deleted by garbage collection.
3835 2017-02-25 Alan Modra <amodra@gmail.com>
3837 * elf32-arc.c (struct dynamic_sections): Delete.
3838 (enum dyn_section_types): Delete.
3839 (dyn_section_names): Delete.
3840 (arc_create_dynamic_sections): Delete.
3841 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3842 segfault on discarded .rela.plt section.
3843 (elf_arc_size_dynamic_sections): Formatting. Don't call
3844 arc_create_dynamic_sections. Don't allocate memory for sections
3845 handled by the generic linker. Correct code finding relocs in
3846 read-only sections. Set SEC_EXCLUDE on zero size .got,
3847 .got.plt, and .dynbss sections. Do set .interp for pies.
3849 2017-02-24 Andrew Waterman <andrew@sifive.com>
3851 * elfnn-riscv.c (GP_NAME): New macro.
3852 (riscv_global_pointer_value): Use it.
3853 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3854 output section, consider only that section's alignment.
3856 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3858 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3859 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3860 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3861 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3863 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3865 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3866 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3869 2017-02-23 Alan Modra <amodra@gmail.com>
3872 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3874 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3875 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3878 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3881 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3882 processing ahead of the call to `elf_gc_sweep_symbol'.
3884 2017-02-22 Nick Clifton <nickc@redhat.com>
3887 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3888 created section 4-byte alignment.
3890 2017-02-22 Alan Modra <amodra@gmail.com>
3892 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3893 on .got or .plt output section being discarded by script.
3894 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3897 2017-02-21 Alan Modra <amodra@gmail.com>
3899 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3900 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3902 2017-02-20 Alan Modra <amodra@gmail.com>
3905 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3906 if DT_RELSZ/DT_RELASZ is zero.
3908 2017-02-17 Nick Clifton <nickc@redhat.com>
3910 * compress.c (bfd_get_full_section_contents): Remember to reduce
3911 compressed size by the sizeof the compression header when
3912 decompressing the contents.
3914 2017-02-17 Pedro Alves <palves@redhat.com>
3916 * srec.c (Chunk): Rename to ...
3917 (_bfd_srec_len): ... this.
3918 (S3Forced): Rename to ...
3919 (_bfd_srec_forceS3): ... this.
3920 * objcopy.c: Adjust all references.
3922 2017-02-17 Pedro Alves <palves@redhat.com>
3924 * archive.c (bsd_write_armap): Rename to ...
3925 (_bfd_bsd_write_armap): ... this.
3926 (coff_write_armap): Rename to ...
3927 (_bfd_coff_write_armap): ... this.
3928 * libbfd-in.h (bsd_write_armap): Rename to ...
3929 (_bfd_bsd_write_armap): ... this.
3930 (coff_write_armap): Rename to ...
3931 (_bfd_coff_write_armap): ... this.
3932 * aout-target.h, aout-tic30.c: Adjust all users.
3933 * libbfd.h: Regenerate.
3935 2017-02-17 Pedro Alves <palves@redhat.com>
3937 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3938 (warn_deprecated): Rename to ...
3939 (_bfd_warn_deprecated): ... this.
3940 * libbfd.c (warn_deprecated): Rename to ...
3941 (_bfd_warn_deprecated): ... this.
3942 * bfd-in2.h: Regenerate.
3944 2017-02-17 Pedro Alves <palves@redhat.com>
3946 * bfdio.c (real_ftell): Rename to ...
3947 (_bfd_real_ftell): ... this.
3948 (real_fseek): Rename to ...
3949 (_bfd_real_fseek): ... this.
3950 (real_fopen): Rename to ...
3951 (_bfd_real_fopen): ... this.
3952 * libbfd-in.h (real_ftell): Rename to ...
3953 (_bfd_real_ftell): ... this.
3954 (real_fseek): Rename to ...
3955 (_bfd_real_fseek): ... this.
3956 (real_fopen): Rename to ...
3957 (_bfd_real_fopen): ... this.
3958 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3959 * libbfd.h: Regenerate.
3961 2017-02-17 Pedro Alves <palves@redhat.com>
3963 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3964 * libbfd.c (read_unsigned_leb128): Rename to ...
3965 (_bfd_read_unsigned_leb128): ... this.
3966 (read_signed_leb128): Rename to ...
3967 (_bfd_read_signed_leb128): ... this.
3968 (safe_read_leb128): Rename to ...
3969 (_bfd_safe_read_leb128): ... this.
3970 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3971 (_bfd_read_unsigned_leb128): ... this.
3972 (read_signed_leb128): Rename to ...
3973 (_bfd_read_signed_leb128): ... this.
3974 (safe_read_leb128): Rename to ...
3975 (_bfd_safe_read_leb128): ... this.
3976 * libbfd.h: Renegerate.
3978 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3980 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3981 before trying to fine matching file and line information.
3983 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3985 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3986 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3987 not match current bfd, then reload debug information. Record bfd
3988 we're loading debug info for in the stash. If we have debug
3989 informatin in the cache then perform section placement before
3992 2017-02-16 Alan Modra <amodra@gmail.com>
3995 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3996 * elfxx-target.h (elf_backend_no_page_alias): Define.
3997 (elfNN_bed): Init new field.
3998 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3999 ensure PT_LOAD segment starts on a new page.
4000 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4002 2017-02-16 Alan Modra <amodra@gmail.com>
4005 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4008 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4010 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4011 * bfd-in2.h: Regenerated.
4013 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4016 * elf32-i386.c (elf_i386_relocate_section): Allow
4017 "lea foo@GOT, %reg" in PIC.
4019 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4022 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4023 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4024 error against local IFUNC symbol without a base register for
4027 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4029 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4030 `%P: %H:' with `info->callbacks->einfo'.
4031 (ppc_elf_relocate_section): Likewise.
4032 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4033 (ppc64_elf_edit_toc): Likewise.
4034 (ppc64_elf_relocate_section): Likewise.
4036 2017-02-14 Alan Modra <amodra@gmail.com>
4038 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4039 --gc-keep-exported, and test versioned field of sym rather than
4040 looking for @ in name.
4042 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4044 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4047 2017-02-13 Nick Clifton <nickc@redhat.com>
4050 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4053 2017-02-07 Andrew Waterman <andrew@sifive.com>
4055 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4056 entry size if PLT header is written.
4058 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4060 Fix sparc64 dynamic relocation processing to use the dynamic
4062 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4063 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4066 2017-02-03 Nick Clifton <nickc@redhat.com>
4069 * coffcode.h (coff_write_object_contents): Enlarge size of
4070 s_name_buf in order to avoid compile time warning about possible
4072 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4073 32-bits of insn value before printing into buffer.
4075 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4077 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4078 `max_local_dynindx'.
4079 (mips_elf_sort_hash_table): Handle it.
4080 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4081 symbols bump up `max_local_dynindx' rather than
4082 `max_non_got_dynindx'.
4084 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4086 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4087 `min_got_dynindx', `max_unref_got_dynindx' and
4088 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4089 (mips_elf_sort_hash_table): Adjust accordingly.
4091 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4093 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4094 to access the hash table.
4096 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4098 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4099 non-NULL `htab' to the beginning.
4101 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4103 * elflink.c (elf_gc_sweep): Wrap overlong line.
4105 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4107 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4108 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4109 * elfxx-mips.c (mips_elf_link_hash_table): Add
4110 `ignore_branch_isa' member.
4111 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4112 in branch relocation calculation as an error if
4113 `ignore_branch_isa' has been set.
4114 (_bfd_mips_elf_insn32): Rename to...
4115 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4116 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4117 Handle the new parameter.
4119 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4121 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4122 local variable dynobj.
4125 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4126 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4127 executable from read-only sections into sdynrelro.
4128 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4129 dynamic relocs in sdynrelro.
4130 (elf_backend_want_dynrelro): Define.
4132 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4134 * config.bfd (*-*-rtemsaout*): Mark as removed.
4136 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4138 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4139 (arm-*-rtems*): Move to (arm*-*-eabi*).
4140 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4141 (m68-*-rtems*): Move to (m68*-*-elf*).
4143 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4145 * config.bfd (*-*-rtemscoff*): Mark as removed.
4147 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4150 * elflink.c (bfd_elf_record_link_assignment): Revert last
4151 change and don't ever clear `forced_local'. Set `mark'
4153 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4155 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4156 (bfd_elf_size_dynamic_sections): ... here.
4157 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4158 and set `mark' instead in `__tls_get_addr_opt' processing.
4159 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4161 2017-01-24 Alan Modra <amodra@gmail.com>
4163 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4164 where dynamic relocs are preferable. Allow ifunc too.
4165 (ensure_undefweak_dynamic): New function.
4166 (allocate_dynrelocs): Use it here. Move plt handling last and
4167 don't make symbols dynamic, simplifying loop. Only make undef
4168 weak symbols with GOT entries dynamic. Correct condition
4169 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4170 comments. Remove goto.
4171 (ppc_elf_relocate_section): Correct test for using dynamic
4172 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4173 to suit. Set up explicit tls_index entries and implicit GOT
4174 tls_index entries resolvable at link time for
4175 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4176 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4177 (ensure_undefweak_dynamic): New function.
4178 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4179 with GOT entries dynamic. Remove unnecessary test of
4180 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4181 (ppc64_elf_relocate_section): Correct test for using dynamic
4182 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4183 to suit. Set up explicit tls_index entries and implicit GOT
4184 tls_index entries resolvable at link time for __tls_get_addr_opt.
4185 Simplify expression to clear mem for prelink.
4187 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4189 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4191 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4193 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4194 (elf_backend_hash_symbol): Define.
4196 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4199 * elflink.c (bfd_elf_record_link_assignment): Clear any
4200 `forced_local' marking for DSO symbols that are not being
4203 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4205 * elfnn-riscv.c (riscv_elf_object_p): New function.
4207 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4210 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4212 (elf_x86_64_check_relocs): Create .eh_frame section for the
4214 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4215 .eh_frame section for the .plt.bnd section.
4216 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4217 for the .plt.bnd section.
4219 2017-01-12 Nick Clifton <nickc@redhat.com>
4222 * opncls.c (find_separate_debug_file): Add include_dirs
4223 parameter. Only include the directory part of the bfd's filename
4224 in search paths if include_dirs is true. Add a couple of extra
4225 locations for looking for debug files.
4226 ( bfd_follow_gnu_debuglink): Update invocation of
4227 find_separate_debug_file.
4228 (bfd_follow_gnu_debugaltlink): Likewise.
4229 (get_build_id): New function: Finds the build-id of the given bfd.
4230 (get_build_id_name): New function: Computes the name of the
4231 separate debug info file for a bfd, based upon its build-id.
4232 (check_build_id_file): New function: Checks to see if a separate
4233 debug info file exists at the given location, and that its
4234 build-id matches that of the original bfd.
4235 (bfd_follow_build_id_debuglink): New function: Finds a separate
4236 debug info file for a given bfd by using the build-id method.
4237 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4238 method of locating a separate debug info file before using the
4240 * bfd-in2.h: Regenerate.
4242 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4245 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4246 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4247 elf_x86_64_eh_frame_plt_got.
4248 (elf_x86_64_size_dynamic_sections): Get unwind info from
4249 elf_x86_64_bnd_arch_bed for the BND PLT.
4251 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4253 * config.bfd: Add entries for i686-redox and x86_64-redox.
4255 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4257 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4259 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4260 .eh_frame section to 4 bytes for x32.
4261 (elf_x86_64_check_relocs): Likewise.
4263 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4266 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4267 (PLT_GOT_FDE_LENGTH): Likewise.
4268 (elf_i386_plt_layout): Add eh_frame_plt_got and
4269 eh_frame_plt_got_size.
4270 (elf_i386_plt): Updated.
4271 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4272 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4273 (elf_i386_size_dynamic_sections): Allocate and initialize
4274 .eh_frame section for .plt.got.
4275 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4277 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4278 eh_frame_plt_got_size.
4279 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4280 (PLT_GOT_FDE_LENGTH): Likewise.
4281 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4282 eh_frame_plt_got_size.
4283 (elf_x86_64_arch_bed): Updated.
4284 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4285 eh_frame_plt_got_size.
4286 (elf_x86_64_nacl_arch_bed): Likewise.
4287 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4288 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4289 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4290 .eh_frame section for .plt.got.
4291 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4294 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4296 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4297 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4299 2017-01-09 Nick Clifton <nickc@redhat.com>
4301 * dwarf2.c (lookup_address_in_function_table): Return early if
4302 there are no functions in the given comp unit, or if the high
4303 address of the last function in the comp unit is less than the
4306 2017-01-09 Nick Clifton <nickc@redhat.com>
4309 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4310 message if there are too many symbols to load.
4312 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4314 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4315 if relocs are cached.
4317 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4320 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4321 for R_MICROBLAZE_GOTOFF_64.
4323 2017-01-03 Nick Clifton <nickc@redhat.com>
4325 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4326 warning about using a possibly uninitialised variable.
4328 2017-01-02 Alan Modra <amodra@gmail.com>
4330 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4331 (allocate_plt_static, allocate_dynrelocs): Use it.
4333 2017-01-02 Alan Modra <amodra@gmail.com>
4335 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4336 .PARISC.unwind section.
4338 2017-01-02 Alan Modra <amodra@gmail.com>
4341 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4342 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4343 indirect to GOT pointer relative code edit.
4345 2017-01-02 Alan Modra <amodra@gmail.com>
4347 Update year range in copyright notice of all files.
4349 For older changes see ChangeLog-2016
4351 Copyright (C) 2017 Free Software Foundation, Inc.
4353 Copying and distribution of this file, with or without modification,
4354 are permitted in any medium without royalty provided the copyright
4355 notice and this notice are preserved.
4361 version-control: never