1 2017-11-28 H.J. Lu <hongjiu.lu@intel.com>
4 * elflink.c (_bfd_elf_merge_symbol): Also skip definition from
6 (elf_link_add_object_symbols): If linker plugin is enabled, set
7 non_ir_ref_regular on symbols referenced in regular objects so
8 that linker plugin will get the correct symbol resolution.
10 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
13 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Use
14 bfd_link_executable instead of bfd_link_pic for TLS.
15 (elfNN_aarch64_allocate_dynrelocs): Likewise.
16 (aarch64_can_relax_tls): Likewise.
18 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
21 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Use
22 UNDEFWEAK_NO_DYNAMIC_RELOC to avoid dynamic GOT relocs.
23 (elfNN_aarch64_allocate_dynrelocs): Likewise.
25 2017-11-24 H.J. Lu <hongjiu.lu@intel.com>
28 * elf.c (elf_read_notes): Add an argument for note aligment.
29 (elf_parse_notes): Likewise.
30 (_bfd_elf_make_section_from_shdr): Pass section aligment to
32 (bfd_section_from_phdr): Pass segment aligment to elf_read_notes.
33 (elf_parse_notes): Add an argument for note aligment. Use
34 ELF_NOTE_DESC_OFFSET to get the offset of the note descriptor.
35 Use ELF_NOTE_NEXT_OFFSET to get the offset of the next note
37 (elf_read_notes): Add an argument for note aligment and pass it
40 2017-11-23 Alan Modra <amodra@gmail.com>
42 * elf32-hppa.c (pc_dynrelocs): Define.
43 (elf32_hppa_copy_indirect_symbol): Don't copy dyn_relocs to weakdefs.
44 (alias_readonly_dynrelocs): New function.
45 (elf32_hppa_adjust_dynamic_symbol): Don't clear non_got_ref to
46 indicate dyn_relocs should be discarded, discard them here.
47 Use alias_readonly_dynrelocs.
48 (allocate_dynrelocs): Don't test or clear non_got_ref.
49 (elf32_hppa_relocate_section): Simplify test for dynamic relocs.
50 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't copy dyn_relocs
52 (alias_readonly_dynrelocs, pc_dynrelocs): New functions.
53 (ppc_elf_adjust_dynamic_symbol): Don't clear non_got_ref to
54 indicate dyn_relocs should be discarded, discard them here.
55 Use alias_readonly_dynrelocs.
56 (allocate_dynrelocs): Don't test or clear non_got_ref.
57 (ppc_elf_relocate_section): Simplify test for dynamic relocs.
59 2017-11-23 Alan Modra <amodra@gmail.com>
61 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
62 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
63 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
64 (ppc64_elf_adjust_dynamic_symbol): Don't use
65 alias_readonly_dynrelocs for function symbols.
67 2017-11-23 Alan Modra <amodra@gmail.com>
69 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
70 Rename u.weakdef to u.alias and update comment.
71 (weakdef): New static inline function.
72 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
73 rather than u.weakdef != NULL, and use weakdef function.
74 (_bfd_elf_adjust_dynamic_symbol): Likewise.
75 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
76 all aliases if def has been overridden in a regular object, not
78 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
79 is_weakalias and use weakdef. Set is_weakalias and circular
80 u.alias. Update comments.
81 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
82 u.weakdef != NULL and use weakdef function.
83 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
84 is_weakalias rather than u.weakdef != NULL and use weakdef
85 function. Assert that def is strong defined.
86 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
87 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
88 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
89 (bfin_adjust_dynamic_symbol): Likewise.
90 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
91 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
92 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
93 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
94 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
95 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
96 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
97 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
98 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
99 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
100 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
101 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
102 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
103 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
104 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
105 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
106 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
107 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
108 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
109 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
110 (tilepro_elf_adjust_dynamic_symbol): Likewise.
111 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
112 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
113 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
114 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
115 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
116 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
117 (ppc64_elf_adjust_dynamic_symbol): Likewise.
118 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
119 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
120 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
121 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
122 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
123 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
124 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
125 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
126 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
127 (tilegx_elf_adjust_dynamic_symbol): Likewise.
128 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
130 2017-11-21 Alan Modra <amodra@gmail.com>
132 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
133 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
135 2017-11-20 Nick Clifton <nickc@redhat.com>
138 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
139 objects without a GNU_PROPERTY note section when looking for a bfd
140 onto which notes can be accumulated.
142 2017-11-20 Alan Modra <amodra@gmail.com>
146 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
147 and leave rel_hdr->sh_flags zero. Update calls.
148 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
149 flag when !gas before adding rel/rela section to group. Set
150 output rel/rela SHF_GROUP flags.
152 2017-11-18 Jim Wilson <jimw@sifive.com>
154 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
155 and to in error message.
157 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
159 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
160 "%F%P:", instead of "%F:", to linker callback in case of error.
162 2017-11-16 Nick Clifton <nickc@redhat.com>
165 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
166 (elfcore_grok_openbsd_procinfo): Likewise.
167 (elfcore_grok_nto_status): Likewise.
169 2017-11-16 Nick Clifton <nickc@redhat.com>
171 * merge.c (sec_merge_emit): Always create padding buffer. Add
172 asserts to make sure that the buffer is long enough.
174 2017-11-15 Alan Modra <amodra@gmail.com>
176 * bfd.c (union _bfd_doprnt_args): Add "Bad".
177 (_bfd_doprnt): Handle more flags.
178 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
179 (error_handler_internal): Init args type to Bad.
181 2017-11-14 Alan Modra <amodra@gmail.com>
184 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
185 non-empty dynamic section.
186 (ppc_build_one_stub): Take elf_gp from output bfd, not output
188 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
190 2017-11-14 Alan Modra <amodra@gmail.com>
192 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
195 2017-11-13 Jan Beulich <jbeulich@suse.com>
197 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
199 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
200 (coff_write_object_contents): Likewise. Issue diagnostic for too
203 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
206 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
209 2017-11-12 Alan Modra <amodra@gmail.com>
211 * elflink.c (elf_link_add_object_symbols): Ignore anything but
212 defined and defweak symbols when setting up weakdefs.
214 2017-11-12 Alan Modra <amodra@gmail.com>
216 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
217 to keep dyn_relocs, clear to discard. Comment.
218 (allocate_dynrelocs): Always clear non_got_ref when clearing
219 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
220 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
221 dyn_relocs on undefined syms to handle for non-pic too.
222 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
223 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
224 to keep dyn_relocs, clear to discard. Comment.
225 (allocate_dynrelocs): Always clear non_got_ref when clearing
226 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
227 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
228 dyn_relocs on undefined syms to handle for non-pic too.
229 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
230 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
231 dyn_relocs here. Don't bother setting non_got_ref. Comment.
232 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
233 ifuncs. Move code deleting dyn_relocs on undefined symbols to
234 handle for non-pic too. Don't test non_got_ref. Do test
235 dynamic_adjusted and ELF_COMMON_DEF_P.
237 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
239 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
240 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
241 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
243 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
245 * elf32-mips.c (elf32_mips_write_core_note): New function.
246 (elf_backend_write_core_note): New macro.
247 * elf64-mips.c (elf64_mips_write_core_note): New function.
248 (elf_backend_write_core_note): New macro.
249 * elfn32-mips.c (elf32_mips_write_core_note): New function.
250 (elf_backend_write_core_note): New macro.
252 2017-11-07 Alan Modra <amodra@gmail.com>
254 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
257 2017-11-07 Alan Modra <amodra@gmail.com>
259 * sysdep.h: Formatting, comment fixes.
260 (gettext, ngettext): Redefine when ENABLE_NLS.
261 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
262 (_): Define using gettext.
263 (textdomain, bindtextdomain): Use safer "do nothing".
264 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
265 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
267 2017-11-05 Alan Modra <amodra@gmail.com>
270 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
273 2017-11-05 Alan Modra <amodra@gmail.com>
276 * bfd.c (union _bfd_doprnt_args): New.
277 (PRINT_TYPE): Add FIELD arg. Take value from args.
278 (_bfd_doprnt): Replace ap parameter with args. Adjust all
279 PRINT_TYPE invocations and reading of format args to suit.
280 Move "%%" handling out of switch handling args. Support
281 positional parameters.
282 (_bfd_doprnt_scan): New function.
283 (error_handler_internal): Call _bfd_doprnt_scan and read args.
285 2017-11-04 Alan Modra <amodra@gmail.com>
287 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
288 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
289 (ppc_elf_relocate_section): Don't output a dynamic relocation
290 for IE GOT entries in an executable.
291 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
292 (ppc64_elf_size_dynamic_sections): Likewise.
293 (ppc64_elf_relocate_section): Likewise.
295 2017-11-04 Alan Modra <amodra@gmail.com>
297 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
298 callers. Don't bother with SEC_ALLOC test. Return section pointer.
300 (maybe_set_textrel): ..here.
301 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
302 (maybe_set_textrel): Call minfo to print textrel warning to map file.
304 2017-11-04 Alan Modra <amodra@gmail.com>
306 * elf32-hppa.c (enum _tls_type): Move.
307 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
308 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
309 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
310 (got_entries_needed, got_relocs_needed): New functions.
311 (allocate_dynrelocs): Use them.
312 (elf32_hppa_size_dynamic_sections): Likewise.
313 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
314 Correct code emitting relocs on GD/IE got entries. Report an
315 error when a symbol has both normal and TLS GOT relocs.
317 2017-11-04 Alan Modra <amodra@gmail.com>
320 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
321 for plabels when non-pic.
322 (maybe_set_textrel): New function.
323 (readonly_dynrelocs): Move and rewrite.
324 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
325 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
326 for functions. Expand non_got_ref comments.
327 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
329 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
331 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
332 Don't use func_pointer_refcount. Don't set plt.refcount nor
333 non_got_ref for function pointer reference.
334 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
335 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
336 func_pointer_refcount.
337 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
338 func_pointer_refcount.
339 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
340 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
341 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
343 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
344 Nick Clifton <nickc@redhat.com>
347 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
348 overlarge raw syment count.
349 (coff_get_normalized_symtab): Likewise.
351 2017-11-01 James Bowman <james.bowman@ftdichip.com>
353 * archures.c: Add bfd_mach_ft32b.
354 * cpu-ft32.c: Add arch_info_struct.
355 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
357 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
359 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
360 (elf32_ft32_adjust_diff_reloc_value)
361 (elf32_ft32_adjust_reloc_if_spans_insn)
362 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
363 (ft32_elf_relax_section): New function.
364 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
365 * bfd-in2.h: Regenerate.
366 * libbfd.h: Regenerate.
368 2017-11-01 Nick Clifton <nickc@redhat.com>
371 * coffcode.h (coff_slurp_line_table): Check for an excessively
372 large line number count.
374 2017-11-01 Nick Clifton <nickc@redhat.com>
377 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
378 and offset in light of further possible bogus values.
380 2017-11-01 Alan Modra <amodra@gmail.com>
383 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
384 entry when just a dynamic reloc can serve. Ensure no dynamic
385 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
386 Expand and move the non_got_ref comment.
387 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
389 2017-11-01 Nick Clifton <nickc@redhat.com>
392 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
394 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
395 members of an archive.
397 2017-10-31 Nick Clifton <nickc@redhat.com>
400 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
403 2017-10-30 Alan Modra <amodra@gmail.com>
405 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
408 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
410 (bfd_elf_gc_sections): Likewise.
412 2017-10-30 Alan Modra <amodra@gmail.com>
415 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
416 ensure non_got_ref is not set due to debug references.
417 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
418 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
419 need for a plt entry.
420 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
421 dynamic relocs when pic. Remove bogus code attempting to handle
423 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
425 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
426 and SYMBOL_REFERENCES_LOCAL in GOT handling.
428 2017-10-28 Alan Modra <amodra@gmail.com>
431 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
432 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
433 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
434 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
436 2017-10-25 Alan Modra <amodra@gmail.com>
438 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
439 optionally prefixed with "_".
440 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
442 2017-10-24 Andrew Waterman <andrew@sifive.com>
444 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
447 2017-10-24 Renlin Li <renlin.li@arm.com>
450 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
452 2017-10-23 Nick Clifton <nickc@redhat.com>
455 * elflink.c (elf_link_output_extsym): Keep global undefined
456 symbols if they have been marked as needed.
458 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
460 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
462 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
463 `_bfd_mips_elf_mkobject'.
465 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
468 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
470 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
472 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
473 (riscv_pcgp_lo_reloc): Likewise.
474 (riscv_pcgp_relocs): Likewise.
475 (riscv_init_pcgp_relocs): New function.
476 (riscv_free_pcgp_relocs): Likewise.
477 (riscv_record_pcgp_hi_reloc): Likewise.
478 (riscv_record_pcgp_lo_reloc): Likewise.
479 (riscv_delete_pcgp_hi_reloc): Likewise.
480 (riscv_use_pcgp_hi_reloc): Likewise.
481 (riscv_record_pcgp_lo_reloc): Likewise.
482 (riscv_find_pcgp_lo_reloc): Likewise.
483 (riscv_delete_pcgp_lo_reloc): Likewise.
484 (_bfd_riscv_relax_pc): Likewise.
485 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
486 via the new functions above.
488 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
490 * elfnn-riscv.c (R_RISCV_DELETE): New define.
491 (_bfd_riscv_relax_delete): New function.
492 (perform_relocation): Handle R_RISCV_DELETE.
493 (_bfd_riscv_relax_section): Likewise.
495 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
498 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
499 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
500 bfd_link_executable for TLS check.
501 (tilegx_elf_check_relocs): Likewise.
502 (allocate_dynrelocs): Likewise.
503 (tilegx_elf_relocate_section): Likewise.
505 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
508 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
509 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
510 bfd_link_executable for TLS check.
511 (tilepro_elf_check_relocs): Likewise.
512 (allocate_dynrelocs): Likewise.
513 (tilepro_elf_relocate_section): Likewise.
515 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
518 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
519 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
520 bfd_link_executable for TLS check.
521 (_bfd_sparc_elf_check_relocs): Likewise.
522 (allocate_dynrelocs): Likewise.
523 (_bfd_sparc_elf_relocate_section): Likewise.
525 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
527 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
528 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
529 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
531 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
533 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
534 indirect and warning symbols.
536 2017-10-17 Alan Modra <amodra@gmail.com>
539 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
540 against size left rather than comparing pointers. Reorganise loop.
542 2017-10-17 Alan Modra <amodra@gmail.com>
545 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
546 and error for any other size that doesn't cover the header word.
548 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
550 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
551 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
552 (elf_backend_gc_sweep_hook): Likewise.
553 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
554 (bfinfdpic_gc_sweep_hook): Likewise.
555 (elf_backend_gc_sweep_hook): Likewise.
556 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
557 (elf_backend_gc_sweep_hook): Likewise.
558 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
559 (elf_backend_gc_sweep_hook): Likewise.
560 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
561 (elf_backend_gc_sweep_hook): Likewise.
562 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
563 (elf_backend_gc_sweep_hook): Likewise.
564 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
565 (elf_backend_gc_sweep_hook): Likewise.
566 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
568 (elf_m68k_remove_got_entry_type): Removed.
569 (elf_m68k_find_got_entry_ptr): Likewise.
570 (elf_m68k_remove_got_entry): Likewise.
571 (elf_m68k_gc_sweep_hook): Likewise.
572 (elf_backend_gc_sweep_hook): Likewise.
573 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
574 (elf_backend_gc_sweep_hook): Likewise.
575 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
576 (elf_backend_gc_sweep_hook): Likewise.
577 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
578 (elf_backend_gc_sweep_hook): Likewise.
579 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
580 (elf_backend_gc_sweep_hook): Likewise.
581 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
582 (elf_backend_gc_sweep_hook): Likewise.
583 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
584 (elf_backend_gc_sweep_hook): Likewise.
585 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
586 (elf_backend_gc_sweep_hook): Likewise.
587 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
588 (elf_backend_gc_sweep_hook): Likewise.
589 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
590 (elf_backend_gc_sweep_hook): Likewise.
591 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
592 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
593 (elf_backend_gc_sweep_hook): Likewise.
594 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
595 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
596 (elf_backend_gc_sweep_hook): Likewise.
597 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
598 (elf_backend_gc_sweep_hook): Likewise.
599 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
600 (elf_backend_gc_sweep_hook): Likewise.
601 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
602 (elf_backend_gc_sweep_hook): Likewise.
603 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
604 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
605 (elf_backend_gc_sweep_hook): Likewise.
606 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
607 (ppc64_elf_gc_sweep_hook): Likewise.
608 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
609 (elf_backend_gc_sweep_hook): Likewise.
610 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
611 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
612 * elflink.c (elf_link_add_object_symbols): Don't call
613 _bfd_elf_link_check_relocs here.
614 (gc_sweep_hook_fn): Removed.
615 (elf_gc_sweep): Remove gc_sweep_hook.
616 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
617 (elf_backend_gc_sweep_hook): Likewise.
618 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
619 (elf_backend_gc_sweep_hook): Likewise.
620 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
621 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
622 (elf_backend_gc_sweep_hook): Likewise.
623 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
624 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
625 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
626 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
627 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
628 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
630 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
632 * elf32-i386.c (elf_i386_backend_data): Removed.
633 (get_elf_i386_backend_data): Likewise.
634 (elf_i386_arch_bed): Replace elf_i386_backend_data with
635 elf_x86_backend_data.
636 (elf_i386_get_synthetic_symtab): Likewise.
637 (elf_i386_nacl_arch_bed): Likewise.
638 (elf_i386_vxworks_arch_bed): Likewise.
639 (elf_i386_relocate_section): Check target_os instead of
641 (elf_i386_finish_dynamic_symbol): Likewise.
642 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
643 Check target_os instead of is_vxworks.
644 (elf_i386_link_setup_gnu_properties): Remove normal_target and
645 is_vxworks. Initialize plt0_pad_byte.
646 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
647 (get_elf_x86_64_arch_data): Likewise.
648 (get_elf_x86_64_backend_data): Likewise.
649 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
650 elf_x86_backend_data.
651 (elf_x86_64_get_synthetic_symtab): Likewise.
652 (elf_x86_64_nacl_arch_bed): Likewise.
653 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
654 normal_target. Initialize plt0_pad_byte.
655 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
656 instead of is_vxworks.
657 (_bfd_x86_elf_size_dynamic_sections): Likewise.
658 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
659 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
660 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
661 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
662 Update normal_target. Set up plt0_pad_byte. Check target_os
663 instead of is_vxworks.
664 * elfxx-x86.h (elf_x86_target_os): New.
665 (elf_x86_backend_data): Likewise.
666 (get_elf_x86_backend_data): Likewise.
667 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
669 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
672 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
674 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
675 _bfd_x86_elf_finish_dynamic_sections.
676 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
677 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
679 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
682 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
685 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
686 hide symbol which was forced to be dynamic.
688 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
691 * elf32-cris.c (cris_elf_relocate_section): Don't generate
692 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
693 (cris_elf_check_relocs): Don't allocate dynamic relocation
694 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
696 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
699 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
700 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
701 (sh_elf_relocate_section): Don't generate dynamic relocation if
702 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
704 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
707 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
708 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
709 (elf_s390_relocate_section): Don't generate dynamic relocation
710 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
711 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
712 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
713 (elf_s390_relocate_section): Don't generate dynamic relocation
714 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
716 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
719 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
720 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
721 (allocate_dynrelocs): Discard dynamic relocations if
722 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
724 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
727 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
728 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
730 (allocate_dynrelocs): Discard dynamic relocations if
731 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
733 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
736 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
737 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
738 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
739 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
740 (elf_m68k_relocate_section): Don't generate dynamic relocation
741 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
743 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
746 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
747 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
748 (allocate_dynrelocs): Discard dynamic relocations if
749 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
750 (elf32_hppa_relocate_section): Don't generate dynamic
751 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
753 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
756 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
757 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
758 (allocate_fptr): Don't allocate function pointer if
759 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
760 (allocate_dynrel_entries): Don't allocate dynamic relocation
761 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
762 (set_got_entry): Don't set GOT entry if
763 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
764 (set_pltoff_entry): Don't set PLTOFF entry if
765 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
766 (elfNN_ia64_relocate_section): Don't install dynamic relocation
767 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
769 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
772 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
773 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
774 (allocate_dynrelocs): Don't allocate dynamic relocations if
775 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
777 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
780 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
781 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
782 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
783 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
785 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
788 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
789 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
790 (tilepro_elf_relocate_section): Don't generate dynamic
791 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
792 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
793 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
794 (tilegx_elf_relocate_section): Don't generate dynamic
795 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
797 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
800 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
801 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
803 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
804 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
806 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
808 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
809 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
810 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
812 2017-10-12 James Bowman <james.bowman@ftdichip.com>
814 * bfd-in2.h: Regenerate.
815 * libbfd.h: Regenerate.
816 * elf32-ft32.c: Add HOWTO R_FT32_15.
817 * reloc.c: Add BFD_RELOC_FT32_15.
819 2017-10-12 Nick Clifton <nickc@redhat.com>
821 * reloc.c (enum bfd_reloc_status): Start values at 2.
822 * bfd-in2.h: Regenerate.
823 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
824 that a TRUE return indicates success. Compare the result of
825 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
826 (build_one_stub): Change sense of tests against aarch64_relocate
828 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
829 than FALSE, when an error is detected.
830 (elfNN_aarch64_final_link_relocate): Likewise.
832 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
834 * elf32-i386.c (elf_backend_hide_symbol): New.
835 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
836 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
837 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
839 2017-10-12 Alan Modra <amodra@gmail.com>
841 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
842 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
843 (bfd_elf_define_start_stop): Likewise.
845 2017-10-12 Alan Modra <amodra@gmail.com>
847 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
848 when executable rather than non-PIC.
849 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
850 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
852 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
854 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
856 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
857 (elf_external_linux_prpsinfo64_ugid32): ... this.
858 (swap_linux_prpsinfo32_out): Rename to...
859 (swap_linux_prpsinfo32_ugid32_out): ... this.
860 (elf_external_linux_prpsinfo64_ugid16): New structure.
861 (swap_linux_prpsinfo64_ugid16_out): New function.
862 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
863 (elf_backend_linux_prpsinfo64_ugid16): Define.
864 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
865 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
866 of the 64-bit Linux core PRPSINFO note.
867 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
869 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
871 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
873 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
874 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
875 (elf_external_ppc_linux_prpsinfo32)
876 (swap_ppc_linux_prpsinfo32_out): Move to...
877 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
878 (swap_linux_prpsinfo32_ugid32_out): ... these.
879 (elf_external_linux_prpsinfo32): Rename to...
880 (elf_external_linux_prpsinfo32_ugid16): ... this.
881 (swap_linux_prpsinfo32_out): Rename to...
882 (swap_linux_prpsinfo32_ugid16_out): ... this.
883 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
884 (elf_backend_linux_prpsinfo32_ugid16): Define.
885 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
886 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
887 of the 32-bit Linux core PRPSINFO note.
888 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
889 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
890 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
891 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
892 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
893 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
894 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
895 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
896 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
897 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
899 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
901 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
902 `gap' member ahead of `pr_flag'.
904 2017-10-11 Pedro Alves <palves@redhat.com>
906 * bfd.c (_doprnt): Rename to ...
907 (_bfd_doprnt): ... this.
908 (error_handler_internal): Adjust.
910 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
912 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
913 instead of incrementing it.
914 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
916 2017-10-10 Renlin Li <renlin.li@arm.com>
919 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
920 symbols into dynamic.
922 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
925 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
926 (riscv_elf_link_hash_table_create): Initialize max_alignment to
928 (_bfd_riscv_relax_section): Cache the max alignment of output
929 sections if possible.
931 2017-10-10 Alan Modra <amodra@gmail.com>
933 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
934 .opd whenever .opd is present and non-zero size. Move code
935 setting abiversion to/from output file earlier. Only set
936 u.opd.func_sec when --gc-sections. Read relocs and set up
937 u.opd.func_sec values here..
938 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
940 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
942 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
944 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
947 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
949 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
950 .interp section with "ld --no-dynamic-linker".
952 2017-10-09 Alan Modra <amodra@gmail.com>
955 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
956 funcinfo_hash_table and varinfo_hash_table.
958 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
960 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
961 in read-only section with minfo.
962 (sh_elf_size_dynamic_sections): Likewise.
964 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
966 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
969 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
971 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
972 this_hdr.sh_entsize only if section size > 0.
974 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
976 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
978 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
980 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
981 in read-only section with minfo.
982 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
984 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
986 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
989 2017-10-06 John Baldwin <jhb@FreeBSD.org>
991 * elf-bfd.h (struct elf_backend_data): Add
992 `elf_backend_grok_freebsd_prstatus'.
993 * elf.c (elfcore_grok_freebsd_note): Call
994 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
996 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
998 (elf_backend_grok_freebsd_prstatus): Define.
999 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
1000 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
1002 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1004 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
1005 and has_non_got_reloc with zero_undefweak.
1006 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1007 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
1008 zero_undefweak to 1.
1009 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
1010 has_non_got_reloc with zero_undefweak.
1011 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
1012 has_got_reloc and has_non_got_reloc with zero_undefweak.
1013 (elf_x86_link_hash_entry): Likewise.
1015 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1017 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
1018 (VERIFY_COPY_RELOC): Likewise.
1020 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1022 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
1023 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1024 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1026 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1028 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
1029 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
1030 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1032 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1034 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
1035 * elf32-i386.c (elf_i386_relocate_section): Use it.
1036 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1038 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1040 * elf32-i386.c (X86_SIZE_TYPE_P): New.
1041 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1042 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
1043 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
1044 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
1046 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1048 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
1049 (PLT_LOCAL_IFUNC_P): Likewise.
1050 * elf32-i386.c (elf_i386_relocate_section): Use them.
1051 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1053 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1055 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
1056 * elf32-i386.c (elf_i386_relocate_section): Use it.
1057 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1059 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1061 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1062 * elf32-i386.c (elf_i386_relocate_section): Use it.
1063 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1065 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1067 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1068 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1069 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1070 (X86_PCREL_TYPE_P): This.
1071 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1072 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1073 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1075 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1077 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1079 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1080 * elf32-i386.c (elf_i386_tls_transition): Use it.
1081 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1083 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1085 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1086 Dump dynamic relocation in read-only section with minfo if
1088 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1089 (maybe_set_textrel): Likewise.
1090 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1091 read-only section with minfo.
1093 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1095 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1097 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1099 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1100 in read-only section with minfo.
1101 (tilepro_elf_size_dynamic_sections): Likewise.
1102 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1103 (tilegx_elf_size_dynamic_sections): Likewise.
1105 2017-10-05 Pedro Alves <palves@redhat.com>
1108 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1109 ellipsis parameter. Split out bfd_error_on_input code to..
1110 (bfd_set_input_error): .. New function.
1111 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1112 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1113 * bfd-in2.h: Regenerate.
1115 2017-10-05 Alan Modra <amodra@gmail.com>
1117 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1118 fini_array error value.
1120 2017-10-05 Alan Modra <amodra@gmail.com>
1123 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1125 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1127 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1128 (bfd_elf_set_group_contents): Add associated reloc section indices
1131 2017-10-04 Alan Modra <amodra@gmail.com>
1133 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1134 classify symbols for ELFv2.
1136 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1139 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1140 undergoes default promotion.
1141 * bfd-in2.h: Regenerate.
1143 2017-10-02 Alan Modra <amodra@gmail.com>
1145 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1146 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1148 2017-10-01 Alan Modra <amodra@gmail.com>
1151 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1152 (add_line_info): Always put end_sequence last.
1154 2017-10-01 Alan Modra <amodra@gmail.com>
1157 * dwarf2.c (read_section): Allocate buffer with extra byte for
1158 bfd_simple_get_relocated_section_contents rather than copying
1161 2017-09-29 Alan Modra <amodra@gmail.com>
1163 * merge.c (merge_strings): Return FALSE on malloc failure.
1164 (_bfd_merge_sections): Return failures from record_section and
1167 2017-09-28 Alan Modra <amodra@gmail.com>
1170 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1171 a case where plugin_notice isn't called.
1173 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1175 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1178 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1181 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1182 output_bfd to info->callbacks->minfo.
1184 2017-09-26 Nick Clifton <nickc@redhat.com>
1187 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1188 assertion failure if elf_x86_64_rtype_to_howto has already issued
1191 2017-09-26 Alan Modra <amodra@gmail.com>
1194 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1197 2017-09-26 Nick Clifton <nickc@redhat.com>
1200 * dwarf2.c (read_formatted_entries): Fail early if we know that
1201 the loop parsing data entries will overflow the end of the
1204 2017-09-26 Alan Modra <amodra@gmail.com>
1207 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1208 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1209 to stash->info_ptr_memory, and check die_ref is within that memory.
1210 Set info_ptr_end correctly when another CU is refd. Check die_ref
1211 for DW_FORM_ref4 etc. is within CU.
1213 2017-09-26 Alan Modra <amodra@gmail.com>
1216 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1217 (read_formatted_entries): Init "fe".
1218 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1220 2017-09-26 Alan Modra <amodra@gmail.com>
1223 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1224 bounds in inner loop.
1226 2017-09-25 Alan Modra <amodra@gmail.com>
1229 * dwarf1.c (parse_die): Sanity check pointer against section limit
1230 before dereferencing.
1231 (parse_line_table): Likewise.
1233 2017-09-25 Alan Modra <amodra@gmail.com>
1236 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1238 (parse_comp_unit): Likewise.
1240 2017-09-25 Alan Modra <amodra@gmail.com>
1243 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1245 2017-09-24 Alan Modra <amodra@gmail.com>
1248 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1249 within section bounds.
1251 2017-09-24 Alan Modra <amodra@gmail.com>
1254 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1256 2017-09-24 Alan Modra <amodra@gmail.com>
1259 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1260 pname param. Return status. Make name const. Don't abort,
1261 return an error. Formatting. Exit if current info_ptr matches
1262 orig_info_ptr. Update callers.
1263 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1264 nested_funcs an array of structs for extensibility. Formatting.
1266 2017-09-24 Alan Modra <amodra@gmail.com>
1269 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1270 rather than dividing by zero.
1272 2017-09-24 Alan Modra <amodra@gmail.com>
1275 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1277 2017-09-24 Alan Modra <amodra@gmail.com>
1280 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1282 2017-09-24 Alan Modra <amodra@gmail.com>
1285 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1286 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1289 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1292 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1295 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1298 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1299 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1301 2017-09-22 Pedro Alves <palves@redhat.com>
1302 Alan Modra <amodra@gmail.com>
1304 * version.h: Add comment.
1306 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1308 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1309 NT_S390_GS_BC, correct the previously swapped invocations of
1310 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1312 2017-09-19 Alan Modra <amodra@gmail.com>
1315 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1318 2017-09-19 Alan Modra <amodra@gmail.com>
1321 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1322 symbols before calculating verrefs. Don't renumber dynsyms
1323 after gc. Exclude .gnu.version when zero or one dynsym.
1324 Localize some vars and reindent.
1326 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1329 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1330 return from bfd_canonicalize_dynamic_reloc.
1332 2017-09-15 Alan Modra <amodra@gmail.com>
1335 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1336 overflows bfd_size_type.
1338 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1341 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1342 to indicate if conversion is performed.
1343 (elf_i386_check_relocs): Cache section contents and relocations
1344 if conversion is performed.
1345 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1346 contents and relocations if conversion is performed.
1348 2017-09-14 Nick Clifton <nickc@redhat.com>
1351 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1354 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1356 * elfxx-x86.h: Fix a typo in comments.
1358 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1360 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1362 2017-09-09 Alan Modra <amodra@gmail.com>
1364 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1367 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1369 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1370 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1371 (elf_i386_finish_dynamic_symbol): Likewise.
1372 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1373 (elf_x86_64_finish_dynamic_symbol): Likewise.
1374 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1375 (_bfd_x86_elf_fixup_symbol): Likewise.
1377 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1379 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1380 check has_non_got_reloc.
1382 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1385 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1386 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1387 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1388 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1389 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1390 and linker_def on __ehdr_start if it is referenced and not
1392 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1393 and return TRUE when building executable, if a symbol has
1394 non-GOT/non-PLT relocations in text section or there is no
1396 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1398 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1400 * elfxx-x86.h: Update comments.
1402 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1404 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1405 elf_x86_plt_layout_table with elf_x86_init_table.
1406 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1408 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1410 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1411 (elf_x86_init_table): This.
1412 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1413 elf_x86_plt_layout_table with elf_x86_init_table.
1415 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1417 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1418 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1419 * configure: Regenerated.
1420 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1421 and r_sym fields of plt_layout.
1422 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1424 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1425 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1426 r_info nor r_sym fields.
1427 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1429 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1431 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1433 * (_bfd_riscv_relax_align): Call bfd_set_error and
1434 print an error message when unable to relax a .align directive.
1436 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1438 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1439 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1440 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1441 R_RISCV_PCREL_HI20 relocs, and pass the result to
1442 riscv_record_pcrel_hi_reloc.
1444 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1446 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1447 r_type_p. Remove the converted argument. Replace
1448 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1449 the new relocation type via r_type_p.
1450 (elf_i386_relocate_section): Likewise.
1451 (elf_i386_finish_dynamic_symbol): Likewise.
1452 (need_convert_load): Removed.
1453 (check_relocs_failed): Updated.
1454 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1455 instead of setting need_convert_load.
1456 (_bfd_i386_elf_convert_load): Removed.
1457 * elf64-x86-64.c (need_convert_load): Removed.
1458 (check_relocs_failed): Updated.
1459 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1460 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1461 Return the new relocation type via r_type_p.
1462 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1463 instead of setting need_convert_load.
1464 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1466 (_bfd_x86_64_elf_convert_load): Removed.
1467 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1468 with SYMBOL_REFERENCES_LOCAL_P.
1469 (elf_x86_64_finish_dynamic_symbol): Likewise.
1470 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1472 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1473 (_bfd_x86_elf_link_symbol_references_local): New function.
1474 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1475 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1476 SYMBOL_REFERENCES_LOCAL_P.
1477 (elf_x86_link_hash_entry): Add local_ref.
1478 (elf_x86_link_hash_table): Remove convert_load.
1479 (_bfd_i386_elf_convert_load): Removed.
1480 (_bfd_x86_64_elf_convert_load): Likewise.
1481 (_bfd_x86_elf_link_symbol_references_local): New.
1483 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1485 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1486 (elf_x86_64_info_to_howto): Get the real relocation type by
1487 masking out R_X86_64_converted_reloc_bit.
1488 (elf_x86_64_check_tls_transition): Get the real relocation type
1489 by masking out R_X86_64_converted_reloc_bit.
1490 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1491 instead of setting converted_reloc.
1492 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1493 instead of converted_reloc. Get the real relocation type by
1494 masking out R_X86_64_converted_reloc_bit.
1495 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1496 R_X86_64_converted_reloc_bit is valid.
1497 * elfxx-x86.h (converted_reloc): Removed.
1499 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1501 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1502 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1503 to get the relocation type again.
1504 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1505 r_type when calling elf_x86_64_tls_transition. Don't use
1506 ELF32_R_TYPE to get the relocation type again.
1508 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1510 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1513 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1515 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1516 argument. Don't check relocation overflow. Avoid relocation
1517 overflow if --no-relax is used. Set converted_reloc on symbol
1518 if a GOTPCREL relocation is converted.
1519 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1520 --no-relax if GOTPCREL relocation conversion leads to relocation
1522 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1524 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1525 Edmar Wienskoski <edmar.wienskoski@nxp.com
1527 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1528 (ppc_elf_check_relocs): Handle it.
1529 (ppc_elf_vle_split20): New function.
1530 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1532 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1535 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1536 for x86-64 if GOT_TLS_GDESC_P is true.
1538 2017-09-03 Alan Modra <amodra@gmail.com>
1541 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1543 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1545 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1546 tls_get_addr for x86-64 in one place.
1548 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1550 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1551 with elfxx-x86.lo for 64-bit BFD.
1552 * configure: Regenerated.
1554 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1556 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1557 (_bfd_i386_elf_convert_load): This. Remove static.
1558 (elf_i386_size_dynamic_sections): Removed.
1559 (elf_backend_size_dynamic_sections): Likewise.
1560 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1561 (_bfd_x86_64_elf_convert_load): This. Remove static.
1562 (elf_x86_64_size_dynamic_sections): Removed.
1563 (elf_backend_size_dynamic_sections): Likewise.
1564 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1565 (elf_x86_allocate_dynrelocs): This. Make it static.
1566 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1567 (elf_x86_allocate_local_dynreloc): This. Make it static.
1568 (elf_i386_is_reloc_section): New function.
1569 (elf_x86_64_is_reloc_section): Likewise.
1570 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1571 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1572 Rearrange got_entry_size initialization.
1573 (_bfd_x86_elf_size_dynamic_sections): New function.
1574 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1575 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1576 (_bfd_i386_elf_convert_load): New.
1577 (_bfd_x86_64_elf_convert_load): Likewise.
1578 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1579 (elf_backend_size_dynamic_sections): Likewise.
1580 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1581 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1583 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1585 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1588 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1590 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1591 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1593 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1595 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1596 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1597 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1598 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1599 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1600 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1602 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1604 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1605 (elf_i386_allocate_local_dynrelocs): Likewise.
1606 (elf_i386_size_dynamic_sections): Replace
1607 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1608 with _bfd_x86_elf_allocate_dynrelocs and
1609 _bfd_x86_elf_allocate_local_dynrelocs.
1610 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1611 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1612 (elf_x86_64_size_dynamic_sections): Replace
1613 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1614 with _bfd_x86_elf_allocate_dynrelocs and
1615 _bfd_x86_elf_allocate_local_dynrelocs.
1616 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1617 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1618 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1619 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1621 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1623 * elf32-i386.c (is_i386_elf): Removed.
1624 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1625 (elf_i386_size_dynamic_sections): Likewise.
1626 (elf_i386_relocate_section): Likewise.
1627 * elf64-x86-64.c (is_x86_64_elf): Removed.
1628 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1630 (elf_x86_64_size_dynamic_sections): Likewise.
1631 (elf_x86_64_relocate_section): Likewise.
1632 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1634 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1637 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1639 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1640 (elf_i386_allocate_dynrelocs): Replace
1641 elf_i386_compute_jump_table_size with
1642 elf_x86_compute_jump_table_size.
1643 (elf_i386_size_dynamic_sections): Likewise.
1644 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1645 (elf_x86_64_allocate_dynrelocs): Replace
1646 elf_x86_64_compute_jump_table_size with
1647 elf_x86_compute_jump_table_size.
1648 (elf_x86_64_size_dynamic_sections): Likewise.
1649 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1651 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1652 (elf_x86_compute_jump_table_size): New.
1654 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1656 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1658 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1659 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1661 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1663 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1664 with htab->is_vxworks.
1665 (elf_i386_size_dynamic_sections): Likewise.
1666 (elf_i386_relocate_section): Likewise.
1667 (elf_i386_finish_dynamic_symbol): Likewise.
1668 (elf_i386_finish_dynamic_sections): Likewise.
1670 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1672 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1673 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1674 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1675 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1676 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1677 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1678 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1679 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1681 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1684 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1685 ELF_COMMON_DEF_P for common symbols.
1687 2017-09-02 Alan Modra <amodra@gmail.com>
1689 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1690 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1691 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1693 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1695 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1696 (elf_backend_gc_mark_hook): Likewise.
1697 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1698 (elf_backend_gc_mark_hook): Likewise.
1699 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1700 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1701 (elf_backend_gc_mark_hook): Likewise.
1703 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1705 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1706 (elf_backend_adjust_dynamic_symbol): Likewise.
1707 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1708 (elf_backend_adjust_dynamic_symbol): Likewise.
1709 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1710 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1711 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1712 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1713 (elf_backend_adjust_dynamic_symbol): Likewise.
1715 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1717 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1720 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1722 * elf32-i386.c (elf_i386_mkobject): Removed.
1723 (bfd_elf32_mkobject): Likewise.
1724 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1725 (bfd_elf64_mkobject): Likewise.
1726 (bfd_elf32_mkobject): Likewise.
1727 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1728 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1729 (bfd_elf64_mkobject): Likewise.
1730 (bfd_elf32_mkobject): Likewise.
1732 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1734 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1735 Call _bfd_x86_elf_link_setup_gnu_properties.
1736 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1737 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1739 (elf_x86_64_non_lazy_plt): Likewise.
1740 (elf_x86_64_lazy_bnd_plt): Likewise.
1741 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1742 (elf_x86_64_lazy_ibt_plt): Likewise.
1743 (elf_x32_lazy_ibt_plt): Likewise.
1744 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1745 (elf_x32_non_lazy_ibt_plt): Likewise.
1746 (elf_x86_64_nacl_plt): Likewise.
1747 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1748 _bfd_x86_elf_link_setup_gnu_properties.
1749 * elfxx-x86.c: Include elf-vxworks.h".
1750 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1751 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1752 comments for pic_plt0_entry and pic_plt_entry.
1753 (elf_x86_non_lazy_plt_layout): Likewise.
1754 (elf_x86_plt_layout_table): New.
1755 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1757 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1760 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1761 .eh_frame section for the second PLT.
1762 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1763 alignment of .eh_frame section for the second PLT.
1765 2017-09-01 Nick Clifton <nickc@redhat.com>
1768 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1771 2017-09-01 Nick Clifton <nickc@redhat.com>
1774 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1775 attribute buffer is NUL terminated.
1777 2017-08-31 Nick Clifton <nickc@redhat.com>
1780 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1781 to dwarf string sections.
1783 2017-08-31 Alan Modra <amodra@gmail.com>
1785 * po/SRC-POTFILES.in: Regenerate.
1787 2017-08-31 Alan Modra <amodra@gmail.com>
1789 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1790 for a section containing just a terminator. Allow multiple
1791 terminators at end of section.
1792 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1793 sections when not adding alignment. Assert on terminator in
1796 2017-08-31 Alan Modra <amodra@gmail.com>
1800 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1803 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1805 * configure.ac (bfd_backends): Add elf64.lo together with
1806 elfxx-x86.lo for 64-bit BFD.
1807 * configure: Regenerated.
1809 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1811 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1814 2017-08-31 Alan Modra <amodra@gmail.com>
1817 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1818 before _close_and_cleanup. Call iovec->bclose after.
1819 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1821 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1823 * elf32-i386.c (elf_i386_plt_type): Removed.
1824 (elf_i386_plt): Likewise.
1825 (elf_i386_get_synthetic_symtab): Updated. Call
1826 _bfd_x86_elf_get_synthetic_symtab.
1827 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1828 (elf_x86_64_plt): Likewise.
1829 (elf_x86_64_get_synthetic_symtab): Updated. Call
1830 _bfd_x86_elf_get_synthetic_symtab.
1831 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1832 (elf_x86_64_get_plt_got_vma): Likewise.
1833 (elf_i386_valid_plt_reloc_p): Likewise.
1834 (elf_x86_64_valid_plt_reloc_p): Likewise.
1835 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1836 * elfxx-x86.h (elf_x86_plt_type): New.
1837 (elf_x86_plt): Likewise.
1838 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1840 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1842 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1843 target_id instead of elf_machine_code.
1845 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1847 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1848 (elf_i386_lazy_plt_layout): Likewise.
1849 (elf_i386_non_lazy_plt_layout): Likewise.
1850 (elf_i386_plt_layout): Likewise.
1851 (elf_i386_link_hash_table): Likewise.
1852 (elf_i386_next_tls_desc_index): Likewise.
1853 (elf_i386_srelplt2): Likewise.
1854 (elf_i386_plt): Likewise.
1855 (elf_i386_lazy_plt): Likewise.
1856 (elf_i386_non_lazy_plt): Likewise.
1857 (elf_i386_link_hash_table_create): Likewise.
1858 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1859 (elf_i386_lazy_plt): Updated.
1860 (elf_i386_non_lazy_plt): Likewise.
1861 (elf_i386_lazy_ibt_plt): Likewise.
1862 (elf_i386_non_lazy_ibt_plt): Likewise.
1863 (elf_i386_allocate_dynrelocs): Likewise.
1864 (elf_i386_size_dynamic_sections): Likewise.
1865 (elf_i386_relocate_section): Likewise.
1866 (elf_i386_finish_dynamic_symbol): Likewise.
1867 (elf_i386_finish_dynamic_sections): Likewise.
1868 (elf_i386_get_synthetic_symtab): Likewise.
1869 (elf_i386_link_setup_gnu_properties): Likewise.
1870 (elf_i386_nacl_plt): Likewise.
1871 * elf64-x86-64.c (ABI_64_P): Removed.
1872 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1873 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1874 (elf_x86_64_lazy_plt_layout): Likewise.
1875 (elf_x86_64_non_lazy_plt_layout): Likewise.
1876 (elf_x86_64_plt_layout): Likewise.
1877 (elf_x86_64_link_hash_table): Likewise.
1878 (elf_x86_64_plt): Likewise.
1879 (elf_x86_64_lazy_plt): Likewise.
1880 (elf_x86_64_non_lazy_plt): Likewise.
1881 (elf_x86_64_link_hash_table_create): Likewise.
1882 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1883 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1884 (elf_x86_64_lazy_plt): Updated.
1885 (elf_x86_64_non_lazy_plt): Likewise.
1886 (elf_x86_64_lazy_bnd_plt): Likewise.
1887 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1888 (elf_x86_64_lazy_ibt_plt): Likewise.
1889 (elf_x32_lazy_ibt_plt): Likewise.
1890 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1891 (elf_x32_non_lazy_ibt_plt): Likewise.
1892 (elf_x86_64_allocate_dynrelocs): Likewise.
1893 (elf_x86_64_size_dynamic_sections): Likewise.
1894 (elf_x86_64_relocate_section): Likewise.
1895 (elf_x86_64_finish_dynamic_symbol): Likewise.
1896 (elf_x86_64_finish_dynamic_sections): Likewise.
1897 (elf_x86_64_get_synthetic_symtab): Likewise.
1898 (elf_x86_64_link_setup_gnu_properties): Likewise.
1899 (elf_x86_64_nacl_plt): Likewise.
1900 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1902 (ELF32_DYNAMIC_INTERPRETER): New.
1903 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1904 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1905 (_bfd_x86_elf_link_hash_table_create): Likewise.
1906 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1907 (elf_x86_link_hash_table_free): This. Make it static.
1908 * elfxx-x86.h: Don't include "objalloc.h".
1910 (elf_x86_lazy_plt_layout): Likewise.
1911 (elf_x86_non_lazy_plt_layout): Likewise.
1912 (elf_x86_plt_layout): Likewise.
1913 (_bfd_x86_elf_link_hash_table_create): Likewise.
1914 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1915 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1916 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1917 srelplt2 and next_tls_desc_index.
1918 (_bfd_x86_elf_link_hash_table_free): Removed.
1920 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1922 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1923 branch offset interpretation.
1925 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1928 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1930 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1932 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1933 (elf_x86_64_srelplt2): Likewise.
1935 2017-08-30 Alan Modra <amodra@gmail.com>
1937 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1938 (ppc64_elf_tls_optimize): Set it.
1939 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1940 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1941 addis would add zero.
1942 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1943 (ppc_elf_tls_optimize): Set it.
1944 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1945 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1947 2017-08-30 Alan Modra <amodra@gmail.com>
1949 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1950 __tls_get_addr call sequences to LE, don't move the addi down
1951 to the nop. Replace the bl with addi and leave the nop alone.
1953 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1955 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1957 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1959 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1961 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1963 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1964 (BFD64_BACKENDS): Likewise.
1965 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1966 (BFD64_BACKENDS_CFILES): Likewise.
1967 * Makefile.in: Regenerated.
1968 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1969 elf32-i386.lo and elf64-x86-64.lo.
1970 * configure: Regenerated.
1971 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1972 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1973 "objalloc.h" and "hashtab.h".
1974 (ELIMINATE_COPY_RELOCS): Removed.
1975 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1976 (SYMBOL_NO_COPYRELOC): Likewise.
1977 (elf_i386_link_hash_entry): Likewise.
1978 (GOT_UNKNOWN): Likewise.
1979 (GOT_NORMAL): Likewise.
1980 (GOT_TLS_GD): Likewise.
1981 (elf_i386_hash_entry): Likewise.
1982 (elf_i386_obj_tdata): Likewise.
1983 (elf_i386_tdata): Likewise.
1984 (elf_i386_local_got_tls_type): Likewise.
1985 (elf_i386_local_tlsdesc_gotent): Likewise.
1986 (elf_i386_hash_table): Likewise.
1987 (elf_i386_link_hash_newfunc): Likewise.
1988 (elf_i386_local_htab_hash): Likewise.
1989 (elf_i386_local_htab_eq): Likewise.
1990 (elf_i386_get_local_sym_hash): Likewise.
1991 (elf_i386_link_hash_table_free): Likewise.
1992 (elf_i386_copy_indirect_symbol): Likewise.
1993 (elf_i386_fixup_symbol): Likewise.
1994 (elf_i386_readonly_dynrelocs): Likewise.
1995 (elf_i386_always_size_sections): Likewise.
1996 (elf_i386_set_tls_module_base): Likewise.
1997 (elf_i386_dtpoff_base): Likewise.
1998 (compare_relocs): Likewise.
1999 (elf_i386_hash_symbol): Likewise.
2000 (elf_i386_parse_gnu_properties): Likewise.
2001 (elf_i386_merge_gnu_properties): Likewise.
2002 (elf_i386_link_check_relocs): Likewise.
2003 (elf_i386_merge_symbol_attribute): Likewise.
2004 (bfd_elf32_bfd_link_check_relocs): Likewise.
2005 (elf_backend_copy_indirect_symbol): Likewise.
2006 (elf_backend_always_size_sections): Likewise.
2007 (elf_backend_omit_section_dynsym): Likewise.
2008 (elf_backend_hash_symbol): Likewise.
2009 (elf_backend_fixup_symbol): Likewise.
2010 (elf_backend_parse_gnu_properties): Likewise.
2011 (elf_backend_merge_gnu_properties): Likewise.
2012 (elf_backend_merge_symbol_attribute): Likewise.
2013 (elf_i386_mkobject): Updated.
2014 (elf_i386_link_hash_table_create): Likewise.
2015 (elf_i386_check_tls_transition): Likewise.
2016 (elf_i386_tls_transition): Likewise.
2017 (elf_i386_convert_load_reloc): Likewise.
2018 (elf_i386_check_relocs): Likewise.
2019 (elf_i386_adjust_dynamic_symbol): Likewise.
2020 (elf_i386_allocate_dynrelocs): Likewise.
2021 (elf_i386_convert_load): Likewise.
2022 (elf_i386_size_dynamic_sections): Likewise.
2023 (elf_i386_relocate_section): Likewise.
2024 (elf_i386_finish_dynamic_symbol ): Likewise.
2025 (elf_i386_finish_dynamic_sections): Likewise.
2026 (elf_i386_output_arch_local_syms): Likewise.
2027 (elf_i386_get_synthetic_symtab): Likewise.
2028 (elf_i386_link_setup_gnu_properties): Likewise.
2029 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
2030 of elf_link_hash_table, as base.
2031 (elf_i386_next_tls_desc_index): New.
2032 (elf_i386_srelplt2): Likewise.
2033 (elf_i386_plt): Likewise.
2034 (elf_i386_lazy_plt): Likewise.
2035 (elf_i386_non_lazy_plt): Likewise.
2036 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
2037 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
2038 "objalloc.h" and "hashtab.h".
2039 (ELIMINATE_COPY_RELOCS): Removed.
2040 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
2041 (SYMBOL_NO_COPYRELOC): Likewise.
2042 (elf_x86_64_link_hash_entry): Likewise.
2043 (GOT_UNKNOWN): Likewise.
2044 (GOT_NORMAL): Likewise.
2045 (GOT_TLS_GD): Likewise.
2046 (elf_x86_64_hash_entry): Likewise.
2047 (elf_x86_64_obj_tdata): Likewise.
2048 (elf_x86_64_tdata): Likewise.
2049 (elf_x86_64_local_got_tls_type): Likewise.
2050 (elf_x86_64_local_tlsdesc_gotent): Likewise.
2051 (elf_x86_64_hash_table): Likewise.
2052 (elf_x86_64_link_hash_newfunc): Likewise.
2053 (elf_x86_64_local_htab_hash): Likewise.
2054 (elf_x86_64_local_htab_eq): Likewise.
2055 (elf_x86_64_get_local_sym_hash): Likewise.
2056 (elf_x86_64_link_hash_table_free): Likewise.
2057 (elf_x86_64_copy_indirect_symbol): Likewise.
2058 (elf_x86_64_fixup_symbol): Likewise.
2059 (elf_x86_64_readonly_dynrelocs): Likewise.
2060 (elf_x86_64_always_size_sections): Likewise.
2061 (elf_x86_64_set_tls_module_base): Likewise.
2062 (elf_x86_64_dtpoff_base): Likewise.
2063 (compare_relocs): Likewise.
2064 (elf_x86_64_merge_symbol_attribute): Likewise.
2065 (elf_x86_64_hash_symbol): Likewise.
2066 (elf_x86_64_parse_gnu_properties): Likewise.
2067 (elf_x86_64_merge_gnu_properties): Likewise.
2068 (elf_x86_64_link_check_relocs): Likewise.
2069 (elf_backend_copy_indirect_symbol): Likewise.
2070 (elf_backend_always_size_sections): Likewise.
2071 (bfd_elf64_bfd_link_check_relocs): Likewise.
2072 (elf_backend_merge_symbol_attribute): Likewise.
2073 (elf_backend_hash_symbol): Likewise.
2074 (elf_backend_omit_section_dynsym): Likewise.
2075 (elf_backend_fixup_symbol): Likewise.
2076 (elf_backend_parse_gnu_properties): Likewise.
2077 (elf_backend_merge_gnu_properties): Likewise.
2078 (bfd_elf32_bfd_link_check_relocs): Likewise.
2079 (elf_x86_64_mkobject): Updated.
2080 (elf_x86_64_link_hash_table_create): Likewise.
2081 (elf_x86_64_check_tls_transition): Likewise.
2082 (elf_x86_64_tls_transition): Likewise.
2083 (elf_x86_64_convert_load_reloc): Likewise.
2084 (elf_x86_64_check_relocs): Likewise.
2085 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2086 (elf_x86_64_allocate_dynrelocs): Likewise.
2087 (elf_x86_64_convert_load): Likewise.
2088 (elf_x86_64_size_dynamic_sections): Likewise.
2089 (elf_x86_64_relocate_section): Likewise.
2090 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2091 (elf_x86_64_finish_dynamic_sections): Likewise.
2092 (elf_x86_64_output_arch_local_syms): Likewise.
2093 (elf_x86_64_get_synthetic_symtab): Likewise.
2094 (elf_x86_64_link_setup_gnu_properties): Likewise.
2095 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2096 instead of elf_link_hash_table, as base.
2097 (elf_x86_64_next_tls_desc_index): New.
2098 (elf_x86_64_srelplt2): Likewise.
2099 (elf_x86_64_plt): Likewise.
2100 (elf_x86_64_lazy_plt): Likewise.
2101 (elf_x86_64_non_lazy_plt): Likewise.
2102 * elfxx-x86.c: New file.
2103 * elfxx-x86.h: Likewise.
2105 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2107 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2109 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2111 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2113 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2114 sections before checking dynamic relocations and free invalid
2115 PLT section contents.
2116 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2118 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2120 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2121 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2123 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2126 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2128 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2130 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2132 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2134 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2136 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2139 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2140 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2141 Add a has_no_copy_on_protected bitfield.
2142 (elf_has_no_copy_on_protected): New.
2143 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2144 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2145 (elf_merge_gnu_property_list): Likewise.
2146 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2147 to FALSE for elf_has_no_copy_on_protected.
2148 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2149 (elf_i386_link_hash_entry): Add def_protected.
2150 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2151 when checking info->nocopyreloc.
2152 (elf_i386_link_setup_gnu_properties): Don't set
2153 extern_protected_data here.
2154 (elf_i386_merge_symbol_attribute): New function.
2155 (elf_backend_merge_symbol_attribute): New.
2156 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2157 (elf_x86_64_link_hash_entry): Add def_protected.
2158 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2159 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2160 when checking info->nocopyreloc.
2161 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2162 relocation run-time overflow and unresolvable R_X86_64_32S
2163 relocation against protected data symbol defined in shared object
2164 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2165 (elf_x86_64_link_setup_gnu_properties): Don't set
2166 extern_protected_data here.
2167 (elf_x86_64_merge_symbol_attribute): New function.
2168 (elf_backend_merge_symbol_attribute): New.
2170 2017-08-26 Alan Modra <amodra@gmail.com>
2172 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2173 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2174 (ppc_elf_relocate_section): Comment fix.
2175 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2176 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2177 Support dynamic relocs for TPREL16 when non-pic too.
2178 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2179 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2182 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2184 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2185 "symbol" in comments.
2186 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2188 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2191 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2192 R_X86_64_PC32 relocation run-time overflow and unresolvable
2193 R_X86_64_32S relocation with -z nocopyreloc.
2195 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2197 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2198 Undefined symbols may not have a type.
2199 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2201 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2203 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2204 bfd_link_info. Report shared, PIE or PDE object based on
2206 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2207 (elf_x86_64_relocate_section): Likewise.
2209 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2211 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2212 for function symbols.
2213 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2215 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2217 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2218 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2219 is set on any input relocatable file.
2220 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2222 2017-08-23 Alan Modra <amodra@gmail.com>
2225 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2226 ensure_undefweak_dynamic. Handle undefined too.
2227 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2228 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2229 (allocate_dynrelocs): Discard undefined non-default visibility
2230 relocs first. Make undefined syms dynamic. Tidy goto.
2232 2017-08-21 Alan Modra <amodra@gmail.com>
2233 H.J. Lu <hongjiu.lu@intel.com>
2236 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2237 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2239 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2242 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2243 undefined weak symbols.
2245 2017-08-18 Nick Clifton <nickc@redhat.com>
2248 * tekhex.c (getsym): Fix check for source pointer walking off the
2249 end of the input buffer.
2251 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2254 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2255 relocations in debug sections, change abort to _bfd_error_handler.
2257 2017-08-14 Nick Clifton <nickc@redhat.com>
2260 * elf.c (setup_group): Check for an empty or very small group
2262 * po/bfd.pot: Regenerate.
2264 2017-08-14 Alan Modra <amodra@gmail.com>
2267 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2268 alignment padding here.
2269 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2270 in a reverse pass over sections.
2272 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2275 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2276 for @plt suffixes first.
2277 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2279 2017-08-08 Nick Clifton <nickc@redhat.com>
2282 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2283 small section lengths.
2284 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2286 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2287 there is enough data present in the note.
2289 2017-08-08 Alan Modra <amodra@gmail.com>
2292 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2293 got.refcount for GOTOFF relocs, just create .got section.
2295 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2297 * elflink.c (elf_link_add_object_symbols): Move common symbol
2298 check after bed->common_definition.
2300 2017-08-07 Alan Modra <amodra@gmail.com>
2303 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2304 needed to define various dynamic tags have been discarded.
2306 2017-08-07 Nick Clifton <nickc@redhat.com>
2309 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2310 has not been set then use the bfd returned by
2311 _bfd_elf_link_setup_gnu_properties. If that is null then search
2312 through all the input bfds selecting the first normal, ELF format
2314 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2316 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2318 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2320 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2321 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2322 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2323 (elf_i386_link_check_relocs): New function.
2324 (bfd_elf32_bfd_link_check_relocs): New.
2325 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2327 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2328 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2329 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2330 (elf_x86_64_link_check_relocs): New function.
2331 (bfd_elf64_bfd_link_check_relocs): New.
2332 (bfd_elf32_bfd_link_check_relocs): Likewise.
2334 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2337 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2338 as undefined for --no-define-common.
2340 2017-08-05 Alan Modra <amodra@gmail.com>
2342 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2343 hppa_link_hash_table.
2345 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2347 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2348 entries for sysregs with negative indices.
2350 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2352 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2353 isn't the S/390 specific elf data.
2354 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2356 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2358 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2359 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2360 [R_RISCV_ADD16]: Likewise.
2361 [R_RISCV_ADD32]: Likewise.
2362 [R_RISCV_ADD64]: Likewise.
2363 [R_RISCV_SUB6]: Likewise.
2364 [R_RISCV_SUB8]: Likewise.
2365 [R_RISCV_SUB16]: Likewise.
2366 [R_RISCV_SUB32]: Likewise.
2367 [R_RISCV_SUB64]: Likewise.
2369 2017-07-31 Alan Modra <amodra@gmail.com>
2371 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2372 without ld.so checks.
2374 2017-07-29 Alan Modra <amodra@gmail.com>
2377 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2378 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2379 (is_elfv2_localentry0): Test non_zero_localentry.
2380 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2382 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2384 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2385 pointer check for htab->elf.irelplt.
2386 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2388 2017-07-27 Nick Clifton <nickc@redhat.com>
2391 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2393 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2395 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2397 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2399 (evax_bfd_print_emh): Check for invalid string lengths.
2401 2017-07-25 Nick Clifton <nickc@redhat.com>
2403 * po/fr.po: Updated French translation.
2405 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2408 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2409 16-bit absolute branches into 10-bit pc-relative branches on the
2410 MSP430 as well as the MSP430X.
2412 2017-07-25 Alan Modra <amodra@gmail.com>
2414 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2415 (stub_eh_frame_size): New function.
2416 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2417 (group_sections): Init group tls_get_addr_opt_bctrl.
2418 (ppc64_elf_size_stubs): Update sizing and initialization of
2419 .eh_frame. Iteration over stubs via group list.
2420 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2421 (ppc64_elf_finish_dynamic_sections): Update finalization of
2424 2017-07-24 Nick Clifton <nickc@redhat.com>
2427 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2428 of the relocs to the canonicalize_one_reloc routine.
2429 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2430 for the _bfd_mach_o_canonicalize_one_reloc field.
2431 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2432 res_base parameter. Use to check for corrupt pair relocs.
2433 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2435 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2437 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2440 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2441 enough data in the record before attempting to parse it.
2442 (_bfd_vms_slurp_eeom): Likewise.
2444 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2445 (image_set_ptr): Likewise.
2446 (alpha_vms_slurp_relocs): Likewise.
2448 (alpha_vms_object_p): Check for a truncated record.
2450 2017-07-24 Nick Clifton <nickc@redhat.com>
2453 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2454 an unrecognized reloc and sets the bfd_error value.
2455 * libbfd.h: Regenerate.
2456 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2458 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2459 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2460 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2461 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2462 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2464 2017-07-23 Alan Modra <amodra@gmail.com>
2466 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2469 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2472 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2473 reloc_class_ifunc for ifunc symbols.
2475 2017-07-19 Nick Clifton <nickc@redhat.com>
2478 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2479 correct magic bytes at the start, set the error to wrong format
2480 and clear the format selector before returning NULL.
2482 2017-07-19 Nick Clifton <nickc@redhat.com>
2485 * coff-rs6000.c (_bfd_strntol): New function.
2486 (_bfd_strntoll): New function.
2487 (GET_VALUE_IN_FIELD): New macro.
2488 (EQ_VALUE_IN_FIELD): new macro.
2489 (_bfd_xcoff_slurp_armap): Use new macros.
2490 (_bfd_xcoff_archive_p): Likewise.
2491 (_bfd_xcoff_read_ar_hdr): Likewise.
2492 (_bfd_xcoff_openr_next_archived_file): Likewise.
2493 (_bfd_xcoff_stat_arch_elt): Likewise.
2494 * coff64-rs6000.c (_bfd_strntol): New function.
2495 (_bfd_strntoll): New function.
2496 (GET_VALUE_IN_FIELD): New macro.
2497 (xcoff64_slurp_armap): Use new macros.
2499 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2500 John Eric Martin <John.Martin@emmicro-us.com>
2502 * bfd-in2.h: Regenerate.
2503 * libbfd.h: Regenerate.
2504 * elf32-arc.c (JLI): Define.
2505 * reloc.c: Add JLI relocations.
2507 2017-07-18 Nick Clifton <nickc@redhat.com>
2510 * coff-sh.c: Fix spelling typos.
2511 * compress.c: Likewise.
2512 * cpu-pdp11.c: Likewise.
2513 * ecofflink.c: Likewise.
2514 * elf-m10300.c: Likewise.
2516 * elf32-arm.c: Likewise.
2517 * elf32-m68k.c: Likewise.
2518 * elf32-nds32.c: Likewise.
2519 * elf32-ppc.c: Likewise.
2520 * elf32-sh.c: Likewise.
2521 * elf32-v850.c: Likewise.
2522 * elf64-ppc.c: Likewise.
2523 * elf64-x86-64.c: Likewise.
2524 * elflink.c: Likewise.
2525 * elfnn-aarch64.c: Likewise.
2526 * elfxx-mips.c: Likewise.
2528 * sunos.c: Likewise.
2529 * vms-alpha.c: Likewise.
2530 * xcofflink.c: Likewise.
2532 2017-07-18 Nick Clifton <nickc@redhat.com>
2535 * coffcode.h (handle_COMDAT): Replace abort with an error message
2538 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2541 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2544 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2546 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2548 2017-07-16 Alan Modra <amodra@gmail.com>
2550 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2551 __tls_index GOT entries when using __tls_get_addr_opt stub.
2552 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2554 2017-07-12 Alan Modra <amodra@gmail.com>
2556 * po/es.po: Update from translationproject.org/latest/bfd/.
2557 * po/fi.po: Likewise.
2558 * po/fr.po: Likewise.
2559 * po/id.po: Likewise.
2560 * po/ja.po: Likewise.
2561 * po/ro.po: Likewise.
2562 * po/ru.po: Likewise.
2563 * po/sr.po: Likewise.
2564 * po/sv.po: Likewise.
2565 * po/tr.po: Likewise.
2566 * po/uk.po: Likewise.
2567 * po/vi.po: Likewise.
2568 * po/zh_CN.po: Likewise.
2569 * po/hr.po: New file from translationproject.org.
2570 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2571 * configure: Regenerate.
2573 2017-07-12 Nick Clifton <nickc@redhat.com>
2575 Fix compile time warnings using gcc 7.1.1.
2576 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2578 (elf_xtensa_get_gotplt_section): Increase length of got_name
2580 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2581 default return of FALSE.
2582 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2583 default return of FALSE.
2585 2017-07-12 Alan Modra <amodra@gmail.com>
2587 * binary.c (binary_set_section_contents): Don't print filepos in
2589 (coff_write_object_contents): Cast size_t for error message.
2590 (coff_slurp_line_table): Don't use bfd_vma symndx.
2591 (coff_slurp_reloc_table): Remove unneeded cast.
2592 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2594 (find_abstract_instance_name): Likewise.
2595 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2596 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2597 (elf32_arm_check_relocs): Make r_symndx an int.
2598 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2600 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2602 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2604 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2605 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2606 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2607 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2608 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2609 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2610 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2611 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2612 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2613 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2614 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2615 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2616 and use %lu for error message.
2617 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2618 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2621 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2623 (elf32_arm_final_link_relocate): Likewise.
2624 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2625 * coffcode.h (styp_to_sec_flags): Likewise.
2626 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2627 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2628 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2629 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2630 (elf32_bfin_merge_private_bfd_data): Likewise.
2631 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2632 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2633 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2634 (i370_elf_relocate_section): Likewise.
2635 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2636 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2637 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2638 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2639 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2640 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2641 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2642 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2643 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2644 * ieee.c (ieee_write_id, read_id): Likewise.
2645 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2646 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2647 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2648 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2649 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2650 * stabs.c (_bfd_link_section_stabs): Likewise.
2652 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2654 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2655 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2656 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2657 * coff-sh.c (sh_relax_section): Likewise.
2658 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2659 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2660 * coffcode.h (coff_slurp_reloc_table): Likewise.
2661 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2662 (_bfd_coff_read_string_table): Likewise.
2663 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2664 * compress.c (bfd_get_full_section_contents): Likewise.
2665 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2666 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2667 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2668 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2669 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2670 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2671 (elf32_arm_write_section): Likewise.
2672 * elf32-bfin.c (bfin_relocate_section): Likewise.
2673 (bfinfdpic_relocate_section): Likewise.
2674 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2675 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2676 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2677 (elf_i386_relocate_section): Likewise.
2678 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2679 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2680 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2681 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2682 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2683 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2684 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2685 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2686 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2687 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2688 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2689 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2690 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2691 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2692 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2693 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2694 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2695 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2696 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2697 * elf32-sh.c (sh_elf_relax_section): Likewise.
2698 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2699 (sh_elf_relocate_section): Likewise.
2700 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2701 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2702 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2703 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2704 * elf32-v850.c (v850_elf_relax_section): Likewise.
2705 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2706 (elf_vax_relocate_section): Likewise.
2707 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2708 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2709 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2710 (do_fix_for_relocatable_link): Likewise.
2711 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2712 (elf64_alpha_relax_with_lituse): Likewise.
2713 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2714 (elf_hppa_final_link_relocate): Likewise.
2715 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2716 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2717 (elf64_vms_link_add_object_symbols): Likewise.
2718 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2719 (mmix_final_link_relocate): Likewise.
2720 * elf64-s390.c (invalid_tls_insn): Likewise.
2721 (elf_s390_relocate_section): Likewise.
2722 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2723 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2724 (elf_x86_64_relocate_section): Likewise.
2725 * elfcode.h (elf_slurp_symbol_table): Likewise.
2726 * elfcore.h (elf_core_file_p): Likewise.
2727 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2728 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2729 (elfNN_aarch64_relocate_section): Likewise.
2730 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2731 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2732 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2733 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2734 (_bfd_mips_elf_relocate_section): Likewise.
2735 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2736 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2737 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2738 * ieee.c (ieee_slurp_external_symbols): Likewise.
2739 * ihex.c (ihex_write_object_content): Likewise.
2740 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2741 * merge.c (_bfd_merged_section_offset): Likewise.
2742 * mmo.c (mmo_write_loc_chunk): Likewise.
2743 (mmo_write_object_contents): Likewise.
2744 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2745 * stabs.c (_bfd_link_section_stabs): Likewise.
2746 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2748 2017-07-11 Alan Modra <amodra@gmail.com>
2750 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2752 2017-07-11 Alan Modra <amodra@gmail.com>
2754 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2755 instruction" error using _bfd_error_handler, not einfo.
2757 2017-07-10 Nick Clifton <nickc@redhat.com>
2759 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2760 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2762 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2764 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2766 2017-07-07 Alan Modra <amodra@gmail.com>
2768 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2770 2017-07-07 Alan Modra <amodra@gmail.com>
2772 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2773 as long long. Move code replacing "ll" with "I64", and simplify.
2775 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2777 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2780 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2782 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2784 (line_info_add_file_name): Likewise.
2785 (decode_line_info): Likewise.
2787 2017-07-04 Tristan Gingold <gingold@adacore.com>
2789 * version.m4: Bump version to 2.29.51
2790 * configure: Regenerate.
2792 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2794 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2795 sanity check at the head of this function.
2797 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2799 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2800 dwarf_line_str_size.
2801 (struct attr_abbrev): Add field implicit_const.
2802 (dwarf_debug_sections): Add .debug_line_str.
2803 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2804 (dwarf_debug_section_assert): Add static assertion.
2805 (read_indirect_line_string): New.
2806 (read_abbrevs): Support DW_FORM_implicit_const.
2807 (is_str_attr): Support DW_FORM_line_strp.
2808 (read_attribute_value): Support DW_FORM_line_strp and
2809 DW_FORM_implicit_const.
2810 (read_attribute): Support DW_FORM_implicit_const.
2811 (line_info_add_include_dir, line_info_add_include_dir_stub):
2812 (line_info_add_file_name, read_formatted_entries): New.
2813 (decode_line_info, parse_comp_unit): Support DWARF 5.
2814 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2816 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2818 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2819 abort statement that was put for symbols that are not dynamic.
2821 2017-07-03 Tristan Gingold <gingold@adacore.com>
2823 * po/bfd.pot: Regenerate
2825 2017-07-03 Alan Modra <amodra@gmail.com>
2827 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2828 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2829 * elf.c (setup_group): Use "Lx" to print sh_size.
2830 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2831 unknown section type in hex.
2832 (copy_special_section_fields): Style fix.
2833 (bfd_section_from_shdr): Correct format for sh_link. Use a
2834 common error message for all the variants of unrecognized
2836 (assign_file_positions_for_load_sections): Use "Lx" for lma
2837 adjust error message.
2838 (assign_file_positions_for_non_load_sections): Formatting.
2839 (rewrite_elf_program_header): Formatting. Use "Lx" for
2840 bfd_vma values in error messages.
2841 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2842 ELF_R_SYM value to type expected by format.
2843 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2845 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2846 (elf_link_input_bfd): Use "Lx" for r_info.
2847 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2849 2017-07-03 Alan Modra <amodra@gmail.com>
2851 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2852 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2853 Microsoft C library variant of long long format specifier.
2854 (PRINT20): Cast value to bfd_uint64_t not long long.
2855 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2856 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2857 long long. Don't cast to bfd_vma.
2858 * elf32-score.c (score3_bfd_getl48): Likewise.
2859 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2861 2017-07-03 Alan Modra <amodra@gmail.com>
2863 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2865 (bfd_elf_print_symbol): Don't cast symbol->flags.
2866 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2867 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2868 _bfd_error_handler argument order.
2869 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2871 2017-07-03 Alan Modra <amodra@gmail.com>
2873 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2874 AC_TYPE_LONG_DOUBLE.
2875 * configure: Regenerate.
2876 * config.in: Regenerate.
2878 2017-06-29 Andrew Waterman <andrew@sifive.com>
2880 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2883 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2885 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2886 unless it is undefined weak.
2887 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2888 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2890 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2891 is not dynamic in PIC, abort.
2893 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2896 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2897 undefined weak symbols into dynamic.
2898 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2899 relocation for non-dynamic symbols.
2900 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2902 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2904 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2905 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2906 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2907 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2908 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2911 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2913 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2914 (elfcore_write_s390_gs_bc): Likewise.
2915 * elf.c (elfcore_grok_s390_gs_cb): New function.
2916 (elfcore_grok_s390_gs_bc): New function.
2917 (elfcore_grok_note): Call them.
2918 (elfcore_write_s390_gs_cb): New function.
2919 (elfcore_write_s390_gs_bc): New function.
2920 (elfcore_write_register_note): Call them.
2922 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2924 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2925 bfd_get_file_size. Check archive element size.
2926 (_bfd_generic_get_section_contents_in_window): Likewise.
2928 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2930 * bfd-in2.h: Regenerated.
2931 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2932 (bfd_get_file_size): Likewise.
2934 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2935 Matthew Fortune <matthew.fortune@imgtec.com>
2937 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2938 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2939 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2940 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2942 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2943 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2944 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2945 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2946 `bfd_mach_mips_interaptiv_mr2' entries.
2947 * bfd-in2.h: Regenerate.
2949 2017-06-27 Nick Clifton <nickc@redhat.com>
2951 * tekhex.c (pass_over): Revert accidental conversion of a local
2952 array to a static array.
2954 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2957 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2958 reloc addend if necessary. Adjust diff only if
2959 shrinked_insn_address < end_address.
2961 2017-06-27 Alan Modra <amodra@gmail.com>
2964 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2965 (_bfd_generic_get_section_contents_in_window): Likewise.
2967 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2969 * elfnn-riscv.c (perform_relocation): Support the new
2970 R_RISCV_32_PCREL relocation.
2971 (riscv_elf_relocate_section): Likewise.
2972 * elfxx-riscv.c (howto_table): Likewise.
2973 (riscv_reloc_map): Likewise.
2974 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2975 * libbfd.h: Regenerate.
2977 2017-06-27 Alan Modra <amodra@gmail.com>
2980 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2981 Use unsigned file pointer type, and remove cast.
2982 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2983 Add "count", not "sz".
2985 2017-06-26 Pedro Alves <palves@redhat.com>
2988 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2991 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2994 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2997 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2999 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
3000 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
3001 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
3002 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
3003 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
3005 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
3008 * compress.c (bfd_get_full_section_contents): Don't check the
3010 * libbfd.c (_bfd_generic_get_section_contents): Check for and
3011 reject a section whose size + offset is greater than the size
3013 (_bfd_generic_get_section_contents_in_window): Likewise.
3015 2017-06-26 Nick Clifton <nickc@redhat.com>
3018 * tekhex.c (getvalue): Check for the source pointer exceeding the
3019 end pointer before the first byte is read.
3021 2017-06-26 Nick Clifton <nickc@redhat.com>
3024 * opncls.c (get_build_id): Check that the section is big enough
3025 to contain the whole note.
3026 * compress.c (bfd_get_full_section_contents): Check for and reject
3027 a section whose size is greater than the size of the entire file.
3028 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
3029 contain a notes section.
3031 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3033 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
3035 (elf_s390_modify_segment_map): Likewise.
3036 (bfd_elf_s390_set_options): Lisewise.
3038 2017-06-26 Alan Modra <amodra@gmail.com>
3040 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
3042 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
3043 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
3044 .preinit_array on --just-syms bfds.
3045 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
3046 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
3047 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
3049 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
3051 * elf.c (find_link): Bounds check "hint".
3053 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
3055 * elf32-arm.c (using_thumb_only): Update list of architectures in
3056 BFD_ASSERT for which the logic is valid.
3057 (using_thumb2_bl): Likewise.
3058 (using_thumb2): Likewise and return true for ARMv8-R.
3059 (arch_has_arm_nop): Likewise.
3060 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3061 merging logic. Update commentis for value 15 of v8m_baseline,
3062 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3063 merging of value 15 of Tag_CPU_arch.
3065 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3067 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3068 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3069 * bfd-in2.h: Regenerate.
3071 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3073 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3074 the error_alignment label forward. Properly align program
3075 property note section.
3077 2017-06-22 Eric Christopher <echristo@gmail.com>
3079 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3080 abs to fix a truncation warning.
3082 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3084 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3085 local undefined weak symbol to 0.
3086 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3088 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3090 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3091 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3092 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3093 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3094 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3095 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3096 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3097 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3099 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3101 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3102 (elf_i386_lazy_ibt_plt_entry): Likewise.
3103 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3104 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3105 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3106 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3107 (elf_i386_lazy_plt_layout): Likewise.
3108 (elf_i386_non_lazy_plt_layout): Likewise.
3109 (elf_i386_link_hash_entry): Add plt_second.
3110 (elf_i386_link_hash_table): Add plt_second and
3111 plt_second_eh_frame.
3112 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3113 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3114 the second PLT. Check the second PLT.
3115 (elf_i386_relocate_section): Use the second PLT to resolve
3116 PLT reference if needed.
3117 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3119 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3120 second PLT. Generate unwind info for the second PLT.
3121 (elf_i386_plt_type): Add plt_second.
3122 (elf_i386_get_synthetic_symtab): Support the second PLT.
3123 (elf_i386_parse_gnu_properties): Support
3124 GNU_PROPERTY_X86_FEATURE_1_AND.
3125 (elf_i386_merge_gnu_properties): Support
3126 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3127 on GNU_PROPERTY_X86_FEATURE_1_IBT
3128 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3129 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3130 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3131 is set on all relocatable inputs.
3132 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3133 (elf_x32_lazy_ibt_plt_entry): Likewise.
3134 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3135 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3136 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3137 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3138 (elf_x86_64_lazy_ibt_plt): Likewise.
3139 (elf_x32_lazy_ibt_plt): Likewise.
3140 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3141 (elf_x32_non_lazy_ibt_plt): Likewise.
3142 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3143 (elf_x86_64_parse_gnu_properties): Support
3144 GNU_PROPERTY_X86_FEATURE_1_AND.
3145 (elf_x86_64_merge_gnu_properties): Support
3146 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3147 on GNU_PROPERTY_X86_FEATURE_1_IBT
3148 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3149 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3150 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3151 is set on all relocatable inputs.
3153 2017-06-22 Nick Clifton <nickc@redhat.com>
3156 * som.c (setup_sections): NUL terminate the space_strings buffer.
3157 Check that the space.name field does not index beyond the end of
3158 the space_strings buffer.
3160 2017-06-21 Nick Clifton <nickc@redhat.com>
3163 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3165 2017-06-21 Nick Clifton <nickc@redhat.com>
3168 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3169 type of the size parameter.
3170 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3171 length of the counted string.
3172 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3173 (_bfd_vms_save_counted_string): Likewise.
3174 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3175 _bfd_vms_save_counted_string.
3176 (_bfd_vms_slurp_ehdr): Likewise.
3177 (_bfd_vms_slurp_egsd): Likewise.
3178 (Parse_module): Likewise.
3180 2017-06-21 Alan Modra <amodra@gmail.com>
3182 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3183 calls before tocsave calls.
3184 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3187 2017-06-21 Nick Clifton <nickc@redhat.com>
3190 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3191 bfd_get_full_section_contents returns no contents.
3193 2017-06-21 Nick Clifton <nickc@redhat.com>
3196 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3199 2017-06-21 Nick Clifton <nickc@redhat.com>
3202 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3204 (image_set_ptr): Likewise.
3205 (alpha_vms_fix_sec_rel): Likewise.
3206 (alpha_vms_slurp_relocs): Likewise.
3208 2017-06-21 Nick Clifton <nickc@redhat.com>
3211 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3213 (ieee_archive_p): Likewise.
3214 (ieee_object_p): Likewise.
3216 2017-06-21 Nick Clifton <nickc@redhat.com>
3219 * elf.c (setup_group): Zero the group section pointer list after
3220 allocation so that loops can be caught. Check for NULL pointers
3221 when processing a group list.
3223 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3225 * elf-s390.h: New file.
3226 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3228 (elf_s390_additional_program_headers): New function.
3229 (elf_s390_modify_segment_map): New function.
3230 (bfd_elf_s390_set_options): New function.
3231 (elf_backend_additional_program_headers)
3232 (elf_backend_modify_segment_map): Add macro definitions.
3234 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3237 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3238 the DYNAMIC bit instead of bfd_count_sections.
3240 2017-06-19 Nick Clifton <nickc@redhat.com>
3243 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3245 (evax_bfd_print_eeom): Likewise.
3246 (evax_bfd_print_egsd): Check for an overlarge record length.
3247 (evax_bfd_print_etir): Likewise.
3249 2017-06-19 Nick Clifton <nickc@redhat.com>
3252 * libieee.h (struct common_header_type): Add end_p field.
3253 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3255 (read_id): Check for a length that exceeds the remaining bytes in
3257 (ieee_seek): Initialise end_p.
3258 (ieee_archive_p): Likewise.
3259 (ieee_object_p): Likewise.
3261 2017-06-19 Nick Clifton <nickc@redhat.com>
3264 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3265 before reading the EIHS structure entries.
3267 2017-06-19 Nick Clifton <nickc@redhat.com>
3270 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3271 gsd_size. Check that there are enough bytes remaining to read the
3272 type and size of the next egsd. Check that the size of the egsd
3273 does not exceed the size of the record.
3275 2017-06-19 Alan Modra <amodra@gmail.com>
3277 * config.bfd: Correct targ_underscore for cris.
3279 2017-06-18 Alan Modra <amodra@gmail.com>
3281 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3282 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3284 2017-06-16 Nick Clifton <nickc@redhat.com>
3286 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3287 bucketlist is empty because there are no symbols to add to the
3290 2017-06-16 Alan Modra <amodra@gmail.com>
3296 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3297 (BFD_JUMP_TABLE_LINK): Likewise.
3298 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3299 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3300 (bfd_elf_define_start_stop): New function.
3301 * linker.c (bfd_generic_define_start_stop): New function.
3302 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3304 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3305 * aout-target.h (MY_bfd_define_start_stop): Define.
3306 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3307 * binary.c (binary_bfd_define_start_stop): Define.
3308 * bout.c (b_out_bfd_define_start_stop): Define.
3309 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3310 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3311 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3312 * coffcode.h (coff_bfd_define_start_stop): Define.
3313 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3314 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3315 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3316 * ieee.c (ieee_bfd_define_start_stop): Define.
3317 * ihex.c (ihex_bfd_define_start_stop): Define.
3318 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3319 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3320 * mmo.c (mmo_bfd_define_start_stop): Define.
3321 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3322 * oasys.c (oasys_bfd_define_start_stop): Define.
3323 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3324 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3325 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3326 * som.c (som_bfd_define_start_stop): Define.
3327 * srec.c (srec_bfd_define_start_stop): Define.
3328 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3329 * versados.c (versados_bfd_define_start_stop): Define.
3330 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3331 (alpha_vms_bfd_define_start_stop): Define.
3332 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3333 * bfd-in2.h: Regenerate.
3334 * libbfd.h: Regenerate.
3336 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3338 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3339 SYMBOL_REFERENCES_LOCAL.
3341 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3344 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3345 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3346 runtime for if there needs copy relocation elimination.
3347 (need_copy_relocation_p): New function. Return true for symbol with
3348 pc-relative references and if it's against read-only sections.
3349 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3350 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3351 that are related with accessing external objects.
3352 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3353 in elfNN_aarch64_check_relocs.
3355 2017-06-15 Nick Clifton <nickc@redhat.com>
3358 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3361 (ieee_archive_p): Likewise.
3363 2017-06-15 Nick Clifton <nickc@redhat.com>
3366 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3368 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3370 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3371 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3372 keep both windowed and call0 ABI PLT definitions.
3373 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3374 elf_xtensa_*_plt_entry endex.
3375 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3377 2017-06-14 Nick Clifton <nickc@redhat.com>
3380 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3383 2017-06-14 Nick Clifton <nickc@redhat.com>
3386 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3387 maximum value for the ascic pointer. Check that name processing
3388 does not read beyond this value.
3389 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3392 2017-06-14 Nick Clifton <nickc@redhat.com>
3395 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3396 (process_otr): Check for an invalid offset in the otr structure.
3398 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3400 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3402 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3408 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3409 vtable field to a union.
3410 (_bfd_elf_is_start_stop): Removed.
3411 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3412 __start_SECNAME and __stop_SECNAME symbols.
3413 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3414 * elflink.c (_bfd_elf_is_start_stop): Removed.
3415 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3416 _bfd_elf_is_start_stop.
3417 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3418 __stop_SECNAME symbols. Updated.
3419 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3420 (bfd_elf_gc_record_vtinherit): Likewise.
3421 (bfd_elf_gc_record_vtentry): Likewise.
3423 2017-06-13 Nick Clifton <nickc@redhat.com>
3426 * elflink.c (elf_link_adjust_relocs): Generate an error when
3427 encountering a reloc against a symbol removed by garbage
3430 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3432 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3433 to merge_gnu_properties.
3434 * elf-properties.c (elf_merge_gnu_properties): Add struct
3435 bfd_link_info * and pass it to merge_gnu_properties.
3436 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3437 and pass it to elf_merge_gnu_properties.
3438 (_bfd_elf_link_setup_gnu_properties): Pass info to
3439 elf_merge_gnu_property_list.
3440 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3442 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3444 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3447 * binary.c (binary_set_section_contents): Scale lma by octets
3448 per byte to set filepos.
3450 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3452 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3455 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3457 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3460 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3462 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3463 patched section contents for TLS IE reloc.
3464 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3466 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3468 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3469 RELOC_FOR_GLOBAL_SYMBOL macro.
3471 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3473 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3476 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3478 * config/tc-arc.c (md_undefined_symbol): Changed.
3479 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3481 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3483 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3486 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3488 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3489 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3491 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3493 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3496 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3498 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3499 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3500 is non-zero. Add clarifying comments.
3502 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3504 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3505 name. Use local IFUNC symbol name string to report unsupported
3506 non-PIC call to IFUNC function.
3507 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3508 when generating R_386_IRELATIVE relocation.
3509 (elf_i386_finish_dynamic_symbol): Likewise.
3510 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3512 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3513 when generating R_X86_64_IRELATIVE relocation.
3514 (elf_x86_64_finish_dynamic_symbol): Likewise.
3516 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3518 * elf.c (setup_group): Make sure BFD sections are created for all
3519 group sections in the input file when processing SHF_GROUP
3521 (bfd_section_from_shdr): Avoid duplicating logic already
3522 implemented in `setup_group'.
3524 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3527 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3528 if the hint address is zero.
3530 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3533 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3534 ELF_COMMON_DEF_P for common symbols.
3536 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3538 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3539 SEC_GROUP sections as SEC_EXCLUDE.
3540 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3541 (assign_section_numbers): Use resolve_section_groups flag instead
3542 of relocatable link type.
3543 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3544 flag instead of checking the final_link flag for part of the
3545 checks in here. Fix white space as a result.
3546 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3547 instead of relocatable link type.
3548 (bfd_elf_final_link): Likewise.
3550 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3552 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3554 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3555 (s3_bfd_score_elf_check_relocs): Likewise.
3556 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3557 (score_elf_final_link_relocate): Likewise.
3558 (s7_bfd_score_elf_check_relocs): Likewise.
3560 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3562 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3565 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3567 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3568 from `reloc_count' rather than decrementing it.
3569 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3570 `reloc_count' by `int_rels_per_ext_rel'.
3571 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3572 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3573 entry determination.
3574 (s3_bfd_score_elf_check_relocs): Likewise.
3575 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3576 (s7_bfd_score_elf_relocate_section): Likewise.
3577 (s7_bfd_score_elf_check_relocs): Likewise.
3578 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3579 prototype and function.
3580 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3581 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3582 triple rather than once the sum of REL and RELA relocation entry
3584 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3585 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3586 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3587 storage allocation size determination.
3588 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3589 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3590 by `int_rels_per_ext_rel' for last relocation entry
3592 (bfd_elf_final_link): Do not multiply `reloc_count' by
3593 `int_rels_per_ext_rel' for internal relocation storage
3594 allocation size determination.
3595 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3596 `int_rels_per_ext_rel' for last relocation entry determination.
3597 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3598 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3599 (_bfd_mips_elf_relocate_section): Likewise.
3601 2017-06-05 Alan Modra <amodra@gmail.com>
3604 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3606 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3608 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3609 determine structure sizes.
3610 (elfcore_grok_freebsd_prstatus): Likewise.
3612 2017-06-01 Alan Modra <amodra@gmail.com>
3614 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3615 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3617 (is_elfv2_localentry0): New function.
3618 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3619 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3620 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3621 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3622 optimized localentry:0 stubs.
3623 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3624 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3626 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3628 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3630 2017-05-30 Casey Smith <clegg89@gmail.com>
3633 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3634 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3636 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3638 * cpu-arc.c (arc_compatible): New function.
3640 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3642 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3644 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3647 * bfdio.c (bfd_get_file_size): New function.
3648 * bfd-in2.h: Regenerated.
3650 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3652 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3655 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3657 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3658 dynobj instead of htab->elf.dynobj.
3660 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3662 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3664 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3665 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3666 actual number of internal relocations retrieved. Adjust
3667 function description.
3668 (bfd_elf64_canonicalize_reloc): Remove macro.
3669 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3671 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3673 * archures.c (bfd_mach_sparc_v9m8): Define.
3674 (bfd_mach_sparc_v8plusm8): Likewise.
3675 (bfd_mach_sparc_v9_p): Adjust to M8.
3676 (bfd_mach_sparc_64bit_p): Likewise.
3677 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3678 bfd_mach_sparc_v8plusm8.
3679 * bfd-in2.h: Regenerated.
3680 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3682 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3683 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3684 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3686 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3687 bfd_mach_sparc_v8plusm8.
3689 2017-05-19 Alan Modra <amodra@gmail.com>
3691 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3692 debug and special sections when no non-note alloc sections in an
3695 2017-05-18 Alan Modra <amodra@gmail.com>
3697 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3698 * elf-m10300.c: Likewise.
3700 * elf32-arc.c: Likewise.
3701 * elf32-bfin.c: Likewise.
3702 * elf32-m68k.c: Likewise.
3703 * elf32-nds32.c: Likewise.
3704 * elf32-tilepro.c: Likewise.
3705 * elflink.c: Likewise.
3706 * elfnn-aarch64.c: Likewise.
3707 * elfnn-riscv.c: Likewise.
3708 * elfxx-tilegx.c: Likewise.
3709 * mach-o.c: Likewise.
3710 * peXXigen.c: Likewise.
3711 * vms-alpha.c: Likewise.
3712 * vms-lib.c: Likewise.
3714 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3717 * elflink.c (elf_gc_mark_debug_section): New function.
3718 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3719 referenced by kept debug sections.
3721 2017-05-16 Alan Modra <amodra@gmail.com>
3723 * elf-m10300.c: Rename occurrences of non_ir_ref.
3724 * elf32-arm.c: Likewise.
3725 * elf32-bfin.c: Likewise.
3726 * elf32-cr16.c: Likewise.
3727 * elf32-cris.c: Likewise.
3728 * elf32-d10v.c: Likewise.
3729 * elf32-dlx.c: Likewise.
3730 * elf32-fr30.c: Likewise.
3731 * elf32-frv.c: Likewise.
3732 * elf32-hppa.c: Likewise.
3733 * elf32-i370.c: Likewise.
3734 * elf32-i386.c: Likewise.
3735 * elf32-iq2000.c: Likewise.
3736 * elf32-lm32.c: Likewise.
3737 * elf32-m32c.c: Likewise.
3738 * elf32-m32r.c: Likewise.
3739 * elf32-m68hc1x.c: Likewise.
3740 * elf32-m68k.c: Likewise.
3741 * elf32-mcore.c: Likewise.
3742 * elf32-metag.c: Likewise.
3743 * elf32-microblaze.c: Likewise.
3744 * elf32-moxie.c: Likewise.
3745 * elf32-msp430.c: Likewise.
3746 * elf32-mt.c: Likewise.
3747 * elf32-nios2.c: Likewise.
3748 * elf32-or1k.c: Likewise.
3749 * elf32-ppc.c: Likewise.
3750 * elf32-rl78.c: Likewise.
3751 * elf32-s390.c: Likewise.
3752 * elf32-score.c: Likewise.
3753 * elf32-score7.c: Likewise.
3754 * elf32-sh.c: Likewise.
3755 * elf32-tic6x.c: Likewise.
3756 * elf32-tilepro.c: Likewise.
3757 * elf32-v850.c: Likewise.
3758 * elf32-vax.c: Likewise.
3759 * elf32-xstormy16.c: Likewise.
3760 * elf32-xtensa.c: Likewise.
3761 * elf64-alpha.c: Likewise.
3762 * elf64-hppa.c: Likewise.
3763 * elf64-ia64-vms.c: Likewise.
3764 * elf64-mmix.c: Likewise.
3765 * elf64-ppc.c: Likewise.
3766 * elf64-s390.c: Likewise.
3767 * elf64-sh64.c: Likewise.
3768 * elf64-x86-64.c: Likewise.
3769 * elflink.c: Likewise.
3770 * elfnn-aarch64.c: Likewise.
3771 * elfnn-ia64.c: Likewise.
3772 * elfnn-riscv.c: Likewise.
3773 * elfxx-mips.c: Likewise.
3774 * elfxx-sparc.c: Likewise.
3775 * elfxx-tilegx.c: Likewise.
3776 * linker.c: Likewise.
3778 2017-05-16 Alan Modra <amodra@gmail.com>
3780 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3781 * elflink.c (elf_link_add_object_symbols): Update to use
3783 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3785 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3787 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3789 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3791 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3793 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3794 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3796 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3798 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3800 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3802 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3803 to plt_second/plt_second_eh_frame.
3804 (elf_x86_64_link_hash_newfunc): Updated.
3805 (elf_x86_64_allocate_dynrelocs): Likewise.
3806 (elf_x86_64_size_dynamic_sections): Likewise.
3807 (elf_x86_64_relocate_section): Likewise.
3808 (elf_x86_64_finish_dynamic_symbol): Likewise.
3809 (elf_x86_64_finish_dynamic_sections): Likewise.
3810 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3811 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3813 (elf_backend_setup_gnu_properties): Updated. Create the
3814 .plt.sec section instead of the .plt.sec section.
3816 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3818 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3819 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3820 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3822 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3824 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3825 (bfd_elf64_set_reloc): Define.
3826 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3828 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3830 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3831 (struct bfd_target): New field _bfd_set_reloc.
3832 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3833 * reloc.c (_bfd_generic_set_reloc): New function.
3834 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3835 * nlm-target.h (nlm_set_reloc): Likewise.
3836 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3837 * aout-tic30.c (MY_set_reloc): Likewise.
3838 * aout-target.h (MY_set_reloc): Likewise.
3839 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3840 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3841 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3842 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3843 * aout-adobe.c (aout_32_set_reloc): Likewise.
3844 * bout.c (b_out_set_reloc): Likewise.
3845 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3846 * i386os9k.c (aout_32_set_reloc): Likewise.
3847 * ieee.c (ieee_set_reloc): Likewise.
3848 * oasys.c (oasys_set_reloc): Likewise.
3849 * som.c (som_set_reloc): Likewise.
3850 * versados.c (versados_set_reloc): Likewise.
3851 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3852 _bfd_generic_set_reloc.
3853 (rs6000_xcoff64_aix_vec): LIkewise.
3854 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3855 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3856 * i386msdos.c (msdos_set_reloc): Define to
3857 _bfd_norelocs_set_reloc.
3858 * elfcode.h (elf_set_reloc): Define.
3859 * bfd-in2.h: Regenerated.
3861 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3864 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3865 for IFUNC function address.
3867 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3869 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3870 (CONFLICT_LIST): Likewise.
3871 (opcode/arc-attrs.h): Include.
3872 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3873 (arc_extract_features): New file.
3874 (arc_stralloc): Likewise.
3875 (arc_elf_merge_attributes): Likewise.
3876 (arc_elf_merge_private_bfd_data): Use object attributes.
3877 (bfd_arc_get_mach_from_attributes): New function.
3878 (arc_elf_object_p): Use object attributes.
3879 (arc_elf_final_write_processing): Likewise.
3880 (elf32_arc_obj_attrs_arg_type): New function.
3881 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3882 (elf32_arc_section_from_shdr): Likewise.
3883 (elf_backend_obj_attrs_vendor): Define.
3884 (elf_backend_obj_attrs_section): Likewise.
3885 (elf_backend_obj_attrs_arg_type): Likewise.
3886 (elf_backend_obj_attrs_section_type): Likewise.
3887 (elf_backend_obj_attrs_handle_unknown): Likewise.
3888 (elf_backend_section_from_shdr): Likewise.
3890 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3893 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3894 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3895 and the destination is a Thumb symbol.
3897 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3899 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3900 initializer to silence GCC 4.2.
3901 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3903 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3905 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3906 (LAZY_PLT_ENTRY_SIZE): This.
3907 (NON_LAZY_PLT_ENTRY_SIZE): New.
3908 (elf_x86_64_plt0_entry): Renamed to ...
3909 (elf_x86_64_lazy_plt0_entry): This.
3910 (elf_x86_64_plt_entry): Renamed to ...
3911 (elf_x86_64_lazy_plt_entry): This.
3912 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3913 (elf_x86_64_lazy_bnd_plt0_entry): This.
3914 (elf_x86_64_legacy_plt_entry): Removed.
3915 (elf_x86_64_bnd_plt_entry): Renamed to ...
3916 (elf_x86_64_lazy_bnd_plt_entry): This.
3917 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3918 (elf_x86_64_non_lazy_plt_entry): This.
3919 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3920 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3921 (elf_x86_64_eh_frame_plt): Renamed to ...
3922 (elf_x86_64_eh_frame_lazy_plt): This.
3923 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3924 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3925 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3926 (elf_x86_64_eh_frame_non_lazy_plt): This.
3927 (elf_x86_64_lazy_plt_layout): New.
3928 (elf_x86_64_non_lazy_plt_layout): Likewise.
3929 (elf_x86_64_plt_layout): Likewise.
3930 (elf_x86_64_backend_data): Remove PLT layout information. Add
3931 os for target system.
3932 (GET_PLT_ENTRY_SIZE): Removed.
3933 (elf_x86_64_lazy_plt): New.
3934 (elf_x86_64_non_lazy_plt): Likewise.
3935 (elf_x86_64_lazy_bnd_plt): Likewise.
3936 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3937 (elf_x86-64_arch_bed): Updated.
3938 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3939 (elf_x86_64_create_dynamic_sections): Removed.
3940 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3941 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3942 (elf_x86-64_adjust_dynamic_symbol): Updated.
3943 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3944 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3945 size for PLT0 if there is no PLT0. Get plt_entry_size from
3946 non_lazy_plt for non-lazy PLT entries.
3947 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3948 from non_lazy_plt for non-lazy PLT entries.
3949 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3950 if there is no PLT0.
3951 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3952 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3953 entries with non-lazy PLT layout. Don't fill the second and third
3954 slots in the PLT entry if there is no PLT0.
3955 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3956 if there is no PLT0. Set sh_entsize on the .plt.got section.
3957 (compare_relocs): New.
3958 (elf_x86_64_plt_type): Likewise.
3959 (elf_x86_64_plt): Likewise.
3960 (elf_x86_64_nacl_plt): New. Forward declaration.
3961 (elf_x86_64_get_plt_sym_val): Removed.
3962 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3963 against all dynamic relocations.
3964 (elf_x86_64_link_setup_gnu_properties): New function.
3965 (elf_backend_create_dynamic_sections): Updated.
3966 (elf_backend_setup_gnu_properties): New.
3967 (elf_x86_64_nacl_plt): New.
3968 (elf_x86_64_nacl_arch_bed): Updated.
3970 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3972 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3973 (LAZY_PLT_ENTRY_SIZE): This.
3974 (NON_LAZY_PLT_ENTRY_SIZE): New.
3975 (elf_i386_plt0_entry): Renamed to ...
3976 (elf_i386_lazy_plt0_entry): This.
3977 (elf_i386_plt_entry): Renamed to ...
3978 (elf_i386_lazy_plt_entry): This.
3979 (elf_i386_pic_plt0_entry): Renamed to ...
3980 (elf_i386_pic_lazy_plt0_entry): This.
3981 (elf_i386_pic_plt_entry): Renamed to ...
3982 (elf_i386_pic_lazy_plt_entry): This.
3983 (elf_i386_got_plt_entry): Renamed to ...
3984 (elf_i386_non_lazy_plt_entry): This.
3985 (elf_i386_pic_got_plt_entry): Renamed to ...
3986 (elf_i386_pic_non_lazy_plt_entry): This.
3987 (elf_i386_eh_frame_plt): Renamed to ...
3988 (elf_i386_eh_frame_lazy_plt): This.
3989 (elf_i386_eh_frame_plt_got): Renamed to ...
3990 (elf_i386_eh_frame_non_lazy_plt): This.
3991 (elf_i386_plt_layout): Renamed to ...
3992 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3993 eh_frame_plt_got_size.
3994 (elf_i386_non_lazy_plt_layout): New.
3995 (elf_i386_plt_layout): Likewise.
3996 (elf_i386_non_lazy_plt): Likewise.
3997 (GET_PLT_ENTRY_SIZE): Removed.
3998 (elf_i386_plt): Renamed to ...
3999 (elf_i386_lazy_plt): This.
4000 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
4001 (elf_i386_arch_bed): Updated.
4002 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
4003 (elf_i386_create_dynamic_sections): Removed.
4004 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
4005 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
4006 (elf_i386_adjust_dynamic_symbol): Updated.
4007 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
4008 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
4009 size for PLT0 if there is no PLT0.
4010 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
4011 output section is discarded only if GOT isn't empty.
4012 (elf_i386_relocate_section): Updated. Properly get PLT index
4013 if there is no PLT0.
4014 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
4015 second and third slots in the PLT entry if there is no PLT0.
4016 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
4017 if there is no PLT0. Set sh_entsize on the .plt.got section.
4018 (elf_i386_nacl_plt): Forward declaration.
4019 (elf_i386_get_plt_sym_val): Removed.
4020 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
4021 against all dynamic relocations.
4022 (elf_i386_link_setup_gnu_properties): New function.
4023 (elf_backend_create_dynamic_sections): Updated.
4024 (elf_backend_setup_gnu_properties): New.
4025 (elf_i386_nacl_plt): Updated.
4026 (elf_i386_nacl_arch_bed): Likewise.
4027 (elf_i386_vxworks_arch_bed): Likewise.
4029 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
4031 * elflink.c (elf_output_implib): Remove executable flag from import
4033 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
4034 library is a relocatable object file.
4036 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
4039 * elf32-avr.c (avr_should_move_sym): New function.
4040 (avr_should_reduce_sym_size): Likewise.
4041 (avr_should_increase_sym_size): Likewise.
4042 (elf32_avr_relax_delete_bytes): Adjust symbol values
4043 and sizes by calling new functions.
4045 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
4047 * config.bfd (riscv32-*): Enable rv64.
4049 2017-05-02 Alan Modra <amodra@gmail.com>
4052 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
4053 rather than h->root.type == bfd_link_hash_new.
4054 (bfd_elf_record_link_assignment): Similarly, call
4055 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
4057 2017-04-29 Alan Modra <amodra@gmail.com>
4060 * reloc.c (reloc_offset_in_range): New function.
4061 (bfd_perform_relocation, bfd_install_relocation): Use it.
4062 (_bfd_final_link_relocate): Likewise.
4064 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4066 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4067 before using .plt.got.
4068 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4070 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4072 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4073 instead of "+=" to update 0.
4075 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4077 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4078 .plt.got section here.
4079 (elf_i386_check_relocs): Don't create the .plt.got section.
4080 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4081 the .plt.got and .plt.bnd sections here.
4082 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4085 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4087 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4089 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4090 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4091 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4092 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4095 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4097 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4099 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4100 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4101 the first relocatable ELF input with GNU properties.
4103 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4105 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4106 VxWorks for non-PIC.
4108 2017-04-27 Alan Modra <amodra@gmail.com>
4110 * elf-bfd.h (struct elf_backend_data): Make asection param of
4111 elf_backend_eh_frame_address_size const.
4112 (_bfd_elf_eh_frame_address_size): Likewise.
4113 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4114 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4115 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4116 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4117 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4118 (next_cie_fde_offset): Constify params.
4119 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4121 2017-04-27 Alan Modra <amodra@gmail.com>
4123 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4124 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4125 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4127 (offset_adjust): New function.
4128 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4129 (adjust_eh_frame_local_symbols): Likewise.
4130 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4131 after changing anything. Return true if anything changed.
4132 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4133 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4135 2017-04-27 Alan Modra <amodra@gmail.com>
4137 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4140 2017-04-27 Alan Modra <amodra@gmail.com>
4142 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4143 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4144 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4145 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4146 for undef and undefweak dyn_relocs.
4147 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4148 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4149 (allocate_got, allocate_dynrelocs): Likewise.
4150 (ppc64_elf_relocate_section): Likewise.
4152 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4154 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4155 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4156 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4157 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4159 2017-04-26 Nick Clifton <nickc@redhat.com>
4162 * reloc.c (bfd_perform_relocation): Check for a negative address
4165 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4168 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4170 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4171 (elf_backend_always_renumber_dynsyms): Define.
4172 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4173 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4174 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4175 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4177 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4179 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4181 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4182 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4183 sections have been created.
4185 2017-04-26 Nick Clifton <nickc@redhat.com>
4188 * compress.c (bfd_init_section_compress_status): Check the return
4189 value from bfd_malloc.
4191 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4193 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4194 no_finish_dynamic_symbol.
4195 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4197 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4198 weak symbol, don't make it dynamic.
4199 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4200 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4201 relocation for GOT reference.
4202 (elf_x86_64_finish_dynamic_symbol): Abort if
4203 no_finish_dynamic_symbol isn't 0.
4205 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4208 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4209 undefined weak symbol, don't make it dynamic.
4210 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4211 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4212 relocation for R_386_GOT32.
4214 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4217 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4219 2017-04-23 Alan Modra <amodra@gmail.com>
4222 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4223 * elf.c (lcomm_sym): New.
4224 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4225 * bfd-in2.h: Regenerate.
4227 2017-04-23 Alan Modra <amodra@gmail.com>
4230 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4231 parameters and comment.
4232 (_bfd_elf_get_reloc_section): Delete.
4233 (_bfd_elf_plt_get_reloc_section): Declare.
4234 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4235 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4237 (_bfd_elf_get_reloc_section): ..here. Delete.
4238 (assign_section_numbers): Call elf_get_reloc_section.
4239 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4240 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4242 2017-04-23 Alan Modra <amodra@gmail.com>
4245 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4248 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4251 * elf32-i386.c (elf_i386_link_hash_entry): Add
4252 no_finish_dynamic_symbol.
4253 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4254 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4255 symbol, don't make it dynamic in PIE.
4256 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4257 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4258 relocation for R_386_GOT32
4259 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4262 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4266 * elflink.c (elf_link_add_object_symbols): Require
4267 --no-dynamic-linker with -E/--dynamic-list when creating
4270 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4272 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4275 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4277 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4278 dynamic symbol sorting.
4280 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4283 * elflink.c (elf_link_add_object_symbols): Preserve
4284 dynamic_ref_after_ir_def when restoring the symbol table for
4285 unneeded dynamic object.
4287 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4290 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4291 on on undefined IFUNC symbol in the second PLT.
4293 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4295 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4297 2017-04-19 Alan Modra <amodra@gmail.com>
4299 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4300 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4301 * elf32-ppc.c:Formatting.
4302 (ensure_undefweak_dynamic): Don't make dynamic when
4303 info->dynamic_undefined_weak is zero.
4304 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4305 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4306 not default visibility. Discard undef and undefweak
4308 (ppc_elf_relocate_section): Adjust to suit.
4309 * elf64-ppc.c: Formatting.
4310 (ensure_undefweak_dynamic): Don't make dynamic when
4311 info->dynamic_undefined_weak is zero.
4312 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4313 info->dynamic_undefined_weak. Discard them earlier.
4315 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4318 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4319 before generating the version definition section.
4321 2017-04-17 Alan Modra <amodra@gmail.com>
4323 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4324 state when a regular object file defines a symbol with
4325 incompatible type to that defined by an earlier shared lib.
4327 2017-04-13 Alan Modra <amodra@gmail.com>
4329 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4331 * elf32-arm.c: Likewise.
4332 * elf32-i386.c: Likewise.
4333 * elf32-mep.c: Likewise.
4334 * elf64-ia64-vms.c: Likewise.
4335 * elf64-x86-64.c: Likewise.
4336 * elflink.c: Likewise.
4337 * elfnn-ia64.c: Likewise.
4338 * elfxx-mips.c: Likewise.
4340 2017-04-13 Alan Modra <amodra@gmail.com>
4342 * aoutx.h: Use %B and %A in error messages throughout file.
4343 * aout-cris.c: Likewise.
4344 * archive.c: Likewise.
4345 * binary.c: Likewise.
4346 * coff-rs6000.c: Likewise.
4347 * coff-tic4x.c: Likewise.
4348 * coffcode.h: Likewise.
4349 * coffgen.c: Likewise.
4350 * cofflink.c: Likewise.
4351 * coffswap.h: Likewise.
4352 * cpu-arm.c: Likewise.
4353 * elf-eh-frame.c: Likewise.
4354 * elf-m10300.c: Likewise.
4356 * elf32-arc.c: Likewise.
4357 * elf32-arm.c: Likewise.
4358 * elf32-bfin.c: Likewise.
4359 * elf32-frv.c: Likewise.
4360 * elf32-iq2000.c: Likewise.
4361 * elf32-m32c.c: Likewise.
4362 * elf32-microblaze.c: Likewise.
4363 * elf32-nds32.c: Likewise.
4364 * elf32-rl78.c: Likewise.
4365 * elf32-rx.c: Likewise.
4366 * elf32-score.c: Likewise.
4367 * elf32-score7.c: Likewise.
4368 * elf32-sh64.c: Likewise.
4369 * elf32-v850.c: Likewise.
4370 * elf32-vax.c: Likewise.
4371 * elf32-visium.c: Likewise.
4372 * elf64-ia64-vms.c: Likewise.
4373 * elf64-mmix.c: Likewise.
4374 * elf64-sh64.c: Likewise.
4375 * elfcode.h: Likewise.
4376 * elfnn-aarch64.c: Likewise.
4377 * elfnn-ia64.c: Likewise.
4378 * elfxx-mips.c: Likewise.
4379 * hpux-core.c: Likewise.
4382 * linker.c: Likewise.
4383 * merge.c: Likewise.
4385 * oasys.c: Likewise.
4386 * pdp11.c: Likewise.
4387 * peXXigen.c: Likewise.
4388 * rs6000-core.c: Likewise.
4389 * vms-alpha.c: Likewise.
4390 * xcofflink.c: Likewise.
4392 2017-04-13 Alan Modra <amodra@gmail.com>
4394 * bfd.c (PRINT_TYPE): Define.
4395 (_doprnt): New function.
4396 (error_handler_internal): Use _doprnt.
4397 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4398 calls in their natural order, throughout file.
4399 * coff-mcore.c: Likewise.
4400 * coff-ppc.c: Likewise.
4401 * coff-tic80.c: Likewise.
4402 * cofflink.c: Likewise.
4403 * elf-s390-common.c: Likewise.
4405 * elf32-arm.c: Likewise.
4406 * elf32-i386.c: Likewise.
4407 * elf32-m32r.c: Likewise.
4408 * elf32-msp430.c: Likewise.
4409 * elf32-spu.c: Likewise.
4410 * elf64-ia64-vms.c: Likewise.
4411 * elf64-sparc.c: Likewise.
4412 * elf64-x86-64.c: Likewise.
4413 * elflink.c: Likewise.
4414 * elfnn-aarch64.c: Likewise.
4415 * elfnn-ia64.c: Likewise.
4416 * elfxx-mips.c: Likewise.
4418 2017-04-13 Alan Modra <amodra@gmail.com>
4420 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4421 branch veneers" error. Fix double space and format message.
4422 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4423 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4425 2017-04-13 Alan Modra <amodra@gmail.com>
4427 * bfd-in2.h: Regenerate.
4429 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4431 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4432 extra `\n' in warning/error messages.
4433 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4434 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4436 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4438 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4439 processor-specific properties with generic ELF target vector.
4441 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4443 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4444 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4445 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4446 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4448 (link_hash_newfunc): Initialize has_got_reloc and
4450 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4452 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4454 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4456 (_bfd_sparc_elf_fixup_symbol): New function.
4457 (allocate_dynrelocs): Don't allocate space for dynamic
4458 relocations and discard relocations against resolved undefined
4459 weak symbols in executable. Don't make resolved undefined weak
4460 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4461 relocation against undefined weak symbols in PIE.
4462 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4463 relocations against resolved undefined weak symbols in PIE
4464 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4465 without ynamic PLT/GOT relocations for resolved undefined weak
4467 Don't generate dynamic relocation against resolved undefined
4468 weak symbol in executable.
4469 (pie_finish_undefweak_symbol): New function.
4470 (_bfd_sparc_elf_finish_dynamic_sections): Call
4471 pie_finish_undefweak_symbol on all symbols in PIE.
4472 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4473 (_bfd_sparc_elf_fixup_symbol): New function.
4475 2017-04-10 Nick Clifton <nickc@redhat.com>
4477 * config.bfd: Remove ns32k from obsolete list.
4479 2017-04-10 Alan Modra <amodra@gmail.com>
4482 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4483 (special_sections_i): Likewise for .init_array.
4484 (special_sections_p): Likewise for .preinit_array.
4486 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4490 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4491 ELF_COMMON_DEF_P for common symbols.
4492 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4493 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4494 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4495 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4496 07492f668d2173da7a2bda3707ff0985e0f460b6.
4498 2017-04-07 Pedro Alves <palves@redhat.com>
4500 * opncls.c (bfd_get_debug_link_info): Rename to...
4501 (bfd_get_debug_link_info_1): ... this. Change type of second
4502 parameter to void pointer. Adjust.
4503 (bfd_get_debug_link_info): Reimplement on top of
4504 bfd_get_debug_link_info_1.
4505 (separate_debug_file_exists, separate_alt_debug_file_exists):
4506 Change type of second parameter to void pointer. Adjust.
4507 (get_func_type, check_func_type): Change type of second parameter
4509 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4510 the callback functions instead of passing the address of a local.
4511 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4512 find_separate_debug_file.
4513 (get_alt_debug_link_info_shim): Change type of second parameter to
4514 void pointer. Adjust.
4515 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4516 find_separate_debug_file.
4517 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4518 of second parameter to void pointer. Adjust.
4519 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4520 pointer local to find_separate_debug_file.
4522 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4524 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4525 external symbols with a definition.
4526 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4528 2017-04-07 Alan Modra <amodra@gmail.com>
4530 * po/SRC-POTFILES.in: Regenerate.
4532 2017-04-05 Alan Modra <amodra@gmail.com>
4534 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4537 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4539 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4540 numbers for DataDirectory entry indicies passed to
4543 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4545 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4546 each GNU_MBIND section and align GNU_MBIND section to page size.
4547 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4548 segment for each GNU_MBIND section.
4549 (_bfd_elf_init_private_section_data): Copy sh_info from input
4550 for GNU_MBIND section.
4552 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4554 * elfnn-riscv.c (GP_NAME): Delete.
4555 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4556 (_bfd_riscv_relax_lui): Likewise.
4558 2017-04-04 Nick Clifton <nickc@redhat.com>
4561 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4563 (bfd_elf_final_link): Only initialize the extended symbol index
4564 section if there are extended symbol tables to list.
4566 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4568 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4569 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4570 * configure.ac (elf): Add elf-properties.lo.
4571 * Makefile.in: Regenerated.
4572 * configure: Likewise.
4573 * elf-bfd.h (elf_property_kind): New.
4574 (elf_property): Likewise.
4575 (elf_property_list): Likewise.
4576 (elf_properties): Likewise.
4577 (_bfd_elf_parse_gnu_properties): Likewise.
4578 (_bfd_elf_get_property): Likewise.
4579 (_bfd_elf_link_setup_gnu_properties): Likewise.
4580 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4581 and setup_gnu_properties.
4582 (elf_obj_tdata): Add properties.
4583 * elf-properties.c: New file.
4584 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4585 (elf_i386_merge_gnu_properties): Likewise.
4586 (elf_backend_parse_gnu_properties): Likewise.
4587 (elf_backend_merge_gnu_properties): Likewise.
4588 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4589 (elf_x86_64_merge_gnu_properties): Likewise.
4590 (elf_backend_parse_gnu_properties): Likewise.
4591 (elf_backend_merge_gnu_properties): Likewise.
4592 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4593 (elf_backend_parse_gnu_properties): Likewise.
4594 (elf_backend_setup_gnu_properties): Likewise.
4595 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4596 elf_backend_merge_gnu_properties and
4597 elf_backend_setup_gnu_properties.
4599 2017-03-30 Pip Cet <pipcet@gmail.com>
4601 * elf32-wasm32.c: Add relocation code, two relocs.
4602 * reloc.c: Add wasm32 relocations.
4603 * libbfd.h: Regenerate.
4604 * bfd-in2.h: Regenerate.
4605 * bfd/po/bfd.pot: Regenerate.
4607 2017-03-29 Nick Clifton <nickc@redhat.com>
4610 * coff-bfd.h (struct coff_section_data): Add new fields:
4611 saved_bias and bias.
4612 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4613 computed for PE binaries.
4614 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4617 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4620 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4621 to handle a local symbol with a hash-symbol-entry; without PLT.
4622 Add BFD_ASSERT for an incidental case with GOT entry present.
4623 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4624 isn't forced-or-set local.
4626 2017-03-27 Pip Cet <pipcet@gmail.com>
4628 * wasm-module.c: New file to support WebAssembly modules.
4629 * wasm-module.h: New file to support WebAssembly modules.
4630 * doc/webassembly.texi: Start documenting wasm-module.c.
4631 * config.bfd: Add wasm_vec.
4632 * targets.c: Likewise.
4633 * configure.ac: Likewise.
4634 * Makefile.am: Add entries for wasm-module.c.
4635 * Makefile.in: Regenerate.
4636 * configure: Regenerate.
4637 * po/SRC-POTFILES.in: Regenerate.
4639 2017-03-27 Pip Cet <pipcet@gmail.com>
4641 * cpu-wasm32.c: New file to support wasm32 architecture.
4642 * elf32-wasm32.c: New file to support wasm32 architecture.
4643 * Makefile.am: Add wasm32 architecture.
4644 * archures.c: Likewise.
4645 * config.bfd: Likewise.
4646 * configure.ac: Likewise.
4647 * targets.c: Likewise.
4648 * Makefile.in: Regenerate.
4649 * bfd-in2.h: Regenerate.
4650 * configure: Regenerate.
4651 * po/SRC-POTFILES.in: Regenerate.
4653 2017-03-20 Alan Modra <amodra@gmail.com>
4656 * elf64-ppc.c (compare_symbols): Stabilize sort.
4658 2017-03-18 Alan Modra <amodra@gmail.com>
4660 * elf64-ppc.c (struct ppc_link_hash_table): Add
4661 local_ifunc_resolver and maybe_local_ifunc_resolver.
4662 (ppc_build_one_stub): Set flags on emitting dynamic
4663 relocation to ifunc.
4664 (ppc64_elf_relocate_section): Likewise.
4665 (ppc64_elf_finish_dynamic_symbol): Likewise.
4666 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4667 local dynamic relocs to ifuncs.
4668 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4669 local_ifunc_resolver and maybe_local_ifunc_resolver.
4670 (ppc_elf_relocate_section): Set flag on emitting dynamic
4671 relocation to ifuncs.
4672 (ppc_elf_finish_dynamic_symbol): Likewise.
4673 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4674 dynamic relocs to ifuncs.
4676 2017-03-13 Nick Clifton <nickc@redhat.com>
4679 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4680 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4681 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4682 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4683 * bfd-in2.h: Regenerate.
4684 * libbfd.h: Regenerate.
4685 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4687 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4688 (elfNN_aarch64_howto_table): Likewise.
4689 (aarch64_tls_transition_without_check): Likewise.
4690 (aarch64_reloc_got_type): Likewise.
4691 (elfNN_aarch64_final_link_relocate): Likewise.
4692 (elfNN_aarch64_tls_relax): Likewise.
4693 (elfNN_aarch64_relocate_section): Likewise.
4694 (elfNN_aarch64_gc_sweep_hook): Likewise.
4695 (elfNN_aarch64_check_relocs): Likewise.
4696 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4697 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4699 2017-03-11 Alan Modra <amodra@gmail.com>
4701 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4702 parameter is in fact used. Whitespace fixes.
4703 * elf64-ppc.c: Likewise.
4705 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4707 * rs6000-core.c (CORE_NEW): Simplify macro when
4708 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4710 2017-03-07 Alan Modra <amodra@gmail.com>
4714 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4717 2017-03-05 Alan Modra <amodra@gmail.com>
4719 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4720 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4721 (next_cie_fde_offset): New function.
4722 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4723 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4724 four bytes. Align CIEs to four or eight bytes depending on
4725 per_encoding_aligned8. Align FDEs according to their encoding.
4726 Pad last FDE to output section alignment.
4727 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4729 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4730 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4731 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4733 2017-03-02 Martin Bickel <binutils@ineranves.de>
4736 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4737 empty segments which have a zero filesz, but a non-zero memsz.
4739 2017-03-02 Alan Modra <amodra@gmail.com>
4741 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4743 2017-02-28 Alan Modra <amodra@gmail.com>
4745 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4746 (ppc64_elf_relocate_section): Likewise.
4748 2017-02-28 Alan Modra <amodra@gmail.com>
4751 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4752 rather than elf32_nios2_hash_table or elf_hash_table.
4753 (create_got_section): Likewise.
4754 (nios2_elf32_finish_dynamic_symbol): Likewise.
4755 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4756 (nios2_elf32_size_dynamic_sections): Likewise.
4757 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4758 vars. Use htab equivalents directly instead. Don't create
4759 all dynamic sections on needing just the GOT. Use a goto
4760 rather than a fall-through with reloc test. Ensure
4761 htab->dynobj is set when making dynamic sreloc section.
4762 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4763 equivalent directly instead. Don't segfault on looking for
4764 .dynamic when dynamic sections have not been created. Don't
4765 segfault on .got.plt being discarded.
4766 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4767 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4768 fixme and another not so relevant comment.
4769 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4770 already set, set hash table dynobj on creating .sbss.
4772 2017-02-28 Alan Modra <amodra@gmail.com>
4774 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4775 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4776 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4777 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4778 (ppc64_elf_relocate_section): Likewise.
4779 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4780 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4781 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4782 * libbfd.h: Regenerate.
4783 * bfd-in2.h: Regenerate.
4785 2017-02-28 Alan Modra <amodra@gmail.com>
4787 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4788 dynamic .data.rel.ro read-only.
4789 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4790 rather than section flags when deciding where copy reloc goes.
4791 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4792 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4793 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4794 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4795 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4796 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4797 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4798 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4799 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4800 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4801 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4802 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4803 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4804 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4805 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4806 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4807 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4808 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4809 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4811 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4813 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4814 `jalr $0, $25' instruction encoding.
4816 2017-02-27 Nick Clifton <nickc@redhat.com>
4819 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4820 generating a seg-fault when encountering a symbol that has been
4821 deleted by garbage collection.
4823 2017-02-25 Alan Modra <amodra@gmail.com>
4825 * elf32-arc.c (struct dynamic_sections): Delete.
4826 (enum dyn_section_types): Delete.
4827 (dyn_section_names): Delete.
4828 (arc_create_dynamic_sections): Delete.
4829 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4830 segfault on discarded .rela.plt section.
4831 (elf_arc_size_dynamic_sections): Formatting. Don't call
4832 arc_create_dynamic_sections. Don't allocate memory for sections
4833 handled by the generic linker. Correct code finding relocs in
4834 read-only sections. Set SEC_EXCLUDE on zero size .got,
4835 .got.plt, and .dynbss sections. Do set .interp for pies.
4837 2017-02-24 Andrew Waterman <andrew@sifive.com>
4839 * elfnn-riscv.c (GP_NAME): New macro.
4840 (riscv_global_pointer_value): Use it.
4841 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4842 output section, consider only that section's alignment.
4844 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4846 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4847 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4848 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4849 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4851 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4853 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4854 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4857 2017-02-23 Alan Modra <amodra@gmail.com>
4860 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4862 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4863 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4866 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4869 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4870 processing ahead of the call to `elf_gc_sweep_symbol'.
4872 2017-02-22 Nick Clifton <nickc@redhat.com>
4875 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4876 created section 4-byte alignment.
4878 2017-02-22 Alan Modra <amodra@gmail.com>
4880 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4881 on .got or .plt output section being discarded by script.
4882 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4885 2017-02-21 Alan Modra <amodra@gmail.com>
4887 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4888 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4890 2017-02-20 Alan Modra <amodra@gmail.com>
4893 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4894 if DT_RELSZ/DT_RELASZ is zero.
4896 2017-02-17 Nick Clifton <nickc@redhat.com>
4898 * compress.c (bfd_get_full_section_contents): Remember to reduce
4899 compressed size by the sizeof the compression header when
4900 decompressing the contents.
4902 2017-02-17 Pedro Alves <palves@redhat.com>
4904 * srec.c (Chunk): Rename to ...
4905 (_bfd_srec_len): ... this.
4906 (S3Forced): Rename to ...
4907 (_bfd_srec_forceS3): ... this.
4908 * objcopy.c: Adjust all references.
4910 2017-02-17 Pedro Alves <palves@redhat.com>
4912 * archive.c (bsd_write_armap): Rename to ...
4913 (_bfd_bsd_write_armap): ... this.
4914 (coff_write_armap): Rename to ...
4915 (_bfd_coff_write_armap): ... this.
4916 * libbfd-in.h (bsd_write_armap): Rename to ...
4917 (_bfd_bsd_write_armap): ... this.
4918 (coff_write_armap): Rename to ...
4919 (_bfd_coff_write_armap): ... this.
4920 * aout-target.h, aout-tic30.c: Adjust all users.
4921 * libbfd.h: Regenerate.
4923 2017-02-17 Pedro Alves <palves@redhat.com>
4925 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4926 (warn_deprecated): Rename to ...
4927 (_bfd_warn_deprecated): ... this.
4928 * libbfd.c (warn_deprecated): Rename to ...
4929 (_bfd_warn_deprecated): ... this.
4930 * bfd-in2.h: Regenerate.
4932 2017-02-17 Pedro Alves <palves@redhat.com>
4934 * bfdio.c (real_ftell): Rename to ...
4935 (_bfd_real_ftell): ... this.
4936 (real_fseek): Rename to ...
4937 (_bfd_real_fseek): ... this.
4938 (real_fopen): Rename to ...
4939 (_bfd_real_fopen): ... this.
4940 * libbfd-in.h (real_ftell): Rename to ...
4941 (_bfd_real_ftell): ... this.
4942 (real_fseek): Rename to ...
4943 (_bfd_real_fseek): ... this.
4944 (real_fopen): Rename to ...
4945 (_bfd_real_fopen): ... this.
4946 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4947 * libbfd.h: Regenerate.
4949 2017-02-17 Pedro Alves <palves@redhat.com>
4951 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4952 * libbfd.c (read_unsigned_leb128): Rename to ...
4953 (_bfd_read_unsigned_leb128): ... this.
4954 (read_signed_leb128): Rename to ...
4955 (_bfd_read_signed_leb128): ... this.
4956 (safe_read_leb128): Rename to ...
4957 (_bfd_safe_read_leb128): ... this.
4958 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4959 (_bfd_read_unsigned_leb128): ... this.
4960 (read_signed_leb128): Rename to ...
4961 (_bfd_read_signed_leb128): ... this.
4962 (safe_read_leb128): Rename to ...
4963 (_bfd_safe_read_leb128): ... this.
4964 * libbfd.h: Renegerate.
4966 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4968 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4969 before trying to fine matching file and line information.
4971 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4973 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4974 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4975 not match current bfd, then reload debug information. Record bfd
4976 we're loading debug info for in the stash. If we have debug
4977 informatin in the cache then perform section placement before
4980 2017-02-16 Alan Modra <amodra@gmail.com>
4983 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4984 * elfxx-target.h (elf_backend_no_page_alias): Define.
4985 (elfNN_bed): Init new field.
4986 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4987 ensure PT_LOAD segment starts on a new page.
4988 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4990 2017-02-16 Alan Modra <amodra@gmail.com>
4993 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4996 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4998 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4999 * bfd-in2.h: Regenerated.
5001 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5004 * elf32-i386.c (elf_i386_relocate_section): Allow
5005 "lea foo@GOT, %reg" in PIC.
5007 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
5010 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
5011 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
5012 error against local IFUNC symbol without a base register for
5015 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
5017 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
5018 `%P: %H:' with `info->callbacks->einfo'.
5019 (ppc_elf_relocate_section): Likewise.
5020 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
5021 (ppc64_elf_edit_toc): Likewise.
5022 (ppc64_elf_relocate_section): Likewise.
5024 2017-02-14 Alan Modra <amodra@gmail.com>
5026 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
5027 --gc-keep-exported, and test versioned field of sym rather than
5028 looking for @ in name.
5030 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
5032 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
5035 2017-02-13 Nick Clifton <nickc@redhat.com>
5038 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
5041 2017-02-07 Andrew Waterman <andrew@sifive.com>
5043 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
5044 entry size if PLT header is written.
5046 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
5048 Fix sparc64 dynamic relocation processing to use the dynamic
5050 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
5051 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
5054 2017-02-03 Nick Clifton <nickc@redhat.com>
5057 * coffcode.h (coff_write_object_contents): Enlarge size of
5058 s_name_buf in order to avoid compile time warning about possible
5060 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5061 32-bits of insn value before printing into buffer.
5063 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5065 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5066 `max_local_dynindx'.
5067 (mips_elf_sort_hash_table): Handle it.
5068 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5069 symbols bump up `max_local_dynindx' rather than
5070 `max_non_got_dynindx'.
5072 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5074 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5075 `min_got_dynindx', `max_unref_got_dynindx' and
5076 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5077 (mips_elf_sort_hash_table): Adjust accordingly.
5079 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5081 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5082 to access the hash table.
5084 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5086 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5087 non-NULL `htab' to the beginning.
5089 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5091 * elflink.c (elf_gc_sweep): Wrap overlong line.
5093 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5095 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5096 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5097 * elfxx-mips.c (mips_elf_link_hash_table): Add
5098 `ignore_branch_isa' member.
5099 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5100 in branch relocation calculation as an error if
5101 `ignore_branch_isa' has been set.
5102 (_bfd_mips_elf_insn32): Rename to...
5103 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5104 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5105 Handle the new parameter.
5107 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5109 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5110 local variable dynobj.
5113 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5114 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5115 executable from read-only sections into sdynrelro.
5116 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5117 dynamic relocs in sdynrelro.
5118 (elf_backend_want_dynrelro): Define.
5120 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5122 * config.bfd (*-*-rtemsaout*): Mark as removed.
5124 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5126 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5127 (arm-*-rtems*): Move to (arm*-*-eabi*).
5128 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5129 (m68-*-rtems*): Move to (m68*-*-elf*).
5131 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5133 * config.bfd (*-*-rtemscoff*): Mark as removed.
5135 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5138 * elflink.c (bfd_elf_record_link_assignment): Revert last
5139 change and don't ever clear `forced_local'. Set `mark'
5141 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5143 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5144 (bfd_elf_size_dynamic_sections): ... here.
5145 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5146 and set `mark' instead in `__tls_get_addr_opt' processing.
5147 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5149 2017-01-24 Alan Modra <amodra@gmail.com>
5151 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5152 where dynamic relocs are preferable. Allow ifunc too.
5153 (ensure_undefweak_dynamic): New function.
5154 (allocate_dynrelocs): Use it here. Move plt handling last and
5155 don't make symbols dynamic, simplifying loop. Only make undef
5156 weak symbols with GOT entries dynamic. Correct condition
5157 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5158 comments. Remove goto.
5159 (ppc_elf_relocate_section): Correct test for using dynamic
5160 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5161 to suit. Set up explicit tls_index entries and implicit GOT
5162 tls_index entries resolvable at link time for
5163 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5164 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5165 (ensure_undefweak_dynamic): New function.
5166 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5167 with GOT entries dynamic. Remove unnecessary test of
5168 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5169 (ppc64_elf_relocate_section): Correct test for using dynamic
5170 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5171 to suit. Set up explicit tls_index entries and implicit GOT
5172 tls_index entries resolvable at link time for __tls_get_addr_opt.
5173 Simplify expression to clear mem for prelink.
5175 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5177 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5179 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5181 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5182 (elf_backend_hash_symbol): Define.
5184 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5187 * elflink.c (bfd_elf_record_link_assignment): Clear any
5188 `forced_local' marking for DSO symbols that are not being
5191 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5193 * elfnn-riscv.c (riscv_elf_object_p): New function.
5195 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5198 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5200 (elf_x86_64_check_relocs): Create .eh_frame section for the
5202 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5203 .eh_frame section for the .plt.bnd section.
5204 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5205 for the .plt.bnd section.
5207 2017-01-12 Nick Clifton <nickc@redhat.com>
5210 * opncls.c (find_separate_debug_file): Add include_dirs
5211 parameter. Only include the directory part of the bfd's filename
5212 in search paths if include_dirs is true. Add a couple of extra
5213 locations for looking for debug files.
5214 ( bfd_follow_gnu_debuglink): Update invocation of
5215 find_separate_debug_file.
5216 (bfd_follow_gnu_debugaltlink): Likewise.
5217 (get_build_id): New function: Finds the build-id of the given bfd.
5218 (get_build_id_name): New function: Computes the name of the
5219 separate debug info file for a bfd, based upon its build-id.
5220 (check_build_id_file): New function: Checks to see if a separate
5221 debug info file exists at the given location, and that its
5222 build-id matches that of the original bfd.
5223 (bfd_follow_build_id_debuglink): New function: Finds a separate
5224 debug info file for a given bfd by using the build-id method.
5225 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5226 method of locating a separate debug info file before using the
5228 * bfd-in2.h: Regenerate.
5230 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5233 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5234 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5235 elf_x86_64_eh_frame_plt_got.
5236 (elf_x86_64_size_dynamic_sections): Get unwind info from
5237 elf_x86_64_bnd_arch_bed for the BND PLT.
5239 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5241 * config.bfd: Add entries for i686-redox and x86_64-redox.
5243 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5245 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5247 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5248 .eh_frame section to 4 bytes for x32.
5249 (elf_x86_64_check_relocs): Likewise.
5251 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5254 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5255 (PLT_GOT_FDE_LENGTH): Likewise.
5256 (elf_i386_plt_layout): Add eh_frame_plt_got and
5257 eh_frame_plt_got_size.
5258 (elf_i386_plt): Updated.
5259 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5260 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5261 (elf_i386_size_dynamic_sections): Allocate and initialize
5262 .eh_frame section for .plt.got.
5263 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5265 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5266 eh_frame_plt_got_size.
5267 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5268 (PLT_GOT_FDE_LENGTH): Likewise.
5269 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5270 eh_frame_plt_got_size.
5271 (elf_x86_64_arch_bed): Updated.
5272 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5273 eh_frame_plt_got_size.
5274 (elf_x86_64_nacl_arch_bed): Likewise.
5275 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5276 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5277 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5278 .eh_frame section for .plt.got.
5279 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5282 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5284 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5285 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5287 2017-01-09 Nick Clifton <nickc@redhat.com>
5289 * dwarf2.c (lookup_address_in_function_table): Return early if
5290 there are no functions in the given comp unit, or if the high
5291 address of the last function in the comp unit is less than the
5294 2017-01-09 Nick Clifton <nickc@redhat.com>
5297 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5298 message if there are too many symbols to load.
5300 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5302 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5303 if relocs are cached.
5305 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5308 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5309 for R_MICROBLAZE_GOTOFF_64.
5311 2017-01-03 Nick Clifton <nickc@redhat.com>
5313 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5314 warning about using a possibly uninitialised variable.
5316 2017-01-02 Alan Modra <amodra@gmail.com>
5318 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5319 (allocate_plt_static, allocate_dynrelocs): Use it.
5321 2017-01-02 Alan Modra <amodra@gmail.com>
5323 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5324 .PARISC.unwind section.
5326 2017-01-02 Alan Modra <amodra@gmail.com>
5329 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5330 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5331 indirect to GOT pointer relative code edit.
5333 2017-01-02 Alan Modra <amodra@gmail.com>
5335 Update year range in copyright notice of all files.
5337 For older changes see ChangeLog-2016
5339 Copyright (C) 2017 Free Software Foundation, Inc.
5341 Copying and distribution of this file, with or without modification,
5342 are permitted in any medium without royalty provided the copyright
5343 notice and this notice are preserved.
5349 version-control: never