1 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
3 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
4 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
5 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
7 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
9 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
10 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
11 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
13 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
15 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
16 * elf32-i386.c (elf_i386_relocate_section): Use it.
17 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
19 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
21 * elf32-i386.c (X86_SIZE_TYPE_P): New.
22 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
23 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
24 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
25 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
27 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
29 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
30 (PLT_LOCAL_IFUNC_P): Likewise.
31 * elf32-i386.c (elf_i386_relocate_section): Use them.
32 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
34 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
36 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
37 * elf32-i386.c (elf_i386_relocate_section): Use it.
38 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
40 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
42 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
43 * elf32-i386.c (elf_i386_relocate_section): Use it.
44 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
46 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
48 * elf32-i386.c (X86_PCREL_TYPE_P): New.
49 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
50 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
51 (X86_PCREL_TYPE_P): This.
52 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
53 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
54 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
56 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
58 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
60 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
61 * elf32-i386.c (elf_i386_tls_transition): Use it.
62 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
64 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
66 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
67 Dump dynamic relocation in read-only section with minfo if
69 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
70 (maybe_set_textrel): Likewise.
71 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
72 read-only section with minfo.
74 2017-10-05 John Baldwin <jhb@FreeBSD.org>
76 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
78 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
80 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
81 in read-only section with minfo.
82 (tilepro_elf_size_dynamic_sections): Likewise.
83 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
84 (tilegx_elf_size_dynamic_sections): Likewise.
86 2017-10-05 Pedro Alves <palves@redhat.com>
89 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
90 ellipsis parameter. Split out bfd_error_on_input code to..
91 (bfd_set_input_error): .. New function.
92 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
93 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
94 * bfd-in2.h: Regenerate.
96 2017-10-05 Alan Modra <amodra@gmail.com>
98 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
99 fini_array error value.
101 2017-10-05 Alan Modra <amodra@gmail.com>
104 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
106 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
108 (elf_fake_sections): Adjust calls. Exit immediately on failure.
109 (bfd_elf_set_group_contents): Add associated reloc section indices
112 2017-10-04 Alan Modra <amodra@gmail.com>
114 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
115 classify symbols for ELFv2.
117 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
120 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
121 undergoes default promotion.
122 * bfd-in2.h: Regenerate.
124 2017-10-02 Alan Modra <amodra@gmail.com>
126 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
127 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
129 2017-10-01 Alan Modra <amodra@gmail.com>
132 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
133 (add_line_info): Always put end_sequence last.
135 2017-10-01 Alan Modra <amodra@gmail.com>
138 * dwarf2.c (read_section): Allocate buffer with extra byte for
139 bfd_simple_get_relocated_section_contents rather than copying
142 2017-09-29 Alan Modra <amodra@gmail.com>
144 * merge.c (merge_strings): Return FALSE on malloc failure.
145 (_bfd_merge_sections): Return failures from record_section and
148 2017-09-28 Alan Modra <amodra@gmail.com>
151 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
152 a case where plugin_notice isn't called.
154 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
156 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
159 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
162 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
163 output_bfd to info->callbacks->minfo.
165 2017-09-26 Nick Clifton <nickc@redhat.com>
168 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
169 assertion failure if elf_x86_64_rtype_to_howto has already issued
172 2017-09-26 Alan Modra <amodra@gmail.com>
175 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
178 2017-09-26 Nick Clifton <nickc@redhat.com>
181 * dwarf2.c (read_formatted_entries): Fail early if we know that
182 the loop parsing data entries will overflow the end of the
185 2017-09-26 Alan Modra <amodra@gmail.com>
188 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
189 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
190 to stash->info_ptr_memory, and check die_ref is within that memory.
191 Set info_ptr_end correctly when another CU is refd. Check die_ref
192 for DW_FORM_ref4 etc. is within CU.
194 2017-09-26 Alan Modra <amodra@gmail.com>
197 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
198 (read_formatted_entries): Init "fe".
199 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
201 2017-09-26 Alan Modra <amodra@gmail.com>
204 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
205 bounds in inner loop.
207 2017-09-25 Alan Modra <amodra@gmail.com>
210 * dwarf1.c (parse_die): Sanity check pointer against section limit
211 before dereferencing.
212 (parse_line_table): Likewise.
214 2017-09-25 Alan Modra <amodra@gmail.com>
217 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
219 (parse_comp_unit): Likewise.
221 2017-09-25 Alan Modra <amodra@gmail.com>
224 * dwarf2.c (read_formatted_entries): Error on format_count zero.
226 2017-09-24 Alan Modra <amodra@gmail.com>
229 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
230 within section bounds.
232 2017-09-24 Alan Modra <amodra@gmail.com>
235 * dwarf2.c (decode_line_info): Properly free line sequences on error.
237 2017-09-24 Alan Modra <amodra@gmail.com>
240 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
241 pname param. Return status. Make name const. Don't abort,
242 return an error. Formatting. Exit if current info_ptr matches
243 orig_info_ptr. Update callers.
244 (scan_unit_for_symbols): Start at nesting_level of zero. Make
245 nested_funcs an array of structs for extensibility. Formatting.
247 2017-09-24 Alan Modra <amodra@gmail.com>
250 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
251 rather than dividing by zero.
253 2017-09-24 Alan Modra <amodra@gmail.com>
256 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
258 2017-09-24 Alan Modra <amodra@gmail.com>
261 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
263 2017-09-24 Alan Modra <amodra@gmail.com>
266 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
267 SHT_GNU_verneed section for sanity. Don't zalloc memory for
270 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
273 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
276 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
279 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
280 -1 if bfd_canonicalize_dynamic_reloc returns 0.
282 2017-09-22 Pedro Alves <palves@redhat.com>
283 Alan Modra <amodra@gmail.com>
285 * version.h: Add comment.
287 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
289 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
290 NT_S390_GS_BC, correct the previously swapped invocations of
291 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
293 2017-09-19 Alan Modra <amodra@gmail.com>
296 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
299 2017-09-19 Alan Modra <amodra@gmail.com>
302 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
303 symbols before calculating verrefs. Don't renumber dynsyms
304 after gc. Exclude .gnu.version when zero or one dynsym.
305 Localize some vars and reindent.
307 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
310 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
311 return from bfd_canonicalize_dynamic_reloc.
313 2017-09-15 Alan Modra <amodra@gmail.com>
316 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
317 overflows bfd_size_type.
319 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
322 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
323 to indicate if conversion is performed.
324 (elf_i386_check_relocs): Cache section contents and relocations
325 if conversion is performed.
326 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
327 contents and relocations if conversion is performed.
329 2017-09-14 Nick Clifton <nickc@redhat.com>
332 * peXXigen.c (pe_print_idata): Extend check for HintName vector
335 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
337 * elfxx-x86.h: Fix a typo in comments.
339 2017-09-09 Kamil Rytarowski <n54@gmx.com>
341 * elf32-nds32.c: Rename __BIT() to N32_BIT().
343 2017-09-09 Alan Modra <amodra@gmail.com>
345 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
348 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
350 * elf32-i386.c (elf_i386_relocate_section): Update usage of
351 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
352 (elf_i386_finish_dynamic_symbol): Likewise.
353 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
354 (elf_x86_64_finish_dynamic_symbol): Likewise.
355 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
356 (_bfd_x86_elf_fixup_symbol): Likewise.
358 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
360 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
361 check has_non_got_reloc.
363 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
366 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
367 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
368 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
369 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
370 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
371 and linker_def on __ehdr_start if it is referenced and not
373 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
374 and return TRUE when building executable, if a symbol has
375 non-GOT/non-PLT relocations in text section or there is no
377 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
379 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
381 * elfxx-x86.h: Update comments.
383 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
385 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
386 elf_x86_plt_layout_table with elf_x86_init_table.
387 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
389 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
391 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
392 (elf_x86_init_table): This.
393 (_bfd_x86_elf_link_setup_gnu_properties): Replace
394 elf_x86_plt_layout_table with elf_x86_init_table.
396 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
398 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
399 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
400 * configure: Regenerated.
401 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
402 and r_sym fields of plt_layout.
403 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
405 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
406 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
407 r_info nor r_sym fields.
408 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
410 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
412 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
414 * (_bfd_riscv_relax_align): Call bfd_set_error and
415 print an error message when unable to relax a .align directive.
417 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
419 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
420 (riscv_record_pcrel_hi_reloc): Add absolute argument.
421 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
422 R_RISCV_PCREL_HI20 relocs, and pass the result to
423 riscv_record_pcrel_hi_reloc.
425 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
427 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
428 r_type_p. Remove the converted argument. Replace
429 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
430 the new relocation type via r_type_p.
431 (elf_i386_relocate_section): Likewise.
432 (elf_i386_finish_dynamic_symbol): Likewise.
433 (need_convert_load): Removed.
434 (check_relocs_failed): Updated.
435 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
436 instead of setting need_convert_load.
437 (_bfd_i386_elf_convert_load): Removed.
438 * elf64-x86-64.c (need_convert_load): Removed.
439 (check_relocs_failed): Updated.
440 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
441 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
442 Return the new relocation type via r_type_p.
443 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
444 instead of setting need_convert_load.
445 (elf_x86_64_check_relocs): Don't check PIC if relocation has
447 (_bfd_x86_64_elf_convert_load): Removed.
448 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
449 with SYMBOL_REFERENCES_LOCAL_P.
450 (elf_x86_64_finish_dynamic_symbol): Likewise.
451 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
453 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
454 (_bfd_x86_elf_link_symbol_references_local): New function.
455 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
456 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
457 SYMBOL_REFERENCES_LOCAL_P.
458 (elf_x86_link_hash_entry): Add local_ref.
459 (elf_x86_link_hash_table): Remove convert_load.
460 (_bfd_i386_elf_convert_load): Removed.
461 (_bfd_x86_64_elf_convert_load): Likewise.
462 (_bfd_x86_elf_link_symbol_references_local): New.
464 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
466 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
467 (elf_x86_64_info_to_howto): Get the real relocation type by
468 masking out R_X86_64_converted_reloc_bit.
469 (elf_x86_64_check_tls_transition): Get the real relocation type
470 by masking out R_X86_64_converted_reloc_bit.
471 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
472 instead of setting converted_reloc.
473 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
474 instead of converted_reloc. Get the real relocation type by
475 masking out R_X86_64_converted_reloc_bit.
476 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
477 R_X86_64_converted_reloc_bit is valid.
478 * elfxx-x86.h (converted_reloc): Removed.
480 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
482 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
483 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
484 to get the relocation type again.
485 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
486 r_type when calling elf_x86_64_tls_transition. Don't use
487 ELF32_R_TYPE to get the relocation type again.
489 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
491 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
494 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
496 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
497 argument. Don't check relocation overflow. Avoid relocation
498 overflow if --no-relax is used. Set converted_reloc on symbol
499 if a GOTPCREL relocation is converted.
500 (elf_x86_64_relocate_section): Issue a fatal error and suggest
501 --no-relax if GOTPCREL relocation conversion leads to relocation
503 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
505 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
506 Edmar Wienskoski <edmar.wienskoski@nxp.com
508 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
509 (ppc_elf_check_relocs): Handle it.
510 (ppc_elf_vle_split20): New function.
511 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
513 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
516 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
517 for x86-64 if GOT_TLS_GDESC_P is true.
519 2017-09-03 Alan Modra <amodra@gmail.com>
522 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
524 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
526 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
527 tls_get_addr for x86-64 in one place.
529 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
531 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
532 with elfxx-x86.lo for 64-bit BFD.
533 * configure: Regenerated.
535 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
537 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
538 (_bfd_i386_elf_convert_load): This. Remove static.
539 (elf_i386_size_dynamic_sections): Removed.
540 (elf_backend_size_dynamic_sections): Likewise.
541 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
542 (_bfd_x86_64_elf_convert_load): This. Remove static.
543 (elf_x86_64_size_dynamic_sections): Removed.
544 (elf_backend_size_dynamic_sections): Likewise.
545 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
546 (elf_x86_allocate_dynrelocs): This. Make it static.
547 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
548 (elf_x86_allocate_local_dynreloc): This. Make it static.
549 (elf_i386_is_reloc_section): New function.
550 (elf_x86_64_is_reloc_section): Likewise.
551 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
552 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
553 Rearrange got_entry_size initialization.
554 (_bfd_x86_elf_size_dynamic_sections): New function.
555 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
556 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
557 (_bfd_i386_elf_convert_load): New.
558 (_bfd_x86_64_elf_convert_load): Likewise.
559 (_bfd_x86_elf_size_dynamic_sections): Likewise.
560 (elf_backend_size_dynamic_sections): Likewise.
561 (_bfd_x86_elf_allocate_dynrelocs): Removed.
562 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
564 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
566 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
569 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
571 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
572 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
574 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
576 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
577 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
578 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
579 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
580 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
581 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
583 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
585 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
586 (elf_i386_allocate_local_dynrelocs): Likewise.
587 (elf_i386_size_dynamic_sections): Replace
588 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
589 with _bfd_x86_elf_allocate_dynrelocs and
590 _bfd_x86_elf_allocate_local_dynrelocs.
591 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
592 (elf_x86_64_allocate_local_dynrelocs): Likewise.
593 (elf_x86_64_size_dynamic_sections): Replace
594 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
595 with _bfd_x86_elf_allocate_dynrelocs and
596 _bfd_x86_elf_allocate_local_dynrelocs.
597 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
598 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
599 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
600 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
602 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
604 * elf32-i386.c (is_i386_elf): Removed.
605 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
606 (elf_i386_size_dynamic_sections): Likewise.
607 (elf_i386_relocate_section): Likewise.
608 * elf64-x86-64.c (is_x86_64_elf): Removed.
609 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
611 (elf_x86_64_size_dynamic_sections): Likewise.
612 (elf_x86_64_relocate_section): Likewise.
613 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
615 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
618 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
620 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
621 (elf_i386_allocate_dynrelocs): Replace
622 elf_i386_compute_jump_table_size with
623 elf_x86_compute_jump_table_size.
624 (elf_i386_size_dynamic_sections): Likewise.
625 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
626 (elf_x86_64_allocate_dynrelocs): Replace
627 elf_x86_64_compute_jump_table_size with
628 elf_x86_compute_jump_table_size.
629 (elf_x86_64_size_dynamic_sections): Likewise.
630 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
632 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
633 (elf_x86_compute_jump_table_size): New.
635 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
637 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
639 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
640 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
642 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
644 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
645 with htab->is_vxworks.
646 (elf_i386_size_dynamic_sections): Likewise.
647 (elf_i386_relocate_section): Likewise.
648 (elf_i386_finish_dynamic_symbol): Likewise.
649 (elf_i386_finish_dynamic_sections): Likewise.
651 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
653 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
654 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
655 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
656 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
657 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
658 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
659 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
660 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
662 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
665 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
666 ELF_COMMON_DEF_P for common symbols.
668 2017-09-02 Alan Modra <amodra@gmail.com>
670 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
671 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
672 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
674 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
676 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
677 (elf_backend_gc_mark_hook): Likewise.
678 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
679 (elf_backend_gc_mark_hook): Likewise.
680 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
681 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
682 (elf_backend_gc_mark_hook): Likewise.
684 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
686 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
687 (elf_backend_adjust_dynamic_symbol): Likewise.
688 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
689 (elf_backend_adjust_dynamic_symbol): Likewise.
690 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
691 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
692 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
693 (_bfd_x86_elf_adjust_dynamic_symbol): New.
694 (elf_backend_adjust_dynamic_symbol): Likewise.
696 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
698 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
701 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
703 * elf32-i386.c (elf_i386_mkobject): Removed.
704 (bfd_elf32_mkobject): Likewise.
705 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
706 (bfd_elf64_mkobject): Likewise.
707 (bfd_elf32_mkobject): Likewise.
708 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
709 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
710 (bfd_elf64_mkobject): Likewise.
711 (bfd_elf32_mkobject): Likewise.
713 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
715 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
716 Call _bfd_x86_elf_link_setup_gnu_properties.
717 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
718 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
720 (elf_x86_64_non_lazy_plt): Likewise.
721 (elf_x86_64_lazy_bnd_plt): Likewise.
722 (elf_x86_64_non_lazy_bnd_plt): Likewise.
723 (elf_x86_64_lazy_ibt_plt): Likewise.
724 (elf_x32_lazy_ibt_plt): Likewise.
725 (elf_x86_64_non_lazy_ibt_plt): Likewise.
726 (elf_x32_non_lazy_ibt_plt): Likewise.
727 (elf_x86_64_nacl_plt): Likewise.
728 (elf_x86_64_link_setup_gnu_properties): Updated. Call
729 _bfd_x86_elf_link_setup_gnu_properties.
730 * elfxx-x86.c: Include elf-vxworks.h".
731 (_bfd_x86_elf_link_setup_gnu_properties): New function.
732 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
733 comments for pic_plt0_entry and pic_plt_entry.
734 (elf_x86_non_lazy_plt_layout): Likewise.
735 (elf_x86_plt_layout_table): New.
736 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
738 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
741 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
742 .eh_frame section for the second PLT.
743 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
744 alignment of .eh_frame section for the second PLT.
746 2017-09-01 Nick Clifton <nickc@redhat.com>
749 * dwarf2.c (decode_line_info): Fix test for an overlong line info
752 2017-09-01 Nick Clifton <nickc@redhat.com>
755 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
756 attribute buffer is NUL terminated.
758 2017-08-31 Nick Clifton <nickc@redhat.com>
761 * dwarf2.c (read_section): If necessary add a terminating NUL byte
762 to dwarf string sections.
764 2017-08-31 Alan Modra <amodra@gmail.com>
766 * po/SRC-POTFILES.in: Regenerate.
768 2017-08-31 Alan Modra <amodra@gmail.com>
770 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
771 for a section containing just a terminator. Allow multiple
772 terminators at end of section.
773 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
774 sections when not adding alignment. Assert on terminator in
777 2017-08-31 Alan Modra <amodra@gmail.com>
781 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
784 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
786 * configure.ac (bfd_backends): Add elf64.lo together with
787 elfxx-x86.lo for 64-bit BFD.
788 * configure: Regenerated.
790 2017-08-31 James Bowman <james.bowman@ftdichip.com>
792 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
795 2017-08-31 Alan Modra <amodra@gmail.com>
798 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
799 before _close_and_cleanup. Call iovec->bclose after.
800 (bfd_close): Remove code common to, and call, bfd_close_all_done.
802 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
804 * elf32-i386.c (elf_i386_plt_type): Removed.
805 (elf_i386_plt): Likewise.
806 (elf_i386_get_synthetic_symtab): Updated. Call
807 _bfd_x86_elf_get_synthetic_symtab.
808 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
809 (elf_x86_64_plt): Likewise.
810 (elf_x86_64_get_synthetic_symtab): Updated. Call
811 _bfd_x86_elf_get_synthetic_symtab.
812 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
813 (elf_x86_64_get_plt_got_vma): Likewise.
814 (elf_i386_valid_plt_reloc_p): Likewise.
815 (elf_x86_64_valid_plt_reloc_p): Likewise.
816 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
817 * elfxx-x86.h (elf_x86_plt_type): New.
818 (elf_x86_plt): Likewise.
819 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
821 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
823 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
824 target_id instead of elf_machine_code.
826 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
828 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
829 (elf_i386_lazy_plt_layout): Likewise.
830 (elf_i386_non_lazy_plt_layout): Likewise.
831 (elf_i386_plt_layout): Likewise.
832 (elf_i386_link_hash_table): Likewise.
833 (elf_i386_next_tls_desc_index): Likewise.
834 (elf_i386_srelplt2): Likewise.
835 (elf_i386_plt): Likewise.
836 (elf_i386_lazy_plt): Likewise.
837 (elf_i386_non_lazy_plt): Likewise.
838 (elf_i386_link_hash_table_create): Likewise.
839 (bfd_elf32_bfd_link_hash_table_create): Likewise.
840 (elf_i386_lazy_plt): Updated.
841 (elf_i386_non_lazy_plt): Likewise.
842 (elf_i386_lazy_ibt_plt): Likewise.
843 (elf_i386_non_lazy_ibt_plt): Likewise.
844 (elf_i386_allocate_dynrelocs): Likewise.
845 (elf_i386_size_dynamic_sections): Likewise.
846 (elf_i386_relocate_section): Likewise.
847 (elf_i386_finish_dynamic_symbol): Likewise.
848 (elf_i386_finish_dynamic_sections): Likewise.
849 (elf_i386_get_synthetic_symtab): Likewise.
850 (elf_i386_link_setup_gnu_properties): Likewise.
851 (elf_i386_nacl_plt): Likewise.
852 * elf64-x86-64.c (ABI_64_P): Removed.
853 (ELF64_DYNAMIC_INTERPRETER): Likewise.
854 (ELF32_DYNAMIC_INTERPRETER): Likewise.
855 (elf_x86_64_lazy_plt_layout): Likewise.
856 (elf_x86_64_non_lazy_plt_layout): Likewise.
857 (elf_x86_64_plt_layout): Likewise.
858 (elf_x86_64_link_hash_table): Likewise.
859 (elf_x86_64_plt): Likewise.
860 (elf_x86_64_lazy_plt): Likewise.
861 (elf_x86_64_non_lazy_plt): Likewise.
862 (elf_x86_64_link_hash_table_create): Likewise.
863 (bfd_elf64_bfd_link_hash_table_create): Likewise.
864 (bfd_elf32_bfd_link_hash_table_create): Likewise.
865 (elf_x86_64_lazy_plt): Updated.
866 (elf_x86_64_non_lazy_plt): Likewise.
867 (elf_x86_64_lazy_bnd_plt): Likewise.
868 (elf_x86_64_non_lazy_bnd_plt): Likewise.
869 (elf_x86_64_lazy_ibt_plt): Likewise.
870 (elf_x32_lazy_ibt_plt): Likewise.
871 (elf_x86_64_non_lazy_ibt_plt): Likewise.
872 (elf_x32_non_lazy_ibt_plt): Likewise.
873 (elf_x86_64_allocate_dynrelocs): Likewise.
874 (elf_x86_64_size_dynamic_sections): Likewise.
875 (elf_x86_64_relocate_section): Likewise.
876 (elf_x86_64_finish_dynamic_symbol): Likewise.
877 (elf_x86_64_finish_dynamic_sections): Likewise.
878 (elf_x86_64_get_synthetic_symtab): Likewise.
879 (elf_x86_64_link_setup_gnu_properties): Likewise.
880 (elf_x86_64_nacl_plt): Likewise.
881 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
883 (ELF32_DYNAMIC_INTERPRETER): New.
884 (ELF64_DYNAMIC_INTERPRETER): Likewise.
885 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
886 (_bfd_x86_elf_link_hash_table_create): Likewise.
887 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
888 (elf_x86_link_hash_table_free): This. Make it static.
889 * elfxx-x86.h: Don't include "objalloc.h".
891 (elf_x86_lazy_plt_layout): Likewise.
892 (elf_x86_non_lazy_plt_layout): Likewise.
893 (elf_x86_plt_layout): Likewise.
894 (_bfd_x86_elf_link_hash_table_create): Likewise.
895 (bfd_elf64_bfd_link_hash_table_create): Likewise.
896 (bfd_elf32_bfd_link_hash_table_create): Likewise.
897 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
898 srelplt2 and next_tls_desc_index.
899 (_bfd_x86_elf_link_hash_table_free): Removed.
901 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
903 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
904 branch offset interpretation.
906 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
909 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
911 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
913 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
914 (elf_x86_64_srelplt2): Likewise.
916 2017-08-30 Alan Modra <amodra@gmail.com>
918 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
919 (ppc64_elf_tls_optimize): Set it.
920 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
921 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
922 addis would add zero.
923 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
924 (ppc_elf_tls_optimize): Set it.
925 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
926 insn on TPREL16_LO relocs to use r2 when addis would add zero.
928 2017-08-30 Alan Modra <amodra@gmail.com>
930 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
931 __tls_get_addr call sequences to LE, don't move the addi down
932 to the nop. Replace the bl with addi and leave the nop alone.
934 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
936 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
938 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
940 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
942 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
944 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
945 (BFD64_BACKENDS): Likewise.
946 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
947 (BFD64_BACKENDS_CFILES): Likewise.
948 * Makefile.in: Regenerated.
949 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
950 elf32-i386.lo and elf64-x86-64.lo.
951 * configure: Regenerated.
952 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
953 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
954 "objalloc.h" and "hashtab.h".
955 (ELIMINATE_COPY_RELOCS): Removed.
956 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
957 (SYMBOL_NO_COPYRELOC): Likewise.
958 (elf_i386_link_hash_entry): Likewise.
959 (GOT_UNKNOWN): Likewise.
960 (GOT_NORMAL): Likewise.
961 (GOT_TLS_GD): Likewise.
962 (elf_i386_hash_entry): Likewise.
963 (elf_i386_obj_tdata): Likewise.
964 (elf_i386_tdata): Likewise.
965 (elf_i386_local_got_tls_type): Likewise.
966 (elf_i386_local_tlsdesc_gotent): Likewise.
967 (elf_i386_hash_table): Likewise.
968 (elf_i386_link_hash_newfunc): Likewise.
969 (elf_i386_local_htab_hash): Likewise.
970 (elf_i386_local_htab_eq): Likewise.
971 (elf_i386_get_local_sym_hash): Likewise.
972 (elf_i386_link_hash_table_free): Likewise.
973 (elf_i386_copy_indirect_symbol): Likewise.
974 (elf_i386_fixup_symbol): Likewise.
975 (elf_i386_readonly_dynrelocs): Likewise.
976 (elf_i386_always_size_sections): Likewise.
977 (elf_i386_set_tls_module_base): Likewise.
978 (elf_i386_dtpoff_base): Likewise.
979 (compare_relocs): Likewise.
980 (elf_i386_hash_symbol): Likewise.
981 (elf_i386_parse_gnu_properties): Likewise.
982 (elf_i386_merge_gnu_properties): Likewise.
983 (elf_i386_link_check_relocs): Likewise.
984 (elf_i386_merge_symbol_attribute): Likewise.
985 (bfd_elf32_bfd_link_check_relocs): Likewise.
986 (elf_backend_copy_indirect_symbol): Likewise.
987 (elf_backend_always_size_sections): Likewise.
988 (elf_backend_omit_section_dynsym): Likewise.
989 (elf_backend_hash_symbol): Likewise.
990 (elf_backend_fixup_symbol): Likewise.
991 (elf_backend_parse_gnu_properties): Likewise.
992 (elf_backend_merge_gnu_properties): Likewise.
993 (elf_backend_merge_symbol_attribute): Likewise.
994 (elf_i386_mkobject): Updated.
995 (elf_i386_link_hash_table_create): Likewise.
996 (elf_i386_check_tls_transition): Likewise.
997 (elf_i386_tls_transition): Likewise.
998 (elf_i386_convert_load_reloc): Likewise.
999 (elf_i386_check_relocs): Likewise.
1000 (elf_i386_adjust_dynamic_symbol): Likewise.
1001 (elf_i386_allocate_dynrelocs): Likewise.
1002 (elf_i386_convert_load): Likewise.
1003 (elf_i386_size_dynamic_sections): Likewise.
1004 (elf_i386_relocate_section): Likewise.
1005 (elf_i386_finish_dynamic_symbol ): Likewise.
1006 (elf_i386_finish_dynamic_sections): Likewise.
1007 (elf_i386_output_arch_local_syms): Likewise.
1008 (elf_i386_get_synthetic_symtab): Likewise.
1009 (elf_i386_link_setup_gnu_properties): Likewise.
1010 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1011 of elf_link_hash_table, as base.
1012 (elf_i386_next_tls_desc_index): New.
1013 (elf_i386_srelplt2): Likewise.
1014 (elf_i386_plt): Likewise.
1015 (elf_i386_lazy_plt): Likewise.
1016 (elf_i386_non_lazy_plt): Likewise.
1017 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1018 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1019 "objalloc.h" and "hashtab.h".
1020 (ELIMINATE_COPY_RELOCS): Removed.
1021 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1022 (SYMBOL_NO_COPYRELOC): Likewise.
1023 (elf_x86_64_link_hash_entry): Likewise.
1024 (GOT_UNKNOWN): Likewise.
1025 (GOT_NORMAL): Likewise.
1026 (GOT_TLS_GD): Likewise.
1027 (elf_x86_64_hash_entry): Likewise.
1028 (elf_x86_64_obj_tdata): Likewise.
1029 (elf_x86_64_tdata): Likewise.
1030 (elf_x86_64_local_got_tls_type): Likewise.
1031 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1032 (elf_x86_64_hash_table): Likewise.
1033 (elf_x86_64_link_hash_newfunc): Likewise.
1034 (elf_x86_64_local_htab_hash): Likewise.
1035 (elf_x86_64_local_htab_eq): Likewise.
1036 (elf_x86_64_get_local_sym_hash): Likewise.
1037 (elf_x86_64_link_hash_table_free): Likewise.
1038 (elf_x86_64_copy_indirect_symbol): Likewise.
1039 (elf_x86_64_fixup_symbol): Likewise.
1040 (elf_x86_64_readonly_dynrelocs): Likewise.
1041 (elf_x86_64_always_size_sections): Likewise.
1042 (elf_x86_64_set_tls_module_base): Likewise.
1043 (elf_x86_64_dtpoff_base): Likewise.
1044 (compare_relocs): Likewise.
1045 (elf_x86_64_merge_symbol_attribute): Likewise.
1046 (elf_x86_64_hash_symbol): Likewise.
1047 (elf_x86_64_parse_gnu_properties): Likewise.
1048 (elf_x86_64_merge_gnu_properties): Likewise.
1049 (elf_x86_64_link_check_relocs): Likewise.
1050 (elf_backend_copy_indirect_symbol): Likewise.
1051 (elf_backend_always_size_sections): Likewise.
1052 (bfd_elf64_bfd_link_check_relocs): Likewise.
1053 (elf_backend_merge_symbol_attribute): Likewise.
1054 (elf_backend_hash_symbol): Likewise.
1055 (elf_backend_omit_section_dynsym): Likewise.
1056 (elf_backend_fixup_symbol): Likewise.
1057 (elf_backend_parse_gnu_properties): Likewise.
1058 (elf_backend_merge_gnu_properties): Likewise.
1059 (bfd_elf32_bfd_link_check_relocs): Likewise.
1060 (elf_x86_64_mkobject): Updated.
1061 (elf_x86_64_link_hash_table_create): Likewise.
1062 (elf_x86_64_check_tls_transition): Likewise.
1063 (elf_x86_64_tls_transition): Likewise.
1064 (elf_x86_64_convert_load_reloc): Likewise.
1065 (elf_x86_64_check_relocs): Likewise.
1066 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1067 (elf_x86_64_allocate_dynrelocs): Likewise.
1068 (elf_x86_64_convert_load): Likewise.
1069 (elf_x86_64_size_dynamic_sections): Likewise.
1070 (elf_x86_64_relocate_section): Likewise.
1071 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1072 (elf_x86_64_finish_dynamic_sections): Likewise.
1073 (elf_x86_64_output_arch_local_syms): Likewise.
1074 (elf_x86_64_get_synthetic_symtab): Likewise.
1075 (elf_x86_64_link_setup_gnu_properties): Likewise.
1076 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1077 instead of elf_link_hash_table, as base.
1078 (elf_x86_64_next_tls_desc_index): New.
1079 (elf_x86_64_srelplt2): Likewise.
1080 (elf_x86_64_plt): Likewise.
1081 (elf_x86_64_lazy_plt): Likewise.
1082 (elf_x86_64_non_lazy_plt): Likewise.
1083 * elfxx-x86.c: New file.
1084 * elfxx-x86.h: Likewise.
1086 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1088 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1090 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1092 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1094 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1095 sections before checking dynamic relocations and free invalid
1096 PLT section contents.
1097 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1099 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1101 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1102 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1104 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1107 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1109 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1111 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1113 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1115 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1117 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1120 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1121 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1122 Add a has_no_copy_on_protected bitfield.
1123 (elf_has_no_copy_on_protected): New.
1124 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1125 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1126 (elf_merge_gnu_property_list): Likewise.
1127 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1128 to FALSE for elf_has_no_copy_on_protected.
1129 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1130 (elf_i386_link_hash_entry): Add def_protected.
1131 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1132 when checking info->nocopyreloc.
1133 (elf_i386_link_setup_gnu_properties): Don't set
1134 extern_protected_data here.
1135 (elf_i386_merge_symbol_attribute): New function.
1136 (elf_backend_merge_symbol_attribute): New.
1137 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1138 (elf_x86_64_link_hash_entry): Add def_protected.
1139 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1140 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1141 when checking info->nocopyreloc.
1142 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1143 relocation run-time overflow and unresolvable R_X86_64_32S
1144 relocation against protected data symbol defined in shared object
1145 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1146 (elf_x86_64_link_setup_gnu_properties): Don't set
1147 extern_protected_data here.
1148 (elf_x86_64_merge_symbol_attribute): New function.
1149 (elf_backend_merge_symbol_attribute): New.
1151 2017-08-26 Alan Modra <amodra@gmail.com>
1153 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1154 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1155 (ppc_elf_relocate_section): Comment fix.
1156 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1157 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1158 Support dynamic relocs for TPREL16 when non-pic too.
1159 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1160 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1163 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1165 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1166 "symbol" in comments.
1167 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1169 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1172 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1173 R_X86_64_PC32 relocation run-time overflow and unresolvable
1174 R_X86_64_32S relocation with -z nocopyreloc.
1176 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1178 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1179 Undefined symbols may not have a type.
1180 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1182 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1184 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1185 bfd_link_info. Report shared, PIE or PDE object based on
1187 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1188 (elf_x86_64_relocate_section): Likewise.
1190 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1192 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1193 for function symbols.
1194 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1196 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1198 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1199 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1200 is set on any input relocatable file.
1201 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1203 2017-08-23 Alan Modra <amodra@gmail.com>
1206 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1207 ensure_undefweak_dynamic. Handle undefined too.
1208 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1209 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1210 (allocate_dynrelocs): Discard undefined non-default visibility
1211 relocs first. Make undefined syms dynamic. Tidy goto.
1213 2017-08-21 Alan Modra <amodra@gmail.com>
1214 H.J. Lu <hongjiu.lu@intel.com>
1217 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1218 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1220 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1223 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1224 undefined weak symbols.
1226 2017-08-18 Nick Clifton <nickc@redhat.com>
1229 * tekhex.c (getsym): Fix check for source pointer walking off the
1230 end of the input buffer.
1232 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1235 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1236 relocations in debug sections, change abort to _bfd_error_handler.
1238 2017-08-14 Nick Clifton <nickc@redhat.com>
1241 * elf.c (setup_group): Check for an empty or very small group
1243 * po/bfd.pot: Regenerate.
1245 2017-08-14 Alan Modra <amodra@gmail.com>
1248 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1249 alignment padding here.
1250 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1251 in a reverse pass over sections.
1253 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1256 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1257 for @plt suffixes first.
1258 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1260 2017-08-08 Nick Clifton <nickc@redhat.com>
1263 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1264 small section lengths.
1265 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1267 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1268 there is enough data present in the note.
1270 2017-08-08 Alan Modra <amodra@gmail.com>
1273 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1274 got.refcount for GOTOFF relocs, just create .got section.
1276 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1278 * elflink.c (elf_link_add_object_symbols): Move common symbol
1279 check after bed->common_definition.
1281 2017-08-07 Alan Modra <amodra@gmail.com>
1284 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1285 needed to define various dynamic tags have been discarded.
1287 2017-08-07 Nick Clifton <nickc@redhat.com>
1290 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1291 has not been set then use the bfd returned by
1292 _bfd_elf_link_setup_gnu_properties. If that is null then search
1293 through all the input bfds selecting the first normal, ELF format
1295 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1297 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1299 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1301 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1302 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1303 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1304 (elf_i386_link_check_relocs): New function.
1305 (bfd_elf32_bfd_link_check_relocs): New.
1306 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1308 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1309 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1310 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1311 (elf_x86_64_link_check_relocs): New function.
1312 (bfd_elf64_bfd_link_check_relocs): New.
1313 (bfd_elf32_bfd_link_check_relocs): Likewise.
1315 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1318 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1319 as undefined for --no-define-common.
1321 2017-08-05 Alan Modra <amodra@gmail.com>
1323 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1324 hppa_link_hash_table.
1326 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1328 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1329 entries for sysregs with negative indices.
1331 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1333 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1334 isn't the S/390 specific elf data.
1335 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1337 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1339 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1340 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1341 [R_RISCV_ADD16]: Likewise.
1342 [R_RISCV_ADD32]: Likewise.
1343 [R_RISCV_ADD64]: Likewise.
1344 [R_RISCV_SUB6]: Likewise.
1345 [R_RISCV_SUB8]: Likewise.
1346 [R_RISCV_SUB16]: Likewise.
1347 [R_RISCV_SUB32]: Likewise.
1348 [R_RISCV_SUB64]: Likewise.
1350 2017-07-31 Alan Modra <amodra@gmail.com>
1352 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1353 without ld.so checks.
1355 2017-07-29 Alan Modra <amodra@gmail.com>
1358 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1359 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1360 (is_elfv2_localentry0): Test non_zero_localentry.
1361 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1363 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1365 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1366 pointer check for htab->elf.irelplt.
1367 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1369 2017-07-27 Nick Clifton <nickc@redhat.com>
1372 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1374 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1376 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1378 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1380 (evax_bfd_print_emh): Check for invalid string lengths.
1382 2017-07-25 Nick Clifton <nickc@redhat.com>
1384 * po/fr.po: Updated French translation.
1386 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1389 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1390 16-bit absolute branches into 10-bit pc-relative branches on the
1391 MSP430 as well as the MSP430X.
1393 2017-07-25 Alan Modra <amodra@gmail.com>
1395 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1396 (stub_eh_frame_size): New function.
1397 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1398 (group_sections): Init group tls_get_addr_opt_bctrl.
1399 (ppc64_elf_size_stubs): Update sizing and initialization of
1400 .eh_frame. Iteration over stubs via group list.
1401 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1402 (ppc64_elf_finish_dynamic_sections): Update finalization of
1405 2017-07-24 Nick Clifton <nickc@redhat.com>
1408 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1409 of the relocs to the canonicalize_one_reloc routine.
1410 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1411 for the _bfd_mach_o_canonicalize_one_reloc field.
1412 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1413 res_base parameter. Use to check for corrupt pair relocs.
1414 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1416 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1418 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1421 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1422 enough data in the record before attempting to parse it.
1423 (_bfd_vms_slurp_eeom): Likewise.
1425 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1426 (image_set_ptr): Likewise.
1427 (alpha_vms_slurp_relocs): Likewise.
1429 (alpha_vms_object_p): Check for a truncated record.
1431 2017-07-24 Nick Clifton <nickc@redhat.com>
1434 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1435 an unrecognized reloc and sets the bfd_error value.
1436 * libbfd.h: Regenerate.
1437 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1439 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1440 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1441 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1442 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1443 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1445 2017-07-23 Alan Modra <amodra@gmail.com>
1447 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1450 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1453 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1454 reloc_class_ifunc for ifunc symbols.
1456 2017-07-19 Nick Clifton <nickc@redhat.com>
1459 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1460 correct magic bytes at the start, set the error to wrong format
1461 and clear the format selector before returning NULL.
1463 2017-07-19 Nick Clifton <nickc@redhat.com>
1466 * coff-rs6000.c (_bfd_strntol): New function.
1467 (_bfd_strntoll): New function.
1468 (GET_VALUE_IN_FIELD): New macro.
1469 (EQ_VALUE_IN_FIELD): new macro.
1470 (_bfd_xcoff_slurp_armap): Use new macros.
1471 (_bfd_xcoff_archive_p): Likewise.
1472 (_bfd_xcoff_read_ar_hdr): Likewise.
1473 (_bfd_xcoff_openr_next_archived_file): Likewise.
1474 (_bfd_xcoff_stat_arch_elt): Likewise.
1475 * coff64-rs6000.c (_bfd_strntol): New function.
1476 (_bfd_strntoll): New function.
1477 (GET_VALUE_IN_FIELD): New macro.
1478 (xcoff64_slurp_armap): Use new macros.
1480 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1481 John Eric Martin <John.Martin@emmicro-us.com>
1483 * bfd-in2.h: Regenerate.
1484 * libbfd.h: Regenerate.
1485 * elf32-arc.c (JLI): Define.
1486 * reloc.c: Add JLI relocations.
1488 2017-07-18 Nick Clifton <nickc@redhat.com>
1491 * coff-sh.c: Fix spelling typos.
1492 * compress.c: Likewise.
1493 * cpu-pdp11.c: Likewise.
1494 * ecofflink.c: Likewise.
1495 * elf-m10300.c: Likewise.
1497 * elf32-arm.c: Likewise.
1498 * elf32-m68k.c: Likewise.
1499 * elf32-nds32.c: Likewise.
1500 * elf32-ppc.c: Likewise.
1501 * elf32-sh.c: Likewise.
1502 * elf32-v850.c: Likewise.
1503 * elf64-ppc.c: Likewise.
1504 * elf64-x86-64.c: Likewise.
1505 * elflink.c: Likewise.
1506 * elfnn-aarch64.c: Likewise.
1507 * elfxx-mips.c: Likewise.
1509 * sunos.c: Likewise.
1510 * vms-alpha.c: Likewise.
1511 * xcofflink.c: Likewise.
1513 2017-07-18 Nick Clifton <nickc@redhat.com>
1516 * coffcode.h (handle_COMDAT): Replace abort with an error message
1519 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1522 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1525 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1527 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1529 2017-07-16 Alan Modra <amodra@gmail.com>
1531 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1532 __tls_index GOT entries when using __tls_get_addr_opt stub.
1533 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1535 2017-07-12 Alan Modra <amodra@gmail.com>
1537 * po/es.po: Update from translationproject.org/latest/bfd/.
1538 * po/fi.po: Likewise.
1539 * po/fr.po: Likewise.
1540 * po/id.po: Likewise.
1541 * po/ja.po: Likewise.
1542 * po/ro.po: Likewise.
1543 * po/ru.po: Likewise.
1544 * po/sr.po: Likewise.
1545 * po/sv.po: Likewise.
1546 * po/tr.po: Likewise.
1547 * po/uk.po: Likewise.
1548 * po/vi.po: Likewise.
1549 * po/zh_CN.po: Likewise.
1550 * po/hr.po: New file from translationproject.org.
1551 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1552 * configure: Regenerate.
1554 2017-07-12 Nick Clifton <nickc@redhat.com>
1556 Fix compile time warnings using gcc 7.1.1.
1557 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1559 (elf_xtensa_get_gotplt_section): Increase length of got_name
1561 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1562 default return of FALSE.
1563 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1564 default return of FALSE.
1566 2017-07-12 Alan Modra <amodra@gmail.com>
1568 * binary.c (binary_set_section_contents): Don't print filepos in
1570 (coff_write_object_contents): Cast size_t for error message.
1571 (coff_slurp_line_table): Don't use bfd_vma symndx.
1572 (coff_slurp_reloc_table): Remove unneeded cast.
1573 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1575 (find_abstract_instance_name): Likewise.
1576 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1577 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1578 (elf32_arm_check_relocs): Make r_symndx an int.
1579 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1581 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1583 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1585 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1586 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1587 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1588 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1589 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1590 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1591 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1592 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1593 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1594 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1595 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1596 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1597 and use %lu for error message.
1598 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1599 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1602 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1604 (elf32_arm_final_link_relocate): Likewise.
1605 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1606 * coffcode.h (styp_to_sec_flags): Likewise.
1607 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1608 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1609 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1610 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1611 (elf32_bfin_merge_private_bfd_data): Likewise.
1612 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1613 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1614 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1615 (i370_elf_relocate_section): Likewise.
1616 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1617 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1618 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1619 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1620 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1621 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1622 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1623 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1624 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1625 * ieee.c (ieee_write_id, read_id): Likewise.
1626 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1627 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1628 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1629 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1630 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1631 * stabs.c (_bfd_link_section_stabs): Likewise.
1633 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1635 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1636 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1637 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1638 * coff-sh.c (sh_relax_section): Likewise.
1639 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1640 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1641 * coffcode.h (coff_slurp_reloc_table): Likewise.
1642 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1643 (_bfd_coff_read_string_table): Likewise.
1644 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1645 * compress.c (bfd_get_full_section_contents): Likewise.
1646 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1647 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1648 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1649 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1650 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1651 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1652 (elf32_arm_write_section): Likewise.
1653 * elf32-bfin.c (bfin_relocate_section): Likewise.
1654 (bfinfdpic_relocate_section): Likewise.
1655 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1656 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1657 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1658 (elf_i386_relocate_section): Likewise.
1659 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1660 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1661 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1662 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1663 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1664 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1665 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1666 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1667 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1668 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1669 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1670 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1671 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1672 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1673 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1674 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1675 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1676 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1677 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1678 * elf32-sh.c (sh_elf_relax_section): Likewise.
1679 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1680 (sh_elf_relocate_section): Likewise.
1681 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1682 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1683 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1684 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1685 * elf32-v850.c (v850_elf_relax_section): Likewise.
1686 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1687 (elf_vax_relocate_section): Likewise.
1688 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1689 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1690 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1691 (do_fix_for_relocatable_link): Likewise.
1692 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1693 (elf64_alpha_relax_with_lituse): Likewise.
1694 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1695 (elf_hppa_final_link_relocate): Likewise.
1696 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1697 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1698 (elf64_vms_link_add_object_symbols): Likewise.
1699 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1700 (mmix_final_link_relocate): Likewise.
1701 * elf64-s390.c (invalid_tls_insn): Likewise.
1702 (elf_s390_relocate_section): Likewise.
1703 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1704 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1705 (elf_x86_64_relocate_section): Likewise.
1706 * elfcode.h (elf_slurp_symbol_table): Likewise.
1707 * elfcore.h (elf_core_file_p): Likewise.
1708 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1709 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1710 (elfNN_aarch64_relocate_section): Likewise.
1711 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1712 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1713 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1714 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1715 (_bfd_mips_elf_relocate_section): Likewise.
1716 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1717 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1718 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1719 * ieee.c (ieee_slurp_external_symbols): Likewise.
1720 * ihex.c (ihex_write_object_content): Likewise.
1721 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1722 * merge.c (_bfd_merged_section_offset): Likewise.
1723 * mmo.c (mmo_write_loc_chunk): Likewise.
1724 (mmo_write_object_contents): Likewise.
1725 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1726 * stabs.c (_bfd_link_section_stabs): Likewise.
1727 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1729 2017-07-11 Alan Modra <amodra@gmail.com>
1731 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1733 2017-07-11 Alan Modra <amodra@gmail.com>
1735 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1736 instruction" error using _bfd_error_handler, not einfo.
1738 2017-07-10 Nick Clifton <nickc@redhat.com>
1740 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1741 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1743 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1745 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1747 2017-07-07 Alan Modra <amodra@gmail.com>
1749 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1751 2017-07-07 Alan Modra <amodra@gmail.com>
1753 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1754 as long long. Move code replacing "ll" with "I64", and simplify.
1756 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1758 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1761 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1763 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1765 (line_info_add_file_name): Likewise.
1766 (decode_line_info): Likewise.
1768 2017-07-04 Tristan Gingold <gingold@adacore.com>
1770 * version.m4: Bump version to 2.29.51
1771 * configure: Regenerate.
1773 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1775 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1776 sanity check at the head of this function.
1778 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1780 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1781 dwarf_line_str_size.
1782 (struct attr_abbrev): Add field implicit_const.
1783 (dwarf_debug_sections): Add .debug_line_str.
1784 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1785 (dwarf_debug_section_assert): Add static assertion.
1786 (read_indirect_line_string): New.
1787 (read_abbrevs): Support DW_FORM_implicit_const.
1788 (is_str_attr): Support DW_FORM_line_strp.
1789 (read_attribute_value): Support DW_FORM_line_strp and
1790 DW_FORM_implicit_const.
1791 (read_attribute): Support DW_FORM_implicit_const.
1792 (line_info_add_include_dir, line_info_add_include_dir_stub):
1793 (line_info_add_file_name, read_formatted_entries): New.
1794 (decode_line_info, parse_comp_unit): Support DWARF 5.
1795 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1797 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1799 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1800 abort statement that was put for symbols that are not dynamic.
1802 2017-07-03 Tristan Gingold <gingold@adacore.com>
1804 * po/bfd.pot: Regenerate
1806 2017-07-03 Alan Modra <amodra@gmail.com>
1808 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1809 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1810 * elf.c (setup_group): Use "Lx" to print sh_size.
1811 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1812 unknown section type in hex.
1813 (copy_special_section_fields): Style fix.
1814 (bfd_section_from_shdr): Correct format for sh_link. Use a
1815 common error message for all the variants of unrecognized
1817 (assign_file_positions_for_load_sections): Use "Lx" for lma
1818 adjust error message.
1819 (assign_file_positions_for_non_load_sections): Formatting.
1820 (rewrite_elf_program_header): Formatting. Use "Lx" for
1821 bfd_vma values in error messages.
1822 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1823 ELF_R_SYM value to type expected by format.
1824 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1826 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1827 (elf_link_input_bfd): Use "Lx" for r_info.
1828 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1830 2017-07-03 Alan Modra <amodra@gmail.com>
1832 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1833 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1834 Microsoft C library variant of long long format specifier.
1835 (PRINT20): Cast value to bfd_uint64_t not long long.
1836 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1837 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1838 long long. Don't cast to bfd_vma.
1839 * elf32-score.c (score3_bfd_getl48): Likewise.
1840 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1842 2017-07-03 Alan Modra <amodra@gmail.com>
1844 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1846 (bfd_elf_print_symbol): Don't cast symbol->flags.
1847 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1848 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1849 _bfd_error_handler argument order.
1850 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1852 2017-07-03 Alan Modra <amodra@gmail.com>
1854 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1855 AC_TYPE_LONG_DOUBLE.
1856 * configure: Regenerate.
1857 * config.in: Regenerate.
1859 2017-06-29 Andrew Waterman <andrew@sifive.com>
1861 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1864 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1866 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1867 unless it is undefined weak.
1868 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1869 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1871 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1872 is not dynamic in PIC, abort.
1874 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1877 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1878 undefined weak symbols into dynamic.
1879 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1880 relocation for non-dynamic symbols.
1881 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1883 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1885 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1886 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1887 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1888 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1889 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1892 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1894 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1895 (elfcore_write_s390_gs_bc): Likewise.
1896 * elf.c (elfcore_grok_s390_gs_cb): New function.
1897 (elfcore_grok_s390_gs_bc): New function.
1898 (elfcore_grok_note): Call them.
1899 (elfcore_write_s390_gs_cb): New function.
1900 (elfcore_write_s390_gs_bc): New function.
1901 (elfcore_write_register_note): Call them.
1903 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1905 * libbfd.c (_bfd_generic_get_section_contents): Don't call
1906 bfd_get_file_size. Check archive element size.
1907 (_bfd_generic_get_section_contents_in_window): Likewise.
1909 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
1911 * bfd-in2.h: Regenerated.
1912 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1913 (bfd_get_file_size): Likewise.
1915 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
1916 Matthew Fortune <matthew.fortune@imgtec.com>
1918 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1919 * cpu-mips.c (I_interaptiv_mr2): New enum value.
1920 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1921 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1923 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1924 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1925 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1926 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1927 `bfd_mach_mips_interaptiv_mr2' entries.
1928 * bfd-in2.h: Regenerate.
1930 2017-06-27 Nick Clifton <nickc@redhat.com>
1932 * tekhex.c (pass_over): Revert accidental conversion of a local
1933 array to a static array.
1935 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
1938 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1939 reloc addend if necessary. Adjust diff only if
1940 shrinked_insn_address < end_address.
1942 2017-06-27 Alan Modra <amodra@gmail.com>
1945 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1946 (_bfd_generic_get_section_contents_in_window): Likewise.
1948 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
1950 * elfnn-riscv.c (perform_relocation): Support the new
1951 R_RISCV_32_PCREL relocation.
1952 (riscv_elf_relocate_section): Likewise.
1953 * elfxx-riscv.c (howto_table): Likewise.
1954 (riscv_reloc_map): Likewise.
1955 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1956 * libbfd.h: Regenerate.
1958 2017-06-27 Alan Modra <amodra@gmail.com>
1961 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1962 Use unsigned file pointer type, and remove cast.
1963 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1964 Add "count", not "sz".
1966 2017-06-26 Pedro Alves <palves@redhat.com>
1969 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1972 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1975 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1978 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
1980 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1981 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1982 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1983 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1984 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1986 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
1989 * compress.c (bfd_get_full_section_contents): Don't check the
1991 * libbfd.c (_bfd_generic_get_section_contents): Check for and
1992 reject a section whose size + offset is greater than the size
1994 (_bfd_generic_get_section_contents_in_window): Likewise.
1996 2017-06-26 Nick Clifton <nickc@redhat.com>
1999 * tekhex.c (getvalue): Check for the source pointer exceeding the
2000 end pointer before the first byte is read.
2002 2017-06-26 Nick Clifton <nickc@redhat.com>
2005 * opncls.c (get_build_id): Check that the section is big enough
2006 to contain the whole note.
2007 * compress.c (bfd_get_full_section_contents): Check for and reject
2008 a section whose size is greater than the size of the entire file.
2009 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2010 contain a notes section.
2012 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2014 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2016 (elf_s390_modify_segment_map): Likewise.
2017 (bfd_elf_s390_set_options): Lisewise.
2019 2017-06-26 Alan Modra <amodra@gmail.com>
2021 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2023 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2024 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2025 .preinit_array on --just-syms bfds.
2026 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2027 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2028 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2030 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2032 * elf.c (find_link): Bounds check "hint".
2034 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2036 * elf32-arm.c (using_thumb_only): Update list of architectures in
2037 BFD_ASSERT for which the logic is valid.
2038 (using_thumb2_bl): Likewise.
2039 (using_thumb2): Likewise and return true for ARMv8-R.
2040 (arch_has_arm_nop): Likewise.
2041 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2042 merging logic. Update commentis for value 15 of v8m_baseline,
2043 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2044 merging of value 15 of Tag_CPU_arch.
2046 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2048 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2049 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2050 * bfd-in2.h: Regenerate.
2052 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2054 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2055 the error_alignment label forward. Properly align program
2056 property note section.
2058 2017-06-22 Eric Christopher <echristo@gmail.com>
2060 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2061 abs to fix a truncation warning.
2063 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2065 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2066 local undefined weak symbol to 0.
2067 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2069 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2071 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2072 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2073 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2074 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2075 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2076 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2077 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2078 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2080 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2082 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2083 (elf_i386_lazy_ibt_plt_entry): Likewise.
2084 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2085 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2086 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2087 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2088 (elf_i386_lazy_plt_layout): Likewise.
2089 (elf_i386_non_lazy_plt_layout): Likewise.
2090 (elf_i386_link_hash_entry): Add plt_second.
2091 (elf_i386_link_hash_table): Add plt_second and
2092 plt_second_eh_frame.
2093 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2094 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2095 the second PLT. Check the second PLT.
2096 (elf_i386_relocate_section): Use the second PLT to resolve
2097 PLT reference if needed.
2098 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2100 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2101 second PLT. Generate unwind info for the second PLT.
2102 (elf_i386_plt_type): Add plt_second.
2103 (elf_i386_get_synthetic_symtab): Support the second PLT.
2104 (elf_i386_parse_gnu_properties): Support
2105 GNU_PROPERTY_X86_FEATURE_1_AND.
2106 (elf_i386_merge_gnu_properties): Support
2107 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2108 on GNU_PROPERTY_X86_FEATURE_1_IBT
2109 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2110 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2111 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2112 is set on all relocatable inputs.
2113 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2114 (elf_x32_lazy_ibt_plt_entry): Likewise.
2115 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2116 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2117 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2118 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2119 (elf_x86_64_lazy_ibt_plt): Likewise.
2120 (elf_x32_lazy_ibt_plt): Likewise.
2121 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2122 (elf_x32_non_lazy_ibt_plt): Likewise.
2123 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2124 (elf_x86_64_parse_gnu_properties): Support
2125 GNU_PROPERTY_X86_FEATURE_1_AND.
2126 (elf_x86_64_merge_gnu_properties): Support
2127 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2128 on GNU_PROPERTY_X86_FEATURE_1_IBT
2129 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2130 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2131 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2132 is set on all relocatable inputs.
2134 2017-06-22 Nick Clifton <nickc@redhat.com>
2137 * som.c (setup_sections): NUL terminate the space_strings buffer.
2138 Check that the space.name field does not index beyond the end of
2139 the space_strings buffer.
2141 2017-06-21 Nick Clifton <nickc@redhat.com>
2144 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2146 2017-06-21 Nick Clifton <nickc@redhat.com>
2149 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2150 type of the size parameter.
2151 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2152 length of the counted string.
2153 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2154 (_bfd_vms_save_counted_string): Likewise.
2155 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2156 _bfd_vms_save_counted_string.
2157 (_bfd_vms_slurp_ehdr): Likewise.
2158 (_bfd_vms_slurp_egsd): Likewise.
2159 (Parse_module): Likewise.
2161 2017-06-21 Alan Modra <amodra@gmail.com>
2163 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2164 calls before tocsave calls.
2165 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2168 2017-06-21 Nick Clifton <nickc@redhat.com>
2171 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2172 bfd_get_full_section_contents returns no contents.
2174 2017-06-21 Nick Clifton <nickc@redhat.com>
2177 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2180 2017-06-21 Nick Clifton <nickc@redhat.com>
2183 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2185 (image_set_ptr): Likewise.
2186 (alpha_vms_fix_sec_rel): Likewise.
2187 (alpha_vms_slurp_relocs): Likewise.
2189 2017-06-21 Nick Clifton <nickc@redhat.com>
2192 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2194 (ieee_archive_p): Likewise.
2195 (ieee_object_p): Likewise.
2197 2017-06-21 Nick Clifton <nickc@redhat.com>
2200 * elf.c (setup_group): Zero the group section pointer list after
2201 allocation so that loops can be caught. Check for NULL pointers
2202 when processing a group list.
2204 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2206 * elf-s390.h: New file.
2207 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2209 (elf_s390_additional_program_headers): New function.
2210 (elf_s390_modify_segment_map): New function.
2211 (bfd_elf_s390_set_options): New function.
2212 (elf_backend_additional_program_headers)
2213 (elf_backend_modify_segment_map): Add macro definitions.
2215 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2218 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2219 the DYNAMIC bit instead of bfd_count_sections.
2221 2017-06-19 Nick Clifton <nickc@redhat.com>
2224 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2226 (evax_bfd_print_eeom): Likewise.
2227 (evax_bfd_print_egsd): Check for an overlarge record length.
2228 (evax_bfd_print_etir): Likewise.
2230 2017-06-19 Nick Clifton <nickc@redhat.com>
2233 * libieee.h (struct common_header_type): Add end_p field.
2234 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2236 (read_id): Check for a length that exceeds the remaining bytes in
2238 (ieee_seek): Initialise end_p.
2239 (ieee_archive_p): Likewise.
2240 (ieee_object_p): Likewise.
2242 2017-06-19 Nick Clifton <nickc@redhat.com>
2245 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2246 before reading the EIHS structure entries.
2248 2017-06-19 Nick Clifton <nickc@redhat.com>
2251 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2252 gsd_size. Check that there are enough bytes remaining to read the
2253 type and size of the next egsd. Check that the size of the egsd
2254 does not exceed the size of the record.
2256 2017-06-19 Alan Modra <amodra@gmail.com>
2258 * config.bfd: Correct targ_underscore for cris.
2260 2017-06-18 Alan Modra <amodra@gmail.com>
2262 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2263 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2265 2017-06-16 Nick Clifton <nickc@redhat.com>
2267 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2268 bucketlist is empty because there are no symbols to add to the
2271 2017-06-16 Alan Modra <amodra@gmail.com>
2277 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2278 (BFD_JUMP_TABLE_LINK): Likewise.
2279 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2280 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2281 (bfd_elf_define_start_stop): New function.
2282 * linker.c (bfd_generic_define_start_stop): New function.
2283 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2285 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2286 * aout-target.h (MY_bfd_define_start_stop): Define.
2287 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2288 * binary.c (binary_bfd_define_start_stop): Define.
2289 * bout.c (b_out_bfd_define_start_stop): Define.
2290 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2291 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2292 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2293 * coffcode.h (coff_bfd_define_start_stop): Define.
2294 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2295 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2296 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2297 * ieee.c (ieee_bfd_define_start_stop): Define.
2298 * ihex.c (ihex_bfd_define_start_stop): Define.
2299 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2300 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2301 * mmo.c (mmo_bfd_define_start_stop): Define.
2302 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2303 * oasys.c (oasys_bfd_define_start_stop): Define.
2304 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2305 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2306 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2307 * som.c (som_bfd_define_start_stop): Define.
2308 * srec.c (srec_bfd_define_start_stop): Define.
2309 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2310 * versados.c (versados_bfd_define_start_stop): Define.
2311 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2312 (alpha_vms_bfd_define_start_stop): Define.
2313 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2314 * bfd-in2.h: Regenerate.
2315 * libbfd.h: Regenerate.
2317 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2319 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2320 SYMBOL_REFERENCES_LOCAL.
2322 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2325 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2326 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2327 runtime for if there needs copy relocation elimination.
2328 (need_copy_relocation_p): New function. Return true for symbol with
2329 pc-relative references and if it's against read-only sections.
2330 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2331 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2332 that are related with accessing external objects.
2333 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2334 in elfNN_aarch64_check_relocs.
2336 2017-06-15 Nick Clifton <nickc@redhat.com>
2339 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2342 (ieee_archive_p): Likewise.
2344 2017-06-15 Nick Clifton <nickc@redhat.com>
2347 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2349 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2351 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2352 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2353 keep both windowed and call0 ABI PLT definitions.
2354 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2355 elf_xtensa_*_plt_entry endex.
2356 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2358 2017-06-14 Nick Clifton <nickc@redhat.com>
2361 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2364 2017-06-14 Nick Clifton <nickc@redhat.com>
2367 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2368 maximum value for the ascic pointer. Check that name processing
2369 does not read beyond this value.
2370 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2373 2017-06-14 Nick Clifton <nickc@redhat.com>
2376 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2377 (process_otr): Check for an invalid offset in the otr structure.
2379 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2381 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2383 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2389 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2390 vtable field to a union.
2391 (_bfd_elf_is_start_stop): Removed.
2392 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2393 __start_SECNAME and __stop_SECNAME symbols.
2394 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2395 * elflink.c (_bfd_elf_is_start_stop): Removed.
2396 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2397 _bfd_elf_is_start_stop.
2398 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2399 __stop_SECNAME symbols. Updated.
2400 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2401 (bfd_elf_gc_record_vtinherit): Likewise.
2402 (bfd_elf_gc_record_vtentry): Likewise.
2404 2017-06-13 Nick Clifton <nickc@redhat.com>
2407 * elflink.c (elf_link_adjust_relocs): Generate an error when
2408 encountering a reloc against a symbol removed by garbage
2411 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2413 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2414 to merge_gnu_properties.
2415 * elf-properties.c (elf_merge_gnu_properties): Add struct
2416 bfd_link_info * and pass it to merge_gnu_properties.
2417 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2418 and pass it to elf_merge_gnu_properties.
2419 (_bfd_elf_link_setup_gnu_properties): Pass info to
2420 elf_merge_gnu_property_list.
2421 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2423 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2425 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2428 * binary.c (binary_set_section_contents): Scale lma by octets
2429 per byte to set filepos.
2431 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2433 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2436 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2438 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2441 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2443 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2444 patched section contents for TLS IE reloc.
2445 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2447 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2449 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2450 RELOC_FOR_GLOBAL_SYMBOL macro.
2452 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2454 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2457 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2459 * config/tc-arc.c (md_undefined_symbol): Changed.
2460 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2462 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2464 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2467 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2469 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2470 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2472 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2474 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2477 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2479 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2480 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2481 is non-zero. Add clarifying comments.
2483 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2485 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2486 name. Use local IFUNC symbol name string to report unsupported
2487 non-PIC call to IFUNC function.
2488 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2489 when generating R_386_IRELATIVE relocation.
2490 (elf_i386_finish_dynamic_symbol): Likewise.
2491 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2493 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2494 when generating R_X86_64_IRELATIVE relocation.
2495 (elf_x86_64_finish_dynamic_symbol): Likewise.
2497 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2499 * elf.c (setup_group): Make sure BFD sections are created for all
2500 group sections in the input file when processing SHF_GROUP
2502 (bfd_section_from_shdr): Avoid duplicating logic already
2503 implemented in `setup_group'.
2505 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2508 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2509 if the hint address is zero.
2511 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2514 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2515 ELF_COMMON_DEF_P for common symbols.
2517 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2519 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2520 SEC_GROUP sections as SEC_EXCLUDE.
2521 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2522 (assign_section_numbers): Use resolve_section_groups flag instead
2523 of relocatable link type.
2524 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2525 flag instead of checking the final_link flag for part of the
2526 checks in here. Fix white space as a result.
2527 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2528 instead of relocatable link type.
2529 (bfd_elf_final_link): Likewise.
2531 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2533 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2535 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2536 (s3_bfd_score_elf_check_relocs): Likewise.
2537 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2538 (score_elf_final_link_relocate): Likewise.
2539 (s7_bfd_score_elf_check_relocs): Likewise.
2541 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2543 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2546 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2548 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2549 from `reloc_count' rather than decrementing it.
2550 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2551 `reloc_count' by `int_rels_per_ext_rel'.
2552 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2553 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2554 entry determination.
2555 (s3_bfd_score_elf_check_relocs): Likewise.
2556 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2557 (s7_bfd_score_elf_relocate_section): Likewise.
2558 (s7_bfd_score_elf_check_relocs): Likewise.
2559 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2560 prototype and function.
2561 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2562 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2563 triple rather than once the sum of REL and RELA relocation entry
2565 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2566 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2567 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2568 storage allocation size determination.
2569 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2570 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2571 by `int_rels_per_ext_rel' for last relocation entry
2573 (bfd_elf_final_link): Do not multiply `reloc_count' by
2574 `int_rels_per_ext_rel' for internal relocation storage
2575 allocation size determination.
2576 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2577 `int_rels_per_ext_rel' for last relocation entry determination.
2578 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2579 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2580 (_bfd_mips_elf_relocate_section): Likewise.
2582 2017-06-05 Alan Modra <amodra@gmail.com>
2585 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2587 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2589 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2590 determine structure sizes.
2591 (elfcore_grok_freebsd_prstatus): Likewise.
2593 2017-06-01 Alan Modra <amodra@gmail.com>
2595 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2596 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2598 (is_elfv2_localentry0): New function.
2599 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2600 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2601 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2602 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2603 optimized localentry:0 stubs.
2604 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2605 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2607 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2609 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2611 2017-05-30 Casey Smith <clegg89@gmail.com>
2614 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2615 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2617 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2619 * cpu-arc.c (arc_compatible): New function.
2621 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2623 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2625 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2628 * bfdio.c (bfd_get_file_size): New function.
2629 * bfd-in2.h: Regenerated.
2631 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2633 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2636 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2638 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2639 dynobj instead of htab->elf.dynobj.
2641 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2643 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2645 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2646 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2647 actual number of internal relocations retrieved. Adjust
2648 function description.
2649 (bfd_elf64_canonicalize_reloc): Remove macro.
2650 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2652 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2654 * archures.c (bfd_mach_sparc_v9m8): Define.
2655 (bfd_mach_sparc_v8plusm8): Likewise.
2656 (bfd_mach_sparc_v9_p): Adjust to M8.
2657 (bfd_mach_sparc_64bit_p): Likewise.
2658 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2659 bfd_mach_sparc_v8plusm8.
2660 * bfd-in2.h: Regenerated.
2661 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2663 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2664 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2665 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2667 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2668 bfd_mach_sparc_v8plusm8.
2670 2017-05-19 Alan Modra <amodra@gmail.com>
2672 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2673 debug and special sections when no non-note alloc sections in an
2676 2017-05-18 Alan Modra <amodra@gmail.com>
2678 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2679 * elf-m10300.c: Likewise.
2681 * elf32-arc.c: Likewise.
2682 * elf32-bfin.c: Likewise.
2683 * elf32-m68k.c: Likewise.
2684 * elf32-nds32.c: Likewise.
2685 * elf32-tilepro.c: Likewise.
2686 * elflink.c: Likewise.
2687 * elfnn-aarch64.c: Likewise.
2688 * elfnn-riscv.c: Likewise.
2689 * elfxx-tilegx.c: Likewise.
2690 * mach-o.c: Likewise.
2691 * peXXigen.c: Likewise.
2692 * vms-alpha.c: Likewise.
2693 * vms-lib.c: Likewise.
2695 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2698 * elflink.c (elf_gc_mark_debug_section): New function.
2699 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2700 referenced by kept debug sections.
2702 2017-05-16 Alan Modra <amodra@gmail.com>
2704 * elf-m10300.c: Rename occurrences of non_ir_ref.
2705 * elf32-arm.c: Likewise.
2706 * elf32-bfin.c: Likewise.
2707 * elf32-cr16.c: Likewise.
2708 * elf32-cris.c: Likewise.
2709 * elf32-d10v.c: Likewise.
2710 * elf32-dlx.c: Likewise.
2711 * elf32-fr30.c: Likewise.
2712 * elf32-frv.c: Likewise.
2713 * elf32-hppa.c: Likewise.
2714 * elf32-i370.c: Likewise.
2715 * elf32-i386.c: Likewise.
2716 * elf32-iq2000.c: Likewise.
2717 * elf32-lm32.c: Likewise.
2718 * elf32-m32c.c: Likewise.
2719 * elf32-m32r.c: Likewise.
2720 * elf32-m68hc1x.c: Likewise.
2721 * elf32-m68k.c: Likewise.
2722 * elf32-mcore.c: Likewise.
2723 * elf32-metag.c: Likewise.
2724 * elf32-microblaze.c: Likewise.
2725 * elf32-moxie.c: Likewise.
2726 * elf32-msp430.c: Likewise.
2727 * elf32-mt.c: Likewise.
2728 * elf32-nios2.c: Likewise.
2729 * elf32-or1k.c: Likewise.
2730 * elf32-ppc.c: Likewise.
2731 * elf32-rl78.c: Likewise.
2732 * elf32-s390.c: Likewise.
2733 * elf32-score.c: Likewise.
2734 * elf32-score7.c: Likewise.
2735 * elf32-sh.c: Likewise.
2736 * elf32-tic6x.c: Likewise.
2737 * elf32-tilepro.c: Likewise.
2738 * elf32-v850.c: Likewise.
2739 * elf32-vax.c: Likewise.
2740 * elf32-xstormy16.c: Likewise.
2741 * elf32-xtensa.c: Likewise.
2742 * elf64-alpha.c: Likewise.
2743 * elf64-hppa.c: Likewise.
2744 * elf64-ia64-vms.c: Likewise.
2745 * elf64-mmix.c: Likewise.
2746 * elf64-ppc.c: Likewise.
2747 * elf64-s390.c: Likewise.
2748 * elf64-sh64.c: Likewise.
2749 * elf64-x86-64.c: Likewise.
2750 * elflink.c: Likewise.
2751 * elfnn-aarch64.c: Likewise.
2752 * elfnn-ia64.c: Likewise.
2753 * elfnn-riscv.c: Likewise.
2754 * elfxx-mips.c: Likewise.
2755 * elfxx-sparc.c: Likewise.
2756 * elfxx-tilegx.c: Likewise.
2757 * linker.c: Likewise.
2759 2017-05-16 Alan Modra <amodra@gmail.com>
2761 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2762 * elflink.c (elf_link_add_object_symbols): Update to use
2764 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2766 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2768 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2770 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2772 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2774 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2775 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2777 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2779 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2781 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2783 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2784 to plt_second/plt_second_eh_frame.
2785 (elf_x86_64_link_hash_newfunc): Updated.
2786 (elf_x86_64_allocate_dynrelocs): Likewise.
2787 (elf_x86_64_size_dynamic_sections): Likewise.
2788 (elf_x86_64_relocate_section): Likewise.
2789 (elf_x86_64_finish_dynamic_symbol): Likewise.
2790 (elf_x86_64_finish_dynamic_sections): Likewise.
2791 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2792 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2794 (elf_backend_setup_gnu_properties): Updated. Create the
2795 .plt.sec section instead of the .plt.sec section.
2797 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2799 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2800 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2801 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2803 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2805 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2806 (bfd_elf64_set_reloc): Define.
2807 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2809 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2811 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2812 (struct bfd_target): New field _bfd_set_reloc.
2813 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2814 * reloc.c (_bfd_generic_set_reloc): New function.
2815 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2816 * nlm-target.h (nlm_set_reloc): Likewise.
2817 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2818 * aout-tic30.c (MY_set_reloc): Likewise.
2819 * aout-target.h (MY_set_reloc): Likewise.
2820 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2821 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2822 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2823 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2824 * aout-adobe.c (aout_32_set_reloc): Likewise.
2825 * bout.c (b_out_set_reloc): Likewise.
2826 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2827 * i386os9k.c (aout_32_set_reloc): Likewise.
2828 * ieee.c (ieee_set_reloc): Likewise.
2829 * oasys.c (oasys_set_reloc): Likewise.
2830 * som.c (som_set_reloc): Likewise.
2831 * versados.c (versados_set_reloc): Likewise.
2832 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2833 _bfd_generic_set_reloc.
2834 (rs6000_xcoff64_aix_vec): LIkewise.
2835 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2836 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2837 * i386msdos.c (msdos_set_reloc): Define to
2838 _bfd_norelocs_set_reloc.
2839 * elfcode.h (elf_set_reloc): Define.
2840 * bfd-in2.h: Regenerated.
2842 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2845 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2846 for IFUNC function address.
2848 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2850 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2851 (CONFLICT_LIST): Likewise.
2852 (opcode/arc-attrs.h): Include.
2853 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2854 (arc_extract_features): New file.
2855 (arc_stralloc): Likewise.
2856 (arc_elf_merge_attributes): Likewise.
2857 (arc_elf_merge_private_bfd_data): Use object attributes.
2858 (bfd_arc_get_mach_from_attributes): New function.
2859 (arc_elf_object_p): Use object attributes.
2860 (arc_elf_final_write_processing): Likewise.
2861 (elf32_arc_obj_attrs_arg_type): New function.
2862 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2863 (elf32_arc_section_from_shdr): Likewise.
2864 (elf_backend_obj_attrs_vendor): Define.
2865 (elf_backend_obj_attrs_section): Likewise.
2866 (elf_backend_obj_attrs_arg_type): Likewise.
2867 (elf_backend_obj_attrs_section_type): Likewise.
2868 (elf_backend_obj_attrs_handle_unknown): Likewise.
2869 (elf_backend_section_from_shdr): Likewise.
2871 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2874 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2875 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2876 and the destination is a Thumb symbol.
2878 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2880 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2881 initializer to silence GCC 4.2.
2882 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2884 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2886 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2887 (LAZY_PLT_ENTRY_SIZE): This.
2888 (NON_LAZY_PLT_ENTRY_SIZE): New.
2889 (elf_x86_64_plt0_entry): Renamed to ...
2890 (elf_x86_64_lazy_plt0_entry): This.
2891 (elf_x86_64_plt_entry): Renamed to ...
2892 (elf_x86_64_lazy_plt_entry): This.
2893 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2894 (elf_x86_64_lazy_bnd_plt0_entry): This.
2895 (elf_x86_64_legacy_plt_entry): Removed.
2896 (elf_x86_64_bnd_plt_entry): Renamed to ...
2897 (elf_x86_64_lazy_bnd_plt_entry): This.
2898 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2899 (elf_x86_64_non_lazy_plt_entry): This.
2900 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2901 (elf_x86_64_non_lazy_bnd_plt_entry): This.
2902 (elf_x86_64_eh_frame_plt): Renamed to ...
2903 (elf_x86_64_eh_frame_lazy_plt): This.
2904 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2905 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2906 (elf_x86_64_eh_frame_plt_got): Renamed to ...
2907 (elf_x86_64_eh_frame_non_lazy_plt): This.
2908 (elf_x86_64_lazy_plt_layout): New.
2909 (elf_x86_64_non_lazy_plt_layout): Likewise.
2910 (elf_x86_64_plt_layout): Likewise.
2911 (elf_x86_64_backend_data): Remove PLT layout information. Add
2912 os for target system.
2913 (GET_PLT_ENTRY_SIZE): Removed.
2914 (elf_x86_64_lazy_plt): New.
2915 (elf_x86_64_non_lazy_plt): Likewise.
2916 (elf_x86_64_lazy_bnd_plt): Likewise.
2917 (elf_x86_64_non_lazy_bnd_plt): Likewise.
2918 (elf_x86-64_arch_bed): Updated.
2919 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2920 (elf_x86_64_create_dynamic_sections): Removed.
2921 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
2922 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2923 (elf_x86-64_adjust_dynamic_symbol): Updated.
2924 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
2925 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2926 size for PLT0 if there is no PLT0. Get plt_entry_size from
2927 non_lazy_plt for non-lazy PLT entries.
2928 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
2929 from non_lazy_plt for non-lazy PLT entries.
2930 (elf_x86-64_relocate_section): Updated. Properly get PLT index
2931 if there is no PLT0.
2932 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
2933 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
2934 entries with non-lazy PLT layout. Don't fill the second and third
2935 slots in the PLT entry if there is no PLT0.
2936 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
2937 if there is no PLT0. Set sh_entsize on the .plt.got section.
2938 (compare_relocs): New.
2939 (elf_x86_64_plt_type): Likewise.
2940 (elf_x86_64_plt): Likewise.
2941 (elf_x86_64_nacl_plt): New. Forward declaration.
2942 (elf_x86_64_get_plt_sym_val): Removed.
2943 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2944 against all dynamic relocations.
2945 (elf_x86_64_link_setup_gnu_properties): New function.
2946 (elf_backend_create_dynamic_sections): Updated.
2947 (elf_backend_setup_gnu_properties): New.
2948 (elf_x86_64_nacl_plt): New.
2949 (elf_x86_64_nacl_arch_bed): Updated.
2951 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2953 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2954 (LAZY_PLT_ENTRY_SIZE): This.
2955 (NON_LAZY_PLT_ENTRY_SIZE): New.
2956 (elf_i386_plt0_entry): Renamed to ...
2957 (elf_i386_lazy_plt0_entry): This.
2958 (elf_i386_plt_entry): Renamed to ...
2959 (elf_i386_lazy_plt_entry): This.
2960 (elf_i386_pic_plt0_entry): Renamed to ...
2961 (elf_i386_pic_lazy_plt0_entry): This.
2962 (elf_i386_pic_plt_entry): Renamed to ...
2963 (elf_i386_pic_lazy_plt_entry): This.
2964 (elf_i386_got_plt_entry): Renamed to ...
2965 (elf_i386_non_lazy_plt_entry): This.
2966 (elf_i386_pic_got_plt_entry): Renamed to ...
2967 (elf_i386_pic_non_lazy_plt_entry): This.
2968 (elf_i386_eh_frame_plt): Renamed to ...
2969 (elf_i386_eh_frame_lazy_plt): This.
2970 (elf_i386_eh_frame_plt_got): Renamed to ...
2971 (elf_i386_eh_frame_non_lazy_plt): This.
2972 (elf_i386_plt_layout): Renamed to ...
2973 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
2974 eh_frame_plt_got_size.
2975 (elf_i386_non_lazy_plt_layout): New.
2976 (elf_i386_plt_layout): Likewise.
2977 (elf_i386_non_lazy_plt): Likewise.
2978 (GET_PLT_ENTRY_SIZE): Removed.
2979 (elf_i386_plt): Renamed to ...
2980 (elf_i386_lazy_plt): This.
2981 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
2982 (elf_i386_arch_bed): Updated.
2983 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2984 (elf_i386_create_dynamic_sections): Removed.
2985 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
2986 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2987 (elf_i386_adjust_dynamic_symbol): Updated.
2988 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
2989 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2990 size for PLT0 if there is no PLT0.
2991 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
2992 output section is discarded only if GOT isn't empty.
2993 (elf_i386_relocate_section): Updated. Properly get PLT index
2994 if there is no PLT0.
2995 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
2996 second and third slots in the PLT entry if there is no PLT0.
2997 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
2998 if there is no PLT0. Set sh_entsize on the .plt.got section.
2999 (elf_i386_nacl_plt): Forward declaration.
3000 (elf_i386_get_plt_sym_val): Removed.
3001 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3002 against all dynamic relocations.
3003 (elf_i386_link_setup_gnu_properties): New function.
3004 (elf_backend_create_dynamic_sections): Updated.
3005 (elf_backend_setup_gnu_properties): New.
3006 (elf_i386_nacl_plt): Updated.
3007 (elf_i386_nacl_arch_bed): Likewise.
3008 (elf_i386_vxworks_arch_bed): Likewise.
3010 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3012 * elflink.c (elf_output_implib): Remove executable flag from import
3014 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3015 library is a relocatable object file.
3017 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3020 * elf32-avr.c (avr_should_move_sym): New function.
3021 (avr_should_reduce_sym_size): Likewise.
3022 (avr_should_increase_sym_size): Likewise.
3023 (elf32_avr_relax_delete_bytes): Adjust symbol values
3024 and sizes by calling new functions.
3026 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3028 * config.bfd (riscv32-*): Enable rv64.
3030 2017-05-02 Alan Modra <amodra@gmail.com>
3033 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3034 rather than h->root.type == bfd_link_hash_new.
3035 (bfd_elf_record_link_assignment): Similarly, call
3036 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3038 2017-04-29 Alan Modra <amodra@gmail.com>
3041 * reloc.c (reloc_offset_in_range): New function.
3042 (bfd_perform_relocation, bfd_install_relocation): Use it.
3043 (_bfd_final_link_relocate): Likewise.
3045 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3047 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3048 before using .plt.got.
3049 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3051 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3053 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3054 instead of "+=" to update 0.
3056 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3058 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3059 .plt.got section here.
3060 (elf_i386_check_relocs): Don't create the .plt.got section.
3061 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3062 the .plt.got and .plt.bnd sections here.
3063 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3066 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3068 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3070 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3071 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3072 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3073 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3076 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3078 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3080 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3081 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3082 the first relocatable ELF input with GNU properties.
3084 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3086 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3087 VxWorks for non-PIC.
3089 2017-04-27 Alan Modra <amodra@gmail.com>
3091 * elf-bfd.h (struct elf_backend_data): Make asection param of
3092 elf_backend_eh_frame_address_size const.
3093 (_bfd_elf_eh_frame_address_size): Likewise.
3094 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3095 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3096 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3097 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3098 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3099 (next_cie_fde_offset): Constify params.
3100 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3102 2017-04-27 Alan Modra <amodra@gmail.com>
3104 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3105 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3106 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3108 (offset_adjust): New function.
3109 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3110 (adjust_eh_frame_local_symbols): Likewise.
3111 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3112 after changing anything. Return true if anything changed.
3113 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3114 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3116 2017-04-27 Alan Modra <amodra@gmail.com>
3118 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3121 2017-04-27 Alan Modra <amodra@gmail.com>
3123 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3124 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3125 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3126 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3127 for undef and undefweak dyn_relocs.
3128 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3129 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3130 (allocate_got, allocate_dynrelocs): Likewise.
3131 (ppc64_elf_relocate_section): Likewise.
3133 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3135 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3136 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3137 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3138 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3140 2017-04-26 Nick Clifton <nickc@redhat.com>
3143 * reloc.c (bfd_perform_relocation): Check for a negative address
3146 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3149 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3151 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3152 (elf_backend_always_renumber_dynsyms): Define.
3153 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3154 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3155 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3156 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3158 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3160 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3162 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3163 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3164 sections have been created.
3166 2017-04-26 Nick Clifton <nickc@redhat.com>
3169 * compress.c (bfd_init_section_compress_status): Check the return
3170 value from bfd_malloc.
3172 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3174 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3175 no_finish_dynamic_symbol.
3176 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3178 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3179 weak symbol, don't make it dynamic.
3180 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3181 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3182 relocation for GOT reference.
3183 (elf_x86_64_finish_dynamic_symbol): Abort if
3184 no_finish_dynamic_symbol isn't 0.
3186 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3189 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3190 undefined weak symbol, don't make it dynamic.
3191 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3192 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3193 relocation for R_386_GOT32.
3195 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3198 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3200 2017-04-23 Alan Modra <amodra@gmail.com>
3203 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3204 * elf.c (lcomm_sym): New.
3205 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3206 * bfd-in2.h: Regenerate.
3208 2017-04-23 Alan Modra <amodra@gmail.com>
3211 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3212 parameters and comment.
3213 (_bfd_elf_get_reloc_section): Delete.
3214 (_bfd_elf_plt_get_reloc_section): Declare.
3215 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3216 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3218 (_bfd_elf_get_reloc_section): ..here. Delete.
3219 (assign_section_numbers): Call elf_get_reloc_section.
3220 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3221 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3223 2017-04-23 Alan Modra <amodra@gmail.com>
3226 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3229 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3232 * elf32-i386.c (elf_i386_link_hash_entry): Add
3233 no_finish_dynamic_symbol.
3234 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3235 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3236 symbol, don't make it dynamic in PIE.
3237 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3238 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3239 relocation for R_386_GOT32
3240 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3243 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3247 * elflink.c (elf_link_add_object_symbols): Require
3248 --no-dynamic-linker with -E/--dynamic-list when creating
3251 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3253 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3256 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3258 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3259 dynamic symbol sorting.
3261 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3264 * elflink.c (elf_link_add_object_symbols): Preserve
3265 dynamic_ref_after_ir_def when restoring the symbol table for
3266 unneeded dynamic object.
3268 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3271 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3272 on on undefined IFUNC symbol in the second PLT.
3274 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3276 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3278 2017-04-19 Alan Modra <amodra@gmail.com>
3280 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3281 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3282 * elf32-ppc.c:Formatting.
3283 (ensure_undefweak_dynamic): Don't make dynamic when
3284 info->dynamic_undefined_weak is zero.
3285 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3286 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3287 not default visibility. Discard undef and undefweak
3289 (ppc_elf_relocate_section): Adjust to suit.
3290 * elf64-ppc.c: Formatting.
3291 (ensure_undefweak_dynamic): Don't make dynamic when
3292 info->dynamic_undefined_weak is zero.
3293 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3294 info->dynamic_undefined_weak. Discard them earlier.
3296 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3299 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3300 before generating the version definition section.
3302 2017-04-17 Alan Modra <amodra@gmail.com>
3304 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3305 state when a regular object file defines a symbol with
3306 incompatible type to that defined by an earlier shared lib.
3308 2017-04-13 Alan Modra <amodra@gmail.com>
3310 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3312 * elf32-arm.c: Likewise.
3313 * elf32-i386.c: Likewise.
3314 * elf32-mep.c: Likewise.
3315 * elf64-ia64-vms.c: Likewise.
3316 * elf64-x86-64.c: Likewise.
3317 * elflink.c: Likewise.
3318 * elfnn-ia64.c: Likewise.
3319 * elfxx-mips.c: Likewise.
3321 2017-04-13 Alan Modra <amodra@gmail.com>
3323 * aoutx.h: Use %B and %A in error messages throughout file.
3324 * aout-cris.c: Likewise.
3325 * archive.c: Likewise.
3326 * binary.c: Likewise.
3327 * coff-rs6000.c: Likewise.
3328 * coff-tic4x.c: Likewise.
3329 * coffcode.h: Likewise.
3330 * coffgen.c: Likewise.
3331 * cofflink.c: Likewise.
3332 * coffswap.h: Likewise.
3333 * cpu-arm.c: Likewise.
3334 * elf-eh-frame.c: Likewise.
3335 * elf-m10300.c: Likewise.
3337 * elf32-arc.c: Likewise.
3338 * elf32-arm.c: Likewise.
3339 * elf32-bfin.c: Likewise.
3340 * elf32-frv.c: Likewise.
3341 * elf32-iq2000.c: Likewise.
3342 * elf32-m32c.c: Likewise.
3343 * elf32-microblaze.c: Likewise.
3344 * elf32-nds32.c: Likewise.
3345 * elf32-rl78.c: Likewise.
3346 * elf32-rx.c: Likewise.
3347 * elf32-score.c: Likewise.
3348 * elf32-score7.c: Likewise.
3349 * elf32-sh64.c: Likewise.
3350 * elf32-v850.c: Likewise.
3351 * elf32-vax.c: Likewise.
3352 * elf32-visium.c: Likewise.
3353 * elf64-ia64-vms.c: Likewise.
3354 * elf64-mmix.c: Likewise.
3355 * elf64-sh64.c: Likewise.
3356 * elfcode.h: Likewise.
3357 * elfnn-aarch64.c: Likewise.
3358 * elfnn-ia64.c: Likewise.
3359 * elfxx-mips.c: Likewise.
3360 * hpux-core.c: Likewise.
3363 * linker.c: Likewise.
3364 * merge.c: Likewise.
3366 * oasys.c: Likewise.
3367 * pdp11.c: Likewise.
3368 * peXXigen.c: Likewise.
3369 * rs6000-core.c: Likewise.
3370 * vms-alpha.c: Likewise.
3371 * xcofflink.c: Likewise.
3373 2017-04-13 Alan Modra <amodra@gmail.com>
3375 * bfd.c (PRINT_TYPE): Define.
3376 (_doprnt): New function.
3377 (error_handler_internal): Use _doprnt.
3378 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3379 calls in their natural order, throughout file.
3380 * coff-mcore.c: Likewise.
3381 * coff-ppc.c: Likewise.
3382 * coff-tic80.c: Likewise.
3383 * cofflink.c: Likewise.
3384 * elf-s390-common.c: Likewise.
3386 * elf32-arm.c: Likewise.
3387 * elf32-i386.c: Likewise.
3388 * elf32-m32r.c: Likewise.
3389 * elf32-msp430.c: Likewise.
3390 * elf32-spu.c: Likewise.
3391 * elf64-ia64-vms.c: Likewise.
3392 * elf64-sparc.c: Likewise.
3393 * elf64-x86-64.c: Likewise.
3394 * elflink.c: Likewise.
3395 * elfnn-aarch64.c: Likewise.
3396 * elfnn-ia64.c: Likewise.
3397 * elfxx-mips.c: Likewise.
3399 2017-04-13 Alan Modra <amodra@gmail.com>
3401 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3402 branch veneers" error. Fix double space and format message.
3403 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3404 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3406 2017-04-13 Alan Modra <amodra@gmail.com>
3408 * bfd-in2.h: Regenerate.
3410 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3412 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3413 extra `\n' in warning/error messages.
3414 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3415 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3417 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3419 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3420 processor-specific properties with generic ELF target vector.
3422 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3424 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3425 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3426 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3427 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3429 (link_hash_newfunc): Initialize has_got_reloc and
3431 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3433 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3435 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3437 (_bfd_sparc_elf_fixup_symbol): New function.
3438 (allocate_dynrelocs): Don't allocate space for dynamic
3439 relocations and discard relocations against resolved undefined
3440 weak symbols in executable. Don't make resolved undefined weak
3441 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3442 relocation against undefined weak symbols in PIE.
3443 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3444 relocations against resolved undefined weak symbols in PIE
3445 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3446 without ynamic PLT/GOT relocations for resolved undefined weak
3448 Don't generate dynamic relocation against resolved undefined
3449 weak symbol in executable.
3450 (pie_finish_undefweak_symbol): New function.
3451 (_bfd_sparc_elf_finish_dynamic_sections): Call
3452 pie_finish_undefweak_symbol on all symbols in PIE.
3453 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3454 (_bfd_sparc_elf_fixup_symbol): New function.
3456 2017-04-10 Nick Clifton <nickc@redhat.com>
3458 * config.bfd: Remove ns32k from obsolete list.
3460 2017-04-10 Alan Modra <amodra@gmail.com>
3463 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3464 (special_sections_i): Likewise for .init_array.
3465 (special_sections_p): Likewise for .preinit_array.
3467 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3471 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3472 ELF_COMMON_DEF_P for common symbols.
3473 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3474 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3475 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3476 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3477 07492f668d2173da7a2bda3707ff0985e0f460b6.
3479 2017-04-07 Pedro Alves <palves@redhat.com>
3481 * opncls.c (bfd_get_debug_link_info): Rename to...
3482 (bfd_get_debug_link_info_1): ... this. Change type of second
3483 parameter to void pointer. Adjust.
3484 (bfd_get_debug_link_info): Reimplement on top of
3485 bfd_get_debug_link_info_1.
3486 (separate_debug_file_exists, separate_alt_debug_file_exists):
3487 Change type of second parameter to void pointer. Adjust.
3488 (get_func_type, check_func_type): Change type of second parameter
3490 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3491 the callback functions instead of passing the address of a local.
3492 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3493 find_separate_debug_file.
3494 (get_alt_debug_link_info_shim): Change type of second parameter to
3495 void pointer. Adjust.
3496 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3497 find_separate_debug_file.
3498 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3499 of second parameter to void pointer. Adjust.
3500 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3501 pointer local to find_separate_debug_file.
3503 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3505 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3506 external symbols with a definition.
3507 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3509 2017-04-07 Alan Modra <amodra@gmail.com>
3511 * po/SRC-POTFILES.in: Regenerate.
3513 2017-04-05 Alan Modra <amodra@gmail.com>
3515 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3518 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3520 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3521 numbers for DataDirectory entry indicies passed to
3524 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3526 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3527 each GNU_MBIND section and align GNU_MBIND section to page size.
3528 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3529 segment for each GNU_MBIND section.
3530 (_bfd_elf_init_private_section_data): Copy sh_info from input
3531 for GNU_MBIND section.
3533 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3535 * elfnn-riscv.c (GP_NAME): Delete.
3536 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3537 (_bfd_riscv_relax_lui): Likewise.
3539 2017-04-04 Nick Clifton <nickc@redhat.com>
3542 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3544 (bfd_elf_final_link): Only initialize the extended symbol index
3545 section if there are extended symbol tables to list.
3547 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3549 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3550 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3551 * configure.ac (elf): Add elf-properties.lo.
3552 * Makefile.in: Regenerated.
3553 * configure: Likewise.
3554 * elf-bfd.h (elf_property_kind): New.
3555 (elf_property): Likewise.
3556 (elf_property_list): Likewise.
3557 (elf_properties): Likewise.
3558 (_bfd_elf_parse_gnu_properties): Likewise.
3559 (_bfd_elf_get_property): Likewise.
3560 (_bfd_elf_link_setup_gnu_properties): Likewise.
3561 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3562 and setup_gnu_properties.
3563 (elf_obj_tdata): Add properties.
3564 * elf-properties.c: New file.
3565 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3566 (elf_i386_merge_gnu_properties): Likewise.
3567 (elf_backend_parse_gnu_properties): Likewise.
3568 (elf_backend_merge_gnu_properties): Likewise.
3569 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3570 (elf_x86_64_merge_gnu_properties): Likewise.
3571 (elf_backend_parse_gnu_properties): Likewise.
3572 (elf_backend_merge_gnu_properties): Likewise.
3573 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3574 (elf_backend_parse_gnu_properties): Likewise.
3575 (elf_backend_setup_gnu_properties): Likewise.
3576 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3577 elf_backend_merge_gnu_properties and
3578 elf_backend_setup_gnu_properties.
3580 2017-03-30 Pip Cet <pipcet@gmail.com>
3582 * elf32-wasm32.c: Add relocation code, two relocs.
3583 * reloc.c: Add wasm32 relocations.
3584 * libbfd.h: Regenerate.
3585 * bfd-in2.h: Regenerate.
3586 * bfd/po/bfd.pot: Regenerate.
3588 2017-03-29 Nick Clifton <nickc@redhat.com>
3591 * coff-bfd.h (struct coff_section_data): Add new fields:
3592 saved_bias and bias.
3593 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3594 computed for PE binaries.
3595 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3598 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3601 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3602 to handle a local symbol with a hash-symbol-entry; without PLT.
3603 Add BFD_ASSERT for an incidental case with GOT entry present.
3604 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3605 isn't forced-or-set local.
3607 2017-03-27 Pip Cet <pipcet@gmail.com>
3609 * wasm-module.c: New file to support WebAssembly modules.
3610 * wasm-module.h: New file to support WebAssembly modules.
3611 * doc/webassembly.texi: Start documenting wasm-module.c.
3612 * config.bfd: Add wasm_vec.
3613 * targets.c: Likewise.
3614 * configure.ac: Likewise.
3615 * Makefile.am: Add entries for wasm-module.c.
3616 * Makefile.in: Regenerate.
3617 * configure: Regenerate.
3618 * po/SRC-POTFILES.in: Regenerate.
3620 2017-03-27 Pip Cet <pipcet@gmail.com>
3622 * cpu-wasm32.c: New file to support wasm32 architecture.
3623 * elf32-wasm32.c: New file to support wasm32 architecture.
3624 * Makefile.am: Add wasm32 architecture.
3625 * archures.c: Likewise.
3626 * config.bfd: Likewise.
3627 * configure.ac: Likewise.
3628 * targets.c: Likewise.
3629 * Makefile.in: Regenerate.
3630 * bfd-in2.h: Regenerate.
3631 * configure: Regenerate.
3632 * po/SRC-POTFILES.in: Regenerate.
3634 2017-03-20 Alan Modra <amodra@gmail.com>
3637 * elf64-ppc.c (compare_symbols): Stabilize sort.
3639 2017-03-18 Alan Modra <amodra@gmail.com>
3641 * elf64-ppc.c (struct ppc_link_hash_table): Add
3642 local_ifunc_resolver and maybe_local_ifunc_resolver.
3643 (ppc_build_one_stub): Set flags on emitting dynamic
3644 relocation to ifunc.
3645 (ppc64_elf_relocate_section): Likewise.
3646 (ppc64_elf_finish_dynamic_symbol): Likewise.
3647 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3648 local dynamic relocs to ifuncs.
3649 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3650 local_ifunc_resolver and maybe_local_ifunc_resolver.
3651 (ppc_elf_relocate_section): Set flag on emitting dynamic
3652 relocation to ifuncs.
3653 (ppc_elf_finish_dynamic_symbol): Likewise.
3654 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3655 dynamic relocs to ifuncs.
3657 2017-03-13 Nick Clifton <nickc@redhat.com>
3660 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3661 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3662 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3663 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3664 * bfd-in2.h: Regenerate.
3665 * libbfd.h: Regenerate.
3666 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3668 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3669 (elfNN_aarch64_howto_table): Likewise.
3670 (aarch64_tls_transition_without_check): Likewise.
3671 (aarch64_reloc_got_type): Likewise.
3672 (elfNN_aarch64_final_link_relocate): Likewise.
3673 (elfNN_aarch64_tls_relax): Likewise.
3674 (elfNN_aarch64_relocate_section): Likewise.
3675 (elfNN_aarch64_gc_sweep_hook): Likewise.
3676 (elfNN_aarch64_check_relocs): Likewise.
3677 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3678 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3680 2017-03-11 Alan Modra <amodra@gmail.com>
3682 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3683 parameter is in fact used. Whitespace fixes.
3684 * elf64-ppc.c: Likewise.
3686 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3688 * rs6000-core.c (CORE_NEW): Simplify macro when
3689 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3691 2017-03-07 Alan Modra <amodra@gmail.com>
3695 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3698 2017-03-05 Alan Modra <amodra@gmail.com>
3700 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3701 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3702 (next_cie_fde_offset): New function.
3703 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3704 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3705 four bytes. Align CIEs to four or eight bytes depending on
3706 per_encoding_aligned8. Align FDEs according to their encoding.
3707 Pad last FDE to output section alignment.
3708 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3710 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3711 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3712 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3714 2017-03-02 Martin Bickel <binutils@ineranves.de>
3717 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3718 empty segments which have a zero filesz, but a non-zero memsz.
3720 2017-03-02 Alan Modra <amodra@gmail.com>
3722 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3724 2017-02-28 Alan Modra <amodra@gmail.com>
3726 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3727 (ppc64_elf_relocate_section): Likewise.
3729 2017-02-28 Alan Modra <amodra@gmail.com>
3732 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3733 rather than elf32_nios2_hash_table or elf_hash_table.
3734 (create_got_section): Likewise.
3735 (nios2_elf32_finish_dynamic_symbol): Likewise.
3736 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3737 (nios2_elf32_size_dynamic_sections): Likewise.
3738 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3739 vars. Use htab equivalents directly instead. Don't create
3740 all dynamic sections on needing just the GOT. Use a goto
3741 rather than a fall-through with reloc test. Ensure
3742 htab->dynobj is set when making dynamic sreloc section.
3743 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3744 equivalent directly instead. Don't segfault on looking for
3745 .dynamic when dynamic sections have not been created. Don't
3746 segfault on .got.plt being discarded.
3747 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3748 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3749 fixme and another not so relevant comment.
3750 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3751 already set, set hash table dynobj on creating .sbss.
3753 2017-02-28 Alan Modra <amodra@gmail.com>
3755 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3756 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3757 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3758 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3759 (ppc64_elf_relocate_section): Likewise.
3760 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3761 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3762 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3763 * libbfd.h: Regenerate.
3764 * bfd-in2.h: Regenerate.
3766 2017-02-28 Alan Modra <amodra@gmail.com>
3768 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3769 dynamic .data.rel.ro read-only.
3770 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3771 rather than section flags when deciding where copy reloc goes.
3772 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3773 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3774 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3775 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3776 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3777 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3778 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3779 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3780 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3781 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3782 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3783 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3784 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3785 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3786 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3787 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3788 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3789 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3790 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3792 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3794 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3795 `jalr $0, $25' instruction encoding.
3797 2017-02-27 Nick Clifton <nickc@redhat.com>
3800 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3801 generating a seg-fault when encountering a symbol that has been
3802 deleted by garbage collection.
3804 2017-02-25 Alan Modra <amodra@gmail.com>
3806 * elf32-arc.c (struct dynamic_sections): Delete.
3807 (enum dyn_section_types): Delete.
3808 (dyn_section_names): Delete.
3809 (arc_create_dynamic_sections): Delete.
3810 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3811 segfault on discarded .rela.plt section.
3812 (elf_arc_size_dynamic_sections): Formatting. Don't call
3813 arc_create_dynamic_sections. Don't allocate memory for sections
3814 handled by the generic linker. Correct code finding relocs in
3815 read-only sections. Set SEC_EXCLUDE on zero size .got,
3816 .got.plt, and .dynbss sections. Do set .interp for pies.
3818 2017-02-24 Andrew Waterman <andrew@sifive.com>
3820 * elfnn-riscv.c (GP_NAME): New macro.
3821 (riscv_global_pointer_value): Use it.
3822 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3823 output section, consider only that section's alignment.
3825 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3827 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3828 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3829 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3830 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3832 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3834 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3835 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3838 2017-02-23 Alan Modra <amodra@gmail.com>
3841 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3843 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3844 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3847 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3850 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3851 processing ahead of the call to `elf_gc_sweep_symbol'.
3853 2017-02-22 Nick Clifton <nickc@redhat.com>
3856 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3857 created section 4-byte alignment.
3859 2017-02-22 Alan Modra <amodra@gmail.com>
3861 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3862 on .got or .plt output section being discarded by script.
3863 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3866 2017-02-21 Alan Modra <amodra@gmail.com>
3868 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3869 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3871 2017-02-20 Alan Modra <amodra@gmail.com>
3874 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3875 if DT_RELSZ/DT_RELASZ is zero.
3877 2017-02-17 Nick Clifton <nickc@redhat.com>
3879 * compress.c (bfd_get_full_section_contents): Remember to reduce
3880 compressed size by the sizeof the compression header when
3881 decompressing the contents.
3883 2017-02-17 Pedro Alves <palves@redhat.com>
3885 * srec.c (Chunk): Rename to ...
3886 (_bfd_srec_len): ... this.
3887 (S3Forced): Rename to ...
3888 (_bfd_srec_forceS3): ... this.
3889 * objcopy.c: Adjust all references.
3891 2017-02-17 Pedro Alves <palves@redhat.com>
3893 * archive.c (bsd_write_armap): Rename to ...
3894 (_bfd_bsd_write_armap): ... this.
3895 (coff_write_armap): Rename to ...
3896 (_bfd_coff_write_armap): ... this.
3897 * libbfd-in.h (bsd_write_armap): Rename to ...
3898 (_bfd_bsd_write_armap): ... this.
3899 (coff_write_armap): Rename to ...
3900 (_bfd_coff_write_armap): ... this.
3901 * aout-target.h, aout-tic30.c: Adjust all users.
3902 * libbfd.h: Regenerate.
3904 2017-02-17 Pedro Alves <palves@redhat.com>
3906 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3907 (warn_deprecated): Rename to ...
3908 (_bfd_warn_deprecated): ... this.
3909 * libbfd.c (warn_deprecated): Rename to ...
3910 (_bfd_warn_deprecated): ... this.
3911 * bfd-in2.h: Regenerate.
3913 2017-02-17 Pedro Alves <palves@redhat.com>
3915 * bfdio.c (real_ftell): Rename to ...
3916 (_bfd_real_ftell): ... this.
3917 (real_fseek): Rename to ...
3918 (_bfd_real_fseek): ... this.
3919 (real_fopen): Rename to ...
3920 (_bfd_real_fopen): ... this.
3921 * libbfd-in.h (real_ftell): Rename to ...
3922 (_bfd_real_ftell): ... this.
3923 (real_fseek): Rename to ...
3924 (_bfd_real_fseek): ... this.
3925 (real_fopen): Rename to ...
3926 (_bfd_real_fopen): ... this.
3927 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3928 * libbfd.h: Regenerate.
3930 2017-02-17 Pedro Alves <palves@redhat.com>
3932 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3933 * libbfd.c (read_unsigned_leb128): Rename to ...
3934 (_bfd_read_unsigned_leb128): ... this.
3935 (read_signed_leb128): Rename to ...
3936 (_bfd_read_signed_leb128): ... this.
3937 (safe_read_leb128): Rename to ...
3938 (_bfd_safe_read_leb128): ... this.
3939 * libbfd-in.h (read_unsigned_leb128): Rename to ...
3940 (_bfd_read_unsigned_leb128): ... this.
3941 (read_signed_leb128): Rename to ...
3942 (_bfd_read_signed_leb128): ... this.
3943 (safe_read_leb128): Rename to ...
3944 (_bfd_safe_read_leb128): ... this.
3945 * libbfd.h: Renegerate.
3947 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3949 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3950 before trying to fine matching file and line information.
3952 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
3954 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3955 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3956 not match current bfd, then reload debug information. Record bfd
3957 we're loading debug info for in the stash. If we have debug
3958 informatin in the cache then perform section placement before
3961 2017-02-16 Alan Modra <amodra@gmail.com>
3964 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3965 * elfxx-target.h (elf_backend_no_page_alias): Define.
3966 (elfNN_bed): Init new field.
3967 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3968 ensure PT_LOAD segment starts on a new page.
3969 * elf32-hppa.c (elf_backend_no_page_alias): Define.
3971 2017-02-16 Alan Modra <amodra@gmail.com>
3974 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3977 2017-02-16 Jiong Wang <jiong.wang@arm.com>
3979 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3980 * bfd-in2.h: Regenerated.
3982 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3985 * elf32-i386.c (elf_i386_relocate_section): Allow
3986 "lea foo@GOT, %reg" in PIC.
3988 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
3991 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3992 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3993 error against local IFUNC symbol without a base register for
3996 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
3998 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3999 `%P: %H:' with `info->callbacks->einfo'.
4000 (ppc_elf_relocate_section): Likewise.
4001 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4002 (ppc64_elf_edit_toc): Likewise.
4003 (ppc64_elf_relocate_section): Likewise.
4005 2017-02-14 Alan Modra <amodra@gmail.com>
4007 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4008 --gc-keep-exported, and test versioned field of sym rather than
4009 looking for @ in name.
4011 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4013 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4016 2017-02-13 Nick Clifton <nickc@redhat.com>
4019 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4022 2017-02-07 Andrew Waterman <andrew@sifive.com>
4024 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4025 entry size if PLT header is written.
4027 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4029 Fix sparc64 dynamic relocation processing to use the dynamic
4031 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4032 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4035 2017-02-03 Nick Clifton <nickc@redhat.com>
4038 * coffcode.h (coff_write_object_contents): Enlarge size of
4039 s_name_buf in order to avoid compile time warning about possible
4041 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4042 32-bits of insn value before printing into buffer.
4044 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4046 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4047 `max_local_dynindx'.
4048 (mips_elf_sort_hash_table): Handle it.
4049 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4050 symbols bump up `max_local_dynindx' rather than
4051 `max_non_got_dynindx'.
4053 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4055 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4056 `min_got_dynindx', `max_unref_got_dynindx' and
4057 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4058 (mips_elf_sort_hash_table): Adjust accordingly.
4060 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4062 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4063 to access the hash table.
4065 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4067 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4068 non-NULL `htab' to the beginning.
4070 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4072 * elflink.c (elf_gc_sweep): Wrap overlong line.
4074 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4076 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4077 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4078 * elfxx-mips.c (mips_elf_link_hash_table): Add
4079 `ignore_branch_isa' member.
4080 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4081 in branch relocation calculation as an error if
4082 `ignore_branch_isa' has been set.
4083 (_bfd_mips_elf_insn32): Rename to...
4084 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4085 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4086 Handle the new parameter.
4088 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4090 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4091 local variable dynobj.
4094 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4095 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4096 executable from read-only sections into sdynrelro.
4097 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4098 dynamic relocs in sdynrelro.
4099 (elf_backend_want_dynrelro): Define.
4101 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4103 * config.bfd (*-*-rtemsaout*): Mark as removed.
4105 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4107 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4108 (arm-*-rtems*): Move to (arm*-*-eabi*).
4109 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4110 (m68-*-rtems*): Move to (m68*-*-elf*).
4112 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4114 * config.bfd (*-*-rtemscoff*): Mark as removed.
4116 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4119 * elflink.c (bfd_elf_record_link_assignment): Revert last
4120 change and don't ever clear `forced_local'. Set `mark'
4122 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4124 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4125 (bfd_elf_size_dynamic_sections): ... here.
4126 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4127 and set `mark' instead in `__tls_get_addr_opt' processing.
4128 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4130 2017-01-24 Alan Modra <amodra@gmail.com>
4132 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4133 where dynamic relocs are preferable. Allow ifunc too.
4134 (ensure_undefweak_dynamic): New function.
4135 (allocate_dynrelocs): Use it here. Move plt handling last and
4136 don't make symbols dynamic, simplifying loop. Only make undef
4137 weak symbols with GOT entries dynamic. Correct condition
4138 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4139 comments. Remove goto.
4140 (ppc_elf_relocate_section): Correct test for using dynamic
4141 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4142 to suit. Set up explicit tls_index entries and implicit GOT
4143 tls_index entries resolvable at link time for
4144 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4145 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4146 (ensure_undefweak_dynamic): New function.
4147 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4148 with GOT entries dynamic. Remove unnecessary test of
4149 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4150 (ppc64_elf_relocate_section): Correct test for using dynamic
4151 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4152 to suit. Set up explicit tls_index entries and implicit GOT
4153 tls_index entries resolvable at link time for __tls_get_addr_opt.
4154 Simplify expression to clear mem for prelink.
4156 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4158 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4160 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4162 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4163 (elf_backend_hash_symbol): Define.
4165 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4168 * elflink.c (bfd_elf_record_link_assignment): Clear any
4169 `forced_local' marking for DSO symbols that are not being
4172 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4174 * elfnn-riscv.c (riscv_elf_object_p): New function.
4176 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4179 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4181 (elf_x86_64_check_relocs): Create .eh_frame section for the
4183 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4184 .eh_frame section for the .plt.bnd section.
4185 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4186 for the .plt.bnd section.
4188 2017-01-12 Nick Clifton <nickc@redhat.com>
4191 * opncls.c (find_separate_debug_file): Add include_dirs
4192 parameter. Only include the directory part of the bfd's filename
4193 in search paths if include_dirs is true. Add a couple of extra
4194 locations for looking for debug files.
4195 ( bfd_follow_gnu_debuglink): Update invocation of
4196 find_separate_debug_file.
4197 (bfd_follow_gnu_debugaltlink): Likewise.
4198 (get_build_id): New function: Finds the build-id of the given bfd.
4199 (get_build_id_name): New function: Computes the name of the
4200 separate debug info file for a bfd, based upon its build-id.
4201 (check_build_id_file): New function: Checks to see if a separate
4202 debug info file exists at the given location, and that its
4203 build-id matches that of the original bfd.
4204 (bfd_follow_build_id_debuglink): New function: Finds a separate
4205 debug info file for a given bfd by using the build-id method.
4206 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4207 method of locating a separate debug info file before using the
4209 * bfd-in2.h: Regenerate.
4211 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4214 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4215 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4216 elf_x86_64_eh_frame_plt_got.
4217 (elf_x86_64_size_dynamic_sections): Get unwind info from
4218 elf_x86_64_bnd_arch_bed for the BND PLT.
4220 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4222 * config.bfd: Add entries for i686-redox and x86_64-redox.
4224 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4226 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4228 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4229 .eh_frame section to 4 bytes for x32.
4230 (elf_x86_64_check_relocs): Likewise.
4232 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4235 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4236 (PLT_GOT_FDE_LENGTH): Likewise.
4237 (elf_i386_plt_layout): Add eh_frame_plt_got and
4238 eh_frame_plt_got_size.
4239 (elf_i386_plt): Updated.
4240 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4241 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4242 (elf_i386_size_dynamic_sections): Allocate and initialize
4243 .eh_frame section for .plt.got.
4244 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4246 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4247 eh_frame_plt_got_size.
4248 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4249 (PLT_GOT_FDE_LENGTH): Likewise.
4250 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4251 eh_frame_plt_got_size.
4252 (elf_x86_64_arch_bed): Updated.
4253 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4254 eh_frame_plt_got_size.
4255 (elf_x86_64_nacl_arch_bed): Likewise.
4256 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4257 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4258 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4259 .eh_frame section for .plt.got.
4260 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4263 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4265 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4266 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4268 2017-01-09 Nick Clifton <nickc@redhat.com>
4270 * dwarf2.c (lookup_address_in_function_table): Return early if
4271 there are no functions in the given comp unit, or if the high
4272 address of the last function in the comp unit is less than the
4275 2017-01-09 Nick Clifton <nickc@redhat.com>
4278 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4279 message if there are too many symbols to load.
4281 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4283 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4284 if relocs are cached.
4286 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4289 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4290 for R_MICROBLAZE_GOTOFF_64.
4292 2017-01-03 Nick Clifton <nickc@redhat.com>
4294 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4295 warning about using a possibly uninitialised variable.
4297 2017-01-02 Alan Modra <amodra@gmail.com>
4299 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4300 (allocate_plt_static, allocate_dynrelocs): Use it.
4302 2017-01-02 Alan Modra <amodra@gmail.com>
4304 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4305 .PARISC.unwind section.
4307 2017-01-02 Alan Modra <amodra@gmail.com>
4310 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4311 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4312 indirect to GOT pointer relative code edit.
4314 2017-01-02 Alan Modra <amodra@gmail.com>
4316 Update year range in copyright notice of all files.
4318 For older changes see ChangeLog-2016
4320 Copyright (C) 2017 Free Software Foundation, Inc.
4322 Copying and distribution of this file, with or without modification,
4323 are permitted in any medium without royalty provided the copyright
4324 notice and this notice are preserved.
4330 version-control: never