1 2017-11-21 Alan Modra <amodra@gmail.com>
3 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
4 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
6 2017-11-20 Nick Clifton <nickc@redhat.com>
9 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
10 objects without a GNU_PROPERTY note section when looking for a bfd
11 onto which notes can be accumulated.
13 2017-11-20 Alan Modra <amodra@gmail.com>
17 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
18 and leave rel_hdr->sh_flags zero. Update calls.
19 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
20 flag when !gas before adding rel/rela section to group. Set
21 output rel/rela SHF_GROUP flags.
23 2017-11-18 Jim Wilson <jimw@sifive.com>
25 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
26 and to in error message.
28 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
30 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
31 "%F%P:", instead of "%F:", to linker callback in case of error.
33 2017-11-16 Nick Clifton <nickc@redhat.com>
36 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
37 (elfcore_grok_openbsd_procinfo): Likewise.
38 (elfcore_grok_nto_status): Likewise.
40 2017-11-16 Nick Clifton <nickc@redhat.com>
42 * merge.c (sec_merge_emit): Always create padding buffer. Add
43 asserts to make sure that the buffer is long enough.
45 2017-11-15 Alan Modra <amodra@gmail.com>
47 * bfd.c (union _bfd_doprnt_args): Add "Bad".
48 (_bfd_doprnt): Handle more flags.
49 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
50 (error_handler_internal): Init args type to Bad.
52 2017-11-14 Alan Modra <amodra@gmail.com>
55 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
56 non-empty dynamic section.
57 (ppc_build_one_stub): Take elf_gp from output bfd, not output
59 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
61 2017-11-14 Alan Modra <amodra@gmail.com>
63 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
66 2017-11-13 Jan Beulich <jbeulich@suse.com>
68 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
70 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
71 (coff_write_object_contents): Likewise. Issue diagnostic for too
74 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
77 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
80 2017-11-12 Alan Modra <amodra@gmail.com>
82 * elflink.c (elf_link_add_object_symbols): Ignore anything but
83 defined and defweak symbols when setting up weakdefs.
85 2017-11-12 Alan Modra <amodra@gmail.com>
87 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
88 to keep dyn_relocs, clear to discard. Comment.
89 (allocate_dynrelocs): Always clear non_got_ref when clearing
90 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
91 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
92 dyn_relocs on undefined syms to handle for non-pic too.
93 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
94 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
95 to keep dyn_relocs, clear to discard. Comment.
96 (allocate_dynrelocs): Always clear non_got_ref when clearing
97 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
98 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
99 dyn_relocs on undefined syms to handle for non-pic too.
100 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
101 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
102 dyn_relocs here. Don't bother setting non_got_ref. Comment.
103 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
104 ifuncs. Move code deleting dyn_relocs on undefined symbols to
105 handle for non-pic too. Don't test non_got_ref. Do test
106 dynamic_adjusted and ELF_COMMON_DEF_P.
108 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
110 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
111 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
112 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
114 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
116 * elf32-mips.c (elf32_mips_write_core_note): New function.
117 (elf_backend_write_core_note): New macro.
118 * elf64-mips.c (elf64_mips_write_core_note): New function.
119 (elf_backend_write_core_note): New macro.
120 * elfn32-mips.c (elf32_mips_write_core_note): New function.
121 (elf_backend_write_core_note): New macro.
123 2017-11-07 Alan Modra <amodra@gmail.com>
125 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
128 2017-11-07 Alan Modra <amodra@gmail.com>
130 * sysdep.h: Formatting, comment fixes.
131 (gettext, ngettext): Redefine when ENABLE_NLS.
132 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
133 (_): Define using gettext.
134 (textdomain, bindtextdomain): Use safer "do nothing".
135 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
136 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
138 2017-11-05 Alan Modra <amodra@gmail.com>
141 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
144 2017-11-05 Alan Modra <amodra@gmail.com>
147 * bfd.c (union _bfd_doprnt_args): New.
148 (PRINT_TYPE): Add FIELD arg. Take value from args.
149 (_bfd_doprnt): Replace ap parameter with args. Adjust all
150 PRINT_TYPE invocations and reading of format args to suit.
151 Move "%%" handling out of switch handling args. Support
152 positional parameters.
153 (_bfd_doprnt_scan): New function.
154 (error_handler_internal): Call _bfd_doprnt_scan and read args.
156 2017-11-04 Alan Modra <amodra@gmail.com>
158 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
159 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
160 (ppc_elf_relocate_section): Don't output a dynamic relocation
161 for IE GOT entries in an executable.
162 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
163 (ppc64_elf_size_dynamic_sections): Likewise.
164 (ppc64_elf_relocate_section): Likewise.
166 2017-11-04 Alan Modra <amodra@gmail.com>
168 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
169 callers. Don't bother with SEC_ALLOC test. Return section pointer.
171 (maybe_set_textrel): ..here.
172 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
173 (maybe_set_textrel): Call minfo to print textrel warning to map file.
175 2017-11-04 Alan Modra <amodra@gmail.com>
177 * elf32-hppa.c (enum _tls_type): Move.
178 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
179 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
180 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
181 (got_entries_needed, got_relocs_needed): New functions.
182 (allocate_dynrelocs): Use them.
183 (elf32_hppa_size_dynamic_sections): Likewise.
184 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
185 Correct code emitting relocs on GD/IE got entries. Report an
186 error when a symbol has both normal and TLS GOT relocs.
188 2017-11-04 Alan Modra <amodra@gmail.com>
191 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
192 for plabels when non-pic.
193 (maybe_set_textrel): New function.
194 (readonly_dynrelocs): Move and rewrite.
195 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
196 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
197 for functions. Expand non_got_ref comments.
198 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
200 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
202 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
203 Don't use func_pointer_refcount. Don't set plt.refcount nor
204 non_got_ref for function pointer reference.
205 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
206 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
207 func_pointer_refcount.
208 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
209 func_pointer_refcount.
210 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
211 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
212 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
214 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
215 Nick Clifton <nickc@redhat.com>
218 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
219 overlarge raw syment count.
220 (coff_get_normalized_symtab): Likewise.
222 2017-11-01 James Bowman <james.bowman@ftdichip.com>
224 * archures.c: Add bfd_mach_ft32b.
225 * cpu-ft32.c: Add arch_info_struct.
226 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
228 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
230 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
231 (elf32_ft32_adjust_diff_reloc_value)
232 (elf32_ft32_adjust_reloc_if_spans_insn)
233 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
234 (ft32_elf_relax_section): New function.
235 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
236 * bfd-in2.h: Regenerate.
237 * libbfd.h: Regenerate.
239 2017-11-01 Nick Clifton <nickc@redhat.com>
242 * coffcode.h (coff_slurp_line_table): Check for an excessively
243 large line number count.
245 2017-11-01 Nick Clifton <nickc@redhat.com>
248 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
249 and offset in light of further possible bogus values.
251 2017-11-01 Alan Modra <amodra@gmail.com>
254 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
255 entry when just a dynamic reloc can serve. Ensure no dynamic
256 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
257 Expand and move the non_got_ref comment.
258 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
260 2017-11-01 Nick Clifton <nickc@redhat.com>
263 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
265 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
266 members of an archive.
268 2017-10-31 Nick Clifton <nickc@redhat.com>
271 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
274 2017-10-30 Alan Modra <amodra@gmail.com>
276 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
279 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
281 (bfd_elf_gc_sections): Likewise.
283 2017-10-30 Alan Modra <amodra@gmail.com>
286 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
287 ensure non_got_ref is not set due to debug references.
288 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
289 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
290 need for a plt entry.
291 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
292 dynamic relocs when pic. Remove bogus code attempting to handle
294 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
296 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
297 and SYMBOL_REFERENCES_LOCAL in GOT handling.
299 2017-10-28 Alan Modra <amodra@gmail.com>
302 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
303 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
304 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
305 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
307 2017-10-25 Alan Modra <amodra@gmail.com>
309 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
310 optionally prefixed with "_".
311 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
313 2017-10-24 Andrew Waterman <andrew@sifive.com>
315 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
318 2017-10-24 Renlin Li <renlin.li@arm.com>
321 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
323 2017-10-23 Nick Clifton <nickc@redhat.com>
326 * elflink.c (elf_link_output_extsym): Keep global undefined
327 symbols if they have been marked as needed.
329 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
331 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
333 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
334 `_bfd_mips_elf_mkobject'.
336 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
339 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
341 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
343 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
344 (riscv_pcgp_lo_reloc): Likewise.
345 (riscv_pcgp_relocs): Likewise.
346 (riscv_init_pcgp_relocs): New function.
347 (riscv_free_pcgp_relocs): Likewise.
348 (riscv_record_pcgp_hi_reloc): Likewise.
349 (riscv_record_pcgp_lo_reloc): Likewise.
350 (riscv_delete_pcgp_hi_reloc): Likewise.
351 (riscv_use_pcgp_hi_reloc): Likewise.
352 (riscv_record_pcgp_lo_reloc): Likewise.
353 (riscv_find_pcgp_lo_reloc): Likewise.
354 (riscv_delete_pcgp_lo_reloc): Likewise.
355 (_bfd_riscv_relax_pc): Likewise.
356 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
357 via the new functions above.
359 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
361 * elfnn-riscv.c (R_RISCV_DELETE): New define.
362 (_bfd_riscv_relax_delete): New function.
363 (perform_relocation): Handle R_RISCV_DELETE.
364 (_bfd_riscv_relax_section): Likewise.
366 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
369 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
370 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
371 bfd_link_executable for TLS check.
372 (tilegx_elf_check_relocs): Likewise.
373 (allocate_dynrelocs): Likewise.
374 (tilegx_elf_relocate_section): Likewise.
376 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
379 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
380 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
381 bfd_link_executable for TLS check.
382 (tilepro_elf_check_relocs): Likewise.
383 (allocate_dynrelocs): Likewise.
384 (tilepro_elf_relocate_section): Likewise.
386 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
389 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
390 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
391 bfd_link_executable for TLS check.
392 (_bfd_sparc_elf_check_relocs): Likewise.
393 (allocate_dynrelocs): Likewise.
394 (_bfd_sparc_elf_relocate_section): Likewise.
396 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
398 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
399 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
400 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
402 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
404 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
405 indirect and warning symbols.
407 2017-10-17 Alan Modra <amodra@gmail.com>
410 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
411 against size left rather than comparing pointers. Reorganise loop.
413 2017-10-17 Alan Modra <amodra@gmail.com>
416 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
417 and error for any other size that doesn't cover the header word.
419 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
421 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
422 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
423 (elf_backend_gc_sweep_hook): Likewise.
424 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
425 (bfinfdpic_gc_sweep_hook): Likewise.
426 (elf_backend_gc_sweep_hook): Likewise.
427 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
428 (elf_backend_gc_sweep_hook): Likewise.
429 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
430 (elf_backend_gc_sweep_hook): Likewise.
431 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
432 (elf_backend_gc_sweep_hook): Likewise.
433 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
434 (elf_backend_gc_sweep_hook): Likewise.
435 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
436 (elf_backend_gc_sweep_hook): Likewise.
437 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
439 (elf_m68k_remove_got_entry_type): Removed.
440 (elf_m68k_find_got_entry_ptr): Likewise.
441 (elf_m68k_remove_got_entry): Likewise.
442 (elf_m68k_gc_sweep_hook): Likewise.
443 (elf_backend_gc_sweep_hook): Likewise.
444 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
445 (elf_backend_gc_sweep_hook): Likewise.
446 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
447 (elf_backend_gc_sweep_hook): Likewise.
448 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
449 (elf_backend_gc_sweep_hook): Likewise.
450 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
451 (elf_backend_gc_sweep_hook): Likewise.
452 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
453 (elf_backend_gc_sweep_hook): Likewise.
454 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
455 (elf_backend_gc_sweep_hook): Likewise.
456 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
457 (elf_backend_gc_sweep_hook): Likewise.
458 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
459 (elf_backend_gc_sweep_hook): Likewise.
460 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
461 (elf_backend_gc_sweep_hook): Likewise.
462 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
463 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
464 (elf_backend_gc_sweep_hook): Likewise.
465 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
466 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
467 (elf_backend_gc_sweep_hook): Likewise.
468 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
469 (elf_backend_gc_sweep_hook): Likewise.
470 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
471 (elf_backend_gc_sweep_hook): Likewise.
472 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
473 (elf_backend_gc_sweep_hook): Likewise.
474 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
475 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
476 (elf_backend_gc_sweep_hook): Likewise.
477 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
478 (ppc64_elf_gc_sweep_hook): Likewise.
479 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
480 (elf_backend_gc_sweep_hook): Likewise.
481 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
482 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
483 * elflink.c (elf_link_add_object_symbols): Don't call
484 _bfd_elf_link_check_relocs here.
485 (gc_sweep_hook_fn): Removed.
486 (elf_gc_sweep): Remove gc_sweep_hook.
487 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
488 (elf_backend_gc_sweep_hook): Likewise.
489 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
490 (elf_backend_gc_sweep_hook): Likewise.
491 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
492 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
493 (elf_backend_gc_sweep_hook): Likewise.
494 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
495 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
496 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
497 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
498 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
499 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
501 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
503 * elf32-i386.c (elf_i386_backend_data): Removed.
504 (get_elf_i386_backend_data): Likewise.
505 (elf_i386_arch_bed): Replace elf_i386_backend_data with
506 elf_x86_backend_data.
507 (elf_i386_get_synthetic_symtab): Likewise.
508 (elf_i386_nacl_arch_bed): Likewise.
509 (elf_i386_vxworks_arch_bed): Likewise.
510 (elf_i386_relocate_section): Check target_os instead of
512 (elf_i386_finish_dynamic_symbol): Likewise.
513 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
514 Check target_os instead of is_vxworks.
515 (elf_i386_link_setup_gnu_properties): Remove normal_target and
516 is_vxworks. Initialize plt0_pad_byte.
517 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
518 (get_elf_x86_64_arch_data): Likewise.
519 (get_elf_x86_64_backend_data): Likewise.
520 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
521 elf_x86_backend_data.
522 (elf_x86_64_get_synthetic_symtab): Likewise.
523 (elf_x86_64_nacl_arch_bed): Likewise.
524 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
525 normal_target. Initialize plt0_pad_byte.
526 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
527 instead of is_vxworks.
528 (_bfd_x86_elf_size_dynamic_sections): Likewise.
529 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
530 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
531 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
532 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
533 Update normal_target. Set up plt0_pad_byte. Check target_os
534 instead of is_vxworks.
535 * elfxx-x86.h (elf_x86_target_os): New.
536 (elf_x86_backend_data): Likewise.
537 (get_elf_x86_backend_data): Likewise.
538 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
540 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
543 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
545 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
546 _bfd_x86_elf_finish_dynamic_sections.
547 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
548 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
550 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
553 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
556 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
557 hide symbol which was forced to be dynamic.
559 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
562 * elf32-cris.c (cris_elf_relocate_section): Don't generate
563 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
564 (cris_elf_check_relocs): Don't allocate dynamic relocation
565 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
567 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
570 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
571 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
572 (sh_elf_relocate_section): Don't generate dynamic relocation if
573 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
575 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
578 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
579 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
580 (elf_s390_relocate_section): Don't generate dynamic relocation
581 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
582 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
583 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
584 (elf_s390_relocate_section): Don't generate dynamic relocation
585 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
587 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
590 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
591 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
592 (allocate_dynrelocs): Discard dynamic relocations if
593 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
595 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
598 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
599 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
601 (allocate_dynrelocs): Discard dynamic relocations if
602 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
604 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
607 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
608 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
609 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
610 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
611 (elf_m68k_relocate_section): Don't generate dynamic relocation
612 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
614 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
617 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
618 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
619 (allocate_dynrelocs): Discard dynamic relocations if
620 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
621 (elf32_hppa_relocate_section): Don't generate dynamic
622 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
624 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
627 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
628 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
629 (allocate_fptr): Don't allocate function pointer if
630 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
631 (allocate_dynrel_entries): Don't allocate dynamic relocation
632 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
633 (set_got_entry): Don't set GOT entry if
634 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
635 (set_pltoff_entry): Don't set PLTOFF entry if
636 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
637 (elfNN_ia64_relocate_section): Don't install dynamic relocation
638 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
640 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
643 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
644 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
645 (allocate_dynrelocs): Don't allocate dynamic relocations if
646 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
648 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
651 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
652 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
653 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
654 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
656 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
659 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
660 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
661 (tilepro_elf_relocate_section): Don't generate dynamic
662 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
663 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
664 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
665 (tilegx_elf_relocate_section): Don't generate dynamic
666 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
668 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
671 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
672 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
674 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
675 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
677 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
679 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
680 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
681 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
683 2017-10-12 James Bowman <james.bowman@ftdichip.com>
685 * bfd-in2.h: Regenerate.
686 * libbfd.h: Regenerate.
687 * elf32-ft32.c: Add HOWTO R_FT32_15.
688 * reloc.c: Add BFD_RELOC_FT32_15.
690 2017-10-12 Nick Clifton <nickc@redhat.com>
692 * reloc.c (enum bfd_reloc_status): Start values at 2.
693 * bfd-in2.h: Regenerate.
694 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
695 that a TRUE return indicates success. Compare the result of
696 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
697 (build_one_stub): Change sense of tests against aarch64_relocate
699 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
700 than FALSE, when an error is detected.
701 (elfNN_aarch64_final_link_relocate): Likewise.
703 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
705 * elf32-i386.c (elf_backend_hide_symbol): New.
706 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
707 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
708 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
710 2017-10-12 Alan Modra <amodra@gmail.com>
712 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
713 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
714 (bfd_elf_define_start_stop): Likewise.
716 2017-10-12 Alan Modra <amodra@gmail.com>
718 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
719 when executable rather than non-PIC.
720 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
721 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
723 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
725 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
727 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
728 (elf_external_linux_prpsinfo64_ugid32): ... this.
729 (swap_linux_prpsinfo32_out): Rename to...
730 (swap_linux_prpsinfo32_ugid32_out): ... this.
731 (elf_external_linux_prpsinfo64_ugid16): New structure.
732 (swap_linux_prpsinfo64_ugid16_out): New function.
733 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
734 (elf_backend_linux_prpsinfo64_ugid16): Define.
735 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
736 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
737 of the 64-bit Linux core PRPSINFO note.
738 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
740 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
742 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
744 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
745 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
746 (elf_external_ppc_linux_prpsinfo32)
747 (swap_ppc_linux_prpsinfo32_out): Move to...
748 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
749 (swap_linux_prpsinfo32_ugid32_out): ... these.
750 (elf_external_linux_prpsinfo32): Rename to...
751 (elf_external_linux_prpsinfo32_ugid16): ... this.
752 (swap_linux_prpsinfo32_out): Rename to...
753 (swap_linux_prpsinfo32_ugid16_out): ... this.
754 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
755 (elf_backend_linux_prpsinfo32_ugid16): Define.
756 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
757 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
758 of the 32-bit Linux core PRPSINFO note.
759 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
760 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
761 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
762 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
763 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
764 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
765 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
766 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
767 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
768 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
770 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
772 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
773 `gap' member ahead of `pr_flag'.
775 2017-10-11 Pedro Alves <palves@redhat.com>
777 * bfd.c (_doprnt): Rename to ...
778 (_bfd_doprnt): ... this.
779 (error_handler_internal): Adjust.
781 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
783 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
784 instead of incrementing it.
785 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
787 2017-10-10 Renlin Li <renlin.li@arm.com>
790 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
791 symbols into dynamic.
793 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
796 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
797 (riscv_elf_link_hash_table_create): Initialize max_alignment to
799 (_bfd_riscv_relax_section): Cache the max alignment of output
800 sections if possible.
802 2017-10-10 Alan Modra <amodra@gmail.com>
804 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
805 .opd whenever .opd is present and non-zero size. Move code
806 setting abiversion to/from output file earlier. Only set
807 u.opd.func_sec when --gc-sections. Read relocs and set up
808 u.opd.func_sec values here..
809 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
811 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
813 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
815 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
818 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
820 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
821 .interp section with "ld --no-dynamic-linker".
823 2017-10-09 Alan Modra <amodra@gmail.com>
826 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
827 funcinfo_hash_table and varinfo_hash_table.
829 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
831 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
832 in read-only section with minfo.
833 (sh_elf_size_dynamic_sections): Likewise.
835 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
837 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
840 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
842 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
843 this_hdr.sh_entsize only if section size > 0.
845 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
847 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
849 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
851 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
852 in read-only section with minfo.
853 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
855 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
857 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
860 2017-10-06 John Baldwin <jhb@FreeBSD.org>
862 * elf-bfd.h (struct elf_backend_data): Add
863 `elf_backend_grok_freebsd_prstatus'.
864 * elf.c (elfcore_grok_freebsd_note): Call
865 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
867 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
869 (elf_backend_grok_freebsd_prstatus): Define.
870 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
871 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
873 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
875 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
876 and has_non_got_reloc with zero_undefweak.
877 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
878 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
880 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
881 has_non_got_reloc with zero_undefweak.
882 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
883 has_got_reloc and has_non_got_reloc with zero_undefweak.
884 (elf_x86_link_hash_entry): Likewise.
886 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
888 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
889 (VERIFY_COPY_RELOC): Likewise.
891 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
893 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
894 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
895 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
897 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
899 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
900 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
901 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
903 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
905 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
906 * elf32-i386.c (elf_i386_relocate_section): Use it.
907 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
909 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
911 * elf32-i386.c (X86_SIZE_TYPE_P): New.
912 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
913 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
914 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
915 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
917 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
919 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
920 (PLT_LOCAL_IFUNC_P): Likewise.
921 * elf32-i386.c (elf_i386_relocate_section): Use them.
922 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
924 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
926 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
927 * elf32-i386.c (elf_i386_relocate_section): Use it.
928 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
930 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
932 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
933 * elf32-i386.c (elf_i386_relocate_section): Use it.
934 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
936 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
938 * elf32-i386.c (X86_PCREL_TYPE_P): New.
939 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
940 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
941 (X86_PCREL_TYPE_P): This.
942 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
943 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
944 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
946 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
948 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
950 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
951 * elf32-i386.c (elf_i386_tls_transition): Use it.
952 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
954 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
956 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
957 Dump dynamic relocation in read-only section with minfo if
959 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
960 (maybe_set_textrel): Likewise.
961 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
962 read-only section with minfo.
964 2017-10-05 John Baldwin <jhb@FreeBSD.org>
966 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
968 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
970 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
971 in read-only section with minfo.
972 (tilepro_elf_size_dynamic_sections): Likewise.
973 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
974 (tilegx_elf_size_dynamic_sections): Likewise.
976 2017-10-05 Pedro Alves <palves@redhat.com>
979 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
980 ellipsis parameter. Split out bfd_error_on_input code to..
981 (bfd_set_input_error): .. New function.
982 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
983 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
984 * bfd-in2.h: Regenerate.
986 2017-10-05 Alan Modra <amodra@gmail.com>
988 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
989 fini_array error value.
991 2017-10-05 Alan Modra <amodra@gmail.com>
994 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
996 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
998 (elf_fake_sections): Adjust calls. Exit immediately on failure.
999 (bfd_elf_set_group_contents): Add associated reloc section indices
1002 2017-10-04 Alan Modra <amodra@gmail.com>
1004 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1005 classify symbols for ELFv2.
1007 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1010 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1011 undergoes default promotion.
1012 * bfd-in2.h: Regenerate.
1014 2017-10-02 Alan Modra <amodra@gmail.com>
1016 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1017 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1019 2017-10-01 Alan Modra <amodra@gmail.com>
1022 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1023 (add_line_info): Always put end_sequence last.
1025 2017-10-01 Alan Modra <amodra@gmail.com>
1028 * dwarf2.c (read_section): Allocate buffer with extra byte for
1029 bfd_simple_get_relocated_section_contents rather than copying
1032 2017-09-29 Alan Modra <amodra@gmail.com>
1034 * merge.c (merge_strings): Return FALSE on malloc failure.
1035 (_bfd_merge_sections): Return failures from record_section and
1038 2017-09-28 Alan Modra <amodra@gmail.com>
1041 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1042 a case where plugin_notice isn't called.
1044 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1046 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1049 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1052 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1053 output_bfd to info->callbacks->minfo.
1055 2017-09-26 Nick Clifton <nickc@redhat.com>
1058 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1059 assertion failure if elf_x86_64_rtype_to_howto has already issued
1062 2017-09-26 Alan Modra <amodra@gmail.com>
1065 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1068 2017-09-26 Nick Clifton <nickc@redhat.com>
1071 * dwarf2.c (read_formatted_entries): Fail early if we know that
1072 the loop parsing data entries will overflow the end of the
1075 2017-09-26 Alan Modra <amodra@gmail.com>
1078 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1079 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1080 to stash->info_ptr_memory, and check die_ref is within that memory.
1081 Set info_ptr_end correctly when another CU is refd. Check die_ref
1082 for DW_FORM_ref4 etc. is within CU.
1084 2017-09-26 Alan Modra <amodra@gmail.com>
1087 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1088 (read_formatted_entries): Init "fe".
1089 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1091 2017-09-26 Alan Modra <amodra@gmail.com>
1094 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1095 bounds in inner loop.
1097 2017-09-25 Alan Modra <amodra@gmail.com>
1100 * dwarf1.c (parse_die): Sanity check pointer against section limit
1101 before dereferencing.
1102 (parse_line_table): Likewise.
1104 2017-09-25 Alan Modra <amodra@gmail.com>
1107 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1109 (parse_comp_unit): Likewise.
1111 2017-09-25 Alan Modra <amodra@gmail.com>
1114 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1116 2017-09-24 Alan Modra <amodra@gmail.com>
1119 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1120 within section bounds.
1122 2017-09-24 Alan Modra <amodra@gmail.com>
1125 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1127 2017-09-24 Alan Modra <amodra@gmail.com>
1130 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1131 pname param. Return status. Make name const. Don't abort,
1132 return an error. Formatting. Exit if current info_ptr matches
1133 orig_info_ptr. Update callers.
1134 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1135 nested_funcs an array of structs for extensibility. Formatting.
1137 2017-09-24 Alan Modra <amodra@gmail.com>
1140 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1141 rather than dividing by zero.
1143 2017-09-24 Alan Modra <amodra@gmail.com>
1146 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1148 2017-09-24 Alan Modra <amodra@gmail.com>
1151 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1153 2017-09-24 Alan Modra <amodra@gmail.com>
1156 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1157 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1160 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1163 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1166 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1169 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1170 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1172 2017-09-22 Pedro Alves <palves@redhat.com>
1173 Alan Modra <amodra@gmail.com>
1175 * version.h: Add comment.
1177 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1179 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1180 NT_S390_GS_BC, correct the previously swapped invocations of
1181 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1183 2017-09-19 Alan Modra <amodra@gmail.com>
1186 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1189 2017-09-19 Alan Modra <amodra@gmail.com>
1192 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1193 symbols before calculating verrefs. Don't renumber dynsyms
1194 after gc. Exclude .gnu.version when zero or one dynsym.
1195 Localize some vars and reindent.
1197 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1200 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1201 return from bfd_canonicalize_dynamic_reloc.
1203 2017-09-15 Alan Modra <amodra@gmail.com>
1206 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1207 overflows bfd_size_type.
1209 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1212 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1213 to indicate if conversion is performed.
1214 (elf_i386_check_relocs): Cache section contents and relocations
1215 if conversion is performed.
1216 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1217 contents and relocations if conversion is performed.
1219 2017-09-14 Nick Clifton <nickc@redhat.com>
1222 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1225 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1227 * elfxx-x86.h: Fix a typo in comments.
1229 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1231 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1233 2017-09-09 Alan Modra <amodra@gmail.com>
1235 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1238 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1240 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1241 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1242 (elf_i386_finish_dynamic_symbol): Likewise.
1243 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1244 (elf_x86_64_finish_dynamic_symbol): Likewise.
1245 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1246 (_bfd_x86_elf_fixup_symbol): Likewise.
1248 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1250 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1251 check has_non_got_reloc.
1253 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1256 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1257 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1258 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1259 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1260 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1261 and linker_def on __ehdr_start if it is referenced and not
1263 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1264 and return TRUE when building executable, if a symbol has
1265 non-GOT/non-PLT relocations in text section or there is no
1267 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1269 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1271 * elfxx-x86.h: Update comments.
1273 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1275 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1276 elf_x86_plt_layout_table with elf_x86_init_table.
1277 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1279 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1281 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1282 (elf_x86_init_table): This.
1283 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1284 elf_x86_plt_layout_table with elf_x86_init_table.
1286 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1288 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1289 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1290 * configure: Regenerated.
1291 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1292 and r_sym fields of plt_layout.
1293 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1295 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1296 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1297 r_info nor r_sym fields.
1298 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1300 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1302 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1304 * (_bfd_riscv_relax_align): Call bfd_set_error and
1305 print an error message when unable to relax a .align directive.
1307 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1309 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1310 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1311 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1312 R_RISCV_PCREL_HI20 relocs, and pass the result to
1313 riscv_record_pcrel_hi_reloc.
1315 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1317 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1318 r_type_p. Remove the converted argument. Replace
1319 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1320 the new relocation type via r_type_p.
1321 (elf_i386_relocate_section): Likewise.
1322 (elf_i386_finish_dynamic_symbol): Likewise.
1323 (need_convert_load): Removed.
1324 (check_relocs_failed): Updated.
1325 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1326 instead of setting need_convert_load.
1327 (_bfd_i386_elf_convert_load): Removed.
1328 * elf64-x86-64.c (need_convert_load): Removed.
1329 (check_relocs_failed): Updated.
1330 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1331 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1332 Return the new relocation type via r_type_p.
1333 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1334 instead of setting need_convert_load.
1335 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1337 (_bfd_x86_64_elf_convert_load): Removed.
1338 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1339 with SYMBOL_REFERENCES_LOCAL_P.
1340 (elf_x86_64_finish_dynamic_symbol): Likewise.
1341 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1343 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1344 (_bfd_x86_elf_link_symbol_references_local): New function.
1345 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1346 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1347 SYMBOL_REFERENCES_LOCAL_P.
1348 (elf_x86_link_hash_entry): Add local_ref.
1349 (elf_x86_link_hash_table): Remove convert_load.
1350 (_bfd_i386_elf_convert_load): Removed.
1351 (_bfd_x86_64_elf_convert_load): Likewise.
1352 (_bfd_x86_elf_link_symbol_references_local): New.
1354 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1356 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1357 (elf_x86_64_info_to_howto): Get the real relocation type by
1358 masking out R_X86_64_converted_reloc_bit.
1359 (elf_x86_64_check_tls_transition): Get the real relocation type
1360 by masking out R_X86_64_converted_reloc_bit.
1361 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1362 instead of setting converted_reloc.
1363 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1364 instead of converted_reloc. Get the real relocation type by
1365 masking out R_X86_64_converted_reloc_bit.
1366 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1367 R_X86_64_converted_reloc_bit is valid.
1368 * elfxx-x86.h (converted_reloc): Removed.
1370 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1372 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1373 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1374 to get the relocation type again.
1375 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1376 r_type when calling elf_x86_64_tls_transition. Don't use
1377 ELF32_R_TYPE to get the relocation type again.
1379 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1381 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1384 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1386 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1387 argument. Don't check relocation overflow. Avoid relocation
1388 overflow if --no-relax is used. Set converted_reloc on symbol
1389 if a GOTPCREL relocation is converted.
1390 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1391 --no-relax if GOTPCREL relocation conversion leads to relocation
1393 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1395 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1396 Edmar Wienskoski <edmar.wienskoski@nxp.com
1398 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1399 (ppc_elf_check_relocs): Handle it.
1400 (ppc_elf_vle_split20): New function.
1401 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1403 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1406 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1407 for x86-64 if GOT_TLS_GDESC_P is true.
1409 2017-09-03 Alan Modra <amodra@gmail.com>
1412 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1414 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1416 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1417 tls_get_addr for x86-64 in one place.
1419 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1421 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1422 with elfxx-x86.lo for 64-bit BFD.
1423 * configure: Regenerated.
1425 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1427 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1428 (_bfd_i386_elf_convert_load): This. Remove static.
1429 (elf_i386_size_dynamic_sections): Removed.
1430 (elf_backend_size_dynamic_sections): Likewise.
1431 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1432 (_bfd_x86_64_elf_convert_load): This. Remove static.
1433 (elf_x86_64_size_dynamic_sections): Removed.
1434 (elf_backend_size_dynamic_sections): Likewise.
1435 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1436 (elf_x86_allocate_dynrelocs): This. Make it static.
1437 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1438 (elf_x86_allocate_local_dynreloc): This. Make it static.
1439 (elf_i386_is_reloc_section): New function.
1440 (elf_x86_64_is_reloc_section): Likewise.
1441 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1442 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1443 Rearrange got_entry_size initialization.
1444 (_bfd_x86_elf_size_dynamic_sections): New function.
1445 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1446 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1447 (_bfd_i386_elf_convert_load): New.
1448 (_bfd_x86_64_elf_convert_load): Likewise.
1449 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1450 (elf_backend_size_dynamic_sections): Likewise.
1451 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1452 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1454 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1456 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1459 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1461 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1462 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1464 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1466 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1467 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1468 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1469 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1470 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1471 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1473 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1475 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1476 (elf_i386_allocate_local_dynrelocs): Likewise.
1477 (elf_i386_size_dynamic_sections): Replace
1478 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1479 with _bfd_x86_elf_allocate_dynrelocs and
1480 _bfd_x86_elf_allocate_local_dynrelocs.
1481 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1482 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1483 (elf_x86_64_size_dynamic_sections): Replace
1484 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1485 with _bfd_x86_elf_allocate_dynrelocs and
1486 _bfd_x86_elf_allocate_local_dynrelocs.
1487 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1488 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1489 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1490 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1492 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1494 * elf32-i386.c (is_i386_elf): Removed.
1495 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1496 (elf_i386_size_dynamic_sections): Likewise.
1497 (elf_i386_relocate_section): Likewise.
1498 * elf64-x86-64.c (is_x86_64_elf): Removed.
1499 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1501 (elf_x86_64_size_dynamic_sections): Likewise.
1502 (elf_x86_64_relocate_section): Likewise.
1503 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1505 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1508 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1510 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1511 (elf_i386_allocate_dynrelocs): Replace
1512 elf_i386_compute_jump_table_size with
1513 elf_x86_compute_jump_table_size.
1514 (elf_i386_size_dynamic_sections): Likewise.
1515 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1516 (elf_x86_64_allocate_dynrelocs): Replace
1517 elf_x86_64_compute_jump_table_size with
1518 elf_x86_compute_jump_table_size.
1519 (elf_x86_64_size_dynamic_sections): Likewise.
1520 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1522 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1523 (elf_x86_compute_jump_table_size): New.
1525 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1527 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1529 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1530 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1532 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1534 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1535 with htab->is_vxworks.
1536 (elf_i386_size_dynamic_sections): Likewise.
1537 (elf_i386_relocate_section): Likewise.
1538 (elf_i386_finish_dynamic_symbol): Likewise.
1539 (elf_i386_finish_dynamic_sections): Likewise.
1541 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1543 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1544 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1545 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1546 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1547 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1548 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1549 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1550 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1552 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1555 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1556 ELF_COMMON_DEF_P for common symbols.
1558 2017-09-02 Alan Modra <amodra@gmail.com>
1560 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1561 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1562 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1564 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1566 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1567 (elf_backend_gc_mark_hook): Likewise.
1568 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1569 (elf_backend_gc_mark_hook): Likewise.
1570 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1571 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1572 (elf_backend_gc_mark_hook): Likewise.
1574 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1576 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1577 (elf_backend_adjust_dynamic_symbol): Likewise.
1578 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1579 (elf_backend_adjust_dynamic_symbol): Likewise.
1580 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1581 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1582 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1583 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1584 (elf_backend_adjust_dynamic_symbol): Likewise.
1586 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1588 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1591 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1593 * elf32-i386.c (elf_i386_mkobject): Removed.
1594 (bfd_elf32_mkobject): Likewise.
1595 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1596 (bfd_elf64_mkobject): Likewise.
1597 (bfd_elf32_mkobject): Likewise.
1598 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1599 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1600 (bfd_elf64_mkobject): Likewise.
1601 (bfd_elf32_mkobject): Likewise.
1603 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1605 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1606 Call _bfd_x86_elf_link_setup_gnu_properties.
1607 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1608 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1610 (elf_x86_64_non_lazy_plt): Likewise.
1611 (elf_x86_64_lazy_bnd_plt): Likewise.
1612 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1613 (elf_x86_64_lazy_ibt_plt): Likewise.
1614 (elf_x32_lazy_ibt_plt): Likewise.
1615 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1616 (elf_x32_non_lazy_ibt_plt): Likewise.
1617 (elf_x86_64_nacl_plt): Likewise.
1618 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1619 _bfd_x86_elf_link_setup_gnu_properties.
1620 * elfxx-x86.c: Include elf-vxworks.h".
1621 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1622 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1623 comments for pic_plt0_entry and pic_plt_entry.
1624 (elf_x86_non_lazy_plt_layout): Likewise.
1625 (elf_x86_plt_layout_table): New.
1626 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1628 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1631 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1632 .eh_frame section for the second PLT.
1633 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1634 alignment of .eh_frame section for the second PLT.
1636 2017-09-01 Nick Clifton <nickc@redhat.com>
1639 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1642 2017-09-01 Nick Clifton <nickc@redhat.com>
1645 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1646 attribute buffer is NUL terminated.
1648 2017-08-31 Nick Clifton <nickc@redhat.com>
1651 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1652 to dwarf string sections.
1654 2017-08-31 Alan Modra <amodra@gmail.com>
1656 * po/SRC-POTFILES.in: Regenerate.
1658 2017-08-31 Alan Modra <amodra@gmail.com>
1660 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1661 for a section containing just a terminator. Allow multiple
1662 terminators at end of section.
1663 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1664 sections when not adding alignment. Assert on terminator in
1667 2017-08-31 Alan Modra <amodra@gmail.com>
1671 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1674 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1676 * configure.ac (bfd_backends): Add elf64.lo together with
1677 elfxx-x86.lo for 64-bit BFD.
1678 * configure: Regenerated.
1680 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1682 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1685 2017-08-31 Alan Modra <amodra@gmail.com>
1688 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1689 before _close_and_cleanup. Call iovec->bclose after.
1690 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1692 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1694 * elf32-i386.c (elf_i386_plt_type): Removed.
1695 (elf_i386_plt): Likewise.
1696 (elf_i386_get_synthetic_symtab): Updated. Call
1697 _bfd_x86_elf_get_synthetic_symtab.
1698 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1699 (elf_x86_64_plt): Likewise.
1700 (elf_x86_64_get_synthetic_symtab): Updated. Call
1701 _bfd_x86_elf_get_synthetic_symtab.
1702 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1703 (elf_x86_64_get_plt_got_vma): Likewise.
1704 (elf_i386_valid_plt_reloc_p): Likewise.
1705 (elf_x86_64_valid_plt_reloc_p): Likewise.
1706 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1707 * elfxx-x86.h (elf_x86_plt_type): New.
1708 (elf_x86_plt): Likewise.
1709 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1711 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1713 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1714 target_id instead of elf_machine_code.
1716 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1718 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1719 (elf_i386_lazy_plt_layout): Likewise.
1720 (elf_i386_non_lazy_plt_layout): Likewise.
1721 (elf_i386_plt_layout): Likewise.
1722 (elf_i386_link_hash_table): Likewise.
1723 (elf_i386_next_tls_desc_index): Likewise.
1724 (elf_i386_srelplt2): Likewise.
1725 (elf_i386_plt): Likewise.
1726 (elf_i386_lazy_plt): Likewise.
1727 (elf_i386_non_lazy_plt): Likewise.
1728 (elf_i386_link_hash_table_create): Likewise.
1729 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1730 (elf_i386_lazy_plt): Updated.
1731 (elf_i386_non_lazy_plt): Likewise.
1732 (elf_i386_lazy_ibt_plt): Likewise.
1733 (elf_i386_non_lazy_ibt_plt): Likewise.
1734 (elf_i386_allocate_dynrelocs): Likewise.
1735 (elf_i386_size_dynamic_sections): Likewise.
1736 (elf_i386_relocate_section): Likewise.
1737 (elf_i386_finish_dynamic_symbol): Likewise.
1738 (elf_i386_finish_dynamic_sections): Likewise.
1739 (elf_i386_get_synthetic_symtab): Likewise.
1740 (elf_i386_link_setup_gnu_properties): Likewise.
1741 (elf_i386_nacl_plt): Likewise.
1742 * elf64-x86-64.c (ABI_64_P): Removed.
1743 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1744 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1745 (elf_x86_64_lazy_plt_layout): Likewise.
1746 (elf_x86_64_non_lazy_plt_layout): Likewise.
1747 (elf_x86_64_plt_layout): Likewise.
1748 (elf_x86_64_link_hash_table): Likewise.
1749 (elf_x86_64_plt): Likewise.
1750 (elf_x86_64_lazy_plt): Likewise.
1751 (elf_x86_64_non_lazy_plt): Likewise.
1752 (elf_x86_64_link_hash_table_create): Likewise.
1753 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1754 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1755 (elf_x86_64_lazy_plt): Updated.
1756 (elf_x86_64_non_lazy_plt): Likewise.
1757 (elf_x86_64_lazy_bnd_plt): Likewise.
1758 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1759 (elf_x86_64_lazy_ibt_plt): Likewise.
1760 (elf_x32_lazy_ibt_plt): Likewise.
1761 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1762 (elf_x32_non_lazy_ibt_plt): Likewise.
1763 (elf_x86_64_allocate_dynrelocs): Likewise.
1764 (elf_x86_64_size_dynamic_sections): Likewise.
1765 (elf_x86_64_relocate_section): Likewise.
1766 (elf_x86_64_finish_dynamic_symbol): Likewise.
1767 (elf_x86_64_finish_dynamic_sections): Likewise.
1768 (elf_x86_64_get_synthetic_symtab): Likewise.
1769 (elf_x86_64_link_setup_gnu_properties): Likewise.
1770 (elf_x86_64_nacl_plt): Likewise.
1771 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1773 (ELF32_DYNAMIC_INTERPRETER): New.
1774 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1775 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1776 (_bfd_x86_elf_link_hash_table_create): Likewise.
1777 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1778 (elf_x86_link_hash_table_free): This. Make it static.
1779 * elfxx-x86.h: Don't include "objalloc.h".
1781 (elf_x86_lazy_plt_layout): Likewise.
1782 (elf_x86_non_lazy_plt_layout): Likewise.
1783 (elf_x86_plt_layout): Likewise.
1784 (_bfd_x86_elf_link_hash_table_create): Likewise.
1785 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1786 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1787 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1788 srelplt2 and next_tls_desc_index.
1789 (_bfd_x86_elf_link_hash_table_free): Removed.
1791 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1793 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1794 branch offset interpretation.
1796 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1799 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1801 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1803 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1804 (elf_x86_64_srelplt2): Likewise.
1806 2017-08-30 Alan Modra <amodra@gmail.com>
1808 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1809 (ppc64_elf_tls_optimize): Set it.
1810 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1811 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1812 addis would add zero.
1813 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1814 (ppc_elf_tls_optimize): Set it.
1815 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1816 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1818 2017-08-30 Alan Modra <amodra@gmail.com>
1820 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1821 __tls_get_addr call sequences to LE, don't move the addi down
1822 to the nop. Replace the bl with addi and leave the nop alone.
1824 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1826 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1828 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1830 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1832 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1834 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1835 (BFD64_BACKENDS): Likewise.
1836 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1837 (BFD64_BACKENDS_CFILES): Likewise.
1838 * Makefile.in: Regenerated.
1839 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1840 elf32-i386.lo and elf64-x86-64.lo.
1841 * configure: Regenerated.
1842 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1843 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1844 "objalloc.h" and "hashtab.h".
1845 (ELIMINATE_COPY_RELOCS): Removed.
1846 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1847 (SYMBOL_NO_COPYRELOC): Likewise.
1848 (elf_i386_link_hash_entry): Likewise.
1849 (GOT_UNKNOWN): Likewise.
1850 (GOT_NORMAL): Likewise.
1851 (GOT_TLS_GD): Likewise.
1852 (elf_i386_hash_entry): Likewise.
1853 (elf_i386_obj_tdata): Likewise.
1854 (elf_i386_tdata): Likewise.
1855 (elf_i386_local_got_tls_type): Likewise.
1856 (elf_i386_local_tlsdesc_gotent): Likewise.
1857 (elf_i386_hash_table): Likewise.
1858 (elf_i386_link_hash_newfunc): Likewise.
1859 (elf_i386_local_htab_hash): Likewise.
1860 (elf_i386_local_htab_eq): Likewise.
1861 (elf_i386_get_local_sym_hash): Likewise.
1862 (elf_i386_link_hash_table_free): Likewise.
1863 (elf_i386_copy_indirect_symbol): Likewise.
1864 (elf_i386_fixup_symbol): Likewise.
1865 (elf_i386_readonly_dynrelocs): Likewise.
1866 (elf_i386_always_size_sections): Likewise.
1867 (elf_i386_set_tls_module_base): Likewise.
1868 (elf_i386_dtpoff_base): Likewise.
1869 (compare_relocs): Likewise.
1870 (elf_i386_hash_symbol): Likewise.
1871 (elf_i386_parse_gnu_properties): Likewise.
1872 (elf_i386_merge_gnu_properties): Likewise.
1873 (elf_i386_link_check_relocs): Likewise.
1874 (elf_i386_merge_symbol_attribute): Likewise.
1875 (bfd_elf32_bfd_link_check_relocs): Likewise.
1876 (elf_backend_copy_indirect_symbol): Likewise.
1877 (elf_backend_always_size_sections): Likewise.
1878 (elf_backend_omit_section_dynsym): Likewise.
1879 (elf_backend_hash_symbol): Likewise.
1880 (elf_backend_fixup_symbol): Likewise.
1881 (elf_backend_parse_gnu_properties): Likewise.
1882 (elf_backend_merge_gnu_properties): Likewise.
1883 (elf_backend_merge_symbol_attribute): Likewise.
1884 (elf_i386_mkobject): Updated.
1885 (elf_i386_link_hash_table_create): Likewise.
1886 (elf_i386_check_tls_transition): Likewise.
1887 (elf_i386_tls_transition): Likewise.
1888 (elf_i386_convert_load_reloc): Likewise.
1889 (elf_i386_check_relocs): Likewise.
1890 (elf_i386_adjust_dynamic_symbol): Likewise.
1891 (elf_i386_allocate_dynrelocs): Likewise.
1892 (elf_i386_convert_load): Likewise.
1893 (elf_i386_size_dynamic_sections): Likewise.
1894 (elf_i386_relocate_section): Likewise.
1895 (elf_i386_finish_dynamic_symbol ): Likewise.
1896 (elf_i386_finish_dynamic_sections): Likewise.
1897 (elf_i386_output_arch_local_syms): Likewise.
1898 (elf_i386_get_synthetic_symtab): Likewise.
1899 (elf_i386_link_setup_gnu_properties): Likewise.
1900 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1901 of elf_link_hash_table, as base.
1902 (elf_i386_next_tls_desc_index): New.
1903 (elf_i386_srelplt2): Likewise.
1904 (elf_i386_plt): Likewise.
1905 (elf_i386_lazy_plt): Likewise.
1906 (elf_i386_non_lazy_plt): Likewise.
1907 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1908 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1909 "objalloc.h" and "hashtab.h".
1910 (ELIMINATE_COPY_RELOCS): Removed.
1911 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1912 (SYMBOL_NO_COPYRELOC): Likewise.
1913 (elf_x86_64_link_hash_entry): Likewise.
1914 (GOT_UNKNOWN): Likewise.
1915 (GOT_NORMAL): Likewise.
1916 (GOT_TLS_GD): Likewise.
1917 (elf_x86_64_hash_entry): Likewise.
1918 (elf_x86_64_obj_tdata): Likewise.
1919 (elf_x86_64_tdata): Likewise.
1920 (elf_x86_64_local_got_tls_type): Likewise.
1921 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1922 (elf_x86_64_hash_table): Likewise.
1923 (elf_x86_64_link_hash_newfunc): Likewise.
1924 (elf_x86_64_local_htab_hash): Likewise.
1925 (elf_x86_64_local_htab_eq): Likewise.
1926 (elf_x86_64_get_local_sym_hash): Likewise.
1927 (elf_x86_64_link_hash_table_free): Likewise.
1928 (elf_x86_64_copy_indirect_symbol): Likewise.
1929 (elf_x86_64_fixup_symbol): Likewise.
1930 (elf_x86_64_readonly_dynrelocs): Likewise.
1931 (elf_x86_64_always_size_sections): Likewise.
1932 (elf_x86_64_set_tls_module_base): Likewise.
1933 (elf_x86_64_dtpoff_base): Likewise.
1934 (compare_relocs): Likewise.
1935 (elf_x86_64_merge_symbol_attribute): Likewise.
1936 (elf_x86_64_hash_symbol): Likewise.
1937 (elf_x86_64_parse_gnu_properties): Likewise.
1938 (elf_x86_64_merge_gnu_properties): Likewise.
1939 (elf_x86_64_link_check_relocs): Likewise.
1940 (elf_backend_copy_indirect_symbol): Likewise.
1941 (elf_backend_always_size_sections): Likewise.
1942 (bfd_elf64_bfd_link_check_relocs): Likewise.
1943 (elf_backend_merge_symbol_attribute): Likewise.
1944 (elf_backend_hash_symbol): Likewise.
1945 (elf_backend_omit_section_dynsym): Likewise.
1946 (elf_backend_fixup_symbol): Likewise.
1947 (elf_backend_parse_gnu_properties): Likewise.
1948 (elf_backend_merge_gnu_properties): Likewise.
1949 (bfd_elf32_bfd_link_check_relocs): Likewise.
1950 (elf_x86_64_mkobject): Updated.
1951 (elf_x86_64_link_hash_table_create): Likewise.
1952 (elf_x86_64_check_tls_transition): Likewise.
1953 (elf_x86_64_tls_transition): Likewise.
1954 (elf_x86_64_convert_load_reloc): Likewise.
1955 (elf_x86_64_check_relocs): Likewise.
1956 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1957 (elf_x86_64_allocate_dynrelocs): Likewise.
1958 (elf_x86_64_convert_load): Likewise.
1959 (elf_x86_64_size_dynamic_sections): Likewise.
1960 (elf_x86_64_relocate_section): Likewise.
1961 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1962 (elf_x86_64_finish_dynamic_sections): Likewise.
1963 (elf_x86_64_output_arch_local_syms): Likewise.
1964 (elf_x86_64_get_synthetic_symtab): Likewise.
1965 (elf_x86_64_link_setup_gnu_properties): Likewise.
1966 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1967 instead of elf_link_hash_table, as base.
1968 (elf_x86_64_next_tls_desc_index): New.
1969 (elf_x86_64_srelplt2): Likewise.
1970 (elf_x86_64_plt): Likewise.
1971 (elf_x86_64_lazy_plt): Likewise.
1972 (elf_x86_64_non_lazy_plt): Likewise.
1973 * elfxx-x86.c: New file.
1974 * elfxx-x86.h: Likewise.
1976 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1978 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1980 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1982 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1984 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1985 sections before checking dynamic relocations and free invalid
1986 PLT section contents.
1987 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1989 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1991 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1992 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1994 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1997 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1999 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2001 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2003 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2005 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2007 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2010 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2011 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2012 Add a has_no_copy_on_protected bitfield.
2013 (elf_has_no_copy_on_protected): New.
2014 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2015 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2016 (elf_merge_gnu_property_list): Likewise.
2017 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2018 to FALSE for elf_has_no_copy_on_protected.
2019 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2020 (elf_i386_link_hash_entry): Add def_protected.
2021 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2022 when checking info->nocopyreloc.
2023 (elf_i386_link_setup_gnu_properties): Don't set
2024 extern_protected_data here.
2025 (elf_i386_merge_symbol_attribute): New function.
2026 (elf_backend_merge_symbol_attribute): New.
2027 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2028 (elf_x86_64_link_hash_entry): Add def_protected.
2029 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2030 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2031 when checking info->nocopyreloc.
2032 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2033 relocation run-time overflow and unresolvable R_X86_64_32S
2034 relocation against protected data symbol defined in shared object
2035 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2036 (elf_x86_64_link_setup_gnu_properties): Don't set
2037 extern_protected_data here.
2038 (elf_x86_64_merge_symbol_attribute): New function.
2039 (elf_backend_merge_symbol_attribute): New.
2041 2017-08-26 Alan Modra <amodra@gmail.com>
2043 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2044 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2045 (ppc_elf_relocate_section): Comment fix.
2046 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2047 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2048 Support dynamic relocs for TPREL16 when non-pic too.
2049 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2050 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2053 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2055 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2056 "symbol" in comments.
2057 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2059 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2062 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2063 R_X86_64_PC32 relocation run-time overflow and unresolvable
2064 R_X86_64_32S relocation with -z nocopyreloc.
2066 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2068 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2069 Undefined symbols may not have a type.
2070 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2072 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2074 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2075 bfd_link_info. Report shared, PIE or PDE object based on
2077 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2078 (elf_x86_64_relocate_section): Likewise.
2080 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2082 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2083 for function symbols.
2084 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2086 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2088 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2089 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2090 is set on any input relocatable file.
2091 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2093 2017-08-23 Alan Modra <amodra@gmail.com>
2096 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2097 ensure_undefweak_dynamic. Handle undefined too.
2098 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2099 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2100 (allocate_dynrelocs): Discard undefined non-default visibility
2101 relocs first. Make undefined syms dynamic. Tidy goto.
2103 2017-08-21 Alan Modra <amodra@gmail.com>
2104 H.J. Lu <hongjiu.lu@intel.com>
2107 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2108 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2110 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2113 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2114 undefined weak symbols.
2116 2017-08-18 Nick Clifton <nickc@redhat.com>
2119 * tekhex.c (getsym): Fix check for source pointer walking off the
2120 end of the input buffer.
2122 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2125 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2126 relocations in debug sections, change abort to _bfd_error_handler.
2128 2017-08-14 Nick Clifton <nickc@redhat.com>
2131 * elf.c (setup_group): Check for an empty or very small group
2133 * po/bfd.pot: Regenerate.
2135 2017-08-14 Alan Modra <amodra@gmail.com>
2138 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2139 alignment padding here.
2140 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2141 in a reverse pass over sections.
2143 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2146 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2147 for @plt suffixes first.
2148 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2150 2017-08-08 Nick Clifton <nickc@redhat.com>
2153 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2154 small section lengths.
2155 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2157 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2158 there is enough data present in the note.
2160 2017-08-08 Alan Modra <amodra@gmail.com>
2163 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2164 got.refcount for GOTOFF relocs, just create .got section.
2166 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2168 * elflink.c (elf_link_add_object_symbols): Move common symbol
2169 check after bed->common_definition.
2171 2017-08-07 Alan Modra <amodra@gmail.com>
2174 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2175 needed to define various dynamic tags have been discarded.
2177 2017-08-07 Nick Clifton <nickc@redhat.com>
2180 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2181 has not been set then use the bfd returned by
2182 _bfd_elf_link_setup_gnu_properties. If that is null then search
2183 through all the input bfds selecting the first normal, ELF format
2185 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2187 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2189 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2191 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2192 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2193 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2194 (elf_i386_link_check_relocs): New function.
2195 (bfd_elf32_bfd_link_check_relocs): New.
2196 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2198 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2199 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2200 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2201 (elf_x86_64_link_check_relocs): New function.
2202 (bfd_elf64_bfd_link_check_relocs): New.
2203 (bfd_elf32_bfd_link_check_relocs): Likewise.
2205 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2208 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2209 as undefined for --no-define-common.
2211 2017-08-05 Alan Modra <amodra@gmail.com>
2213 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2214 hppa_link_hash_table.
2216 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2218 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2219 entries for sysregs with negative indices.
2221 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2223 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2224 isn't the S/390 specific elf data.
2225 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2227 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2229 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2230 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2231 [R_RISCV_ADD16]: Likewise.
2232 [R_RISCV_ADD32]: Likewise.
2233 [R_RISCV_ADD64]: Likewise.
2234 [R_RISCV_SUB6]: Likewise.
2235 [R_RISCV_SUB8]: Likewise.
2236 [R_RISCV_SUB16]: Likewise.
2237 [R_RISCV_SUB32]: Likewise.
2238 [R_RISCV_SUB64]: Likewise.
2240 2017-07-31 Alan Modra <amodra@gmail.com>
2242 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2243 without ld.so checks.
2245 2017-07-29 Alan Modra <amodra@gmail.com>
2248 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2249 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2250 (is_elfv2_localentry0): Test non_zero_localentry.
2251 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2253 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2255 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2256 pointer check for htab->elf.irelplt.
2257 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2259 2017-07-27 Nick Clifton <nickc@redhat.com>
2262 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2264 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2266 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2268 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2270 (evax_bfd_print_emh): Check for invalid string lengths.
2272 2017-07-25 Nick Clifton <nickc@redhat.com>
2274 * po/fr.po: Updated French translation.
2276 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2279 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2280 16-bit absolute branches into 10-bit pc-relative branches on the
2281 MSP430 as well as the MSP430X.
2283 2017-07-25 Alan Modra <amodra@gmail.com>
2285 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2286 (stub_eh_frame_size): New function.
2287 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2288 (group_sections): Init group tls_get_addr_opt_bctrl.
2289 (ppc64_elf_size_stubs): Update sizing and initialization of
2290 .eh_frame. Iteration over stubs via group list.
2291 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2292 (ppc64_elf_finish_dynamic_sections): Update finalization of
2295 2017-07-24 Nick Clifton <nickc@redhat.com>
2298 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2299 of the relocs to the canonicalize_one_reloc routine.
2300 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2301 for the _bfd_mach_o_canonicalize_one_reloc field.
2302 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2303 res_base parameter. Use to check for corrupt pair relocs.
2304 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2306 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2308 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2311 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2312 enough data in the record before attempting to parse it.
2313 (_bfd_vms_slurp_eeom): Likewise.
2315 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2316 (image_set_ptr): Likewise.
2317 (alpha_vms_slurp_relocs): Likewise.
2319 (alpha_vms_object_p): Check for a truncated record.
2321 2017-07-24 Nick Clifton <nickc@redhat.com>
2324 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2325 an unrecognized reloc and sets the bfd_error value.
2326 * libbfd.h: Regenerate.
2327 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2329 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2330 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2331 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2332 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2333 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2335 2017-07-23 Alan Modra <amodra@gmail.com>
2337 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2340 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2343 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2344 reloc_class_ifunc for ifunc symbols.
2346 2017-07-19 Nick Clifton <nickc@redhat.com>
2349 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2350 correct magic bytes at the start, set the error to wrong format
2351 and clear the format selector before returning NULL.
2353 2017-07-19 Nick Clifton <nickc@redhat.com>
2356 * coff-rs6000.c (_bfd_strntol): New function.
2357 (_bfd_strntoll): New function.
2358 (GET_VALUE_IN_FIELD): New macro.
2359 (EQ_VALUE_IN_FIELD): new macro.
2360 (_bfd_xcoff_slurp_armap): Use new macros.
2361 (_bfd_xcoff_archive_p): Likewise.
2362 (_bfd_xcoff_read_ar_hdr): Likewise.
2363 (_bfd_xcoff_openr_next_archived_file): Likewise.
2364 (_bfd_xcoff_stat_arch_elt): Likewise.
2365 * coff64-rs6000.c (_bfd_strntol): New function.
2366 (_bfd_strntoll): New function.
2367 (GET_VALUE_IN_FIELD): New macro.
2368 (xcoff64_slurp_armap): Use new macros.
2370 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2371 John Eric Martin <John.Martin@emmicro-us.com>
2373 * bfd-in2.h: Regenerate.
2374 * libbfd.h: Regenerate.
2375 * elf32-arc.c (JLI): Define.
2376 * reloc.c: Add JLI relocations.
2378 2017-07-18 Nick Clifton <nickc@redhat.com>
2381 * coff-sh.c: Fix spelling typos.
2382 * compress.c: Likewise.
2383 * cpu-pdp11.c: Likewise.
2384 * ecofflink.c: Likewise.
2385 * elf-m10300.c: Likewise.
2387 * elf32-arm.c: Likewise.
2388 * elf32-m68k.c: Likewise.
2389 * elf32-nds32.c: Likewise.
2390 * elf32-ppc.c: Likewise.
2391 * elf32-sh.c: Likewise.
2392 * elf32-v850.c: Likewise.
2393 * elf64-ppc.c: Likewise.
2394 * elf64-x86-64.c: Likewise.
2395 * elflink.c: Likewise.
2396 * elfnn-aarch64.c: Likewise.
2397 * elfxx-mips.c: Likewise.
2399 * sunos.c: Likewise.
2400 * vms-alpha.c: Likewise.
2401 * xcofflink.c: Likewise.
2403 2017-07-18 Nick Clifton <nickc@redhat.com>
2406 * coffcode.h (handle_COMDAT): Replace abort with an error message
2409 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2412 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2415 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2417 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2419 2017-07-16 Alan Modra <amodra@gmail.com>
2421 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2422 __tls_index GOT entries when using __tls_get_addr_opt stub.
2423 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2425 2017-07-12 Alan Modra <amodra@gmail.com>
2427 * po/es.po: Update from translationproject.org/latest/bfd/.
2428 * po/fi.po: Likewise.
2429 * po/fr.po: Likewise.
2430 * po/id.po: Likewise.
2431 * po/ja.po: Likewise.
2432 * po/ro.po: Likewise.
2433 * po/ru.po: Likewise.
2434 * po/sr.po: Likewise.
2435 * po/sv.po: Likewise.
2436 * po/tr.po: Likewise.
2437 * po/uk.po: Likewise.
2438 * po/vi.po: Likewise.
2439 * po/zh_CN.po: Likewise.
2440 * po/hr.po: New file from translationproject.org.
2441 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2442 * configure: Regenerate.
2444 2017-07-12 Nick Clifton <nickc@redhat.com>
2446 Fix compile time warnings using gcc 7.1.1.
2447 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2449 (elf_xtensa_get_gotplt_section): Increase length of got_name
2451 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2452 default return of FALSE.
2453 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2454 default return of FALSE.
2456 2017-07-12 Alan Modra <amodra@gmail.com>
2458 * binary.c (binary_set_section_contents): Don't print filepos in
2460 (coff_write_object_contents): Cast size_t for error message.
2461 (coff_slurp_line_table): Don't use bfd_vma symndx.
2462 (coff_slurp_reloc_table): Remove unneeded cast.
2463 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2465 (find_abstract_instance_name): Likewise.
2466 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2467 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2468 (elf32_arm_check_relocs): Make r_symndx an int.
2469 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2471 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2473 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2475 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2476 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2477 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2478 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2479 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2480 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2481 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2482 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2483 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2484 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2485 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2486 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2487 and use %lu for error message.
2488 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2489 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2492 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2494 (elf32_arm_final_link_relocate): Likewise.
2495 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2496 * coffcode.h (styp_to_sec_flags): Likewise.
2497 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2498 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2499 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2500 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2501 (elf32_bfin_merge_private_bfd_data): Likewise.
2502 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2503 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2504 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2505 (i370_elf_relocate_section): Likewise.
2506 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2507 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2508 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2509 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2510 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2511 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2512 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2513 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2514 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2515 * ieee.c (ieee_write_id, read_id): Likewise.
2516 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2517 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2518 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2519 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2520 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2521 * stabs.c (_bfd_link_section_stabs): Likewise.
2523 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2525 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2526 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2527 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2528 * coff-sh.c (sh_relax_section): Likewise.
2529 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2530 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2531 * coffcode.h (coff_slurp_reloc_table): Likewise.
2532 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2533 (_bfd_coff_read_string_table): Likewise.
2534 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2535 * compress.c (bfd_get_full_section_contents): Likewise.
2536 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2537 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2538 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2539 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2540 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2541 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2542 (elf32_arm_write_section): Likewise.
2543 * elf32-bfin.c (bfin_relocate_section): Likewise.
2544 (bfinfdpic_relocate_section): Likewise.
2545 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2546 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2547 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2548 (elf_i386_relocate_section): Likewise.
2549 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2550 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2551 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2552 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2553 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2554 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2555 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2556 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2557 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2558 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2559 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2560 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2561 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2562 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2563 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2564 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2565 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2566 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2567 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2568 * elf32-sh.c (sh_elf_relax_section): Likewise.
2569 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2570 (sh_elf_relocate_section): Likewise.
2571 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2572 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2573 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2574 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2575 * elf32-v850.c (v850_elf_relax_section): Likewise.
2576 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2577 (elf_vax_relocate_section): Likewise.
2578 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2579 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2580 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2581 (do_fix_for_relocatable_link): Likewise.
2582 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2583 (elf64_alpha_relax_with_lituse): Likewise.
2584 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2585 (elf_hppa_final_link_relocate): Likewise.
2586 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2587 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2588 (elf64_vms_link_add_object_symbols): Likewise.
2589 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2590 (mmix_final_link_relocate): Likewise.
2591 * elf64-s390.c (invalid_tls_insn): Likewise.
2592 (elf_s390_relocate_section): Likewise.
2593 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2594 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2595 (elf_x86_64_relocate_section): Likewise.
2596 * elfcode.h (elf_slurp_symbol_table): Likewise.
2597 * elfcore.h (elf_core_file_p): Likewise.
2598 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2599 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2600 (elfNN_aarch64_relocate_section): Likewise.
2601 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2602 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2603 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2604 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2605 (_bfd_mips_elf_relocate_section): Likewise.
2606 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2607 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2608 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2609 * ieee.c (ieee_slurp_external_symbols): Likewise.
2610 * ihex.c (ihex_write_object_content): Likewise.
2611 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2612 * merge.c (_bfd_merged_section_offset): Likewise.
2613 * mmo.c (mmo_write_loc_chunk): Likewise.
2614 (mmo_write_object_contents): Likewise.
2615 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2616 * stabs.c (_bfd_link_section_stabs): Likewise.
2617 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2619 2017-07-11 Alan Modra <amodra@gmail.com>
2621 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2623 2017-07-11 Alan Modra <amodra@gmail.com>
2625 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2626 instruction" error using _bfd_error_handler, not einfo.
2628 2017-07-10 Nick Clifton <nickc@redhat.com>
2630 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2631 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2633 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2635 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2637 2017-07-07 Alan Modra <amodra@gmail.com>
2639 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2641 2017-07-07 Alan Modra <amodra@gmail.com>
2643 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2644 as long long. Move code replacing "ll" with "I64", and simplify.
2646 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2648 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2651 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2653 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2655 (line_info_add_file_name): Likewise.
2656 (decode_line_info): Likewise.
2658 2017-07-04 Tristan Gingold <gingold@adacore.com>
2660 * version.m4: Bump version to 2.29.51
2661 * configure: Regenerate.
2663 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2665 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2666 sanity check at the head of this function.
2668 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2670 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2671 dwarf_line_str_size.
2672 (struct attr_abbrev): Add field implicit_const.
2673 (dwarf_debug_sections): Add .debug_line_str.
2674 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2675 (dwarf_debug_section_assert): Add static assertion.
2676 (read_indirect_line_string): New.
2677 (read_abbrevs): Support DW_FORM_implicit_const.
2678 (is_str_attr): Support DW_FORM_line_strp.
2679 (read_attribute_value): Support DW_FORM_line_strp and
2680 DW_FORM_implicit_const.
2681 (read_attribute): Support DW_FORM_implicit_const.
2682 (line_info_add_include_dir, line_info_add_include_dir_stub):
2683 (line_info_add_file_name, read_formatted_entries): New.
2684 (decode_line_info, parse_comp_unit): Support DWARF 5.
2685 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2687 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2689 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2690 abort statement that was put for symbols that are not dynamic.
2692 2017-07-03 Tristan Gingold <gingold@adacore.com>
2694 * po/bfd.pot: Regenerate
2696 2017-07-03 Alan Modra <amodra@gmail.com>
2698 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2699 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2700 * elf.c (setup_group): Use "Lx" to print sh_size.
2701 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2702 unknown section type in hex.
2703 (copy_special_section_fields): Style fix.
2704 (bfd_section_from_shdr): Correct format for sh_link. Use a
2705 common error message for all the variants of unrecognized
2707 (assign_file_positions_for_load_sections): Use "Lx" for lma
2708 adjust error message.
2709 (assign_file_positions_for_non_load_sections): Formatting.
2710 (rewrite_elf_program_header): Formatting. Use "Lx" for
2711 bfd_vma values in error messages.
2712 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2713 ELF_R_SYM value to type expected by format.
2714 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2716 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2717 (elf_link_input_bfd): Use "Lx" for r_info.
2718 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2720 2017-07-03 Alan Modra <amodra@gmail.com>
2722 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2723 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2724 Microsoft C library variant of long long format specifier.
2725 (PRINT20): Cast value to bfd_uint64_t not long long.
2726 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2727 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2728 long long. Don't cast to bfd_vma.
2729 * elf32-score.c (score3_bfd_getl48): Likewise.
2730 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2732 2017-07-03 Alan Modra <amodra@gmail.com>
2734 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2736 (bfd_elf_print_symbol): Don't cast symbol->flags.
2737 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2738 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2739 _bfd_error_handler argument order.
2740 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2742 2017-07-03 Alan Modra <amodra@gmail.com>
2744 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2745 AC_TYPE_LONG_DOUBLE.
2746 * configure: Regenerate.
2747 * config.in: Regenerate.
2749 2017-06-29 Andrew Waterman <andrew@sifive.com>
2751 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2754 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2756 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2757 unless it is undefined weak.
2758 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2759 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2761 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2762 is not dynamic in PIC, abort.
2764 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2767 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2768 undefined weak symbols into dynamic.
2769 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2770 relocation for non-dynamic symbols.
2771 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2773 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2775 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2776 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2777 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2778 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2779 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2782 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2784 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2785 (elfcore_write_s390_gs_bc): Likewise.
2786 * elf.c (elfcore_grok_s390_gs_cb): New function.
2787 (elfcore_grok_s390_gs_bc): New function.
2788 (elfcore_grok_note): Call them.
2789 (elfcore_write_s390_gs_cb): New function.
2790 (elfcore_write_s390_gs_bc): New function.
2791 (elfcore_write_register_note): Call them.
2793 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2795 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2796 bfd_get_file_size. Check archive element size.
2797 (_bfd_generic_get_section_contents_in_window): Likewise.
2799 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2801 * bfd-in2.h: Regenerated.
2802 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2803 (bfd_get_file_size): Likewise.
2805 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2806 Matthew Fortune <matthew.fortune@imgtec.com>
2808 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2809 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2810 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2811 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2813 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2814 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2815 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2816 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2817 `bfd_mach_mips_interaptiv_mr2' entries.
2818 * bfd-in2.h: Regenerate.
2820 2017-06-27 Nick Clifton <nickc@redhat.com>
2822 * tekhex.c (pass_over): Revert accidental conversion of a local
2823 array to a static array.
2825 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2828 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2829 reloc addend if necessary. Adjust diff only if
2830 shrinked_insn_address < end_address.
2832 2017-06-27 Alan Modra <amodra@gmail.com>
2835 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2836 (_bfd_generic_get_section_contents_in_window): Likewise.
2838 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2840 * elfnn-riscv.c (perform_relocation): Support the new
2841 R_RISCV_32_PCREL relocation.
2842 (riscv_elf_relocate_section): Likewise.
2843 * elfxx-riscv.c (howto_table): Likewise.
2844 (riscv_reloc_map): Likewise.
2845 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2846 * libbfd.h: Regenerate.
2848 2017-06-27 Alan Modra <amodra@gmail.com>
2851 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2852 Use unsigned file pointer type, and remove cast.
2853 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2854 Add "count", not "sz".
2856 2017-06-26 Pedro Alves <palves@redhat.com>
2859 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2862 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2865 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2868 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2870 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2871 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2872 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2873 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2874 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2876 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2879 * compress.c (bfd_get_full_section_contents): Don't check the
2881 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2882 reject a section whose size + offset is greater than the size
2884 (_bfd_generic_get_section_contents_in_window): Likewise.
2886 2017-06-26 Nick Clifton <nickc@redhat.com>
2889 * tekhex.c (getvalue): Check for the source pointer exceeding the
2890 end pointer before the first byte is read.
2892 2017-06-26 Nick Clifton <nickc@redhat.com>
2895 * opncls.c (get_build_id): Check that the section is big enough
2896 to contain the whole note.
2897 * compress.c (bfd_get_full_section_contents): Check for and reject
2898 a section whose size is greater than the size of the entire file.
2899 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2900 contain a notes section.
2902 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2904 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2906 (elf_s390_modify_segment_map): Likewise.
2907 (bfd_elf_s390_set_options): Lisewise.
2909 2017-06-26 Alan Modra <amodra@gmail.com>
2911 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2913 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2914 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2915 .preinit_array on --just-syms bfds.
2916 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2917 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2918 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2920 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2922 * elf.c (find_link): Bounds check "hint".
2924 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2926 * elf32-arm.c (using_thumb_only): Update list of architectures in
2927 BFD_ASSERT for which the logic is valid.
2928 (using_thumb2_bl): Likewise.
2929 (using_thumb2): Likewise and return true for ARMv8-R.
2930 (arch_has_arm_nop): Likewise.
2931 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2932 merging logic. Update commentis for value 15 of v8m_baseline,
2933 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2934 merging of value 15 of Tag_CPU_arch.
2936 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2938 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2939 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2940 * bfd-in2.h: Regenerate.
2942 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2944 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2945 the error_alignment label forward. Properly align program
2946 property note section.
2948 2017-06-22 Eric Christopher <echristo@gmail.com>
2950 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2951 abs to fix a truncation warning.
2953 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2955 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2956 local undefined weak symbol to 0.
2957 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2959 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2961 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2962 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2963 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2964 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2965 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2966 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2967 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2968 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2970 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2972 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2973 (elf_i386_lazy_ibt_plt_entry): Likewise.
2974 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2975 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2976 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2977 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2978 (elf_i386_lazy_plt_layout): Likewise.
2979 (elf_i386_non_lazy_plt_layout): Likewise.
2980 (elf_i386_link_hash_entry): Add plt_second.
2981 (elf_i386_link_hash_table): Add plt_second and
2982 plt_second_eh_frame.
2983 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2984 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2985 the second PLT. Check the second PLT.
2986 (elf_i386_relocate_section): Use the second PLT to resolve
2987 PLT reference if needed.
2988 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2990 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2991 second PLT. Generate unwind info for the second PLT.
2992 (elf_i386_plt_type): Add plt_second.
2993 (elf_i386_get_synthetic_symtab): Support the second PLT.
2994 (elf_i386_parse_gnu_properties): Support
2995 GNU_PROPERTY_X86_FEATURE_1_AND.
2996 (elf_i386_merge_gnu_properties): Support
2997 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2998 on GNU_PROPERTY_X86_FEATURE_1_IBT
2999 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3000 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3001 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3002 is set on all relocatable inputs.
3003 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3004 (elf_x32_lazy_ibt_plt_entry): Likewise.
3005 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3006 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3007 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3008 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3009 (elf_x86_64_lazy_ibt_plt): Likewise.
3010 (elf_x32_lazy_ibt_plt): Likewise.
3011 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3012 (elf_x32_non_lazy_ibt_plt): Likewise.
3013 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3014 (elf_x86_64_parse_gnu_properties): Support
3015 GNU_PROPERTY_X86_FEATURE_1_AND.
3016 (elf_x86_64_merge_gnu_properties): Support
3017 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3018 on GNU_PROPERTY_X86_FEATURE_1_IBT
3019 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3020 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3021 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3022 is set on all relocatable inputs.
3024 2017-06-22 Nick Clifton <nickc@redhat.com>
3027 * som.c (setup_sections): NUL terminate the space_strings buffer.
3028 Check that the space.name field does not index beyond the end of
3029 the space_strings buffer.
3031 2017-06-21 Nick Clifton <nickc@redhat.com>
3034 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3036 2017-06-21 Nick Clifton <nickc@redhat.com>
3039 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3040 type of the size parameter.
3041 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3042 length of the counted string.
3043 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3044 (_bfd_vms_save_counted_string): Likewise.
3045 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3046 _bfd_vms_save_counted_string.
3047 (_bfd_vms_slurp_ehdr): Likewise.
3048 (_bfd_vms_slurp_egsd): Likewise.
3049 (Parse_module): Likewise.
3051 2017-06-21 Alan Modra <amodra@gmail.com>
3053 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3054 calls before tocsave calls.
3055 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3058 2017-06-21 Nick Clifton <nickc@redhat.com>
3061 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3062 bfd_get_full_section_contents returns no contents.
3064 2017-06-21 Nick Clifton <nickc@redhat.com>
3067 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3070 2017-06-21 Nick Clifton <nickc@redhat.com>
3073 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3075 (image_set_ptr): Likewise.
3076 (alpha_vms_fix_sec_rel): Likewise.
3077 (alpha_vms_slurp_relocs): Likewise.
3079 2017-06-21 Nick Clifton <nickc@redhat.com>
3082 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3084 (ieee_archive_p): Likewise.
3085 (ieee_object_p): Likewise.
3087 2017-06-21 Nick Clifton <nickc@redhat.com>
3090 * elf.c (setup_group): Zero the group section pointer list after
3091 allocation so that loops can be caught. Check for NULL pointers
3092 when processing a group list.
3094 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3096 * elf-s390.h: New file.
3097 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3099 (elf_s390_additional_program_headers): New function.
3100 (elf_s390_modify_segment_map): New function.
3101 (bfd_elf_s390_set_options): New function.
3102 (elf_backend_additional_program_headers)
3103 (elf_backend_modify_segment_map): Add macro definitions.
3105 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3108 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3109 the DYNAMIC bit instead of bfd_count_sections.
3111 2017-06-19 Nick Clifton <nickc@redhat.com>
3114 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3116 (evax_bfd_print_eeom): Likewise.
3117 (evax_bfd_print_egsd): Check for an overlarge record length.
3118 (evax_bfd_print_etir): Likewise.
3120 2017-06-19 Nick Clifton <nickc@redhat.com>
3123 * libieee.h (struct common_header_type): Add end_p field.
3124 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3126 (read_id): Check for a length that exceeds the remaining bytes in
3128 (ieee_seek): Initialise end_p.
3129 (ieee_archive_p): Likewise.
3130 (ieee_object_p): Likewise.
3132 2017-06-19 Nick Clifton <nickc@redhat.com>
3135 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3136 before reading the EIHS structure entries.
3138 2017-06-19 Nick Clifton <nickc@redhat.com>
3141 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3142 gsd_size. Check that there are enough bytes remaining to read the
3143 type and size of the next egsd. Check that the size of the egsd
3144 does not exceed the size of the record.
3146 2017-06-19 Alan Modra <amodra@gmail.com>
3148 * config.bfd: Correct targ_underscore for cris.
3150 2017-06-18 Alan Modra <amodra@gmail.com>
3152 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3153 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3155 2017-06-16 Nick Clifton <nickc@redhat.com>
3157 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3158 bucketlist is empty because there are no symbols to add to the
3161 2017-06-16 Alan Modra <amodra@gmail.com>
3167 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3168 (BFD_JUMP_TABLE_LINK): Likewise.
3169 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3170 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3171 (bfd_elf_define_start_stop): New function.
3172 * linker.c (bfd_generic_define_start_stop): New function.
3173 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3175 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3176 * aout-target.h (MY_bfd_define_start_stop): Define.
3177 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3178 * binary.c (binary_bfd_define_start_stop): Define.
3179 * bout.c (b_out_bfd_define_start_stop): Define.
3180 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3181 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3182 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3183 * coffcode.h (coff_bfd_define_start_stop): Define.
3184 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3185 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3186 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3187 * ieee.c (ieee_bfd_define_start_stop): Define.
3188 * ihex.c (ihex_bfd_define_start_stop): Define.
3189 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3190 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3191 * mmo.c (mmo_bfd_define_start_stop): Define.
3192 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3193 * oasys.c (oasys_bfd_define_start_stop): Define.
3194 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3195 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3196 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3197 * som.c (som_bfd_define_start_stop): Define.
3198 * srec.c (srec_bfd_define_start_stop): Define.
3199 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3200 * versados.c (versados_bfd_define_start_stop): Define.
3201 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3202 (alpha_vms_bfd_define_start_stop): Define.
3203 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3204 * bfd-in2.h: Regenerate.
3205 * libbfd.h: Regenerate.
3207 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3209 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3210 SYMBOL_REFERENCES_LOCAL.
3212 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3215 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3216 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3217 runtime for if there needs copy relocation elimination.
3218 (need_copy_relocation_p): New function. Return true for symbol with
3219 pc-relative references and if it's against read-only sections.
3220 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3221 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3222 that are related with accessing external objects.
3223 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3224 in elfNN_aarch64_check_relocs.
3226 2017-06-15 Nick Clifton <nickc@redhat.com>
3229 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3232 (ieee_archive_p): Likewise.
3234 2017-06-15 Nick Clifton <nickc@redhat.com>
3237 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3239 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3241 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3242 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3243 keep both windowed and call0 ABI PLT definitions.
3244 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3245 elf_xtensa_*_plt_entry endex.
3246 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3248 2017-06-14 Nick Clifton <nickc@redhat.com>
3251 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3254 2017-06-14 Nick Clifton <nickc@redhat.com>
3257 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3258 maximum value for the ascic pointer. Check that name processing
3259 does not read beyond this value.
3260 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3263 2017-06-14 Nick Clifton <nickc@redhat.com>
3266 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3267 (process_otr): Check for an invalid offset in the otr structure.
3269 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3271 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3273 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3279 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3280 vtable field to a union.
3281 (_bfd_elf_is_start_stop): Removed.
3282 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3283 __start_SECNAME and __stop_SECNAME symbols.
3284 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3285 * elflink.c (_bfd_elf_is_start_stop): Removed.
3286 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3287 _bfd_elf_is_start_stop.
3288 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3289 __stop_SECNAME symbols. Updated.
3290 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3291 (bfd_elf_gc_record_vtinherit): Likewise.
3292 (bfd_elf_gc_record_vtentry): Likewise.
3294 2017-06-13 Nick Clifton <nickc@redhat.com>
3297 * elflink.c (elf_link_adjust_relocs): Generate an error when
3298 encountering a reloc against a symbol removed by garbage
3301 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3303 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3304 to merge_gnu_properties.
3305 * elf-properties.c (elf_merge_gnu_properties): Add struct
3306 bfd_link_info * and pass it to merge_gnu_properties.
3307 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3308 and pass it to elf_merge_gnu_properties.
3309 (_bfd_elf_link_setup_gnu_properties): Pass info to
3310 elf_merge_gnu_property_list.
3311 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3313 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3315 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3318 * binary.c (binary_set_section_contents): Scale lma by octets
3319 per byte to set filepos.
3321 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3323 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3326 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3328 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3331 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3333 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3334 patched section contents for TLS IE reloc.
3335 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3337 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3339 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3340 RELOC_FOR_GLOBAL_SYMBOL macro.
3342 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3344 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3347 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3349 * config/tc-arc.c (md_undefined_symbol): Changed.
3350 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3352 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3354 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3357 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3359 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3360 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3362 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3364 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3367 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3369 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3370 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3371 is non-zero. Add clarifying comments.
3373 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3375 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3376 name. Use local IFUNC symbol name string to report unsupported
3377 non-PIC call to IFUNC function.
3378 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3379 when generating R_386_IRELATIVE relocation.
3380 (elf_i386_finish_dynamic_symbol): Likewise.
3381 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3383 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3384 when generating R_X86_64_IRELATIVE relocation.
3385 (elf_x86_64_finish_dynamic_symbol): Likewise.
3387 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3389 * elf.c (setup_group): Make sure BFD sections are created for all
3390 group sections in the input file when processing SHF_GROUP
3392 (bfd_section_from_shdr): Avoid duplicating logic already
3393 implemented in `setup_group'.
3395 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3398 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3399 if the hint address is zero.
3401 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3404 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3405 ELF_COMMON_DEF_P for common symbols.
3407 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3409 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3410 SEC_GROUP sections as SEC_EXCLUDE.
3411 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3412 (assign_section_numbers): Use resolve_section_groups flag instead
3413 of relocatable link type.
3414 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3415 flag instead of checking the final_link flag for part of the
3416 checks in here. Fix white space as a result.
3417 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3418 instead of relocatable link type.
3419 (bfd_elf_final_link): Likewise.
3421 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3423 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3425 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3426 (s3_bfd_score_elf_check_relocs): Likewise.
3427 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3428 (score_elf_final_link_relocate): Likewise.
3429 (s7_bfd_score_elf_check_relocs): Likewise.
3431 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3433 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3436 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3438 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3439 from `reloc_count' rather than decrementing it.
3440 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3441 `reloc_count' by `int_rels_per_ext_rel'.
3442 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3443 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3444 entry determination.
3445 (s3_bfd_score_elf_check_relocs): Likewise.
3446 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3447 (s7_bfd_score_elf_relocate_section): Likewise.
3448 (s7_bfd_score_elf_check_relocs): Likewise.
3449 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3450 prototype and function.
3451 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3452 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3453 triple rather than once the sum of REL and RELA relocation entry
3455 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3456 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3457 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3458 storage allocation size determination.
3459 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3460 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3461 by `int_rels_per_ext_rel' for last relocation entry
3463 (bfd_elf_final_link): Do not multiply `reloc_count' by
3464 `int_rels_per_ext_rel' for internal relocation storage
3465 allocation size determination.
3466 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3467 `int_rels_per_ext_rel' for last relocation entry determination.
3468 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3469 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3470 (_bfd_mips_elf_relocate_section): Likewise.
3472 2017-06-05 Alan Modra <amodra@gmail.com>
3475 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3477 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3479 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3480 determine structure sizes.
3481 (elfcore_grok_freebsd_prstatus): Likewise.
3483 2017-06-01 Alan Modra <amodra@gmail.com>
3485 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3486 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3488 (is_elfv2_localentry0): New function.
3489 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3490 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3491 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3492 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3493 optimized localentry:0 stubs.
3494 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3495 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3497 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3499 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3501 2017-05-30 Casey Smith <clegg89@gmail.com>
3504 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3505 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3507 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3509 * cpu-arc.c (arc_compatible): New function.
3511 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3513 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3515 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3518 * bfdio.c (bfd_get_file_size): New function.
3519 * bfd-in2.h: Regenerated.
3521 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3523 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3526 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3528 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3529 dynobj instead of htab->elf.dynobj.
3531 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3533 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3535 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3536 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3537 actual number of internal relocations retrieved. Adjust
3538 function description.
3539 (bfd_elf64_canonicalize_reloc): Remove macro.
3540 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3542 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3544 * archures.c (bfd_mach_sparc_v9m8): Define.
3545 (bfd_mach_sparc_v8plusm8): Likewise.
3546 (bfd_mach_sparc_v9_p): Adjust to M8.
3547 (bfd_mach_sparc_64bit_p): Likewise.
3548 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3549 bfd_mach_sparc_v8plusm8.
3550 * bfd-in2.h: Regenerated.
3551 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3553 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3554 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3555 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3557 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3558 bfd_mach_sparc_v8plusm8.
3560 2017-05-19 Alan Modra <amodra@gmail.com>
3562 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3563 debug and special sections when no non-note alloc sections in an
3566 2017-05-18 Alan Modra <amodra@gmail.com>
3568 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3569 * elf-m10300.c: Likewise.
3571 * elf32-arc.c: Likewise.
3572 * elf32-bfin.c: Likewise.
3573 * elf32-m68k.c: Likewise.
3574 * elf32-nds32.c: Likewise.
3575 * elf32-tilepro.c: Likewise.
3576 * elflink.c: Likewise.
3577 * elfnn-aarch64.c: Likewise.
3578 * elfnn-riscv.c: Likewise.
3579 * elfxx-tilegx.c: Likewise.
3580 * mach-o.c: Likewise.
3581 * peXXigen.c: Likewise.
3582 * vms-alpha.c: Likewise.
3583 * vms-lib.c: Likewise.
3585 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3588 * elflink.c (elf_gc_mark_debug_section): New function.
3589 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3590 referenced by kept debug sections.
3592 2017-05-16 Alan Modra <amodra@gmail.com>
3594 * elf-m10300.c: Rename occurrences of non_ir_ref.
3595 * elf32-arm.c: Likewise.
3596 * elf32-bfin.c: Likewise.
3597 * elf32-cr16.c: Likewise.
3598 * elf32-cris.c: Likewise.
3599 * elf32-d10v.c: Likewise.
3600 * elf32-dlx.c: Likewise.
3601 * elf32-fr30.c: Likewise.
3602 * elf32-frv.c: Likewise.
3603 * elf32-hppa.c: Likewise.
3604 * elf32-i370.c: Likewise.
3605 * elf32-i386.c: Likewise.
3606 * elf32-iq2000.c: Likewise.
3607 * elf32-lm32.c: Likewise.
3608 * elf32-m32c.c: Likewise.
3609 * elf32-m32r.c: Likewise.
3610 * elf32-m68hc1x.c: Likewise.
3611 * elf32-m68k.c: Likewise.
3612 * elf32-mcore.c: Likewise.
3613 * elf32-metag.c: Likewise.
3614 * elf32-microblaze.c: Likewise.
3615 * elf32-moxie.c: Likewise.
3616 * elf32-msp430.c: Likewise.
3617 * elf32-mt.c: Likewise.
3618 * elf32-nios2.c: Likewise.
3619 * elf32-or1k.c: Likewise.
3620 * elf32-ppc.c: Likewise.
3621 * elf32-rl78.c: Likewise.
3622 * elf32-s390.c: Likewise.
3623 * elf32-score.c: Likewise.
3624 * elf32-score7.c: Likewise.
3625 * elf32-sh.c: Likewise.
3626 * elf32-tic6x.c: Likewise.
3627 * elf32-tilepro.c: Likewise.
3628 * elf32-v850.c: Likewise.
3629 * elf32-vax.c: Likewise.
3630 * elf32-xstormy16.c: Likewise.
3631 * elf32-xtensa.c: Likewise.
3632 * elf64-alpha.c: Likewise.
3633 * elf64-hppa.c: Likewise.
3634 * elf64-ia64-vms.c: Likewise.
3635 * elf64-mmix.c: Likewise.
3636 * elf64-ppc.c: Likewise.
3637 * elf64-s390.c: Likewise.
3638 * elf64-sh64.c: Likewise.
3639 * elf64-x86-64.c: Likewise.
3640 * elflink.c: Likewise.
3641 * elfnn-aarch64.c: Likewise.
3642 * elfnn-ia64.c: Likewise.
3643 * elfnn-riscv.c: Likewise.
3644 * elfxx-mips.c: Likewise.
3645 * elfxx-sparc.c: Likewise.
3646 * elfxx-tilegx.c: Likewise.
3647 * linker.c: Likewise.
3649 2017-05-16 Alan Modra <amodra@gmail.com>
3651 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3652 * elflink.c (elf_link_add_object_symbols): Update to use
3654 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3656 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3658 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3660 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3662 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3664 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3665 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3667 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3669 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3671 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3673 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3674 to plt_second/plt_second_eh_frame.
3675 (elf_x86_64_link_hash_newfunc): Updated.
3676 (elf_x86_64_allocate_dynrelocs): Likewise.
3677 (elf_x86_64_size_dynamic_sections): Likewise.
3678 (elf_x86_64_relocate_section): Likewise.
3679 (elf_x86_64_finish_dynamic_symbol): Likewise.
3680 (elf_x86_64_finish_dynamic_sections): Likewise.
3681 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3682 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3684 (elf_backend_setup_gnu_properties): Updated. Create the
3685 .plt.sec section instead of the .plt.sec section.
3687 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3689 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3690 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3691 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3693 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3695 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3696 (bfd_elf64_set_reloc): Define.
3697 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3699 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3701 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3702 (struct bfd_target): New field _bfd_set_reloc.
3703 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3704 * reloc.c (_bfd_generic_set_reloc): New function.
3705 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3706 * nlm-target.h (nlm_set_reloc): Likewise.
3707 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3708 * aout-tic30.c (MY_set_reloc): Likewise.
3709 * aout-target.h (MY_set_reloc): Likewise.
3710 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3711 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3712 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3713 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3714 * aout-adobe.c (aout_32_set_reloc): Likewise.
3715 * bout.c (b_out_set_reloc): Likewise.
3716 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3717 * i386os9k.c (aout_32_set_reloc): Likewise.
3718 * ieee.c (ieee_set_reloc): Likewise.
3719 * oasys.c (oasys_set_reloc): Likewise.
3720 * som.c (som_set_reloc): Likewise.
3721 * versados.c (versados_set_reloc): Likewise.
3722 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3723 _bfd_generic_set_reloc.
3724 (rs6000_xcoff64_aix_vec): LIkewise.
3725 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3726 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3727 * i386msdos.c (msdos_set_reloc): Define to
3728 _bfd_norelocs_set_reloc.
3729 * elfcode.h (elf_set_reloc): Define.
3730 * bfd-in2.h: Regenerated.
3732 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3735 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3736 for IFUNC function address.
3738 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3740 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3741 (CONFLICT_LIST): Likewise.
3742 (opcode/arc-attrs.h): Include.
3743 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3744 (arc_extract_features): New file.
3745 (arc_stralloc): Likewise.
3746 (arc_elf_merge_attributes): Likewise.
3747 (arc_elf_merge_private_bfd_data): Use object attributes.
3748 (bfd_arc_get_mach_from_attributes): New function.
3749 (arc_elf_object_p): Use object attributes.
3750 (arc_elf_final_write_processing): Likewise.
3751 (elf32_arc_obj_attrs_arg_type): New function.
3752 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3753 (elf32_arc_section_from_shdr): Likewise.
3754 (elf_backend_obj_attrs_vendor): Define.
3755 (elf_backend_obj_attrs_section): Likewise.
3756 (elf_backend_obj_attrs_arg_type): Likewise.
3757 (elf_backend_obj_attrs_section_type): Likewise.
3758 (elf_backend_obj_attrs_handle_unknown): Likewise.
3759 (elf_backend_section_from_shdr): Likewise.
3761 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3764 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3765 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3766 and the destination is a Thumb symbol.
3768 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3770 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3771 initializer to silence GCC 4.2.
3772 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3774 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3776 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3777 (LAZY_PLT_ENTRY_SIZE): This.
3778 (NON_LAZY_PLT_ENTRY_SIZE): New.
3779 (elf_x86_64_plt0_entry): Renamed to ...
3780 (elf_x86_64_lazy_plt0_entry): This.
3781 (elf_x86_64_plt_entry): Renamed to ...
3782 (elf_x86_64_lazy_plt_entry): This.
3783 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3784 (elf_x86_64_lazy_bnd_plt0_entry): This.
3785 (elf_x86_64_legacy_plt_entry): Removed.
3786 (elf_x86_64_bnd_plt_entry): Renamed to ...
3787 (elf_x86_64_lazy_bnd_plt_entry): This.
3788 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3789 (elf_x86_64_non_lazy_plt_entry): This.
3790 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3791 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3792 (elf_x86_64_eh_frame_plt): Renamed to ...
3793 (elf_x86_64_eh_frame_lazy_plt): This.
3794 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3795 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3796 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3797 (elf_x86_64_eh_frame_non_lazy_plt): This.
3798 (elf_x86_64_lazy_plt_layout): New.
3799 (elf_x86_64_non_lazy_plt_layout): Likewise.
3800 (elf_x86_64_plt_layout): Likewise.
3801 (elf_x86_64_backend_data): Remove PLT layout information. Add
3802 os for target system.
3803 (GET_PLT_ENTRY_SIZE): Removed.
3804 (elf_x86_64_lazy_plt): New.
3805 (elf_x86_64_non_lazy_plt): Likewise.
3806 (elf_x86_64_lazy_bnd_plt): Likewise.
3807 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3808 (elf_x86-64_arch_bed): Updated.
3809 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3810 (elf_x86_64_create_dynamic_sections): Removed.
3811 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3812 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3813 (elf_x86-64_adjust_dynamic_symbol): Updated.
3814 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3815 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3816 size for PLT0 if there is no PLT0. Get plt_entry_size from
3817 non_lazy_plt for non-lazy PLT entries.
3818 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3819 from non_lazy_plt for non-lazy PLT entries.
3820 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3821 if there is no PLT0.
3822 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3823 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3824 entries with non-lazy PLT layout. Don't fill the second and third
3825 slots in the PLT entry if there is no PLT0.
3826 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3827 if there is no PLT0. Set sh_entsize on the .plt.got section.
3828 (compare_relocs): New.
3829 (elf_x86_64_plt_type): Likewise.
3830 (elf_x86_64_plt): Likewise.
3831 (elf_x86_64_nacl_plt): New. Forward declaration.
3832 (elf_x86_64_get_plt_sym_val): Removed.
3833 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3834 against all dynamic relocations.
3835 (elf_x86_64_link_setup_gnu_properties): New function.
3836 (elf_backend_create_dynamic_sections): Updated.
3837 (elf_backend_setup_gnu_properties): New.
3838 (elf_x86_64_nacl_plt): New.
3839 (elf_x86_64_nacl_arch_bed): Updated.
3841 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3843 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3844 (LAZY_PLT_ENTRY_SIZE): This.
3845 (NON_LAZY_PLT_ENTRY_SIZE): New.
3846 (elf_i386_plt0_entry): Renamed to ...
3847 (elf_i386_lazy_plt0_entry): This.
3848 (elf_i386_plt_entry): Renamed to ...
3849 (elf_i386_lazy_plt_entry): This.
3850 (elf_i386_pic_plt0_entry): Renamed to ...
3851 (elf_i386_pic_lazy_plt0_entry): This.
3852 (elf_i386_pic_plt_entry): Renamed to ...
3853 (elf_i386_pic_lazy_plt_entry): This.
3854 (elf_i386_got_plt_entry): Renamed to ...
3855 (elf_i386_non_lazy_plt_entry): This.
3856 (elf_i386_pic_got_plt_entry): Renamed to ...
3857 (elf_i386_pic_non_lazy_plt_entry): This.
3858 (elf_i386_eh_frame_plt): Renamed to ...
3859 (elf_i386_eh_frame_lazy_plt): This.
3860 (elf_i386_eh_frame_plt_got): Renamed to ...
3861 (elf_i386_eh_frame_non_lazy_plt): This.
3862 (elf_i386_plt_layout): Renamed to ...
3863 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3864 eh_frame_plt_got_size.
3865 (elf_i386_non_lazy_plt_layout): New.
3866 (elf_i386_plt_layout): Likewise.
3867 (elf_i386_non_lazy_plt): Likewise.
3868 (GET_PLT_ENTRY_SIZE): Removed.
3869 (elf_i386_plt): Renamed to ...
3870 (elf_i386_lazy_plt): This.
3871 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3872 (elf_i386_arch_bed): Updated.
3873 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3874 (elf_i386_create_dynamic_sections): Removed.
3875 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3876 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3877 (elf_i386_adjust_dynamic_symbol): Updated.
3878 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3879 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3880 size for PLT0 if there is no PLT0.
3881 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3882 output section is discarded only if GOT isn't empty.
3883 (elf_i386_relocate_section): Updated. Properly get PLT index
3884 if there is no PLT0.
3885 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3886 second and third slots in the PLT entry if there is no PLT0.
3887 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3888 if there is no PLT0. Set sh_entsize on the .plt.got section.
3889 (elf_i386_nacl_plt): Forward declaration.
3890 (elf_i386_get_plt_sym_val): Removed.
3891 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3892 against all dynamic relocations.
3893 (elf_i386_link_setup_gnu_properties): New function.
3894 (elf_backend_create_dynamic_sections): Updated.
3895 (elf_backend_setup_gnu_properties): New.
3896 (elf_i386_nacl_plt): Updated.
3897 (elf_i386_nacl_arch_bed): Likewise.
3898 (elf_i386_vxworks_arch_bed): Likewise.
3900 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3902 * elflink.c (elf_output_implib): Remove executable flag from import
3904 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3905 library is a relocatable object file.
3907 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3910 * elf32-avr.c (avr_should_move_sym): New function.
3911 (avr_should_reduce_sym_size): Likewise.
3912 (avr_should_increase_sym_size): Likewise.
3913 (elf32_avr_relax_delete_bytes): Adjust symbol values
3914 and sizes by calling new functions.
3916 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3918 * config.bfd (riscv32-*): Enable rv64.
3920 2017-05-02 Alan Modra <amodra@gmail.com>
3923 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3924 rather than h->root.type == bfd_link_hash_new.
3925 (bfd_elf_record_link_assignment): Similarly, call
3926 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3928 2017-04-29 Alan Modra <amodra@gmail.com>
3931 * reloc.c (reloc_offset_in_range): New function.
3932 (bfd_perform_relocation, bfd_install_relocation): Use it.
3933 (_bfd_final_link_relocate): Likewise.
3935 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3937 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3938 before using .plt.got.
3939 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3941 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3943 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3944 instead of "+=" to update 0.
3946 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3948 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3949 .plt.got section here.
3950 (elf_i386_check_relocs): Don't create the .plt.got section.
3951 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3952 the .plt.got and .plt.bnd sections here.
3953 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3956 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3958 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3960 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3961 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3962 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3963 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3966 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3968 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3970 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3971 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3972 the first relocatable ELF input with GNU properties.
3974 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3976 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3977 VxWorks for non-PIC.
3979 2017-04-27 Alan Modra <amodra@gmail.com>
3981 * elf-bfd.h (struct elf_backend_data): Make asection param of
3982 elf_backend_eh_frame_address_size const.
3983 (_bfd_elf_eh_frame_address_size): Likewise.
3984 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3985 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3986 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3987 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3988 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3989 (next_cie_fde_offset): Constify params.
3990 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3992 2017-04-27 Alan Modra <amodra@gmail.com>
3994 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3995 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3996 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3998 (offset_adjust): New function.
3999 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4000 (adjust_eh_frame_local_symbols): Likewise.
4001 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4002 after changing anything. Return true if anything changed.
4003 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4004 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4006 2017-04-27 Alan Modra <amodra@gmail.com>
4008 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4011 2017-04-27 Alan Modra <amodra@gmail.com>
4013 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4014 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4015 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4016 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4017 for undef and undefweak dyn_relocs.
4018 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4019 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4020 (allocate_got, allocate_dynrelocs): Likewise.
4021 (ppc64_elf_relocate_section): Likewise.
4023 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4025 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4026 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4027 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4028 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4030 2017-04-26 Nick Clifton <nickc@redhat.com>
4033 * reloc.c (bfd_perform_relocation): Check for a negative address
4036 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4039 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4041 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4042 (elf_backend_always_renumber_dynsyms): Define.
4043 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4044 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4045 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4046 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4048 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4050 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4052 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4053 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4054 sections have been created.
4056 2017-04-26 Nick Clifton <nickc@redhat.com>
4059 * compress.c (bfd_init_section_compress_status): Check the return
4060 value from bfd_malloc.
4062 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4064 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4065 no_finish_dynamic_symbol.
4066 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4068 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4069 weak symbol, don't make it dynamic.
4070 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4071 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4072 relocation for GOT reference.
4073 (elf_x86_64_finish_dynamic_symbol): Abort if
4074 no_finish_dynamic_symbol isn't 0.
4076 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4079 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4080 undefined weak symbol, don't make it dynamic.
4081 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4082 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4083 relocation for R_386_GOT32.
4085 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4088 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4090 2017-04-23 Alan Modra <amodra@gmail.com>
4093 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4094 * elf.c (lcomm_sym): New.
4095 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4096 * bfd-in2.h: Regenerate.
4098 2017-04-23 Alan Modra <amodra@gmail.com>
4101 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4102 parameters and comment.
4103 (_bfd_elf_get_reloc_section): Delete.
4104 (_bfd_elf_plt_get_reloc_section): Declare.
4105 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4106 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4108 (_bfd_elf_get_reloc_section): ..here. Delete.
4109 (assign_section_numbers): Call elf_get_reloc_section.
4110 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4111 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4113 2017-04-23 Alan Modra <amodra@gmail.com>
4116 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4119 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4122 * elf32-i386.c (elf_i386_link_hash_entry): Add
4123 no_finish_dynamic_symbol.
4124 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4125 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4126 symbol, don't make it dynamic in PIE.
4127 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4128 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4129 relocation for R_386_GOT32
4130 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4133 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4137 * elflink.c (elf_link_add_object_symbols): Require
4138 --no-dynamic-linker with -E/--dynamic-list when creating
4141 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4143 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4146 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4148 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4149 dynamic symbol sorting.
4151 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4154 * elflink.c (elf_link_add_object_symbols): Preserve
4155 dynamic_ref_after_ir_def when restoring the symbol table for
4156 unneeded dynamic object.
4158 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4161 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4162 on on undefined IFUNC symbol in the second PLT.
4164 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4166 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4168 2017-04-19 Alan Modra <amodra@gmail.com>
4170 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4171 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4172 * elf32-ppc.c:Formatting.
4173 (ensure_undefweak_dynamic): Don't make dynamic when
4174 info->dynamic_undefined_weak is zero.
4175 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4176 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4177 not default visibility. Discard undef and undefweak
4179 (ppc_elf_relocate_section): Adjust to suit.
4180 * elf64-ppc.c: Formatting.
4181 (ensure_undefweak_dynamic): Don't make dynamic when
4182 info->dynamic_undefined_weak is zero.
4183 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4184 info->dynamic_undefined_weak. Discard them earlier.
4186 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4189 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4190 before generating the version definition section.
4192 2017-04-17 Alan Modra <amodra@gmail.com>
4194 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4195 state when a regular object file defines a symbol with
4196 incompatible type to that defined by an earlier shared lib.
4198 2017-04-13 Alan Modra <amodra@gmail.com>
4200 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4202 * elf32-arm.c: Likewise.
4203 * elf32-i386.c: Likewise.
4204 * elf32-mep.c: Likewise.
4205 * elf64-ia64-vms.c: Likewise.
4206 * elf64-x86-64.c: Likewise.
4207 * elflink.c: Likewise.
4208 * elfnn-ia64.c: Likewise.
4209 * elfxx-mips.c: Likewise.
4211 2017-04-13 Alan Modra <amodra@gmail.com>
4213 * aoutx.h: Use %B and %A in error messages throughout file.
4214 * aout-cris.c: Likewise.
4215 * archive.c: Likewise.
4216 * binary.c: Likewise.
4217 * coff-rs6000.c: Likewise.
4218 * coff-tic4x.c: Likewise.
4219 * coffcode.h: Likewise.
4220 * coffgen.c: Likewise.
4221 * cofflink.c: Likewise.
4222 * coffswap.h: Likewise.
4223 * cpu-arm.c: Likewise.
4224 * elf-eh-frame.c: Likewise.
4225 * elf-m10300.c: Likewise.
4227 * elf32-arc.c: Likewise.
4228 * elf32-arm.c: Likewise.
4229 * elf32-bfin.c: Likewise.
4230 * elf32-frv.c: Likewise.
4231 * elf32-iq2000.c: Likewise.
4232 * elf32-m32c.c: Likewise.
4233 * elf32-microblaze.c: Likewise.
4234 * elf32-nds32.c: Likewise.
4235 * elf32-rl78.c: Likewise.
4236 * elf32-rx.c: Likewise.
4237 * elf32-score.c: Likewise.
4238 * elf32-score7.c: Likewise.
4239 * elf32-sh64.c: Likewise.
4240 * elf32-v850.c: Likewise.
4241 * elf32-vax.c: Likewise.
4242 * elf32-visium.c: Likewise.
4243 * elf64-ia64-vms.c: Likewise.
4244 * elf64-mmix.c: Likewise.
4245 * elf64-sh64.c: Likewise.
4246 * elfcode.h: Likewise.
4247 * elfnn-aarch64.c: Likewise.
4248 * elfnn-ia64.c: Likewise.
4249 * elfxx-mips.c: Likewise.
4250 * hpux-core.c: Likewise.
4253 * linker.c: Likewise.
4254 * merge.c: Likewise.
4256 * oasys.c: Likewise.
4257 * pdp11.c: Likewise.
4258 * peXXigen.c: Likewise.
4259 * rs6000-core.c: Likewise.
4260 * vms-alpha.c: Likewise.
4261 * xcofflink.c: Likewise.
4263 2017-04-13 Alan Modra <amodra@gmail.com>
4265 * bfd.c (PRINT_TYPE): Define.
4266 (_doprnt): New function.
4267 (error_handler_internal): Use _doprnt.
4268 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4269 calls in their natural order, throughout file.
4270 * coff-mcore.c: Likewise.
4271 * coff-ppc.c: Likewise.
4272 * coff-tic80.c: Likewise.
4273 * cofflink.c: Likewise.
4274 * elf-s390-common.c: Likewise.
4276 * elf32-arm.c: Likewise.
4277 * elf32-i386.c: Likewise.
4278 * elf32-m32r.c: Likewise.
4279 * elf32-msp430.c: Likewise.
4280 * elf32-spu.c: Likewise.
4281 * elf64-ia64-vms.c: Likewise.
4282 * elf64-sparc.c: Likewise.
4283 * elf64-x86-64.c: Likewise.
4284 * elflink.c: Likewise.
4285 * elfnn-aarch64.c: Likewise.
4286 * elfnn-ia64.c: Likewise.
4287 * elfxx-mips.c: Likewise.
4289 2017-04-13 Alan Modra <amodra@gmail.com>
4291 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4292 branch veneers" error. Fix double space and format message.
4293 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4294 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4296 2017-04-13 Alan Modra <amodra@gmail.com>
4298 * bfd-in2.h: Regenerate.
4300 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4302 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4303 extra `\n' in warning/error messages.
4304 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4305 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4307 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4309 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4310 processor-specific properties with generic ELF target vector.
4312 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4314 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4315 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4316 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4317 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4319 (link_hash_newfunc): Initialize has_got_reloc and
4321 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4323 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4325 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4327 (_bfd_sparc_elf_fixup_symbol): New function.
4328 (allocate_dynrelocs): Don't allocate space for dynamic
4329 relocations and discard relocations against resolved undefined
4330 weak symbols in executable. Don't make resolved undefined weak
4331 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4332 relocation against undefined weak symbols in PIE.
4333 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4334 relocations against resolved undefined weak symbols in PIE
4335 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4336 without ynamic PLT/GOT relocations for resolved undefined weak
4338 Don't generate dynamic relocation against resolved undefined
4339 weak symbol in executable.
4340 (pie_finish_undefweak_symbol): New function.
4341 (_bfd_sparc_elf_finish_dynamic_sections): Call
4342 pie_finish_undefweak_symbol on all symbols in PIE.
4343 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4344 (_bfd_sparc_elf_fixup_symbol): New function.
4346 2017-04-10 Nick Clifton <nickc@redhat.com>
4348 * config.bfd: Remove ns32k from obsolete list.
4350 2017-04-10 Alan Modra <amodra@gmail.com>
4353 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4354 (special_sections_i): Likewise for .init_array.
4355 (special_sections_p): Likewise for .preinit_array.
4357 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4361 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4362 ELF_COMMON_DEF_P for common symbols.
4363 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4364 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4365 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4366 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4367 07492f668d2173da7a2bda3707ff0985e0f460b6.
4369 2017-04-07 Pedro Alves <palves@redhat.com>
4371 * opncls.c (bfd_get_debug_link_info): Rename to...
4372 (bfd_get_debug_link_info_1): ... this. Change type of second
4373 parameter to void pointer. Adjust.
4374 (bfd_get_debug_link_info): Reimplement on top of
4375 bfd_get_debug_link_info_1.
4376 (separate_debug_file_exists, separate_alt_debug_file_exists):
4377 Change type of second parameter to void pointer. Adjust.
4378 (get_func_type, check_func_type): Change type of second parameter
4380 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4381 the callback functions instead of passing the address of a local.
4382 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4383 find_separate_debug_file.
4384 (get_alt_debug_link_info_shim): Change type of second parameter to
4385 void pointer. Adjust.
4386 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4387 find_separate_debug_file.
4388 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4389 of second parameter to void pointer. Adjust.
4390 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4391 pointer local to find_separate_debug_file.
4393 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4395 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4396 external symbols with a definition.
4397 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4399 2017-04-07 Alan Modra <amodra@gmail.com>
4401 * po/SRC-POTFILES.in: Regenerate.
4403 2017-04-05 Alan Modra <amodra@gmail.com>
4405 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4408 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4410 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4411 numbers for DataDirectory entry indicies passed to
4414 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4416 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4417 each GNU_MBIND section and align GNU_MBIND section to page size.
4418 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4419 segment for each GNU_MBIND section.
4420 (_bfd_elf_init_private_section_data): Copy sh_info from input
4421 for GNU_MBIND section.
4423 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4425 * elfnn-riscv.c (GP_NAME): Delete.
4426 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4427 (_bfd_riscv_relax_lui): Likewise.
4429 2017-04-04 Nick Clifton <nickc@redhat.com>
4432 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4434 (bfd_elf_final_link): Only initialize the extended symbol index
4435 section if there are extended symbol tables to list.
4437 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4439 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4440 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4441 * configure.ac (elf): Add elf-properties.lo.
4442 * Makefile.in: Regenerated.
4443 * configure: Likewise.
4444 * elf-bfd.h (elf_property_kind): New.
4445 (elf_property): Likewise.
4446 (elf_property_list): Likewise.
4447 (elf_properties): Likewise.
4448 (_bfd_elf_parse_gnu_properties): Likewise.
4449 (_bfd_elf_get_property): Likewise.
4450 (_bfd_elf_link_setup_gnu_properties): Likewise.
4451 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4452 and setup_gnu_properties.
4453 (elf_obj_tdata): Add properties.
4454 * elf-properties.c: New file.
4455 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4456 (elf_i386_merge_gnu_properties): Likewise.
4457 (elf_backend_parse_gnu_properties): Likewise.
4458 (elf_backend_merge_gnu_properties): Likewise.
4459 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4460 (elf_x86_64_merge_gnu_properties): Likewise.
4461 (elf_backend_parse_gnu_properties): Likewise.
4462 (elf_backend_merge_gnu_properties): Likewise.
4463 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4464 (elf_backend_parse_gnu_properties): Likewise.
4465 (elf_backend_setup_gnu_properties): Likewise.
4466 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4467 elf_backend_merge_gnu_properties and
4468 elf_backend_setup_gnu_properties.
4470 2017-03-30 Pip Cet <pipcet@gmail.com>
4472 * elf32-wasm32.c: Add relocation code, two relocs.
4473 * reloc.c: Add wasm32 relocations.
4474 * libbfd.h: Regenerate.
4475 * bfd-in2.h: Regenerate.
4476 * bfd/po/bfd.pot: Regenerate.
4478 2017-03-29 Nick Clifton <nickc@redhat.com>
4481 * coff-bfd.h (struct coff_section_data): Add new fields:
4482 saved_bias and bias.
4483 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4484 computed for PE binaries.
4485 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4488 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4491 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4492 to handle a local symbol with a hash-symbol-entry; without PLT.
4493 Add BFD_ASSERT for an incidental case with GOT entry present.
4494 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4495 isn't forced-or-set local.
4497 2017-03-27 Pip Cet <pipcet@gmail.com>
4499 * wasm-module.c: New file to support WebAssembly modules.
4500 * wasm-module.h: New file to support WebAssembly modules.
4501 * doc/webassembly.texi: Start documenting wasm-module.c.
4502 * config.bfd: Add wasm_vec.
4503 * targets.c: Likewise.
4504 * configure.ac: Likewise.
4505 * Makefile.am: Add entries for wasm-module.c.
4506 * Makefile.in: Regenerate.
4507 * configure: Regenerate.
4508 * po/SRC-POTFILES.in: Regenerate.
4510 2017-03-27 Pip Cet <pipcet@gmail.com>
4512 * cpu-wasm32.c: New file to support wasm32 architecture.
4513 * elf32-wasm32.c: New file to support wasm32 architecture.
4514 * Makefile.am: Add wasm32 architecture.
4515 * archures.c: Likewise.
4516 * config.bfd: Likewise.
4517 * configure.ac: Likewise.
4518 * targets.c: Likewise.
4519 * Makefile.in: Regenerate.
4520 * bfd-in2.h: Regenerate.
4521 * configure: Regenerate.
4522 * po/SRC-POTFILES.in: Regenerate.
4524 2017-03-20 Alan Modra <amodra@gmail.com>
4527 * elf64-ppc.c (compare_symbols): Stabilize sort.
4529 2017-03-18 Alan Modra <amodra@gmail.com>
4531 * elf64-ppc.c (struct ppc_link_hash_table): Add
4532 local_ifunc_resolver and maybe_local_ifunc_resolver.
4533 (ppc_build_one_stub): Set flags on emitting dynamic
4534 relocation to ifunc.
4535 (ppc64_elf_relocate_section): Likewise.
4536 (ppc64_elf_finish_dynamic_symbol): Likewise.
4537 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4538 local dynamic relocs to ifuncs.
4539 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4540 local_ifunc_resolver and maybe_local_ifunc_resolver.
4541 (ppc_elf_relocate_section): Set flag on emitting dynamic
4542 relocation to ifuncs.
4543 (ppc_elf_finish_dynamic_symbol): Likewise.
4544 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4545 dynamic relocs to ifuncs.
4547 2017-03-13 Nick Clifton <nickc@redhat.com>
4550 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4551 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4552 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4553 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4554 * bfd-in2.h: Regenerate.
4555 * libbfd.h: Regenerate.
4556 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4558 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4559 (elfNN_aarch64_howto_table): Likewise.
4560 (aarch64_tls_transition_without_check): Likewise.
4561 (aarch64_reloc_got_type): Likewise.
4562 (elfNN_aarch64_final_link_relocate): Likewise.
4563 (elfNN_aarch64_tls_relax): Likewise.
4564 (elfNN_aarch64_relocate_section): Likewise.
4565 (elfNN_aarch64_gc_sweep_hook): Likewise.
4566 (elfNN_aarch64_check_relocs): Likewise.
4567 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4568 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4570 2017-03-11 Alan Modra <amodra@gmail.com>
4572 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4573 parameter is in fact used. Whitespace fixes.
4574 * elf64-ppc.c: Likewise.
4576 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4578 * rs6000-core.c (CORE_NEW): Simplify macro when
4579 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4581 2017-03-07 Alan Modra <amodra@gmail.com>
4585 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4588 2017-03-05 Alan Modra <amodra@gmail.com>
4590 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4591 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4592 (next_cie_fde_offset): New function.
4593 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4594 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4595 four bytes. Align CIEs to four or eight bytes depending on
4596 per_encoding_aligned8. Align FDEs according to their encoding.
4597 Pad last FDE to output section alignment.
4598 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4600 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4601 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4602 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4604 2017-03-02 Martin Bickel <binutils@ineranves.de>
4607 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4608 empty segments which have a zero filesz, but a non-zero memsz.
4610 2017-03-02 Alan Modra <amodra@gmail.com>
4612 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4614 2017-02-28 Alan Modra <amodra@gmail.com>
4616 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4617 (ppc64_elf_relocate_section): Likewise.
4619 2017-02-28 Alan Modra <amodra@gmail.com>
4622 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4623 rather than elf32_nios2_hash_table or elf_hash_table.
4624 (create_got_section): Likewise.
4625 (nios2_elf32_finish_dynamic_symbol): Likewise.
4626 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4627 (nios2_elf32_size_dynamic_sections): Likewise.
4628 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4629 vars. Use htab equivalents directly instead. Don't create
4630 all dynamic sections on needing just the GOT. Use a goto
4631 rather than a fall-through with reloc test. Ensure
4632 htab->dynobj is set when making dynamic sreloc section.
4633 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4634 equivalent directly instead. Don't segfault on looking for
4635 .dynamic when dynamic sections have not been created. Don't
4636 segfault on .got.plt being discarded.
4637 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4638 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4639 fixme and another not so relevant comment.
4640 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4641 already set, set hash table dynobj on creating .sbss.
4643 2017-02-28 Alan Modra <amodra@gmail.com>
4645 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4646 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4647 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4648 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4649 (ppc64_elf_relocate_section): Likewise.
4650 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4651 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4652 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4653 * libbfd.h: Regenerate.
4654 * bfd-in2.h: Regenerate.
4656 2017-02-28 Alan Modra <amodra@gmail.com>
4658 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4659 dynamic .data.rel.ro read-only.
4660 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4661 rather than section flags when deciding where copy reloc goes.
4662 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4663 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4664 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4665 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4666 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4667 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4668 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4669 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4670 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4671 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4672 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4673 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4674 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4675 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4676 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4677 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4678 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4679 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4680 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4682 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4684 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4685 `jalr $0, $25' instruction encoding.
4687 2017-02-27 Nick Clifton <nickc@redhat.com>
4690 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4691 generating a seg-fault when encountering a symbol that has been
4692 deleted by garbage collection.
4694 2017-02-25 Alan Modra <amodra@gmail.com>
4696 * elf32-arc.c (struct dynamic_sections): Delete.
4697 (enum dyn_section_types): Delete.
4698 (dyn_section_names): Delete.
4699 (arc_create_dynamic_sections): Delete.
4700 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4701 segfault on discarded .rela.plt section.
4702 (elf_arc_size_dynamic_sections): Formatting. Don't call
4703 arc_create_dynamic_sections. Don't allocate memory for sections
4704 handled by the generic linker. Correct code finding relocs in
4705 read-only sections. Set SEC_EXCLUDE on zero size .got,
4706 .got.plt, and .dynbss sections. Do set .interp for pies.
4708 2017-02-24 Andrew Waterman <andrew@sifive.com>
4710 * elfnn-riscv.c (GP_NAME): New macro.
4711 (riscv_global_pointer_value): Use it.
4712 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4713 output section, consider only that section's alignment.
4715 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4717 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4718 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4719 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4720 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4722 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4724 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4725 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4728 2017-02-23 Alan Modra <amodra@gmail.com>
4731 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4733 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4734 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4737 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4740 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4741 processing ahead of the call to `elf_gc_sweep_symbol'.
4743 2017-02-22 Nick Clifton <nickc@redhat.com>
4746 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4747 created section 4-byte alignment.
4749 2017-02-22 Alan Modra <amodra@gmail.com>
4751 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4752 on .got or .plt output section being discarded by script.
4753 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4756 2017-02-21 Alan Modra <amodra@gmail.com>
4758 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4759 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4761 2017-02-20 Alan Modra <amodra@gmail.com>
4764 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4765 if DT_RELSZ/DT_RELASZ is zero.
4767 2017-02-17 Nick Clifton <nickc@redhat.com>
4769 * compress.c (bfd_get_full_section_contents): Remember to reduce
4770 compressed size by the sizeof the compression header when
4771 decompressing the contents.
4773 2017-02-17 Pedro Alves <palves@redhat.com>
4775 * srec.c (Chunk): Rename to ...
4776 (_bfd_srec_len): ... this.
4777 (S3Forced): Rename to ...
4778 (_bfd_srec_forceS3): ... this.
4779 * objcopy.c: Adjust all references.
4781 2017-02-17 Pedro Alves <palves@redhat.com>
4783 * archive.c (bsd_write_armap): Rename to ...
4784 (_bfd_bsd_write_armap): ... this.
4785 (coff_write_armap): Rename to ...
4786 (_bfd_coff_write_armap): ... this.
4787 * libbfd-in.h (bsd_write_armap): Rename to ...
4788 (_bfd_bsd_write_armap): ... this.
4789 (coff_write_armap): Rename to ...
4790 (_bfd_coff_write_armap): ... this.
4791 * aout-target.h, aout-tic30.c: Adjust all users.
4792 * libbfd.h: Regenerate.
4794 2017-02-17 Pedro Alves <palves@redhat.com>
4796 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4797 (warn_deprecated): Rename to ...
4798 (_bfd_warn_deprecated): ... this.
4799 * libbfd.c (warn_deprecated): Rename to ...
4800 (_bfd_warn_deprecated): ... this.
4801 * bfd-in2.h: Regenerate.
4803 2017-02-17 Pedro Alves <palves@redhat.com>
4805 * bfdio.c (real_ftell): Rename to ...
4806 (_bfd_real_ftell): ... this.
4807 (real_fseek): Rename to ...
4808 (_bfd_real_fseek): ... this.
4809 (real_fopen): Rename to ...
4810 (_bfd_real_fopen): ... this.
4811 * libbfd-in.h (real_ftell): Rename to ...
4812 (_bfd_real_ftell): ... this.
4813 (real_fseek): Rename to ...
4814 (_bfd_real_fseek): ... this.
4815 (real_fopen): Rename to ...
4816 (_bfd_real_fopen): ... this.
4817 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4818 * libbfd.h: Regenerate.
4820 2017-02-17 Pedro Alves <palves@redhat.com>
4822 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4823 * libbfd.c (read_unsigned_leb128): Rename to ...
4824 (_bfd_read_unsigned_leb128): ... this.
4825 (read_signed_leb128): Rename to ...
4826 (_bfd_read_signed_leb128): ... this.
4827 (safe_read_leb128): Rename to ...
4828 (_bfd_safe_read_leb128): ... this.
4829 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4830 (_bfd_read_unsigned_leb128): ... this.
4831 (read_signed_leb128): Rename to ...
4832 (_bfd_read_signed_leb128): ... this.
4833 (safe_read_leb128): Rename to ...
4834 (_bfd_safe_read_leb128): ... this.
4835 * libbfd.h: Renegerate.
4837 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4839 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4840 before trying to fine matching file and line information.
4842 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4844 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4845 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4846 not match current bfd, then reload debug information. Record bfd
4847 we're loading debug info for in the stash. If we have debug
4848 informatin in the cache then perform section placement before
4851 2017-02-16 Alan Modra <amodra@gmail.com>
4854 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4855 * elfxx-target.h (elf_backend_no_page_alias): Define.
4856 (elfNN_bed): Init new field.
4857 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4858 ensure PT_LOAD segment starts on a new page.
4859 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4861 2017-02-16 Alan Modra <amodra@gmail.com>
4864 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4867 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4869 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4870 * bfd-in2.h: Regenerated.
4872 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4875 * elf32-i386.c (elf_i386_relocate_section): Allow
4876 "lea foo@GOT, %reg" in PIC.
4878 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4881 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4882 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4883 error against local IFUNC symbol without a base register for
4886 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4888 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4889 `%P: %H:' with `info->callbacks->einfo'.
4890 (ppc_elf_relocate_section): Likewise.
4891 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4892 (ppc64_elf_edit_toc): Likewise.
4893 (ppc64_elf_relocate_section): Likewise.
4895 2017-02-14 Alan Modra <amodra@gmail.com>
4897 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4898 --gc-keep-exported, and test versioned field of sym rather than
4899 looking for @ in name.
4901 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4903 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4906 2017-02-13 Nick Clifton <nickc@redhat.com>
4909 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4912 2017-02-07 Andrew Waterman <andrew@sifive.com>
4914 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4915 entry size if PLT header is written.
4917 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4919 Fix sparc64 dynamic relocation processing to use the dynamic
4921 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4922 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4925 2017-02-03 Nick Clifton <nickc@redhat.com>
4928 * coffcode.h (coff_write_object_contents): Enlarge size of
4929 s_name_buf in order to avoid compile time warning about possible
4931 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4932 32-bits of insn value before printing into buffer.
4934 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4936 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4937 `max_local_dynindx'.
4938 (mips_elf_sort_hash_table): Handle it.
4939 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4940 symbols bump up `max_local_dynindx' rather than
4941 `max_non_got_dynindx'.
4943 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4945 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4946 `min_got_dynindx', `max_unref_got_dynindx' and
4947 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4948 (mips_elf_sort_hash_table): Adjust accordingly.
4950 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4952 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4953 to access the hash table.
4955 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4957 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4958 non-NULL `htab' to the beginning.
4960 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4962 * elflink.c (elf_gc_sweep): Wrap overlong line.
4964 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4966 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4967 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4968 * elfxx-mips.c (mips_elf_link_hash_table): Add
4969 `ignore_branch_isa' member.
4970 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4971 in branch relocation calculation as an error if
4972 `ignore_branch_isa' has been set.
4973 (_bfd_mips_elf_insn32): Rename to...
4974 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4975 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4976 Handle the new parameter.
4978 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4980 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4981 local variable dynobj.
4984 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4985 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4986 executable from read-only sections into sdynrelro.
4987 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4988 dynamic relocs in sdynrelro.
4989 (elf_backend_want_dynrelro): Define.
4991 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4993 * config.bfd (*-*-rtemsaout*): Mark as removed.
4995 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4997 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4998 (arm-*-rtems*): Move to (arm*-*-eabi*).
4999 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5000 (m68-*-rtems*): Move to (m68*-*-elf*).
5002 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5004 * config.bfd (*-*-rtemscoff*): Mark as removed.
5006 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5009 * elflink.c (bfd_elf_record_link_assignment): Revert last
5010 change and don't ever clear `forced_local'. Set `mark'
5012 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5014 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5015 (bfd_elf_size_dynamic_sections): ... here.
5016 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5017 and set `mark' instead in `__tls_get_addr_opt' processing.
5018 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5020 2017-01-24 Alan Modra <amodra@gmail.com>
5022 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5023 where dynamic relocs are preferable. Allow ifunc too.
5024 (ensure_undefweak_dynamic): New function.
5025 (allocate_dynrelocs): Use it here. Move plt handling last and
5026 don't make symbols dynamic, simplifying loop. Only make undef
5027 weak symbols with GOT entries dynamic. Correct condition
5028 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5029 comments. Remove goto.
5030 (ppc_elf_relocate_section): Correct test for using dynamic
5031 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5032 to suit. Set up explicit tls_index entries and implicit GOT
5033 tls_index entries resolvable at link time for
5034 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5035 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5036 (ensure_undefweak_dynamic): New function.
5037 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5038 with GOT entries dynamic. Remove unnecessary test of
5039 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5040 (ppc64_elf_relocate_section): Correct test for using dynamic
5041 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5042 to suit. Set up explicit tls_index entries and implicit GOT
5043 tls_index entries resolvable at link time for __tls_get_addr_opt.
5044 Simplify expression to clear mem for prelink.
5046 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5048 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5050 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5052 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5053 (elf_backend_hash_symbol): Define.
5055 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5058 * elflink.c (bfd_elf_record_link_assignment): Clear any
5059 `forced_local' marking for DSO symbols that are not being
5062 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5064 * elfnn-riscv.c (riscv_elf_object_p): New function.
5066 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5069 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5071 (elf_x86_64_check_relocs): Create .eh_frame section for the
5073 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5074 .eh_frame section for the .plt.bnd section.
5075 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5076 for the .plt.bnd section.
5078 2017-01-12 Nick Clifton <nickc@redhat.com>
5081 * opncls.c (find_separate_debug_file): Add include_dirs
5082 parameter. Only include the directory part of the bfd's filename
5083 in search paths if include_dirs is true. Add a couple of extra
5084 locations for looking for debug files.
5085 ( bfd_follow_gnu_debuglink): Update invocation of
5086 find_separate_debug_file.
5087 (bfd_follow_gnu_debugaltlink): Likewise.
5088 (get_build_id): New function: Finds the build-id of the given bfd.
5089 (get_build_id_name): New function: Computes the name of the
5090 separate debug info file for a bfd, based upon its build-id.
5091 (check_build_id_file): New function: Checks to see if a separate
5092 debug info file exists at the given location, and that its
5093 build-id matches that of the original bfd.
5094 (bfd_follow_build_id_debuglink): New function: Finds a separate
5095 debug info file for a given bfd by using the build-id method.
5096 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5097 method of locating a separate debug info file before using the
5099 * bfd-in2.h: Regenerate.
5101 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5104 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5105 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5106 elf_x86_64_eh_frame_plt_got.
5107 (elf_x86_64_size_dynamic_sections): Get unwind info from
5108 elf_x86_64_bnd_arch_bed for the BND PLT.
5110 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5112 * config.bfd: Add entries for i686-redox and x86_64-redox.
5114 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5116 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5118 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5119 .eh_frame section to 4 bytes for x32.
5120 (elf_x86_64_check_relocs): Likewise.
5122 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5125 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5126 (PLT_GOT_FDE_LENGTH): Likewise.
5127 (elf_i386_plt_layout): Add eh_frame_plt_got and
5128 eh_frame_plt_got_size.
5129 (elf_i386_plt): Updated.
5130 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5131 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5132 (elf_i386_size_dynamic_sections): Allocate and initialize
5133 .eh_frame section for .plt.got.
5134 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5136 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5137 eh_frame_plt_got_size.
5138 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5139 (PLT_GOT_FDE_LENGTH): Likewise.
5140 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5141 eh_frame_plt_got_size.
5142 (elf_x86_64_arch_bed): Updated.
5143 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5144 eh_frame_plt_got_size.
5145 (elf_x86_64_nacl_arch_bed): Likewise.
5146 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5147 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5148 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5149 .eh_frame section for .plt.got.
5150 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5153 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5155 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5156 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5158 2017-01-09 Nick Clifton <nickc@redhat.com>
5160 * dwarf2.c (lookup_address_in_function_table): Return early if
5161 there are no functions in the given comp unit, or if the high
5162 address of the last function in the comp unit is less than the
5165 2017-01-09 Nick Clifton <nickc@redhat.com>
5168 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5169 message if there are too many symbols to load.
5171 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5173 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5174 if relocs are cached.
5176 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5179 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5180 for R_MICROBLAZE_GOTOFF_64.
5182 2017-01-03 Nick Clifton <nickc@redhat.com>
5184 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5185 warning about using a possibly uninitialised variable.
5187 2017-01-02 Alan Modra <amodra@gmail.com>
5189 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5190 (allocate_plt_static, allocate_dynrelocs): Use it.
5192 2017-01-02 Alan Modra <amodra@gmail.com>
5194 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5195 .PARISC.unwind section.
5197 2017-01-02 Alan Modra <amodra@gmail.com>
5200 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5201 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5202 indirect to GOT pointer relative code edit.
5204 2017-01-02 Alan Modra <amodra@gmail.com>
5206 Update year range in copyright notice of all files.
5208 For older changes see ChangeLog-2016
5210 Copyright (C) 2017 Free Software Foundation, Inc.
5212 Copying and distribution of this file, with or without modification,
5213 are permitted in any medium without royalty provided the copyright
5214 notice and this notice are preserved.
5220 version-control: never