1 2017-11-24 H.J. Lu <hongjiu.lu@intel.com>
4 * elf.c (elf_read_notes): Add an argument for note aligment.
5 (elf_parse_notes): Likewise.
6 (_bfd_elf_make_section_from_shdr): Pass section aligment to
8 (bfd_section_from_phdr): Pass segment aligment to elf_read_notes.
9 (elf_parse_notes): Add an argument for note aligment. Use
10 ELF_NOTE_DESC_OFFSET to get the offset of the note descriptor.
11 Use ELF_NOTE_NEXT_OFFSET to get the offset of the next note
13 (elf_read_notes): Add an argument for note aligment and pass it
16 2017-11-23 Alan Modra <amodra@gmail.com>
18 * elf32-hppa.c (pc_dynrelocs): Define.
19 (elf32_hppa_copy_indirect_symbol): Don't copy dyn_relocs to weakdefs.
20 (alias_readonly_dynrelocs): New function.
21 (elf32_hppa_adjust_dynamic_symbol): Don't clear non_got_ref to
22 indicate dyn_relocs should be discarded, discard them here.
23 Use alias_readonly_dynrelocs.
24 (allocate_dynrelocs): Don't test or clear non_got_ref.
25 (elf32_hppa_relocate_section): Simplify test for dynamic relocs.
26 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't copy dyn_relocs
28 (alias_readonly_dynrelocs, pc_dynrelocs): New functions.
29 (ppc_elf_adjust_dynamic_symbol): Don't clear non_got_ref to
30 indicate dyn_relocs should be discarded, discard them here.
31 Use alias_readonly_dynrelocs.
32 (allocate_dynrelocs): Don't test or clear non_got_ref.
33 (ppc_elf_relocate_section): Simplify test for dynamic relocs.
35 2017-11-23 Alan Modra <amodra@gmail.com>
37 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
38 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
39 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
40 (ppc64_elf_adjust_dynamic_symbol): Don't use
41 alias_readonly_dynrelocs for function symbols.
43 2017-11-23 Alan Modra <amodra@gmail.com>
45 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
46 Rename u.weakdef to u.alias and update comment.
47 (weakdef): New static inline function.
48 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
49 rather than u.weakdef != NULL, and use weakdef function.
50 (_bfd_elf_adjust_dynamic_symbol): Likewise.
51 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
52 all aliases if def has been overridden in a regular object, not
54 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
55 is_weakalias and use weakdef. Set is_weakalias and circular
56 u.alias. Update comments.
57 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
58 u.weakdef != NULL and use weakdef function.
59 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
60 is_weakalias rather than u.weakdef != NULL and use weakdef
61 function. Assert that def is strong defined.
62 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
63 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
64 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
65 (bfin_adjust_dynamic_symbol): Likewise.
66 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
67 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
68 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
69 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
70 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
71 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
72 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
73 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
74 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
75 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
76 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
77 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
78 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
79 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
80 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
81 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
82 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
83 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
84 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
85 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
86 (tilepro_elf_adjust_dynamic_symbol): Likewise.
87 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
88 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
89 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
90 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
91 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
92 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
93 (ppc64_elf_adjust_dynamic_symbol): Likewise.
94 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
95 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
96 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
97 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
98 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
99 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
100 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
101 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
102 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
103 (tilegx_elf_adjust_dynamic_symbol): Likewise.
104 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
106 2017-11-21 Alan Modra <amodra@gmail.com>
108 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
109 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
111 2017-11-20 Nick Clifton <nickc@redhat.com>
114 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
115 objects without a GNU_PROPERTY note section when looking for a bfd
116 onto which notes can be accumulated.
118 2017-11-20 Alan Modra <amodra@gmail.com>
122 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
123 and leave rel_hdr->sh_flags zero. Update calls.
124 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
125 flag when !gas before adding rel/rela section to group. Set
126 output rel/rela SHF_GROUP flags.
128 2017-11-18 Jim Wilson <jimw@sifive.com>
130 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
131 and to in error message.
133 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
135 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
136 "%F%P:", instead of "%F:", to linker callback in case of error.
138 2017-11-16 Nick Clifton <nickc@redhat.com>
141 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
142 (elfcore_grok_openbsd_procinfo): Likewise.
143 (elfcore_grok_nto_status): Likewise.
145 2017-11-16 Nick Clifton <nickc@redhat.com>
147 * merge.c (sec_merge_emit): Always create padding buffer. Add
148 asserts to make sure that the buffer is long enough.
150 2017-11-15 Alan Modra <amodra@gmail.com>
152 * bfd.c (union _bfd_doprnt_args): Add "Bad".
153 (_bfd_doprnt): Handle more flags.
154 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
155 (error_handler_internal): Init args type to Bad.
157 2017-11-14 Alan Modra <amodra@gmail.com>
160 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
161 non-empty dynamic section.
162 (ppc_build_one_stub): Take elf_gp from output bfd, not output
164 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
166 2017-11-14 Alan Modra <amodra@gmail.com>
168 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
171 2017-11-13 Jan Beulich <jbeulich@suse.com>
173 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
175 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
176 (coff_write_object_contents): Likewise. Issue diagnostic for too
179 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
182 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
185 2017-11-12 Alan Modra <amodra@gmail.com>
187 * elflink.c (elf_link_add_object_symbols): Ignore anything but
188 defined and defweak symbols when setting up weakdefs.
190 2017-11-12 Alan Modra <amodra@gmail.com>
192 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
193 to keep dyn_relocs, clear to discard. Comment.
194 (allocate_dynrelocs): Always clear non_got_ref when clearing
195 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
196 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
197 dyn_relocs on undefined syms to handle for non-pic too.
198 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
199 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
200 to keep dyn_relocs, clear to discard. Comment.
201 (allocate_dynrelocs): Always clear non_got_ref when clearing
202 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
203 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
204 dyn_relocs on undefined syms to handle for non-pic too.
205 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
206 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
207 dyn_relocs here. Don't bother setting non_got_ref. Comment.
208 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
209 ifuncs. Move code deleting dyn_relocs on undefined symbols to
210 handle for non-pic too. Don't test non_got_ref. Do test
211 dynamic_adjusted and ELF_COMMON_DEF_P.
213 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
215 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
216 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
217 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
219 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
221 * elf32-mips.c (elf32_mips_write_core_note): New function.
222 (elf_backend_write_core_note): New macro.
223 * elf64-mips.c (elf64_mips_write_core_note): New function.
224 (elf_backend_write_core_note): New macro.
225 * elfn32-mips.c (elf32_mips_write_core_note): New function.
226 (elf_backend_write_core_note): New macro.
228 2017-11-07 Alan Modra <amodra@gmail.com>
230 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
233 2017-11-07 Alan Modra <amodra@gmail.com>
235 * sysdep.h: Formatting, comment fixes.
236 (gettext, ngettext): Redefine when ENABLE_NLS.
237 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
238 (_): Define using gettext.
239 (textdomain, bindtextdomain): Use safer "do nothing".
240 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
241 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
243 2017-11-05 Alan Modra <amodra@gmail.com>
246 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
249 2017-11-05 Alan Modra <amodra@gmail.com>
252 * bfd.c (union _bfd_doprnt_args): New.
253 (PRINT_TYPE): Add FIELD arg. Take value from args.
254 (_bfd_doprnt): Replace ap parameter with args. Adjust all
255 PRINT_TYPE invocations and reading of format args to suit.
256 Move "%%" handling out of switch handling args. Support
257 positional parameters.
258 (_bfd_doprnt_scan): New function.
259 (error_handler_internal): Call _bfd_doprnt_scan and read args.
261 2017-11-04 Alan Modra <amodra@gmail.com>
263 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
264 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
265 (ppc_elf_relocate_section): Don't output a dynamic relocation
266 for IE GOT entries in an executable.
267 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
268 (ppc64_elf_size_dynamic_sections): Likewise.
269 (ppc64_elf_relocate_section): Likewise.
271 2017-11-04 Alan Modra <amodra@gmail.com>
273 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
274 callers. Don't bother with SEC_ALLOC test. Return section pointer.
276 (maybe_set_textrel): ..here.
277 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
278 (maybe_set_textrel): Call minfo to print textrel warning to map file.
280 2017-11-04 Alan Modra <amodra@gmail.com>
282 * elf32-hppa.c (enum _tls_type): Move.
283 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
284 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
285 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
286 (got_entries_needed, got_relocs_needed): New functions.
287 (allocate_dynrelocs): Use them.
288 (elf32_hppa_size_dynamic_sections): Likewise.
289 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
290 Correct code emitting relocs on GD/IE got entries. Report an
291 error when a symbol has both normal and TLS GOT relocs.
293 2017-11-04 Alan Modra <amodra@gmail.com>
296 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
297 for plabels when non-pic.
298 (maybe_set_textrel): New function.
299 (readonly_dynrelocs): Move and rewrite.
300 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
301 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
302 for functions. Expand non_got_ref comments.
303 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
305 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
307 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
308 Don't use func_pointer_refcount. Don't set plt.refcount nor
309 non_got_ref for function pointer reference.
310 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
311 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
312 func_pointer_refcount.
313 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
314 func_pointer_refcount.
315 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
316 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
317 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
319 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
320 Nick Clifton <nickc@redhat.com>
323 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
324 overlarge raw syment count.
325 (coff_get_normalized_symtab): Likewise.
327 2017-11-01 James Bowman <james.bowman@ftdichip.com>
329 * archures.c: Add bfd_mach_ft32b.
330 * cpu-ft32.c: Add arch_info_struct.
331 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
333 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
335 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
336 (elf32_ft32_adjust_diff_reloc_value)
337 (elf32_ft32_adjust_reloc_if_spans_insn)
338 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
339 (ft32_elf_relax_section): New function.
340 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
341 * bfd-in2.h: Regenerate.
342 * libbfd.h: Regenerate.
344 2017-11-01 Nick Clifton <nickc@redhat.com>
347 * coffcode.h (coff_slurp_line_table): Check for an excessively
348 large line number count.
350 2017-11-01 Nick Clifton <nickc@redhat.com>
353 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
354 and offset in light of further possible bogus values.
356 2017-11-01 Alan Modra <amodra@gmail.com>
359 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
360 entry when just a dynamic reloc can serve. Ensure no dynamic
361 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
362 Expand and move the non_got_ref comment.
363 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
365 2017-11-01 Nick Clifton <nickc@redhat.com>
368 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
370 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
371 members of an archive.
373 2017-10-31 Nick Clifton <nickc@redhat.com>
376 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
379 2017-10-30 Alan Modra <amodra@gmail.com>
381 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
384 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
386 (bfd_elf_gc_sections): Likewise.
388 2017-10-30 Alan Modra <amodra@gmail.com>
391 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
392 ensure non_got_ref is not set due to debug references.
393 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
394 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
395 need for a plt entry.
396 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
397 dynamic relocs when pic. Remove bogus code attempting to handle
399 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
401 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
402 and SYMBOL_REFERENCES_LOCAL in GOT handling.
404 2017-10-28 Alan Modra <amodra@gmail.com>
407 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
408 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
409 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
410 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
412 2017-10-25 Alan Modra <amodra@gmail.com>
414 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
415 optionally prefixed with "_".
416 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
418 2017-10-24 Andrew Waterman <andrew@sifive.com>
420 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
423 2017-10-24 Renlin Li <renlin.li@arm.com>
426 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
428 2017-10-23 Nick Clifton <nickc@redhat.com>
431 * elflink.c (elf_link_output_extsym): Keep global undefined
432 symbols if they have been marked as needed.
434 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
436 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
438 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
439 `_bfd_mips_elf_mkobject'.
441 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
444 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
446 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
448 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
449 (riscv_pcgp_lo_reloc): Likewise.
450 (riscv_pcgp_relocs): Likewise.
451 (riscv_init_pcgp_relocs): New function.
452 (riscv_free_pcgp_relocs): Likewise.
453 (riscv_record_pcgp_hi_reloc): Likewise.
454 (riscv_record_pcgp_lo_reloc): Likewise.
455 (riscv_delete_pcgp_hi_reloc): Likewise.
456 (riscv_use_pcgp_hi_reloc): Likewise.
457 (riscv_record_pcgp_lo_reloc): Likewise.
458 (riscv_find_pcgp_lo_reloc): Likewise.
459 (riscv_delete_pcgp_lo_reloc): Likewise.
460 (_bfd_riscv_relax_pc): Likewise.
461 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
462 via the new functions above.
464 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
466 * elfnn-riscv.c (R_RISCV_DELETE): New define.
467 (_bfd_riscv_relax_delete): New function.
468 (perform_relocation): Handle R_RISCV_DELETE.
469 (_bfd_riscv_relax_section): Likewise.
471 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
474 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
475 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
476 bfd_link_executable for TLS check.
477 (tilegx_elf_check_relocs): Likewise.
478 (allocate_dynrelocs): Likewise.
479 (tilegx_elf_relocate_section): Likewise.
481 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
484 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
485 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
486 bfd_link_executable for TLS check.
487 (tilepro_elf_check_relocs): Likewise.
488 (allocate_dynrelocs): Likewise.
489 (tilepro_elf_relocate_section): Likewise.
491 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
494 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
495 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
496 bfd_link_executable for TLS check.
497 (_bfd_sparc_elf_check_relocs): Likewise.
498 (allocate_dynrelocs): Likewise.
499 (_bfd_sparc_elf_relocate_section): Likewise.
501 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
503 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
504 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
505 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
507 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
509 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
510 indirect and warning symbols.
512 2017-10-17 Alan Modra <amodra@gmail.com>
515 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
516 against size left rather than comparing pointers. Reorganise loop.
518 2017-10-17 Alan Modra <amodra@gmail.com>
521 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
522 and error for any other size that doesn't cover the header word.
524 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
526 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
527 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
528 (elf_backend_gc_sweep_hook): Likewise.
529 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
530 (bfinfdpic_gc_sweep_hook): Likewise.
531 (elf_backend_gc_sweep_hook): Likewise.
532 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
533 (elf_backend_gc_sweep_hook): Likewise.
534 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
535 (elf_backend_gc_sweep_hook): Likewise.
536 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
537 (elf_backend_gc_sweep_hook): Likewise.
538 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
539 (elf_backend_gc_sweep_hook): Likewise.
540 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
541 (elf_backend_gc_sweep_hook): Likewise.
542 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
544 (elf_m68k_remove_got_entry_type): Removed.
545 (elf_m68k_find_got_entry_ptr): Likewise.
546 (elf_m68k_remove_got_entry): Likewise.
547 (elf_m68k_gc_sweep_hook): Likewise.
548 (elf_backend_gc_sweep_hook): Likewise.
549 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
550 (elf_backend_gc_sweep_hook): Likewise.
551 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
552 (elf_backend_gc_sweep_hook): Likewise.
553 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
554 (elf_backend_gc_sweep_hook): Likewise.
555 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
556 (elf_backend_gc_sweep_hook): Likewise.
557 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
558 (elf_backend_gc_sweep_hook): Likewise.
559 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
560 (elf_backend_gc_sweep_hook): Likewise.
561 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
562 (elf_backend_gc_sweep_hook): Likewise.
563 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
564 (elf_backend_gc_sweep_hook): Likewise.
565 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
566 (elf_backend_gc_sweep_hook): Likewise.
567 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
568 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
569 (elf_backend_gc_sweep_hook): Likewise.
570 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
571 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
572 (elf_backend_gc_sweep_hook): Likewise.
573 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
574 (elf_backend_gc_sweep_hook): Likewise.
575 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
576 (elf_backend_gc_sweep_hook): Likewise.
577 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
578 (elf_backend_gc_sweep_hook): Likewise.
579 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
580 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
581 (elf_backend_gc_sweep_hook): Likewise.
582 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
583 (ppc64_elf_gc_sweep_hook): Likewise.
584 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
585 (elf_backend_gc_sweep_hook): Likewise.
586 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
587 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
588 * elflink.c (elf_link_add_object_symbols): Don't call
589 _bfd_elf_link_check_relocs here.
590 (gc_sweep_hook_fn): Removed.
591 (elf_gc_sweep): Remove gc_sweep_hook.
592 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
593 (elf_backend_gc_sweep_hook): Likewise.
594 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
595 (elf_backend_gc_sweep_hook): Likewise.
596 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
597 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
598 (elf_backend_gc_sweep_hook): Likewise.
599 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
600 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
601 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
602 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
603 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
604 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
606 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
608 * elf32-i386.c (elf_i386_backend_data): Removed.
609 (get_elf_i386_backend_data): Likewise.
610 (elf_i386_arch_bed): Replace elf_i386_backend_data with
611 elf_x86_backend_data.
612 (elf_i386_get_synthetic_symtab): Likewise.
613 (elf_i386_nacl_arch_bed): Likewise.
614 (elf_i386_vxworks_arch_bed): Likewise.
615 (elf_i386_relocate_section): Check target_os instead of
617 (elf_i386_finish_dynamic_symbol): Likewise.
618 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
619 Check target_os instead of is_vxworks.
620 (elf_i386_link_setup_gnu_properties): Remove normal_target and
621 is_vxworks. Initialize plt0_pad_byte.
622 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
623 (get_elf_x86_64_arch_data): Likewise.
624 (get_elf_x86_64_backend_data): Likewise.
625 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
626 elf_x86_backend_data.
627 (elf_x86_64_get_synthetic_symtab): Likewise.
628 (elf_x86_64_nacl_arch_bed): Likewise.
629 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
630 normal_target. Initialize plt0_pad_byte.
631 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
632 instead of is_vxworks.
633 (_bfd_x86_elf_size_dynamic_sections): Likewise.
634 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
635 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
636 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
637 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
638 Update normal_target. Set up plt0_pad_byte. Check target_os
639 instead of is_vxworks.
640 * elfxx-x86.h (elf_x86_target_os): New.
641 (elf_x86_backend_data): Likewise.
642 (get_elf_x86_backend_data): Likewise.
643 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
645 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
648 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
650 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
651 _bfd_x86_elf_finish_dynamic_sections.
652 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
653 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
655 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
658 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
661 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
662 hide symbol which was forced to be dynamic.
664 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
667 * elf32-cris.c (cris_elf_relocate_section): Don't generate
668 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
669 (cris_elf_check_relocs): Don't allocate dynamic relocation
670 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
672 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
675 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
676 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
677 (sh_elf_relocate_section): Don't generate dynamic relocation if
678 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
680 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
683 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
684 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
685 (elf_s390_relocate_section): Don't generate dynamic relocation
686 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
687 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
688 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
689 (elf_s390_relocate_section): Don't generate dynamic relocation
690 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
692 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
695 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
696 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
697 (allocate_dynrelocs): Discard dynamic relocations if
698 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
700 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
703 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
704 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
706 (allocate_dynrelocs): Discard dynamic relocations if
707 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
709 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
712 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
713 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
714 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
715 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
716 (elf_m68k_relocate_section): Don't generate dynamic relocation
717 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
719 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
722 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
723 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
724 (allocate_dynrelocs): Discard dynamic relocations if
725 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
726 (elf32_hppa_relocate_section): Don't generate dynamic
727 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
729 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
732 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
733 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
734 (allocate_fptr): Don't allocate function pointer if
735 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
736 (allocate_dynrel_entries): Don't allocate dynamic relocation
737 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
738 (set_got_entry): Don't set GOT entry if
739 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
740 (set_pltoff_entry): Don't set PLTOFF entry if
741 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
742 (elfNN_ia64_relocate_section): Don't install dynamic relocation
743 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
745 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
748 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
749 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
750 (allocate_dynrelocs): Don't allocate dynamic relocations if
751 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
753 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
756 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
757 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
758 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
759 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
761 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
764 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
765 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
766 (tilepro_elf_relocate_section): Don't generate dynamic
767 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
768 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
769 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
770 (tilegx_elf_relocate_section): Don't generate dynamic
771 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
773 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
776 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
777 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
779 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
780 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
782 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
784 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
785 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
786 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
788 2017-10-12 James Bowman <james.bowman@ftdichip.com>
790 * bfd-in2.h: Regenerate.
791 * libbfd.h: Regenerate.
792 * elf32-ft32.c: Add HOWTO R_FT32_15.
793 * reloc.c: Add BFD_RELOC_FT32_15.
795 2017-10-12 Nick Clifton <nickc@redhat.com>
797 * reloc.c (enum bfd_reloc_status): Start values at 2.
798 * bfd-in2.h: Regenerate.
799 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
800 that a TRUE return indicates success. Compare the result of
801 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
802 (build_one_stub): Change sense of tests against aarch64_relocate
804 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
805 than FALSE, when an error is detected.
806 (elfNN_aarch64_final_link_relocate): Likewise.
808 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
810 * elf32-i386.c (elf_backend_hide_symbol): New.
811 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
812 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
813 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
815 2017-10-12 Alan Modra <amodra@gmail.com>
817 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
818 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
819 (bfd_elf_define_start_stop): Likewise.
821 2017-10-12 Alan Modra <amodra@gmail.com>
823 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
824 when executable rather than non-PIC.
825 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
826 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
828 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
830 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
832 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
833 (elf_external_linux_prpsinfo64_ugid32): ... this.
834 (swap_linux_prpsinfo32_out): Rename to...
835 (swap_linux_prpsinfo32_ugid32_out): ... this.
836 (elf_external_linux_prpsinfo64_ugid16): New structure.
837 (swap_linux_prpsinfo64_ugid16_out): New function.
838 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
839 (elf_backend_linux_prpsinfo64_ugid16): Define.
840 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
841 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
842 of the 64-bit Linux core PRPSINFO note.
843 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
845 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
847 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
849 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
850 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
851 (elf_external_ppc_linux_prpsinfo32)
852 (swap_ppc_linux_prpsinfo32_out): Move to...
853 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
854 (swap_linux_prpsinfo32_ugid32_out): ... these.
855 (elf_external_linux_prpsinfo32): Rename to...
856 (elf_external_linux_prpsinfo32_ugid16): ... this.
857 (swap_linux_prpsinfo32_out): Rename to...
858 (swap_linux_prpsinfo32_ugid16_out): ... this.
859 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
860 (elf_backend_linux_prpsinfo32_ugid16): Define.
861 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
862 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
863 of the 32-bit Linux core PRPSINFO note.
864 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
865 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
866 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
867 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
868 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
869 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
870 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
871 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
872 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
873 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
875 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
877 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
878 `gap' member ahead of `pr_flag'.
880 2017-10-11 Pedro Alves <palves@redhat.com>
882 * bfd.c (_doprnt): Rename to ...
883 (_bfd_doprnt): ... this.
884 (error_handler_internal): Adjust.
886 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
888 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
889 instead of incrementing it.
890 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
892 2017-10-10 Renlin Li <renlin.li@arm.com>
895 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
896 symbols into dynamic.
898 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
901 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
902 (riscv_elf_link_hash_table_create): Initialize max_alignment to
904 (_bfd_riscv_relax_section): Cache the max alignment of output
905 sections if possible.
907 2017-10-10 Alan Modra <amodra@gmail.com>
909 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
910 .opd whenever .opd is present and non-zero size. Move code
911 setting abiversion to/from output file earlier. Only set
912 u.opd.func_sec when --gc-sections. Read relocs and set up
913 u.opd.func_sec values here..
914 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
916 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
918 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
920 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
923 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
925 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
926 .interp section with "ld --no-dynamic-linker".
928 2017-10-09 Alan Modra <amodra@gmail.com>
931 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
932 funcinfo_hash_table and varinfo_hash_table.
934 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
936 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
937 in read-only section with minfo.
938 (sh_elf_size_dynamic_sections): Likewise.
940 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
942 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
945 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
947 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
948 this_hdr.sh_entsize only if section size > 0.
950 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
952 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
954 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
956 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
957 in read-only section with minfo.
958 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
960 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
962 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
965 2017-10-06 John Baldwin <jhb@FreeBSD.org>
967 * elf-bfd.h (struct elf_backend_data): Add
968 `elf_backend_grok_freebsd_prstatus'.
969 * elf.c (elfcore_grok_freebsd_note): Call
970 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
972 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
974 (elf_backend_grok_freebsd_prstatus): Define.
975 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
976 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
978 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
980 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
981 and has_non_got_reloc with zero_undefweak.
982 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
983 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
985 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
986 has_non_got_reloc with zero_undefweak.
987 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
988 has_got_reloc and has_non_got_reloc with zero_undefweak.
989 (elf_x86_link_hash_entry): Likewise.
991 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
993 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
994 (VERIFY_COPY_RELOC): Likewise.
996 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
998 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
999 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1000 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1002 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1004 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
1005 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1006 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1008 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1010 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
1011 * elf32-i386.c (elf_i386_relocate_section): Use it.
1012 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1014 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1016 * elf32-i386.c (X86_SIZE_TYPE_P): New.
1017 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1018 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
1019 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1020 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
1022 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1024 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
1025 (PLT_LOCAL_IFUNC_P): Likewise.
1026 * elf32-i386.c (elf_i386_relocate_section): Use them.
1027 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1029 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1031 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
1032 * elf32-i386.c (elf_i386_relocate_section): Use it.
1033 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1035 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1037 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1038 * elf32-i386.c (elf_i386_relocate_section): Use it.
1039 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1041 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1043 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1044 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1045 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1046 (X86_PCREL_TYPE_P): This.
1047 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1048 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1049 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1051 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1053 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1055 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1056 * elf32-i386.c (elf_i386_tls_transition): Use it.
1057 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1059 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1061 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1062 Dump dynamic relocation in read-only section with minfo if
1064 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1065 (maybe_set_textrel): Likewise.
1066 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1067 read-only section with minfo.
1069 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1071 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1073 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1075 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1076 in read-only section with minfo.
1077 (tilepro_elf_size_dynamic_sections): Likewise.
1078 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1079 (tilegx_elf_size_dynamic_sections): Likewise.
1081 2017-10-05 Pedro Alves <palves@redhat.com>
1084 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1085 ellipsis parameter. Split out bfd_error_on_input code to..
1086 (bfd_set_input_error): .. New function.
1087 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1088 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1089 * bfd-in2.h: Regenerate.
1091 2017-10-05 Alan Modra <amodra@gmail.com>
1093 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1094 fini_array error value.
1096 2017-10-05 Alan Modra <amodra@gmail.com>
1099 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1101 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1103 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1104 (bfd_elf_set_group_contents): Add associated reloc section indices
1107 2017-10-04 Alan Modra <amodra@gmail.com>
1109 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1110 classify symbols for ELFv2.
1112 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1115 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1116 undergoes default promotion.
1117 * bfd-in2.h: Regenerate.
1119 2017-10-02 Alan Modra <amodra@gmail.com>
1121 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1122 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1124 2017-10-01 Alan Modra <amodra@gmail.com>
1127 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1128 (add_line_info): Always put end_sequence last.
1130 2017-10-01 Alan Modra <amodra@gmail.com>
1133 * dwarf2.c (read_section): Allocate buffer with extra byte for
1134 bfd_simple_get_relocated_section_contents rather than copying
1137 2017-09-29 Alan Modra <amodra@gmail.com>
1139 * merge.c (merge_strings): Return FALSE on malloc failure.
1140 (_bfd_merge_sections): Return failures from record_section and
1143 2017-09-28 Alan Modra <amodra@gmail.com>
1146 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1147 a case where plugin_notice isn't called.
1149 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1151 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1154 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1157 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1158 output_bfd to info->callbacks->minfo.
1160 2017-09-26 Nick Clifton <nickc@redhat.com>
1163 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1164 assertion failure if elf_x86_64_rtype_to_howto has already issued
1167 2017-09-26 Alan Modra <amodra@gmail.com>
1170 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1173 2017-09-26 Nick Clifton <nickc@redhat.com>
1176 * dwarf2.c (read_formatted_entries): Fail early if we know that
1177 the loop parsing data entries will overflow the end of the
1180 2017-09-26 Alan Modra <amodra@gmail.com>
1183 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1184 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1185 to stash->info_ptr_memory, and check die_ref is within that memory.
1186 Set info_ptr_end correctly when another CU is refd. Check die_ref
1187 for DW_FORM_ref4 etc. is within CU.
1189 2017-09-26 Alan Modra <amodra@gmail.com>
1192 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1193 (read_formatted_entries): Init "fe".
1194 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1196 2017-09-26 Alan Modra <amodra@gmail.com>
1199 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1200 bounds in inner loop.
1202 2017-09-25 Alan Modra <amodra@gmail.com>
1205 * dwarf1.c (parse_die): Sanity check pointer against section limit
1206 before dereferencing.
1207 (parse_line_table): Likewise.
1209 2017-09-25 Alan Modra <amodra@gmail.com>
1212 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1214 (parse_comp_unit): Likewise.
1216 2017-09-25 Alan Modra <amodra@gmail.com>
1219 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1221 2017-09-24 Alan Modra <amodra@gmail.com>
1224 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1225 within section bounds.
1227 2017-09-24 Alan Modra <amodra@gmail.com>
1230 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1232 2017-09-24 Alan Modra <amodra@gmail.com>
1235 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1236 pname param. Return status. Make name const. Don't abort,
1237 return an error. Formatting. Exit if current info_ptr matches
1238 orig_info_ptr. Update callers.
1239 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1240 nested_funcs an array of structs for extensibility. Formatting.
1242 2017-09-24 Alan Modra <amodra@gmail.com>
1245 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1246 rather than dividing by zero.
1248 2017-09-24 Alan Modra <amodra@gmail.com>
1251 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1253 2017-09-24 Alan Modra <amodra@gmail.com>
1256 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1258 2017-09-24 Alan Modra <amodra@gmail.com>
1261 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1262 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1265 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1268 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1271 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1274 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1275 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1277 2017-09-22 Pedro Alves <palves@redhat.com>
1278 Alan Modra <amodra@gmail.com>
1280 * version.h: Add comment.
1282 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1284 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1285 NT_S390_GS_BC, correct the previously swapped invocations of
1286 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1288 2017-09-19 Alan Modra <amodra@gmail.com>
1291 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1294 2017-09-19 Alan Modra <amodra@gmail.com>
1297 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1298 symbols before calculating verrefs. Don't renumber dynsyms
1299 after gc. Exclude .gnu.version when zero or one dynsym.
1300 Localize some vars and reindent.
1302 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1305 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1306 return from bfd_canonicalize_dynamic_reloc.
1308 2017-09-15 Alan Modra <amodra@gmail.com>
1311 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1312 overflows bfd_size_type.
1314 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1317 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1318 to indicate if conversion is performed.
1319 (elf_i386_check_relocs): Cache section contents and relocations
1320 if conversion is performed.
1321 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1322 contents and relocations if conversion is performed.
1324 2017-09-14 Nick Clifton <nickc@redhat.com>
1327 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1330 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1332 * elfxx-x86.h: Fix a typo in comments.
1334 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1336 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1338 2017-09-09 Alan Modra <amodra@gmail.com>
1340 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1343 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1345 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1346 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1347 (elf_i386_finish_dynamic_symbol): Likewise.
1348 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1349 (elf_x86_64_finish_dynamic_symbol): Likewise.
1350 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1351 (_bfd_x86_elf_fixup_symbol): Likewise.
1353 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1355 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1356 check has_non_got_reloc.
1358 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1361 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1362 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1363 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1364 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1365 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1366 and linker_def on __ehdr_start if it is referenced and not
1368 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1369 and return TRUE when building executable, if a symbol has
1370 non-GOT/non-PLT relocations in text section or there is no
1372 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1374 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1376 * elfxx-x86.h: Update comments.
1378 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1380 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1381 elf_x86_plt_layout_table with elf_x86_init_table.
1382 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1384 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1386 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1387 (elf_x86_init_table): This.
1388 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1389 elf_x86_plt_layout_table with elf_x86_init_table.
1391 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1393 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1394 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1395 * configure: Regenerated.
1396 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1397 and r_sym fields of plt_layout.
1398 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1400 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1401 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1402 r_info nor r_sym fields.
1403 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1405 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1407 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1409 * (_bfd_riscv_relax_align): Call bfd_set_error and
1410 print an error message when unable to relax a .align directive.
1412 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1414 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1415 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1416 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1417 R_RISCV_PCREL_HI20 relocs, and pass the result to
1418 riscv_record_pcrel_hi_reloc.
1420 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1422 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1423 r_type_p. Remove the converted argument. Replace
1424 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1425 the new relocation type via r_type_p.
1426 (elf_i386_relocate_section): Likewise.
1427 (elf_i386_finish_dynamic_symbol): Likewise.
1428 (need_convert_load): Removed.
1429 (check_relocs_failed): Updated.
1430 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1431 instead of setting need_convert_load.
1432 (_bfd_i386_elf_convert_load): Removed.
1433 * elf64-x86-64.c (need_convert_load): Removed.
1434 (check_relocs_failed): Updated.
1435 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1436 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1437 Return the new relocation type via r_type_p.
1438 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1439 instead of setting need_convert_load.
1440 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1442 (_bfd_x86_64_elf_convert_load): Removed.
1443 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1444 with SYMBOL_REFERENCES_LOCAL_P.
1445 (elf_x86_64_finish_dynamic_symbol): Likewise.
1446 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1448 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1449 (_bfd_x86_elf_link_symbol_references_local): New function.
1450 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1451 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1452 SYMBOL_REFERENCES_LOCAL_P.
1453 (elf_x86_link_hash_entry): Add local_ref.
1454 (elf_x86_link_hash_table): Remove convert_load.
1455 (_bfd_i386_elf_convert_load): Removed.
1456 (_bfd_x86_64_elf_convert_load): Likewise.
1457 (_bfd_x86_elf_link_symbol_references_local): New.
1459 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1461 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1462 (elf_x86_64_info_to_howto): Get the real relocation type by
1463 masking out R_X86_64_converted_reloc_bit.
1464 (elf_x86_64_check_tls_transition): Get the real relocation type
1465 by masking out R_X86_64_converted_reloc_bit.
1466 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1467 instead of setting converted_reloc.
1468 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1469 instead of converted_reloc. Get the real relocation type by
1470 masking out R_X86_64_converted_reloc_bit.
1471 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1472 R_X86_64_converted_reloc_bit is valid.
1473 * elfxx-x86.h (converted_reloc): Removed.
1475 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1477 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1478 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1479 to get the relocation type again.
1480 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1481 r_type when calling elf_x86_64_tls_transition. Don't use
1482 ELF32_R_TYPE to get the relocation type again.
1484 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1486 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1489 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1491 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1492 argument. Don't check relocation overflow. Avoid relocation
1493 overflow if --no-relax is used. Set converted_reloc on symbol
1494 if a GOTPCREL relocation is converted.
1495 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1496 --no-relax if GOTPCREL relocation conversion leads to relocation
1498 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1500 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1501 Edmar Wienskoski <edmar.wienskoski@nxp.com
1503 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1504 (ppc_elf_check_relocs): Handle it.
1505 (ppc_elf_vle_split20): New function.
1506 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1508 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1511 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1512 for x86-64 if GOT_TLS_GDESC_P is true.
1514 2017-09-03 Alan Modra <amodra@gmail.com>
1517 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1519 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1521 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1522 tls_get_addr for x86-64 in one place.
1524 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1526 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1527 with elfxx-x86.lo for 64-bit BFD.
1528 * configure: Regenerated.
1530 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1532 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1533 (_bfd_i386_elf_convert_load): This. Remove static.
1534 (elf_i386_size_dynamic_sections): Removed.
1535 (elf_backend_size_dynamic_sections): Likewise.
1536 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1537 (_bfd_x86_64_elf_convert_load): This. Remove static.
1538 (elf_x86_64_size_dynamic_sections): Removed.
1539 (elf_backend_size_dynamic_sections): Likewise.
1540 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1541 (elf_x86_allocate_dynrelocs): This. Make it static.
1542 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1543 (elf_x86_allocate_local_dynreloc): This. Make it static.
1544 (elf_i386_is_reloc_section): New function.
1545 (elf_x86_64_is_reloc_section): Likewise.
1546 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1547 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1548 Rearrange got_entry_size initialization.
1549 (_bfd_x86_elf_size_dynamic_sections): New function.
1550 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1551 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1552 (_bfd_i386_elf_convert_load): New.
1553 (_bfd_x86_64_elf_convert_load): Likewise.
1554 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1555 (elf_backend_size_dynamic_sections): Likewise.
1556 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1557 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1559 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1561 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1564 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1566 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1567 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1569 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1571 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1572 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1573 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1574 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1575 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1576 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1578 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1580 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1581 (elf_i386_allocate_local_dynrelocs): Likewise.
1582 (elf_i386_size_dynamic_sections): Replace
1583 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1584 with _bfd_x86_elf_allocate_dynrelocs and
1585 _bfd_x86_elf_allocate_local_dynrelocs.
1586 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1587 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1588 (elf_x86_64_size_dynamic_sections): Replace
1589 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1590 with _bfd_x86_elf_allocate_dynrelocs and
1591 _bfd_x86_elf_allocate_local_dynrelocs.
1592 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1593 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1594 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1595 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1597 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1599 * elf32-i386.c (is_i386_elf): Removed.
1600 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1601 (elf_i386_size_dynamic_sections): Likewise.
1602 (elf_i386_relocate_section): Likewise.
1603 * elf64-x86-64.c (is_x86_64_elf): Removed.
1604 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1606 (elf_x86_64_size_dynamic_sections): Likewise.
1607 (elf_x86_64_relocate_section): Likewise.
1608 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1610 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1613 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1615 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1616 (elf_i386_allocate_dynrelocs): Replace
1617 elf_i386_compute_jump_table_size with
1618 elf_x86_compute_jump_table_size.
1619 (elf_i386_size_dynamic_sections): Likewise.
1620 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1621 (elf_x86_64_allocate_dynrelocs): Replace
1622 elf_x86_64_compute_jump_table_size with
1623 elf_x86_compute_jump_table_size.
1624 (elf_x86_64_size_dynamic_sections): Likewise.
1625 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1627 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1628 (elf_x86_compute_jump_table_size): New.
1630 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1632 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1634 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1635 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1637 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1639 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1640 with htab->is_vxworks.
1641 (elf_i386_size_dynamic_sections): Likewise.
1642 (elf_i386_relocate_section): Likewise.
1643 (elf_i386_finish_dynamic_symbol): Likewise.
1644 (elf_i386_finish_dynamic_sections): Likewise.
1646 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1648 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1649 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1650 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1651 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1652 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1653 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1654 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1655 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1657 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1660 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1661 ELF_COMMON_DEF_P for common symbols.
1663 2017-09-02 Alan Modra <amodra@gmail.com>
1665 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1666 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1667 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1669 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1671 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1672 (elf_backend_gc_mark_hook): Likewise.
1673 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1674 (elf_backend_gc_mark_hook): Likewise.
1675 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1676 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1677 (elf_backend_gc_mark_hook): Likewise.
1679 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1681 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1682 (elf_backend_adjust_dynamic_symbol): Likewise.
1683 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1684 (elf_backend_adjust_dynamic_symbol): Likewise.
1685 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1686 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1687 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1688 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1689 (elf_backend_adjust_dynamic_symbol): Likewise.
1691 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1693 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1696 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1698 * elf32-i386.c (elf_i386_mkobject): Removed.
1699 (bfd_elf32_mkobject): Likewise.
1700 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1701 (bfd_elf64_mkobject): Likewise.
1702 (bfd_elf32_mkobject): Likewise.
1703 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1704 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1705 (bfd_elf64_mkobject): Likewise.
1706 (bfd_elf32_mkobject): Likewise.
1708 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1710 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1711 Call _bfd_x86_elf_link_setup_gnu_properties.
1712 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1713 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1715 (elf_x86_64_non_lazy_plt): Likewise.
1716 (elf_x86_64_lazy_bnd_plt): Likewise.
1717 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1718 (elf_x86_64_lazy_ibt_plt): Likewise.
1719 (elf_x32_lazy_ibt_plt): Likewise.
1720 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1721 (elf_x32_non_lazy_ibt_plt): Likewise.
1722 (elf_x86_64_nacl_plt): Likewise.
1723 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1724 _bfd_x86_elf_link_setup_gnu_properties.
1725 * elfxx-x86.c: Include elf-vxworks.h".
1726 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1727 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1728 comments for pic_plt0_entry and pic_plt_entry.
1729 (elf_x86_non_lazy_plt_layout): Likewise.
1730 (elf_x86_plt_layout_table): New.
1731 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1733 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1736 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1737 .eh_frame section for the second PLT.
1738 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1739 alignment of .eh_frame section for the second PLT.
1741 2017-09-01 Nick Clifton <nickc@redhat.com>
1744 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1747 2017-09-01 Nick Clifton <nickc@redhat.com>
1750 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1751 attribute buffer is NUL terminated.
1753 2017-08-31 Nick Clifton <nickc@redhat.com>
1756 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1757 to dwarf string sections.
1759 2017-08-31 Alan Modra <amodra@gmail.com>
1761 * po/SRC-POTFILES.in: Regenerate.
1763 2017-08-31 Alan Modra <amodra@gmail.com>
1765 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1766 for a section containing just a terminator. Allow multiple
1767 terminators at end of section.
1768 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1769 sections when not adding alignment. Assert on terminator in
1772 2017-08-31 Alan Modra <amodra@gmail.com>
1776 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1779 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1781 * configure.ac (bfd_backends): Add elf64.lo together with
1782 elfxx-x86.lo for 64-bit BFD.
1783 * configure: Regenerated.
1785 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1787 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1790 2017-08-31 Alan Modra <amodra@gmail.com>
1793 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1794 before _close_and_cleanup. Call iovec->bclose after.
1795 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1797 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1799 * elf32-i386.c (elf_i386_plt_type): Removed.
1800 (elf_i386_plt): Likewise.
1801 (elf_i386_get_synthetic_symtab): Updated. Call
1802 _bfd_x86_elf_get_synthetic_symtab.
1803 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1804 (elf_x86_64_plt): Likewise.
1805 (elf_x86_64_get_synthetic_symtab): Updated. Call
1806 _bfd_x86_elf_get_synthetic_symtab.
1807 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1808 (elf_x86_64_get_plt_got_vma): Likewise.
1809 (elf_i386_valid_plt_reloc_p): Likewise.
1810 (elf_x86_64_valid_plt_reloc_p): Likewise.
1811 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1812 * elfxx-x86.h (elf_x86_plt_type): New.
1813 (elf_x86_plt): Likewise.
1814 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1816 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1818 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1819 target_id instead of elf_machine_code.
1821 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1823 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1824 (elf_i386_lazy_plt_layout): Likewise.
1825 (elf_i386_non_lazy_plt_layout): Likewise.
1826 (elf_i386_plt_layout): Likewise.
1827 (elf_i386_link_hash_table): Likewise.
1828 (elf_i386_next_tls_desc_index): Likewise.
1829 (elf_i386_srelplt2): Likewise.
1830 (elf_i386_plt): Likewise.
1831 (elf_i386_lazy_plt): Likewise.
1832 (elf_i386_non_lazy_plt): Likewise.
1833 (elf_i386_link_hash_table_create): Likewise.
1834 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1835 (elf_i386_lazy_plt): Updated.
1836 (elf_i386_non_lazy_plt): Likewise.
1837 (elf_i386_lazy_ibt_plt): Likewise.
1838 (elf_i386_non_lazy_ibt_plt): Likewise.
1839 (elf_i386_allocate_dynrelocs): Likewise.
1840 (elf_i386_size_dynamic_sections): Likewise.
1841 (elf_i386_relocate_section): Likewise.
1842 (elf_i386_finish_dynamic_symbol): Likewise.
1843 (elf_i386_finish_dynamic_sections): Likewise.
1844 (elf_i386_get_synthetic_symtab): Likewise.
1845 (elf_i386_link_setup_gnu_properties): Likewise.
1846 (elf_i386_nacl_plt): Likewise.
1847 * elf64-x86-64.c (ABI_64_P): Removed.
1848 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1849 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1850 (elf_x86_64_lazy_plt_layout): Likewise.
1851 (elf_x86_64_non_lazy_plt_layout): Likewise.
1852 (elf_x86_64_plt_layout): Likewise.
1853 (elf_x86_64_link_hash_table): Likewise.
1854 (elf_x86_64_plt): Likewise.
1855 (elf_x86_64_lazy_plt): Likewise.
1856 (elf_x86_64_non_lazy_plt): Likewise.
1857 (elf_x86_64_link_hash_table_create): Likewise.
1858 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1859 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1860 (elf_x86_64_lazy_plt): Updated.
1861 (elf_x86_64_non_lazy_plt): Likewise.
1862 (elf_x86_64_lazy_bnd_plt): Likewise.
1863 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1864 (elf_x86_64_lazy_ibt_plt): Likewise.
1865 (elf_x32_lazy_ibt_plt): Likewise.
1866 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1867 (elf_x32_non_lazy_ibt_plt): Likewise.
1868 (elf_x86_64_allocate_dynrelocs): Likewise.
1869 (elf_x86_64_size_dynamic_sections): Likewise.
1870 (elf_x86_64_relocate_section): Likewise.
1871 (elf_x86_64_finish_dynamic_symbol): Likewise.
1872 (elf_x86_64_finish_dynamic_sections): Likewise.
1873 (elf_x86_64_get_synthetic_symtab): Likewise.
1874 (elf_x86_64_link_setup_gnu_properties): Likewise.
1875 (elf_x86_64_nacl_plt): Likewise.
1876 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1878 (ELF32_DYNAMIC_INTERPRETER): New.
1879 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1880 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1881 (_bfd_x86_elf_link_hash_table_create): Likewise.
1882 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1883 (elf_x86_link_hash_table_free): This. Make it static.
1884 * elfxx-x86.h: Don't include "objalloc.h".
1886 (elf_x86_lazy_plt_layout): Likewise.
1887 (elf_x86_non_lazy_plt_layout): Likewise.
1888 (elf_x86_plt_layout): Likewise.
1889 (_bfd_x86_elf_link_hash_table_create): Likewise.
1890 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1891 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1892 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1893 srelplt2 and next_tls_desc_index.
1894 (_bfd_x86_elf_link_hash_table_free): Removed.
1896 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1898 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1899 branch offset interpretation.
1901 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1904 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1906 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1908 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1909 (elf_x86_64_srelplt2): Likewise.
1911 2017-08-30 Alan Modra <amodra@gmail.com>
1913 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1914 (ppc64_elf_tls_optimize): Set it.
1915 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1916 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1917 addis would add zero.
1918 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1919 (ppc_elf_tls_optimize): Set it.
1920 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1921 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1923 2017-08-30 Alan Modra <amodra@gmail.com>
1925 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1926 __tls_get_addr call sequences to LE, don't move the addi down
1927 to the nop. Replace the bl with addi and leave the nop alone.
1929 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1931 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1933 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1935 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1937 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1939 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1940 (BFD64_BACKENDS): Likewise.
1941 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1942 (BFD64_BACKENDS_CFILES): Likewise.
1943 * Makefile.in: Regenerated.
1944 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1945 elf32-i386.lo and elf64-x86-64.lo.
1946 * configure: Regenerated.
1947 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1948 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1949 "objalloc.h" and "hashtab.h".
1950 (ELIMINATE_COPY_RELOCS): Removed.
1951 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1952 (SYMBOL_NO_COPYRELOC): Likewise.
1953 (elf_i386_link_hash_entry): Likewise.
1954 (GOT_UNKNOWN): Likewise.
1955 (GOT_NORMAL): Likewise.
1956 (GOT_TLS_GD): Likewise.
1957 (elf_i386_hash_entry): Likewise.
1958 (elf_i386_obj_tdata): Likewise.
1959 (elf_i386_tdata): Likewise.
1960 (elf_i386_local_got_tls_type): Likewise.
1961 (elf_i386_local_tlsdesc_gotent): Likewise.
1962 (elf_i386_hash_table): Likewise.
1963 (elf_i386_link_hash_newfunc): Likewise.
1964 (elf_i386_local_htab_hash): Likewise.
1965 (elf_i386_local_htab_eq): Likewise.
1966 (elf_i386_get_local_sym_hash): Likewise.
1967 (elf_i386_link_hash_table_free): Likewise.
1968 (elf_i386_copy_indirect_symbol): Likewise.
1969 (elf_i386_fixup_symbol): Likewise.
1970 (elf_i386_readonly_dynrelocs): Likewise.
1971 (elf_i386_always_size_sections): Likewise.
1972 (elf_i386_set_tls_module_base): Likewise.
1973 (elf_i386_dtpoff_base): Likewise.
1974 (compare_relocs): Likewise.
1975 (elf_i386_hash_symbol): Likewise.
1976 (elf_i386_parse_gnu_properties): Likewise.
1977 (elf_i386_merge_gnu_properties): Likewise.
1978 (elf_i386_link_check_relocs): Likewise.
1979 (elf_i386_merge_symbol_attribute): Likewise.
1980 (bfd_elf32_bfd_link_check_relocs): Likewise.
1981 (elf_backend_copy_indirect_symbol): Likewise.
1982 (elf_backend_always_size_sections): Likewise.
1983 (elf_backend_omit_section_dynsym): Likewise.
1984 (elf_backend_hash_symbol): Likewise.
1985 (elf_backend_fixup_symbol): Likewise.
1986 (elf_backend_parse_gnu_properties): Likewise.
1987 (elf_backend_merge_gnu_properties): Likewise.
1988 (elf_backend_merge_symbol_attribute): Likewise.
1989 (elf_i386_mkobject): Updated.
1990 (elf_i386_link_hash_table_create): Likewise.
1991 (elf_i386_check_tls_transition): Likewise.
1992 (elf_i386_tls_transition): Likewise.
1993 (elf_i386_convert_load_reloc): Likewise.
1994 (elf_i386_check_relocs): Likewise.
1995 (elf_i386_adjust_dynamic_symbol): Likewise.
1996 (elf_i386_allocate_dynrelocs): Likewise.
1997 (elf_i386_convert_load): Likewise.
1998 (elf_i386_size_dynamic_sections): Likewise.
1999 (elf_i386_relocate_section): Likewise.
2000 (elf_i386_finish_dynamic_symbol ): Likewise.
2001 (elf_i386_finish_dynamic_sections): Likewise.
2002 (elf_i386_output_arch_local_syms): Likewise.
2003 (elf_i386_get_synthetic_symtab): Likewise.
2004 (elf_i386_link_setup_gnu_properties): Likewise.
2005 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
2006 of elf_link_hash_table, as base.
2007 (elf_i386_next_tls_desc_index): New.
2008 (elf_i386_srelplt2): Likewise.
2009 (elf_i386_plt): Likewise.
2010 (elf_i386_lazy_plt): Likewise.
2011 (elf_i386_non_lazy_plt): Likewise.
2012 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
2013 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2014 "objalloc.h" and "hashtab.h".
2015 (ELIMINATE_COPY_RELOCS): Removed.
2016 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2017 (SYMBOL_NO_COPYRELOC): Likewise.
2018 (elf_x86_64_link_hash_entry): Likewise.
2019 (GOT_UNKNOWN): Likewise.
2020 (GOT_NORMAL): Likewise.
2021 (GOT_TLS_GD): Likewise.
2022 (elf_x86_64_hash_entry): Likewise.
2023 (elf_x86_64_obj_tdata): Likewise.
2024 (elf_x86_64_tdata): Likewise.
2025 (elf_x86_64_local_got_tls_type): Likewise.
2026 (elf_x86_64_local_tlsdesc_gotent): Likewise.
2027 (elf_x86_64_hash_table): Likewise.
2028 (elf_x86_64_link_hash_newfunc): Likewise.
2029 (elf_x86_64_local_htab_hash): Likewise.
2030 (elf_x86_64_local_htab_eq): Likewise.
2031 (elf_x86_64_get_local_sym_hash): Likewise.
2032 (elf_x86_64_link_hash_table_free): Likewise.
2033 (elf_x86_64_copy_indirect_symbol): Likewise.
2034 (elf_x86_64_fixup_symbol): Likewise.
2035 (elf_x86_64_readonly_dynrelocs): Likewise.
2036 (elf_x86_64_always_size_sections): Likewise.
2037 (elf_x86_64_set_tls_module_base): Likewise.
2038 (elf_x86_64_dtpoff_base): Likewise.
2039 (compare_relocs): Likewise.
2040 (elf_x86_64_merge_symbol_attribute): Likewise.
2041 (elf_x86_64_hash_symbol): Likewise.
2042 (elf_x86_64_parse_gnu_properties): Likewise.
2043 (elf_x86_64_merge_gnu_properties): Likewise.
2044 (elf_x86_64_link_check_relocs): Likewise.
2045 (elf_backend_copy_indirect_symbol): Likewise.
2046 (elf_backend_always_size_sections): Likewise.
2047 (bfd_elf64_bfd_link_check_relocs): Likewise.
2048 (elf_backend_merge_symbol_attribute): Likewise.
2049 (elf_backend_hash_symbol): Likewise.
2050 (elf_backend_omit_section_dynsym): Likewise.
2051 (elf_backend_fixup_symbol): Likewise.
2052 (elf_backend_parse_gnu_properties): Likewise.
2053 (elf_backend_merge_gnu_properties): Likewise.
2054 (bfd_elf32_bfd_link_check_relocs): Likewise.
2055 (elf_x86_64_mkobject): Updated.
2056 (elf_x86_64_link_hash_table_create): Likewise.
2057 (elf_x86_64_check_tls_transition): Likewise.
2058 (elf_x86_64_tls_transition): Likewise.
2059 (elf_x86_64_convert_load_reloc): Likewise.
2060 (elf_x86_64_check_relocs): Likewise.
2061 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2062 (elf_x86_64_allocate_dynrelocs): Likewise.
2063 (elf_x86_64_convert_load): Likewise.
2064 (elf_x86_64_size_dynamic_sections): Likewise.
2065 (elf_x86_64_relocate_section): Likewise.
2066 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2067 (elf_x86_64_finish_dynamic_sections): Likewise.
2068 (elf_x86_64_output_arch_local_syms): Likewise.
2069 (elf_x86_64_get_synthetic_symtab): Likewise.
2070 (elf_x86_64_link_setup_gnu_properties): Likewise.
2071 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2072 instead of elf_link_hash_table, as base.
2073 (elf_x86_64_next_tls_desc_index): New.
2074 (elf_x86_64_srelplt2): Likewise.
2075 (elf_x86_64_plt): Likewise.
2076 (elf_x86_64_lazy_plt): Likewise.
2077 (elf_x86_64_non_lazy_plt): Likewise.
2078 * elfxx-x86.c: New file.
2079 * elfxx-x86.h: Likewise.
2081 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2083 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2085 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2087 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2089 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2090 sections before checking dynamic relocations and free invalid
2091 PLT section contents.
2092 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2094 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2096 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2097 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2099 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2102 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2104 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2106 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2108 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2110 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2112 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2115 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2116 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2117 Add a has_no_copy_on_protected bitfield.
2118 (elf_has_no_copy_on_protected): New.
2119 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2120 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2121 (elf_merge_gnu_property_list): Likewise.
2122 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2123 to FALSE for elf_has_no_copy_on_protected.
2124 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2125 (elf_i386_link_hash_entry): Add def_protected.
2126 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2127 when checking info->nocopyreloc.
2128 (elf_i386_link_setup_gnu_properties): Don't set
2129 extern_protected_data here.
2130 (elf_i386_merge_symbol_attribute): New function.
2131 (elf_backend_merge_symbol_attribute): New.
2132 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2133 (elf_x86_64_link_hash_entry): Add def_protected.
2134 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2135 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2136 when checking info->nocopyreloc.
2137 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2138 relocation run-time overflow and unresolvable R_X86_64_32S
2139 relocation against protected data symbol defined in shared object
2140 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2141 (elf_x86_64_link_setup_gnu_properties): Don't set
2142 extern_protected_data here.
2143 (elf_x86_64_merge_symbol_attribute): New function.
2144 (elf_backend_merge_symbol_attribute): New.
2146 2017-08-26 Alan Modra <amodra@gmail.com>
2148 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2149 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2150 (ppc_elf_relocate_section): Comment fix.
2151 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2152 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2153 Support dynamic relocs for TPREL16 when non-pic too.
2154 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2155 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2158 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2160 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2161 "symbol" in comments.
2162 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2164 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2167 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2168 R_X86_64_PC32 relocation run-time overflow and unresolvable
2169 R_X86_64_32S relocation with -z nocopyreloc.
2171 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2173 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2174 Undefined symbols may not have a type.
2175 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2177 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2179 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2180 bfd_link_info. Report shared, PIE or PDE object based on
2182 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2183 (elf_x86_64_relocate_section): Likewise.
2185 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2187 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2188 for function symbols.
2189 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2191 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2193 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2194 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2195 is set on any input relocatable file.
2196 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2198 2017-08-23 Alan Modra <amodra@gmail.com>
2201 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2202 ensure_undefweak_dynamic. Handle undefined too.
2203 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2204 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2205 (allocate_dynrelocs): Discard undefined non-default visibility
2206 relocs first. Make undefined syms dynamic. Tidy goto.
2208 2017-08-21 Alan Modra <amodra@gmail.com>
2209 H.J. Lu <hongjiu.lu@intel.com>
2212 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2213 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2215 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2218 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2219 undefined weak symbols.
2221 2017-08-18 Nick Clifton <nickc@redhat.com>
2224 * tekhex.c (getsym): Fix check for source pointer walking off the
2225 end of the input buffer.
2227 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2230 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2231 relocations in debug sections, change abort to _bfd_error_handler.
2233 2017-08-14 Nick Clifton <nickc@redhat.com>
2236 * elf.c (setup_group): Check for an empty or very small group
2238 * po/bfd.pot: Regenerate.
2240 2017-08-14 Alan Modra <amodra@gmail.com>
2243 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2244 alignment padding here.
2245 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2246 in a reverse pass over sections.
2248 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2251 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2252 for @plt suffixes first.
2253 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2255 2017-08-08 Nick Clifton <nickc@redhat.com>
2258 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2259 small section lengths.
2260 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2262 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2263 there is enough data present in the note.
2265 2017-08-08 Alan Modra <amodra@gmail.com>
2268 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2269 got.refcount for GOTOFF relocs, just create .got section.
2271 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2273 * elflink.c (elf_link_add_object_symbols): Move common symbol
2274 check after bed->common_definition.
2276 2017-08-07 Alan Modra <amodra@gmail.com>
2279 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2280 needed to define various dynamic tags have been discarded.
2282 2017-08-07 Nick Clifton <nickc@redhat.com>
2285 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2286 has not been set then use the bfd returned by
2287 _bfd_elf_link_setup_gnu_properties. If that is null then search
2288 through all the input bfds selecting the first normal, ELF format
2290 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2292 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2294 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2296 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2297 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2298 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2299 (elf_i386_link_check_relocs): New function.
2300 (bfd_elf32_bfd_link_check_relocs): New.
2301 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2303 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2304 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2305 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2306 (elf_x86_64_link_check_relocs): New function.
2307 (bfd_elf64_bfd_link_check_relocs): New.
2308 (bfd_elf32_bfd_link_check_relocs): Likewise.
2310 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2313 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2314 as undefined for --no-define-common.
2316 2017-08-05 Alan Modra <amodra@gmail.com>
2318 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2319 hppa_link_hash_table.
2321 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2323 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2324 entries for sysregs with negative indices.
2326 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2328 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2329 isn't the S/390 specific elf data.
2330 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2332 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2334 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2335 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2336 [R_RISCV_ADD16]: Likewise.
2337 [R_RISCV_ADD32]: Likewise.
2338 [R_RISCV_ADD64]: Likewise.
2339 [R_RISCV_SUB6]: Likewise.
2340 [R_RISCV_SUB8]: Likewise.
2341 [R_RISCV_SUB16]: Likewise.
2342 [R_RISCV_SUB32]: Likewise.
2343 [R_RISCV_SUB64]: Likewise.
2345 2017-07-31 Alan Modra <amodra@gmail.com>
2347 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2348 without ld.so checks.
2350 2017-07-29 Alan Modra <amodra@gmail.com>
2353 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2354 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2355 (is_elfv2_localentry0): Test non_zero_localentry.
2356 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2358 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2360 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2361 pointer check for htab->elf.irelplt.
2362 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2364 2017-07-27 Nick Clifton <nickc@redhat.com>
2367 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2369 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2371 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2373 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2375 (evax_bfd_print_emh): Check for invalid string lengths.
2377 2017-07-25 Nick Clifton <nickc@redhat.com>
2379 * po/fr.po: Updated French translation.
2381 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2384 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2385 16-bit absolute branches into 10-bit pc-relative branches on the
2386 MSP430 as well as the MSP430X.
2388 2017-07-25 Alan Modra <amodra@gmail.com>
2390 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2391 (stub_eh_frame_size): New function.
2392 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2393 (group_sections): Init group tls_get_addr_opt_bctrl.
2394 (ppc64_elf_size_stubs): Update sizing and initialization of
2395 .eh_frame. Iteration over stubs via group list.
2396 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2397 (ppc64_elf_finish_dynamic_sections): Update finalization of
2400 2017-07-24 Nick Clifton <nickc@redhat.com>
2403 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2404 of the relocs to the canonicalize_one_reloc routine.
2405 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2406 for the _bfd_mach_o_canonicalize_one_reloc field.
2407 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2408 res_base parameter. Use to check for corrupt pair relocs.
2409 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2411 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2413 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2416 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2417 enough data in the record before attempting to parse it.
2418 (_bfd_vms_slurp_eeom): Likewise.
2420 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2421 (image_set_ptr): Likewise.
2422 (alpha_vms_slurp_relocs): Likewise.
2424 (alpha_vms_object_p): Check for a truncated record.
2426 2017-07-24 Nick Clifton <nickc@redhat.com>
2429 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2430 an unrecognized reloc and sets the bfd_error value.
2431 * libbfd.h: Regenerate.
2432 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2434 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2435 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2436 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2437 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2438 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2440 2017-07-23 Alan Modra <amodra@gmail.com>
2442 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2445 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2448 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2449 reloc_class_ifunc for ifunc symbols.
2451 2017-07-19 Nick Clifton <nickc@redhat.com>
2454 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2455 correct magic bytes at the start, set the error to wrong format
2456 and clear the format selector before returning NULL.
2458 2017-07-19 Nick Clifton <nickc@redhat.com>
2461 * coff-rs6000.c (_bfd_strntol): New function.
2462 (_bfd_strntoll): New function.
2463 (GET_VALUE_IN_FIELD): New macro.
2464 (EQ_VALUE_IN_FIELD): new macro.
2465 (_bfd_xcoff_slurp_armap): Use new macros.
2466 (_bfd_xcoff_archive_p): Likewise.
2467 (_bfd_xcoff_read_ar_hdr): Likewise.
2468 (_bfd_xcoff_openr_next_archived_file): Likewise.
2469 (_bfd_xcoff_stat_arch_elt): Likewise.
2470 * coff64-rs6000.c (_bfd_strntol): New function.
2471 (_bfd_strntoll): New function.
2472 (GET_VALUE_IN_FIELD): New macro.
2473 (xcoff64_slurp_armap): Use new macros.
2475 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2476 John Eric Martin <John.Martin@emmicro-us.com>
2478 * bfd-in2.h: Regenerate.
2479 * libbfd.h: Regenerate.
2480 * elf32-arc.c (JLI): Define.
2481 * reloc.c: Add JLI relocations.
2483 2017-07-18 Nick Clifton <nickc@redhat.com>
2486 * coff-sh.c: Fix spelling typos.
2487 * compress.c: Likewise.
2488 * cpu-pdp11.c: Likewise.
2489 * ecofflink.c: Likewise.
2490 * elf-m10300.c: Likewise.
2492 * elf32-arm.c: Likewise.
2493 * elf32-m68k.c: Likewise.
2494 * elf32-nds32.c: Likewise.
2495 * elf32-ppc.c: Likewise.
2496 * elf32-sh.c: Likewise.
2497 * elf32-v850.c: Likewise.
2498 * elf64-ppc.c: Likewise.
2499 * elf64-x86-64.c: Likewise.
2500 * elflink.c: Likewise.
2501 * elfnn-aarch64.c: Likewise.
2502 * elfxx-mips.c: Likewise.
2504 * sunos.c: Likewise.
2505 * vms-alpha.c: Likewise.
2506 * xcofflink.c: Likewise.
2508 2017-07-18 Nick Clifton <nickc@redhat.com>
2511 * coffcode.h (handle_COMDAT): Replace abort with an error message
2514 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2517 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2520 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2522 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2524 2017-07-16 Alan Modra <amodra@gmail.com>
2526 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2527 __tls_index GOT entries when using __tls_get_addr_opt stub.
2528 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2530 2017-07-12 Alan Modra <amodra@gmail.com>
2532 * po/es.po: Update from translationproject.org/latest/bfd/.
2533 * po/fi.po: Likewise.
2534 * po/fr.po: Likewise.
2535 * po/id.po: Likewise.
2536 * po/ja.po: Likewise.
2537 * po/ro.po: Likewise.
2538 * po/ru.po: Likewise.
2539 * po/sr.po: Likewise.
2540 * po/sv.po: Likewise.
2541 * po/tr.po: Likewise.
2542 * po/uk.po: Likewise.
2543 * po/vi.po: Likewise.
2544 * po/zh_CN.po: Likewise.
2545 * po/hr.po: New file from translationproject.org.
2546 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2547 * configure: Regenerate.
2549 2017-07-12 Nick Clifton <nickc@redhat.com>
2551 Fix compile time warnings using gcc 7.1.1.
2552 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2554 (elf_xtensa_get_gotplt_section): Increase length of got_name
2556 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2557 default return of FALSE.
2558 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2559 default return of FALSE.
2561 2017-07-12 Alan Modra <amodra@gmail.com>
2563 * binary.c (binary_set_section_contents): Don't print filepos in
2565 (coff_write_object_contents): Cast size_t for error message.
2566 (coff_slurp_line_table): Don't use bfd_vma symndx.
2567 (coff_slurp_reloc_table): Remove unneeded cast.
2568 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2570 (find_abstract_instance_name): Likewise.
2571 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2572 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2573 (elf32_arm_check_relocs): Make r_symndx an int.
2574 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2576 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2578 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2580 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2581 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2582 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2583 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2584 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2585 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2586 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2587 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2588 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2589 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2590 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2591 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2592 and use %lu for error message.
2593 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2594 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2597 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2599 (elf32_arm_final_link_relocate): Likewise.
2600 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2601 * coffcode.h (styp_to_sec_flags): Likewise.
2602 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2603 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2604 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2605 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2606 (elf32_bfin_merge_private_bfd_data): Likewise.
2607 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2608 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2609 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2610 (i370_elf_relocate_section): Likewise.
2611 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2612 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2613 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2614 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2615 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2616 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2617 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2618 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2619 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2620 * ieee.c (ieee_write_id, read_id): Likewise.
2621 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2622 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2623 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2624 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2625 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2626 * stabs.c (_bfd_link_section_stabs): Likewise.
2628 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2630 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2631 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2632 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2633 * coff-sh.c (sh_relax_section): Likewise.
2634 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2635 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2636 * coffcode.h (coff_slurp_reloc_table): Likewise.
2637 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2638 (_bfd_coff_read_string_table): Likewise.
2639 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2640 * compress.c (bfd_get_full_section_contents): Likewise.
2641 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2642 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2643 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2644 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2645 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2646 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2647 (elf32_arm_write_section): Likewise.
2648 * elf32-bfin.c (bfin_relocate_section): Likewise.
2649 (bfinfdpic_relocate_section): Likewise.
2650 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2651 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2652 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2653 (elf_i386_relocate_section): Likewise.
2654 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2655 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2656 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2657 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2658 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2659 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2660 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2661 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2662 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2663 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2664 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2665 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2666 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2667 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2668 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2669 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2670 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2671 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2672 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2673 * elf32-sh.c (sh_elf_relax_section): Likewise.
2674 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2675 (sh_elf_relocate_section): Likewise.
2676 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2677 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2678 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2679 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2680 * elf32-v850.c (v850_elf_relax_section): Likewise.
2681 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2682 (elf_vax_relocate_section): Likewise.
2683 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2684 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2685 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2686 (do_fix_for_relocatable_link): Likewise.
2687 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2688 (elf64_alpha_relax_with_lituse): Likewise.
2689 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2690 (elf_hppa_final_link_relocate): Likewise.
2691 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2692 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2693 (elf64_vms_link_add_object_symbols): Likewise.
2694 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2695 (mmix_final_link_relocate): Likewise.
2696 * elf64-s390.c (invalid_tls_insn): Likewise.
2697 (elf_s390_relocate_section): Likewise.
2698 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2699 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2700 (elf_x86_64_relocate_section): Likewise.
2701 * elfcode.h (elf_slurp_symbol_table): Likewise.
2702 * elfcore.h (elf_core_file_p): Likewise.
2703 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2704 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2705 (elfNN_aarch64_relocate_section): Likewise.
2706 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2707 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2708 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2709 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2710 (_bfd_mips_elf_relocate_section): Likewise.
2711 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2712 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2713 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2714 * ieee.c (ieee_slurp_external_symbols): Likewise.
2715 * ihex.c (ihex_write_object_content): Likewise.
2716 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2717 * merge.c (_bfd_merged_section_offset): Likewise.
2718 * mmo.c (mmo_write_loc_chunk): Likewise.
2719 (mmo_write_object_contents): Likewise.
2720 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2721 * stabs.c (_bfd_link_section_stabs): Likewise.
2722 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2724 2017-07-11 Alan Modra <amodra@gmail.com>
2726 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2728 2017-07-11 Alan Modra <amodra@gmail.com>
2730 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2731 instruction" error using _bfd_error_handler, not einfo.
2733 2017-07-10 Nick Clifton <nickc@redhat.com>
2735 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2736 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2738 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2740 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2742 2017-07-07 Alan Modra <amodra@gmail.com>
2744 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2746 2017-07-07 Alan Modra <amodra@gmail.com>
2748 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2749 as long long. Move code replacing "ll" with "I64", and simplify.
2751 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2753 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2756 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2758 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2760 (line_info_add_file_name): Likewise.
2761 (decode_line_info): Likewise.
2763 2017-07-04 Tristan Gingold <gingold@adacore.com>
2765 * version.m4: Bump version to 2.29.51
2766 * configure: Regenerate.
2768 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2770 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2771 sanity check at the head of this function.
2773 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2775 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2776 dwarf_line_str_size.
2777 (struct attr_abbrev): Add field implicit_const.
2778 (dwarf_debug_sections): Add .debug_line_str.
2779 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2780 (dwarf_debug_section_assert): Add static assertion.
2781 (read_indirect_line_string): New.
2782 (read_abbrevs): Support DW_FORM_implicit_const.
2783 (is_str_attr): Support DW_FORM_line_strp.
2784 (read_attribute_value): Support DW_FORM_line_strp and
2785 DW_FORM_implicit_const.
2786 (read_attribute): Support DW_FORM_implicit_const.
2787 (line_info_add_include_dir, line_info_add_include_dir_stub):
2788 (line_info_add_file_name, read_formatted_entries): New.
2789 (decode_line_info, parse_comp_unit): Support DWARF 5.
2790 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2792 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2794 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2795 abort statement that was put for symbols that are not dynamic.
2797 2017-07-03 Tristan Gingold <gingold@adacore.com>
2799 * po/bfd.pot: Regenerate
2801 2017-07-03 Alan Modra <amodra@gmail.com>
2803 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2804 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2805 * elf.c (setup_group): Use "Lx" to print sh_size.
2806 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2807 unknown section type in hex.
2808 (copy_special_section_fields): Style fix.
2809 (bfd_section_from_shdr): Correct format for sh_link. Use a
2810 common error message for all the variants of unrecognized
2812 (assign_file_positions_for_load_sections): Use "Lx" for lma
2813 adjust error message.
2814 (assign_file_positions_for_non_load_sections): Formatting.
2815 (rewrite_elf_program_header): Formatting. Use "Lx" for
2816 bfd_vma values in error messages.
2817 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2818 ELF_R_SYM value to type expected by format.
2819 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2821 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2822 (elf_link_input_bfd): Use "Lx" for r_info.
2823 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2825 2017-07-03 Alan Modra <amodra@gmail.com>
2827 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2828 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2829 Microsoft C library variant of long long format specifier.
2830 (PRINT20): Cast value to bfd_uint64_t not long long.
2831 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2832 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2833 long long. Don't cast to bfd_vma.
2834 * elf32-score.c (score3_bfd_getl48): Likewise.
2835 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2837 2017-07-03 Alan Modra <amodra@gmail.com>
2839 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2841 (bfd_elf_print_symbol): Don't cast symbol->flags.
2842 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2843 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2844 _bfd_error_handler argument order.
2845 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2847 2017-07-03 Alan Modra <amodra@gmail.com>
2849 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2850 AC_TYPE_LONG_DOUBLE.
2851 * configure: Regenerate.
2852 * config.in: Regenerate.
2854 2017-06-29 Andrew Waterman <andrew@sifive.com>
2856 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2859 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2861 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2862 unless it is undefined weak.
2863 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2864 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2866 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2867 is not dynamic in PIC, abort.
2869 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2872 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2873 undefined weak symbols into dynamic.
2874 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2875 relocation for non-dynamic symbols.
2876 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2878 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2880 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2881 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2882 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2883 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2884 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2887 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2889 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2890 (elfcore_write_s390_gs_bc): Likewise.
2891 * elf.c (elfcore_grok_s390_gs_cb): New function.
2892 (elfcore_grok_s390_gs_bc): New function.
2893 (elfcore_grok_note): Call them.
2894 (elfcore_write_s390_gs_cb): New function.
2895 (elfcore_write_s390_gs_bc): New function.
2896 (elfcore_write_register_note): Call them.
2898 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2900 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2901 bfd_get_file_size. Check archive element size.
2902 (_bfd_generic_get_section_contents_in_window): Likewise.
2904 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2906 * bfd-in2.h: Regenerated.
2907 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2908 (bfd_get_file_size): Likewise.
2910 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2911 Matthew Fortune <matthew.fortune@imgtec.com>
2913 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2914 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2915 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2916 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2918 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2919 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2920 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2921 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2922 `bfd_mach_mips_interaptiv_mr2' entries.
2923 * bfd-in2.h: Regenerate.
2925 2017-06-27 Nick Clifton <nickc@redhat.com>
2927 * tekhex.c (pass_over): Revert accidental conversion of a local
2928 array to a static array.
2930 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2933 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2934 reloc addend if necessary. Adjust diff only if
2935 shrinked_insn_address < end_address.
2937 2017-06-27 Alan Modra <amodra@gmail.com>
2940 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2941 (_bfd_generic_get_section_contents_in_window): Likewise.
2943 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2945 * elfnn-riscv.c (perform_relocation): Support the new
2946 R_RISCV_32_PCREL relocation.
2947 (riscv_elf_relocate_section): Likewise.
2948 * elfxx-riscv.c (howto_table): Likewise.
2949 (riscv_reloc_map): Likewise.
2950 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2951 * libbfd.h: Regenerate.
2953 2017-06-27 Alan Modra <amodra@gmail.com>
2956 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2957 Use unsigned file pointer type, and remove cast.
2958 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2959 Add "count", not "sz".
2961 2017-06-26 Pedro Alves <palves@redhat.com>
2964 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2967 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2970 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2973 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2975 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2976 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2977 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2978 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2979 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2981 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2984 * compress.c (bfd_get_full_section_contents): Don't check the
2986 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2987 reject a section whose size + offset is greater than the size
2989 (_bfd_generic_get_section_contents_in_window): Likewise.
2991 2017-06-26 Nick Clifton <nickc@redhat.com>
2994 * tekhex.c (getvalue): Check for the source pointer exceeding the
2995 end pointer before the first byte is read.
2997 2017-06-26 Nick Clifton <nickc@redhat.com>
3000 * opncls.c (get_build_id): Check that the section is big enough
3001 to contain the whole note.
3002 * compress.c (bfd_get_full_section_contents): Check for and reject
3003 a section whose size is greater than the size of the entire file.
3004 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3005 contain a notes section.
3007 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3009 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3011 (elf_s390_modify_segment_map): Likewise.
3012 (bfd_elf_s390_set_options): Lisewise.
3014 2017-06-26 Alan Modra <amodra@gmail.com>
3016 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
3018 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
3019 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
3020 .preinit_array on --just-syms bfds.
3021 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
3022 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
3023 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
3025 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3027 * elf.c (find_link): Bounds check "hint".
3029 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
3031 * elf32-arm.c (using_thumb_only): Update list of architectures in
3032 BFD_ASSERT for which the logic is valid.
3033 (using_thumb2_bl): Likewise.
3034 (using_thumb2): Likewise and return true for ARMv8-R.
3035 (arch_has_arm_nop): Likewise.
3036 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3037 merging logic. Update commentis for value 15 of v8m_baseline,
3038 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3039 merging of value 15 of Tag_CPU_arch.
3041 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3043 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3044 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3045 * bfd-in2.h: Regenerate.
3047 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3049 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3050 the error_alignment label forward. Properly align program
3051 property note section.
3053 2017-06-22 Eric Christopher <echristo@gmail.com>
3055 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3056 abs to fix a truncation warning.
3058 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3060 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3061 local undefined weak symbol to 0.
3062 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3064 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3066 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3067 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3068 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3069 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3070 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3071 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3072 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3073 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3075 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3077 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3078 (elf_i386_lazy_ibt_plt_entry): Likewise.
3079 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3080 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3081 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3082 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3083 (elf_i386_lazy_plt_layout): Likewise.
3084 (elf_i386_non_lazy_plt_layout): Likewise.
3085 (elf_i386_link_hash_entry): Add plt_second.
3086 (elf_i386_link_hash_table): Add plt_second and
3087 plt_second_eh_frame.
3088 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3089 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3090 the second PLT. Check the second PLT.
3091 (elf_i386_relocate_section): Use the second PLT to resolve
3092 PLT reference if needed.
3093 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3095 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3096 second PLT. Generate unwind info for the second PLT.
3097 (elf_i386_plt_type): Add plt_second.
3098 (elf_i386_get_synthetic_symtab): Support the second PLT.
3099 (elf_i386_parse_gnu_properties): Support
3100 GNU_PROPERTY_X86_FEATURE_1_AND.
3101 (elf_i386_merge_gnu_properties): Support
3102 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3103 on GNU_PROPERTY_X86_FEATURE_1_IBT
3104 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3105 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3106 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3107 is set on all relocatable inputs.
3108 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3109 (elf_x32_lazy_ibt_plt_entry): Likewise.
3110 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3111 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3112 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3113 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3114 (elf_x86_64_lazy_ibt_plt): Likewise.
3115 (elf_x32_lazy_ibt_plt): Likewise.
3116 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3117 (elf_x32_non_lazy_ibt_plt): Likewise.
3118 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3119 (elf_x86_64_parse_gnu_properties): Support
3120 GNU_PROPERTY_X86_FEATURE_1_AND.
3121 (elf_x86_64_merge_gnu_properties): Support
3122 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3123 on GNU_PROPERTY_X86_FEATURE_1_IBT
3124 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3125 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3126 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3127 is set on all relocatable inputs.
3129 2017-06-22 Nick Clifton <nickc@redhat.com>
3132 * som.c (setup_sections): NUL terminate the space_strings buffer.
3133 Check that the space.name field does not index beyond the end of
3134 the space_strings buffer.
3136 2017-06-21 Nick Clifton <nickc@redhat.com>
3139 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3141 2017-06-21 Nick Clifton <nickc@redhat.com>
3144 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3145 type of the size parameter.
3146 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3147 length of the counted string.
3148 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3149 (_bfd_vms_save_counted_string): Likewise.
3150 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3151 _bfd_vms_save_counted_string.
3152 (_bfd_vms_slurp_ehdr): Likewise.
3153 (_bfd_vms_slurp_egsd): Likewise.
3154 (Parse_module): Likewise.
3156 2017-06-21 Alan Modra <amodra@gmail.com>
3158 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3159 calls before tocsave calls.
3160 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3163 2017-06-21 Nick Clifton <nickc@redhat.com>
3166 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3167 bfd_get_full_section_contents returns no contents.
3169 2017-06-21 Nick Clifton <nickc@redhat.com>
3172 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3175 2017-06-21 Nick Clifton <nickc@redhat.com>
3178 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3180 (image_set_ptr): Likewise.
3181 (alpha_vms_fix_sec_rel): Likewise.
3182 (alpha_vms_slurp_relocs): Likewise.
3184 2017-06-21 Nick Clifton <nickc@redhat.com>
3187 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3189 (ieee_archive_p): Likewise.
3190 (ieee_object_p): Likewise.
3192 2017-06-21 Nick Clifton <nickc@redhat.com>
3195 * elf.c (setup_group): Zero the group section pointer list after
3196 allocation so that loops can be caught. Check for NULL pointers
3197 when processing a group list.
3199 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3201 * elf-s390.h: New file.
3202 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3204 (elf_s390_additional_program_headers): New function.
3205 (elf_s390_modify_segment_map): New function.
3206 (bfd_elf_s390_set_options): New function.
3207 (elf_backend_additional_program_headers)
3208 (elf_backend_modify_segment_map): Add macro definitions.
3210 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3213 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3214 the DYNAMIC bit instead of bfd_count_sections.
3216 2017-06-19 Nick Clifton <nickc@redhat.com>
3219 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3221 (evax_bfd_print_eeom): Likewise.
3222 (evax_bfd_print_egsd): Check for an overlarge record length.
3223 (evax_bfd_print_etir): Likewise.
3225 2017-06-19 Nick Clifton <nickc@redhat.com>
3228 * libieee.h (struct common_header_type): Add end_p field.
3229 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3231 (read_id): Check for a length that exceeds the remaining bytes in
3233 (ieee_seek): Initialise end_p.
3234 (ieee_archive_p): Likewise.
3235 (ieee_object_p): Likewise.
3237 2017-06-19 Nick Clifton <nickc@redhat.com>
3240 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3241 before reading the EIHS structure entries.
3243 2017-06-19 Nick Clifton <nickc@redhat.com>
3246 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3247 gsd_size. Check that there are enough bytes remaining to read the
3248 type and size of the next egsd. Check that the size of the egsd
3249 does not exceed the size of the record.
3251 2017-06-19 Alan Modra <amodra@gmail.com>
3253 * config.bfd: Correct targ_underscore for cris.
3255 2017-06-18 Alan Modra <amodra@gmail.com>
3257 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3258 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3260 2017-06-16 Nick Clifton <nickc@redhat.com>
3262 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3263 bucketlist is empty because there are no symbols to add to the
3266 2017-06-16 Alan Modra <amodra@gmail.com>
3272 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3273 (BFD_JUMP_TABLE_LINK): Likewise.
3274 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3275 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3276 (bfd_elf_define_start_stop): New function.
3277 * linker.c (bfd_generic_define_start_stop): New function.
3278 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3280 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3281 * aout-target.h (MY_bfd_define_start_stop): Define.
3282 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3283 * binary.c (binary_bfd_define_start_stop): Define.
3284 * bout.c (b_out_bfd_define_start_stop): Define.
3285 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3286 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3287 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3288 * coffcode.h (coff_bfd_define_start_stop): Define.
3289 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3290 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3291 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3292 * ieee.c (ieee_bfd_define_start_stop): Define.
3293 * ihex.c (ihex_bfd_define_start_stop): Define.
3294 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3295 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3296 * mmo.c (mmo_bfd_define_start_stop): Define.
3297 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3298 * oasys.c (oasys_bfd_define_start_stop): Define.
3299 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3300 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3301 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3302 * som.c (som_bfd_define_start_stop): Define.
3303 * srec.c (srec_bfd_define_start_stop): Define.
3304 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3305 * versados.c (versados_bfd_define_start_stop): Define.
3306 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3307 (alpha_vms_bfd_define_start_stop): Define.
3308 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3309 * bfd-in2.h: Regenerate.
3310 * libbfd.h: Regenerate.
3312 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3314 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3315 SYMBOL_REFERENCES_LOCAL.
3317 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3320 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3321 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3322 runtime for if there needs copy relocation elimination.
3323 (need_copy_relocation_p): New function. Return true for symbol with
3324 pc-relative references and if it's against read-only sections.
3325 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3326 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3327 that are related with accessing external objects.
3328 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3329 in elfNN_aarch64_check_relocs.
3331 2017-06-15 Nick Clifton <nickc@redhat.com>
3334 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3337 (ieee_archive_p): Likewise.
3339 2017-06-15 Nick Clifton <nickc@redhat.com>
3342 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3344 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3346 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3347 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3348 keep both windowed and call0 ABI PLT definitions.
3349 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3350 elf_xtensa_*_plt_entry endex.
3351 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3353 2017-06-14 Nick Clifton <nickc@redhat.com>
3356 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3359 2017-06-14 Nick Clifton <nickc@redhat.com>
3362 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3363 maximum value for the ascic pointer. Check that name processing
3364 does not read beyond this value.
3365 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3368 2017-06-14 Nick Clifton <nickc@redhat.com>
3371 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3372 (process_otr): Check for an invalid offset in the otr structure.
3374 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3376 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3378 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3384 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3385 vtable field to a union.
3386 (_bfd_elf_is_start_stop): Removed.
3387 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3388 __start_SECNAME and __stop_SECNAME symbols.
3389 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3390 * elflink.c (_bfd_elf_is_start_stop): Removed.
3391 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3392 _bfd_elf_is_start_stop.
3393 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3394 __stop_SECNAME symbols. Updated.
3395 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3396 (bfd_elf_gc_record_vtinherit): Likewise.
3397 (bfd_elf_gc_record_vtentry): Likewise.
3399 2017-06-13 Nick Clifton <nickc@redhat.com>
3402 * elflink.c (elf_link_adjust_relocs): Generate an error when
3403 encountering a reloc against a symbol removed by garbage
3406 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3408 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3409 to merge_gnu_properties.
3410 * elf-properties.c (elf_merge_gnu_properties): Add struct
3411 bfd_link_info * and pass it to merge_gnu_properties.
3412 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3413 and pass it to elf_merge_gnu_properties.
3414 (_bfd_elf_link_setup_gnu_properties): Pass info to
3415 elf_merge_gnu_property_list.
3416 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3418 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3420 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3423 * binary.c (binary_set_section_contents): Scale lma by octets
3424 per byte to set filepos.
3426 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3428 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3431 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3433 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3436 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3438 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3439 patched section contents for TLS IE reloc.
3440 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3442 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3444 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3445 RELOC_FOR_GLOBAL_SYMBOL macro.
3447 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3449 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3452 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3454 * config/tc-arc.c (md_undefined_symbol): Changed.
3455 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3457 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3459 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3462 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3464 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3465 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3467 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3469 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3472 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3474 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3475 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3476 is non-zero. Add clarifying comments.
3478 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3480 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3481 name. Use local IFUNC symbol name string to report unsupported
3482 non-PIC call to IFUNC function.
3483 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3484 when generating R_386_IRELATIVE relocation.
3485 (elf_i386_finish_dynamic_symbol): Likewise.
3486 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3488 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3489 when generating R_X86_64_IRELATIVE relocation.
3490 (elf_x86_64_finish_dynamic_symbol): Likewise.
3492 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3494 * elf.c (setup_group): Make sure BFD sections are created for all
3495 group sections in the input file when processing SHF_GROUP
3497 (bfd_section_from_shdr): Avoid duplicating logic already
3498 implemented in `setup_group'.
3500 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3503 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3504 if the hint address is zero.
3506 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3509 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3510 ELF_COMMON_DEF_P for common symbols.
3512 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3514 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3515 SEC_GROUP sections as SEC_EXCLUDE.
3516 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3517 (assign_section_numbers): Use resolve_section_groups flag instead
3518 of relocatable link type.
3519 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3520 flag instead of checking the final_link flag for part of the
3521 checks in here. Fix white space as a result.
3522 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3523 instead of relocatable link type.
3524 (bfd_elf_final_link): Likewise.
3526 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3528 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3530 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3531 (s3_bfd_score_elf_check_relocs): Likewise.
3532 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3533 (score_elf_final_link_relocate): Likewise.
3534 (s7_bfd_score_elf_check_relocs): Likewise.
3536 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3538 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3541 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3543 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3544 from `reloc_count' rather than decrementing it.
3545 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3546 `reloc_count' by `int_rels_per_ext_rel'.
3547 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3548 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3549 entry determination.
3550 (s3_bfd_score_elf_check_relocs): Likewise.
3551 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3552 (s7_bfd_score_elf_relocate_section): Likewise.
3553 (s7_bfd_score_elf_check_relocs): Likewise.
3554 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3555 prototype and function.
3556 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3557 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3558 triple rather than once the sum of REL and RELA relocation entry
3560 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3561 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3562 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3563 storage allocation size determination.
3564 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3565 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3566 by `int_rels_per_ext_rel' for last relocation entry
3568 (bfd_elf_final_link): Do not multiply `reloc_count' by
3569 `int_rels_per_ext_rel' for internal relocation storage
3570 allocation size determination.
3571 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3572 `int_rels_per_ext_rel' for last relocation entry determination.
3573 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3574 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3575 (_bfd_mips_elf_relocate_section): Likewise.
3577 2017-06-05 Alan Modra <amodra@gmail.com>
3580 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3582 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3584 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3585 determine structure sizes.
3586 (elfcore_grok_freebsd_prstatus): Likewise.
3588 2017-06-01 Alan Modra <amodra@gmail.com>
3590 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3591 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3593 (is_elfv2_localentry0): New function.
3594 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3595 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3596 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3597 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3598 optimized localentry:0 stubs.
3599 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3600 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3602 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3604 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3606 2017-05-30 Casey Smith <clegg89@gmail.com>
3609 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3610 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3612 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3614 * cpu-arc.c (arc_compatible): New function.
3616 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3618 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3620 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3623 * bfdio.c (bfd_get_file_size): New function.
3624 * bfd-in2.h: Regenerated.
3626 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3628 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3631 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3633 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3634 dynobj instead of htab->elf.dynobj.
3636 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3638 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3640 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3641 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3642 actual number of internal relocations retrieved. Adjust
3643 function description.
3644 (bfd_elf64_canonicalize_reloc): Remove macro.
3645 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3647 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3649 * archures.c (bfd_mach_sparc_v9m8): Define.
3650 (bfd_mach_sparc_v8plusm8): Likewise.
3651 (bfd_mach_sparc_v9_p): Adjust to M8.
3652 (bfd_mach_sparc_64bit_p): Likewise.
3653 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3654 bfd_mach_sparc_v8plusm8.
3655 * bfd-in2.h: Regenerated.
3656 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3658 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3659 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3660 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3662 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3663 bfd_mach_sparc_v8plusm8.
3665 2017-05-19 Alan Modra <amodra@gmail.com>
3667 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3668 debug and special sections when no non-note alloc sections in an
3671 2017-05-18 Alan Modra <amodra@gmail.com>
3673 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3674 * elf-m10300.c: Likewise.
3676 * elf32-arc.c: Likewise.
3677 * elf32-bfin.c: Likewise.
3678 * elf32-m68k.c: Likewise.
3679 * elf32-nds32.c: Likewise.
3680 * elf32-tilepro.c: Likewise.
3681 * elflink.c: Likewise.
3682 * elfnn-aarch64.c: Likewise.
3683 * elfnn-riscv.c: Likewise.
3684 * elfxx-tilegx.c: Likewise.
3685 * mach-o.c: Likewise.
3686 * peXXigen.c: Likewise.
3687 * vms-alpha.c: Likewise.
3688 * vms-lib.c: Likewise.
3690 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3693 * elflink.c (elf_gc_mark_debug_section): New function.
3694 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3695 referenced by kept debug sections.
3697 2017-05-16 Alan Modra <amodra@gmail.com>
3699 * elf-m10300.c: Rename occurrences of non_ir_ref.
3700 * elf32-arm.c: Likewise.
3701 * elf32-bfin.c: Likewise.
3702 * elf32-cr16.c: Likewise.
3703 * elf32-cris.c: Likewise.
3704 * elf32-d10v.c: Likewise.
3705 * elf32-dlx.c: Likewise.
3706 * elf32-fr30.c: Likewise.
3707 * elf32-frv.c: Likewise.
3708 * elf32-hppa.c: Likewise.
3709 * elf32-i370.c: Likewise.
3710 * elf32-i386.c: Likewise.
3711 * elf32-iq2000.c: Likewise.
3712 * elf32-lm32.c: Likewise.
3713 * elf32-m32c.c: Likewise.
3714 * elf32-m32r.c: Likewise.
3715 * elf32-m68hc1x.c: Likewise.
3716 * elf32-m68k.c: Likewise.
3717 * elf32-mcore.c: Likewise.
3718 * elf32-metag.c: Likewise.
3719 * elf32-microblaze.c: Likewise.
3720 * elf32-moxie.c: Likewise.
3721 * elf32-msp430.c: Likewise.
3722 * elf32-mt.c: Likewise.
3723 * elf32-nios2.c: Likewise.
3724 * elf32-or1k.c: Likewise.
3725 * elf32-ppc.c: Likewise.
3726 * elf32-rl78.c: Likewise.
3727 * elf32-s390.c: Likewise.
3728 * elf32-score.c: Likewise.
3729 * elf32-score7.c: Likewise.
3730 * elf32-sh.c: Likewise.
3731 * elf32-tic6x.c: Likewise.
3732 * elf32-tilepro.c: Likewise.
3733 * elf32-v850.c: Likewise.
3734 * elf32-vax.c: Likewise.
3735 * elf32-xstormy16.c: Likewise.
3736 * elf32-xtensa.c: Likewise.
3737 * elf64-alpha.c: Likewise.
3738 * elf64-hppa.c: Likewise.
3739 * elf64-ia64-vms.c: Likewise.
3740 * elf64-mmix.c: Likewise.
3741 * elf64-ppc.c: Likewise.
3742 * elf64-s390.c: Likewise.
3743 * elf64-sh64.c: Likewise.
3744 * elf64-x86-64.c: Likewise.
3745 * elflink.c: Likewise.
3746 * elfnn-aarch64.c: Likewise.
3747 * elfnn-ia64.c: Likewise.
3748 * elfnn-riscv.c: Likewise.
3749 * elfxx-mips.c: Likewise.
3750 * elfxx-sparc.c: Likewise.
3751 * elfxx-tilegx.c: Likewise.
3752 * linker.c: Likewise.
3754 2017-05-16 Alan Modra <amodra@gmail.com>
3756 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3757 * elflink.c (elf_link_add_object_symbols): Update to use
3759 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3761 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3763 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3765 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3767 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3769 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3770 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3772 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3774 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3776 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3778 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3779 to plt_second/plt_second_eh_frame.
3780 (elf_x86_64_link_hash_newfunc): Updated.
3781 (elf_x86_64_allocate_dynrelocs): Likewise.
3782 (elf_x86_64_size_dynamic_sections): Likewise.
3783 (elf_x86_64_relocate_section): Likewise.
3784 (elf_x86_64_finish_dynamic_symbol): Likewise.
3785 (elf_x86_64_finish_dynamic_sections): Likewise.
3786 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3787 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3789 (elf_backend_setup_gnu_properties): Updated. Create the
3790 .plt.sec section instead of the .plt.sec section.
3792 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3794 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3795 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3796 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3798 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3800 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3801 (bfd_elf64_set_reloc): Define.
3802 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3804 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3806 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3807 (struct bfd_target): New field _bfd_set_reloc.
3808 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3809 * reloc.c (_bfd_generic_set_reloc): New function.
3810 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3811 * nlm-target.h (nlm_set_reloc): Likewise.
3812 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3813 * aout-tic30.c (MY_set_reloc): Likewise.
3814 * aout-target.h (MY_set_reloc): Likewise.
3815 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3816 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3817 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3818 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3819 * aout-adobe.c (aout_32_set_reloc): Likewise.
3820 * bout.c (b_out_set_reloc): Likewise.
3821 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3822 * i386os9k.c (aout_32_set_reloc): Likewise.
3823 * ieee.c (ieee_set_reloc): Likewise.
3824 * oasys.c (oasys_set_reloc): Likewise.
3825 * som.c (som_set_reloc): Likewise.
3826 * versados.c (versados_set_reloc): Likewise.
3827 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3828 _bfd_generic_set_reloc.
3829 (rs6000_xcoff64_aix_vec): LIkewise.
3830 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3831 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3832 * i386msdos.c (msdos_set_reloc): Define to
3833 _bfd_norelocs_set_reloc.
3834 * elfcode.h (elf_set_reloc): Define.
3835 * bfd-in2.h: Regenerated.
3837 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3840 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3841 for IFUNC function address.
3843 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3845 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3846 (CONFLICT_LIST): Likewise.
3847 (opcode/arc-attrs.h): Include.
3848 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3849 (arc_extract_features): New file.
3850 (arc_stralloc): Likewise.
3851 (arc_elf_merge_attributes): Likewise.
3852 (arc_elf_merge_private_bfd_data): Use object attributes.
3853 (bfd_arc_get_mach_from_attributes): New function.
3854 (arc_elf_object_p): Use object attributes.
3855 (arc_elf_final_write_processing): Likewise.
3856 (elf32_arc_obj_attrs_arg_type): New function.
3857 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3858 (elf32_arc_section_from_shdr): Likewise.
3859 (elf_backend_obj_attrs_vendor): Define.
3860 (elf_backend_obj_attrs_section): Likewise.
3861 (elf_backend_obj_attrs_arg_type): Likewise.
3862 (elf_backend_obj_attrs_section_type): Likewise.
3863 (elf_backend_obj_attrs_handle_unknown): Likewise.
3864 (elf_backend_section_from_shdr): Likewise.
3866 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3869 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3870 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3871 and the destination is a Thumb symbol.
3873 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3875 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3876 initializer to silence GCC 4.2.
3877 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3879 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3881 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3882 (LAZY_PLT_ENTRY_SIZE): This.
3883 (NON_LAZY_PLT_ENTRY_SIZE): New.
3884 (elf_x86_64_plt0_entry): Renamed to ...
3885 (elf_x86_64_lazy_plt0_entry): This.
3886 (elf_x86_64_plt_entry): Renamed to ...
3887 (elf_x86_64_lazy_plt_entry): This.
3888 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3889 (elf_x86_64_lazy_bnd_plt0_entry): This.
3890 (elf_x86_64_legacy_plt_entry): Removed.
3891 (elf_x86_64_bnd_plt_entry): Renamed to ...
3892 (elf_x86_64_lazy_bnd_plt_entry): This.
3893 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3894 (elf_x86_64_non_lazy_plt_entry): This.
3895 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3896 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3897 (elf_x86_64_eh_frame_plt): Renamed to ...
3898 (elf_x86_64_eh_frame_lazy_plt): This.
3899 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3900 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3901 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3902 (elf_x86_64_eh_frame_non_lazy_plt): This.
3903 (elf_x86_64_lazy_plt_layout): New.
3904 (elf_x86_64_non_lazy_plt_layout): Likewise.
3905 (elf_x86_64_plt_layout): Likewise.
3906 (elf_x86_64_backend_data): Remove PLT layout information. Add
3907 os for target system.
3908 (GET_PLT_ENTRY_SIZE): Removed.
3909 (elf_x86_64_lazy_plt): New.
3910 (elf_x86_64_non_lazy_plt): Likewise.
3911 (elf_x86_64_lazy_bnd_plt): Likewise.
3912 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3913 (elf_x86-64_arch_bed): Updated.
3914 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3915 (elf_x86_64_create_dynamic_sections): Removed.
3916 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3917 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3918 (elf_x86-64_adjust_dynamic_symbol): Updated.
3919 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3920 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3921 size for PLT0 if there is no PLT0. Get plt_entry_size from
3922 non_lazy_plt for non-lazy PLT entries.
3923 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3924 from non_lazy_plt for non-lazy PLT entries.
3925 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3926 if there is no PLT0.
3927 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3928 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3929 entries with non-lazy PLT layout. Don't fill the second and third
3930 slots in the PLT entry if there is no PLT0.
3931 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3932 if there is no PLT0. Set sh_entsize on the .plt.got section.
3933 (compare_relocs): New.
3934 (elf_x86_64_plt_type): Likewise.
3935 (elf_x86_64_plt): Likewise.
3936 (elf_x86_64_nacl_plt): New. Forward declaration.
3937 (elf_x86_64_get_plt_sym_val): Removed.
3938 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3939 against all dynamic relocations.
3940 (elf_x86_64_link_setup_gnu_properties): New function.
3941 (elf_backend_create_dynamic_sections): Updated.
3942 (elf_backend_setup_gnu_properties): New.
3943 (elf_x86_64_nacl_plt): New.
3944 (elf_x86_64_nacl_arch_bed): Updated.
3946 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3948 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3949 (LAZY_PLT_ENTRY_SIZE): This.
3950 (NON_LAZY_PLT_ENTRY_SIZE): New.
3951 (elf_i386_plt0_entry): Renamed to ...
3952 (elf_i386_lazy_plt0_entry): This.
3953 (elf_i386_plt_entry): Renamed to ...
3954 (elf_i386_lazy_plt_entry): This.
3955 (elf_i386_pic_plt0_entry): Renamed to ...
3956 (elf_i386_pic_lazy_plt0_entry): This.
3957 (elf_i386_pic_plt_entry): Renamed to ...
3958 (elf_i386_pic_lazy_plt_entry): This.
3959 (elf_i386_got_plt_entry): Renamed to ...
3960 (elf_i386_non_lazy_plt_entry): This.
3961 (elf_i386_pic_got_plt_entry): Renamed to ...
3962 (elf_i386_pic_non_lazy_plt_entry): This.
3963 (elf_i386_eh_frame_plt): Renamed to ...
3964 (elf_i386_eh_frame_lazy_plt): This.
3965 (elf_i386_eh_frame_plt_got): Renamed to ...
3966 (elf_i386_eh_frame_non_lazy_plt): This.
3967 (elf_i386_plt_layout): Renamed to ...
3968 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3969 eh_frame_plt_got_size.
3970 (elf_i386_non_lazy_plt_layout): New.
3971 (elf_i386_plt_layout): Likewise.
3972 (elf_i386_non_lazy_plt): Likewise.
3973 (GET_PLT_ENTRY_SIZE): Removed.
3974 (elf_i386_plt): Renamed to ...
3975 (elf_i386_lazy_plt): This.
3976 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3977 (elf_i386_arch_bed): Updated.
3978 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3979 (elf_i386_create_dynamic_sections): Removed.
3980 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3981 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3982 (elf_i386_adjust_dynamic_symbol): Updated.
3983 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3984 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3985 size for PLT0 if there is no PLT0.
3986 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3987 output section is discarded only if GOT isn't empty.
3988 (elf_i386_relocate_section): Updated. Properly get PLT index
3989 if there is no PLT0.
3990 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3991 second and third slots in the PLT entry if there is no PLT0.
3992 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3993 if there is no PLT0. Set sh_entsize on the .plt.got section.
3994 (elf_i386_nacl_plt): Forward declaration.
3995 (elf_i386_get_plt_sym_val): Removed.
3996 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3997 against all dynamic relocations.
3998 (elf_i386_link_setup_gnu_properties): New function.
3999 (elf_backend_create_dynamic_sections): Updated.
4000 (elf_backend_setup_gnu_properties): New.
4001 (elf_i386_nacl_plt): Updated.
4002 (elf_i386_nacl_arch_bed): Likewise.
4003 (elf_i386_vxworks_arch_bed): Likewise.
4005 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4007 * elflink.c (elf_output_implib): Remove executable flag from import
4009 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4010 library is a relocatable object file.
4012 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
4015 * elf32-avr.c (avr_should_move_sym): New function.
4016 (avr_should_reduce_sym_size): Likewise.
4017 (avr_should_increase_sym_size): Likewise.
4018 (elf32_avr_relax_delete_bytes): Adjust symbol values
4019 and sizes by calling new functions.
4021 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4023 * config.bfd (riscv32-*): Enable rv64.
4025 2017-05-02 Alan Modra <amodra@gmail.com>
4028 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
4029 rather than h->root.type == bfd_link_hash_new.
4030 (bfd_elf_record_link_assignment): Similarly, call
4031 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
4033 2017-04-29 Alan Modra <amodra@gmail.com>
4036 * reloc.c (reloc_offset_in_range): New function.
4037 (bfd_perform_relocation, bfd_install_relocation): Use it.
4038 (_bfd_final_link_relocate): Likewise.
4040 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4042 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4043 before using .plt.got.
4044 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4046 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4048 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4049 instead of "+=" to update 0.
4051 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4053 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4054 .plt.got section here.
4055 (elf_i386_check_relocs): Don't create the .plt.got section.
4056 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4057 the .plt.got and .plt.bnd sections here.
4058 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4061 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4063 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4065 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4066 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4067 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4068 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4071 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4073 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4075 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4076 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4077 the first relocatable ELF input with GNU properties.
4079 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4081 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4082 VxWorks for non-PIC.
4084 2017-04-27 Alan Modra <amodra@gmail.com>
4086 * elf-bfd.h (struct elf_backend_data): Make asection param of
4087 elf_backend_eh_frame_address_size const.
4088 (_bfd_elf_eh_frame_address_size): Likewise.
4089 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4090 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4091 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4092 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4093 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4094 (next_cie_fde_offset): Constify params.
4095 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4097 2017-04-27 Alan Modra <amodra@gmail.com>
4099 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4100 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4101 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4103 (offset_adjust): New function.
4104 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4105 (adjust_eh_frame_local_symbols): Likewise.
4106 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4107 after changing anything. Return true if anything changed.
4108 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4109 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4111 2017-04-27 Alan Modra <amodra@gmail.com>
4113 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4116 2017-04-27 Alan Modra <amodra@gmail.com>
4118 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4119 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4120 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4121 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4122 for undef and undefweak dyn_relocs.
4123 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4124 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4125 (allocate_got, allocate_dynrelocs): Likewise.
4126 (ppc64_elf_relocate_section): Likewise.
4128 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4130 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4131 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4132 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4133 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4135 2017-04-26 Nick Clifton <nickc@redhat.com>
4138 * reloc.c (bfd_perform_relocation): Check for a negative address
4141 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4144 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4146 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4147 (elf_backend_always_renumber_dynsyms): Define.
4148 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4149 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4150 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4151 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4153 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4155 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4157 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4158 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4159 sections have been created.
4161 2017-04-26 Nick Clifton <nickc@redhat.com>
4164 * compress.c (bfd_init_section_compress_status): Check the return
4165 value from bfd_malloc.
4167 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4169 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4170 no_finish_dynamic_symbol.
4171 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4173 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4174 weak symbol, don't make it dynamic.
4175 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4176 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4177 relocation for GOT reference.
4178 (elf_x86_64_finish_dynamic_symbol): Abort if
4179 no_finish_dynamic_symbol isn't 0.
4181 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4184 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4185 undefined weak symbol, don't make it dynamic.
4186 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4187 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4188 relocation for R_386_GOT32.
4190 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4193 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4195 2017-04-23 Alan Modra <amodra@gmail.com>
4198 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4199 * elf.c (lcomm_sym): New.
4200 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4201 * bfd-in2.h: Regenerate.
4203 2017-04-23 Alan Modra <amodra@gmail.com>
4206 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4207 parameters and comment.
4208 (_bfd_elf_get_reloc_section): Delete.
4209 (_bfd_elf_plt_get_reloc_section): Declare.
4210 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4211 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4213 (_bfd_elf_get_reloc_section): ..here. Delete.
4214 (assign_section_numbers): Call elf_get_reloc_section.
4215 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4216 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4218 2017-04-23 Alan Modra <amodra@gmail.com>
4221 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4224 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4227 * elf32-i386.c (elf_i386_link_hash_entry): Add
4228 no_finish_dynamic_symbol.
4229 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4230 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4231 symbol, don't make it dynamic in PIE.
4232 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4233 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4234 relocation for R_386_GOT32
4235 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4238 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4242 * elflink.c (elf_link_add_object_symbols): Require
4243 --no-dynamic-linker with -E/--dynamic-list when creating
4246 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4248 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4251 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4253 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4254 dynamic symbol sorting.
4256 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4259 * elflink.c (elf_link_add_object_symbols): Preserve
4260 dynamic_ref_after_ir_def when restoring the symbol table for
4261 unneeded dynamic object.
4263 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4266 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4267 on on undefined IFUNC symbol in the second PLT.
4269 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4271 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4273 2017-04-19 Alan Modra <amodra@gmail.com>
4275 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4276 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4277 * elf32-ppc.c:Formatting.
4278 (ensure_undefweak_dynamic): Don't make dynamic when
4279 info->dynamic_undefined_weak is zero.
4280 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4281 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4282 not default visibility. Discard undef and undefweak
4284 (ppc_elf_relocate_section): Adjust to suit.
4285 * elf64-ppc.c: Formatting.
4286 (ensure_undefweak_dynamic): Don't make dynamic when
4287 info->dynamic_undefined_weak is zero.
4288 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4289 info->dynamic_undefined_weak. Discard them earlier.
4291 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4294 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4295 before generating the version definition section.
4297 2017-04-17 Alan Modra <amodra@gmail.com>
4299 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4300 state when a regular object file defines a symbol with
4301 incompatible type to that defined by an earlier shared lib.
4303 2017-04-13 Alan Modra <amodra@gmail.com>
4305 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4307 * elf32-arm.c: Likewise.
4308 * elf32-i386.c: Likewise.
4309 * elf32-mep.c: Likewise.
4310 * elf64-ia64-vms.c: Likewise.
4311 * elf64-x86-64.c: Likewise.
4312 * elflink.c: Likewise.
4313 * elfnn-ia64.c: Likewise.
4314 * elfxx-mips.c: Likewise.
4316 2017-04-13 Alan Modra <amodra@gmail.com>
4318 * aoutx.h: Use %B and %A in error messages throughout file.
4319 * aout-cris.c: Likewise.
4320 * archive.c: Likewise.
4321 * binary.c: Likewise.
4322 * coff-rs6000.c: Likewise.
4323 * coff-tic4x.c: Likewise.
4324 * coffcode.h: Likewise.
4325 * coffgen.c: Likewise.
4326 * cofflink.c: Likewise.
4327 * coffswap.h: Likewise.
4328 * cpu-arm.c: Likewise.
4329 * elf-eh-frame.c: Likewise.
4330 * elf-m10300.c: Likewise.
4332 * elf32-arc.c: Likewise.
4333 * elf32-arm.c: Likewise.
4334 * elf32-bfin.c: Likewise.
4335 * elf32-frv.c: Likewise.
4336 * elf32-iq2000.c: Likewise.
4337 * elf32-m32c.c: Likewise.
4338 * elf32-microblaze.c: Likewise.
4339 * elf32-nds32.c: Likewise.
4340 * elf32-rl78.c: Likewise.
4341 * elf32-rx.c: Likewise.
4342 * elf32-score.c: Likewise.
4343 * elf32-score7.c: Likewise.
4344 * elf32-sh64.c: Likewise.
4345 * elf32-v850.c: Likewise.
4346 * elf32-vax.c: Likewise.
4347 * elf32-visium.c: Likewise.
4348 * elf64-ia64-vms.c: Likewise.
4349 * elf64-mmix.c: Likewise.
4350 * elf64-sh64.c: Likewise.
4351 * elfcode.h: Likewise.
4352 * elfnn-aarch64.c: Likewise.
4353 * elfnn-ia64.c: Likewise.
4354 * elfxx-mips.c: Likewise.
4355 * hpux-core.c: Likewise.
4358 * linker.c: Likewise.
4359 * merge.c: Likewise.
4361 * oasys.c: Likewise.
4362 * pdp11.c: Likewise.
4363 * peXXigen.c: Likewise.
4364 * rs6000-core.c: Likewise.
4365 * vms-alpha.c: Likewise.
4366 * xcofflink.c: Likewise.
4368 2017-04-13 Alan Modra <amodra@gmail.com>
4370 * bfd.c (PRINT_TYPE): Define.
4371 (_doprnt): New function.
4372 (error_handler_internal): Use _doprnt.
4373 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4374 calls in their natural order, throughout file.
4375 * coff-mcore.c: Likewise.
4376 * coff-ppc.c: Likewise.
4377 * coff-tic80.c: Likewise.
4378 * cofflink.c: Likewise.
4379 * elf-s390-common.c: Likewise.
4381 * elf32-arm.c: Likewise.
4382 * elf32-i386.c: Likewise.
4383 * elf32-m32r.c: Likewise.
4384 * elf32-msp430.c: Likewise.
4385 * elf32-spu.c: Likewise.
4386 * elf64-ia64-vms.c: Likewise.
4387 * elf64-sparc.c: Likewise.
4388 * elf64-x86-64.c: Likewise.
4389 * elflink.c: Likewise.
4390 * elfnn-aarch64.c: Likewise.
4391 * elfnn-ia64.c: Likewise.
4392 * elfxx-mips.c: Likewise.
4394 2017-04-13 Alan Modra <amodra@gmail.com>
4396 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4397 branch veneers" error. Fix double space and format message.
4398 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4399 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4401 2017-04-13 Alan Modra <amodra@gmail.com>
4403 * bfd-in2.h: Regenerate.
4405 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4407 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4408 extra `\n' in warning/error messages.
4409 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4410 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4412 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4414 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4415 processor-specific properties with generic ELF target vector.
4417 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4419 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4420 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4421 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4422 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4424 (link_hash_newfunc): Initialize has_got_reloc and
4426 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4428 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4430 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4432 (_bfd_sparc_elf_fixup_symbol): New function.
4433 (allocate_dynrelocs): Don't allocate space for dynamic
4434 relocations and discard relocations against resolved undefined
4435 weak symbols in executable. Don't make resolved undefined weak
4436 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4437 relocation against undefined weak symbols in PIE.
4438 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4439 relocations against resolved undefined weak symbols in PIE
4440 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4441 without ynamic PLT/GOT relocations for resolved undefined weak
4443 Don't generate dynamic relocation against resolved undefined
4444 weak symbol in executable.
4445 (pie_finish_undefweak_symbol): New function.
4446 (_bfd_sparc_elf_finish_dynamic_sections): Call
4447 pie_finish_undefweak_symbol on all symbols in PIE.
4448 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4449 (_bfd_sparc_elf_fixup_symbol): New function.
4451 2017-04-10 Nick Clifton <nickc@redhat.com>
4453 * config.bfd: Remove ns32k from obsolete list.
4455 2017-04-10 Alan Modra <amodra@gmail.com>
4458 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4459 (special_sections_i): Likewise for .init_array.
4460 (special_sections_p): Likewise for .preinit_array.
4462 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4466 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4467 ELF_COMMON_DEF_P for common symbols.
4468 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4469 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4470 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4471 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4472 07492f668d2173da7a2bda3707ff0985e0f460b6.
4474 2017-04-07 Pedro Alves <palves@redhat.com>
4476 * opncls.c (bfd_get_debug_link_info): Rename to...
4477 (bfd_get_debug_link_info_1): ... this. Change type of second
4478 parameter to void pointer. Adjust.
4479 (bfd_get_debug_link_info): Reimplement on top of
4480 bfd_get_debug_link_info_1.
4481 (separate_debug_file_exists, separate_alt_debug_file_exists):
4482 Change type of second parameter to void pointer. Adjust.
4483 (get_func_type, check_func_type): Change type of second parameter
4485 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4486 the callback functions instead of passing the address of a local.
4487 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4488 find_separate_debug_file.
4489 (get_alt_debug_link_info_shim): Change type of second parameter to
4490 void pointer. Adjust.
4491 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4492 find_separate_debug_file.
4493 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4494 of second parameter to void pointer. Adjust.
4495 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4496 pointer local to find_separate_debug_file.
4498 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4500 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4501 external symbols with a definition.
4502 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4504 2017-04-07 Alan Modra <amodra@gmail.com>
4506 * po/SRC-POTFILES.in: Regenerate.
4508 2017-04-05 Alan Modra <amodra@gmail.com>
4510 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4513 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4515 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4516 numbers for DataDirectory entry indicies passed to
4519 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4521 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4522 each GNU_MBIND section and align GNU_MBIND section to page size.
4523 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4524 segment for each GNU_MBIND section.
4525 (_bfd_elf_init_private_section_data): Copy sh_info from input
4526 for GNU_MBIND section.
4528 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4530 * elfnn-riscv.c (GP_NAME): Delete.
4531 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4532 (_bfd_riscv_relax_lui): Likewise.
4534 2017-04-04 Nick Clifton <nickc@redhat.com>
4537 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4539 (bfd_elf_final_link): Only initialize the extended symbol index
4540 section if there are extended symbol tables to list.
4542 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4544 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4545 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4546 * configure.ac (elf): Add elf-properties.lo.
4547 * Makefile.in: Regenerated.
4548 * configure: Likewise.
4549 * elf-bfd.h (elf_property_kind): New.
4550 (elf_property): Likewise.
4551 (elf_property_list): Likewise.
4552 (elf_properties): Likewise.
4553 (_bfd_elf_parse_gnu_properties): Likewise.
4554 (_bfd_elf_get_property): Likewise.
4555 (_bfd_elf_link_setup_gnu_properties): Likewise.
4556 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4557 and setup_gnu_properties.
4558 (elf_obj_tdata): Add properties.
4559 * elf-properties.c: New file.
4560 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4561 (elf_i386_merge_gnu_properties): Likewise.
4562 (elf_backend_parse_gnu_properties): Likewise.
4563 (elf_backend_merge_gnu_properties): Likewise.
4564 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4565 (elf_x86_64_merge_gnu_properties): Likewise.
4566 (elf_backend_parse_gnu_properties): Likewise.
4567 (elf_backend_merge_gnu_properties): Likewise.
4568 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4569 (elf_backend_parse_gnu_properties): Likewise.
4570 (elf_backend_setup_gnu_properties): Likewise.
4571 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4572 elf_backend_merge_gnu_properties and
4573 elf_backend_setup_gnu_properties.
4575 2017-03-30 Pip Cet <pipcet@gmail.com>
4577 * elf32-wasm32.c: Add relocation code, two relocs.
4578 * reloc.c: Add wasm32 relocations.
4579 * libbfd.h: Regenerate.
4580 * bfd-in2.h: Regenerate.
4581 * bfd/po/bfd.pot: Regenerate.
4583 2017-03-29 Nick Clifton <nickc@redhat.com>
4586 * coff-bfd.h (struct coff_section_data): Add new fields:
4587 saved_bias and bias.
4588 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4589 computed for PE binaries.
4590 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4593 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4596 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4597 to handle a local symbol with a hash-symbol-entry; without PLT.
4598 Add BFD_ASSERT for an incidental case with GOT entry present.
4599 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4600 isn't forced-or-set local.
4602 2017-03-27 Pip Cet <pipcet@gmail.com>
4604 * wasm-module.c: New file to support WebAssembly modules.
4605 * wasm-module.h: New file to support WebAssembly modules.
4606 * doc/webassembly.texi: Start documenting wasm-module.c.
4607 * config.bfd: Add wasm_vec.
4608 * targets.c: Likewise.
4609 * configure.ac: Likewise.
4610 * Makefile.am: Add entries for wasm-module.c.
4611 * Makefile.in: Regenerate.
4612 * configure: Regenerate.
4613 * po/SRC-POTFILES.in: Regenerate.
4615 2017-03-27 Pip Cet <pipcet@gmail.com>
4617 * cpu-wasm32.c: New file to support wasm32 architecture.
4618 * elf32-wasm32.c: New file to support wasm32 architecture.
4619 * Makefile.am: Add wasm32 architecture.
4620 * archures.c: Likewise.
4621 * config.bfd: Likewise.
4622 * configure.ac: Likewise.
4623 * targets.c: Likewise.
4624 * Makefile.in: Regenerate.
4625 * bfd-in2.h: Regenerate.
4626 * configure: Regenerate.
4627 * po/SRC-POTFILES.in: Regenerate.
4629 2017-03-20 Alan Modra <amodra@gmail.com>
4632 * elf64-ppc.c (compare_symbols): Stabilize sort.
4634 2017-03-18 Alan Modra <amodra@gmail.com>
4636 * elf64-ppc.c (struct ppc_link_hash_table): Add
4637 local_ifunc_resolver and maybe_local_ifunc_resolver.
4638 (ppc_build_one_stub): Set flags on emitting dynamic
4639 relocation to ifunc.
4640 (ppc64_elf_relocate_section): Likewise.
4641 (ppc64_elf_finish_dynamic_symbol): Likewise.
4642 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4643 local dynamic relocs to ifuncs.
4644 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4645 local_ifunc_resolver and maybe_local_ifunc_resolver.
4646 (ppc_elf_relocate_section): Set flag on emitting dynamic
4647 relocation to ifuncs.
4648 (ppc_elf_finish_dynamic_symbol): Likewise.
4649 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4650 dynamic relocs to ifuncs.
4652 2017-03-13 Nick Clifton <nickc@redhat.com>
4655 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4656 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4657 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4658 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4659 * bfd-in2.h: Regenerate.
4660 * libbfd.h: Regenerate.
4661 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4663 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4664 (elfNN_aarch64_howto_table): Likewise.
4665 (aarch64_tls_transition_without_check): Likewise.
4666 (aarch64_reloc_got_type): Likewise.
4667 (elfNN_aarch64_final_link_relocate): Likewise.
4668 (elfNN_aarch64_tls_relax): Likewise.
4669 (elfNN_aarch64_relocate_section): Likewise.
4670 (elfNN_aarch64_gc_sweep_hook): Likewise.
4671 (elfNN_aarch64_check_relocs): Likewise.
4672 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4673 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4675 2017-03-11 Alan Modra <amodra@gmail.com>
4677 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4678 parameter is in fact used. Whitespace fixes.
4679 * elf64-ppc.c: Likewise.
4681 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4683 * rs6000-core.c (CORE_NEW): Simplify macro when
4684 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4686 2017-03-07 Alan Modra <amodra@gmail.com>
4690 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4693 2017-03-05 Alan Modra <amodra@gmail.com>
4695 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4696 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4697 (next_cie_fde_offset): New function.
4698 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4699 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4700 four bytes. Align CIEs to four or eight bytes depending on
4701 per_encoding_aligned8. Align FDEs according to their encoding.
4702 Pad last FDE to output section alignment.
4703 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4705 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4706 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4707 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4709 2017-03-02 Martin Bickel <binutils@ineranves.de>
4712 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4713 empty segments which have a zero filesz, but a non-zero memsz.
4715 2017-03-02 Alan Modra <amodra@gmail.com>
4717 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4719 2017-02-28 Alan Modra <amodra@gmail.com>
4721 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4722 (ppc64_elf_relocate_section): Likewise.
4724 2017-02-28 Alan Modra <amodra@gmail.com>
4727 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4728 rather than elf32_nios2_hash_table or elf_hash_table.
4729 (create_got_section): Likewise.
4730 (nios2_elf32_finish_dynamic_symbol): Likewise.
4731 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4732 (nios2_elf32_size_dynamic_sections): Likewise.
4733 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4734 vars. Use htab equivalents directly instead. Don't create
4735 all dynamic sections on needing just the GOT. Use a goto
4736 rather than a fall-through with reloc test. Ensure
4737 htab->dynobj is set when making dynamic sreloc section.
4738 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4739 equivalent directly instead. Don't segfault on looking for
4740 .dynamic when dynamic sections have not been created. Don't
4741 segfault on .got.plt being discarded.
4742 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4743 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4744 fixme and another not so relevant comment.
4745 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4746 already set, set hash table dynobj on creating .sbss.
4748 2017-02-28 Alan Modra <amodra@gmail.com>
4750 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4751 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4752 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4753 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4754 (ppc64_elf_relocate_section): Likewise.
4755 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4756 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4757 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4758 * libbfd.h: Regenerate.
4759 * bfd-in2.h: Regenerate.
4761 2017-02-28 Alan Modra <amodra@gmail.com>
4763 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4764 dynamic .data.rel.ro read-only.
4765 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4766 rather than section flags when deciding where copy reloc goes.
4767 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4768 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4769 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4770 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4771 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4772 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4773 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4774 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4775 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4776 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4777 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4778 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4779 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4780 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4781 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4782 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4783 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4784 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4785 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4787 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4789 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4790 `jalr $0, $25' instruction encoding.
4792 2017-02-27 Nick Clifton <nickc@redhat.com>
4795 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4796 generating a seg-fault when encountering a symbol that has been
4797 deleted by garbage collection.
4799 2017-02-25 Alan Modra <amodra@gmail.com>
4801 * elf32-arc.c (struct dynamic_sections): Delete.
4802 (enum dyn_section_types): Delete.
4803 (dyn_section_names): Delete.
4804 (arc_create_dynamic_sections): Delete.
4805 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4806 segfault on discarded .rela.plt section.
4807 (elf_arc_size_dynamic_sections): Formatting. Don't call
4808 arc_create_dynamic_sections. Don't allocate memory for sections
4809 handled by the generic linker. Correct code finding relocs in
4810 read-only sections. Set SEC_EXCLUDE on zero size .got,
4811 .got.plt, and .dynbss sections. Do set .interp for pies.
4813 2017-02-24 Andrew Waterman <andrew@sifive.com>
4815 * elfnn-riscv.c (GP_NAME): New macro.
4816 (riscv_global_pointer_value): Use it.
4817 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4818 output section, consider only that section's alignment.
4820 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4822 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4823 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4824 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4825 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4827 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4829 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4830 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4833 2017-02-23 Alan Modra <amodra@gmail.com>
4836 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4838 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4839 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4842 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4845 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4846 processing ahead of the call to `elf_gc_sweep_symbol'.
4848 2017-02-22 Nick Clifton <nickc@redhat.com>
4851 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4852 created section 4-byte alignment.
4854 2017-02-22 Alan Modra <amodra@gmail.com>
4856 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4857 on .got or .plt output section being discarded by script.
4858 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4861 2017-02-21 Alan Modra <amodra@gmail.com>
4863 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4864 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4866 2017-02-20 Alan Modra <amodra@gmail.com>
4869 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4870 if DT_RELSZ/DT_RELASZ is zero.
4872 2017-02-17 Nick Clifton <nickc@redhat.com>
4874 * compress.c (bfd_get_full_section_contents): Remember to reduce
4875 compressed size by the sizeof the compression header when
4876 decompressing the contents.
4878 2017-02-17 Pedro Alves <palves@redhat.com>
4880 * srec.c (Chunk): Rename to ...
4881 (_bfd_srec_len): ... this.
4882 (S3Forced): Rename to ...
4883 (_bfd_srec_forceS3): ... this.
4884 * objcopy.c: Adjust all references.
4886 2017-02-17 Pedro Alves <palves@redhat.com>
4888 * archive.c (bsd_write_armap): Rename to ...
4889 (_bfd_bsd_write_armap): ... this.
4890 (coff_write_armap): Rename to ...
4891 (_bfd_coff_write_armap): ... this.
4892 * libbfd-in.h (bsd_write_armap): Rename to ...
4893 (_bfd_bsd_write_armap): ... this.
4894 (coff_write_armap): Rename to ...
4895 (_bfd_coff_write_armap): ... this.
4896 * aout-target.h, aout-tic30.c: Adjust all users.
4897 * libbfd.h: Regenerate.
4899 2017-02-17 Pedro Alves <palves@redhat.com>
4901 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4902 (warn_deprecated): Rename to ...
4903 (_bfd_warn_deprecated): ... this.
4904 * libbfd.c (warn_deprecated): Rename to ...
4905 (_bfd_warn_deprecated): ... this.
4906 * bfd-in2.h: Regenerate.
4908 2017-02-17 Pedro Alves <palves@redhat.com>
4910 * bfdio.c (real_ftell): Rename to ...
4911 (_bfd_real_ftell): ... this.
4912 (real_fseek): Rename to ...
4913 (_bfd_real_fseek): ... this.
4914 (real_fopen): Rename to ...
4915 (_bfd_real_fopen): ... this.
4916 * libbfd-in.h (real_ftell): Rename to ...
4917 (_bfd_real_ftell): ... this.
4918 (real_fseek): Rename to ...
4919 (_bfd_real_fseek): ... this.
4920 (real_fopen): Rename to ...
4921 (_bfd_real_fopen): ... this.
4922 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4923 * libbfd.h: Regenerate.
4925 2017-02-17 Pedro Alves <palves@redhat.com>
4927 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4928 * libbfd.c (read_unsigned_leb128): Rename to ...
4929 (_bfd_read_unsigned_leb128): ... this.
4930 (read_signed_leb128): Rename to ...
4931 (_bfd_read_signed_leb128): ... this.
4932 (safe_read_leb128): Rename to ...
4933 (_bfd_safe_read_leb128): ... this.
4934 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4935 (_bfd_read_unsigned_leb128): ... this.
4936 (read_signed_leb128): Rename to ...
4937 (_bfd_read_signed_leb128): ... this.
4938 (safe_read_leb128): Rename to ...
4939 (_bfd_safe_read_leb128): ... this.
4940 * libbfd.h: Renegerate.
4942 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4944 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4945 before trying to fine matching file and line information.
4947 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4949 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4950 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4951 not match current bfd, then reload debug information. Record bfd
4952 we're loading debug info for in the stash. If we have debug
4953 informatin in the cache then perform section placement before
4956 2017-02-16 Alan Modra <amodra@gmail.com>
4959 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4960 * elfxx-target.h (elf_backend_no_page_alias): Define.
4961 (elfNN_bed): Init new field.
4962 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4963 ensure PT_LOAD segment starts on a new page.
4964 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4966 2017-02-16 Alan Modra <amodra@gmail.com>
4969 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4972 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4974 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4975 * bfd-in2.h: Regenerated.
4977 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4980 * elf32-i386.c (elf_i386_relocate_section): Allow
4981 "lea foo@GOT, %reg" in PIC.
4983 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4986 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4987 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4988 error against local IFUNC symbol without a base register for
4991 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4993 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4994 `%P: %H:' with `info->callbacks->einfo'.
4995 (ppc_elf_relocate_section): Likewise.
4996 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4997 (ppc64_elf_edit_toc): Likewise.
4998 (ppc64_elf_relocate_section): Likewise.
5000 2017-02-14 Alan Modra <amodra@gmail.com>
5002 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
5003 --gc-keep-exported, and test versioned field of sym rather than
5004 looking for @ in name.
5006 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5008 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5011 2017-02-13 Nick Clifton <nickc@redhat.com>
5014 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5017 2017-02-07 Andrew Waterman <andrew@sifive.com>
5019 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5020 entry size if PLT header is written.
5022 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5024 Fix sparc64 dynamic relocation processing to use the dynamic
5026 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5027 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5030 2017-02-03 Nick Clifton <nickc@redhat.com>
5033 * coffcode.h (coff_write_object_contents): Enlarge size of
5034 s_name_buf in order to avoid compile time warning about possible
5036 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5037 32-bits of insn value before printing into buffer.
5039 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5041 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5042 `max_local_dynindx'.
5043 (mips_elf_sort_hash_table): Handle it.
5044 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5045 symbols bump up `max_local_dynindx' rather than
5046 `max_non_got_dynindx'.
5048 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5050 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5051 `min_got_dynindx', `max_unref_got_dynindx' and
5052 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5053 (mips_elf_sort_hash_table): Adjust accordingly.
5055 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5057 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5058 to access the hash table.
5060 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5062 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5063 non-NULL `htab' to the beginning.
5065 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5067 * elflink.c (elf_gc_sweep): Wrap overlong line.
5069 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5071 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5072 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5073 * elfxx-mips.c (mips_elf_link_hash_table): Add
5074 `ignore_branch_isa' member.
5075 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5076 in branch relocation calculation as an error if
5077 `ignore_branch_isa' has been set.
5078 (_bfd_mips_elf_insn32): Rename to...
5079 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5080 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5081 Handle the new parameter.
5083 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5085 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5086 local variable dynobj.
5089 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5090 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5091 executable from read-only sections into sdynrelro.
5092 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5093 dynamic relocs in sdynrelro.
5094 (elf_backend_want_dynrelro): Define.
5096 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5098 * config.bfd (*-*-rtemsaout*): Mark as removed.
5100 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5102 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5103 (arm-*-rtems*): Move to (arm*-*-eabi*).
5104 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5105 (m68-*-rtems*): Move to (m68*-*-elf*).
5107 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5109 * config.bfd (*-*-rtemscoff*): Mark as removed.
5111 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5114 * elflink.c (bfd_elf_record_link_assignment): Revert last
5115 change and don't ever clear `forced_local'. Set `mark'
5117 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5119 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5120 (bfd_elf_size_dynamic_sections): ... here.
5121 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5122 and set `mark' instead in `__tls_get_addr_opt' processing.
5123 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5125 2017-01-24 Alan Modra <amodra@gmail.com>
5127 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5128 where dynamic relocs are preferable. Allow ifunc too.
5129 (ensure_undefweak_dynamic): New function.
5130 (allocate_dynrelocs): Use it here. Move plt handling last and
5131 don't make symbols dynamic, simplifying loop. Only make undef
5132 weak symbols with GOT entries dynamic. Correct condition
5133 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5134 comments. Remove goto.
5135 (ppc_elf_relocate_section): Correct test for using dynamic
5136 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5137 to suit. Set up explicit tls_index entries and implicit GOT
5138 tls_index entries resolvable at link time for
5139 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5140 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5141 (ensure_undefweak_dynamic): New function.
5142 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5143 with GOT entries dynamic. Remove unnecessary test of
5144 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5145 (ppc64_elf_relocate_section): Correct test for using dynamic
5146 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5147 to suit. Set up explicit tls_index entries and implicit GOT
5148 tls_index entries resolvable at link time for __tls_get_addr_opt.
5149 Simplify expression to clear mem for prelink.
5151 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5153 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5155 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5157 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5158 (elf_backend_hash_symbol): Define.
5160 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5163 * elflink.c (bfd_elf_record_link_assignment): Clear any
5164 `forced_local' marking for DSO symbols that are not being
5167 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5169 * elfnn-riscv.c (riscv_elf_object_p): New function.
5171 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5174 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5176 (elf_x86_64_check_relocs): Create .eh_frame section for the
5178 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5179 .eh_frame section for the .plt.bnd section.
5180 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5181 for the .plt.bnd section.
5183 2017-01-12 Nick Clifton <nickc@redhat.com>
5186 * opncls.c (find_separate_debug_file): Add include_dirs
5187 parameter. Only include the directory part of the bfd's filename
5188 in search paths if include_dirs is true. Add a couple of extra
5189 locations for looking for debug files.
5190 ( bfd_follow_gnu_debuglink): Update invocation of
5191 find_separate_debug_file.
5192 (bfd_follow_gnu_debugaltlink): Likewise.
5193 (get_build_id): New function: Finds the build-id of the given bfd.
5194 (get_build_id_name): New function: Computes the name of the
5195 separate debug info file for a bfd, based upon its build-id.
5196 (check_build_id_file): New function: Checks to see if a separate
5197 debug info file exists at the given location, and that its
5198 build-id matches that of the original bfd.
5199 (bfd_follow_build_id_debuglink): New function: Finds a separate
5200 debug info file for a given bfd by using the build-id method.
5201 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5202 method of locating a separate debug info file before using the
5204 * bfd-in2.h: Regenerate.
5206 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5209 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5210 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5211 elf_x86_64_eh_frame_plt_got.
5212 (elf_x86_64_size_dynamic_sections): Get unwind info from
5213 elf_x86_64_bnd_arch_bed for the BND PLT.
5215 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5217 * config.bfd: Add entries for i686-redox and x86_64-redox.
5219 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5221 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5223 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5224 .eh_frame section to 4 bytes for x32.
5225 (elf_x86_64_check_relocs): Likewise.
5227 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5230 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5231 (PLT_GOT_FDE_LENGTH): Likewise.
5232 (elf_i386_plt_layout): Add eh_frame_plt_got and
5233 eh_frame_plt_got_size.
5234 (elf_i386_plt): Updated.
5235 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5236 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5237 (elf_i386_size_dynamic_sections): Allocate and initialize
5238 .eh_frame section for .plt.got.
5239 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5241 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5242 eh_frame_plt_got_size.
5243 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5244 (PLT_GOT_FDE_LENGTH): Likewise.
5245 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5246 eh_frame_plt_got_size.
5247 (elf_x86_64_arch_bed): Updated.
5248 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5249 eh_frame_plt_got_size.
5250 (elf_x86_64_nacl_arch_bed): Likewise.
5251 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5252 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5253 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5254 .eh_frame section for .plt.got.
5255 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5258 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5260 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5261 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5263 2017-01-09 Nick Clifton <nickc@redhat.com>
5265 * dwarf2.c (lookup_address_in_function_table): Return early if
5266 there are no functions in the given comp unit, or if the high
5267 address of the last function in the comp unit is less than the
5270 2017-01-09 Nick Clifton <nickc@redhat.com>
5273 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5274 message if there are too many symbols to load.
5276 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5278 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5279 if relocs are cached.
5281 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5284 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5285 for R_MICROBLAZE_GOTOFF_64.
5287 2017-01-03 Nick Clifton <nickc@redhat.com>
5289 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5290 warning about using a possibly uninitialised variable.
5292 2017-01-02 Alan Modra <amodra@gmail.com>
5294 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5295 (allocate_plt_static, allocate_dynrelocs): Use it.
5297 2017-01-02 Alan Modra <amodra@gmail.com>
5299 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5300 .PARISC.unwind section.
5302 2017-01-02 Alan Modra <amodra@gmail.com>
5305 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5306 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5307 indirect to GOT pointer relative code edit.
5309 2017-01-02 Alan Modra <amodra@gmail.com>
5311 Update year range in copyright notice of all files.
5313 For older changes see ChangeLog-2016
5315 Copyright (C) 2017 Free Software Foundation, Inc.
5317 Copying and distribution of this file, with or without modification,
5318 are permitted in any medium without royalty provided the copyright
5319 notice and this notice are preserved.
5325 version-control: never