1 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
4 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use
5 bfd_link_executable instead of bfd_link_pic for TLS.
6 (elfNN_aarch64_allocate_dynrelocs): Likewise.
7 (aarch64_can_relax_tls): Likewise.
9 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
12 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Use
13 UNDEFWEAK_NO_DYNAMIC_RELOC to avoid dynamic GOT relocs.
14 (elfNN_aarch64_allocate_dynrelocs): Likewise.
16 2017-11-24 H.J. Lu <hongjiu.lu@intel.com>
19 * elf.c (elf_read_notes): Add an argument for note aligment.
20 (elf_parse_notes): Likewise.
21 (_bfd_elf_make_section_from_shdr): Pass section aligment to
23 (bfd_section_from_phdr): Pass segment aligment to elf_read_notes.
24 (elf_parse_notes): Add an argument for note aligment. Use
25 ELF_NOTE_DESC_OFFSET to get the offset of the note descriptor.
26 Use ELF_NOTE_NEXT_OFFSET to get the offset of the next note
28 (elf_read_notes): Add an argument for note aligment and pass it
31 2017-11-23 Alan Modra <amodra@gmail.com>
33 * elf32-hppa.c (pc_dynrelocs): Define.
34 (elf32_hppa_copy_indirect_symbol): Don't copy dyn_relocs to weakdefs.
35 (alias_readonly_dynrelocs): New function.
36 (elf32_hppa_adjust_dynamic_symbol): Don't clear non_got_ref to
37 indicate dyn_relocs should be discarded, discard them here.
38 Use alias_readonly_dynrelocs.
39 (allocate_dynrelocs): Don't test or clear non_got_ref.
40 (elf32_hppa_relocate_section): Simplify test for dynamic relocs.
41 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't copy dyn_relocs
43 (alias_readonly_dynrelocs, pc_dynrelocs): New functions.
44 (ppc_elf_adjust_dynamic_symbol): Don't clear non_got_ref to
45 indicate dyn_relocs should be discarded, discard them here.
46 Use alias_readonly_dynrelocs.
47 (allocate_dynrelocs): Don't test or clear non_got_ref.
48 (ppc_elf_relocate_section): Simplify test for dynamic relocs.
50 2017-11-23 Alan Modra <amodra@gmail.com>
52 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
53 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
54 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
55 (ppc64_elf_adjust_dynamic_symbol): Don't use
56 alias_readonly_dynrelocs for function symbols.
58 2017-11-23 Alan Modra <amodra@gmail.com>
60 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
61 Rename u.weakdef to u.alias and update comment.
62 (weakdef): New static inline function.
63 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
64 rather than u.weakdef != NULL, and use weakdef function.
65 (_bfd_elf_adjust_dynamic_symbol): Likewise.
66 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
67 all aliases if def has been overridden in a regular object, not
69 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
70 is_weakalias and use weakdef. Set is_weakalias and circular
71 u.alias. Update comments.
72 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
73 u.weakdef != NULL and use weakdef function.
74 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
75 is_weakalias rather than u.weakdef != NULL and use weakdef
76 function. Assert that def is strong defined.
77 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
78 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
79 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
80 (bfin_adjust_dynamic_symbol): Likewise.
81 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
82 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
83 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
84 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
85 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
86 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
87 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
88 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
89 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
90 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
91 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
92 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
93 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
94 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
95 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
96 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
97 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
98 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
99 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
100 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
101 (tilepro_elf_adjust_dynamic_symbol): Likewise.
102 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
103 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
104 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
105 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
106 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
107 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
108 (ppc64_elf_adjust_dynamic_symbol): Likewise.
109 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
110 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
111 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
112 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
113 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
114 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
115 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
116 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
117 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
118 (tilegx_elf_adjust_dynamic_symbol): Likewise.
119 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
121 2017-11-21 Alan Modra <amodra@gmail.com>
123 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
124 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
126 2017-11-20 Nick Clifton <nickc@redhat.com>
129 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
130 objects without a GNU_PROPERTY note section when looking for a bfd
131 onto which notes can be accumulated.
133 2017-11-20 Alan Modra <amodra@gmail.com>
137 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
138 and leave rel_hdr->sh_flags zero. Update calls.
139 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
140 flag when !gas before adding rel/rela section to group. Set
141 output rel/rela SHF_GROUP flags.
143 2017-11-18 Jim Wilson <jimw@sifive.com>
145 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
146 and to in error message.
148 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
150 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
151 "%F%P:", instead of "%F:", to linker callback in case of error.
153 2017-11-16 Nick Clifton <nickc@redhat.com>
156 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
157 (elfcore_grok_openbsd_procinfo): Likewise.
158 (elfcore_grok_nto_status): Likewise.
160 2017-11-16 Nick Clifton <nickc@redhat.com>
162 * merge.c (sec_merge_emit): Always create padding buffer. Add
163 asserts to make sure that the buffer is long enough.
165 2017-11-15 Alan Modra <amodra@gmail.com>
167 * bfd.c (union _bfd_doprnt_args): Add "Bad".
168 (_bfd_doprnt): Handle more flags.
169 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
170 (error_handler_internal): Init args type to Bad.
172 2017-11-14 Alan Modra <amodra@gmail.com>
175 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
176 non-empty dynamic section.
177 (ppc_build_one_stub): Take elf_gp from output bfd, not output
179 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
181 2017-11-14 Alan Modra <amodra@gmail.com>
183 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
186 2017-11-13 Jan Beulich <jbeulich@suse.com>
188 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
190 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
191 (coff_write_object_contents): Likewise. Issue diagnostic for too
194 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
197 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
200 2017-11-12 Alan Modra <amodra@gmail.com>
202 * elflink.c (elf_link_add_object_symbols): Ignore anything but
203 defined and defweak symbols when setting up weakdefs.
205 2017-11-12 Alan Modra <amodra@gmail.com>
207 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
208 to keep dyn_relocs, clear to discard. Comment.
209 (allocate_dynrelocs): Always clear non_got_ref when clearing
210 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
211 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
212 dyn_relocs on undefined syms to handle for non-pic too.
213 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
214 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
215 to keep dyn_relocs, clear to discard. Comment.
216 (allocate_dynrelocs): Always clear non_got_ref when clearing
217 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
218 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
219 dyn_relocs on undefined syms to handle for non-pic too.
220 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
221 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
222 dyn_relocs here. Don't bother setting non_got_ref. Comment.
223 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
224 ifuncs. Move code deleting dyn_relocs on undefined symbols to
225 handle for non-pic too. Don't test non_got_ref. Do test
226 dynamic_adjusted and ELF_COMMON_DEF_P.
228 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
230 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
231 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
232 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
234 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
236 * elf32-mips.c (elf32_mips_write_core_note): New function.
237 (elf_backend_write_core_note): New macro.
238 * elf64-mips.c (elf64_mips_write_core_note): New function.
239 (elf_backend_write_core_note): New macro.
240 * elfn32-mips.c (elf32_mips_write_core_note): New function.
241 (elf_backend_write_core_note): New macro.
243 2017-11-07 Alan Modra <amodra@gmail.com>
245 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
248 2017-11-07 Alan Modra <amodra@gmail.com>
250 * sysdep.h: Formatting, comment fixes.
251 (gettext, ngettext): Redefine when ENABLE_NLS.
252 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
253 (_): Define using gettext.
254 (textdomain, bindtextdomain): Use safer "do nothing".
255 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
256 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
258 2017-11-05 Alan Modra <amodra@gmail.com>
261 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
264 2017-11-05 Alan Modra <amodra@gmail.com>
267 * bfd.c (union _bfd_doprnt_args): New.
268 (PRINT_TYPE): Add FIELD arg. Take value from args.
269 (_bfd_doprnt): Replace ap parameter with args. Adjust all
270 PRINT_TYPE invocations and reading of format args to suit.
271 Move "%%" handling out of switch handling args. Support
272 positional parameters.
273 (_bfd_doprnt_scan): New function.
274 (error_handler_internal): Call _bfd_doprnt_scan and read args.
276 2017-11-04 Alan Modra <amodra@gmail.com>
278 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
279 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
280 (ppc_elf_relocate_section): Don't output a dynamic relocation
281 for IE GOT entries in an executable.
282 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
283 (ppc64_elf_size_dynamic_sections): Likewise.
284 (ppc64_elf_relocate_section): Likewise.
286 2017-11-04 Alan Modra <amodra@gmail.com>
288 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
289 callers. Don't bother with SEC_ALLOC test. Return section pointer.
291 (maybe_set_textrel): ..here.
292 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
293 (maybe_set_textrel): Call minfo to print textrel warning to map file.
295 2017-11-04 Alan Modra <amodra@gmail.com>
297 * elf32-hppa.c (enum _tls_type): Move.
298 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
299 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
300 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
301 (got_entries_needed, got_relocs_needed): New functions.
302 (allocate_dynrelocs): Use them.
303 (elf32_hppa_size_dynamic_sections): Likewise.
304 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
305 Correct code emitting relocs on GD/IE got entries. Report an
306 error when a symbol has both normal and TLS GOT relocs.
308 2017-11-04 Alan Modra <amodra@gmail.com>
311 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
312 for plabels when non-pic.
313 (maybe_set_textrel): New function.
314 (readonly_dynrelocs): Move and rewrite.
315 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
316 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
317 for functions. Expand non_got_ref comments.
318 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
320 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
322 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
323 Don't use func_pointer_refcount. Don't set plt.refcount nor
324 non_got_ref for function pointer reference.
325 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
326 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
327 func_pointer_refcount.
328 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
329 func_pointer_refcount.
330 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
331 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
332 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
334 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
335 Nick Clifton <nickc@redhat.com>
338 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
339 overlarge raw syment count.
340 (coff_get_normalized_symtab): Likewise.
342 2017-11-01 James Bowman <james.bowman@ftdichip.com>
344 * archures.c: Add bfd_mach_ft32b.
345 * cpu-ft32.c: Add arch_info_struct.
346 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
348 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
350 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
351 (elf32_ft32_adjust_diff_reloc_value)
352 (elf32_ft32_adjust_reloc_if_spans_insn)
353 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
354 (ft32_elf_relax_section): New function.
355 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
356 * bfd-in2.h: Regenerate.
357 * libbfd.h: Regenerate.
359 2017-11-01 Nick Clifton <nickc@redhat.com>
362 * coffcode.h (coff_slurp_line_table): Check for an excessively
363 large line number count.
365 2017-11-01 Nick Clifton <nickc@redhat.com>
368 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
369 and offset in light of further possible bogus values.
371 2017-11-01 Alan Modra <amodra@gmail.com>
374 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
375 entry when just a dynamic reloc can serve. Ensure no dynamic
376 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
377 Expand and move the non_got_ref comment.
378 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
380 2017-11-01 Nick Clifton <nickc@redhat.com>
383 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
385 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
386 members of an archive.
388 2017-10-31 Nick Clifton <nickc@redhat.com>
391 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
394 2017-10-30 Alan Modra <amodra@gmail.com>
396 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
399 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
401 (bfd_elf_gc_sections): Likewise.
403 2017-10-30 Alan Modra <amodra@gmail.com>
406 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
407 ensure non_got_ref is not set due to debug references.
408 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
409 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
410 need for a plt entry.
411 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
412 dynamic relocs when pic. Remove bogus code attempting to handle
414 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
416 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
417 and SYMBOL_REFERENCES_LOCAL in GOT handling.
419 2017-10-28 Alan Modra <amodra@gmail.com>
422 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
423 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
424 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
425 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
427 2017-10-25 Alan Modra <amodra@gmail.com>
429 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
430 optionally prefixed with "_".
431 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
433 2017-10-24 Andrew Waterman <andrew@sifive.com>
435 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
438 2017-10-24 Renlin Li <renlin.li@arm.com>
441 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
443 2017-10-23 Nick Clifton <nickc@redhat.com>
446 * elflink.c (elf_link_output_extsym): Keep global undefined
447 symbols if they have been marked as needed.
449 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
451 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
453 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
454 `_bfd_mips_elf_mkobject'.
456 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
459 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
461 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
463 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
464 (riscv_pcgp_lo_reloc): Likewise.
465 (riscv_pcgp_relocs): Likewise.
466 (riscv_init_pcgp_relocs): New function.
467 (riscv_free_pcgp_relocs): Likewise.
468 (riscv_record_pcgp_hi_reloc): Likewise.
469 (riscv_record_pcgp_lo_reloc): Likewise.
470 (riscv_delete_pcgp_hi_reloc): Likewise.
471 (riscv_use_pcgp_hi_reloc): Likewise.
472 (riscv_record_pcgp_lo_reloc): Likewise.
473 (riscv_find_pcgp_lo_reloc): Likewise.
474 (riscv_delete_pcgp_lo_reloc): Likewise.
475 (_bfd_riscv_relax_pc): Likewise.
476 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
477 via the new functions above.
479 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
481 * elfnn-riscv.c (R_RISCV_DELETE): New define.
482 (_bfd_riscv_relax_delete): New function.
483 (perform_relocation): Handle R_RISCV_DELETE.
484 (_bfd_riscv_relax_section): Likewise.
486 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
489 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
490 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
491 bfd_link_executable for TLS check.
492 (tilegx_elf_check_relocs): Likewise.
493 (allocate_dynrelocs): Likewise.
494 (tilegx_elf_relocate_section): Likewise.
496 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
499 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
500 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
501 bfd_link_executable for TLS check.
502 (tilepro_elf_check_relocs): Likewise.
503 (allocate_dynrelocs): Likewise.
504 (tilepro_elf_relocate_section): Likewise.
506 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
509 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
510 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
511 bfd_link_executable for TLS check.
512 (_bfd_sparc_elf_check_relocs): Likewise.
513 (allocate_dynrelocs): Likewise.
514 (_bfd_sparc_elf_relocate_section): Likewise.
516 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
518 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
519 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
520 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
522 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
524 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
525 indirect and warning symbols.
527 2017-10-17 Alan Modra <amodra@gmail.com>
530 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
531 against size left rather than comparing pointers. Reorganise loop.
533 2017-10-17 Alan Modra <amodra@gmail.com>
536 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
537 and error for any other size that doesn't cover the header word.
539 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
541 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
542 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
543 (elf_backend_gc_sweep_hook): Likewise.
544 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
545 (bfinfdpic_gc_sweep_hook): Likewise.
546 (elf_backend_gc_sweep_hook): Likewise.
547 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
548 (elf_backend_gc_sweep_hook): Likewise.
549 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
550 (elf_backend_gc_sweep_hook): Likewise.
551 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
552 (elf_backend_gc_sweep_hook): Likewise.
553 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
554 (elf_backend_gc_sweep_hook): Likewise.
555 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
556 (elf_backend_gc_sweep_hook): Likewise.
557 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
559 (elf_m68k_remove_got_entry_type): Removed.
560 (elf_m68k_find_got_entry_ptr): Likewise.
561 (elf_m68k_remove_got_entry): Likewise.
562 (elf_m68k_gc_sweep_hook): Likewise.
563 (elf_backend_gc_sweep_hook): Likewise.
564 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
565 (elf_backend_gc_sweep_hook): Likewise.
566 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
567 (elf_backend_gc_sweep_hook): Likewise.
568 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
569 (elf_backend_gc_sweep_hook): Likewise.
570 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
571 (elf_backend_gc_sweep_hook): Likewise.
572 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
573 (elf_backend_gc_sweep_hook): Likewise.
574 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
575 (elf_backend_gc_sweep_hook): Likewise.
576 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
577 (elf_backend_gc_sweep_hook): Likewise.
578 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
579 (elf_backend_gc_sweep_hook): Likewise.
580 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
581 (elf_backend_gc_sweep_hook): Likewise.
582 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
583 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
584 (elf_backend_gc_sweep_hook): Likewise.
585 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
586 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
587 (elf_backend_gc_sweep_hook): Likewise.
588 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
589 (elf_backend_gc_sweep_hook): Likewise.
590 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
591 (elf_backend_gc_sweep_hook): Likewise.
592 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
593 (elf_backend_gc_sweep_hook): Likewise.
594 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
595 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
596 (elf_backend_gc_sweep_hook): Likewise.
597 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
598 (ppc64_elf_gc_sweep_hook): Likewise.
599 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
600 (elf_backend_gc_sweep_hook): Likewise.
601 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
602 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
603 * elflink.c (elf_link_add_object_symbols): Don't call
604 _bfd_elf_link_check_relocs here.
605 (gc_sweep_hook_fn): Removed.
606 (elf_gc_sweep): Remove gc_sweep_hook.
607 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
608 (elf_backend_gc_sweep_hook): Likewise.
609 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
610 (elf_backend_gc_sweep_hook): Likewise.
611 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
612 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
613 (elf_backend_gc_sweep_hook): Likewise.
614 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
615 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
616 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
617 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
618 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
619 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
621 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
623 * elf32-i386.c (elf_i386_backend_data): Removed.
624 (get_elf_i386_backend_data): Likewise.
625 (elf_i386_arch_bed): Replace elf_i386_backend_data with
626 elf_x86_backend_data.
627 (elf_i386_get_synthetic_symtab): Likewise.
628 (elf_i386_nacl_arch_bed): Likewise.
629 (elf_i386_vxworks_arch_bed): Likewise.
630 (elf_i386_relocate_section): Check target_os instead of
632 (elf_i386_finish_dynamic_symbol): Likewise.
633 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
634 Check target_os instead of is_vxworks.
635 (elf_i386_link_setup_gnu_properties): Remove normal_target and
636 is_vxworks. Initialize plt0_pad_byte.
637 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
638 (get_elf_x86_64_arch_data): Likewise.
639 (get_elf_x86_64_backend_data): Likewise.
640 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
641 elf_x86_backend_data.
642 (elf_x86_64_get_synthetic_symtab): Likewise.
643 (elf_x86_64_nacl_arch_bed): Likewise.
644 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
645 normal_target. Initialize plt0_pad_byte.
646 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
647 instead of is_vxworks.
648 (_bfd_x86_elf_size_dynamic_sections): Likewise.
649 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
650 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
651 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
652 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
653 Update normal_target. Set up plt0_pad_byte. Check target_os
654 instead of is_vxworks.
655 * elfxx-x86.h (elf_x86_target_os): New.
656 (elf_x86_backend_data): Likewise.
657 (get_elf_x86_backend_data): Likewise.
658 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
660 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
663 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
665 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
666 _bfd_x86_elf_finish_dynamic_sections.
667 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
668 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
670 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
673 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
676 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
677 hide symbol which was forced to be dynamic.
679 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
682 * elf32-cris.c (cris_elf_relocate_section): Don't generate
683 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
684 (cris_elf_check_relocs): Don't allocate dynamic relocation
685 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
687 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
690 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
691 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
692 (sh_elf_relocate_section): Don't generate dynamic relocation if
693 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
695 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
698 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
699 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
700 (elf_s390_relocate_section): Don't generate dynamic relocation
701 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
702 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
703 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
704 (elf_s390_relocate_section): Don't generate dynamic relocation
705 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
707 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
710 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
711 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
712 (allocate_dynrelocs): Discard dynamic relocations if
713 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
715 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
718 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
719 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
721 (allocate_dynrelocs): Discard dynamic relocations if
722 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
724 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
727 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
728 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
729 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
730 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
731 (elf_m68k_relocate_section): Don't generate dynamic relocation
732 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
734 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
737 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
738 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
739 (allocate_dynrelocs): Discard dynamic relocations if
740 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
741 (elf32_hppa_relocate_section): Don't generate dynamic
742 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
744 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
747 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
748 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
749 (allocate_fptr): Don't allocate function pointer if
750 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
751 (allocate_dynrel_entries): Don't allocate dynamic relocation
752 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
753 (set_got_entry): Don't set GOT entry if
754 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
755 (set_pltoff_entry): Don't set PLTOFF entry if
756 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
757 (elfNN_ia64_relocate_section): Don't install dynamic relocation
758 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
760 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
763 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
764 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
765 (allocate_dynrelocs): Don't allocate dynamic relocations if
766 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
768 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
771 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
772 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
773 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
774 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
776 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
779 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
780 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
781 (tilepro_elf_relocate_section): Don't generate dynamic
782 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
783 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
784 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
785 (tilegx_elf_relocate_section): Don't generate dynamic
786 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
788 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
791 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
792 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
794 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
795 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
797 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
799 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
800 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
801 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
803 2017-10-12 James Bowman <james.bowman@ftdichip.com>
805 * bfd-in2.h: Regenerate.
806 * libbfd.h: Regenerate.
807 * elf32-ft32.c: Add HOWTO R_FT32_15.
808 * reloc.c: Add BFD_RELOC_FT32_15.
810 2017-10-12 Nick Clifton <nickc@redhat.com>
812 * reloc.c (enum bfd_reloc_status): Start values at 2.
813 * bfd-in2.h: Regenerate.
814 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
815 that a TRUE return indicates success. Compare the result of
816 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
817 (build_one_stub): Change sense of tests against aarch64_relocate
819 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
820 than FALSE, when an error is detected.
821 (elfNN_aarch64_final_link_relocate): Likewise.
823 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
825 * elf32-i386.c (elf_backend_hide_symbol): New.
826 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
827 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
828 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
830 2017-10-12 Alan Modra <amodra@gmail.com>
832 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
833 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
834 (bfd_elf_define_start_stop): Likewise.
836 2017-10-12 Alan Modra <amodra@gmail.com>
838 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
839 when executable rather than non-PIC.
840 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
841 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
843 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
845 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
847 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
848 (elf_external_linux_prpsinfo64_ugid32): ... this.
849 (swap_linux_prpsinfo32_out): Rename to...
850 (swap_linux_prpsinfo32_ugid32_out): ... this.
851 (elf_external_linux_prpsinfo64_ugid16): New structure.
852 (swap_linux_prpsinfo64_ugid16_out): New function.
853 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
854 (elf_backend_linux_prpsinfo64_ugid16): Define.
855 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
856 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
857 of the 64-bit Linux core PRPSINFO note.
858 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
860 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
862 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
864 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
865 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
866 (elf_external_ppc_linux_prpsinfo32)
867 (swap_ppc_linux_prpsinfo32_out): Move to...
868 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
869 (swap_linux_prpsinfo32_ugid32_out): ... these.
870 (elf_external_linux_prpsinfo32): Rename to...
871 (elf_external_linux_prpsinfo32_ugid16): ... this.
872 (swap_linux_prpsinfo32_out): Rename to...
873 (swap_linux_prpsinfo32_ugid16_out): ... this.
874 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
875 (elf_backend_linux_prpsinfo32_ugid16): Define.
876 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
877 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
878 of the 32-bit Linux core PRPSINFO note.
879 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
880 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
881 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
882 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
883 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
884 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
885 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
886 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
887 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
888 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
890 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
892 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
893 `gap' member ahead of `pr_flag'.
895 2017-10-11 Pedro Alves <palves@redhat.com>
897 * bfd.c (_doprnt): Rename to ...
898 (_bfd_doprnt): ... this.
899 (error_handler_internal): Adjust.
901 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
903 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
904 instead of incrementing it.
905 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
907 2017-10-10 Renlin Li <renlin.li@arm.com>
910 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
911 symbols into dynamic.
913 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
916 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
917 (riscv_elf_link_hash_table_create): Initialize max_alignment to
919 (_bfd_riscv_relax_section): Cache the max alignment of output
920 sections if possible.
922 2017-10-10 Alan Modra <amodra@gmail.com>
924 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
925 .opd whenever .opd is present and non-zero size. Move code
926 setting abiversion to/from output file earlier. Only set
927 u.opd.func_sec when --gc-sections. Read relocs and set up
928 u.opd.func_sec values here..
929 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
931 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
933 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
935 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
938 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
940 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
941 .interp section with "ld --no-dynamic-linker".
943 2017-10-09 Alan Modra <amodra@gmail.com>
946 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
947 funcinfo_hash_table and varinfo_hash_table.
949 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
951 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
952 in read-only section with minfo.
953 (sh_elf_size_dynamic_sections): Likewise.
955 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
957 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
960 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
962 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
963 this_hdr.sh_entsize only if section size > 0.
965 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
967 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
969 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
971 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
972 in read-only section with minfo.
973 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
975 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
977 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
980 2017-10-06 John Baldwin <jhb@FreeBSD.org>
982 * elf-bfd.h (struct elf_backend_data): Add
983 `elf_backend_grok_freebsd_prstatus'.
984 * elf.c (elfcore_grok_freebsd_note): Call
985 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
987 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
989 (elf_backend_grok_freebsd_prstatus): Define.
990 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
991 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
993 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
995 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
996 and has_non_got_reloc with zero_undefweak.
997 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
998 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
1000 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
1001 has_non_got_reloc with zero_undefweak.
1002 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
1003 has_got_reloc and has_non_got_reloc with zero_undefweak.
1004 (elf_x86_link_hash_entry): Likewise.
1006 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1008 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
1009 (VERIFY_COPY_RELOC): Likewise.
1011 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1013 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
1014 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1015 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1017 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1019 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
1020 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1021 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1023 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1025 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
1026 * elf32-i386.c (elf_i386_relocate_section): Use it.
1027 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1029 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1031 * elf32-i386.c (X86_SIZE_TYPE_P): New.
1032 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1033 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
1034 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1035 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
1037 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1039 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
1040 (PLT_LOCAL_IFUNC_P): Likewise.
1041 * elf32-i386.c (elf_i386_relocate_section): Use them.
1042 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1044 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1046 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
1047 * elf32-i386.c (elf_i386_relocate_section): Use it.
1048 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1050 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1052 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1053 * elf32-i386.c (elf_i386_relocate_section): Use it.
1054 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1056 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1058 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1059 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1060 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1061 (X86_PCREL_TYPE_P): This.
1062 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1063 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1064 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1066 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1068 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1070 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1071 * elf32-i386.c (elf_i386_tls_transition): Use it.
1072 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1074 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1076 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1077 Dump dynamic relocation in read-only section with minfo if
1079 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1080 (maybe_set_textrel): Likewise.
1081 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1082 read-only section with minfo.
1084 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1086 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1088 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1090 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1091 in read-only section with minfo.
1092 (tilepro_elf_size_dynamic_sections): Likewise.
1093 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1094 (tilegx_elf_size_dynamic_sections): Likewise.
1096 2017-10-05 Pedro Alves <palves@redhat.com>
1099 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1100 ellipsis parameter. Split out bfd_error_on_input code to..
1101 (bfd_set_input_error): .. New function.
1102 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1103 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1104 * bfd-in2.h: Regenerate.
1106 2017-10-05 Alan Modra <amodra@gmail.com>
1108 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1109 fini_array error value.
1111 2017-10-05 Alan Modra <amodra@gmail.com>
1114 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1116 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1118 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1119 (bfd_elf_set_group_contents): Add associated reloc section indices
1122 2017-10-04 Alan Modra <amodra@gmail.com>
1124 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1125 classify symbols for ELFv2.
1127 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1130 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1131 undergoes default promotion.
1132 * bfd-in2.h: Regenerate.
1134 2017-10-02 Alan Modra <amodra@gmail.com>
1136 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1137 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1139 2017-10-01 Alan Modra <amodra@gmail.com>
1142 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1143 (add_line_info): Always put end_sequence last.
1145 2017-10-01 Alan Modra <amodra@gmail.com>
1148 * dwarf2.c (read_section): Allocate buffer with extra byte for
1149 bfd_simple_get_relocated_section_contents rather than copying
1152 2017-09-29 Alan Modra <amodra@gmail.com>
1154 * merge.c (merge_strings): Return FALSE on malloc failure.
1155 (_bfd_merge_sections): Return failures from record_section and
1158 2017-09-28 Alan Modra <amodra@gmail.com>
1161 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1162 a case where plugin_notice isn't called.
1164 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1166 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1169 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1172 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1173 output_bfd to info->callbacks->minfo.
1175 2017-09-26 Nick Clifton <nickc@redhat.com>
1178 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1179 assertion failure if elf_x86_64_rtype_to_howto has already issued
1182 2017-09-26 Alan Modra <amodra@gmail.com>
1185 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1188 2017-09-26 Nick Clifton <nickc@redhat.com>
1191 * dwarf2.c (read_formatted_entries): Fail early if we know that
1192 the loop parsing data entries will overflow the end of the
1195 2017-09-26 Alan Modra <amodra@gmail.com>
1198 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1199 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1200 to stash->info_ptr_memory, and check die_ref is within that memory.
1201 Set info_ptr_end correctly when another CU is refd. Check die_ref
1202 for DW_FORM_ref4 etc. is within CU.
1204 2017-09-26 Alan Modra <amodra@gmail.com>
1207 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1208 (read_formatted_entries): Init "fe".
1209 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1211 2017-09-26 Alan Modra <amodra@gmail.com>
1214 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1215 bounds in inner loop.
1217 2017-09-25 Alan Modra <amodra@gmail.com>
1220 * dwarf1.c (parse_die): Sanity check pointer against section limit
1221 before dereferencing.
1222 (parse_line_table): Likewise.
1224 2017-09-25 Alan Modra <amodra@gmail.com>
1227 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1229 (parse_comp_unit): Likewise.
1231 2017-09-25 Alan Modra <amodra@gmail.com>
1234 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1236 2017-09-24 Alan Modra <amodra@gmail.com>
1239 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1240 within section bounds.
1242 2017-09-24 Alan Modra <amodra@gmail.com>
1245 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1247 2017-09-24 Alan Modra <amodra@gmail.com>
1250 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1251 pname param. Return status. Make name const. Don't abort,
1252 return an error. Formatting. Exit if current info_ptr matches
1253 orig_info_ptr. Update callers.
1254 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1255 nested_funcs an array of structs for extensibility. Formatting.
1257 2017-09-24 Alan Modra <amodra@gmail.com>
1260 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1261 rather than dividing by zero.
1263 2017-09-24 Alan Modra <amodra@gmail.com>
1266 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1268 2017-09-24 Alan Modra <amodra@gmail.com>
1271 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1273 2017-09-24 Alan Modra <amodra@gmail.com>
1276 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1277 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1280 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1283 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1286 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1289 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1290 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1292 2017-09-22 Pedro Alves <palves@redhat.com>
1293 Alan Modra <amodra@gmail.com>
1295 * version.h: Add comment.
1297 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1299 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1300 NT_S390_GS_BC, correct the previously swapped invocations of
1301 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1303 2017-09-19 Alan Modra <amodra@gmail.com>
1306 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1309 2017-09-19 Alan Modra <amodra@gmail.com>
1312 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1313 symbols before calculating verrefs. Don't renumber dynsyms
1314 after gc. Exclude .gnu.version when zero or one dynsym.
1315 Localize some vars and reindent.
1317 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1320 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1321 return from bfd_canonicalize_dynamic_reloc.
1323 2017-09-15 Alan Modra <amodra@gmail.com>
1326 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1327 overflows bfd_size_type.
1329 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1332 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1333 to indicate if conversion is performed.
1334 (elf_i386_check_relocs): Cache section contents and relocations
1335 if conversion is performed.
1336 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1337 contents and relocations if conversion is performed.
1339 2017-09-14 Nick Clifton <nickc@redhat.com>
1342 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1345 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1347 * elfxx-x86.h: Fix a typo in comments.
1349 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1351 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1353 2017-09-09 Alan Modra <amodra@gmail.com>
1355 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1358 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1360 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1361 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1362 (elf_i386_finish_dynamic_symbol): Likewise.
1363 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1364 (elf_x86_64_finish_dynamic_symbol): Likewise.
1365 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1366 (_bfd_x86_elf_fixup_symbol): Likewise.
1368 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1370 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1371 check has_non_got_reloc.
1373 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1376 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1377 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1378 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1379 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1380 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1381 and linker_def on __ehdr_start if it is referenced and not
1383 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1384 and return TRUE when building executable, if a symbol has
1385 non-GOT/non-PLT relocations in text section or there is no
1387 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1389 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1391 * elfxx-x86.h: Update comments.
1393 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1395 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1396 elf_x86_plt_layout_table with elf_x86_init_table.
1397 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1399 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1401 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1402 (elf_x86_init_table): This.
1403 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1404 elf_x86_plt_layout_table with elf_x86_init_table.
1406 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1408 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1409 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1410 * configure: Regenerated.
1411 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1412 and r_sym fields of plt_layout.
1413 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1415 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1416 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1417 r_info nor r_sym fields.
1418 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1420 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1422 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1424 * (_bfd_riscv_relax_align): Call bfd_set_error and
1425 print an error message when unable to relax a .align directive.
1427 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1429 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1430 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1431 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1432 R_RISCV_PCREL_HI20 relocs, and pass the result to
1433 riscv_record_pcrel_hi_reloc.
1435 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1437 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1438 r_type_p. Remove the converted argument. Replace
1439 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1440 the new relocation type via r_type_p.
1441 (elf_i386_relocate_section): Likewise.
1442 (elf_i386_finish_dynamic_symbol): Likewise.
1443 (need_convert_load): Removed.
1444 (check_relocs_failed): Updated.
1445 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1446 instead of setting need_convert_load.
1447 (_bfd_i386_elf_convert_load): Removed.
1448 * elf64-x86-64.c (need_convert_load): Removed.
1449 (check_relocs_failed): Updated.
1450 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1451 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1452 Return the new relocation type via r_type_p.
1453 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1454 instead of setting need_convert_load.
1455 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1457 (_bfd_x86_64_elf_convert_load): Removed.
1458 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1459 with SYMBOL_REFERENCES_LOCAL_P.
1460 (elf_x86_64_finish_dynamic_symbol): Likewise.
1461 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1463 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1464 (_bfd_x86_elf_link_symbol_references_local): New function.
1465 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1466 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1467 SYMBOL_REFERENCES_LOCAL_P.
1468 (elf_x86_link_hash_entry): Add local_ref.
1469 (elf_x86_link_hash_table): Remove convert_load.
1470 (_bfd_i386_elf_convert_load): Removed.
1471 (_bfd_x86_64_elf_convert_load): Likewise.
1472 (_bfd_x86_elf_link_symbol_references_local): New.
1474 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1476 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1477 (elf_x86_64_info_to_howto): Get the real relocation type by
1478 masking out R_X86_64_converted_reloc_bit.
1479 (elf_x86_64_check_tls_transition): Get the real relocation type
1480 by masking out R_X86_64_converted_reloc_bit.
1481 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1482 instead of setting converted_reloc.
1483 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1484 instead of converted_reloc. Get the real relocation type by
1485 masking out R_X86_64_converted_reloc_bit.
1486 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1487 R_X86_64_converted_reloc_bit is valid.
1488 * elfxx-x86.h (converted_reloc): Removed.
1490 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1492 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1493 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1494 to get the relocation type again.
1495 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1496 r_type when calling elf_x86_64_tls_transition. Don't use
1497 ELF32_R_TYPE to get the relocation type again.
1499 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1501 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1504 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1506 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1507 argument. Don't check relocation overflow. Avoid relocation
1508 overflow if --no-relax is used. Set converted_reloc on symbol
1509 if a GOTPCREL relocation is converted.
1510 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1511 --no-relax if GOTPCREL relocation conversion leads to relocation
1513 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1515 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1516 Edmar Wienskoski <edmar.wienskoski@nxp.com
1518 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1519 (ppc_elf_check_relocs): Handle it.
1520 (ppc_elf_vle_split20): New function.
1521 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1523 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1526 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1527 for x86-64 if GOT_TLS_GDESC_P is true.
1529 2017-09-03 Alan Modra <amodra@gmail.com>
1532 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1534 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1536 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1537 tls_get_addr for x86-64 in one place.
1539 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1541 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1542 with elfxx-x86.lo for 64-bit BFD.
1543 * configure: Regenerated.
1545 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1547 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1548 (_bfd_i386_elf_convert_load): This. Remove static.
1549 (elf_i386_size_dynamic_sections): Removed.
1550 (elf_backend_size_dynamic_sections): Likewise.
1551 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1552 (_bfd_x86_64_elf_convert_load): This. Remove static.
1553 (elf_x86_64_size_dynamic_sections): Removed.
1554 (elf_backend_size_dynamic_sections): Likewise.
1555 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1556 (elf_x86_allocate_dynrelocs): This. Make it static.
1557 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1558 (elf_x86_allocate_local_dynreloc): This. Make it static.
1559 (elf_i386_is_reloc_section): New function.
1560 (elf_x86_64_is_reloc_section): Likewise.
1561 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1562 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1563 Rearrange got_entry_size initialization.
1564 (_bfd_x86_elf_size_dynamic_sections): New function.
1565 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1566 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1567 (_bfd_i386_elf_convert_load): New.
1568 (_bfd_x86_64_elf_convert_load): Likewise.
1569 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1570 (elf_backend_size_dynamic_sections): Likewise.
1571 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1572 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1574 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1576 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1579 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1581 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1582 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1584 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1586 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1587 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1588 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1589 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1590 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1591 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1593 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1595 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1596 (elf_i386_allocate_local_dynrelocs): Likewise.
1597 (elf_i386_size_dynamic_sections): Replace
1598 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1599 with _bfd_x86_elf_allocate_dynrelocs and
1600 _bfd_x86_elf_allocate_local_dynrelocs.
1601 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1602 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1603 (elf_x86_64_size_dynamic_sections): Replace
1604 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1605 with _bfd_x86_elf_allocate_dynrelocs and
1606 _bfd_x86_elf_allocate_local_dynrelocs.
1607 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1608 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1609 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1610 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1612 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1614 * elf32-i386.c (is_i386_elf): Removed.
1615 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1616 (elf_i386_size_dynamic_sections): Likewise.
1617 (elf_i386_relocate_section): Likewise.
1618 * elf64-x86-64.c (is_x86_64_elf): Removed.
1619 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1621 (elf_x86_64_size_dynamic_sections): Likewise.
1622 (elf_x86_64_relocate_section): Likewise.
1623 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1625 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1628 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1630 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1631 (elf_i386_allocate_dynrelocs): Replace
1632 elf_i386_compute_jump_table_size with
1633 elf_x86_compute_jump_table_size.
1634 (elf_i386_size_dynamic_sections): Likewise.
1635 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1636 (elf_x86_64_allocate_dynrelocs): Replace
1637 elf_x86_64_compute_jump_table_size with
1638 elf_x86_compute_jump_table_size.
1639 (elf_x86_64_size_dynamic_sections): Likewise.
1640 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1642 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1643 (elf_x86_compute_jump_table_size): New.
1645 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1647 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1649 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1650 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1652 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1654 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1655 with htab->is_vxworks.
1656 (elf_i386_size_dynamic_sections): Likewise.
1657 (elf_i386_relocate_section): Likewise.
1658 (elf_i386_finish_dynamic_symbol): Likewise.
1659 (elf_i386_finish_dynamic_sections): Likewise.
1661 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1663 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1664 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1665 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1666 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1667 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1668 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1669 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1670 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1672 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1675 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1676 ELF_COMMON_DEF_P for common symbols.
1678 2017-09-02 Alan Modra <amodra@gmail.com>
1680 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1681 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1682 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1684 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1686 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1687 (elf_backend_gc_mark_hook): Likewise.
1688 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1689 (elf_backend_gc_mark_hook): Likewise.
1690 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1691 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1692 (elf_backend_gc_mark_hook): Likewise.
1694 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1696 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1697 (elf_backend_adjust_dynamic_symbol): Likewise.
1698 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1699 (elf_backend_adjust_dynamic_symbol): Likewise.
1700 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1701 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1702 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1703 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1704 (elf_backend_adjust_dynamic_symbol): Likewise.
1706 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1708 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1711 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1713 * elf32-i386.c (elf_i386_mkobject): Removed.
1714 (bfd_elf32_mkobject): Likewise.
1715 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1716 (bfd_elf64_mkobject): Likewise.
1717 (bfd_elf32_mkobject): Likewise.
1718 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1719 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1720 (bfd_elf64_mkobject): Likewise.
1721 (bfd_elf32_mkobject): Likewise.
1723 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1725 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1726 Call _bfd_x86_elf_link_setup_gnu_properties.
1727 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1728 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1730 (elf_x86_64_non_lazy_plt): Likewise.
1731 (elf_x86_64_lazy_bnd_plt): Likewise.
1732 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1733 (elf_x86_64_lazy_ibt_plt): Likewise.
1734 (elf_x32_lazy_ibt_plt): Likewise.
1735 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1736 (elf_x32_non_lazy_ibt_plt): Likewise.
1737 (elf_x86_64_nacl_plt): Likewise.
1738 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1739 _bfd_x86_elf_link_setup_gnu_properties.
1740 * elfxx-x86.c: Include elf-vxworks.h".
1741 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1742 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1743 comments for pic_plt0_entry and pic_plt_entry.
1744 (elf_x86_non_lazy_plt_layout): Likewise.
1745 (elf_x86_plt_layout_table): New.
1746 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1748 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1751 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1752 .eh_frame section for the second PLT.
1753 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1754 alignment of .eh_frame section for the second PLT.
1756 2017-09-01 Nick Clifton <nickc@redhat.com>
1759 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1762 2017-09-01 Nick Clifton <nickc@redhat.com>
1765 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1766 attribute buffer is NUL terminated.
1768 2017-08-31 Nick Clifton <nickc@redhat.com>
1771 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1772 to dwarf string sections.
1774 2017-08-31 Alan Modra <amodra@gmail.com>
1776 * po/SRC-POTFILES.in: Regenerate.
1778 2017-08-31 Alan Modra <amodra@gmail.com>
1780 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1781 for a section containing just a terminator. Allow multiple
1782 terminators at end of section.
1783 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1784 sections when not adding alignment. Assert on terminator in
1787 2017-08-31 Alan Modra <amodra@gmail.com>
1791 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1794 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1796 * configure.ac (bfd_backends): Add elf64.lo together with
1797 elfxx-x86.lo for 64-bit BFD.
1798 * configure: Regenerated.
1800 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1802 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1805 2017-08-31 Alan Modra <amodra@gmail.com>
1808 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1809 before _close_and_cleanup. Call iovec->bclose after.
1810 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1812 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1814 * elf32-i386.c (elf_i386_plt_type): Removed.
1815 (elf_i386_plt): Likewise.
1816 (elf_i386_get_synthetic_symtab): Updated. Call
1817 _bfd_x86_elf_get_synthetic_symtab.
1818 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1819 (elf_x86_64_plt): Likewise.
1820 (elf_x86_64_get_synthetic_symtab): Updated. Call
1821 _bfd_x86_elf_get_synthetic_symtab.
1822 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1823 (elf_x86_64_get_plt_got_vma): Likewise.
1824 (elf_i386_valid_plt_reloc_p): Likewise.
1825 (elf_x86_64_valid_plt_reloc_p): Likewise.
1826 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1827 * elfxx-x86.h (elf_x86_plt_type): New.
1828 (elf_x86_plt): Likewise.
1829 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1831 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1833 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1834 target_id instead of elf_machine_code.
1836 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1838 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1839 (elf_i386_lazy_plt_layout): Likewise.
1840 (elf_i386_non_lazy_plt_layout): Likewise.
1841 (elf_i386_plt_layout): Likewise.
1842 (elf_i386_link_hash_table): Likewise.
1843 (elf_i386_next_tls_desc_index): Likewise.
1844 (elf_i386_srelplt2): Likewise.
1845 (elf_i386_plt): Likewise.
1846 (elf_i386_lazy_plt): Likewise.
1847 (elf_i386_non_lazy_plt): Likewise.
1848 (elf_i386_link_hash_table_create): Likewise.
1849 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1850 (elf_i386_lazy_plt): Updated.
1851 (elf_i386_non_lazy_plt): Likewise.
1852 (elf_i386_lazy_ibt_plt): Likewise.
1853 (elf_i386_non_lazy_ibt_plt): Likewise.
1854 (elf_i386_allocate_dynrelocs): Likewise.
1855 (elf_i386_size_dynamic_sections): Likewise.
1856 (elf_i386_relocate_section): Likewise.
1857 (elf_i386_finish_dynamic_symbol): Likewise.
1858 (elf_i386_finish_dynamic_sections): Likewise.
1859 (elf_i386_get_synthetic_symtab): Likewise.
1860 (elf_i386_link_setup_gnu_properties): Likewise.
1861 (elf_i386_nacl_plt): Likewise.
1862 * elf64-x86-64.c (ABI_64_P): Removed.
1863 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1864 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1865 (elf_x86_64_lazy_plt_layout): Likewise.
1866 (elf_x86_64_non_lazy_plt_layout): Likewise.
1867 (elf_x86_64_plt_layout): Likewise.
1868 (elf_x86_64_link_hash_table): Likewise.
1869 (elf_x86_64_plt): Likewise.
1870 (elf_x86_64_lazy_plt): Likewise.
1871 (elf_x86_64_non_lazy_plt): Likewise.
1872 (elf_x86_64_link_hash_table_create): Likewise.
1873 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1874 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1875 (elf_x86_64_lazy_plt): Updated.
1876 (elf_x86_64_non_lazy_plt): Likewise.
1877 (elf_x86_64_lazy_bnd_plt): Likewise.
1878 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1879 (elf_x86_64_lazy_ibt_plt): Likewise.
1880 (elf_x32_lazy_ibt_plt): Likewise.
1881 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1882 (elf_x32_non_lazy_ibt_plt): Likewise.
1883 (elf_x86_64_allocate_dynrelocs): Likewise.
1884 (elf_x86_64_size_dynamic_sections): Likewise.
1885 (elf_x86_64_relocate_section): Likewise.
1886 (elf_x86_64_finish_dynamic_symbol): Likewise.
1887 (elf_x86_64_finish_dynamic_sections): Likewise.
1888 (elf_x86_64_get_synthetic_symtab): Likewise.
1889 (elf_x86_64_link_setup_gnu_properties): Likewise.
1890 (elf_x86_64_nacl_plt): Likewise.
1891 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1893 (ELF32_DYNAMIC_INTERPRETER): New.
1894 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1895 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1896 (_bfd_x86_elf_link_hash_table_create): Likewise.
1897 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1898 (elf_x86_link_hash_table_free): This. Make it static.
1899 * elfxx-x86.h: Don't include "objalloc.h".
1901 (elf_x86_lazy_plt_layout): Likewise.
1902 (elf_x86_non_lazy_plt_layout): Likewise.
1903 (elf_x86_plt_layout): Likewise.
1904 (_bfd_x86_elf_link_hash_table_create): Likewise.
1905 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1906 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1907 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1908 srelplt2 and next_tls_desc_index.
1909 (_bfd_x86_elf_link_hash_table_free): Removed.
1911 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1913 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1914 branch offset interpretation.
1916 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1919 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1921 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1923 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1924 (elf_x86_64_srelplt2): Likewise.
1926 2017-08-30 Alan Modra <amodra@gmail.com>
1928 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1929 (ppc64_elf_tls_optimize): Set it.
1930 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1931 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1932 addis would add zero.
1933 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1934 (ppc_elf_tls_optimize): Set it.
1935 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1936 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1938 2017-08-30 Alan Modra <amodra@gmail.com>
1940 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1941 __tls_get_addr call sequences to LE, don't move the addi down
1942 to the nop. Replace the bl with addi and leave the nop alone.
1944 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1946 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1948 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1950 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1952 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1954 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1955 (BFD64_BACKENDS): Likewise.
1956 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1957 (BFD64_BACKENDS_CFILES): Likewise.
1958 * Makefile.in: Regenerated.
1959 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1960 elf32-i386.lo and elf64-x86-64.lo.
1961 * configure: Regenerated.
1962 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1963 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1964 "objalloc.h" and "hashtab.h".
1965 (ELIMINATE_COPY_RELOCS): Removed.
1966 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1967 (SYMBOL_NO_COPYRELOC): Likewise.
1968 (elf_i386_link_hash_entry): Likewise.
1969 (GOT_UNKNOWN): Likewise.
1970 (GOT_NORMAL): Likewise.
1971 (GOT_TLS_GD): Likewise.
1972 (elf_i386_hash_entry): Likewise.
1973 (elf_i386_obj_tdata): Likewise.
1974 (elf_i386_tdata): Likewise.
1975 (elf_i386_local_got_tls_type): Likewise.
1976 (elf_i386_local_tlsdesc_gotent): Likewise.
1977 (elf_i386_hash_table): Likewise.
1978 (elf_i386_link_hash_newfunc): Likewise.
1979 (elf_i386_local_htab_hash): Likewise.
1980 (elf_i386_local_htab_eq): Likewise.
1981 (elf_i386_get_local_sym_hash): Likewise.
1982 (elf_i386_link_hash_table_free): Likewise.
1983 (elf_i386_copy_indirect_symbol): Likewise.
1984 (elf_i386_fixup_symbol): Likewise.
1985 (elf_i386_readonly_dynrelocs): Likewise.
1986 (elf_i386_always_size_sections): Likewise.
1987 (elf_i386_set_tls_module_base): Likewise.
1988 (elf_i386_dtpoff_base): Likewise.
1989 (compare_relocs): Likewise.
1990 (elf_i386_hash_symbol): Likewise.
1991 (elf_i386_parse_gnu_properties): Likewise.
1992 (elf_i386_merge_gnu_properties): Likewise.
1993 (elf_i386_link_check_relocs): Likewise.
1994 (elf_i386_merge_symbol_attribute): Likewise.
1995 (bfd_elf32_bfd_link_check_relocs): Likewise.
1996 (elf_backend_copy_indirect_symbol): Likewise.
1997 (elf_backend_always_size_sections): Likewise.
1998 (elf_backend_omit_section_dynsym): Likewise.
1999 (elf_backend_hash_symbol): Likewise.
2000 (elf_backend_fixup_symbol): Likewise.
2001 (elf_backend_parse_gnu_properties): Likewise.
2002 (elf_backend_merge_gnu_properties): Likewise.
2003 (elf_backend_merge_symbol_attribute): Likewise.
2004 (elf_i386_mkobject): Updated.
2005 (elf_i386_link_hash_table_create): Likewise.
2006 (elf_i386_check_tls_transition): Likewise.
2007 (elf_i386_tls_transition): Likewise.
2008 (elf_i386_convert_load_reloc): Likewise.
2009 (elf_i386_check_relocs): Likewise.
2010 (elf_i386_adjust_dynamic_symbol): Likewise.
2011 (elf_i386_allocate_dynrelocs): Likewise.
2012 (elf_i386_convert_load): Likewise.
2013 (elf_i386_size_dynamic_sections): Likewise.
2014 (elf_i386_relocate_section): Likewise.
2015 (elf_i386_finish_dynamic_symbol ): Likewise.
2016 (elf_i386_finish_dynamic_sections): Likewise.
2017 (elf_i386_output_arch_local_syms): Likewise.
2018 (elf_i386_get_synthetic_symtab): Likewise.
2019 (elf_i386_link_setup_gnu_properties): Likewise.
2020 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
2021 of elf_link_hash_table, as base.
2022 (elf_i386_next_tls_desc_index): New.
2023 (elf_i386_srelplt2): Likewise.
2024 (elf_i386_plt): Likewise.
2025 (elf_i386_lazy_plt): Likewise.
2026 (elf_i386_non_lazy_plt): Likewise.
2027 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
2028 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2029 "objalloc.h" and "hashtab.h".
2030 (ELIMINATE_COPY_RELOCS): Removed.
2031 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2032 (SYMBOL_NO_COPYRELOC): Likewise.
2033 (elf_x86_64_link_hash_entry): Likewise.
2034 (GOT_UNKNOWN): Likewise.
2035 (GOT_NORMAL): Likewise.
2036 (GOT_TLS_GD): Likewise.
2037 (elf_x86_64_hash_entry): Likewise.
2038 (elf_x86_64_obj_tdata): Likewise.
2039 (elf_x86_64_tdata): Likewise.
2040 (elf_x86_64_local_got_tls_type): Likewise.
2041 (elf_x86_64_local_tlsdesc_gotent): Likewise.
2042 (elf_x86_64_hash_table): Likewise.
2043 (elf_x86_64_link_hash_newfunc): Likewise.
2044 (elf_x86_64_local_htab_hash): Likewise.
2045 (elf_x86_64_local_htab_eq): Likewise.
2046 (elf_x86_64_get_local_sym_hash): Likewise.
2047 (elf_x86_64_link_hash_table_free): Likewise.
2048 (elf_x86_64_copy_indirect_symbol): Likewise.
2049 (elf_x86_64_fixup_symbol): Likewise.
2050 (elf_x86_64_readonly_dynrelocs): Likewise.
2051 (elf_x86_64_always_size_sections): Likewise.
2052 (elf_x86_64_set_tls_module_base): Likewise.
2053 (elf_x86_64_dtpoff_base): Likewise.
2054 (compare_relocs): Likewise.
2055 (elf_x86_64_merge_symbol_attribute): Likewise.
2056 (elf_x86_64_hash_symbol): Likewise.
2057 (elf_x86_64_parse_gnu_properties): Likewise.
2058 (elf_x86_64_merge_gnu_properties): Likewise.
2059 (elf_x86_64_link_check_relocs): Likewise.
2060 (elf_backend_copy_indirect_symbol): Likewise.
2061 (elf_backend_always_size_sections): Likewise.
2062 (bfd_elf64_bfd_link_check_relocs): Likewise.
2063 (elf_backend_merge_symbol_attribute): Likewise.
2064 (elf_backend_hash_symbol): Likewise.
2065 (elf_backend_omit_section_dynsym): Likewise.
2066 (elf_backend_fixup_symbol): Likewise.
2067 (elf_backend_parse_gnu_properties): Likewise.
2068 (elf_backend_merge_gnu_properties): Likewise.
2069 (bfd_elf32_bfd_link_check_relocs): Likewise.
2070 (elf_x86_64_mkobject): Updated.
2071 (elf_x86_64_link_hash_table_create): Likewise.
2072 (elf_x86_64_check_tls_transition): Likewise.
2073 (elf_x86_64_tls_transition): Likewise.
2074 (elf_x86_64_convert_load_reloc): Likewise.
2075 (elf_x86_64_check_relocs): Likewise.
2076 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2077 (elf_x86_64_allocate_dynrelocs): Likewise.
2078 (elf_x86_64_convert_load): Likewise.
2079 (elf_x86_64_size_dynamic_sections): Likewise.
2080 (elf_x86_64_relocate_section): Likewise.
2081 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2082 (elf_x86_64_finish_dynamic_sections): Likewise.
2083 (elf_x86_64_output_arch_local_syms): Likewise.
2084 (elf_x86_64_get_synthetic_symtab): Likewise.
2085 (elf_x86_64_link_setup_gnu_properties): Likewise.
2086 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2087 instead of elf_link_hash_table, as base.
2088 (elf_x86_64_next_tls_desc_index): New.
2089 (elf_x86_64_srelplt2): Likewise.
2090 (elf_x86_64_plt): Likewise.
2091 (elf_x86_64_lazy_plt): Likewise.
2092 (elf_x86_64_non_lazy_plt): Likewise.
2093 * elfxx-x86.c: New file.
2094 * elfxx-x86.h: Likewise.
2096 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2098 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2100 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2102 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2104 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2105 sections before checking dynamic relocations and free invalid
2106 PLT section contents.
2107 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2109 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2111 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2112 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2114 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2117 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2119 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2121 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2123 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2125 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2127 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2130 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2131 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2132 Add a has_no_copy_on_protected bitfield.
2133 (elf_has_no_copy_on_protected): New.
2134 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2135 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2136 (elf_merge_gnu_property_list): Likewise.
2137 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2138 to FALSE for elf_has_no_copy_on_protected.
2139 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2140 (elf_i386_link_hash_entry): Add def_protected.
2141 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2142 when checking info->nocopyreloc.
2143 (elf_i386_link_setup_gnu_properties): Don't set
2144 extern_protected_data here.
2145 (elf_i386_merge_symbol_attribute): New function.
2146 (elf_backend_merge_symbol_attribute): New.
2147 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2148 (elf_x86_64_link_hash_entry): Add def_protected.
2149 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2150 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2151 when checking info->nocopyreloc.
2152 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2153 relocation run-time overflow and unresolvable R_X86_64_32S
2154 relocation against protected data symbol defined in shared object
2155 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2156 (elf_x86_64_link_setup_gnu_properties): Don't set
2157 extern_protected_data here.
2158 (elf_x86_64_merge_symbol_attribute): New function.
2159 (elf_backend_merge_symbol_attribute): New.
2161 2017-08-26 Alan Modra <amodra@gmail.com>
2163 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2164 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2165 (ppc_elf_relocate_section): Comment fix.
2166 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2167 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2168 Support dynamic relocs for TPREL16 when non-pic too.
2169 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2170 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2173 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2175 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2176 "symbol" in comments.
2177 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2179 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2182 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2183 R_X86_64_PC32 relocation run-time overflow and unresolvable
2184 R_X86_64_32S relocation with -z nocopyreloc.
2186 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2188 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2189 Undefined symbols may not have a type.
2190 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2192 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2194 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2195 bfd_link_info. Report shared, PIE or PDE object based on
2197 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2198 (elf_x86_64_relocate_section): Likewise.
2200 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2202 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2203 for function symbols.
2204 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2206 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2208 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2209 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2210 is set on any input relocatable file.
2211 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2213 2017-08-23 Alan Modra <amodra@gmail.com>
2216 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2217 ensure_undefweak_dynamic. Handle undefined too.
2218 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2219 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2220 (allocate_dynrelocs): Discard undefined non-default visibility
2221 relocs first. Make undefined syms dynamic. Tidy goto.
2223 2017-08-21 Alan Modra <amodra@gmail.com>
2224 H.J. Lu <hongjiu.lu@intel.com>
2227 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2228 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2230 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2233 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2234 undefined weak symbols.
2236 2017-08-18 Nick Clifton <nickc@redhat.com>
2239 * tekhex.c (getsym): Fix check for source pointer walking off the
2240 end of the input buffer.
2242 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2245 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2246 relocations in debug sections, change abort to _bfd_error_handler.
2248 2017-08-14 Nick Clifton <nickc@redhat.com>
2251 * elf.c (setup_group): Check for an empty or very small group
2253 * po/bfd.pot: Regenerate.
2255 2017-08-14 Alan Modra <amodra@gmail.com>
2258 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2259 alignment padding here.
2260 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2261 in a reverse pass over sections.
2263 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2266 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2267 for @plt suffixes first.
2268 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2270 2017-08-08 Nick Clifton <nickc@redhat.com>
2273 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2274 small section lengths.
2275 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2277 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2278 there is enough data present in the note.
2280 2017-08-08 Alan Modra <amodra@gmail.com>
2283 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2284 got.refcount for GOTOFF relocs, just create .got section.
2286 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2288 * elflink.c (elf_link_add_object_symbols): Move common symbol
2289 check after bed->common_definition.
2291 2017-08-07 Alan Modra <amodra@gmail.com>
2294 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2295 needed to define various dynamic tags have been discarded.
2297 2017-08-07 Nick Clifton <nickc@redhat.com>
2300 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2301 has not been set then use the bfd returned by
2302 _bfd_elf_link_setup_gnu_properties. If that is null then search
2303 through all the input bfds selecting the first normal, ELF format
2305 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2307 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2309 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2311 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2312 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2313 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2314 (elf_i386_link_check_relocs): New function.
2315 (bfd_elf32_bfd_link_check_relocs): New.
2316 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2318 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2319 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2320 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2321 (elf_x86_64_link_check_relocs): New function.
2322 (bfd_elf64_bfd_link_check_relocs): New.
2323 (bfd_elf32_bfd_link_check_relocs): Likewise.
2325 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2328 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2329 as undefined for --no-define-common.
2331 2017-08-05 Alan Modra <amodra@gmail.com>
2333 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2334 hppa_link_hash_table.
2336 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2338 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2339 entries for sysregs with negative indices.
2341 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2343 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2344 isn't the S/390 specific elf data.
2345 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2347 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2349 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2350 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2351 [R_RISCV_ADD16]: Likewise.
2352 [R_RISCV_ADD32]: Likewise.
2353 [R_RISCV_ADD64]: Likewise.
2354 [R_RISCV_SUB6]: Likewise.
2355 [R_RISCV_SUB8]: Likewise.
2356 [R_RISCV_SUB16]: Likewise.
2357 [R_RISCV_SUB32]: Likewise.
2358 [R_RISCV_SUB64]: Likewise.
2360 2017-07-31 Alan Modra <amodra@gmail.com>
2362 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2363 without ld.so checks.
2365 2017-07-29 Alan Modra <amodra@gmail.com>
2368 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2369 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2370 (is_elfv2_localentry0): Test non_zero_localentry.
2371 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2373 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2375 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2376 pointer check for htab->elf.irelplt.
2377 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2379 2017-07-27 Nick Clifton <nickc@redhat.com>
2382 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2384 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2386 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2388 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2390 (evax_bfd_print_emh): Check for invalid string lengths.
2392 2017-07-25 Nick Clifton <nickc@redhat.com>
2394 * po/fr.po: Updated French translation.
2396 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2399 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2400 16-bit absolute branches into 10-bit pc-relative branches on the
2401 MSP430 as well as the MSP430X.
2403 2017-07-25 Alan Modra <amodra@gmail.com>
2405 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2406 (stub_eh_frame_size): New function.
2407 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2408 (group_sections): Init group tls_get_addr_opt_bctrl.
2409 (ppc64_elf_size_stubs): Update sizing and initialization of
2410 .eh_frame. Iteration over stubs via group list.
2411 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2412 (ppc64_elf_finish_dynamic_sections): Update finalization of
2415 2017-07-24 Nick Clifton <nickc@redhat.com>
2418 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2419 of the relocs to the canonicalize_one_reloc routine.
2420 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2421 for the _bfd_mach_o_canonicalize_one_reloc field.
2422 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2423 res_base parameter. Use to check for corrupt pair relocs.
2424 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2426 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2428 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2431 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2432 enough data in the record before attempting to parse it.
2433 (_bfd_vms_slurp_eeom): Likewise.
2435 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2436 (image_set_ptr): Likewise.
2437 (alpha_vms_slurp_relocs): Likewise.
2439 (alpha_vms_object_p): Check for a truncated record.
2441 2017-07-24 Nick Clifton <nickc@redhat.com>
2444 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2445 an unrecognized reloc and sets the bfd_error value.
2446 * libbfd.h: Regenerate.
2447 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2449 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2450 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2451 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2452 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2453 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2455 2017-07-23 Alan Modra <amodra@gmail.com>
2457 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2460 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2463 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2464 reloc_class_ifunc for ifunc symbols.
2466 2017-07-19 Nick Clifton <nickc@redhat.com>
2469 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2470 correct magic bytes at the start, set the error to wrong format
2471 and clear the format selector before returning NULL.
2473 2017-07-19 Nick Clifton <nickc@redhat.com>
2476 * coff-rs6000.c (_bfd_strntol): New function.
2477 (_bfd_strntoll): New function.
2478 (GET_VALUE_IN_FIELD): New macro.
2479 (EQ_VALUE_IN_FIELD): new macro.
2480 (_bfd_xcoff_slurp_armap): Use new macros.
2481 (_bfd_xcoff_archive_p): Likewise.
2482 (_bfd_xcoff_read_ar_hdr): Likewise.
2483 (_bfd_xcoff_openr_next_archived_file): Likewise.
2484 (_bfd_xcoff_stat_arch_elt): Likewise.
2485 * coff64-rs6000.c (_bfd_strntol): New function.
2486 (_bfd_strntoll): New function.
2487 (GET_VALUE_IN_FIELD): New macro.
2488 (xcoff64_slurp_armap): Use new macros.
2490 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2491 John Eric Martin <John.Martin@emmicro-us.com>
2493 * bfd-in2.h: Regenerate.
2494 * libbfd.h: Regenerate.
2495 * elf32-arc.c (JLI): Define.
2496 * reloc.c: Add JLI relocations.
2498 2017-07-18 Nick Clifton <nickc@redhat.com>
2501 * coff-sh.c: Fix spelling typos.
2502 * compress.c: Likewise.
2503 * cpu-pdp11.c: Likewise.
2504 * ecofflink.c: Likewise.
2505 * elf-m10300.c: Likewise.
2507 * elf32-arm.c: Likewise.
2508 * elf32-m68k.c: Likewise.
2509 * elf32-nds32.c: Likewise.
2510 * elf32-ppc.c: Likewise.
2511 * elf32-sh.c: Likewise.
2512 * elf32-v850.c: Likewise.
2513 * elf64-ppc.c: Likewise.
2514 * elf64-x86-64.c: Likewise.
2515 * elflink.c: Likewise.
2516 * elfnn-aarch64.c: Likewise.
2517 * elfxx-mips.c: Likewise.
2519 * sunos.c: Likewise.
2520 * vms-alpha.c: Likewise.
2521 * xcofflink.c: Likewise.
2523 2017-07-18 Nick Clifton <nickc@redhat.com>
2526 * coffcode.h (handle_COMDAT): Replace abort with an error message
2529 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2532 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2535 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2537 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2539 2017-07-16 Alan Modra <amodra@gmail.com>
2541 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2542 __tls_index GOT entries when using __tls_get_addr_opt stub.
2543 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2545 2017-07-12 Alan Modra <amodra@gmail.com>
2547 * po/es.po: Update from translationproject.org/latest/bfd/.
2548 * po/fi.po: Likewise.
2549 * po/fr.po: Likewise.
2550 * po/id.po: Likewise.
2551 * po/ja.po: Likewise.
2552 * po/ro.po: Likewise.
2553 * po/ru.po: Likewise.
2554 * po/sr.po: Likewise.
2555 * po/sv.po: Likewise.
2556 * po/tr.po: Likewise.
2557 * po/uk.po: Likewise.
2558 * po/vi.po: Likewise.
2559 * po/zh_CN.po: Likewise.
2560 * po/hr.po: New file from translationproject.org.
2561 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2562 * configure: Regenerate.
2564 2017-07-12 Nick Clifton <nickc@redhat.com>
2566 Fix compile time warnings using gcc 7.1.1.
2567 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2569 (elf_xtensa_get_gotplt_section): Increase length of got_name
2571 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2572 default return of FALSE.
2573 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2574 default return of FALSE.
2576 2017-07-12 Alan Modra <amodra@gmail.com>
2578 * binary.c (binary_set_section_contents): Don't print filepos in
2580 (coff_write_object_contents): Cast size_t for error message.
2581 (coff_slurp_line_table): Don't use bfd_vma symndx.
2582 (coff_slurp_reloc_table): Remove unneeded cast.
2583 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2585 (find_abstract_instance_name): Likewise.
2586 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2587 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2588 (elf32_arm_check_relocs): Make r_symndx an int.
2589 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2591 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2593 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2595 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2596 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2597 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2598 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2599 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2600 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2601 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2602 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2603 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2604 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2605 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2606 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2607 and use %lu for error message.
2608 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2609 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2612 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2614 (elf32_arm_final_link_relocate): Likewise.
2615 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2616 * coffcode.h (styp_to_sec_flags): Likewise.
2617 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2618 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2619 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2620 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2621 (elf32_bfin_merge_private_bfd_data): Likewise.
2622 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2623 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2624 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2625 (i370_elf_relocate_section): Likewise.
2626 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2627 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2628 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2629 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2630 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2631 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2632 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2633 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2634 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2635 * ieee.c (ieee_write_id, read_id): Likewise.
2636 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2637 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2638 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2639 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2640 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2641 * stabs.c (_bfd_link_section_stabs): Likewise.
2643 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2645 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2646 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2647 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2648 * coff-sh.c (sh_relax_section): Likewise.
2649 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2650 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2651 * coffcode.h (coff_slurp_reloc_table): Likewise.
2652 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2653 (_bfd_coff_read_string_table): Likewise.
2654 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2655 * compress.c (bfd_get_full_section_contents): Likewise.
2656 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2657 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2658 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2659 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2660 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2661 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2662 (elf32_arm_write_section): Likewise.
2663 * elf32-bfin.c (bfin_relocate_section): Likewise.
2664 (bfinfdpic_relocate_section): Likewise.
2665 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2666 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2667 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2668 (elf_i386_relocate_section): Likewise.
2669 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2670 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2671 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2672 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2673 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2674 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2675 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2676 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2677 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2678 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2679 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2680 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2681 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2682 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2683 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2684 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2685 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2686 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2687 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2688 * elf32-sh.c (sh_elf_relax_section): Likewise.
2689 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2690 (sh_elf_relocate_section): Likewise.
2691 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2692 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2693 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2694 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2695 * elf32-v850.c (v850_elf_relax_section): Likewise.
2696 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2697 (elf_vax_relocate_section): Likewise.
2698 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2699 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2700 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2701 (do_fix_for_relocatable_link): Likewise.
2702 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2703 (elf64_alpha_relax_with_lituse): Likewise.
2704 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2705 (elf_hppa_final_link_relocate): Likewise.
2706 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2707 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2708 (elf64_vms_link_add_object_symbols): Likewise.
2709 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2710 (mmix_final_link_relocate): Likewise.
2711 * elf64-s390.c (invalid_tls_insn): Likewise.
2712 (elf_s390_relocate_section): Likewise.
2713 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2714 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2715 (elf_x86_64_relocate_section): Likewise.
2716 * elfcode.h (elf_slurp_symbol_table): Likewise.
2717 * elfcore.h (elf_core_file_p): Likewise.
2718 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2719 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2720 (elfNN_aarch64_relocate_section): Likewise.
2721 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2722 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2723 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2724 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2725 (_bfd_mips_elf_relocate_section): Likewise.
2726 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2727 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2728 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2729 * ieee.c (ieee_slurp_external_symbols): Likewise.
2730 * ihex.c (ihex_write_object_content): Likewise.
2731 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2732 * merge.c (_bfd_merged_section_offset): Likewise.
2733 * mmo.c (mmo_write_loc_chunk): Likewise.
2734 (mmo_write_object_contents): Likewise.
2735 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2736 * stabs.c (_bfd_link_section_stabs): Likewise.
2737 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2739 2017-07-11 Alan Modra <amodra@gmail.com>
2741 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2743 2017-07-11 Alan Modra <amodra@gmail.com>
2745 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2746 instruction" error using _bfd_error_handler, not einfo.
2748 2017-07-10 Nick Clifton <nickc@redhat.com>
2750 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2751 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2753 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2755 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2757 2017-07-07 Alan Modra <amodra@gmail.com>
2759 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2761 2017-07-07 Alan Modra <amodra@gmail.com>
2763 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2764 as long long. Move code replacing "ll" with "I64", and simplify.
2766 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2768 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2771 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2773 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2775 (line_info_add_file_name): Likewise.
2776 (decode_line_info): Likewise.
2778 2017-07-04 Tristan Gingold <gingold@adacore.com>
2780 * version.m4: Bump version to 2.29.51
2781 * configure: Regenerate.
2783 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2785 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2786 sanity check at the head of this function.
2788 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2790 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2791 dwarf_line_str_size.
2792 (struct attr_abbrev): Add field implicit_const.
2793 (dwarf_debug_sections): Add .debug_line_str.
2794 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2795 (dwarf_debug_section_assert): Add static assertion.
2796 (read_indirect_line_string): New.
2797 (read_abbrevs): Support DW_FORM_implicit_const.
2798 (is_str_attr): Support DW_FORM_line_strp.
2799 (read_attribute_value): Support DW_FORM_line_strp and
2800 DW_FORM_implicit_const.
2801 (read_attribute): Support DW_FORM_implicit_const.
2802 (line_info_add_include_dir, line_info_add_include_dir_stub):
2803 (line_info_add_file_name, read_formatted_entries): New.
2804 (decode_line_info, parse_comp_unit): Support DWARF 5.
2805 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2807 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2809 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2810 abort statement that was put for symbols that are not dynamic.
2812 2017-07-03 Tristan Gingold <gingold@adacore.com>
2814 * po/bfd.pot: Regenerate
2816 2017-07-03 Alan Modra <amodra@gmail.com>
2818 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2819 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2820 * elf.c (setup_group): Use "Lx" to print sh_size.
2821 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2822 unknown section type in hex.
2823 (copy_special_section_fields): Style fix.
2824 (bfd_section_from_shdr): Correct format for sh_link. Use a
2825 common error message for all the variants of unrecognized
2827 (assign_file_positions_for_load_sections): Use "Lx" for lma
2828 adjust error message.
2829 (assign_file_positions_for_non_load_sections): Formatting.
2830 (rewrite_elf_program_header): Formatting. Use "Lx" for
2831 bfd_vma values in error messages.
2832 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2833 ELF_R_SYM value to type expected by format.
2834 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2836 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2837 (elf_link_input_bfd): Use "Lx" for r_info.
2838 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2840 2017-07-03 Alan Modra <amodra@gmail.com>
2842 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2843 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2844 Microsoft C library variant of long long format specifier.
2845 (PRINT20): Cast value to bfd_uint64_t not long long.
2846 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2847 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2848 long long. Don't cast to bfd_vma.
2849 * elf32-score.c (score3_bfd_getl48): Likewise.
2850 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2852 2017-07-03 Alan Modra <amodra@gmail.com>
2854 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2856 (bfd_elf_print_symbol): Don't cast symbol->flags.
2857 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2858 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2859 _bfd_error_handler argument order.
2860 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2862 2017-07-03 Alan Modra <amodra@gmail.com>
2864 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2865 AC_TYPE_LONG_DOUBLE.
2866 * configure: Regenerate.
2867 * config.in: Regenerate.
2869 2017-06-29 Andrew Waterman <andrew@sifive.com>
2871 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2874 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2876 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2877 unless it is undefined weak.
2878 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2879 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2881 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2882 is not dynamic in PIC, abort.
2884 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2887 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2888 undefined weak symbols into dynamic.
2889 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2890 relocation for non-dynamic symbols.
2891 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2893 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2895 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2896 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2897 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2898 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2899 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2902 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2904 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2905 (elfcore_write_s390_gs_bc): Likewise.
2906 * elf.c (elfcore_grok_s390_gs_cb): New function.
2907 (elfcore_grok_s390_gs_bc): New function.
2908 (elfcore_grok_note): Call them.
2909 (elfcore_write_s390_gs_cb): New function.
2910 (elfcore_write_s390_gs_bc): New function.
2911 (elfcore_write_register_note): Call them.
2913 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2915 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2916 bfd_get_file_size. Check archive element size.
2917 (_bfd_generic_get_section_contents_in_window): Likewise.
2919 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2921 * bfd-in2.h: Regenerated.
2922 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2923 (bfd_get_file_size): Likewise.
2925 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2926 Matthew Fortune <matthew.fortune@imgtec.com>
2928 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2929 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2930 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2931 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2933 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2934 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2935 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2936 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2937 `bfd_mach_mips_interaptiv_mr2' entries.
2938 * bfd-in2.h: Regenerate.
2940 2017-06-27 Nick Clifton <nickc@redhat.com>
2942 * tekhex.c (pass_over): Revert accidental conversion of a local
2943 array to a static array.
2945 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2948 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2949 reloc addend if necessary. Adjust diff only if
2950 shrinked_insn_address < end_address.
2952 2017-06-27 Alan Modra <amodra@gmail.com>
2955 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2956 (_bfd_generic_get_section_contents_in_window): Likewise.
2958 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2960 * elfnn-riscv.c (perform_relocation): Support the new
2961 R_RISCV_32_PCREL relocation.
2962 (riscv_elf_relocate_section): Likewise.
2963 * elfxx-riscv.c (howto_table): Likewise.
2964 (riscv_reloc_map): Likewise.
2965 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2966 * libbfd.h: Regenerate.
2968 2017-06-27 Alan Modra <amodra@gmail.com>
2971 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2972 Use unsigned file pointer type, and remove cast.
2973 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2974 Add "count", not "sz".
2976 2017-06-26 Pedro Alves <palves@redhat.com>
2979 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2982 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2985 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2988 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2990 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2991 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2992 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2993 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2994 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2996 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2999 * compress.c (bfd_get_full_section_contents): Don't check the
3001 * libbfd.c (_bfd_generic_get_section_contents): Check for and
3002 reject a section whose size + offset is greater than the size
3004 (_bfd_generic_get_section_contents_in_window): Likewise.
3006 2017-06-26 Nick Clifton <nickc@redhat.com>
3009 * tekhex.c (getvalue): Check for the source pointer exceeding the
3010 end pointer before the first byte is read.
3012 2017-06-26 Nick Clifton <nickc@redhat.com>
3015 * opncls.c (get_build_id): Check that the section is big enough
3016 to contain the whole note.
3017 * compress.c (bfd_get_full_section_contents): Check for and reject
3018 a section whose size is greater than the size of the entire file.
3019 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3020 contain a notes section.
3022 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3024 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3026 (elf_s390_modify_segment_map): Likewise.
3027 (bfd_elf_s390_set_options): Lisewise.
3029 2017-06-26 Alan Modra <amodra@gmail.com>
3031 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
3033 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
3034 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
3035 .preinit_array on --just-syms bfds.
3036 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
3037 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
3038 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
3040 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3042 * elf.c (find_link): Bounds check "hint".
3044 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
3046 * elf32-arm.c (using_thumb_only): Update list of architectures in
3047 BFD_ASSERT for which the logic is valid.
3048 (using_thumb2_bl): Likewise.
3049 (using_thumb2): Likewise and return true for ARMv8-R.
3050 (arch_has_arm_nop): Likewise.
3051 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3052 merging logic. Update commentis for value 15 of v8m_baseline,
3053 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3054 merging of value 15 of Tag_CPU_arch.
3056 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3058 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3059 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3060 * bfd-in2.h: Regenerate.
3062 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3064 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3065 the error_alignment label forward. Properly align program
3066 property note section.
3068 2017-06-22 Eric Christopher <echristo@gmail.com>
3070 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3071 abs to fix a truncation warning.
3073 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3075 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3076 local undefined weak symbol to 0.
3077 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3079 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3081 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3082 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3083 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3084 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3085 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3086 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3087 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3088 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3090 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3092 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3093 (elf_i386_lazy_ibt_plt_entry): Likewise.
3094 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3095 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3096 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3097 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3098 (elf_i386_lazy_plt_layout): Likewise.
3099 (elf_i386_non_lazy_plt_layout): Likewise.
3100 (elf_i386_link_hash_entry): Add plt_second.
3101 (elf_i386_link_hash_table): Add plt_second and
3102 plt_second_eh_frame.
3103 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3104 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3105 the second PLT. Check the second PLT.
3106 (elf_i386_relocate_section): Use the second PLT to resolve
3107 PLT reference if needed.
3108 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3110 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3111 second PLT. Generate unwind info for the second PLT.
3112 (elf_i386_plt_type): Add plt_second.
3113 (elf_i386_get_synthetic_symtab): Support the second PLT.
3114 (elf_i386_parse_gnu_properties): Support
3115 GNU_PROPERTY_X86_FEATURE_1_AND.
3116 (elf_i386_merge_gnu_properties): Support
3117 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3118 on GNU_PROPERTY_X86_FEATURE_1_IBT
3119 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3120 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3121 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3122 is set on all relocatable inputs.
3123 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3124 (elf_x32_lazy_ibt_plt_entry): Likewise.
3125 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3126 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3127 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3128 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3129 (elf_x86_64_lazy_ibt_plt): Likewise.
3130 (elf_x32_lazy_ibt_plt): Likewise.
3131 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3132 (elf_x32_non_lazy_ibt_plt): Likewise.
3133 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3134 (elf_x86_64_parse_gnu_properties): Support
3135 GNU_PROPERTY_X86_FEATURE_1_AND.
3136 (elf_x86_64_merge_gnu_properties): Support
3137 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3138 on GNU_PROPERTY_X86_FEATURE_1_IBT
3139 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3140 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3141 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3142 is set on all relocatable inputs.
3144 2017-06-22 Nick Clifton <nickc@redhat.com>
3147 * som.c (setup_sections): NUL terminate the space_strings buffer.
3148 Check that the space.name field does not index beyond the end of
3149 the space_strings buffer.
3151 2017-06-21 Nick Clifton <nickc@redhat.com>
3154 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3156 2017-06-21 Nick Clifton <nickc@redhat.com>
3159 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3160 type of the size parameter.
3161 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3162 length of the counted string.
3163 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3164 (_bfd_vms_save_counted_string): Likewise.
3165 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3166 _bfd_vms_save_counted_string.
3167 (_bfd_vms_slurp_ehdr): Likewise.
3168 (_bfd_vms_slurp_egsd): Likewise.
3169 (Parse_module): Likewise.
3171 2017-06-21 Alan Modra <amodra@gmail.com>
3173 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3174 calls before tocsave calls.
3175 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3178 2017-06-21 Nick Clifton <nickc@redhat.com>
3181 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3182 bfd_get_full_section_contents returns no contents.
3184 2017-06-21 Nick Clifton <nickc@redhat.com>
3187 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3190 2017-06-21 Nick Clifton <nickc@redhat.com>
3193 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3195 (image_set_ptr): Likewise.
3196 (alpha_vms_fix_sec_rel): Likewise.
3197 (alpha_vms_slurp_relocs): Likewise.
3199 2017-06-21 Nick Clifton <nickc@redhat.com>
3202 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3204 (ieee_archive_p): Likewise.
3205 (ieee_object_p): Likewise.
3207 2017-06-21 Nick Clifton <nickc@redhat.com>
3210 * elf.c (setup_group): Zero the group section pointer list after
3211 allocation so that loops can be caught. Check for NULL pointers
3212 when processing a group list.
3214 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3216 * elf-s390.h: New file.
3217 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3219 (elf_s390_additional_program_headers): New function.
3220 (elf_s390_modify_segment_map): New function.
3221 (bfd_elf_s390_set_options): New function.
3222 (elf_backend_additional_program_headers)
3223 (elf_backend_modify_segment_map): Add macro definitions.
3225 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3228 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3229 the DYNAMIC bit instead of bfd_count_sections.
3231 2017-06-19 Nick Clifton <nickc@redhat.com>
3234 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3236 (evax_bfd_print_eeom): Likewise.
3237 (evax_bfd_print_egsd): Check for an overlarge record length.
3238 (evax_bfd_print_etir): Likewise.
3240 2017-06-19 Nick Clifton <nickc@redhat.com>
3243 * libieee.h (struct common_header_type): Add end_p field.
3244 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3246 (read_id): Check for a length that exceeds the remaining bytes in
3248 (ieee_seek): Initialise end_p.
3249 (ieee_archive_p): Likewise.
3250 (ieee_object_p): Likewise.
3252 2017-06-19 Nick Clifton <nickc@redhat.com>
3255 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3256 before reading the EIHS structure entries.
3258 2017-06-19 Nick Clifton <nickc@redhat.com>
3261 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3262 gsd_size. Check that there are enough bytes remaining to read the
3263 type and size of the next egsd. Check that the size of the egsd
3264 does not exceed the size of the record.
3266 2017-06-19 Alan Modra <amodra@gmail.com>
3268 * config.bfd: Correct targ_underscore for cris.
3270 2017-06-18 Alan Modra <amodra@gmail.com>
3272 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3273 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3275 2017-06-16 Nick Clifton <nickc@redhat.com>
3277 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3278 bucketlist is empty because there are no symbols to add to the
3281 2017-06-16 Alan Modra <amodra@gmail.com>
3287 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3288 (BFD_JUMP_TABLE_LINK): Likewise.
3289 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3290 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3291 (bfd_elf_define_start_stop): New function.
3292 * linker.c (bfd_generic_define_start_stop): New function.
3293 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3295 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3296 * aout-target.h (MY_bfd_define_start_stop): Define.
3297 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3298 * binary.c (binary_bfd_define_start_stop): Define.
3299 * bout.c (b_out_bfd_define_start_stop): Define.
3300 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3301 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3302 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3303 * coffcode.h (coff_bfd_define_start_stop): Define.
3304 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3305 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3306 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3307 * ieee.c (ieee_bfd_define_start_stop): Define.
3308 * ihex.c (ihex_bfd_define_start_stop): Define.
3309 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3310 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3311 * mmo.c (mmo_bfd_define_start_stop): Define.
3312 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3313 * oasys.c (oasys_bfd_define_start_stop): Define.
3314 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3315 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3316 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3317 * som.c (som_bfd_define_start_stop): Define.
3318 * srec.c (srec_bfd_define_start_stop): Define.
3319 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3320 * versados.c (versados_bfd_define_start_stop): Define.
3321 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3322 (alpha_vms_bfd_define_start_stop): Define.
3323 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3324 * bfd-in2.h: Regenerate.
3325 * libbfd.h: Regenerate.
3327 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3329 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3330 SYMBOL_REFERENCES_LOCAL.
3332 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3335 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3336 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3337 runtime for if there needs copy relocation elimination.
3338 (need_copy_relocation_p): New function. Return true for symbol with
3339 pc-relative references and if it's against read-only sections.
3340 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3341 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3342 that are related with accessing external objects.
3343 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3344 in elfNN_aarch64_check_relocs.
3346 2017-06-15 Nick Clifton <nickc@redhat.com>
3349 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3352 (ieee_archive_p): Likewise.
3354 2017-06-15 Nick Clifton <nickc@redhat.com>
3357 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3359 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3361 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3362 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3363 keep both windowed and call0 ABI PLT definitions.
3364 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3365 elf_xtensa_*_plt_entry endex.
3366 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3368 2017-06-14 Nick Clifton <nickc@redhat.com>
3371 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3374 2017-06-14 Nick Clifton <nickc@redhat.com>
3377 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3378 maximum value for the ascic pointer. Check that name processing
3379 does not read beyond this value.
3380 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3383 2017-06-14 Nick Clifton <nickc@redhat.com>
3386 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3387 (process_otr): Check for an invalid offset in the otr structure.
3389 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3391 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3393 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3399 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3400 vtable field to a union.
3401 (_bfd_elf_is_start_stop): Removed.
3402 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3403 __start_SECNAME and __stop_SECNAME symbols.
3404 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3405 * elflink.c (_bfd_elf_is_start_stop): Removed.
3406 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3407 _bfd_elf_is_start_stop.
3408 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3409 __stop_SECNAME symbols. Updated.
3410 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3411 (bfd_elf_gc_record_vtinherit): Likewise.
3412 (bfd_elf_gc_record_vtentry): Likewise.
3414 2017-06-13 Nick Clifton <nickc@redhat.com>
3417 * elflink.c (elf_link_adjust_relocs): Generate an error when
3418 encountering a reloc against a symbol removed by garbage
3421 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3423 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3424 to merge_gnu_properties.
3425 * elf-properties.c (elf_merge_gnu_properties): Add struct
3426 bfd_link_info * and pass it to merge_gnu_properties.
3427 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3428 and pass it to elf_merge_gnu_properties.
3429 (_bfd_elf_link_setup_gnu_properties): Pass info to
3430 elf_merge_gnu_property_list.
3431 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3433 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3435 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3438 * binary.c (binary_set_section_contents): Scale lma by octets
3439 per byte to set filepos.
3441 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3443 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3446 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3448 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3451 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3453 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3454 patched section contents for TLS IE reloc.
3455 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3457 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3459 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3460 RELOC_FOR_GLOBAL_SYMBOL macro.
3462 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3464 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3467 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3469 * config/tc-arc.c (md_undefined_symbol): Changed.
3470 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3472 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3474 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3477 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3479 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3480 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3482 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3484 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3487 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3489 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3490 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3491 is non-zero. Add clarifying comments.
3493 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3495 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3496 name. Use local IFUNC symbol name string to report unsupported
3497 non-PIC call to IFUNC function.
3498 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3499 when generating R_386_IRELATIVE relocation.
3500 (elf_i386_finish_dynamic_symbol): Likewise.
3501 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3503 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3504 when generating R_X86_64_IRELATIVE relocation.
3505 (elf_x86_64_finish_dynamic_symbol): Likewise.
3507 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3509 * elf.c (setup_group): Make sure BFD sections are created for all
3510 group sections in the input file when processing SHF_GROUP
3512 (bfd_section_from_shdr): Avoid duplicating logic already
3513 implemented in `setup_group'.
3515 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3518 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3519 if the hint address is zero.
3521 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3524 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3525 ELF_COMMON_DEF_P for common symbols.
3527 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3529 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3530 SEC_GROUP sections as SEC_EXCLUDE.
3531 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3532 (assign_section_numbers): Use resolve_section_groups flag instead
3533 of relocatable link type.
3534 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3535 flag instead of checking the final_link flag for part of the
3536 checks in here. Fix white space as a result.
3537 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3538 instead of relocatable link type.
3539 (bfd_elf_final_link): Likewise.
3541 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3543 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3545 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3546 (s3_bfd_score_elf_check_relocs): Likewise.
3547 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3548 (score_elf_final_link_relocate): Likewise.
3549 (s7_bfd_score_elf_check_relocs): Likewise.
3551 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3553 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3556 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3558 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3559 from `reloc_count' rather than decrementing it.
3560 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3561 `reloc_count' by `int_rels_per_ext_rel'.
3562 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3563 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3564 entry determination.
3565 (s3_bfd_score_elf_check_relocs): Likewise.
3566 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3567 (s7_bfd_score_elf_relocate_section): Likewise.
3568 (s7_bfd_score_elf_check_relocs): Likewise.
3569 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3570 prototype and function.
3571 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3572 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3573 triple rather than once the sum of REL and RELA relocation entry
3575 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3576 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3577 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3578 storage allocation size determination.
3579 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3580 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3581 by `int_rels_per_ext_rel' for last relocation entry
3583 (bfd_elf_final_link): Do not multiply `reloc_count' by
3584 `int_rels_per_ext_rel' for internal relocation storage
3585 allocation size determination.
3586 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3587 `int_rels_per_ext_rel' for last relocation entry determination.
3588 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3589 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3590 (_bfd_mips_elf_relocate_section): Likewise.
3592 2017-06-05 Alan Modra <amodra@gmail.com>
3595 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3597 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3599 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3600 determine structure sizes.
3601 (elfcore_grok_freebsd_prstatus): Likewise.
3603 2017-06-01 Alan Modra <amodra@gmail.com>
3605 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3606 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3608 (is_elfv2_localentry0): New function.
3609 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3610 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3611 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3612 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3613 optimized localentry:0 stubs.
3614 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3615 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3617 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3619 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3621 2017-05-30 Casey Smith <clegg89@gmail.com>
3624 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3625 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3627 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3629 * cpu-arc.c (arc_compatible): New function.
3631 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3633 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3635 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3638 * bfdio.c (bfd_get_file_size): New function.
3639 * bfd-in2.h: Regenerated.
3641 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3643 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3646 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3648 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3649 dynobj instead of htab->elf.dynobj.
3651 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3653 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3655 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3656 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3657 actual number of internal relocations retrieved. Adjust
3658 function description.
3659 (bfd_elf64_canonicalize_reloc): Remove macro.
3660 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3662 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3664 * archures.c (bfd_mach_sparc_v9m8): Define.
3665 (bfd_mach_sparc_v8plusm8): Likewise.
3666 (bfd_mach_sparc_v9_p): Adjust to M8.
3667 (bfd_mach_sparc_64bit_p): Likewise.
3668 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3669 bfd_mach_sparc_v8plusm8.
3670 * bfd-in2.h: Regenerated.
3671 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3673 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3674 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3675 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3677 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3678 bfd_mach_sparc_v8plusm8.
3680 2017-05-19 Alan Modra <amodra@gmail.com>
3682 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3683 debug and special sections when no non-note alloc sections in an
3686 2017-05-18 Alan Modra <amodra@gmail.com>
3688 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3689 * elf-m10300.c: Likewise.
3691 * elf32-arc.c: Likewise.
3692 * elf32-bfin.c: Likewise.
3693 * elf32-m68k.c: Likewise.
3694 * elf32-nds32.c: Likewise.
3695 * elf32-tilepro.c: Likewise.
3696 * elflink.c: Likewise.
3697 * elfnn-aarch64.c: Likewise.
3698 * elfnn-riscv.c: Likewise.
3699 * elfxx-tilegx.c: Likewise.
3700 * mach-o.c: Likewise.
3701 * peXXigen.c: Likewise.
3702 * vms-alpha.c: Likewise.
3703 * vms-lib.c: Likewise.
3705 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3708 * elflink.c (elf_gc_mark_debug_section): New function.
3709 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3710 referenced by kept debug sections.
3712 2017-05-16 Alan Modra <amodra@gmail.com>
3714 * elf-m10300.c: Rename occurrences of non_ir_ref.
3715 * elf32-arm.c: Likewise.
3716 * elf32-bfin.c: Likewise.
3717 * elf32-cr16.c: Likewise.
3718 * elf32-cris.c: Likewise.
3719 * elf32-d10v.c: Likewise.
3720 * elf32-dlx.c: Likewise.
3721 * elf32-fr30.c: Likewise.
3722 * elf32-frv.c: Likewise.
3723 * elf32-hppa.c: Likewise.
3724 * elf32-i370.c: Likewise.
3725 * elf32-i386.c: Likewise.
3726 * elf32-iq2000.c: Likewise.
3727 * elf32-lm32.c: Likewise.
3728 * elf32-m32c.c: Likewise.
3729 * elf32-m32r.c: Likewise.
3730 * elf32-m68hc1x.c: Likewise.
3731 * elf32-m68k.c: Likewise.
3732 * elf32-mcore.c: Likewise.
3733 * elf32-metag.c: Likewise.
3734 * elf32-microblaze.c: Likewise.
3735 * elf32-moxie.c: Likewise.
3736 * elf32-msp430.c: Likewise.
3737 * elf32-mt.c: Likewise.
3738 * elf32-nios2.c: Likewise.
3739 * elf32-or1k.c: Likewise.
3740 * elf32-ppc.c: Likewise.
3741 * elf32-rl78.c: Likewise.
3742 * elf32-s390.c: Likewise.
3743 * elf32-score.c: Likewise.
3744 * elf32-score7.c: Likewise.
3745 * elf32-sh.c: Likewise.
3746 * elf32-tic6x.c: Likewise.
3747 * elf32-tilepro.c: Likewise.
3748 * elf32-v850.c: Likewise.
3749 * elf32-vax.c: Likewise.
3750 * elf32-xstormy16.c: Likewise.
3751 * elf32-xtensa.c: Likewise.
3752 * elf64-alpha.c: Likewise.
3753 * elf64-hppa.c: Likewise.
3754 * elf64-ia64-vms.c: Likewise.
3755 * elf64-mmix.c: Likewise.
3756 * elf64-ppc.c: Likewise.
3757 * elf64-s390.c: Likewise.
3758 * elf64-sh64.c: Likewise.
3759 * elf64-x86-64.c: Likewise.
3760 * elflink.c: Likewise.
3761 * elfnn-aarch64.c: Likewise.
3762 * elfnn-ia64.c: Likewise.
3763 * elfnn-riscv.c: Likewise.
3764 * elfxx-mips.c: Likewise.
3765 * elfxx-sparc.c: Likewise.
3766 * elfxx-tilegx.c: Likewise.
3767 * linker.c: Likewise.
3769 2017-05-16 Alan Modra <amodra@gmail.com>
3771 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3772 * elflink.c (elf_link_add_object_symbols): Update to use
3774 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3776 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3778 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3780 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3782 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3784 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3785 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3787 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3789 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3791 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3793 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3794 to plt_second/plt_second_eh_frame.
3795 (elf_x86_64_link_hash_newfunc): Updated.
3796 (elf_x86_64_allocate_dynrelocs): Likewise.
3797 (elf_x86_64_size_dynamic_sections): Likewise.
3798 (elf_x86_64_relocate_section): Likewise.
3799 (elf_x86_64_finish_dynamic_symbol): Likewise.
3800 (elf_x86_64_finish_dynamic_sections): Likewise.
3801 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3802 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3804 (elf_backend_setup_gnu_properties): Updated. Create the
3805 .plt.sec section instead of the .plt.sec section.
3807 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3809 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3810 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3811 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3813 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3815 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3816 (bfd_elf64_set_reloc): Define.
3817 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3819 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3821 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3822 (struct bfd_target): New field _bfd_set_reloc.
3823 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3824 * reloc.c (_bfd_generic_set_reloc): New function.
3825 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3826 * nlm-target.h (nlm_set_reloc): Likewise.
3827 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3828 * aout-tic30.c (MY_set_reloc): Likewise.
3829 * aout-target.h (MY_set_reloc): Likewise.
3830 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3831 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3832 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3833 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3834 * aout-adobe.c (aout_32_set_reloc): Likewise.
3835 * bout.c (b_out_set_reloc): Likewise.
3836 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3837 * i386os9k.c (aout_32_set_reloc): Likewise.
3838 * ieee.c (ieee_set_reloc): Likewise.
3839 * oasys.c (oasys_set_reloc): Likewise.
3840 * som.c (som_set_reloc): Likewise.
3841 * versados.c (versados_set_reloc): Likewise.
3842 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3843 _bfd_generic_set_reloc.
3844 (rs6000_xcoff64_aix_vec): LIkewise.
3845 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3846 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3847 * i386msdos.c (msdos_set_reloc): Define to
3848 _bfd_norelocs_set_reloc.
3849 * elfcode.h (elf_set_reloc): Define.
3850 * bfd-in2.h: Regenerated.
3852 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3855 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3856 for IFUNC function address.
3858 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3860 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3861 (CONFLICT_LIST): Likewise.
3862 (opcode/arc-attrs.h): Include.
3863 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3864 (arc_extract_features): New file.
3865 (arc_stralloc): Likewise.
3866 (arc_elf_merge_attributes): Likewise.
3867 (arc_elf_merge_private_bfd_data): Use object attributes.
3868 (bfd_arc_get_mach_from_attributes): New function.
3869 (arc_elf_object_p): Use object attributes.
3870 (arc_elf_final_write_processing): Likewise.
3871 (elf32_arc_obj_attrs_arg_type): New function.
3872 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3873 (elf32_arc_section_from_shdr): Likewise.
3874 (elf_backend_obj_attrs_vendor): Define.
3875 (elf_backend_obj_attrs_section): Likewise.
3876 (elf_backend_obj_attrs_arg_type): Likewise.
3877 (elf_backend_obj_attrs_section_type): Likewise.
3878 (elf_backend_obj_attrs_handle_unknown): Likewise.
3879 (elf_backend_section_from_shdr): Likewise.
3881 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3884 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3885 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3886 and the destination is a Thumb symbol.
3888 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3890 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3891 initializer to silence GCC 4.2.
3892 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3894 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3896 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3897 (LAZY_PLT_ENTRY_SIZE): This.
3898 (NON_LAZY_PLT_ENTRY_SIZE): New.
3899 (elf_x86_64_plt0_entry): Renamed to ...
3900 (elf_x86_64_lazy_plt0_entry): This.
3901 (elf_x86_64_plt_entry): Renamed to ...
3902 (elf_x86_64_lazy_plt_entry): This.
3903 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3904 (elf_x86_64_lazy_bnd_plt0_entry): This.
3905 (elf_x86_64_legacy_plt_entry): Removed.
3906 (elf_x86_64_bnd_plt_entry): Renamed to ...
3907 (elf_x86_64_lazy_bnd_plt_entry): This.
3908 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3909 (elf_x86_64_non_lazy_plt_entry): This.
3910 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3911 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3912 (elf_x86_64_eh_frame_plt): Renamed to ...
3913 (elf_x86_64_eh_frame_lazy_plt): This.
3914 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3915 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3916 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3917 (elf_x86_64_eh_frame_non_lazy_plt): This.
3918 (elf_x86_64_lazy_plt_layout): New.
3919 (elf_x86_64_non_lazy_plt_layout): Likewise.
3920 (elf_x86_64_plt_layout): Likewise.
3921 (elf_x86_64_backend_data): Remove PLT layout information. Add
3922 os for target system.
3923 (GET_PLT_ENTRY_SIZE): Removed.
3924 (elf_x86_64_lazy_plt): New.
3925 (elf_x86_64_non_lazy_plt): Likewise.
3926 (elf_x86_64_lazy_bnd_plt): Likewise.
3927 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3928 (elf_x86-64_arch_bed): Updated.
3929 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3930 (elf_x86_64_create_dynamic_sections): Removed.
3931 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3932 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3933 (elf_x86-64_adjust_dynamic_symbol): Updated.
3934 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3935 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3936 size for PLT0 if there is no PLT0. Get plt_entry_size from
3937 non_lazy_plt for non-lazy PLT entries.
3938 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3939 from non_lazy_plt for non-lazy PLT entries.
3940 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3941 if there is no PLT0.
3942 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3943 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3944 entries with non-lazy PLT layout. Don't fill the second and third
3945 slots in the PLT entry if there is no PLT0.
3946 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3947 if there is no PLT0. Set sh_entsize on the .plt.got section.
3948 (compare_relocs): New.
3949 (elf_x86_64_plt_type): Likewise.
3950 (elf_x86_64_plt): Likewise.
3951 (elf_x86_64_nacl_plt): New. Forward declaration.
3952 (elf_x86_64_get_plt_sym_val): Removed.
3953 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3954 against all dynamic relocations.
3955 (elf_x86_64_link_setup_gnu_properties): New function.
3956 (elf_backend_create_dynamic_sections): Updated.
3957 (elf_backend_setup_gnu_properties): New.
3958 (elf_x86_64_nacl_plt): New.
3959 (elf_x86_64_nacl_arch_bed): Updated.
3961 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3963 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3964 (LAZY_PLT_ENTRY_SIZE): This.
3965 (NON_LAZY_PLT_ENTRY_SIZE): New.
3966 (elf_i386_plt0_entry): Renamed to ...
3967 (elf_i386_lazy_plt0_entry): This.
3968 (elf_i386_plt_entry): Renamed to ...
3969 (elf_i386_lazy_plt_entry): This.
3970 (elf_i386_pic_plt0_entry): Renamed to ...
3971 (elf_i386_pic_lazy_plt0_entry): This.
3972 (elf_i386_pic_plt_entry): Renamed to ...
3973 (elf_i386_pic_lazy_plt_entry): This.
3974 (elf_i386_got_plt_entry): Renamed to ...
3975 (elf_i386_non_lazy_plt_entry): This.
3976 (elf_i386_pic_got_plt_entry): Renamed to ...
3977 (elf_i386_pic_non_lazy_plt_entry): This.
3978 (elf_i386_eh_frame_plt): Renamed to ...
3979 (elf_i386_eh_frame_lazy_plt): This.
3980 (elf_i386_eh_frame_plt_got): Renamed to ...
3981 (elf_i386_eh_frame_non_lazy_plt): This.
3982 (elf_i386_plt_layout): Renamed to ...
3983 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3984 eh_frame_plt_got_size.
3985 (elf_i386_non_lazy_plt_layout): New.
3986 (elf_i386_plt_layout): Likewise.
3987 (elf_i386_non_lazy_plt): Likewise.
3988 (GET_PLT_ENTRY_SIZE): Removed.
3989 (elf_i386_plt): Renamed to ...
3990 (elf_i386_lazy_plt): This.
3991 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3992 (elf_i386_arch_bed): Updated.
3993 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3994 (elf_i386_create_dynamic_sections): Removed.
3995 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3996 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3997 (elf_i386_adjust_dynamic_symbol): Updated.
3998 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3999 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4000 size for PLT0 if there is no PLT0.
4001 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
4002 output section is discarded only if GOT isn't empty.
4003 (elf_i386_relocate_section): Updated. Properly get PLT index
4004 if there is no PLT0.
4005 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
4006 second and third slots in the PLT entry if there is no PLT0.
4007 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
4008 if there is no PLT0. Set sh_entsize on the .plt.got section.
4009 (elf_i386_nacl_plt): Forward declaration.
4010 (elf_i386_get_plt_sym_val): Removed.
4011 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
4012 against all dynamic relocations.
4013 (elf_i386_link_setup_gnu_properties): New function.
4014 (elf_backend_create_dynamic_sections): Updated.
4015 (elf_backend_setup_gnu_properties): New.
4016 (elf_i386_nacl_plt): Updated.
4017 (elf_i386_nacl_arch_bed): Likewise.
4018 (elf_i386_vxworks_arch_bed): Likewise.
4020 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4022 * elflink.c (elf_output_implib): Remove executable flag from import
4024 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4025 library is a relocatable object file.
4027 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
4030 * elf32-avr.c (avr_should_move_sym): New function.
4031 (avr_should_reduce_sym_size): Likewise.
4032 (avr_should_increase_sym_size): Likewise.
4033 (elf32_avr_relax_delete_bytes): Adjust symbol values
4034 and sizes by calling new functions.
4036 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4038 * config.bfd (riscv32-*): Enable rv64.
4040 2017-05-02 Alan Modra <amodra@gmail.com>
4043 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
4044 rather than h->root.type == bfd_link_hash_new.
4045 (bfd_elf_record_link_assignment): Similarly, call
4046 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
4048 2017-04-29 Alan Modra <amodra@gmail.com>
4051 * reloc.c (reloc_offset_in_range): New function.
4052 (bfd_perform_relocation, bfd_install_relocation): Use it.
4053 (_bfd_final_link_relocate): Likewise.
4055 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4057 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4058 before using .plt.got.
4059 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4061 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4063 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4064 instead of "+=" to update 0.
4066 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4068 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4069 .plt.got section here.
4070 (elf_i386_check_relocs): Don't create the .plt.got section.
4071 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4072 the .plt.got and .plt.bnd sections here.
4073 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4076 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4078 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4080 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4081 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4082 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4083 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4086 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4088 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4090 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4091 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4092 the first relocatable ELF input with GNU properties.
4094 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4096 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4097 VxWorks for non-PIC.
4099 2017-04-27 Alan Modra <amodra@gmail.com>
4101 * elf-bfd.h (struct elf_backend_data): Make asection param of
4102 elf_backend_eh_frame_address_size const.
4103 (_bfd_elf_eh_frame_address_size): Likewise.
4104 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4105 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4106 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4107 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4108 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4109 (next_cie_fde_offset): Constify params.
4110 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4112 2017-04-27 Alan Modra <amodra@gmail.com>
4114 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4115 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4116 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4118 (offset_adjust): New function.
4119 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4120 (adjust_eh_frame_local_symbols): Likewise.
4121 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4122 after changing anything. Return true if anything changed.
4123 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4124 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4126 2017-04-27 Alan Modra <amodra@gmail.com>
4128 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4131 2017-04-27 Alan Modra <amodra@gmail.com>
4133 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4134 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4135 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4136 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4137 for undef and undefweak dyn_relocs.
4138 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4139 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4140 (allocate_got, allocate_dynrelocs): Likewise.
4141 (ppc64_elf_relocate_section): Likewise.
4143 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4145 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4146 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4147 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4148 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4150 2017-04-26 Nick Clifton <nickc@redhat.com>
4153 * reloc.c (bfd_perform_relocation): Check for a negative address
4156 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4159 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4161 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4162 (elf_backend_always_renumber_dynsyms): Define.
4163 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4164 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4165 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4166 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4168 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4170 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4172 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4173 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4174 sections have been created.
4176 2017-04-26 Nick Clifton <nickc@redhat.com>
4179 * compress.c (bfd_init_section_compress_status): Check the return
4180 value from bfd_malloc.
4182 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4184 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4185 no_finish_dynamic_symbol.
4186 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4188 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4189 weak symbol, don't make it dynamic.
4190 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4191 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4192 relocation for GOT reference.
4193 (elf_x86_64_finish_dynamic_symbol): Abort if
4194 no_finish_dynamic_symbol isn't 0.
4196 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4199 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4200 undefined weak symbol, don't make it dynamic.
4201 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4202 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4203 relocation for R_386_GOT32.
4205 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4208 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4210 2017-04-23 Alan Modra <amodra@gmail.com>
4213 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4214 * elf.c (lcomm_sym): New.
4215 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4216 * bfd-in2.h: Regenerate.
4218 2017-04-23 Alan Modra <amodra@gmail.com>
4221 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4222 parameters and comment.
4223 (_bfd_elf_get_reloc_section): Delete.
4224 (_bfd_elf_plt_get_reloc_section): Declare.
4225 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4226 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4228 (_bfd_elf_get_reloc_section): ..here. Delete.
4229 (assign_section_numbers): Call elf_get_reloc_section.
4230 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4231 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4233 2017-04-23 Alan Modra <amodra@gmail.com>
4236 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4239 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4242 * elf32-i386.c (elf_i386_link_hash_entry): Add
4243 no_finish_dynamic_symbol.
4244 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4245 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4246 symbol, don't make it dynamic in PIE.
4247 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4248 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4249 relocation for R_386_GOT32
4250 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4253 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4257 * elflink.c (elf_link_add_object_symbols): Require
4258 --no-dynamic-linker with -E/--dynamic-list when creating
4261 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4263 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4266 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4268 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4269 dynamic symbol sorting.
4271 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4274 * elflink.c (elf_link_add_object_symbols): Preserve
4275 dynamic_ref_after_ir_def when restoring the symbol table for
4276 unneeded dynamic object.
4278 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4281 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4282 on on undefined IFUNC symbol in the second PLT.
4284 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4286 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4288 2017-04-19 Alan Modra <amodra@gmail.com>
4290 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4291 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4292 * elf32-ppc.c:Formatting.
4293 (ensure_undefweak_dynamic): Don't make dynamic when
4294 info->dynamic_undefined_weak is zero.
4295 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4296 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4297 not default visibility. Discard undef and undefweak
4299 (ppc_elf_relocate_section): Adjust to suit.
4300 * elf64-ppc.c: Formatting.
4301 (ensure_undefweak_dynamic): Don't make dynamic when
4302 info->dynamic_undefined_weak is zero.
4303 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4304 info->dynamic_undefined_weak. Discard them earlier.
4306 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4309 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4310 before generating the version definition section.
4312 2017-04-17 Alan Modra <amodra@gmail.com>
4314 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4315 state when a regular object file defines a symbol with
4316 incompatible type to that defined by an earlier shared lib.
4318 2017-04-13 Alan Modra <amodra@gmail.com>
4320 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4322 * elf32-arm.c: Likewise.
4323 * elf32-i386.c: Likewise.
4324 * elf32-mep.c: Likewise.
4325 * elf64-ia64-vms.c: Likewise.
4326 * elf64-x86-64.c: Likewise.
4327 * elflink.c: Likewise.
4328 * elfnn-ia64.c: Likewise.
4329 * elfxx-mips.c: Likewise.
4331 2017-04-13 Alan Modra <amodra@gmail.com>
4333 * aoutx.h: Use %B and %A in error messages throughout file.
4334 * aout-cris.c: Likewise.
4335 * archive.c: Likewise.
4336 * binary.c: Likewise.
4337 * coff-rs6000.c: Likewise.
4338 * coff-tic4x.c: Likewise.
4339 * coffcode.h: Likewise.
4340 * coffgen.c: Likewise.
4341 * cofflink.c: Likewise.
4342 * coffswap.h: Likewise.
4343 * cpu-arm.c: Likewise.
4344 * elf-eh-frame.c: Likewise.
4345 * elf-m10300.c: Likewise.
4347 * elf32-arc.c: Likewise.
4348 * elf32-arm.c: Likewise.
4349 * elf32-bfin.c: Likewise.
4350 * elf32-frv.c: Likewise.
4351 * elf32-iq2000.c: Likewise.
4352 * elf32-m32c.c: Likewise.
4353 * elf32-microblaze.c: Likewise.
4354 * elf32-nds32.c: Likewise.
4355 * elf32-rl78.c: Likewise.
4356 * elf32-rx.c: Likewise.
4357 * elf32-score.c: Likewise.
4358 * elf32-score7.c: Likewise.
4359 * elf32-sh64.c: Likewise.
4360 * elf32-v850.c: Likewise.
4361 * elf32-vax.c: Likewise.
4362 * elf32-visium.c: Likewise.
4363 * elf64-ia64-vms.c: Likewise.
4364 * elf64-mmix.c: Likewise.
4365 * elf64-sh64.c: Likewise.
4366 * elfcode.h: Likewise.
4367 * elfnn-aarch64.c: Likewise.
4368 * elfnn-ia64.c: Likewise.
4369 * elfxx-mips.c: Likewise.
4370 * hpux-core.c: Likewise.
4373 * linker.c: Likewise.
4374 * merge.c: Likewise.
4376 * oasys.c: Likewise.
4377 * pdp11.c: Likewise.
4378 * peXXigen.c: Likewise.
4379 * rs6000-core.c: Likewise.
4380 * vms-alpha.c: Likewise.
4381 * xcofflink.c: Likewise.
4383 2017-04-13 Alan Modra <amodra@gmail.com>
4385 * bfd.c (PRINT_TYPE): Define.
4386 (_doprnt): New function.
4387 (error_handler_internal): Use _doprnt.
4388 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4389 calls in their natural order, throughout file.
4390 * coff-mcore.c: Likewise.
4391 * coff-ppc.c: Likewise.
4392 * coff-tic80.c: Likewise.
4393 * cofflink.c: Likewise.
4394 * elf-s390-common.c: Likewise.
4396 * elf32-arm.c: Likewise.
4397 * elf32-i386.c: Likewise.
4398 * elf32-m32r.c: Likewise.
4399 * elf32-msp430.c: Likewise.
4400 * elf32-spu.c: Likewise.
4401 * elf64-ia64-vms.c: Likewise.
4402 * elf64-sparc.c: Likewise.
4403 * elf64-x86-64.c: Likewise.
4404 * elflink.c: Likewise.
4405 * elfnn-aarch64.c: Likewise.
4406 * elfnn-ia64.c: Likewise.
4407 * elfxx-mips.c: Likewise.
4409 2017-04-13 Alan Modra <amodra@gmail.com>
4411 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4412 branch veneers" error. Fix double space and format message.
4413 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4414 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4416 2017-04-13 Alan Modra <amodra@gmail.com>
4418 * bfd-in2.h: Regenerate.
4420 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4422 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4423 extra `\n' in warning/error messages.
4424 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4425 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4427 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4429 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4430 processor-specific properties with generic ELF target vector.
4432 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4434 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4435 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4436 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4437 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4439 (link_hash_newfunc): Initialize has_got_reloc and
4441 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4443 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4445 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4447 (_bfd_sparc_elf_fixup_symbol): New function.
4448 (allocate_dynrelocs): Don't allocate space for dynamic
4449 relocations and discard relocations against resolved undefined
4450 weak symbols in executable. Don't make resolved undefined weak
4451 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4452 relocation against undefined weak symbols in PIE.
4453 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4454 relocations against resolved undefined weak symbols in PIE
4455 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4456 without ynamic PLT/GOT relocations for resolved undefined weak
4458 Don't generate dynamic relocation against resolved undefined
4459 weak symbol in executable.
4460 (pie_finish_undefweak_symbol): New function.
4461 (_bfd_sparc_elf_finish_dynamic_sections): Call
4462 pie_finish_undefweak_symbol on all symbols in PIE.
4463 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4464 (_bfd_sparc_elf_fixup_symbol): New function.
4466 2017-04-10 Nick Clifton <nickc@redhat.com>
4468 * config.bfd: Remove ns32k from obsolete list.
4470 2017-04-10 Alan Modra <amodra@gmail.com>
4473 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4474 (special_sections_i): Likewise for .init_array.
4475 (special_sections_p): Likewise for .preinit_array.
4477 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4481 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4482 ELF_COMMON_DEF_P for common symbols.
4483 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4484 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4485 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4486 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4487 07492f668d2173da7a2bda3707ff0985e0f460b6.
4489 2017-04-07 Pedro Alves <palves@redhat.com>
4491 * opncls.c (bfd_get_debug_link_info): Rename to...
4492 (bfd_get_debug_link_info_1): ... this. Change type of second
4493 parameter to void pointer. Adjust.
4494 (bfd_get_debug_link_info): Reimplement on top of
4495 bfd_get_debug_link_info_1.
4496 (separate_debug_file_exists, separate_alt_debug_file_exists):
4497 Change type of second parameter to void pointer. Adjust.
4498 (get_func_type, check_func_type): Change type of second parameter
4500 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4501 the callback functions instead of passing the address of a local.
4502 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4503 find_separate_debug_file.
4504 (get_alt_debug_link_info_shim): Change type of second parameter to
4505 void pointer. Adjust.
4506 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4507 find_separate_debug_file.
4508 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4509 of second parameter to void pointer. Adjust.
4510 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4511 pointer local to find_separate_debug_file.
4513 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4515 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4516 external symbols with a definition.
4517 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4519 2017-04-07 Alan Modra <amodra@gmail.com>
4521 * po/SRC-POTFILES.in: Regenerate.
4523 2017-04-05 Alan Modra <amodra@gmail.com>
4525 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4528 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4530 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4531 numbers for DataDirectory entry indicies passed to
4534 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4536 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4537 each GNU_MBIND section and align GNU_MBIND section to page size.
4538 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4539 segment for each GNU_MBIND section.
4540 (_bfd_elf_init_private_section_data): Copy sh_info from input
4541 for GNU_MBIND section.
4543 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4545 * elfnn-riscv.c (GP_NAME): Delete.
4546 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4547 (_bfd_riscv_relax_lui): Likewise.
4549 2017-04-04 Nick Clifton <nickc@redhat.com>
4552 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4554 (bfd_elf_final_link): Only initialize the extended symbol index
4555 section if there are extended symbol tables to list.
4557 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4559 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4560 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4561 * configure.ac (elf): Add elf-properties.lo.
4562 * Makefile.in: Regenerated.
4563 * configure: Likewise.
4564 * elf-bfd.h (elf_property_kind): New.
4565 (elf_property): Likewise.
4566 (elf_property_list): Likewise.
4567 (elf_properties): Likewise.
4568 (_bfd_elf_parse_gnu_properties): Likewise.
4569 (_bfd_elf_get_property): Likewise.
4570 (_bfd_elf_link_setup_gnu_properties): Likewise.
4571 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4572 and setup_gnu_properties.
4573 (elf_obj_tdata): Add properties.
4574 * elf-properties.c: New file.
4575 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4576 (elf_i386_merge_gnu_properties): Likewise.
4577 (elf_backend_parse_gnu_properties): Likewise.
4578 (elf_backend_merge_gnu_properties): Likewise.
4579 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4580 (elf_x86_64_merge_gnu_properties): Likewise.
4581 (elf_backend_parse_gnu_properties): Likewise.
4582 (elf_backend_merge_gnu_properties): Likewise.
4583 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4584 (elf_backend_parse_gnu_properties): Likewise.
4585 (elf_backend_setup_gnu_properties): Likewise.
4586 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4587 elf_backend_merge_gnu_properties and
4588 elf_backend_setup_gnu_properties.
4590 2017-03-30 Pip Cet <pipcet@gmail.com>
4592 * elf32-wasm32.c: Add relocation code, two relocs.
4593 * reloc.c: Add wasm32 relocations.
4594 * libbfd.h: Regenerate.
4595 * bfd-in2.h: Regenerate.
4596 * bfd/po/bfd.pot: Regenerate.
4598 2017-03-29 Nick Clifton <nickc@redhat.com>
4601 * coff-bfd.h (struct coff_section_data): Add new fields:
4602 saved_bias and bias.
4603 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4604 computed for PE binaries.
4605 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4608 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4611 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4612 to handle a local symbol with a hash-symbol-entry; without PLT.
4613 Add BFD_ASSERT for an incidental case with GOT entry present.
4614 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4615 isn't forced-or-set local.
4617 2017-03-27 Pip Cet <pipcet@gmail.com>
4619 * wasm-module.c: New file to support WebAssembly modules.
4620 * wasm-module.h: New file to support WebAssembly modules.
4621 * doc/webassembly.texi: Start documenting wasm-module.c.
4622 * config.bfd: Add wasm_vec.
4623 * targets.c: Likewise.
4624 * configure.ac: Likewise.
4625 * Makefile.am: Add entries for wasm-module.c.
4626 * Makefile.in: Regenerate.
4627 * configure: Regenerate.
4628 * po/SRC-POTFILES.in: Regenerate.
4630 2017-03-27 Pip Cet <pipcet@gmail.com>
4632 * cpu-wasm32.c: New file to support wasm32 architecture.
4633 * elf32-wasm32.c: New file to support wasm32 architecture.
4634 * Makefile.am: Add wasm32 architecture.
4635 * archures.c: Likewise.
4636 * config.bfd: Likewise.
4637 * configure.ac: Likewise.
4638 * targets.c: Likewise.
4639 * Makefile.in: Regenerate.
4640 * bfd-in2.h: Regenerate.
4641 * configure: Regenerate.
4642 * po/SRC-POTFILES.in: Regenerate.
4644 2017-03-20 Alan Modra <amodra@gmail.com>
4647 * elf64-ppc.c (compare_symbols): Stabilize sort.
4649 2017-03-18 Alan Modra <amodra@gmail.com>
4651 * elf64-ppc.c (struct ppc_link_hash_table): Add
4652 local_ifunc_resolver and maybe_local_ifunc_resolver.
4653 (ppc_build_one_stub): Set flags on emitting dynamic
4654 relocation to ifunc.
4655 (ppc64_elf_relocate_section): Likewise.
4656 (ppc64_elf_finish_dynamic_symbol): Likewise.
4657 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4658 local dynamic relocs to ifuncs.
4659 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4660 local_ifunc_resolver and maybe_local_ifunc_resolver.
4661 (ppc_elf_relocate_section): Set flag on emitting dynamic
4662 relocation to ifuncs.
4663 (ppc_elf_finish_dynamic_symbol): Likewise.
4664 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4665 dynamic relocs to ifuncs.
4667 2017-03-13 Nick Clifton <nickc@redhat.com>
4670 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4671 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4672 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4673 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4674 * bfd-in2.h: Regenerate.
4675 * libbfd.h: Regenerate.
4676 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4678 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4679 (elfNN_aarch64_howto_table): Likewise.
4680 (aarch64_tls_transition_without_check): Likewise.
4681 (aarch64_reloc_got_type): Likewise.
4682 (elfNN_aarch64_final_link_relocate): Likewise.
4683 (elfNN_aarch64_tls_relax): Likewise.
4684 (elfNN_aarch64_relocate_section): Likewise.
4685 (elfNN_aarch64_gc_sweep_hook): Likewise.
4686 (elfNN_aarch64_check_relocs): Likewise.
4687 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4688 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4690 2017-03-11 Alan Modra <amodra@gmail.com>
4692 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4693 parameter is in fact used. Whitespace fixes.
4694 * elf64-ppc.c: Likewise.
4696 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4698 * rs6000-core.c (CORE_NEW): Simplify macro when
4699 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4701 2017-03-07 Alan Modra <amodra@gmail.com>
4705 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4708 2017-03-05 Alan Modra <amodra@gmail.com>
4710 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4711 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4712 (next_cie_fde_offset): New function.
4713 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4714 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4715 four bytes. Align CIEs to four or eight bytes depending on
4716 per_encoding_aligned8. Align FDEs according to their encoding.
4717 Pad last FDE to output section alignment.
4718 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4720 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4721 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4722 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4724 2017-03-02 Martin Bickel <binutils@ineranves.de>
4727 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4728 empty segments which have a zero filesz, but a non-zero memsz.
4730 2017-03-02 Alan Modra <amodra@gmail.com>
4732 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4734 2017-02-28 Alan Modra <amodra@gmail.com>
4736 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4737 (ppc64_elf_relocate_section): Likewise.
4739 2017-02-28 Alan Modra <amodra@gmail.com>
4742 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4743 rather than elf32_nios2_hash_table or elf_hash_table.
4744 (create_got_section): Likewise.
4745 (nios2_elf32_finish_dynamic_symbol): Likewise.
4746 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4747 (nios2_elf32_size_dynamic_sections): Likewise.
4748 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4749 vars. Use htab equivalents directly instead. Don't create
4750 all dynamic sections on needing just the GOT. Use a goto
4751 rather than a fall-through with reloc test. Ensure
4752 htab->dynobj is set when making dynamic sreloc section.
4753 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4754 equivalent directly instead. Don't segfault on looking for
4755 .dynamic when dynamic sections have not been created. Don't
4756 segfault on .got.plt being discarded.
4757 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4758 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4759 fixme and another not so relevant comment.
4760 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4761 already set, set hash table dynobj on creating .sbss.
4763 2017-02-28 Alan Modra <amodra@gmail.com>
4765 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4766 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4767 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4768 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4769 (ppc64_elf_relocate_section): Likewise.
4770 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4771 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4772 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4773 * libbfd.h: Regenerate.
4774 * bfd-in2.h: Regenerate.
4776 2017-02-28 Alan Modra <amodra@gmail.com>
4778 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4779 dynamic .data.rel.ro read-only.
4780 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4781 rather than section flags when deciding where copy reloc goes.
4782 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4783 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4784 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4785 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4786 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4787 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4788 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4789 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4790 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4791 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4792 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4793 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4794 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4795 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4796 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4797 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4798 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4799 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4800 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4802 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4804 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4805 `jalr $0, $25' instruction encoding.
4807 2017-02-27 Nick Clifton <nickc@redhat.com>
4810 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4811 generating a seg-fault when encountering a symbol that has been
4812 deleted by garbage collection.
4814 2017-02-25 Alan Modra <amodra@gmail.com>
4816 * elf32-arc.c (struct dynamic_sections): Delete.
4817 (enum dyn_section_types): Delete.
4818 (dyn_section_names): Delete.
4819 (arc_create_dynamic_sections): Delete.
4820 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4821 segfault on discarded .rela.plt section.
4822 (elf_arc_size_dynamic_sections): Formatting. Don't call
4823 arc_create_dynamic_sections. Don't allocate memory for sections
4824 handled by the generic linker. Correct code finding relocs in
4825 read-only sections. Set SEC_EXCLUDE on zero size .got,
4826 .got.plt, and .dynbss sections. Do set .interp for pies.
4828 2017-02-24 Andrew Waterman <andrew@sifive.com>
4830 * elfnn-riscv.c (GP_NAME): New macro.
4831 (riscv_global_pointer_value): Use it.
4832 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4833 output section, consider only that section's alignment.
4835 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4837 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4838 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4839 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4840 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4842 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4844 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4845 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4848 2017-02-23 Alan Modra <amodra@gmail.com>
4851 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4853 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4854 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4857 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4860 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4861 processing ahead of the call to `elf_gc_sweep_symbol'.
4863 2017-02-22 Nick Clifton <nickc@redhat.com>
4866 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4867 created section 4-byte alignment.
4869 2017-02-22 Alan Modra <amodra@gmail.com>
4871 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4872 on .got or .plt output section being discarded by script.
4873 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4876 2017-02-21 Alan Modra <amodra@gmail.com>
4878 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4879 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4881 2017-02-20 Alan Modra <amodra@gmail.com>
4884 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4885 if DT_RELSZ/DT_RELASZ is zero.
4887 2017-02-17 Nick Clifton <nickc@redhat.com>
4889 * compress.c (bfd_get_full_section_contents): Remember to reduce
4890 compressed size by the sizeof the compression header when
4891 decompressing the contents.
4893 2017-02-17 Pedro Alves <palves@redhat.com>
4895 * srec.c (Chunk): Rename to ...
4896 (_bfd_srec_len): ... this.
4897 (S3Forced): Rename to ...
4898 (_bfd_srec_forceS3): ... this.
4899 * objcopy.c: Adjust all references.
4901 2017-02-17 Pedro Alves <palves@redhat.com>
4903 * archive.c (bsd_write_armap): Rename to ...
4904 (_bfd_bsd_write_armap): ... this.
4905 (coff_write_armap): Rename to ...
4906 (_bfd_coff_write_armap): ... this.
4907 * libbfd-in.h (bsd_write_armap): Rename to ...
4908 (_bfd_bsd_write_armap): ... this.
4909 (coff_write_armap): Rename to ...
4910 (_bfd_coff_write_armap): ... this.
4911 * aout-target.h, aout-tic30.c: Adjust all users.
4912 * libbfd.h: Regenerate.
4914 2017-02-17 Pedro Alves <palves@redhat.com>
4916 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4917 (warn_deprecated): Rename to ...
4918 (_bfd_warn_deprecated): ... this.
4919 * libbfd.c (warn_deprecated): Rename to ...
4920 (_bfd_warn_deprecated): ... this.
4921 * bfd-in2.h: Regenerate.
4923 2017-02-17 Pedro Alves <palves@redhat.com>
4925 * bfdio.c (real_ftell): Rename to ...
4926 (_bfd_real_ftell): ... this.
4927 (real_fseek): Rename to ...
4928 (_bfd_real_fseek): ... this.
4929 (real_fopen): Rename to ...
4930 (_bfd_real_fopen): ... this.
4931 * libbfd-in.h (real_ftell): Rename to ...
4932 (_bfd_real_ftell): ... this.
4933 (real_fseek): Rename to ...
4934 (_bfd_real_fseek): ... this.
4935 (real_fopen): Rename to ...
4936 (_bfd_real_fopen): ... this.
4937 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4938 * libbfd.h: Regenerate.
4940 2017-02-17 Pedro Alves <palves@redhat.com>
4942 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4943 * libbfd.c (read_unsigned_leb128): Rename to ...
4944 (_bfd_read_unsigned_leb128): ... this.
4945 (read_signed_leb128): Rename to ...
4946 (_bfd_read_signed_leb128): ... this.
4947 (safe_read_leb128): Rename to ...
4948 (_bfd_safe_read_leb128): ... this.
4949 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4950 (_bfd_read_unsigned_leb128): ... this.
4951 (read_signed_leb128): Rename to ...
4952 (_bfd_read_signed_leb128): ... this.
4953 (safe_read_leb128): Rename to ...
4954 (_bfd_safe_read_leb128): ... this.
4955 * libbfd.h: Renegerate.
4957 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4959 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4960 before trying to fine matching file and line information.
4962 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4964 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4965 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4966 not match current bfd, then reload debug information. Record bfd
4967 we're loading debug info for in the stash. If we have debug
4968 informatin in the cache then perform section placement before
4971 2017-02-16 Alan Modra <amodra@gmail.com>
4974 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4975 * elfxx-target.h (elf_backend_no_page_alias): Define.
4976 (elfNN_bed): Init new field.
4977 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4978 ensure PT_LOAD segment starts on a new page.
4979 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4981 2017-02-16 Alan Modra <amodra@gmail.com>
4984 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4987 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4989 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4990 * bfd-in2.h: Regenerated.
4992 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4995 * elf32-i386.c (elf_i386_relocate_section): Allow
4996 "lea foo@GOT, %reg" in PIC.
4998 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5001 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
5002 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
5003 error against local IFUNC symbol without a base register for
5006 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
5008 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
5009 `%P: %H:' with `info->callbacks->einfo'.
5010 (ppc_elf_relocate_section): Likewise.
5011 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
5012 (ppc64_elf_edit_toc): Likewise.
5013 (ppc64_elf_relocate_section): Likewise.
5015 2017-02-14 Alan Modra <amodra@gmail.com>
5017 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
5018 --gc-keep-exported, and test versioned field of sym rather than
5019 looking for @ in name.
5021 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5023 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5026 2017-02-13 Nick Clifton <nickc@redhat.com>
5029 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5032 2017-02-07 Andrew Waterman <andrew@sifive.com>
5034 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5035 entry size if PLT header is written.
5037 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5039 Fix sparc64 dynamic relocation processing to use the dynamic
5041 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5042 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5045 2017-02-03 Nick Clifton <nickc@redhat.com>
5048 * coffcode.h (coff_write_object_contents): Enlarge size of
5049 s_name_buf in order to avoid compile time warning about possible
5051 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5052 32-bits of insn value before printing into buffer.
5054 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5056 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5057 `max_local_dynindx'.
5058 (mips_elf_sort_hash_table): Handle it.
5059 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5060 symbols bump up `max_local_dynindx' rather than
5061 `max_non_got_dynindx'.
5063 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5065 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5066 `min_got_dynindx', `max_unref_got_dynindx' and
5067 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5068 (mips_elf_sort_hash_table): Adjust accordingly.
5070 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5072 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5073 to access the hash table.
5075 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5077 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5078 non-NULL `htab' to the beginning.
5080 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5082 * elflink.c (elf_gc_sweep): Wrap overlong line.
5084 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5086 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5087 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5088 * elfxx-mips.c (mips_elf_link_hash_table): Add
5089 `ignore_branch_isa' member.
5090 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5091 in branch relocation calculation as an error if
5092 `ignore_branch_isa' has been set.
5093 (_bfd_mips_elf_insn32): Rename to...
5094 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5095 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5096 Handle the new parameter.
5098 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5100 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5101 local variable dynobj.
5104 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5105 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5106 executable from read-only sections into sdynrelro.
5107 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5108 dynamic relocs in sdynrelro.
5109 (elf_backend_want_dynrelro): Define.
5111 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5113 * config.bfd (*-*-rtemsaout*): Mark as removed.
5115 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5117 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5118 (arm-*-rtems*): Move to (arm*-*-eabi*).
5119 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5120 (m68-*-rtems*): Move to (m68*-*-elf*).
5122 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5124 * config.bfd (*-*-rtemscoff*): Mark as removed.
5126 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5129 * elflink.c (bfd_elf_record_link_assignment): Revert last
5130 change and don't ever clear `forced_local'. Set `mark'
5132 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5134 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5135 (bfd_elf_size_dynamic_sections): ... here.
5136 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5137 and set `mark' instead in `__tls_get_addr_opt' processing.
5138 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5140 2017-01-24 Alan Modra <amodra@gmail.com>
5142 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5143 where dynamic relocs are preferable. Allow ifunc too.
5144 (ensure_undefweak_dynamic): New function.
5145 (allocate_dynrelocs): Use it here. Move plt handling last and
5146 don't make symbols dynamic, simplifying loop. Only make undef
5147 weak symbols with GOT entries dynamic. Correct condition
5148 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5149 comments. Remove goto.
5150 (ppc_elf_relocate_section): Correct test for using dynamic
5151 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5152 to suit. Set up explicit tls_index entries and implicit GOT
5153 tls_index entries resolvable at link time for
5154 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5155 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5156 (ensure_undefweak_dynamic): New function.
5157 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5158 with GOT entries dynamic. Remove unnecessary test of
5159 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5160 (ppc64_elf_relocate_section): Correct test for using dynamic
5161 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5162 to suit. Set up explicit tls_index entries and implicit GOT
5163 tls_index entries resolvable at link time for __tls_get_addr_opt.
5164 Simplify expression to clear mem for prelink.
5166 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5168 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5170 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5172 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5173 (elf_backend_hash_symbol): Define.
5175 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5178 * elflink.c (bfd_elf_record_link_assignment): Clear any
5179 `forced_local' marking for DSO symbols that are not being
5182 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5184 * elfnn-riscv.c (riscv_elf_object_p): New function.
5186 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5189 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5191 (elf_x86_64_check_relocs): Create .eh_frame section for the
5193 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5194 .eh_frame section for the .plt.bnd section.
5195 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5196 for the .plt.bnd section.
5198 2017-01-12 Nick Clifton <nickc@redhat.com>
5201 * opncls.c (find_separate_debug_file): Add include_dirs
5202 parameter. Only include the directory part of the bfd's filename
5203 in search paths if include_dirs is true. Add a couple of extra
5204 locations for looking for debug files.
5205 ( bfd_follow_gnu_debuglink): Update invocation of
5206 find_separate_debug_file.
5207 (bfd_follow_gnu_debugaltlink): Likewise.
5208 (get_build_id): New function: Finds the build-id of the given bfd.
5209 (get_build_id_name): New function: Computes the name of the
5210 separate debug info file for a bfd, based upon its build-id.
5211 (check_build_id_file): New function: Checks to see if a separate
5212 debug info file exists at the given location, and that its
5213 build-id matches that of the original bfd.
5214 (bfd_follow_build_id_debuglink): New function: Finds a separate
5215 debug info file for a given bfd by using the build-id method.
5216 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5217 method of locating a separate debug info file before using the
5219 * bfd-in2.h: Regenerate.
5221 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5224 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5225 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5226 elf_x86_64_eh_frame_plt_got.
5227 (elf_x86_64_size_dynamic_sections): Get unwind info from
5228 elf_x86_64_bnd_arch_bed for the BND PLT.
5230 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5232 * config.bfd: Add entries for i686-redox and x86_64-redox.
5234 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5236 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5238 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5239 .eh_frame section to 4 bytes for x32.
5240 (elf_x86_64_check_relocs): Likewise.
5242 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5245 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5246 (PLT_GOT_FDE_LENGTH): Likewise.
5247 (elf_i386_plt_layout): Add eh_frame_plt_got and
5248 eh_frame_plt_got_size.
5249 (elf_i386_plt): Updated.
5250 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5251 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5252 (elf_i386_size_dynamic_sections): Allocate and initialize
5253 .eh_frame section for .plt.got.
5254 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5256 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5257 eh_frame_plt_got_size.
5258 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5259 (PLT_GOT_FDE_LENGTH): Likewise.
5260 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5261 eh_frame_plt_got_size.
5262 (elf_x86_64_arch_bed): Updated.
5263 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5264 eh_frame_plt_got_size.
5265 (elf_x86_64_nacl_arch_bed): Likewise.
5266 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5267 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5268 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5269 .eh_frame section for .plt.got.
5270 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5273 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5275 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5276 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5278 2017-01-09 Nick Clifton <nickc@redhat.com>
5280 * dwarf2.c (lookup_address_in_function_table): Return early if
5281 there are no functions in the given comp unit, or if the high
5282 address of the last function in the comp unit is less than the
5285 2017-01-09 Nick Clifton <nickc@redhat.com>
5288 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5289 message if there are too many symbols to load.
5291 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5293 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5294 if relocs are cached.
5296 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5299 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5300 for R_MICROBLAZE_GOTOFF_64.
5302 2017-01-03 Nick Clifton <nickc@redhat.com>
5304 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5305 warning about using a possibly uninitialised variable.
5307 2017-01-02 Alan Modra <amodra@gmail.com>
5309 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5310 (allocate_plt_static, allocate_dynrelocs): Use it.
5312 2017-01-02 Alan Modra <amodra@gmail.com>
5314 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5315 .PARISC.unwind section.
5317 2017-01-02 Alan Modra <amodra@gmail.com>
5320 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5321 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5322 indirect to GOT pointer relative code edit.
5324 2017-01-02 Alan Modra <amodra@gmail.com>
5326 Update year range in copyright notice of all files.
5328 For older changes see ChangeLog-2016
5330 Copyright (C) 2017 Free Software Foundation, Inc.
5332 Copying and distribution of this file, with or without modification,
5333 are permitted in any medium without royalty provided the copyright
5334 notice and this notice are preserved.
5340 version-control: never