1 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
3 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
6 2017-10-06 John Baldwin <jhb@FreeBSD.org>
8 * elf-bfd.h (struct elf_backend_data): Add
9 `elf_backend_grok_freebsd_prstatus'.
10 * elf.c (elfcore_grok_freebsd_note): Call
11 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
13 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
15 (elf_backend_grok_freebsd_prstatus): Define.
16 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
17 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
19 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
21 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
22 and has_non_got_reloc with zero_undefweak.
23 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
24 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
26 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
27 has_non_got_reloc with zero_undefweak.
28 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
29 has_got_reloc and has_non_got_reloc with zero_undefweak.
30 (elf_x86_link_hash_entry): Likewise.
32 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
34 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
35 (VERIFY_COPY_RELOC): Likewise.
37 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
39 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
40 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
41 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
43 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
45 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
46 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
47 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
49 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
51 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
52 * elf32-i386.c (elf_i386_relocate_section): Use it.
53 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
55 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
57 * elf32-i386.c (X86_SIZE_TYPE_P): New.
58 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
59 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
60 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
61 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
63 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
65 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
66 (PLT_LOCAL_IFUNC_P): Likewise.
67 * elf32-i386.c (elf_i386_relocate_section): Use them.
68 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
70 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
72 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
73 * elf32-i386.c (elf_i386_relocate_section): Use it.
74 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
76 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
78 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
79 * elf32-i386.c (elf_i386_relocate_section): Use it.
80 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
82 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
84 * elf32-i386.c (X86_PCREL_TYPE_P): New.
85 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
86 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
87 (X86_PCREL_TYPE_P): This.
88 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
89 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
90 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
92 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
94 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
96 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
97 * elf32-i386.c (elf_i386_tls_transition): Use it.
98 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
100 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
102 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
103 Dump dynamic relocation in read-only section with minfo if
105 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
106 (maybe_set_textrel): Likewise.
107 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
108 read-only section with minfo.
110 2017-10-05 John Baldwin <jhb@FreeBSD.org>
112 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
114 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
116 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
117 in read-only section with minfo.
118 (tilepro_elf_size_dynamic_sections): Likewise.
119 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
120 (tilegx_elf_size_dynamic_sections): Likewise.
122 2017-10-05 Pedro Alves <palves@redhat.com>
125 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
126 ellipsis parameter. Split out bfd_error_on_input code to..
127 (bfd_set_input_error): .. New function.
128 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
129 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
130 * bfd-in2.h: Regenerate.
132 2017-10-05 Alan Modra <amodra@gmail.com>
134 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
135 fini_array error value.
137 2017-10-05 Alan Modra <amodra@gmail.com>
140 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
142 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
144 (elf_fake_sections): Adjust calls. Exit immediately on failure.
145 (bfd_elf_set_group_contents): Add associated reloc section indices
148 2017-10-04 Alan Modra <amodra@gmail.com>
150 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
151 classify symbols for ELFv2.
153 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
156 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
157 undergoes default promotion.
158 * bfd-in2.h: Regenerate.
160 2017-10-02 Alan Modra <amodra@gmail.com>
162 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
163 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
165 2017-10-01 Alan Modra <amodra@gmail.com>
168 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
169 (add_line_info): Always put end_sequence last.
171 2017-10-01 Alan Modra <amodra@gmail.com>
174 * dwarf2.c (read_section): Allocate buffer with extra byte for
175 bfd_simple_get_relocated_section_contents rather than copying
178 2017-09-29 Alan Modra <amodra@gmail.com>
180 * merge.c (merge_strings): Return FALSE on malloc failure.
181 (_bfd_merge_sections): Return failures from record_section and
184 2017-09-28 Alan Modra <amodra@gmail.com>
187 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
188 a case where plugin_notice isn't called.
190 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
192 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
195 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
198 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
199 output_bfd to info->callbacks->minfo.
201 2017-09-26 Nick Clifton <nickc@redhat.com>
204 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
205 assertion failure if elf_x86_64_rtype_to_howto has already issued
208 2017-09-26 Alan Modra <amodra@gmail.com>
211 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
214 2017-09-26 Nick Clifton <nickc@redhat.com>
217 * dwarf2.c (read_formatted_entries): Fail early if we know that
218 the loop parsing data entries will overflow the end of the
221 2017-09-26 Alan Modra <amodra@gmail.com>
224 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
225 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
226 to stash->info_ptr_memory, and check die_ref is within that memory.
227 Set info_ptr_end correctly when another CU is refd. Check die_ref
228 for DW_FORM_ref4 etc. is within CU.
230 2017-09-26 Alan Modra <amodra@gmail.com>
233 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
234 (read_formatted_entries): Init "fe".
235 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
237 2017-09-26 Alan Modra <amodra@gmail.com>
240 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
241 bounds in inner loop.
243 2017-09-25 Alan Modra <amodra@gmail.com>
246 * dwarf1.c (parse_die): Sanity check pointer against section limit
247 before dereferencing.
248 (parse_line_table): Likewise.
250 2017-09-25 Alan Modra <amodra@gmail.com>
253 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
255 (parse_comp_unit): Likewise.
257 2017-09-25 Alan Modra <amodra@gmail.com>
260 * dwarf2.c (read_formatted_entries): Error on format_count zero.
262 2017-09-24 Alan Modra <amodra@gmail.com>
265 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
266 within section bounds.
268 2017-09-24 Alan Modra <amodra@gmail.com>
271 * dwarf2.c (decode_line_info): Properly free line sequences on error.
273 2017-09-24 Alan Modra <amodra@gmail.com>
276 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
277 pname param. Return status. Make name const. Don't abort,
278 return an error. Formatting. Exit if current info_ptr matches
279 orig_info_ptr. Update callers.
280 (scan_unit_for_symbols): Start at nesting_level of zero. Make
281 nested_funcs an array of structs for extensibility. Formatting.
283 2017-09-24 Alan Modra <amodra@gmail.com>
286 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
287 rather than dividing by zero.
289 2017-09-24 Alan Modra <amodra@gmail.com>
292 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
294 2017-09-24 Alan Modra <amodra@gmail.com>
297 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
299 2017-09-24 Alan Modra <amodra@gmail.com>
302 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
303 SHT_GNU_verneed section for sanity. Don't zalloc memory for
306 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
309 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
312 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
315 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
316 -1 if bfd_canonicalize_dynamic_reloc returns 0.
318 2017-09-22 Pedro Alves <palves@redhat.com>
319 Alan Modra <amodra@gmail.com>
321 * version.h: Add comment.
323 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
325 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
326 NT_S390_GS_BC, correct the previously swapped invocations of
327 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
329 2017-09-19 Alan Modra <amodra@gmail.com>
332 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
335 2017-09-19 Alan Modra <amodra@gmail.com>
338 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
339 symbols before calculating verrefs. Don't renumber dynsyms
340 after gc. Exclude .gnu.version when zero or one dynsym.
341 Localize some vars and reindent.
343 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
346 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
347 return from bfd_canonicalize_dynamic_reloc.
349 2017-09-15 Alan Modra <amodra@gmail.com>
352 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
353 overflows bfd_size_type.
355 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
358 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
359 to indicate if conversion is performed.
360 (elf_i386_check_relocs): Cache section contents and relocations
361 if conversion is performed.
362 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
363 contents and relocations if conversion is performed.
365 2017-09-14 Nick Clifton <nickc@redhat.com>
368 * peXXigen.c (pe_print_idata): Extend check for HintName vector
371 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
373 * elfxx-x86.h: Fix a typo in comments.
375 2017-09-09 Kamil Rytarowski <n54@gmx.com>
377 * elf32-nds32.c: Rename __BIT() to N32_BIT().
379 2017-09-09 Alan Modra <amodra@gmail.com>
381 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
384 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
386 * elf32-i386.c (elf_i386_relocate_section): Update usage of
387 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
388 (elf_i386_finish_dynamic_symbol): Likewise.
389 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
390 (elf_x86_64_finish_dynamic_symbol): Likewise.
391 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
392 (_bfd_x86_elf_fixup_symbol): Likewise.
394 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
396 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
397 check has_non_got_reloc.
399 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
402 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
403 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
404 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
405 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
406 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
407 and linker_def on __ehdr_start if it is referenced and not
409 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
410 and return TRUE when building executable, if a symbol has
411 non-GOT/non-PLT relocations in text section or there is no
413 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
415 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
417 * elfxx-x86.h: Update comments.
419 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
421 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
422 elf_x86_plt_layout_table with elf_x86_init_table.
423 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
425 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
427 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
428 (elf_x86_init_table): This.
429 (_bfd_x86_elf_link_setup_gnu_properties): Replace
430 elf_x86_plt_layout_table with elf_x86_init_table.
432 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
434 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
435 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
436 * configure: Regenerated.
437 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
438 and r_sym fields of plt_layout.
439 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
441 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
442 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
443 r_info nor r_sym fields.
444 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
446 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
448 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
450 * (_bfd_riscv_relax_align): Call bfd_set_error and
451 print an error message when unable to relax a .align directive.
453 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
455 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
456 (riscv_record_pcrel_hi_reloc): Add absolute argument.
457 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
458 R_RISCV_PCREL_HI20 relocs, and pass the result to
459 riscv_record_pcrel_hi_reloc.
461 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
463 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
464 r_type_p. Remove the converted argument. Replace
465 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
466 the new relocation type via r_type_p.
467 (elf_i386_relocate_section): Likewise.
468 (elf_i386_finish_dynamic_symbol): Likewise.
469 (need_convert_load): Removed.
470 (check_relocs_failed): Updated.
471 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
472 instead of setting need_convert_load.
473 (_bfd_i386_elf_convert_load): Removed.
474 * elf64-x86-64.c (need_convert_load): Removed.
475 (check_relocs_failed): Updated.
476 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
477 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
478 Return the new relocation type via r_type_p.
479 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
480 instead of setting need_convert_load.
481 (elf_x86_64_check_relocs): Don't check PIC if relocation has
483 (_bfd_x86_64_elf_convert_load): Removed.
484 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
485 with SYMBOL_REFERENCES_LOCAL_P.
486 (elf_x86_64_finish_dynamic_symbol): Likewise.
487 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
489 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
490 (_bfd_x86_elf_link_symbol_references_local): New function.
491 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
492 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
493 SYMBOL_REFERENCES_LOCAL_P.
494 (elf_x86_link_hash_entry): Add local_ref.
495 (elf_x86_link_hash_table): Remove convert_load.
496 (_bfd_i386_elf_convert_load): Removed.
497 (_bfd_x86_64_elf_convert_load): Likewise.
498 (_bfd_x86_elf_link_symbol_references_local): New.
500 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
502 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
503 (elf_x86_64_info_to_howto): Get the real relocation type by
504 masking out R_X86_64_converted_reloc_bit.
505 (elf_x86_64_check_tls_transition): Get the real relocation type
506 by masking out R_X86_64_converted_reloc_bit.
507 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
508 instead of setting converted_reloc.
509 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
510 instead of converted_reloc. Get the real relocation type by
511 masking out R_X86_64_converted_reloc_bit.
512 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
513 R_X86_64_converted_reloc_bit is valid.
514 * elfxx-x86.h (converted_reloc): Removed.
516 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
518 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
519 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
520 to get the relocation type again.
521 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
522 r_type when calling elf_x86_64_tls_transition. Don't use
523 ELF32_R_TYPE to get the relocation type again.
525 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
527 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
530 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
532 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
533 argument. Don't check relocation overflow. Avoid relocation
534 overflow if --no-relax is used. Set converted_reloc on symbol
535 if a GOTPCREL relocation is converted.
536 (elf_x86_64_relocate_section): Issue a fatal error and suggest
537 --no-relax if GOTPCREL relocation conversion leads to relocation
539 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
541 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
542 Edmar Wienskoski <edmar.wienskoski@nxp.com
544 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
545 (ppc_elf_check_relocs): Handle it.
546 (ppc_elf_vle_split20): New function.
547 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
549 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
552 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
553 for x86-64 if GOT_TLS_GDESC_P is true.
555 2017-09-03 Alan Modra <amodra@gmail.com>
558 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
560 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
562 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
563 tls_get_addr for x86-64 in one place.
565 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
567 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
568 with elfxx-x86.lo for 64-bit BFD.
569 * configure: Regenerated.
571 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
573 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
574 (_bfd_i386_elf_convert_load): This. Remove static.
575 (elf_i386_size_dynamic_sections): Removed.
576 (elf_backend_size_dynamic_sections): Likewise.
577 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
578 (_bfd_x86_64_elf_convert_load): This. Remove static.
579 (elf_x86_64_size_dynamic_sections): Removed.
580 (elf_backend_size_dynamic_sections): Likewise.
581 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
582 (elf_x86_allocate_dynrelocs): This. Make it static.
583 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
584 (elf_x86_allocate_local_dynreloc): This. Make it static.
585 (elf_i386_is_reloc_section): New function.
586 (elf_x86_64_is_reloc_section): Likewise.
587 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
588 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
589 Rearrange got_entry_size initialization.
590 (_bfd_x86_elf_size_dynamic_sections): New function.
591 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
592 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
593 (_bfd_i386_elf_convert_load): New.
594 (_bfd_x86_64_elf_convert_load): Likewise.
595 (_bfd_x86_elf_size_dynamic_sections): Likewise.
596 (elf_backend_size_dynamic_sections): Likewise.
597 (_bfd_x86_elf_allocate_dynrelocs): Removed.
598 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
600 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
602 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
605 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
607 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
608 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
610 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
612 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
613 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
614 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
615 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
616 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
617 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
619 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
621 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
622 (elf_i386_allocate_local_dynrelocs): Likewise.
623 (elf_i386_size_dynamic_sections): Replace
624 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
625 with _bfd_x86_elf_allocate_dynrelocs and
626 _bfd_x86_elf_allocate_local_dynrelocs.
627 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
628 (elf_x86_64_allocate_local_dynrelocs): Likewise.
629 (elf_x86_64_size_dynamic_sections): Replace
630 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
631 with _bfd_x86_elf_allocate_dynrelocs and
632 _bfd_x86_elf_allocate_local_dynrelocs.
633 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
634 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
635 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
636 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
638 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
640 * elf32-i386.c (is_i386_elf): Removed.
641 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
642 (elf_i386_size_dynamic_sections): Likewise.
643 (elf_i386_relocate_section): Likewise.
644 * elf64-x86-64.c (is_x86_64_elf): Removed.
645 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
647 (elf_x86_64_size_dynamic_sections): Likewise.
648 (elf_x86_64_relocate_section): Likewise.
649 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
651 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
654 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
656 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
657 (elf_i386_allocate_dynrelocs): Replace
658 elf_i386_compute_jump_table_size with
659 elf_x86_compute_jump_table_size.
660 (elf_i386_size_dynamic_sections): Likewise.
661 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
662 (elf_x86_64_allocate_dynrelocs): Replace
663 elf_x86_64_compute_jump_table_size with
664 elf_x86_compute_jump_table_size.
665 (elf_x86_64_size_dynamic_sections): Likewise.
666 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
668 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
669 (elf_x86_compute_jump_table_size): New.
671 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
673 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
675 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
676 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
678 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
680 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
681 with htab->is_vxworks.
682 (elf_i386_size_dynamic_sections): Likewise.
683 (elf_i386_relocate_section): Likewise.
684 (elf_i386_finish_dynamic_symbol): Likewise.
685 (elf_i386_finish_dynamic_sections): Likewise.
687 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
689 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
690 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
691 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
692 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
693 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
694 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
695 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
696 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
698 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
701 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
702 ELF_COMMON_DEF_P for common symbols.
704 2017-09-02 Alan Modra <amodra@gmail.com>
706 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
707 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
708 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
710 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
712 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
713 (elf_backend_gc_mark_hook): Likewise.
714 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
715 (elf_backend_gc_mark_hook): Likewise.
716 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
717 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
718 (elf_backend_gc_mark_hook): Likewise.
720 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
722 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
723 (elf_backend_adjust_dynamic_symbol): Likewise.
724 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
725 (elf_backend_adjust_dynamic_symbol): Likewise.
726 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
727 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
728 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
729 (_bfd_x86_elf_adjust_dynamic_symbol): New.
730 (elf_backend_adjust_dynamic_symbol): Likewise.
732 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
734 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
737 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
739 * elf32-i386.c (elf_i386_mkobject): Removed.
740 (bfd_elf32_mkobject): Likewise.
741 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
742 (bfd_elf64_mkobject): Likewise.
743 (bfd_elf32_mkobject): Likewise.
744 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
745 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
746 (bfd_elf64_mkobject): Likewise.
747 (bfd_elf32_mkobject): Likewise.
749 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
751 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
752 Call _bfd_x86_elf_link_setup_gnu_properties.
753 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
754 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
756 (elf_x86_64_non_lazy_plt): Likewise.
757 (elf_x86_64_lazy_bnd_plt): Likewise.
758 (elf_x86_64_non_lazy_bnd_plt): Likewise.
759 (elf_x86_64_lazy_ibt_plt): Likewise.
760 (elf_x32_lazy_ibt_plt): Likewise.
761 (elf_x86_64_non_lazy_ibt_plt): Likewise.
762 (elf_x32_non_lazy_ibt_plt): Likewise.
763 (elf_x86_64_nacl_plt): Likewise.
764 (elf_x86_64_link_setup_gnu_properties): Updated. Call
765 _bfd_x86_elf_link_setup_gnu_properties.
766 * elfxx-x86.c: Include elf-vxworks.h".
767 (_bfd_x86_elf_link_setup_gnu_properties): New function.
768 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
769 comments for pic_plt0_entry and pic_plt_entry.
770 (elf_x86_non_lazy_plt_layout): Likewise.
771 (elf_x86_plt_layout_table): New.
772 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
774 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
777 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
778 .eh_frame section for the second PLT.
779 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
780 alignment of .eh_frame section for the second PLT.
782 2017-09-01 Nick Clifton <nickc@redhat.com>
785 * dwarf2.c (decode_line_info): Fix test for an overlong line info
788 2017-09-01 Nick Clifton <nickc@redhat.com>
791 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
792 attribute buffer is NUL terminated.
794 2017-08-31 Nick Clifton <nickc@redhat.com>
797 * dwarf2.c (read_section): If necessary add a terminating NUL byte
798 to dwarf string sections.
800 2017-08-31 Alan Modra <amodra@gmail.com>
802 * po/SRC-POTFILES.in: Regenerate.
804 2017-08-31 Alan Modra <amodra@gmail.com>
806 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
807 for a section containing just a terminator. Allow multiple
808 terminators at end of section.
809 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
810 sections when not adding alignment. Assert on terminator in
813 2017-08-31 Alan Modra <amodra@gmail.com>
817 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
820 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
822 * configure.ac (bfd_backends): Add elf64.lo together with
823 elfxx-x86.lo for 64-bit BFD.
824 * configure: Regenerated.
826 2017-08-31 James Bowman <james.bowman@ftdichip.com>
828 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
831 2017-08-31 Alan Modra <amodra@gmail.com>
834 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
835 before _close_and_cleanup. Call iovec->bclose after.
836 (bfd_close): Remove code common to, and call, bfd_close_all_done.
838 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
840 * elf32-i386.c (elf_i386_plt_type): Removed.
841 (elf_i386_plt): Likewise.
842 (elf_i386_get_synthetic_symtab): Updated. Call
843 _bfd_x86_elf_get_synthetic_symtab.
844 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
845 (elf_x86_64_plt): Likewise.
846 (elf_x86_64_get_synthetic_symtab): Updated. Call
847 _bfd_x86_elf_get_synthetic_symtab.
848 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
849 (elf_x86_64_get_plt_got_vma): Likewise.
850 (elf_i386_valid_plt_reloc_p): Likewise.
851 (elf_x86_64_valid_plt_reloc_p): Likewise.
852 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
853 * elfxx-x86.h (elf_x86_plt_type): New.
854 (elf_x86_plt): Likewise.
855 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
857 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
859 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
860 target_id instead of elf_machine_code.
862 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
864 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
865 (elf_i386_lazy_plt_layout): Likewise.
866 (elf_i386_non_lazy_plt_layout): Likewise.
867 (elf_i386_plt_layout): Likewise.
868 (elf_i386_link_hash_table): Likewise.
869 (elf_i386_next_tls_desc_index): Likewise.
870 (elf_i386_srelplt2): Likewise.
871 (elf_i386_plt): Likewise.
872 (elf_i386_lazy_plt): Likewise.
873 (elf_i386_non_lazy_plt): Likewise.
874 (elf_i386_link_hash_table_create): Likewise.
875 (bfd_elf32_bfd_link_hash_table_create): Likewise.
876 (elf_i386_lazy_plt): Updated.
877 (elf_i386_non_lazy_plt): Likewise.
878 (elf_i386_lazy_ibt_plt): Likewise.
879 (elf_i386_non_lazy_ibt_plt): Likewise.
880 (elf_i386_allocate_dynrelocs): Likewise.
881 (elf_i386_size_dynamic_sections): Likewise.
882 (elf_i386_relocate_section): Likewise.
883 (elf_i386_finish_dynamic_symbol): Likewise.
884 (elf_i386_finish_dynamic_sections): Likewise.
885 (elf_i386_get_synthetic_symtab): Likewise.
886 (elf_i386_link_setup_gnu_properties): Likewise.
887 (elf_i386_nacl_plt): Likewise.
888 * elf64-x86-64.c (ABI_64_P): Removed.
889 (ELF64_DYNAMIC_INTERPRETER): Likewise.
890 (ELF32_DYNAMIC_INTERPRETER): Likewise.
891 (elf_x86_64_lazy_plt_layout): Likewise.
892 (elf_x86_64_non_lazy_plt_layout): Likewise.
893 (elf_x86_64_plt_layout): Likewise.
894 (elf_x86_64_link_hash_table): Likewise.
895 (elf_x86_64_plt): Likewise.
896 (elf_x86_64_lazy_plt): Likewise.
897 (elf_x86_64_non_lazy_plt): Likewise.
898 (elf_x86_64_link_hash_table_create): Likewise.
899 (bfd_elf64_bfd_link_hash_table_create): Likewise.
900 (bfd_elf32_bfd_link_hash_table_create): Likewise.
901 (elf_x86_64_lazy_plt): Updated.
902 (elf_x86_64_non_lazy_plt): Likewise.
903 (elf_x86_64_lazy_bnd_plt): Likewise.
904 (elf_x86_64_non_lazy_bnd_plt): Likewise.
905 (elf_x86_64_lazy_ibt_plt): Likewise.
906 (elf_x32_lazy_ibt_plt): Likewise.
907 (elf_x86_64_non_lazy_ibt_plt): Likewise.
908 (elf_x32_non_lazy_ibt_plt): Likewise.
909 (elf_x86_64_allocate_dynrelocs): Likewise.
910 (elf_x86_64_size_dynamic_sections): Likewise.
911 (elf_x86_64_relocate_section): Likewise.
912 (elf_x86_64_finish_dynamic_symbol): Likewise.
913 (elf_x86_64_finish_dynamic_sections): Likewise.
914 (elf_x86_64_get_synthetic_symtab): Likewise.
915 (elf_x86_64_link_setup_gnu_properties): Likewise.
916 (elf_x86_64_nacl_plt): Likewise.
917 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
919 (ELF32_DYNAMIC_INTERPRETER): New.
920 (ELF64_DYNAMIC_INTERPRETER): Likewise.
921 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
922 (_bfd_x86_elf_link_hash_table_create): Likewise.
923 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
924 (elf_x86_link_hash_table_free): This. Make it static.
925 * elfxx-x86.h: Don't include "objalloc.h".
927 (elf_x86_lazy_plt_layout): Likewise.
928 (elf_x86_non_lazy_plt_layout): Likewise.
929 (elf_x86_plt_layout): Likewise.
930 (_bfd_x86_elf_link_hash_table_create): Likewise.
931 (bfd_elf64_bfd_link_hash_table_create): Likewise.
932 (bfd_elf32_bfd_link_hash_table_create): Likewise.
933 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
934 srelplt2 and next_tls_desc_index.
935 (_bfd_x86_elf_link_hash_table_free): Removed.
937 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
939 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
940 branch offset interpretation.
942 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
945 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
947 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
949 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
950 (elf_x86_64_srelplt2): Likewise.
952 2017-08-30 Alan Modra <amodra@gmail.com>
954 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
955 (ppc64_elf_tls_optimize): Set it.
956 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
957 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
958 addis would add zero.
959 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
960 (ppc_elf_tls_optimize): Set it.
961 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
962 insn on TPREL16_LO relocs to use r2 when addis would add zero.
964 2017-08-30 Alan Modra <amodra@gmail.com>
966 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
967 __tls_get_addr call sequences to LE, don't move the addi down
968 to the nop. Replace the bl with addi and leave the nop alone.
970 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
972 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
974 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
976 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
978 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
980 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
981 (BFD64_BACKENDS): Likewise.
982 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
983 (BFD64_BACKENDS_CFILES): Likewise.
984 * Makefile.in: Regenerated.
985 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
986 elf32-i386.lo and elf64-x86-64.lo.
987 * configure: Regenerated.
988 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
989 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
990 "objalloc.h" and "hashtab.h".
991 (ELIMINATE_COPY_RELOCS): Removed.
992 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
993 (SYMBOL_NO_COPYRELOC): Likewise.
994 (elf_i386_link_hash_entry): Likewise.
995 (GOT_UNKNOWN): Likewise.
996 (GOT_NORMAL): Likewise.
997 (GOT_TLS_GD): Likewise.
998 (elf_i386_hash_entry): Likewise.
999 (elf_i386_obj_tdata): Likewise.
1000 (elf_i386_tdata): Likewise.
1001 (elf_i386_local_got_tls_type): Likewise.
1002 (elf_i386_local_tlsdesc_gotent): Likewise.
1003 (elf_i386_hash_table): Likewise.
1004 (elf_i386_link_hash_newfunc): Likewise.
1005 (elf_i386_local_htab_hash): Likewise.
1006 (elf_i386_local_htab_eq): Likewise.
1007 (elf_i386_get_local_sym_hash): Likewise.
1008 (elf_i386_link_hash_table_free): Likewise.
1009 (elf_i386_copy_indirect_symbol): Likewise.
1010 (elf_i386_fixup_symbol): Likewise.
1011 (elf_i386_readonly_dynrelocs): Likewise.
1012 (elf_i386_always_size_sections): Likewise.
1013 (elf_i386_set_tls_module_base): Likewise.
1014 (elf_i386_dtpoff_base): Likewise.
1015 (compare_relocs): Likewise.
1016 (elf_i386_hash_symbol): Likewise.
1017 (elf_i386_parse_gnu_properties): Likewise.
1018 (elf_i386_merge_gnu_properties): Likewise.
1019 (elf_i386_link_check_relocs): Likewise.
1020 (elf_i386_merge_symbol_attribute): Likewise.
1021 (bfd_elf32_bfd_link_check_relocs): Likewise.
1022 (elf_backend_copy_indirect_symbol): Likewise.
1023 (elf_backend_always_size_sections): Likewise.
1024 (elf_backend_omit_section_dynsym): Likewise.
1025 (elf_backend_hash_symbol): Likewise.
1026 (elf_backend_fixup_symbol): Likewise.
1027 (elf_backend_parse_gnu_properties): Likewise.
1028 (elf_backend_merge_gnu_properties): Likewise.
1029 (elf_backend_merge_symbol_attribute): Likewise.
1030 (elf_i386_mkobject): Updated.
1031 (elf_i386_link_hash_table_create): Likewise.
1032 (elf_i386_check_tls_transition): Likewise.
1033 (elf_i386_tls_transition): Likewise.
1034 (elf_i386_convert_load_reloc): Likewise.
1035 (elf_i386_check_relocs): Likewise.
1036 (elf_i386_adjust_dynamic_symbol): Likewise.
1037 (elf_i386_allocate_dynrelocs): Likewise.
1038 (elf_i386_convert_load): Likewise.
1039 (elf_i386_size_dynamic_sections): Likewise.
1040 (elf_i386_relocate_section): Likewise.
1041 (elf_i386_finish_dynamic_symbol ): Likewise.
1042 (elf_i386_finish_dynamic_sections): Likewise.
1043 (elf_i386_output_arch_local_syms): Likewise.
1044 (elf_i386_get_synthetic_symtab): Likewise.
1045 (elf_i386_link_setup_gnu_properties): Likewise.
1046 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1047 of elf_link_hash_table, as base.
1048 (elf_i386_next_tls_desc_index): New.
1049 (elf_i386_srelplt2): Likewise.
1050 (elf_i386_plt): Likewise.
1051 (elf_i386_lazy_plt): Likewise.
1052 (elf_i386_non_lazy_plt): Likewise.
1053 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1054 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1055 "objalloc.h" and "hashtab.h".
1056 (ELIMINATE_COPY_RELOCS): Removed.
1057 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1058 (SYMBOL_NO_COPYRELOC): Likewise.
1059 (elf_x86_64_link_hash_entry): Likewise.
1060 (GOT_UNKNOWN): Likewise.
1061 (GOT_NORMAL): Likewise.
1062 (GOT_TLS_GD): Likewise.
1063 (elf_x86_64_hash_entry): Likewise.
1064 (elf_x86_64_obj_tdata): Likewise.
1065 (elf_x86_64_tdata): Likewise.
1066 (elf_x86_64_local_got_tls_type): Likewise.
1067 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1068 (elf_x86_64_hash_table): Likewise.
1069 (elf_x86_64_link_hash_newfunc): Likewise.
1070 (elf_x86_64_local_htab_hash): Likewise.
1071 (elf_x86_64_local_htab_eq): Likewise.
1072 (elf_x86_64_get_local_sym_hash): Likewise.
1073 (elf_x86_64_link_hash_table_free): Likewise.
1074 (elf_x86_64_copy_indirect_symbol): Likewise.
1075 (elf_x86_64_fixup_symbol): Likewise.
1076 (elf_x86_64_readonly_dynrelocs): Likewise.
1077 (elf_x86_64_always_size_sections): Likewise.
1078 (elf_x86_64_set_tls_module_base): Likewise.
1079 (elf_x86_64_dtpoff_base): Likewise.
1080 (compare_relocs): Likewise.
1081 (elf_x86_64_merge_symbol_attribute): Likewise.
1082 (elf_x86_64_hash_symbol): Likewise.
1083 (elf_x86_64_parse_gnu_properties): Likewise.
1084 (elf_x86_64_merge_gnu_properties): Likewise.
1085 (elf_x86_64_link_check_relocs): Likewise.
1086 (elf_backend_copy_indirect_symbol): Likewise.
1087 (elf_backend_always_size_sections): Likewise.
1088 (bfd_elf64_bfd_link_check_relocs): Likewise.
1089 (elf_backend_merge_symbol_attribute): Likewise.
1090 (elf_backend_hash_symbol): Likewise.
1091 (elf_backend_omit_section_dynsym): Likewise.
1092 (elf_backend_fixup_symbol): Likewise.
1093 (elf_backend_parse_gnu_properties): Likewise.
1094 (elf_backend_merge_gnu_properties): Likewise.
1095 (bfd_elf32_bfd_link_check_relocs): Likewise.
1096 (elf_x86_64_mkobject): Updated.
1097 (elf_x86_64_link_hash_table_create): Likewise.
1098 (elf_x86_64_check_tls_transition): Likewise.
1099 (elf_x86_64_tls_transition): Likewise.
1100 (elf_x86_64_convert_load_reloc): Likewise.
1101 (elf_x86_64_check_relocs): Likewise.
1102 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1103 (elf_x86_64_allocate_dynrelocs): Likewise.
1104 (elf_x86_64_convert_load): Likewise.
1105 (elf_x86_64_size_dynamic_sections): Likewise.
1106 (elf_x86_64_relocate_section): Likewise.
1107 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1108 (elf_x86_64_finish_dynamic_sections): Likewise.
1109 (elf_x86_64_output_arch_local_syms): Likewise.
1110 (elf_x86_64_get_synthetic_symtab): Likewise.
1111 (elf_x86_64_link_setup_gnu_properties): Likewise.
1112 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1113 instead of elf_link_hash_table, as base.
1114 (elf_x86_64_next_tls_desc_index): New.
1115 (elf_x86_64_srelplt2): Likewise.
1116 (elf_x86_64_plt): Likewise.
1117 (elf_x86_64_lazy_plt): Likewise.
1118 (elf_x86_64_non_lazy_plt): Likewise.
1119 * elfxx-x86.c: New file.
1120 * elfxx-x86.h: Likewise.
1122 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1124 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1126 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1128 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1130 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1131 sections before checking dynamic relocations and free invalid
1132 PLT section contents.
1133 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1135 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1137 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1138 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1140 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1143 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1145 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1147 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1149 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1151 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1153 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1156 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1157 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1158 Add a has_no_copy_on_protected bitfield.
1159 (elf_has_no_copy_on_protected): New.
1160 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1161 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1162 (elf_merge_gnu_property_list): Likewise.
1163 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1164 to FALSE for elf_has_no_copy_on_protected.
1165 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1166 (elf_i386_link_hash_entry): Add def_protected.
1167 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1168 when checking info->nocopyreloc.
1169 (elf_i386_link_setup_gnu_properties): Don't set
1170 extern_protected_data here.
1171 (elf_i386_merge_symbol_attribute): New function.
1172 (elf_backend_merge_symbol_attribute): New.
1173 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1174 (elf_x86_64_link_hash_entry): Add def_protected.
1175 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1176 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1177 when checking info->nocopyreloc.
1178 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1179 relocation run-time overflow and unresolvable R_X86_64_32S
1180 relocation against protected data symbol defined in shared object
1181 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1182 (elf_x86_64_link_setup_gnu_properties): Don't set
1183 extern_protected_data here.
1184 (elf_x86_64_merge_symbol_attribute): New function.
1185 (elf_backend_merge_symbol_attribute): New.
1187 2017-08-26 Alan Modra <amodra@gmail.com>
1189 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1190 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1191 (ppc_elf_relocate_section): Comment fix.
1192 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1193 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1194 Support dynamic relocs for TPREL16 when non-pic too.
1195 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1196 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1199 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1201 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1202 "symbol" in comments.
1203 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1205 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1208 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1209 R_X86_64_PC32 relocation run-time overflow and unresolvable
1210 R_X86_64_32S relocation with -z nocopyreloc.
1212 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1214 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1215 Undefined symbols may not have a type.
1216 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1218 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1220 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1221 bfd_link_info. Report shared, PIE or PDE object based on
1223 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1224 (elf_x86_64_relocate_section): Likewise.
1226 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1228 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1229 for function symbols.
1230 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1232 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1234 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1235 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1236 is set on any input relocatable file.
1237 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1239 2017-08-23 Alan Modra <amodra@gmail.com>
1242 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1243 ensure_undefweak_dynamic. Handle undefined too.
1244 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1245 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1246 (allocate_dynrelocs): Discard undefined non-default visibility
1247 relocs first. Make undefined syms dynamic. Tidy goto.
1249 2017-08-21 Alan Modra <amodra@gmail.com>
1250 H.J. Lu <hongjiu.lu@intel.com>
1253 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1254 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1256 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1259 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1260 undefined weak symbols.
1262 2017-08-18 Nick Clifton <nickc@redhat.com>
1265 * tekhex.c (getsym): Fix check for source pointer walking off the
1266 end of the input buffer.
1268 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1271 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1272 relocations in debug sections, change abort to _bfd_error_handler.
1274 2017-08-14 Nick Clifton <nickc@redhat.com>
1277 * elf.c (setup_group): Check for an empty or very small group
1279 * po/bfd.pot: Regenerate.
1281 2017-08-14 Alan Modra <amodra@gmail.com>
1284 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1285 alignment padding here.
1286 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1287 in a reverse pass over sections.
1289 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1292 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1293 for @plt suffixes first.
1294 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1296 2017-08-08 Nick Clifton <nickc@redhat.com>
1299 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1300 small section lengths.
1301 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1303 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1304 there is enough data present in the note.
1306 2017-08-08 Alan Modra <amodra@gmail.com>
1309 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1310 got.refcount for GOTOFF relocs, just create .got section.
1312 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1314 * elflink.c (elf_link_add_object_symbols): Move common symbol
1315 check after bed->common_definition.
1317 2017-08-07 Alan Modra <amodra@gmail.com>
1320 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1321 needed to define various dynamic tags have been discarded.
1323 2017-08-07 Nick Clifton <nickc@redhat.com>
1326 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1327 has not been set then use the bfd returned by
1328 _bfd_elf_link_setup_gnu_properties. If that is null then search
1329 through all the input bfds selecting the first normal, ELF format
1331 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1333 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1335 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1337 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1338 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1339 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1340 (elf_i386_link_check_relocs): New function.
1341 (bfd_elf32_bfd_link_check_relocs): New.
1342 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1344 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1345 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1346 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1347 (elf_x86_64_link_check_relocs): New function.
1348 (bfd_elf64_bfd_link_check_relocs): New.
1349 (bfd_elf32_bfd_link_check_relocs): Likewise.
1351 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1354 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1355 as undefined for --no-define-common.
1357 2017-08-05 Alan Modra <amodra@gmail.com>
1359 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1360 hppa_link_hash_table.
1362 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1364 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1365 entries for sysregs with negative indices.
1367 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1369 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1370 isn't the S/390 specific elf data.
1371 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1373 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1375 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1376 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1377 [R_RISCV_ADD16]: Likewise.
1378 [R_RISCV_ADD32]: Likewise.
1379 [R_RISCV_ADD64]: Likewise.
1380 [R_RISCV_SUB6]: Likewise.
1381 [R_RISCV_SUB8]: Likewise.
1382 [R_RISCV_SUB16]: Likewise.
1383 [R_RISCV_SUB32]: Likewise.
1384 [R_RISCV_SUB64]: Likewise.
1386 2017-07-31 Alan Modra <amodra@gmail.com>
1388 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1389 without ld.so checks.
1391 2017-07-29 Alan Modra <amodra@gmail.com>
1394 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1395 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1396 (is_elfv2_localentry0): Test non_zero_localentry.
1397 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1399 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1401 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1402 pointer check for htab->elf.irelplt.
1403 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1405 2017-07-27 Nick Clifton <nickc@redhat.com>
1408 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1410 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1412 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1414 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1416 (evax_bfd_print_emh): Check for invalid string lengths.
1418 2017-07-25 Nick Clifton <nickc@redhat.com>
1420 * po/fr.po: Updated French translation.
1422 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1425 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1426 16-bit absolute branches into 10-bit pc-relative branches on the
1427 MSP430 as well as the MSP430X.
1429 2017-07-25 Alan Modra <amodra@gmail.com>
1431 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1432 (stub_eh_frame_size): New function.
1433 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1434 (group_sections): Init group tls_get_addr_opt_bctrl.
1435 (ppc64_elf_size_stubs): Update sizing and initialization of
1436 .eh_frame. Iteration over stubs via group list.
1437 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1438 (ppc64_elf_finish_dynamic_sections): Update finalization of
1441 2017-07-24 Nick Clifton <nickc@redhat.com>
1444 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1445 of the relocs to the canonicalize_one_reloc routine.
1446 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1447 for the _bfd_mach_o_canonicalize_one_reloc field.
1448 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1449 res_base parameter. Use to check for corrupt pair relocs.
1450 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1452 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1454 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1457 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1458 enough data in the record before attempting to parse it.
1459 (_bfd_vms_slurp_eeom): Likewise.
1461 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1462 (image_set_ptr): Likewise.
1463 (alpha_vms_slurp_relocs): Likewise.
1465 (alpha_vms_object_p): Check for a truncated record.
1467 2017-07-24 Nick Clifton <nickc@redhat.com>
1470 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1471 an unrecognized reloc and sets the bfd_error value.
1472 * libbfd.h: Regenerate.
1473 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1475 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1476 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1477 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1478 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1479 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1481 2017-07-23 Alan Modra <amodra@gmail.com>
1483 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1486 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1489 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1490 reloc_class_ifunc for ifunc symbols.
1492 2017-07-19 Nick Clifton <nickc@redhat.com>
1495 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1496 correct magic bytes at the start, set the error to wrong format
1497 and clear the format selector before returning NULL.
1499 2017-07-19 Nick Clifton <nickc@redhat.com>
1502 * coff-rs6000.c (_bfd_strntol): New function.
1503 (_bfd_strntoll): New function.
1504 (GET_VALUE_IN_FIELD): New macro.
1505 (EQ_VALUE_IN_FIELD): new macro.
1506 (_bfd_xcoff_slurp_armap): Use new macros.
1507 (_bfd_xcoff_archive_p): Likewise.
1508 (_bfd_xcoff_read_ar_hdr): Likewise.
1509 (_bfd_xcoff_openr_next_archived_file): Likewise.
1510 (_bfd_xcoff_stat_arch_elt): Likewise.
1511 * coff64-rs6000.c (_bfd_strntol): New function.
1512 (_bfd_strntoll): New function.
1513 (GET_VALUE_IN_FIELD): New macro.
1514 (xcoff64_slurp_armap): Use new macros.
1516 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1517 John Eric Martin <John.Martin@emmicro-us.com>
1519 * bfd-in2.h: Regenerate.
1520 * libbfd.h: Regenerate.
1521 * elf32-arc.c (JLI): Define.
1522 * reloc.c: Add JLI relocations.
1524 2017-07-18 Nick Clifton <nickc@redhat.com>
1527 * coff-sh.c: Fix spelling typos.
1528 * compress.c: Likewise.
1529 * cpu-pdp11.c: Likewise.
1530 * ecofflink.c: Likewise.
1531 * elf-m10300.c: Likewise.
1533 * elf32-arm.c: Likewise.
1534 * elf32-m68k.c: Likewise.
1535 * elf32-nds32.c: Likewise.
1536 * elf32-ppc.c: Likewise.
1537 * elf32-sh.c: Likewise.
1538 * elf32-v850.c: Likewise.
1539 * elf64-ppc.c: Likewise.
1540 * elf64-x86-64.c: Likewise.
1541 * elflink.c: Likewise.
1542 * elfnn-aarch64.c: Likewise.
1543 * elfxx-mips.c: Likewise.
1545 * sunos.c: Likewise.
1546 * vms-alpha.c: Likewise.
1547 * xcofflink.c: Likewise.
1549 2017-07-18 Nick Clifton <nickc@redhat.com>
1552 * coffcode.h (handle_COMDAT): Replace abort with an error message
1555 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1558 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1561 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1563 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1565 2017-07-16 Alan Modra <amodra@gmail.com>
1567 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1568 __tls_index GOT entries when using __tls_get_addr_opt stub.
1569 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1571 2017-07-12 Alan Modra <amodra@gmail.com>
1573 * po/es.po: Update from translationproject.org/latest/bfd/.
1574 * po/fi.po: Likewise.
1575 * po/fr.po: Likewise.
1576 * po/id.po: Likewise.
1577 * po/ja.po: Likewise.
1578 * po/ro.po: Likewise.
1579 * po/ru.po: Likewise.
1580 * po/sr.po: Likewise.
1581 * po/sv.po: Likewise.
1582 * po/tr.po: Likewise.
1583 * po/uk.po: Likewise.
1584 * po/vi.po: Likewise.
1585 * po/zh_CN.po: Likewise.
1586 * po/hr.po: New file from translationproject.org.
1587 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1588 * configure: Regenerate.
1590 2017-07-12 Nick Clifton <nickc@redhat.com>
1592 Fix compile time warnings using gcc 7.1.1.
1593 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1595 (elf_xtensa_get_gotplt_section): Increase length of got_name
1597 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1598 default return of FALSE.
1599 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1600 default return of FALSE.
1602 2017-07-12 Alan Modra <amodra@gmail.com>
1604 * binary.c (binary_set_section_contents): Don't print filepos in
1606 (coff_write_object_contents): Cast size_t for error message.
1607 (coff_slurp_line_table): Don't use bfd_vma symndx.
1608 (coff_slurp_reloc_table): Remove unneeded cast.
1609 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1611 (find_abstract_instance_name): Likewise.
1612 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1613 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1614 (elf32_arm_check_relocs): Make r_symndx an int.
1615 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1617 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1619 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1621 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1622 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1623 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1624 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1625 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1626 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1627 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1628 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1629 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1630 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1631 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1632 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1633 and use %lu for error message.
1634 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1635 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1638 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1640 (elf32_arm_final_link_relocate): Likewise.
1641 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1642 * coffcode.h (styp_to_sec_flags): Likewise.
1643 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1644 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1645 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1646 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1647 (elf32_bfin_merge_private_bfd_data): Likewise.
1648 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1649 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1650 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1651 (i370_elf_relocate_section): Likewise.
1652 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1653 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1654 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1655 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1656 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1657 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1658 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1659 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1660 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1661 * ieee.c (ieee_write_id, read_id): Likewise.
1662 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1663 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1664 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1665 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1666 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1667 * stabs.c (_bfd_link_section_stabs): Likewise.
1669 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1671 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1672 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1673 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1674 * coff-sh.c (sh_relax_section): Likewise.
1675 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1676 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1677 * coffcode.h (coff_slurp_reloc_table): Likewise.
1678 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1679 (_bfd_coff_read_string_table): Likewise.
1680 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1681 * compress.c (bfd_get_full_section_contents): Likewise.
1682 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1683 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1684 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1685 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1686 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1687 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1688 (elf32_arm_write_section): Likewise.
1689 * elf32-bfin.c (bfin_relocate_section): Likewise.
1690 (bfinfdpic_relocate_section): Likewise.
1691 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1692 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1693 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1694 (elf_i386_relocate_section): Likewise.
1695 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1696 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1697 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1698 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1699 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1700 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1701 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1702 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1703 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1704 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1705 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1706 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1707 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1708 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1709 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1710 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1711 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1712 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1713 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1714 * elf32-sh.c (sh_elf_relax_section): Likewise.
1715 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1716 (sh_elf_relocate_section): Likewise.
1717 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1718 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1719 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1720 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1721 * elf32-v850.c (v850_elf_relax_section): Likewise.
1722 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1723 (elf_vax_relocate_section): Likewise.
1724 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1725 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1726 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1727 (do_fix_for_relocatable_link): Likewise.
1728 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1729 (elf64_alpha_relax_with_lituse): Likewise.
1730 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1731 (elf_hppa_final_link_relocate): Likewise.
1732 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1733 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1734 (elf64_vms_link_add_object_symbols): Likewise.
1735 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1736 (mmix_final_link_relocate): Likewise.
1737 * elf64-s390.c (invalid_tls_insn): Likewise.
1738 (elf_s390_relocate_section): Likewise.
1739 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1740 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1741 (elf_x86_64_relocate_section): Likewise.
1742 * elfcode.h (elf_slurp_symbol_table): Likewise.
1743 * elfcore.h (elf_core_file_p): Likewise.
1744 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1745 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1746 (elfNN_aarch64_relocate_section): Likewise.
1747 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1748 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1749 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1750 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1751 (_bfd_mips_elf_relocate_section): Likewise.
1752 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1753 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1754 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1755 * ieee.c (ieee_slurp_external_symbols): Likewise.
1756 * ihex.c (ihex_write_object_content): Likewise.
1757 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1758 * merge.c (_bfd_merged_section_offset): Likewise.
1759 * mmo.c (mmo_write_loc_chunk): Likewise.
1760 (mmo_write_object_contents): Likewise.
1761 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1762 * stabs.c (_bfd_link_section_stabs): Likewise.
1763 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1765 2017-07-11 Alan Modra <amodra@gmail.com>
1767 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1769 2017-07-11 Alan Modra <amodra@gmail.com>
1771 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1772 instruction" error using _bfd_error_handler, not einfo.
1774 2017-07-10 Nick Clifton <nickc@redhat.com>
1776 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1777 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1779 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1781 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1783 2017-07-07 Alan Modra <amodra@gmail.com>
1785 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1787 2017-07-07 Alan Modra <amodra@gmail.com>
1789 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1790 as long long. Move code replacing "ll" with "I64", and simplify.
1792 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1794 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1797 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1799 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1801 (line_info_add_file_name): Likewise.
1802 (decode_line_info): Likewise.
1804 2017-07-04 Tristan Gingold <gingold@adacore.com>
1806 * version.m4: Bump version to 2.29.51
1807 * configure: Regenerate.
1809 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1811 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1812 sanity check at the head of this function.
1814 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1816 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1817 dwarf_line_str_size.
1818 (struct attr_abbrev): Add field implicit_const.
1819 (dwarf_debug_sections): Add .debug_line_str.
1820 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1821 (dwarf_debug_section_assert): Add static assertion.
1822 (read_indirect_line_string): New.
1823 (read_abbrevs): Support DW_FORM_implicit_const.
1824 (is_str_attr): Support DW_FORM_line_strp.
1825 (read_attribute_value): Support DW_FORM_line_strp and
1826 DW_FORM_implicit_const.
1827 (read_attribute): Support DW_FORM_implicit_const.
1828 (line_info_add_include_dir, line_info_add_include_dir_stub):
1829 (line_info_add_file_name, read_formatted_entries): New.
1830 (decode_line_info, parse_comp_unit): Support DWARF 5.
1831 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1833 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1835 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1836 abort statement that was put for symbols that are not dynamic.
1838 2017-07-03 Tristan Gingold <gingold@adacore.com>
1840 * po/bfd.pot: Regenerate
1842 2017-07-03 Alan Modra <amodra@gmail.com>
1844 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1845 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1846 * elf.c (setup_group): Use "Lx" to print sh_size.
1847 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1848 unknown section type in hex.
1849 (copy_special_section_fields): Style fix.
1850 (bfd_section_from_shdr): Correct format for sh_link. Use a
1851 common error message for all the variants of unrecognized
1853 (assign_file_positions_for_load_sections): Use "Lx" for lma
1854 adjust error message.
1855 (assign_file_positions_for_non_load_sections): Formatting.
1856 (rewrite_elf_program_header): Formatting. Use "Lx" for
1857 bfd_vma values in error messages.
1858 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1859 ELF_R_SYM value to type expected by format.
1860 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1862 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1863 (elf_link_input_bfd): Use "Lx" for r_info.
1864 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1866 2017-07-03 Alan Modra <amodra@gmail.com>
1868 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1869 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1870 Microsoft C library variant of long long format specifier.
1871 (PRINT20): Cast value to bfd_uint64_t not long long.
1872 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1873 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1874 long long. Don't cast to bfd_vma.
1875 * elf32-score.c (score3_bfd_getl48): Likewise.
1876 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1878 2017-07-03 Alan Modra <amodra@gmail.com>
1880 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1882 (bfd_elf_print_symbol): Don't cast symbol->flags.
1883 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1884 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1885 _bfd_error_handler argument order.
1886 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1888 2017-07-03 Alan Modra <amodra@gmail.com>
1890 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1891 AC_TYPE_LONG_DOUBLE.
1892 * configure: Regenerate.
1893 * config.in: Regenerate.
1895 2017-06-29 Andrew Waterman <andrew@sifive.com>
1897 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1900 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1902 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1903 unless it is undefined weak.
1904 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1905 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1907 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1908 is not dynamic in PIC, abort.
1910 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1913 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1914 undefined weak symbols into dynamic.
1915 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1916 relocation for non-dynamic symbols.
1917 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1919 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1921 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1922 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1923 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1924 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1925 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1928 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1930 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1931 (elfcore_write_s390_gs_bc): Likewise.
1932 * elf.c (elfcore_grok_s390_gs_cb): New function.
1933 (elfcore_grok_s390_gs_bc): New function.
1934 (elfcore_grok_note): Call them.
1935 (elfcore_write_s390_gs_cb): New function.
1936 (elfcore_write_s390_gs_bc): New function.
1937 (elfcore_write_register_note): Call them.
1939 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1941 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1942 bfd_get_file_size. Check archive element size.
1943 (_bfd_generic_get_section_contents_in_window): Likewise.
1945 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1947 * bfd-in2.h: Regenerated.
1948 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1949 (bfd_get_file_size): Likewise.
1951 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1952 Matthew Fortune <matthew.fortune@imgtec.com>
1954 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1955 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1956 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1957 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1959 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1960 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1961 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1962 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1963 `bfd_mach_mips_interaptiv_mr2' entries.
1964 * bfd-in2.h: Regenerate.
1966 2017-06-27 Nick Clifton <nickc@redhat.com>
1968 * tekhex.c (pass_over): Revert accidental conversion of a local
1969 array to a static array.
1971 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1974 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1975 reloc addend if necessary. Adjust diff only if
1976 shrinked_insn_address < end_address.
1978 2017-06-27 Alan Modra <amodra@gmail.com>
1981 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1982 (_bfd_generic_get_section_contents_in_window): Likewise.
1984 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1986 * elfnn-riscv.c (perform_relocation): Support the new
1987 R_RISCV_32_PCREL relocation.
1988 (riscv_elf_relocate_section): Likewise.
1989 * elfxx-riscv.c (howto_table): Likewise.
1990 (riscv_reloc_map): Likewise.
1991 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1992 * libbfd.h: Regenerate.
1994 2017-06-27 Alan Modra <amodra@gmail.com>
1997 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1998 Use unsigned file pointer type, and remove cast.
1999 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2000 Add "count", not "sz".
2002 2017-06-26 Pedro Alves <palves@redhat.com>
2005 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2008 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2011 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2014 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2016 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2017 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2018 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2019 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2020 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2022 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2025 * compress.c (bfd_get_full_section_contents): Don't check the
2027 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2028 reject a section whose size + offset is greater than the size
2030 (_bfd_generic_get_section_contents_in_window): Likewise.
2032 2017-06-26 Nick Clifton <nickc@redhat.com>
2035 * tekhex.c (getvalue): Check for the source pointer exceeding the
2036 end pointer before the first byte is read.
2038 2017-06-26 Nick Clifton <nickc@redhat.com>
2041 * opncls.c (get_build_id): Check that the section is big enough
2042 to contain the whole note.
2043 * compress.c (bfd_get_full_section_contents): Check for and reject
2044 a section whose size is greater than the size of the entire file.
2045 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2046 contain a notes section.
2048 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2050 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2052 (elf_s390_modify_segment_map): Likewise.
2053 (bfd_elf_s390_set_options): Lisewise.
2055 2017-06-26 Alan Modra <amodra@gmail.com>
2057 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2059 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2060 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2061 .preinit_array on --just-syms bfds.
2062 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2063 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2064 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2066 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2068 * elf.c (find_link): Bounds check "hint".
2070 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2072 * elf32-arm.c (using_thumb_only): Update list of architectures in
2073 BFD_ASSERT for which the logic is valid.
2074 (using_thumb2_bl): Likewise.
2075 (using_thumb2): Likewise and return true for ARMv8-R.
2076 (arch_has_arm_nop): Likewise.
2077 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2078 merging logic. Update commentis for value 15 of v8m_baseline,
2079 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2080 merging of value 15 of Tag_CPU_arch.
2082 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2084 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2085 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2086 * bfd-in2.h: Regenerate.
2088 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2090 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2091 the error_alignment label forward. Properly align program
2092 property note section.
2094 2017-06-22 Eric Christopher <echristo@gmail.com>
2096 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2097 abs to fix a truncation warning.
2099 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2101 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2102 local undefined weak symbol to 0.
2103 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2105 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2107 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2108 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2109 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2110 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2111 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2112 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2113 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2114 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2116 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2118 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2119 (elf_i386_lazy_ibt_plt_entry): Likewise.
2120 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2121 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2122 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2123 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2124 (elf_i386_lazy_plt_layout): Likewise.
2125 (elf_i386_non_lazy_plt_layout): Likewise.
2126 (elf_i386_link_hash_entry): Add plt_second.
2127 (elf_i386_link_hash_table): Add plt_second and
2128 plt_second_eh_frame.
2129 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2130 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2131 the second PLT. Check the second PLT.
2132 (elf_i386_relocate_section): Use the second PLT to resolve
2133 PLT reference if needed.
2134 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2136 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2137 second PLT. Generate unwind info for the second PLT.
2138 (elf_i386_plt_type): Add plt_second.
2139 (elf_i386_get_synthetic_symtab): Support the second PLT.
2140 (elf_i386_parse_gnu_properties): Support
2141 GNU_PROPERTY_X86_FEATURE_1_AND.
2142 (elf_i386_merge_gnu_properties): Support
2143 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2144 on GNU_PROPERTY_X86_FEATURE_1_IBT
2145 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2146 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2147 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2148 is set on all relocatable inputs.
2149 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2150 (elf_x32_lazy_ibt_plt_entry): Likewise.
2151 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2152 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2153 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2154 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2155 (elf_x86_64_lazy_ibt_plt): Likewise.
2156 (elf_x32_lazy_ibt_plt): Likewise.
2157 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2158 (elf_x32_non_lazy_ibt_plt): Likewise.
2159 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2160 (elf_x86_64_parse_gnu_properties): Support
2161 GNU_PROPERTY_X86_FEATURE_1_AND.
2162 (elf_x86_64_merge_gnu_properties): Support
2163 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2164 on GNU_PROPERTY_X86_FEATURE_1_IBT
2165 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2166 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2167 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2168 is set on all relocatable inputs.
2170 2017-06-22 Nick Clifton <nickc@redhat.com>
2173 * som.c (setup_sections): NUL terminate the space_strings buffer.
2174 Check that the space.name field does not index beyond the end of
2175 the space_strings buffer.
2177 2017-06-21 Nick Clifton <nickc@redhat.com>
2180 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2182 2017-06-21 Nick Clifton <nickc@redhat.com>
2185 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2186 type of the size parameter.
2187 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2188 length of the counted string.
2189 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2190 (_bfd_vms_save_counted_string): Likewise.
2191 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2192 _bfd_vms_save_counted_string.
2193 (_bfd_vms_slurp_ehdr): Likewise.
2194 (_bfd_vms_slurp_egsd): Likewise.
2195 (Parse_module): Likewise.
2197 2017-06-21 Alan Modra <amodra@gmail.com>
2199 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2200 calls before tocsave calls.
2201 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2204 2017-06-21 Nick Clifton <nickc@redhat.com>
2207 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2208 bfd_get_full_section_contents returns no contents.
2210 2017-06-21 Nick Clifton <nickc@redhat.com>
2213 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2216 2017-06-21 Nick Clifton <nickc@redhat.com>
2219 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2221 (image_set_ptr): Likewise.
2222 (alpha_vms_fix_sec_rel): Likewise.
2223 (alpha_vms_slurp_relocs): Likewise.
2225 2017-06-21 Nick Clifton <nickc@redhat.com>
2228 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2230 (ieee_archive_p): Likewise.
2231 (ieee_object_p): Likewise.
2233 2017-06-21 Nick Clifton <nickc@redhat.com>
2236 * elf.c (setup_group): Zero the group section pointer list after
2237 allocation so that loops can be caught. Check for NULL pointers
2238 when processing a group list.
2240 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2242 * elf-s390.h: New file.
2243 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2245 (elf_s390_additional_program_headers): New function.
2246 (elf_s390_modify_segment_map): New function.
2247 (bfd_elf_s390_set_options): New function.
2248 (elf_backend_additional_program_headers)
2249 (elf_backend_modify_segment_map): Add macro definitions.
2251 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2254 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2255 the DYNAMIC bit instead of bfd_count_sections.
2257 2017-06-19 Nick Clifton <nickc@redhat.com>
2260 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2262 (evax_bfd_print_eeom): Likewise.
2263 (evax_bfd_print_egsd): Check for an overlarge record length.
2264 (evax_bfd_print_etir): Likewise.
2266 2017-06-19 Nick Clifton <nickc@redhat.com>
2269 * libieee.h (struct common_header_type): Add end_p field.
2270 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2272 (read_id): Check for a length that exceeds the remaining bytes in
2274 (ieee_seek): Initialise end_p.
2275 (ieee_archive_p): Likewise.
2276 (ieee_object_p): Likewise.
2278 2017-06-19 Nick Clifton <nickc@redhat.com>
2281 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2282 before reading the EIHS structure entries.
2284 2017-06-19 Nick Clifton <nickc@redhat.com>
2287 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2288 gsd_size. Check that there are enough bytes remaining to read the
2289 type and size of the next egsd. Check that the size of the egsd
2290 does not exceed the size of the record.
2292 2017-06-19 Alan Modra <amodra@gmail.com>
2294 * config.bfd: Correct targ_underscore for cris.
2296 2017-06-18 Alan Modra <amodra@gmail.com>
2298 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2299 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2301 2017-06-16 Nick Clifton <nickc@redhat.com>
2303 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2304 bucketlist is empty because there are no symbols to add to the
2307 2017-06-16 Alan Modra <amodra@gmail.com>
2313 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2314 (BFD_JUMP_TABLE_LINK): Likewise.
2315 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2316 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2317 (bfd_elf_define_start_stop): New function.
2318 * linker.c (bfd_generic_define_start_stop): New function.
2319 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2321 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2322 * aout-target.h (MY_bfd_define_start_stop): Define.
2323 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2324 * binary.c (binary_bfd_define_start_stop): Define.
2325 * bout.c (b_out_bfd_define_start_stop): Define.
2326 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2327 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2328 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2329 * coffcode.h (coff_bfd_define_start_stop): Define.
2330 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2331 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2332 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2333 * ieee.c (ieee_bfd_define_start_stop): Define.
2334 * ihex.c (ihex_bfd_define_start_stop): Define.
2335 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2336 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2337 * mmo.c (mmo_bfd_define_start_stop): Define.
2338 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2339 * oasys.c (oasys_bfd_define_start_stop): Define.
2340 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2341 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2342 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2343 * som.c (som_bfd_define_start_stop): Define.
2344 * srec.c (srec_bfd_define_start_stop): Define.
2345 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2346 * versados.c (versados_bfd_define_start_stop): Define.
2347 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2348 (alpha_vms_bfd_define_start_stop): Define.
2349 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2350 * bfd-in2.h: Regenerate.
2351 * libbfd.h: Regenerate.
2353 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2355 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2356 SYMBOL_REFERENCES_LOCAL.
2358 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2361 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2362 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2363 runtime for if there needs copy relocation elimination.
2364 (need_copy_relocation_p): New function. Return true for symbol with
2365 pc-relative references and if it's against read-only sections.
2366 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2367 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2368 that are related with accessing external objects.
2369 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2370 in elfNN_aarch64_check_relocs.
2372 2017-06-15 Nick Clifton <nickc@redhat.com>
2375 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2378 (ieee_archive_p): Likewise.
2380 2017-06-15 Nick Clifton <nickc@redhat.com>
2383 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2385 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2387 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2388 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2389 keep both windowed and call0 ABI PLT definitions.
2390 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2391 elf_xtensa_*_plt_entry endex.
2392 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2394 2017-06-14 Nick Clifton <nickc@redhat.com>
2397 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2400 2017-06-14 Nick Clifton <nickc@redhat.com>
2403 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2404 maximum value for the ascic pointer. Check that name processing
2405 does not read beyond this value.
2406 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2409 2017-06-14 Nick Clifton <nickc@redhat.com>
2412 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2413 (process_otr): Check for an invalid offset in the otr structure.
2415 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2417 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2419 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2425 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2426 vtable field to a union.
2427 (_bfd_elf_is_start_stop): Removed.
2428 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2429 __start_SECNAME and __stop_SECNAME symbols.
2430 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2431 * elflink.c (_bfd_elf_is_start_stop): Removed.
2432 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2433 _bfd_elf_is_start_stop.
2434 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2435 __stop_SECNAME symbols. Updated.
2436 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2437 (bfd_elf_gc_record_vtinherit): Likewise.
2438 (bfd_elf_gc_record_vtentry): Likewise.
2440 2017-06-13 Nick Clifton <nickc@redhat.com>
2443 * elflink.c (elf_link_adjust_relocs): Generate an error when
2444 encountering a reloc against a symbol removed by garbage
2447 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2449 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2450 to merge_gnu_properties.
2451 * elf-properties.c (elf_merge_gnu_properties): Add struct
2452 bfd_link_info * and pass it to merge_gnu_properties.
2453 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2454 and pass it to elf_merge_gnu_properties.
2455 (_bfd_elf_link_setup_gnu_properties): Pass info to
2456 elf_merge_gnu_property_list.
2457 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2459 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2461 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2464 * binary.c (binary_set_section_contents): Scale lma by octets
2465 per byte to set filepos.
2467 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2469 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2472 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2474 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2477 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2479 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2480 patched section contents for TLS IE reloc.
2481 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2483 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2485 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2486 RELOC_FOR_GLOBAL_SYMBOL macro.
2488 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2490 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2493 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2495 * config/tc-arc.c (md_undefined_symbol): Changed.
2496 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2498 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2500 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2503 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2505 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2506 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2508 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2510 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2513 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2515 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2516 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2517 is non-zero. Add clarifying comments.
2519 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2521 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2522 name. Use local IFUNC symbol name string to report unsupported
2523 non-PIC call to IFUNC function.
2524 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2525 when generating R_386_IRELATIVE relocation.
2526 (elf_i386_finish_dynamic_symbol): Likewise.
2527 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2529 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2530 when generating R_X86_64_IRELATIVE relocation.
2531 (elf_x86_64_finish_dynamic_symbol): Likewise.
2533 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2535 * elf.c (setup_group): Make sure BFD sections are created for all
2536 group sections in the input file when processing SHF_GROUP
2538 (bfd_section_from_shdr): Avoid duplicating logic already
2539 implemented in `setup_group'.
2541 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2544 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2545 if the hint address is zero.
2547 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2550 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2551 ELF_COMMON_DEF_P for common symbols.
2553 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2555 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2556 SEC_GROUP sections as SEC_EXCLUDE.
2557 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2558 (assign_section_numbers): Use resolve_section_groups flag instead
2559 of relocatable link type.
2560 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2561 flag instead of checking the final_link flag for part of the
2562 checks in here. Fix white space as a result.
2563 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2564 instead of relocatable link type.
2565 (bfd_elf_final_link): Likewise.
2567 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2569 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2571 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2572 (s3_bfd_score_elf_check_relocs): Likewise.
2573 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2574 (score_elf_final_link_relocate): Likewise.
2575 (s7_bfd_score_elf_check_relocs): Likewise.
2577 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2579 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2582 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2584 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2585 from `reloc_count' rather than decrementing it.
2586 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2587 `reloc_count' by `int_rels_per_ext_rel'.
2588 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2589 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2590 entry determination.
2591 (s3_bfd_score_elf_check_relocs): Likewise.
2592 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2593 (s7_bfd_score_elf_relocate_section): Likewise.
2594 (s7_bfd_score_elf_check_relocs): Likewise.
2595 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2596 prototype and function.
2597 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2598 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2599 triple rather than once the sum of REL and RELA relocation entry
2601 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2602 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2603 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2604 storage allocation size determination.
2605 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2606 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2607 by `int_rels_per_ext_rel' for last relocation entry
2609 (bfd_elf_final_link): Do not multiply `reloc_count' by
2610 `int_rels_per_ext_rel' for internal relocation storage
2611 allocation size determination.
2612 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2613 `int_rels_per_ext_rel' for last relocation entry determination.
2614 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2615 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2616 (_bfd_mips_elf_relocate_section): Likewise.
2618 2017-06-05 Alan Modra <amodra@gmail.com>
2621 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2623 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2625 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2626 determine structure sizes.
2627 (elfcore_grok_freebsd_prstatus): Likewise.
2629 2017-06-01 Alan Modra <amodra@gmail.com>
2631 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2632 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2634 (is_elfv2_localentry0): New function.
2635 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2636 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2637 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2638 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2639 optimized localentry:0 stubs.
2640 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2641 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2643 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2645 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2647 2017-05-30 Casey Smith <clegg89@gmail.com>
2650 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2651 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2653 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2655 * cpu-arc.c (arc_compatible): New function.
2657 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2659 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2661 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2664 * bfdio.c (bfd_get_file_size): New function.
2665 * bfd-in2.h: Regenerated.
2667 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2669 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2672 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2674 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2675 dynobj instead of htab->elf.dynobj.
2677 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2679 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2681 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2682 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2683 actual number of internal relocations retrieved. Adjust
2684 function description.
2685 (bfd_elf64_canonicalize_reloc): Remove macro.
2686 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2688 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2690 * archures.c (bfd_mach_sparc_v9m8): Define.
2691 (bfd_mach_sparc_v8plusm8): Likewise.
2692 (bfd_mach_sparc_v9_p): Adjust to M8.
2693 (bfd_mach_sparc_64bit_p): Likewise.
2694 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2695 bfd_mach_sparc_v8plusm8.
2696 * bfd-in2.h: Regenerated.
2697 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2699 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2700 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2701 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2703 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2704 bfd_mach_sparc_v8plusm8.
2706 2017-05-19 Alan Modra <amodra@gmail.com>
2708 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2709 debug and special sections when no non-note alloc sections in an
2712 2017-05-18 Alan Modra <amodra@gmail.com>
2714 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2715 * elf-m10300.c: Likewise.
2717 * elf32-arc.c: Likewise.
2718 * elf32-bfin.c: Likewise.
2719 * elf32-m68k.c: Likewise.
2720 * elf32-nds32.c: Likewise.
2721 * elf32-tilepro.c: Likewise.
2722 * elflink.c: Likewise.
2723 * elfnn-aarch64.c: Likewise.
2724 * elfnn-riscv.c: Likewise.
2725 * elfxx-tilegx.c: Likewise.
2726 * mach-o.c: Likewise.
2727 * peXXigen.c: Likewise.
2728 * vms-alpha.c: Likewise.
2729 * vms-lib.c: Likewise.
2731 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2734 * elflink.c (elf_gc_mark_debug_section): New function.
2735 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2736 referenced by kept debug sections.
2738 2017-05-16 Alan Modra <amodra@gmail.com>
2740 * elf-m10300.c: Rename occurrences of non_ir_ref.
2741 * elf32-arm.c: Likewise.
2742 * elf32-bfin.c: Likewise.
2743 * elf32-cr16.c: Likewise.
2744 * elf32-cris.c: Likewise.
2745 * elf32-d10v.c: Likewise.
2746 * elf32-dlx.c: Likewise.
2747 * elf32-fr30.c: Likewise.
2748 * elf32-frv.c: Likewise.
2749 * elf32-hppa.c: Likewise.
2750 * elf32-i370.c: Likewise.
2751 * elf32-i386.c: Likewise.
2752 * elf32-iq2000.c: Likewise.
2753 * elf32-lm32.c: Likewise.
2754 * elf32-m32c.c: Likewise.
2755 * elf32-m32r.c: Likewise.
2756 * elf32-m68hc1x.c: Likewise.
2757 * elf32-m68k.c: Likewise.
2758 * elf32-mcore.c: Likewise.
2759 * elf32-metag.c: Likewise.
2760 * elf32-microblaze.c: Likewise.
2761 * elf32-moxie.c: Likewise.
2762 * elf32-msp430.c: Likewise.
2763 * elf32-mt.c: Likewise.
2764 * elf32-nios2.c: Likewise.
2765 * elf32-or1k.c: Likewise.
2766 * elf32-ppc.c: Likewise.
2767 * elf32-rl78.c: Likewise.
2768 * elf32-s390.c: Likewise.
2769 * elf32-score.c: Likewise.
2770 * elf32-score7.c: Likewise.
2771 * elf32-sh.c: Likewise.
2772 * elf32-tic6x.c: Likewise.
2773 * elf32-tilepro.c: Likewise.
2774 * elf32-v850.c: Likewise.
2775 * elf32-vax.c: Likewise.
2776 * elf32-xstormy16.c: Likewise.
2777 * elf32-xtensa.c: Likewise.
2778 * elf64-alpha.c: Likewise.
2779 * elf64-hppa.c: Likewise.
2780 * elf64-ia64-vms.c: Likewise.
2781 * elf64-mmix.c: Likewise.
2782 * elf64-ppc.c: Likewise.
2783 * elf64-s390.c: Likewise.
2784 * elf64-sh64.c: Likewise.
2785 * elf64-x86-64.c: Likewise.
2786 * elflink.c: Likewise.
2787 * elfnn-aarch64.c: Likewise.
2788 * elfnn-ia64.c: Likewise.
2789 * elfnn-riscv.c: Likewise.
2790 * elfxx-mips.c: Likewise.
2791 * elfxx-sparc.c: Likewise.
2792 * elfxx-tilegx.c: Likewise.
2793 * linker.c: Likewise.
2795 2017-05-16 Alan Modra <amodra@gmail.com>
2797 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2798 * elflink.c (elf_link_add_object_symbols): Update to use
2800 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2802 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2804 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2806 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2808 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2810 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2811 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2813 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2815 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2817 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2819 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2820 to plt_second/plt_second_eh_frame.
2821 (elf_x86_64_link_hash_newfunc): Updated.
2822 (elf_x86_64_allocate_dynrelocs): Likewise.
2823 (elf_x86_64_size_dynamic_sections): Likewise.
2824 (elf_x86_64_relocate_section): Likewise.
2825 (elf_x86_64_finish_dynamic_symbol): Likewise.
2826 (elf_x86_64_finish_dynamic_sections): Likewise.
2827 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2828 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2830 (elf_backend_setup_gnu_properties): Updated. Create the
2831 .plt.sec section instead of the .plt.sec section.
2833 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2835 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2836 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2837 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2839 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2841 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2842 (bfd_elf64_set_reloc): Define.
2843 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2845 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2847 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2848 (struct bfd_target): New field _bfd_set_reloc.
2849 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2850 * reloc.c (_bfd_generic_set_reloc): New function.
2851 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2852 * nlm-target.h (nlm_set_reloc): Likewise.
2853 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2854 * aout-tic30.c (MY_set_reloc): Likewise.
2855 * aout-target.h (MY_set_reloc): Likewise.
2856 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2857 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2858 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2859 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2860 * aout-adobe.c (aout_32_set_reloc): Likewise.
2861 * bout.c (b_out_set_reloc): Likewise.
2862 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2863 * i386os9k.c (aout_32_set_reloc): Likewise.
2864 * ieee.c (ieee_set_reloc): Likewise.
2865 * oasys.c (oasys_set_reloc): Likewise.
2866 * som.c (som_set_reloc): Likewise.
2867 * versados.c (versados_set_reloc): Likewise.
2868 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2869 _bfd_generic_set_reloc.
2870 (rs6000_xcoff64_aix_vec): LIkewise.
2871 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2872 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2873 * i386msdos.c (msdos_set_reloc): Define to
2874 _bfd_norelocs_set_reloc.
2875 * elfcode.h (elf_set_reloc): Define.
2876 * bfd-in2.h: Regenerated.
2878 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2881 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2882 for IFUNC function address.
2884 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2886 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2887 (CONFLICT_LIST): Likewise.
2888 (opcode/arc-attrs.h): Include.
2889 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2890 (arc_extract_features): New file.
2891 (arc_stralloc): Likewise.
2892 (arc_elf_merge_attributes): Likewise.
2893 (arc_elf_merge_private_bfd_data): Use object attributes.
2894 (bfd_arc_get_mach_from_attributes): New function.
2895 (arc_elf_object_p): Use object attributes.
2896 (arc_elf_final_write_processing): Likewise.
2897 (elf32_arc_obj_attrs_arg_type): New function.
2898 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2899 (elf32_arc_section_from_shdr): Likewise.
2900 (elf_backend_obj_attrs_vendor): Define.
2901 (elf_backend_obj_attrs_section): Likewise.
2902 (elf_backend_obj_attrs_arg_type): Likewise.
2903 (elf_backend_obj_attrs_section_type): Likewise.
2904 (elf_backend_obj_attrs_handle_unknown): Likewise.
2905 (elf_backend_section_from_shdr): Likewise.
2907 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2910 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2911 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2912 and the destination is a Thumb symbol.
2914 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2916 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2917 initializer to silence GCC 4.2.
2918 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2920 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2922 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2923 (LAZY_PLT_ENTRY_SIZE): This.
2924 (NON_LAZY_PLT_ENTRY_SIZE): New.
2925 (elf_x86_64_plt0_entry): Renamed to ...
2926 (elf_x86_64_lazy_plt0_entry): This.
2927 (elf_x86_64_plt_entry): Renamed to ...
2928 (elf_x86_64_lazy_plt_entry): This.
2929 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2930 (elf_x86_64_lazy_bnd_plt0_entry): This.
2931 (elf_x86_64_legacy_plt_entry): Removed.
2932 (elf_x86_64_bnd_plt_entry): Renamed to ...
2933 (elf_x86_64_lazy_bnd_plt_entry): This.
2934 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2935 (elf_x86_64_non_lazy_plt_entry): This.
2936 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2937 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2938 (elf_x86_64_eh_frame_plt): Renamed to ...
2939 (elf_x86_64_eh_frame_lazy_plt): This.
2940 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2941 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2942 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2943 (elf_x86_64_eh_frame_non_lazy_plt): This.
2944 (elf_x86_64_lazy_plt_layout): New.
2945 (elf_x86_64_non_lazy_plt_layout): Likewise.
2946 (elf_x86_64_plt_layout): Likewise.
2947 (elf_x86_64_backend_data): Remove PLT layout information. Add
2948 os for target system.
2949 (GET_PLT_ENTRY_SIZE): Removed.
2950 (elf_x86_64_lazy_plt): New.
2951 (elf_x86_64_non_lazy_plt): Likewise.
2952 (elf_x86_64_lazy_bnd_plt): Likewise.
2953 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2954 (elf_x86-64_arch_bed): Updated.
2955 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2956 (elf_x86_64_create_dynamic_sections): Removed.
2957 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2958 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2959 (elf_x86-64_adjust_dynamic_symbol): Updated.
2960 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2961 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2962 size for PLT0 if there is no PLT0. Get plt_entry_size from
2963 non_lazy_plt for non-lazy PLT entries.
2964 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2965 from non_lazy_plt for non-lazy PLT entries.
2966 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2967 if there is no PLT0.
2968 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2969 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2970 entries with non-lazy PLT layout. Don't fill the second and third
2971 slots in the PLT entry if there is no PLT0.
2972 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2973 if there is no PLT0. Set sh_entsize on the .plt.got section.
2974 (compare_relocs): New.
2975 (elf_x86_64_plt_type): Likewise.
2976 (elf_x86_64_plt): Likewise.
2977 (elf_x86_64_nacl_plt): New. Forward declaration.
2978 (elf_x86_64_get_plt_sym_val): Removed.
2979 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2980 against all dynamic relocations.
2981 (elf_x86_64_link_setup_gnu_properties): New function.
2982 (elf_backend_create_dynamic_sections): Updated.
2983 (elf_backend_setup_gnu_properties): New.
2984 (elf_x86_64_nacl_plt): New.
2985 (elf_x86_64_nacl_arch_bed): Updated.
2987 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2989 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2990 (LAZY_PLT_ENTRY_SIZE): This.
2991 (NON_LAZY_PLT_ENTRY_SIZE): New.
2992 (elf_i386_plt0_entry): Renamed to ...
2993 (elf_i386_lazy_plt0_entry): This.
2994 (elf_i386_plt_entry): Renamed to ...
2995 (elf_i386_lazy_plt_entry): This.
2996 (elf_i386_pic_plt0_entry): Renamed to ...
2997 (elf_i386_pic_lazy_plt0_entry): This.
2998 (elf_i386_pic_plt_entry): Renamed to ...
2999 (elf_i386_pic_lazy_plt_entry): This.
3000 (elf_i386_got_plt_entry): Renamed to ...
3001 (elf_i386_non_lazy_plt_entry): This.
3002 (elf_i386_pic_got_plt_entry): Renamed to ...
3003 (elf_i386_pic_non_lazy_plt_entry): This.
3004 (elf_i386_eh_frame_plt): Renamed to ...
3005 (elf_i386_eh_frame_lazy_plt): This.
3006 (elf_i386_eh_frame_plt_got): Renamed to ...
3007 (elf_i386_eh_frame_non_lazy_plt): This.
3008 (elf_i386_plt_layout): Renamed to ...
3009 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3010 eh_frame_plt_got_size.
3011 (elf_i386_non_lazy_plt_layout): New.
3012 (elf_i386_plt_layout): Likewise.
3013 (elf_i386_non_lazy_plt): Likewise.
3014 (GET_PLT_ENTRY_SIZE): Removed.
3015 (elf_i386_plt): Renamed to ...
3016 (elf_i386_lazy_plt): This.
3017 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3018 (elf_i386_arch_bed): Updated.
3019 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3020 (elf_i386_create_dynamic_sections): Removed.
3021 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3022 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3023 (elf_i386_adjust_dynamic_symbol): Updated.
3024 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3025 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3026 size for PLT0 if there is no PLT0.
3027 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3028 output section is discarded only if GOT isn't empty.
3029 (elf_i386_relocate_section): Updated. Properly get PLT index
3030 if there is no PLT0.
3031 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3032 second and third slots in the PLT entry if there is no PLT0.
3033 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3034 if there is no PLT0. Set sh_entsize on the .plt.got section.
3035 (elf_i386_nacl_plt): Forward declaration.
3036 (elf_i386_get_plt_sym_val): Removed.
3037 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3038 against all dynamic relocations.
3039 (elf_i386_link_setup_gnu_properties): New function.
3040 (elf_backend_create_dynamic_sections): Updated.
3041 (elf_backend_setup_gnu_properties): New.
3042 (elf_i386_nacl_plt): Updated.
3043 (elf_i386_nacl_arch_bed): Likewise.
3044 (elf_i386_vxworks_arch_bed): Likewise.
3046 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3048 * elflink.c (elf_output_implib): Remove executable flag from import
3050 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3051 library is a relocatable object file.
3053 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3056 * elf32-avr.c (avr_should_move_sym): New function.
3057 (avr_should_reduce_sym_size): Likewise.
3058 (avr_should_increase_sym_size): Likewise.
3059 (elf32_avr_relax_delete_bytes): Adjust symbol values
3060 and sizes by calling new functions.
3062 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3064 * config.bfd (riscv32-*): Enable rv64.
3066 2017-05-02 Alan Modra <amodra@gmail.com>
3069 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3070 rather than h->root.type == bfd_link_hash_new.
3071 (bfd_elf_record_link_assignment): Similarly, call
3072 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3074 2017-04-29 Alan Modra <amodra@gmail.com>
3077 * reloc.c (reloc_offset_in_range): New function.
3078 (bfd_perform_relocation, bfd_install_relocation): Use it.
3079 (_bfd_final_link_relocate): Likewise.
3081 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3083 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3084 before using .plt.got.
3085 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3087 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3089 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3090 instead of "+=" to update 0.
3092 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3094 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3095 .plt.got section here.
3096 (elf_i386_check_relocs): Don't create the .plt.got section.
3097 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3098 the .plt.got and .plt.bnd sections here.
3099 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3102 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3104 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3106 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3107 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3108 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3109 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3112 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3114 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3116 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3117 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3118 the first relocatable ELF input with GNU properties.
3120 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3122 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3123 VxWorks for non-PIC.
3125 2017-04-27 Alan Modra <amodra@gmail.com>
3127 * elf-bfd.h (struct elf_backend_data): Make asection param of
3128 elf_backend_eh_frame_address_size const.
3129 (_bfd_elf_eh_frame_address_size): Likewise.
3130 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3131 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3132 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3133 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3134 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3135 (next_cie_fde_offset): Constify params.
3136 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3138 2017-04-27 Alan Modra <amodra@gmail.com>
3140 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3141 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3142 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3144 (offset_adjust): New function.
3145 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3146 (adjust_eh_frame_local_symbols): Likewise.
3147 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3148 after changing anything. Return true if anything changed.
3149 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3150 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3152 2017-04-27 Alan Modra <amodra@gmail.com>
3154 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3157 2017-04-27 Alan Modra <amodra@gmail.com>
3159 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3160 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3161 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3162 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3163 for undef and undefweak dyn_relocs.
3164 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3165 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3166 (allocate_got, allocate_dynrelocs): Likewise.
3167 (ppc64_elf_relocate_section): Likewise.
3169 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3171 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3172 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3173 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3174 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3176 2017-04-26 Nick Clifton <nickc@redhat.com>
3179 * reloc.c (bfd_perform_relocation): Check for a negative address
3182 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3185 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3187 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3188 (elf_backend_always_renumber_dynsyms): Define.
3189 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3190 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3191 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3192 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3194 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3196 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3198 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3199 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3200 sections have been created.
3202 2017-04-26 Nick Clifton <nickc@redhat.com>
3205 * compress.c (bfd_init_section_compress_status): Check the return
3206 value from bfd_malloc.
3208 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3210 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3211 no_finish_dynamic_symbol.
3212 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3214 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3215 weak symbol, don't make it dynamic.
3216 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3217 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3218 relocation for GOT reference.
3219 (elf_x86_64_finish_dynamic_symbol): Abort if
3220 no_finish_dynamic_symbol isn't 0.
3222 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3225 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3226 undefined weak symbol, don't make it dynamic.
3227 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3228 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3229 relocation for R_386_GOT32.
3231 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3234 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3236 2017-04-23 Alan Modra <amodra@gmail.com>
3239 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3240 * elf.c (lcomm_sym): New.
3241 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3242 * bfd-in2.h: Regenerate.
3244 2017-04-23 Alan Modra <amodra@gmail.com>
3247 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3248 parameters and comment.
3249 (_bfd_elf_get_reloc_section): Delete.
3250 (_bfd_elf_plt_get_reloc_section): Declare.
3251 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3252 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3254 (_bfd_elf_get_reloc_section): ..here. Delete.
3255 (assign_section_numbers): Call elf_get_reloc_section.
3256 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3257 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3259 2017-04-23 Alan Modra <amodra@gmail.com>
3262 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3265 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3268 * elf32-i386.c (elf_i386_link_hash_entry): Add
3269 no_finish_dynamic_symbol.
3270 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3271 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3272 symbol, don't make it dynamic in PIE.
3273 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3274 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3275 relocation for R_386_GOT32
3276 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3279 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3283 * elflink.c (elf_link_add_object_symbols): Require
3284 --no-dynamic-linker with -E/--dynamic-list when creating
3287 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3289 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3292 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3294 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3295 dynamic symbol sorting.
3297 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3300 * elflink.c (elf_link_add_object_symbols): Preserve
3301 dynamic_ref_after_ir_def when restoring the symbol table for
3302 unneeded dynamic object.
3304 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3307 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3308 on on undefined IFUNC symbol in the second PLT.
3310 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3312 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3314 2017-04-19 Alan Modra <amodra@gmail.com>
3316 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3317 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3318 * elf32-ppc.c:Formatting.
3319 (ensure_undefweak_dynamic): Don't make dynamic when
3320 info->dynamic_undefined_weak is zero.
3321 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3322 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3323 not default visibility. Discard undef and undefweak
3325 (ppc_elf_relocate_section): Adjust to suit.
3326 * elf64-ppc.c: Formatting.
3327 (ensure_undefweak_dynamic): Don't make dynamic when
3328 info->dynamic_undefined_weak is zero.
3329 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3330 info->dynamic_undefined_weak. Discard them earlier.
3332 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3335 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3336 before generating the version definition section.
3338 2017-04-17 Alan Modra <amodra@gmail.com>
3340 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3341 state when a regular object file defines a symbol with
3342 incompatible type to that defined by an earlier shared lib.
3344 2017-04-13 Alan Modra <amodra@gmail.com>
3346 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3348 * elf32-arm.c: Likewise.
3349 * elf32-i386.c: Likewise.
3350 * elf32-mep.c: Likewise.
3351 * elf64-ia64-vms.c: Likewise.
3352 * elf64-x86-64.c: Likewise.
3353 * elflink.c: Likewise.
3354 * elfnn-ia64.c: Likewise.
3355 * elfxx-mips.c: Likewise.
3357 2017-04-13 Alan Modra <amodra@gmail.com>
3359 * aoutx.h: Use %B and %A in error messages throughout file.
3360 * aout-cris.c: Likewise.
3361 * archive.c: Likewise.
3362 * binary.c: Likewise.
3363 * coff-rs6000.c: Likewise.
3364 * coff-tic4x.c: Likewise.
3365 * coffcode.h: Likewise.
3366 * coffgen.c: Likewise.
3367 * cofflink.c: Likewise.
3368 * coffswap.h: Likewise.
3369 * cpu-arm.c: Likewise.
3370 * elf-eh-frame.c: Likewise.
3371 * elf-m10300.c: Likewise.
3373 * elf32-arc.c: Likewise.
3374 * elf32-arm.c: Likewise.
3375 * elf32-bfin.c: Likewise.
3376 * elf32-frv.c: Likewise.
3377 * elf32-iq2000.c: Likewise.
3378 * elf32-m32c.c: Likewise.
3379 * elf32-microblaze.c: Likewise.
3380 * elf32-nds32.c: Likewise.
3381 * elf32-rl78.c: Likewise.
3382 * elf32-rx.c: Likewise.
3383 * elf32-score.c: Likewise.
3384 * elf32-score7.c: Likewise.
3385 * elf32-sh64.c: Likewise.
3386 * elf32-v850.c: Likewise.
3387 * elf32-vax.c: Likewise.
3388 * elf32-visium.c: Likewise.
3389 * elf64-ia64-vms.c: Likewise.
3390 * elf64-mmix.c: Likewise.
3391 * elf64-sh64.c: Likewise.
3392 * elfcode.h: Likewise.
3393 * elfnn-aarch64.c: Likewise.
3394 * elfnn-ia64.c: Likewise.
3395 * elfxx-mips.c: Likewise.
3396 * hpux-core.c: Likewise.
3399 * linker.c: Likewise.
3400 * merge.c: Likewise.
3402 * oasys.c: Likewise.
3403 * pdp11.c: Likewise.
3404 * peXXigen.c: Likewise.
3405 * rs6000-core.c: Likewise.
3406 * vms-alpha.c: Likewise.
3407 * xcofflink.c: Likewise.
3409 2017-04-13 Alan Modra <amodra@gmail.com>
3411 * bfd.c (PRINT_TYPE): Define.
3412 (_doprnt): New function.
3413 (error_handler_internal): Use _doprnt.
3414 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3415 calls in their natural order, throughout file.
3416 * coff-mcore.c: Likewise.
3417 * coff-ppc.c: Likewise.
3418 * coff-tic80.c: Likewise.
3419 * cofflink.c: Likewise.
3420 * elf-s390-common.c: Likewise.
3422 * elf32-arm.c: Likewise.
3423 * elf32-i386.c: Likewise.
3424 * elf32-m32r.c: Likewise.
3425 * elf32-msp430.c: Likewise.
3426 * elf32-spu.c: Likewise.
3427 * elf64-ia64-vms.c: Likewise.
3428 * elf64-sparc.c: Likewise.
3429 * elf64-x86-64.c: Likewise.
3430 * elflink.c: Likewise.
3431 * elfnn-aarch64.c: Likewise.
3432 * elfnn-ia64.c: Likewise.
3433 * elfxx-mips.c: Likewise.
3435 2017-04-13 Alan Modra <amodra@gmail.com>
3437 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3438 branch veneers" error. Fix double space and format message.
3439 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3440 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3442 2017-04-13 Alan Modra <amodra@gmail.com>
3444 * bfd-in2.h: Regenerate.
3446 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3448 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3449 extra `\n' in warning/error messages.
3450 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3451 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3453 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3455 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3456 processor-specific properties with generic ELF target vector.
3458 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3460 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3461 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3462 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3463 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3465 (link_hash_newfunc): Initialize has_got_reloc and
3467 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3469 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3471 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3473 (_bfd_sparc_elf_fixup_symbol): New function.
3474 (allocate_dynrelocs): Don't allocate space for dynamic
3475 relocations and discard relocations against resolved undefined
3476 weak symbols in executable. Don't make resolved undefined weak
3477 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3478 relocation against undefined weak symbols in PIE.
3479 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3480 relocations against resolved undefined weak symbols in PIE
3481 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3482 without ynamic PLT/GOT relocations for resolved undefined weak
3484 Don't generate dynamic relocation against resolved undefined
3485 weak symbol in executable.
3486 (pie_finish_undefweak_symbol): New function.
3487 (_bfd_sparc_elf_finish_dynamic_sections): Call
3488 pie_finish_undefweak_symbol on all symbols in PIE.
3489 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3490 (_bfd_sparc_elf_fixup_symbol): New function.
3492 2017-04-10 Nick Clifton <nickc@redhat.com>
3494 * config.bfd: Remove ns32k from obsolete list.
3496 2017-04-10 Alan Modra <amodra@gmail.com>
3499 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3500 (special_sections_i): Likewise for .init_array.
3501 (special_sections_p): Likewise for .preinit_array.
3503 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3507 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3508 ELF_COMMON_DEF_P for common symbols.
3509 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3510 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3511 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3512 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3513 07492f668d2173da7a2bda3707ff0985e0f460b6.
3515 2017-04-07 Pedro Alves <palves@redhat.com>
3517 * opncls.c (bfd_get_debug_link_info): Rename to...
3518 (bfd_get_debug_link_info_1): ... this. Change type of second
3519 parameter to void pointer. Adjust.
3520 (bfd_get_debug_link_info): Reimplement on top of
3521 bfd_get_debug_link_info_1.
3522 (separate_debug_file_exists, separate_alt_debug_file_exists):
3523 Change type of second parameter to void pointer. Adjust.
3524 (get_func_type, check_func_type): Change type of second parameter
3526 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3527 the callback functions instead of passing the address of a local.
3528 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3529 find_separate_debug_file.
3530 (get_alt_debug_link_info_shim): Change type of second parameter to
3531 void pointer. Adjust.
3532 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3533 find_separate_debug_file.
3534 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3535 of second parameter to void pointer. Adjust.
3536 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3537 pointer local to find_separate_debug_file.
3539 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3541 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3542 external symbols with a definition.
3543 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3545 2017-04-07 Alan Modra <amodra@gmail.com>
3547 * po/SRC-POTFILES.in: Regenerate.
3549 2017-04-05 Alan Modra <amodra@gmail.com>
3551 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3554 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3556 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3557 numbers for DataDirectory entry indicies passed to
3560 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3562 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3563 each GNU_MBIND section and align GNU_MBIND section to page size.
3564 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3565 segment for each GNU_MBIND section.
3566 (_bfd_elf_init_private_section_data): Copy sh_info from input
3567 for GNU_MBIND section.
3569 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3571 * elfnn-riscv.c (GP_NAME): Delete.
3572 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3573 (_bfd_riscv_relax_lui): Likewise.
3575 2017-04-04 Nick Clifton <nickc@redhat.com>
3578 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3580 (bfd_elf_final_link): Only initialize the extended symbol index
3581 section if there are extended symbol tables to list.
3583 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3585 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3586 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3587 * configure.ac (elf): Add elf-properties.lo.
3588 * Makefile.in: Regenerated.
3589 * configure: Likewise.
3590 * elf-bfd.h (elf_property_kind): New.
3591 (elf_property): Likewise.
3592 (elf_property_list): Likewise.
3593 (elf_properties): Likewise.
3594 (_bfd_elf_parse_gnu_properties): Likewise.
3595 (_bfd_elf_get_property): Likewise.
3596 (_bfd_elf_link_setup_gnu_properties): Likewise.
3597 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3598 and setup_gnu_properties.
3599 (elf_obj_tdata): Add properties.
3600 * elf-properties.c: New file.
3601 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3602 (elf_i386_merge_gnu_properties): Likewise.
3603 (elf_backend_parse_gnu_properties): Likewise.
3604 (elf_backend_merge_gnu_properties): Likewise.
3605 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3606 (elf_x86_64_merge_gnu_properties): Likewise.
3607 (elf_backend_parse_gnu_properties): Likewise.
3608 (elf_backend_merge_gnu_properties): Likewise.
3609 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3610 (elf_backend_parse_gnu_properties): Likewise.
3611 (elf_backend_setup_gnu_properties): Likewise.
3612 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3613 elf_backend_merge_gnu_properties and
3614 elf_backend_setup_gnu_properties.
3616 2017-03-30 Pip Cet <pipcet@gmail.com>
3618 * elf32-wasm32.c: Add relocation code, two relocs.
3619 * reloc.c: Add wasm32 relocations.
3620 * libbfd.h: Regenerate.
3621 * bfd-in2.h: Regenerate.
3622 * bfd/po/bfd.pot: Regenerate.
3624 2017-03-29 Nick Clifton <nickc@redhat.com>
3627 * coff-bfd.h (struct coff_section_data): Add new fields:
3628 saved_bias and bias.
3629 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3630 computed for PE binaries.
3631 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3634 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3637 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3638 to handle a local symbol with a hash-symbol-entry; without PLT.
3639 Add BFD_ASSERT for an incidental case with GOT entry present.
3640 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3641 isn't forced-or-set local.
3643 2017-03-27 Pip Cet <pipcet@gmail.com>
3645 * wasm-module.c: New file to support WebAssembly modules.
3646 * wasm-module.h: New file to support WebAssembly modules.
3647 * doc/webassembly.texi: Start documenting wasm-module.c.
3648 * config.bfd: Add wasm_vec.
3649 * targets.c: Likewise.
3650 * configure.ac: Likewise.
3651 * Makefile.am: Add entries for wasm-module.c.
3652 * Makefile.in: Regenerate.
3653 * configure: Regenerate.
3654 * po/SRC-POTFILES.in: Regenerate.
3656 2017-03-27 Pip Cet <pipcet@gmail.com>
3658 * cpu-wasm32.c: New file to support wasm32 architecture.
3659 * elf32-wasm32.c: New file to support wasm32 architecture.
3660 * Makefile.am: Add wasm32 architecture.
3661 * archures.c: Likewise.
3662 * config.bfd: Likewise.
3663 * configure.ac: Likewise.
3664 * targets.c: Likewise.
3665 * Makefile.in: Regenerate.
3666 * bfd-in2.h: Regenerate.
3667 * configure: Regenerate.
3668 * po/SRC-POTFILES.in: Regenerate.
3670 2017-03-20 Alan Modra <amodra@gmail.com>
3673 * elf64-ppc.c (compare_symbols): Stabilize sort.
3675 2017-03-18 Alan Modra <amodra@gmail.com>
3677 * elf64-ppc.c (struct ppc_link_hash_table): Add
3678 local_ifunc_resolver and maybe_local_ifunc_resolver.
3679 (ppc_build_one_stub): Set flags on emitting dynamic
3680 relocation to ifunc.
3681 (ppc64_elf_relocate_section): Likewise.
3682 (ppc64_elf_finish_dynamic_symbol): Likewise.
3683 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3684 local dynamic relocs to ifuncs.
3685 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3686 local_ifunc_resolver and maybe_local_ifunc_resolver.
3687 (ppc_elf_relocate_section): Set flag on emitting dynamic
3688 relocation to ifuncs.
3689 (ppc_elf_finish_dynamic_symbol): Likewise.
3690 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3691 dynamic relocs to ifuncs.
3693 2017-03-13 Nick Clifton <nickc@redhat.com>
3696 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3697 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3698 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3699 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3700 * bfd-in2.h: Regenerate.
3701 * libbfd.h: Regenerate.
3702 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3704 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3705 (elfNN_aarch64_howto_table): Likewise.
3706 (aarch64_tls_transition_without_check): Likewise.
3707 (aarch64_reloc_got_type): Likewise.
3708 (elfNN_aarch64_final_link_relocate): Likewise.
3709 (elfNN_aarch64_tls_relax): Likewise.
3710 (elfNN_aarch64_relocate_section): Likewise.
3711 (elfNN_aarch64_gc_sweep_hook): Likewise.
3712 (elfNN_aarch64_check_relocs): Likewise.
3713 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3714 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3716 2017-03-11 Alan Modra <amodra@gmail.com>
3718 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3719 parameter is in fact used. Whitespace fixes.
3720 * elf64-ppc.c: Likewise.
3722 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3724 * rs6000-core.c (CORE_NEW): Simplify macro when
3725 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3727 2017-03-07 Alan Modra <amodra@gmail.com>
3731 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3734 2017-03-05 Alan Modra <amodra@gmail.com>
3736 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3737 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3738 (next_cie_fde_offset): New function.
3739 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3740 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3741 four bytes. Align CIEs to four or eight bytes depending on
3742 per_encoding_aligned8. Align FDEs according to their encoding.
3743 Pad last FDE to output section alignment.
3744 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3746 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3747 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3748 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3750 2017-03-02 Martin Bickel <binutils@ineranves.de>
3753 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3754 empty segments which have a zero filesz, but a non-zero memsz.
3756 2017-03-02 Alan Modra <amodra@gmail.com>
3758 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3760 2017-02-28 Alan Modra <amodra@gmail.com>
3762 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3763 (ppc64_elf_relocate_section): Likewise.
3765 2017-02-28 Alan Modra <amodra@gmail.com>
3768 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3769 rather than elf32_nios2_hash_table or elf_hash_table.
3770 (create_got_section): Likewise.
3771 (nios2_elf32_finish_dynamic_symbol): Likewise.
3772 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3773 (nios2_elf32_size_dynamic_sections): Likewise.
3774 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3775 vars. Use htab equivalents directly instead. Don't create
3776 all dynamic sections on needing just the GOT. Use a goto
3777 rather than a fall-through with reloc test. Ensure
3778 htab->dynobj is set when making dynamic sreloc section.
3779 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3780 equivalent directly instead. Don't segfault on looking for
3781 .dynamic when dynamic sections have not been created. Don't
3782 segfault on .got.plt being discarded.
3783 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3784 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3785 fixme and another not so relevant comment.
3786 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3787 already set, set hash table dynobj on creating .sbss.
3789 2017-02-28 Alan Modra <amodra@gmail.com>
3791 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3792 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3793 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3794 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3795 (ppc64_elf_relocate_section): Likewise.
3796 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3797 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3798 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3799 * libbfd.h: Regenerate.
3800 * bfd-in2.h: Regenerate.
3802 2017-02-28 Alan Modra <amodra@gmail.com>
3804 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3805 dynamic .data.rel.ro read-only.
3806 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3807 rather than section flags when deciding where copy reloc goes.
3808 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3809 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3810 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3811 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3812 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3813 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3814 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3815 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3816 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3817 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3818 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3819 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3820 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3821 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3822 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3823 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3824 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3825 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3826 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3828 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3830 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3831 `jalr $0, $25' instruction encoding.
3833 2017-02-27 Nick Clifton <nickc@redhat.com>
3836 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3837 generating a seg-fault when encountering a symbol that has been
3838 deleted by garbage collection.
3840 2017-02-25 Alan Modra <amodra@gmail.com>
3842 * elf32-arc.c (struct dynamic_sections): Delete.
3843 (enum dyn_section_types): Delete.
3844 (dyn_section_names): Delete.
3845 (arc_create_dynamic_sections): Delete.
3846 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3847 segfault on discarded .rela.plt section.
3848 (elf_arc_size_dynamic_sections): Formatting. Don't call
3849 arc_create_dynamic_sections. Don't allocate memory for sections
3850 handled by the generic linker. Correct code finding relocs in
3851 read-only sections. Set SEC_EXCLUDE on zero size .got,
3852 .got.plt, and .dynbss sections. Do set .interp for pies.
3854 2017-02-24 Andrew Waterman <andrew@sifive.com>
3856 * elfnn-riscv.c (GP_NAME): New macro.
3857 (riscv_global_pointer_value): Use it.
3858 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3859 output section, consider only that section's alignment.
3861 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3863 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3864 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3865 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3866 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3868 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3870 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3871 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3874 2017-02-23 Alan Modra <amodra@gmail.com>
3877 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3879 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3880 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3883 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3886 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3887 processing ahead of the call to `elf_gc_sweep_symbol'.
3889 2017-02-22 Nick Clifton <nickc@redhat.com>
3892 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3893 created section 4-byte alignment.
3895 2017-02-22 Alan Modra <amodra@gmail.com>
3897 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3898 on .got or .plt output section being discarded by script.
3899 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3902 2017-02-21 Alan Modra <amodra@gmail.com>
3904 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3905 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3907 2017-02-20 Alan Modra <amodra@gmail.com>
3910 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3911 if DT_RELSZ/DT_RELASZ is zero.
3913 2017-02-17 Nick Clifton <nickc@redhat.com>
3915 * compress.c (bfd_get_full_section_contents): Remember to reduce
3916 compressed size by the sizeof the compression header when
3917 decompressing the contents.
3919 2017-02-17 Pedro Alves <palves@redhat.com>
3921 * srec.c (Chunk): Rename to ...
3922 (_bfd_srec_len): ... this.
3923 (S3Forced): Rename to ...
3924 (_bfd_srec_forceS3): ... this.
3925 * objcopy.c: Adjust all references.
3927 2017-02-17 Pedro Alves <palves@redhat.com>
3929 * archive.c (bsd_write_armap): Rename to ...
3930 (_bfd_bsd_write_armap): ... this.
3931 (coff_write_armap): Rename to ...
3932 (_bfd_coff_write_armap): ... this.
3933 * libbfd-in.h (bsd_write_armap): Rename to ...
3934 (_bfd_bsd_write_armap): ... this.
3935 (coff_write_armap): Rename to ...
3936 (_bfd_coff_write_armap): ... this.
3937 * aout-target.h, aout-tic30.c: Adjust all users.
3938 * libbfd.h: Regenerate.
3940 2017-02-17 Pedro Alves <palves@redhat.com>
3942 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3943 (warn_deprecated): Rename to ...
3944 (_bfd_warn_deprecated): ... this.
3945 * libbfd.c (warn_deprecated): Rename to ...
3946 (_bfd_warn_deprecated): ... this.
3947 * bfd-in2.h: Regenerate.
3949 2017-02-17 Pedro Alves <palves@redhat.com>
3951 * bfdio.c (real_ftell): Rename to ...
3952 (_bfd_real_ftell): ... this.
3953 (real_fseek): Rename to ...
3954 (_bfd_real_fseek): ... this.
3955 (real_fopen): Rename to ...
3956 (_bfd_real_fopen): ... this.
3957 * libbfd-in.h (real_ftell): Rename to ...
3958 (_bfd_real_ftell): ... this.
3959 (real_fseek): Rename to ...
3960 (_bfd_real_fseek): ... this.
3961 (real_fopen): Rename to ...
3962 (_bfd_real_fopen): ... this.
3963 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3964 * libbfd.h: Regenerate.
3966 2017-02-17 Pedro Alves <palves@redhat.com>
3968 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3969 * libbfd.c (read_unsigned_leb128): Rename to ...
3970 (_bfd_read_unsigned_leb128): ... this.
3971 (read_signed_leb128): Rename to ...
3972 (_bfd_read_signed_leb128): ... this.
3973 (safe_read_leb128): Rename to ...
3974 (_bfd_safe_read_leb128): ... this.
3975 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3976 (_bfd_read_unsigned_leb128): ... this.
3977 (read_signed_leb128): Rename to ...
3978 (_bfd_read_signed_leb128): ... this.
3979 (safe_read_leb128): Rename to ...
3980 (_bfd_safe_read_leb128): ... this.
3981 * libbfd.h: Renegerate.
3983 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3985 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3986 before trying to fine matching file and line information.
3988 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3990 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3991 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3992 not match current bfd, then reload debug information. Record bfd
3993 we're loading debug info for in the stash. If we have debug
3994 informatin in the cache then perform section placement before
3997 2017-02-16 Alan Modra <amodra@gmail.com>
4000 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4001 * elfxx-target.h (elf_backend_no_page_alias): Define.
4002 (elfNN_bed): Init new field.
4003 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4004 ensure PT_LOAD segment starts on a new page.
4005 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4007 2017-02-16 Alan Modra <amodra@gmail.com>
4010 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4013 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4015 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4016 * bfd-in2.h: Regenerated.
4018 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4021 * elf32-i386.c (elf_i386_relocate_section): Allow
4022 "lea foo@GOT, %reg" in PIC.
4024 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4027 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4028 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4029 error against local IFUNC symbol without a base register for
4032 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4034 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4035 `%P: %H:' with `info->callbacks->einfo'.
4036 (ppc_elf_relocate_section): Likewise.
4037 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4038 (ppc64_elf_edit_toc): Likewise.
4039 (ppc64_elf_relocate_section): Likewise.
4041 2017-02-14 Alan Modra <amodra@gmail.com>
4043 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4044 --gc-keep-exported, and test versioned field of sym rather than
4045 looking for @ in name.
4047 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4049 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4052 2017-02-13 Nick Clifton <nickc@redhat.com>
4055 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4058 2017-02-07 Andrew Waterman <andrew@sifive.com>
4060 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4061 entry size if PLT header is written.
4063 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4065 Fix sparc64 dynamic relocation processing to use the dynamic
4067 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4068 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4071 2017-02-03 Nick Clifton <nickc@redhat.com>
4074 * coffcode.h (coff_write_object_contents): Enlarge size of
4075 s_name_buf in order to avoid compile time warning about possible
4077 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4078 32-bits of insn value before printing into buffer.
4080 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4082 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4083 `max_local_dynindx'.
4084 (mips_elf_sort_hash_table): Handle it.
4085 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4086 symbols bump up `max_local_dynindx' rather than
4087 `max_non_got_dynindx'.
4089 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4091 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4092 `min_got_dynindx', `max_unref_got_dynindx' and
4093 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4094 (mips_elf_sort_hash_table): Adjust accordingly.
4096 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4098 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4099 to access the hash table.
4101 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4103 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4104 non-NULL `htab' to the beginning.
4106 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4108 * elflink.c (elf_gc_sweep): Wrap overlong line.
4110 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4112 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4113 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4114 * elfxx-mips.c (mips_elf_link_hash_table): Add
4115 `ignore_branch_isa' member.
4116 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4117 in branch relocation calculation as an error if
4118 `ignore_branch_isa' has been set.
4119 (_bfd_mips_elf_insn32): Rename to...
4120 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4121 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4122 Handle the new parameter.
4124 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4126 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4127 local variable dynobj.
4130 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4131 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4132 executable from read-only sections into sdynrelro.
4133 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4134 dynamic relocs in sdynrelro.
4135 (elf_backend_want_dynrelro): Define.
4137 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4139 * config.bfd (*-*-rtemsaout*): Mark as removed.
4141 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4143 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4144 (arm-*-rtems*): Move to (arm*-*-eabi*).
4145 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4146 (m68-*-rtems*): Move to (m68*-*-elf*).
4148 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4150 * config.bfd (*-*-rtemscoff*): Mark as removed.
4152 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4155 * elflink.c (bfd_elf_record_link_assignment): Revert last
4156 change and don't ever clear `forced_local'. Set `mark'
4158 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4160 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4161 (bfd_elf_size_dynamic_sections): ... here.
4162 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4163 and set `mark' instead in `__tls_get_addr_opt' processing.
4164 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4166 2017-01-24 Alan Modra <amodra@gmail.com>
4168 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4169 where dynamic relocs are preferable. Allow ifunc too.
4170 (ensure_undefweak_dynamic): New function.
4171 (allocate_dynrelocs): Use it here. Move plt handling last and
4172 don't make symbols dynamic, simplifying loop. Only make undef
4173 weak symbols with GOT entries dynamic. Correct condition
4174 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4175 comments. Remove goto.
4176 (ppc_elf_relocate_section): Correct test for using dynamic
4177 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4178 to suit. Set up explicit tls_index entries and implicit GOT
4179 tls_index entries resolvable at link time for
4180 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4181 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4182 (ensure_undefweak_dynamic): New function.
4183 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4184 with GOT entries dynamic. Remove unnecessary test of
4185 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4186 (ppc64_elf_relocate_section): Correct test for using dynamic
4187 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4188 to suit. Set up explicit tls_index entries and implicit GOT
4189 tls_index entries resolvable at link time for __tls_get_addr_opt.
4190 Simplify expression to clear mem for prelink.
4192 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4194 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4196 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4198 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4199 (elf_backend_hash_symbol): Define.
4201 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4204 * elflink.c (bfd_elf_record_link_assignment): Clear any
4205 `forced_local' marking for DSO symbols that are not being
4208 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4210 * elfnn-riscv.c (riscv_elf_object_p): New function.
4212 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4215 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4217 (elf_x86_64_check_relocs): Create .eh_frame section for the
4219 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4220 .eh_frame section for the .plt.bnd section.
4221 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4222 for the .plt.bnd section.
4224 2017-01-12 Nick Clifton <nickc@redhat.com>
4227 * opncls.c (find_separate_debug_file): Add include_dirs
4228 parameter. Only include the directory part of the bfd's filename
4229 in search paths if include_dirs is true. Add a couple of extra
4230 locations for looking for debug files.
4231 ( bfd_follow_gnu_debuglink): Update invocation of
4232 find_separate_debug_file.
4233 (bfd_follow_gnu_debugaltlink): Likewise.
4234 (get_build_id): New function: Finds the build-id of the given bfd.
4235 (get_build_id_name): New function: Computes the name of the
4236 separate debug info file for a bfd, based upon its build-id.
4237 (check_build_id_file): New function: Checks to see if a separate
4238 debug info file exists at the given location, and that its
4239 build-id matches that of the original bfd.
4240 (bfd_follow_build_id_debuglink): New function: Finds a separate
4241 debug info file for a given bfd by using the build-id method.
4242 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4243 method of locating a separate debug info file before using the
4245 * bfd-in2.h: Regenerate.
4247 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4250 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4251 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4252 elf_x86_64_eh_frame_plt_got.
4253 (elf_x86_64_size_dynamic_sections): Get unwind info from
4254 elf_x86_64_bnd_arch_bed for the BND PLT.
4256 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4258 * config.bfd: Add entries for i686-redox and x86_64-redox.
4260 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4262 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4264 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4265 .eh_frame section to 4 bytes for x32.
4266 (elf_x86_64_check_relocs): Likewise.
4268 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4271 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4272 (PLT_GOT_FDE_LENGTH): Likewise.
4273 (elf_i386_plt_layout): Add eh_frame_plt_got and
4274 eh_frame_plt_got_size.
4275 (elf_i386_plt): Updated.
4276 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4277 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4278 (elf_i386_size_dynamic_sections): Allocate and initialize
4279 .eh_frame section for .plt.got.
4280 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4282 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4283 eh_frame_plt_got_size.
4284 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4285 (PLT_GOT_FDE_LENGTH): Likewise.
4286 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4287 eh_frame_plt_got_size.
4288 (elf_x86_64_arch_bed): Updated.
4289 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4290 eh_frame_plt_got_size.
4291 (elf_x86_64_nacl_arch_bed): Likewise.
4292 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4293 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4294 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4295 .eh_frame section for .plt.got.
4296 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4299 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4301 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4302 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4304 2017-01-09 Nick Clifton <nickc@redhat.com>
4306 * dwarf2.c (lookup_address_in_function_table): Return early if
4307 there are no functions in the given comp unit, or if the high
4308 address of the last function in the comp unit is less than the
4311 2017-01-09 Nick Clifton <nickc@redhat.com>
4314 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4315 message if there are too many symbols to load.
4317 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4319 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4320 if relocs are cached.
4322 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4325 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4326 for R_MICROBLAZE_GOTOFF_64.
4328 2017-01-03 Nick Clifton <nickc@redhat.com>
4330 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4331 warning about using a possibly uninitialised variable.
4333 2017-01-02 Alan Modra <amodra@gmail.com>
4335 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4336 (allocate_plt_static, allocate_dynrelocs): Use it.
4338 2017-01-02 Alan Modra <amodra@gmail.com>
4340 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4341 .PARISC.unwind section.
4343 2017-01-02 Alan Modra <amodra@gmail.com>
4346 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4347 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4348 indirect to GOT pointer relative code edit.
4350 2017-01-02 Alan Modra <amodra@gmail.com>
4352 Update year range in copyright notice of all files.
4354 For older changes see ChangeLog-2016
4356 Copyright (C) 2017 Free Software Foundation, Inc.
4358 Copying and distribution of this file, with or without modification,
4359 are permitted in any medium without royalty provided the copyright
4360 notice and this notice are preserved.
4366 version-control: never