1 2017-11-23 Alan Modra <amodra@gmail.com>
3 * elf64-ppc.c (struct ppc_link_hash_entry): Delete weakref field.
4 (ppc64_elf_copy_indirect_symbol): Don't set weakref.
5 (alias_readonly_dynrelocs): Use u.alias rather than weakref.
6 (ppc64_elf_adjust_dynamic_symbol): Don't use
7 alias_readonly_dynrelocs for function symbols.
9 2017-11-23 Alan Modra <amodra@gmail.com>
11 * elf-bfd.h (struct elf_link_hash_entry): Add is_weakalias.
12 Rename u.weakdef to u.alias and update comment.
13 (weakdef): New static inline function.
14 * elflink.c (bfd_elf_record_link_assignment) Test is_weakalias
15 rather than u.weakdef != NULL, and use weakdef function.
16 (_bfd_elf_adjust_dynamic_symbol): Likewise.
17 (_bfd_elf_fix_symbol_flags): Likewise. Clear is_weakalias on
18 all aliases if def has been overridden in a regular object, not
20 (elf_link_add_object_symbols): Delete new_weakdef flag. Test
21 is_weakalias and use weakdef. Set is_weakalias and circular
22 u.alias. Update comments.
23 (_bfd_elf_gc_mark_rsec): Test is_weakalias rather than
24 u.weakdef != NULL and use weakdef function.
25 * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Test
26 is_weakalias rather than u.weakdef != NULL and use weakdef
27 function. Assert that def is strong defined.
28 * elf32-arc.c (elf_arc_adjust_dynamic_symbol): Likewise.
29 * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
30 * elf32-bfin.c (elf32_bfinfdpic_adjust_dynamic_symbol): Likewise.
31 (bfin_adjust_dynamic_symbol): Likewise.
32 * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
33 * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
34 * elf32-frv.c (elf32_frvfdpic_adjust_dynamic_symbol): Likewise.
35 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
36 * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
37 * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
38 * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
39 * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
40 * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
41 * elf32-microblaze.c (microblaze_elf_adjust_dynamic_symbol): Likewise.
42 * elf32-nds32.c (nds32_elf_adjust_dynamic_symbol): Likewise.
43 * elf32-nios2.c (nios2_elf32_adjust_dynamic_symbol): Likewise.
44 * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
45 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
46 * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
47 * elf32-score.c (s3_bfd_score_elf_adjust_dynamic_symbol): Likewise.
48 * elf32-score7.c (s7_bfd_score_elf_adjust_dynamic_symbol): Likewise.
49 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
50 * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
51 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Likewise.
52 (tilepro_elf_adjust_dynamic_symbol): Likewise.
53 * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
54 * elf32-xtensa.c (elf_xtensa_adjust_dynamic_symbol): Likewise.
55 * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Likewise.
56 * elf64-hppa.c (elf64_hppa_adjust_dynamic_symbol): Likewise.
57 * elf64-ia64-vms.c (elf64_ia64_adjust_dynamic_symbol): Likewise.
58 * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise.
59 (ppc64_elf_adjust_dynamic_symbol): Likewise.
60 * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
61 * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
62 * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
63 * elfnn-ia64.c (elfNN_ia64_adjust_dynamic_symbol): Likewise.
64 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Likewise.
65 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
66 * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
67 (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
68 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
69 (tilegx_elf_adjust_dynamic_symbol): Likewise.
70 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
72 2017-11-21 Alan Modra <amodra@gmail.com>
74 * elf-bfd.h (elf_symbol_from): Check for NULL symbol bfd.
75 * elfcode.h (elf_slurp_reloc_table_from_section): Add FIXME comment.
77 2017-11-20 Nick Clifton <nickc@redhat.com>
80 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Skip
81 objects without a GNU_PROPERTY note section when looking for a bfd
82 onto which notes can be accumulated.
84 2017-11-20 Alan Modra <amodra@gmail.com>
88 * elf.c (_bfd_elf_init_reloc_shdr): Delete "sec_hdr" parameter
89 and leave rel_hdr->sh_flags zero. Update calls.
90 (bfd_elf_set_group_contents): Check input rel/rela SHF_GROUP
91 flag when !gas before adding rel/rela section to group. Set
92 output rel/rela SHF_GROUP flags.
94 2017-11-18 Jim Wilson <jimw@sifive.com>
96 * elfnn-riscv.c (_bfd_riscv_relax_align): Add space between alignment
97 and to in error message.
99 2017-11-17 H.J. Lu <hongjiu.lu@intel.com>
101 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Pass
102 "%F%P:", instead of "%F:", to linker callback in case of error.
104 2017-11-16 Nick Clifton <nickc@redhat.com>
107 * elf.c (elfcore_grok_netbsd_procinfo): Check that the note is big enough.
108 (elfcore_grok_openbsd_procinfo): Likewise.
109 (elfcore_grok_nto_status): Likewise.
111 2017-11-16 Nick Clifton <nickc@redhat.com>
113 * merge.c (sec_merge_emit): Always create padding buffer. Add
114 asserts to make sure that the buffer is long enough.
116 2017-11-15 Alan Modra <amodra@gmail.com>
118 * bfd.c (union _bfd_doprnt_args): Add "Bad".
119 (_bfd_doprnt): Handle more flags.
120 (_bfd_doprnt_scan): Likewise. Tidy setting of args array.
121 (error_handler_internal): Init args type to Bad.
123 2017-11-14 Alan Modra <amodra@gmail.com>
126 * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
127 non-empty dynamic section.
128 (ppc_build_one_stub): Take elf_gp from output bfd, not output
130 (ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.
132 2017-11-14 Alan Modra <amodra@gmail.com>
134 * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for user
137 2017-11-13 Jan Beulich <jbeulich@suse.com>
139 * coff-tic80.c (COFF_ENCODE_ALIGNMENT, COFF_DECODE_ALIGNMENT):
141 * coffcode.h (coff_set_alignment_hook): Drop tic80 special case.
142 (coff_write_object_contents): Likewise. Issue diagnostic for too
145 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
148 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
151 2017-11-12 Alan Modra <amodra@gmail.com>
153 * elflink.c (elf_link_add_object_symbols): Ignore anything but
154 defined and defweak symbols when setting up weakdefs.
156 2017-11-12 Alan Modra <amodra@gmail.com>
158 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
159 to keep dyn_relocs, clear to discard. Comment.
160 (allocate_dynrelocs): Always clear non_got_ref when clearing
161 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
162 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
163 dyn_relocs on undefined syms to handle for non-pic too.
164 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
165 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
166 to keep dyn_relocs, clear to discard. Comment.
167 (allocate_dynrelocs): Always clear non_got_ref when clearing
168 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
169 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
170 dyn_relocs on undefined syms to handle for non-pic too.
171 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
172 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
173 dyn_relocs here. Don't bother setting non_got_ref. Comment.
174 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
175 ifuncs. Move code deleting dyn_relocs on undefined symbols to
176 handle for non-pic too. Don't test non_got_ref. Do test
177 dynamic_adjusted and ELF_COMMON_DEF_P.
179 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
181 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
182 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
183 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
185 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
187 * elf32-mips.c (elf32_mips_write_core_note): New function.
188 (elf_backend_write_core_note): New macro.
189 * elf64-mips.c (elf64_mips_write_core_note): New function.
190 (elf_backend_write_core_note): New macro.
191 * elfn32-mips.c (elf32_mips_write_core_note): New function.
192 (elf_backend_write_core_note): New macro.
194 2017-11-07 Alan Modra <amodra@gmail.com>
196 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
199 2017-11-07 Alan Modra <amodra@gmail.com>
201 * sysdep.h: Formatting, comment fixes.
202 (gettext, ngettext): Redefine when ENABLE_NLS.
203 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
204 (_): Define using gettext.
205 (textdomain, bindtextdomain): Use safer "do nothing".
206 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
207 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
209 2017-11-05 Alan Modra <amodra@gmail.com>
212 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
215 2017-11-05 Alan Modra <amodra@gmail.com>
218 * bfd.c (union _bfd_doprnt_args): New.
219 (PRINT_TYPE): Add FIELD arg. Take value from args.
220 (_bfd_doprnt): Replace ap parameter with args. Adjust all
221 PRINT_TYPE invocations and reading of format args to suit.
222 Move "%%" handling out of switch handling args. Support
223 positional parameters.
224 (_bfd_doprnt_scan): New function.
225 (error_handler_internal): Call _bfd_doprnt_scan and read args.
227 2017-11-04 Alan Modra <amodra@gmail.com>
229 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
230 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
231 (ppc_elf_relocate_section): Don't output a dynamic relocation
232 for IE GOT entries in an executable.
233 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
234 (ppc64_elf_size_dynamic_sections): Likewise.
235 (ppc64_elf_relocate_section): Likewise.
237 2017-11-04 Alan Modra <amodra@gmail.com>
239 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
240 callers. Don't bother with SEC_ALLOC test. Return section pointer.
242 (maybe_set_textrel): ..here.
243 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
244 (maybe_set_textrel): Call minfo to print textrel warning to map file.
246 2017-11-04 Alan Modra <amodra@gmail.com>
248 * elf32-hppa.c (enum _tls_type): Move.
249 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
250 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
251 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
252 (got_entries_needed, got_relocs_needed): New functions.
253 (allocate_dynrelocs): Use them.
254 (elf32_hppa_size_dynamic_sections): Likewise.
255 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
256 Correct code emitting relocs on GD/IE got entries. Report an
257 error when a symbol has both normal and TLS GOT relocs.
259 2017-11-04 Alan Modra <amodra@gmail.com>
262 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
263 for plabels when non-pic.
264 (maybe_set_textrel): New function.
265 (readonly_dynrelocs): Move and rewrite.
266 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
267 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
268 for functions. Expand non_got_ref comments.
269 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
271 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
273 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
274 Don't use func_pointer_refcount. Don't set plt.refcount nor
275 non_got_ref for function pointer reference.
276 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
277 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
278 func_pointer_refcount.
279 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
280 func_pointer_refcount.
281 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
282 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
283 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
285 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
286 Nick Clifton <nickc@redhat.com>
289 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
290 overlarge raw syment count.
291 (coff_get_normalized_symtab): Likewise.
293 2017-11-01 James Bowman <james.bowman@ftdichip.com>
295 * archures.c: Add bfd_mach_ft32b.
296 * cpu-ft32.c: Add arch_info_struct.
297 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
299 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
301 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
302 (elf32_ft32_adjust_diff_reloc_value)
303 (elf32_ft32_adjust_reloc_if_spans_insn)
304 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
305 (ft32_elf_relax_section): New function.
306 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
307 * bfd-in2.h: Regenerate.
308 * libbfd.h: Regenerate.
310 2017-11-01 Nick Clifton <nickc@redhat.com>
313 * coffcode.h (coff_slurp_line_table): Check for an excessively
314 large line number count.
316 2017-11-01 Nick Clifton <nickc@redhat.com>
319 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
320 and offset in light of further possible bogus values.
322 2017-11-01 Alan Modra <amodra@gmail.com>
325 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
326 entry when just a dynamic reloc can serve. Ensure no dynamic
327 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
328 Expand and move the non_got_ref comment.
329 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
331 2017-11-01 Nick Clifton <nickc@redhat.com>
334 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
336 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
337 members of an archive.
339 2017-10-31 Nick Clifton <nickc@redhat.com>
342 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
345 2017-10-30 Alan Modra <amodra@gmail.com>
347 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
350 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
352 (bfd_elf_gc_sections): Likewise.
354 2017-10-30 Alan Modra <amodra@gmail.com>
357 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
358 ensure non_got_ref is not set due to debug references.
359 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
360 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
361 need for a plt entry.
362 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
363 dynamic relocs when pic. Remove bogus code attempting to handle
365 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
367 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
368 and SYMBOL_REFERENCES_LOCAL in GOT handling.
370 2017-10-28 Alan Modra <amodra@gmail.com>
373 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
374 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
375 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
376 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
378 2017-10-25 Alan Modra <amodra@gmail.com>
380 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
381 optionally prefixed with "_".
382 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
384 2017-10-24 Andrew Waterman <andrew@sifive.com>
386 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
389 2017-10-24 Renlin Li <renlin.li@arm.com>
392 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
394 2017-10-23 Nick Clifton <nickc@redhat.com>
397 * elflink.c (elf_link_output_extsym): Keep global undefined
398 symbols if they have been marked as needed.
400 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
402 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
404 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
405 `_bfd_mips_elf_mkobject'.
407 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
410 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
412 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
414 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
415 (riscv_pcgp_lo_reloc): Likewise.
416 (riscv_pcgp_relocs): Likewise.
417 (riscv_init_pcgp_relocs): New function.
418 (riscv_free_pcgp_relocs): Likewise.
419 (riscv_record_pcgp_hi_reloc): Likewise.
420 (riscv_record_pcgp_lo_reloc): Likewise.
421 (riscv_delete_pcgp_hi_reloc): Likewise.
422 (riscv_use_pcgp_hi_reloc): Likewise.
423 (riscv_record_pcgp_lo_reloc): Likewise.
424 (riscv_find_pcgp_lo_reloc): Likewise.
425 (riscv_delete_pcgp_lo_reloc): Likewise.
426 (_bfd_riscv_relax_pc): Likewise.
427 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
428 via the new functions above.
430 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
432 * elfnn-riscv.c (R_RISCV_DELETE): New define.
433 (_bfd_riscv_relax_delete): New function.
434 (perform_relocation): Handle R_RISCV_DELETE.
435 (_bfd_riscv_relax_section): Likewise.
437 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
440 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
441 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
442 bfd_link_executable for TLS check.
443 (tilegx_elf_check_relocs): Likewise.
444 (allocate_dynrelocs): Likewise.
445 (tilegx_elf_relocate_section): Likewise.
447 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
450 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
451 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
452 bfd_link_executable for TLS check.
453 (tilepro_elf_check_relocs): Likewise.
454 (allocate_dynrelocs): Likewise.
455 (tilepro_elf_relocate_section): Likewise.
457 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
460 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
461 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
462 bfd_link_executable for TLS check.
463 (_bfd_sparc_elf_check_relocs): Likewise.
464 (allocate_dynrelocs): Likewise.
465 (_bfd_sparc_elf_relocate_section): Likewise.
467 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
469 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
470 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
471 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
473 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
475 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
476 indirect and warning symbols.
478 2017-10-17 Alan Modra <amodra@gmail.com>
481 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
482 against size left rather than comparing pointers. Reorganise loop.
484 2017-10-17 Alan Modra <amodra@gmail.com>
487 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
488 and error for any other size that doesn't cover the header word.
490 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
492 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
493 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
494 (elf_backend_gc_sweep_hook): Likewise.
495 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
496 (bfinfdpic_gc_sweep_hook): Likewise.
497 (elf_backend_gc_sweep_hook): Likewise.
498 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
499 (elf_backend_gc_sweep_hook): Likewise.
500 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
501 (elf_backend_gc_sweep_hook): Likewise.
502 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
503 (elf_backend_gc_sweep_hook): Likewise.
504 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
505 (elf_backend_gc_sweep_hook): Likewise.
506 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
507 (elf_backend_gc_sweep_hook): Likewise.
508 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
510 (elf_m68k_remove_got_entry_type): Removed.
511 (elf_m68k_find_got_entry_ptr): Likewise.
512 (elf_m68k_remove_got_entry): Likewise.
513 (elf_m68k_gc_sweep_hook): Likewise.
514 (elf_backend_gc_sweep_hook): Likewise.
515 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
516 (elf_backend_gc_sweep_hook): Likewise.
517 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
518 (elf_backend_gc_sweep_hook): Likewise.
519 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
520 (elf_backend_gc_sweep_hook): Likewise.
521 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
522 (elf_backend_gc_sweep_hook): Likewise.
523 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
524 (elf_backend_gc_sweep_hook): Likewise.
525 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
526 (elf_backend_gc_sweep_hook): Likewise.
527 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
528 (elf_backend_gc_sweep_hook): Likewise.
529 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
530 (elf_backend_gc_sweep_hook): Likewise.
531 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
532 (elf_backend_gc_sweep_hook): Likewise.
533 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
534 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
535 (elf_backend_gc_sweep_hook): Likewise.
536 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
537 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
538 (elf_backend_gc_sweep_hook): Likewise.
539 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
540 (elf_backend_gc_sweep_hook): Likewise.
541 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
542 (elf_backend_gc_sweep_hook): Likewise.
543 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
544 (elf_backend_gc_sweep_hook): Likewise.
545 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
546 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
547 (elf_backend_gc_sweep_hook): Likewise.
548 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
549 (ppc64_elf_gc_sweep_hook): Likewise.
550 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
551 (elf_backend_gc_sweep_hook): Likewise.
552 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
553 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
554 * elflink.c (elf_link_add_object_symbols): Don't call
555 _bfd_elf_link_check_relocs here.
556 (gc_sweep_hook_fn): Removed.
557 (elf_gc_sweep): Remove gc_sweep_hook.
558 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
559 (elf_backend_gc_sweep_hook): Likewise.
560 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
561 (elf_backend_gc_sweep_hook): Likewise.
562 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
563 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
564 (elf_backend_gc_sweep_hook): Likewise.
565 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
566 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
567 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
568 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
569 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
570 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
572 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
574 * elf32-i386.c (elf_i386_backend_data): Removed.
575 (get_elf_i386_backend_data): Likewise.
576 (elf_i386_arch_bed): Replace elf_i386_backend_data with
577 elf_x86_backend_data.
578 (elf_i386_get_synthetic_symtab): Likewise.
579 (elf_i386_nacl_arch_bed): Likewise.
580 (elf_i386_vxworks_arch_bed): Likewise.
581 (elf_i386_relocate_section): Check target_os instead of
583 (elf_i386_finish_dynamic_symbol): Likewise.
584 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
585 Check target_os instead of is_vxworks.
586 (elf_i386_link_setup_gnu_properties): Remove normal_target and
587 is_vxworks. Initialize plt0_pad_byte.
588 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
589 (get_elf_x86_64_arch_data): Likewise.
590 (get_elf_x86_64_backend_data): Likewise.
591 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
592 elf_x86_backend_data.
593 (elf_x86_64_get_synthetic_symtab): Likewise.
594 (elf_x86_64_nacl_arch_bed): Likewise.
595 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
596 normal_target. Initialize plt0_pad_byte.
597 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
598 instead of is_vxworks.
599 (_bfd_x86_elf_size_dynamic_sections): Likewise.
600 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
601 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
602 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
603 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
604 Update normal_target. Set up plt0_pad_byte. Check target_os
605 instead of is_vxworks.
606 * elfxx-x86.h (elf_x86_target_os): New.
607 (elf_x86_backend_data): Likewise.
608 (get_elf_x86_backend_data): Likewise.
609 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
611 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
614 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
616 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
617 _bfd_x86_elf_finish_dynamic_sections.
618 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
619 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
621 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
624 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
627 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
628 hide symbol which was forced to be dynamic.
630 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
633 * elf32-cris.c (cris_elf_relocate_section): Don't generate
634 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
635 (cris_elf_check_relocs): Don't allocate dynamic relocation
636 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
638 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
641 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
642 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
643 (sh_elf_relocate_section): Don't generate dynamic relocation if
644 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
646 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
649 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
650 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
651 (elf_s390_relocate_section): Don't generate dynamic relocation
652 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
653 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
654 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
655 (elf_s390_relocate_section): Don't generate dynamic relocation
656 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
658 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
661 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
662 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
663 (allocate_dynrelocs): Discard dynamic relocations if
664 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
666 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
669 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
670 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
672 (allocate_dynrelocs): Discard dynamic relocations if
673 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
675 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
678 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
679 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
680 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
681 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
682 (elf_m68k_relocate_section): Don't generate dynamic relocation
683 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
685 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
688 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
689 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
690 (allocate_dynrelocs): Discard dynamic relocations if
691 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
692 (elf32_hppa_relocate_section): Don't generate dynamic
693 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
695 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
698 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
699 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
700 (allocate_fptr): Don't allocate function pointer if
701 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
702 (allocate_dynrel_entries): Don't allocate dynamic relocation
703 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
704 (set_got_entry): Don't set GOT entry if
705 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
706 (set_pltoff_entry): Don't set PLTOFF entry if
707 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
708 (elfNN_ia64_relocate_section): Don't install dynamic relocation
709 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
711 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
714 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
715 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
716 (allocate_dynrelocs): Don't allocate dynamic relocations if
717 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
719 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
722 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
723 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
724 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
725 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
727 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
730 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
731 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
732 (tilepro_elf_relocate_section): Don't generate dynamic
733 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
734 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
735 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
736 (tilegx_elf_relocate_section): Don't generate dynamic
737 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
739 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
742 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
743 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
745 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
746 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
748 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
750 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
751 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
752 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
754 2017-10-12 James Bowman <james.bowman@ftdichip.com>
756 * bfd-in2.h: Regenerate.
757 * libbfd.h: Regenerate.
758 * elf32-ft32.c: Add HOWTO R_FT32_15.
759 * reloc.c: Add BFD_RELOC_FT32_15.
761 2017-10-12 Nick Clifton <nickc@redhat.com>
763 * reloc.c (enum bfd_reloc_status): Start values at 2.
764 * bfd-in2.h: Regenerate.
765 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
766 that a TRUE return indicates success. Compare the result of
767 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
768 (build_one_stub): Change sense of tests against aarch64_relocate
770 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
771 than FALSE, when an error is detected.
772 (elfNN_aarch64_final_link_relocate): Likewise.
774 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
776 * elf32-i386.c (elf_backend_hide_symbol): New.
777 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
778 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
779 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
781 2017-10-12 Alan Modra <amodra@gmail.com>
783 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
784 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
785 (bfd_elf_define_start_stop): Likewise.
787 2017-10-12 Alan Modra <amodra@gmail.com>
789 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
790 when executable rather than non-PIC.
791 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
792 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
794 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
796 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
798 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
799 (elf_external_linux_prpsinfo64_ugid32): ... this.
800 (swap_linux_prpsinfo32_out): Rename to...
801 (swap_linux_prpsinfo32_ugid32_out): ... this.
802 (elf_external_linux_prpsinfo64_ugid16): New structure.
803 (swap_linux_prpsinfo64_ugid16_out): New function.
804 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
805 (elf_backend_linux_prpsinfo64_ugid16): Define.
806 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
807 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
808 of the 64-bit Linux core PRPSINFO note.
809 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
811 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
813 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
815 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
816 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
817 (elf_external_ppc_linux_prpsinfo32)
818 (swap_ppc_linux_prpsinfo32_out): Move to...
819 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
820 (swap_linux_prpsinfo32_ugid32_out): ... these.
821 (elf_external_linux_prpsinfo32): Rename to...
822 (elf_external_linux_prpsinfo32_ugid16): ... this.
823 (swap_linux_prpsinfo32_out): Rename to...
824 (swap_linux_prpsinfo32_ugid16_out): ... this.
825 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
826 (elf_backend_linux_prpsinfo32_ugid16): Define.
827 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
828 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
829 of the 32-bit Linux core PRPSINFO note.
830 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
831 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
832 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
833 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
834 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
835 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
836 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
837 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
838 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
839 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
841 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
843 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
844 `gap' member ahead of `pr_flag'.
846 2017-10-11 Pedro Alves <palves@redhat.com>
848 * bfd.c (_doprnt): Rename to ...
849 (_bfd_doprnt): ... this.
850 (error_handler_internal): Adjust.
852 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
854 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
855 instead of incrementing it.
856 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
858 2017-10-10 Renlin Li <renlin.li@arm.com>
861 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
862 symbols into dynamic.
864 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
867 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
868 (riscv_elf_link_hash_table_create): Initialize max_alignment to
870 (_bfd_riscv_relax_section): Cache the max alignment of output
871 sections if possible.
873 2017-10-10 Alan Modra <amodra@gmail.com>
875 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
876 .opd whenever .opd is present and non-zero size. Move code
877 setting abiversion to/from output file earlier. Only set
878 u.opd.func_sec when --gc-sections. Read relocs and set up
879 u.opd.func_sec values here..
880 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
882 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
884 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
886 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
889 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
891 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
892 .interp section with "ld --no-dynamic-linker".
894 2017-10-09 Alan Modra <amodra@gmail.com>
897 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
898 funcinfo_hash_table and varinfo_hash_table.
900 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
902 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
903 in read-only section with minfo.
904 (sh_elf_size_dynamic_sections): Likewise.
906 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
908 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
911 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
913 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
914 this_hdr.sh_entsize only if section size > 0.
916 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
918 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
920 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
922 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
923 in read-only section with minfo.
924 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
926 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
928 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
931 2017-10-06 John Baldwin <jhb@FreeBSD.org>
933 * elf-bfd.h (struct elf_backend_data): Add
934 `elf_backend_grok_freebsd_prstatus'.
935 * elf.c (elfcore_grok_freebsd_note): Call
936 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
938 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
940 (elf_backend_grok_freebsd_prstatus): Define.
941 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
942 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
944 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
946 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
947 and has_non_got_reloc with zero_undefweak.
948 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
949 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
951 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
952 has_non_got_reloc with zero_undefweak.
953 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
954 has_got_reloc and has_non_got_reloc with zero_undefweak.
955 (elf_x86_link_hash_entry): Likewise.
957 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
959 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
960 (VERIFY_COPY_RELOC): Likewise.
962 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
964 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
965 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
966 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
968 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
970 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
971 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
972 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
974 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
976 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
977 * elf32-i386.c (elf_i386_relocate_section): Use it.
978 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
980 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
982 * elf32-i386.c (X86_SIZE_TYPE_P): New.
983 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
984 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
985 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
986 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
988 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
990 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
991 (PLT_LOCAL_IFUNC_P): Likewise.
992 * elf32-i386.c (elf_i386_relocate_section): Use them.
993 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
995 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
997 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
998 * elf32-i386.c (elf_i386_relocate_section): Use it.
999 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1001 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1003 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
1004 * elf32-i386.c (elf_i386_relocate_section): Use it.
1005 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1007 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1009 * elf32-i386.c (X86_PCREL_TYPE_P): New.
1010 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1011 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
1012 (X86_PCREL_TYPE_P): This.
1013 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
1014 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
1015 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
1017 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
1019 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
1021 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
1022 * elf32-i386.c (elf_i386_tls_transition): Use it.
1023 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1025 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1027 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
1028 Dump dynamic relocation in read-only section with minfo if
1030 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
1031 (maybe_set_textrel): Likewise.
1032 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
1033 read-only section with minfo.
1035 2017-10-05 John Baldwin <jhb@FreeBSD.org>
1037 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
1039 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
1041 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
1042 in read-only section with minfo.
1043 (tilepro_elf_size_dynamic_sections): Likewise.
1044 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
1045 (tilegx_elf_size_dynamic_sections): Likewise.
1047 2017-10-05 Pedro Alves <palves@redhat.com>
1050 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
1051 ellipsis parameter. Split out bfd_error_on_input code to..
1052 (bfd_set_input_error): .. New function.
1053 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
1054 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
1055 * bfd-in2.h: Regenerate.
1057 2017-10-05 Alan Modra <amodra@gmail.com>
1059 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
1060 fini_array error value.
1062 2017-10-05 Alan Modra <amodra@gmail.com>
1065 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
1067 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
1069 (elf_fake_sections): Adjust calls. Exit immediately on failure.
1070 (bfd_elf_set_group_contents): Add associated reloc section indices
1073 2017-10-04 Alan Modra <amodra@gmail.com>
1075 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
1076 classify symbols for ELFv2.
1078 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
1081 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
1082 undergoes default promotion.
1083 * bfd-in2.h: Regenerate.
1085 2017-10-02 Alan Modra <amodra@gmail.com>
1087 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
1088 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
1090 2017-10-01 Alan Modra <amodra@gmail.com>
1093 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
1094 (add_line_info): Always put end_sequence last.
1096 2017-10-01 Alan Modra <amodra@gmail.com>
1099 * dwarf2.c (read_section): Allocate buffer with extra byte for
1100 bfd_simple_get_relocated_section_contents rather than copying
1103 2017-09-29 Alan Modra <amodra@gmail.com>
1105 * merge.c (merge_strings): Return FALSE on malloc failure.
1106 (_bfd_merge_sections): Return failures from record_section and
1109 2017-09-28 Alan Modra <amodra@gmail.com>
1112 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
1113 a case where plugin_notice isn't called.
1115 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
1117 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
1120 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
1123 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
1124 output_bfd to info->callbacks->minfo.
1126 2017-09-26 Nick Clifton <nickc@redhat.com>
1129 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
1130 assertion failure if elf_x86_64_rtype_to_howto has already issued
1133 2017-09-26 Alan Modra <amodra@gmail.com>
1136 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
1139 2017-09-26 Nick Clifton <nickc@redhat.com>
1142 * dwarf2.c (read_formatted_entries): Fail early if we know that
1143 the loop parsing data entries will overflow the end of the
1146 2017-09-26 Alan Modra <amodra@gmail.com>
1149 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1150 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1151 to stash->info_ptr_memory, and check die_ref is within that memory.
1152 Set info_ptr_end correctly when another CU is refd. Check die_ref
1153 for DW_FORM_ref4 etc. is within CU.
1155 2017-09-26 Alan Modra <amodra@gmail.com>
1158 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1159 (read_formatted_entries): Init "fe".
1160 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1162 2017-09-26 Alan Modra <amodra@gmail.com>
1165 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1166 bounds in inner loop.
1168 2017-09-25 Alan Modra <amodra@gmail.com>
1171 * dwarf1.c (parse_die): Sanity check pointer against section limit
1172 before dereferencing.
1173 (parse_line_table): Likewise.
1175 2017-09-25 Alan Modra <amodra@gmail.com>
1178 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1180 (parse_comp_unit): Likewise.
1182 2017-09-25 Alan Modra <amodra@gmail.com>
1185 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1187 2017-09-24 Alan Modra <amodra@gmail.com>
1190 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1191 within section bounds.
1193 2017-09-24 Alan Modra <amodra@gmail.com>
1196 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1198 2017-09-24 Alan Modra <amodra@gmail.com>
1201 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1202 pname param. Return status. Make name const. Don't abort,
1203 return an error. Formatting. Exit if current info_ptr matches
1204 orig_info_ptr. Update callers.
1205 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1206 nested_funcs an array of structs for extensibility. Formatting.
1208 2017-09-24 Alan Modra <amodra@gmail.com>
1211 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1212 rather than dividing by zero.
1214 2017-09-24 Alan Modra <amodra@gmail.com>
1217 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1219 2017-09-24 Alan Modra <amodra@gmail.com>
1222 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1224 2017-09-24 Alan Modra <amodra@gmail.com>
1227 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1228 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1231 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1234 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1237 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1240 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1241 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1243 2017-09-22 Pedro Alves <palves@redhat.com>
1244 Alan Modra <amodra@gmail.com>
1246 * version.h: Add comment.
1248 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1250 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1251 NT_S390_GS_BC, correct the previously swapped invocations of
1252 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1254 2017-09-19 Alan Modra <amodra@gmail.com>
1257 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1260 2017-09-19 Alan Modra <amodra@gmail.com>
1263 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1264 symbols before calculating verrefs. Don't renumber dynsyms
1265 after gc. Exclude .gnu.version when zero or one dynsym.
1266 Localize some vars and reindent.
1268 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1271 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1272 return from bfd_canonicalize_dynamic_reloc.
1274 2017-09-15 Alan Modra <amodra@gmail.com>
1277 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1278 overflows bfd_size_type.
1280 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1283 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1284 to indicate if conversion is performed.
1285 (elf_i386_check_relocs): Cache section contents and relocations
1286 if conversion is performed.
1287 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1288 contents and relocations if conversion is performed.
1290 2017-09-14 Nick Clifton <nickc@redhat.com>
1293 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1296 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1298 * elfxx-x86.h: Fix a typo in comments.
1300 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1302 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1304 2017-09-09 Alan Modra <amodra@gmail.com>
1306 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1309 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1311 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1312 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1313 (elf_i386_finish_dynamic_symbol): Likewise.
1314 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1315 (elf_x86_64_finish_dynamic_symbol): Likewise.
1316 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1317 (_bfd_x86_elf_fixup_symbol): Likewise.
1319 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1321 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1322 check has_non_got_reloc.
1324 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1327 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1328 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1329 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1330 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1331 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1332 and linker_def on __ehdr_start if it is referenced and not
1334 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1335 and return TRUE when building executable, if a symbol has
1336 non-GOT/non-PLT relocations in text section or there is no
1338 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1340 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1342 * elfxx-x86.h: Update comments.
1344 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1346 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1347 elf_x86_plt_layout_table with elf_x86_init_table.
1348 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1350 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1352 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1353 (elf_x86_init_table): This.
1354 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1355 elf_x86_plt_layout_table with elf_x86_init_table.
1357 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1359 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1360 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1361 * configure: Regenerated.
1362 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1363 and r_sym fields of plt_layout.
1364 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1366 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1367 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1368 r_info nor r_sym fields.
1369 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1371 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1373 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1375 * (_bfd_riscv_relax_align): Call bfd_set_error and
1376 print an error message when unable to relax a .align directive.
1378 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1380 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1381 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1382 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1383 R_RISCV_PCREL_HI20 relocs, and pass the result to
1384 riscv_record_pcrel_hi_reloc.
1386 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1388 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1389 r_type_p. Remove the converted argument. Replace
1390 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1391 the new relocation type via r_type_p.
1392 (elf_i386_relocate_section): Likewise.
1393 (elf_i386_finish_dynamic_symbol): Likewise.
1394 (need_convert_load): Removed.
1395 (check_relocs_failed): Updated.
1396 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1397 instead of setting need_convert_load.
1398 (_bfd_i386_elf_convert_load): Removed.
1399 * elf64-x86-64.c (need_convert_load): Removed.
1400 (check_relocs_failed): Updated.
1401 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1402 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1403 Return the new relocation type via r_type_p.
1404 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1405 instead of setting need_convert_load.
1406 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1408 (_bfd_x86_64_elf_convert_load): Removed.
1409 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1410 with SYMBOL_REFERENCES_LOCAL_P.
1411 (elf_x86_64_finish_dynamic_symbol): Likewise.
1412 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1414 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1415 (_bfd_x86_elf_link_symbol_references_local): New function.
1416 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1417 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1418 SYMBOL_REFERENCES_LOCAL_P.
1419 (elf_x86_link_hash_entry): Add local_ref.
1420 (elf_x86_link_hash_table): Remove convert_load.
1421 (_bfd_i386_elf_convert_load): Removed.
1422 (_bfd_x86_64_elf_convert_load): Likewise.
1423 (_bfd_x86_elf_link_symbol_references_local): New.
1425 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1427 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1428 (elf_x86_64_info_to_howto): Get the real relocation type by
1429 masking out R_X86_64_converted_reloc_bit.
1430 (elf_x86_64_check_tls_transition): Get the real relocation type
1431 by masking out R_X86_64_converted_reloc_bit.
1432 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1433 instead of setting converted_reloc.
1434 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1435 instead of converted_reloc. Get the real relocation type by
1436 masking out R_X86_64_converted_reloc_bit.
1437 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1438 R_X86_64_converted_reloc_bit is valid.
1439 * elfxx-x86.h (converted_reloc): Removed.
1441 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1443 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1444 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1445 to get the relocation type again.
1446 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1447 r_type when calling elf_x86_64_tls_transition. Don't use
1448 ELF32_R_TYPE to get the relocation type again.
1450 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1452 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1455 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1457 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1458 argument. Don't check relocation overflow. Avoid relocation
1459 overflow if --no-relax is used. Set converted_reloc on symbol
1460 if a GOTPCREL relocation is converted.
1461 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1462 --no-relax if GOTPCREL relocation conversion leads to relocation
1464 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1466 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1467 Edmar Wienskoski <edmar.wienskoski@nxp.com
1469 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1470 (ppc_elf_check_relocs): Handle it.
1471 (ppc_elf_vle_split20): New function.
1472 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1474 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1477 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1478 for x86-64 if GOT_TLS_GDESC_P is true.
1480 2017-09-03 Alan Modra <amodra@gmail.com>
1483 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1485 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1487 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1488 tls_get_addr for x86-64 in one place.
1490 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1492 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1493 with elfxx-x86.lo for 64-bit BFD.
1494 * configure: Regenerated.
1496 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1498 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1499 (_bfd_i386_elf_convert_load): This. Remove static.
1500 (elf_i386_size_dynamic_sections): Removed.
1501 (elf_backend_size_dynamic_sections): Likewise.
1502 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1503 (_bfd_x86_64_elf_convert_load): This. Remove static.
1504 (elf_x86_64_size_dynamic_sections): Removed.
1505 (elf_backend_size_dynamic_sections): Likewise.
1506 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1507 (elf_x86_allocate_dynrelocs): This. Make it static.
1508 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1509 (elf_x86_allocate_local_dynreloc): This. Make it static.
1510 (elf_i386_is_reloc_section): New function.
1511 (elf_x86_64_is_reloc_section): Likewise.
1512 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1513 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1514 Rearrange got_entry_size initialization.
1515 (_bfd_x86_elf_size_dynamic_sections): New function.
1516 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1517 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1518 (_bfd_i386_elf_convert_load): New.
1519 (_bfd_x86_64_elf_convert_load): Likewise.
1520 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1521 (elf_backend_size_dynamic_sections): Likewise.
1522 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1523 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1525 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1527 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1530 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1532 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1533 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1535 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1537 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1538 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1539 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1540 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1541 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1542 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1544 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1546 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1547 (elf_i386_allocate_local_dynrelocs): Likewise.
1548 (elf_i386_size_dynamic_sections): Replace
1549 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1550 with _bfd_x86_elf_allocate_dynrelocs and
1551 _bfd_x86_elf_allocate_local_dynrelocs.
1552 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1553 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1554 (elf_x86_64_size_dynamic_sections): Replace
1555 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1556 with _bfd_x86_elf_allocate_dynrelocs and
1557 _bfd_x86_elf_allocate_local_dynrelocs.
1558 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1559 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1560 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1561 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1563 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1565 * elf32-i386.c (is_i386_elf): Removed.
1566 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1567 (elf_i386_size_dynamic_sections): Likewise.
1568 (elf_i386_relocate_section): Likewise.
1569 * elf64-x86-64.c (is_x86_64_elf): Removed.
1570 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1572 (elf_x86_64_size_dynamic_sections): Likewise.
1573 (elf_x86_64_relocate_section): Likewise.
1574 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1576 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1579 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1581 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1582 (elf_i386_allocate_dynrelocs): Replace
1583 elf_i386_compute_jump_table_size with
1584 elf_x86_compute_jump_table_size.
1585 (elf_i386_size_dynamic_sections): Likewise.
1586 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1587 (elf_x86_64_allocate_dynrelocs): Replace
1588 elf_x86_64_compute_jump_table_size with
1589 elf_x86_compute_jump_table_size.
1590 (elf_x86_64_size_dynamic_sections): Likewise.
1591 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1593 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1594 (elf_x86_compute_jump_table_size): New.
1596 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1598 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1600 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1601 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1603 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1605 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1606 with htab->is_vxworks.
1607 (elf_i386_size_dynamic_sections): Likewise.
1608 (elf_i386_relocate_section): Likewise.
1609 (elf_i386_finish_dynamic_symbol): Likewise.
1610 (elf_i386_finish_dynamic_sections): Likewise.
1612 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1614 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1615 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1616 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1617 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1618 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1619 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1620 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1621 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1623 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1626 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1627 ELF_COMMON_DEF_P for common symbols.
1629 2017-09-02 Alan Modra <amodra@gmail.com>
1631 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1632 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1633 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1635 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1637 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1638 (elf_backend_gc_mark_hook): Likewise.
1639 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1640 (elf_backend_gc_mark_hook): Likewise.
1641 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1642 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1643 (elf_backend_gc_mark_hook): Likewise.
1645 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1647 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1648 (elf_backend_adjust_dynamic_symbol): Likewise.
1649 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1650 (elf_backend_adjust_dynamic_symbol): Likewise.
1651 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1652 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1653 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1654 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1655 (elf_backend_adjust_dynamic_symbol): Likewise.
1657 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1659 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1662 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1664 * elf32-i386.c (elf_i386_mkobject): Removed.
1665 (bfd_elf32_mkobject): Likewise.
1666 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1667 (bfd_elf64_mkobject): Likewise.
1668 (bfd_elf32_mkobject): Likewise.
1669 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1670 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1671 (bfd_elf64_mkobject): Likewise.
1672 (bfd_elf32_mkobject): Likewise.
1674 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1676 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1677 Call _bfd_x86_elf_link_setup_gnu_properties.
1678 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1679 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1681 (elf_x86_64_non_lazy_plt): Likewise.
1682 (elf_x86_64_lazy_bnd_plt): Likewise.
1683 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1684 (elf_x86_64_lazy_ibt_plt): Likewise.
1685 (elf_x32_lazy_ibt_plt): Likewise.
1686 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1687 (elf_x32_non_lazy_ibt_plt): Likewise.
1688 (elf_x86_64_nacl_plt): Likewise.
1689 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1690 _bfd_x86_elf_link_setup_gnu_properties.
1691 * elfxx-x86.c: Include elf-vxworks.h".
1692 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1693 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1694 comments for pic_plt0_entry and pic_plt_entry.
1695 (elf_x86_non_lazy_plt_layout): Likewise.
1696 (elf_x86_plt_layout_table): New.
1697 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1699 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1702 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1703 .eh_frame section for the second PLT.
1704 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1705 alignment of .eh_frame section for the second PLT.
1707 2017-09-01 Nick Clifton <nickc@redhat.com>
1710 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1713 2017-09-01 Nick Clifton <nickc@redhat.com>
1716 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1717 attribute buffer is NUL terminated.
1719 2017-08-31 Nick Clifton <nickc@redhat.com>
1722 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1723 to dwarf string sections.
1725 2017-08-31 Alan Modra <amodra@gmail.com>
1727 * po/SRC-POTFILES.in: Regenerate.
1729 2017-08-31 Alan Modra <amodra@gmail.com>
1731 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1732 for a section containing just a terminator. Allow multiple
1733 terminators at end of section.
1734 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1735 sections when not adding alignment. Assert on terminator in
1738 2017-08-31 Alan Modra <amodra@gmail.com>
1742 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1745 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1747 * configure.ac (bfd_backends): Add elf64.lo together with
1748 elfxx-x86.lo for 64-bit BFD.
1749 * configure: Regenerated.
1751 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1753 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1756 2017-08-31 Alan Modra <amodra@gmail.com>
1759 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1760 before _close_and_cleanup. Call iovec->bclose after.
1761 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1763 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1765 * elf32-i386.c (elf_i386_plt_type): Removed.
1766 (elf_i386_plt): Likewise.
1767 (elf_i386_get_synthetic_symtab): Updated. Call
1768 _bfd_x86_elf_get_synthetic_symtab.
1769 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1770 (elf_x86_64_plt): Likewise.
1771 (elf_x86_64_get_synthetic_symtab): Updated. Call
1772 _bfd_x86_elf_get_synthetic_symtab.
1773 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1774 (elf_x86_64_get_plt_got_vma): Likewise.
1775 (elf_i386_valid_plt_reloc_p): Likewise.
1776 (elf_x86_64_valid_plt_reloc_p): Likewise.
1777 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1778 * elfxx-x86.h (elf_x86_plt_type): New.
1779 (elf_x86_plt): Likewise.
1780 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1782 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1784 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1785 target_id instead of elf_machine_code.
1787 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1789 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1790 (elf_i386_lazy_plt_layout): Likewise.
1791 (elf_i386_non_lazy_plt_layout): Likewise.
1792 (elf_i386_plt_layout): Likewise.
1793 (elf_i386_link_hash_table): Likewise.
1794 (elf_i386_next_tls_desc_index): Likewise.
1795 (elf_i386_srelplt2): Likewise.
1796 (elf_i386_plt): Likewise.
1797 (elf_i386_lazy_plt): Likewise.
1798 (elf_i386_non_lazy_plt): Likewise.
1799 (elf_i386_link_hash_table_create): Likewise.
1800 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1801 (elf_i386_lazy_plt): Updated.
1802 (elf_i386_non_lazy_plt): Likewise.
1803 (elf_i386_lazy_ibt_plt): Likewise.
1804 (elf_i386_non_lazy_ibt_plt): Likewise.
1805 (elf_i386_allocate_dynrelocs): Likewise.
1806 (elf_i386_size_dynamic_sections): Likewise.
1807 (elf_i386_relocate_section): Likewise.
1808 (elf_i386_finish_dynamic_symbol): Likewise.
1809 (elf_i386_finish_dynamic_sections): Likewise.
1810 (elf_i386_get_synthetic_symtab): Likewise.
1811 (elf_i386_link_setup_gnu_properties): Likewise.
1812 (elf_i386_nacl_plt): Likewise.
1813 * elf64-x86-64.c (ABI_64_P): Removed.
1814 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1815 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1816 (elf_x86_64_lazy_plt_layout): Likewise.
1817 (elf_x86_64_non_lazy_plt_layout): Likewise.
1818 (elf_x86_64_plt_layout): Likewise.
1819 (elf_x86_64_link_hash_table): Likewise.
1820 (elf_x86_64_plt): Likewise.
1821 (elf_x86_64_lazy_plt): Likewise.
1822 (elf_x86_64_non_lazy_plt): Likewise.
1823 (elf_x86_64_link_hash_table_create): Likewise.
1824 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1825 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1826 (elf_x86_64_lazy_plt): Updated.
1827 (elf_x86_64_non_lazy_plt): Likewise.
1828 (elf_x86_64_lazy_bnd_plt): Likewise.
1829 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1830 (elf_x86_64_lazy_ibt_plt): Likewise.
1831 (elf_x32_lazy_ibt_plt): Likewise.
1832 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1833 (elf_x32_non_lazy_ibt_plt): Likewise.
1834 (elf_x86_64_allocate_dynrelocs): Likewise.
1835 (elf_x86_64_size_dynamic_sections): Likewise.
1836 (elf_x86_64_relocate_section): Likewise.
1837 (elf_x86_64_finish_dynamic_symbol): Likewise.
1838 (elf_x86_64_finish_dynamic_sections): Likewise.
1839 (elf_x86_64_get_synthetic_symtab): Likewise.
1840 (elf_x86_64_link_setup_gnu_properties): Likewise.
1841 (elf_x86_64_nacl_plt): Likewise.
1842 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1844 (ELF32_DYNAMIC_INTERPRETER): New.
1845 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1846 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1847 (_bfd_x86_elf_link_hash_table_create): Likewise.
1848 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1849 (elf_x86_link_hash_table_free): This. Make it static.
1850 * elfxx-x86.h: Don't include "objalloc.h".
1852 (elf_x86_lazy_plt_layout): Likewise.
1853 (elf_x86_non_lazy_plt_layout): Likewise.
1854 (elf_x86_plt_layout): Likewise.
1855 (_bfd_x86_elf_link_hash_table_create): Likewise.
1856 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1857 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1858 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1859 srelplt2 and next_tls_desc_index.
1860 (_bfd_x86_elf_link_hash_table_free): Removed.
1862 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1864 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1865 branch offset interpretation.
1867 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1870 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1872 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1874 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1875 (elf_x86_64_srelplt2): Likewise.
1877 2017-08-30 Alan Modra <amodra@gmail.com>
1879 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1880 (ppc64_elf_tls_optimize): Set it.
1881 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1882 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1883 addis would add zero.
1884 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1885 (ppc_elf_tls_optimize): Set it.
1886 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1887 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1889 2017-08-30 Alan Modra <amodra@gmail.com>
1891 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1892 __tls_get_addr call sequences to LE, don't move the addi down
1893 to the nop. Replace the bl with addi and leave the nop alone.
1895 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1897 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1899 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1901 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1903 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1905 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1906 (BFD64_BACKENDS): Likewise.
1907 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1908 (BFD64_BACKENDS_CFILES): Likewise.
1909 * Makefile.in: Regenerated.
1910 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1911 elf32-i386.lo and elf64-x86-64.lo.
1912 * configure: Regenerated.
1913 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1914 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1915 "objalloc.h" and "hashtab.h".
1916 (ELIMINATE_COPY_RELOCS): Removed.
1917 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1918 (SYMBOL_NO_COPYRELOC): Likewise.
1919 (elf_i386_link_hash_entry): Likewise.
1920 (GOT_UNKNOWN): Likewise.
1921 (GOT_NORMAL): Likewise.
1922 (GOT_TLS_GD): Likewise.
1923 (elf_i386_hash_entry): Likewise.
1924 (elf_i386_obj_tdata): Likewise.
1925 (elf_i386_tdata): Likewise.
1926 (elf_i386_local_got_tls_type): Likewise.
1927 (elf_i386_local_tlsdesc_gotent): Likewise.
1928 (elf_i386_hash_table): Likewise.
1929 (elf_i386_link_hash_newfunc): Likewise.
1930 (elf_i386_local_htab_hash): Likewise.
1931 (elf_i386_local_htab_eq): Likewise.
1932 (elf_i386_get_local_sym_hash): Likewise.
1933 (elf_i386_link_hash_table_free): Likewise.
1934 (elf_i386_copy_indirect_symbol): Likewise.
1935 (elf_i386_fixup_symbol): Likewise.
1936 (elf_i386_readonly_dynrelocs): Likewise.
1937 (elf_i386_always_size_sections): Likewise.
1938 (elf_i386_set_tls_module_base): Likewise.
1939 (elf_i386_dtpoff_base): Likewise.
1940 (compare_relocs): Likewise.
1941 (elf_i386_hash_symbol): Likewise.
1942 (elf_i386_parse_gnu_properties): Likewise.
1943 (elf_i386_merge_gnu_properties): Likewise.
1944 (elf_i386_link_check_relocs): Likewise.
1945 (elf_i386_merge_symbol_attribute): Likewise.
1946 (bfd_elf32_bfd_link_check_relocs): Likewise.
1947 (elf_backend_copy_indirect_symbol): Likewise.
1948 (elf_backend_always_size_sections): Likewise.
1949 (elf_backend_omit_section_dynsym): Likewise.
1950 (elf_backend_hash_symbol): Likewise.
1951 (elf_backend_fixup_symbol): Likewise.
1952 (elf_backend_parse_gnu_properties): Likewise.
1953 (elf_backend_merge_gnu_properties): Likewise.
1954 (elf_backend_merge_symbol_attribute): Likewise.
1955 (elf_i386_mkobject): Updated.
1956 (elf_i386_link_hash_table_create): Likewise.
1957 (elf_i386_check_tls_transition): Likewise.
1958 (elf_i386_tls_transition): Likewise.
1959 (elf_i386_convert_load_reloc): Likewise.
1960 (elf_i386_check_relocs): Likewise.
1961 (elf_i386_adjust_dynamic_symbol): Likewise.
1962 (elf_i386_allocate_dynrelocs): Likewise.
1963 (elf_i386_convert_load): Likewise.
1964 (elf_i386_size_dynamic_sections): Likewise.
1965 (elf_i386_relocate_section): Likewise.
1966 (elf_i386_finish_dynamic_symbol ): Likewise.
1967 (elf_i386_finish_dynamic_sections): Likewise.
1968 (elf_i386_output_arch_local_syms): Likewise.
1969 (elf_i386_get_synthetic_symtab): Likewise.
1970 (elf_i386_link_setup_gnu_properties): Likewise.
1971 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1972 of elf_link_hash_table, as base.
1973 (elf_i386_next_tls_desc_index): New.
1974 (elf_i386_srelplt2): Likewise.
1975 (elf_i386_plt): Likewise.
1976 (elf_i386_lazy_plt): Likewise.
1977 (elf_i386_non_lazy_plt): Likewise.
1978 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1979 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1980 "objalloc.h" and "hashtab.h".
1981 (ELIMINATE_COPY_RELOCS): Removed.
1982 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1983 (SYMBOL_NO_COPYRELOC): Likewise.
1984 (elf_x86_64_link_hash_entry): Likewise.
1985 (GOT_UNKNOWN): Likewise.
1986 (GOT_NORMAL): Likewise.
1987 (GOT_TLS_GD): Likewise.
1988 (elf_x86_64_hash_entry): Likewise.
1989 (elf_x86_64_obj_tdata): Likewise.
1990 (elf_x86_64_tdata): Likewise.
1991 (elf_x86_64_local_got_tls_type): Likewise.
1992 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1993 (elf_x86_64_hash_table): Likewise.
1994 (elf_x86_64_link_hash_newfunc): Likewise.
1995 (elf_x86_64_local_htab_hash): Likewise.
1996 (elf_x86_64_local_htab_eq): Likewise.
1997 (elf_x86_64_get_local_sym_hash): Likewise.
1998 (elf_x86_64_link_hash_table_free): Likewise.
1999 (elf_x86_64_copy_indirect_symbol): Likewise.
2000 (elf_x86_64_fixup_symbol): Likewise.
2001 (elf_x86_64_readonly_dynrelocs): Likewise.
2002 (elf_x86_64_always_size_sections): Likewise.
2003 (elf_x86_64_set_tls_module_base): Likewise.
2004 (elf_x86_64_dtpoff_base): Likewise.
2005 (compare_relocs): Likewise.
2006 (elf_x86_64_merge_symbol_attribute): Likewise.
2007 (elf_x86_64_hash_symbol): Likewise.
2008 (elf_x86_64_parse_gnu_properties): Likewise.
2009 (elf_x86_64_merge_gnu_properties): Likewise.
2010 (elf_x86_64_link_check_relocs): Likewise.
2011 (elf_backend_copy_indirect_symbol): Likewise.
2012 (elf_backend_always_size_sections): Likewise.
2013 (bfd_elf64_bfd_link_check_relocs): Likewise.
2014 (elf_backend_merge_symbol_attribute): Likewise.
2015 (elf_backend_hash_symbol): Likewise.
2016 (elf_backend_omit_section_dynsym): Likewise.
2017 (elf_backend_fixup_symbol): Likewise.
2018 (elf_backend_parse_gnu_properties): Likewise.
2019 (elf_backend_merge_gnu_properties): Likewise.
2020 (bfd_elf32_bfd_link_check_relocs): Likewise.
2021 (elf_x86_64_mkobject): Updated.
2022 (elf_x86_64_link_hash_table_create): Likewise.
2023 (elf_x86_64_check_tls_transition): Likewise.
2024 (elf_x86_64_tls_transition): Likewise.
2025 (elf_x86_64_convert_load_reloc): Likewise.
2026 (elf_x86_64_check_relocs): Likewise.
2027 (elf_x86_64_adjust_dynamic_symbol): Likewise.
2028 (elf_x86_64_allocate_dynrelocs): Likewise.
2029 (elf_x86_64_convert_load): Likewise.
2030 (elf_x86_64_size_dynamic_sections): Likewise.
2031 (elf_x86_64_relocate_section): Likewise.
2032 (elf_x86_64_finish_dynamic_symbol ): Likewise.
2033 (elf_x86_64_finish_dynamic_sections): Likewise.
2034 (elf_x86_64_output_arch_local_syms): Likewise.
2035 (elf_x86_64_get_synthetic_symtab): Likewise.
2036 (elf_x86_64_link_setup_gnu_properties): Likewise.
2037 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
2038 instead of elf_link_hash_table, as base.
2039 (elf_x86_64_next_tls_desc_index): New.
2040 (elf_x86_64_srelplt2): Likewise.
2041 (elf_x86_64_plt): Likewise.
2042 (elf_x86_64_lazy_plt): Likewise.
2043 (elf_x86_64_non_lazy_plt): Likewise.
2044 * elfxx-x86.c: New file.
2045 * elfxx-x86.h: Likewise.
2047 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2049 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
2051 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2053 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
2055 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
2056 sections before checking dynamic relocations and free invalid
2057 PLT section contents.
2058 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2060 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2062 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
2063 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
2065 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
2068 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
2070 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2072 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
2074 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
2076 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
2078 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
2081 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
2082 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
2083 Add a has_no_copy_on_protected bitfield.
2084 (elf_has_no_copy_on_protected): New.
2085 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
2086 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2087 (elf_merge_gnu_property_list): Likewise.
2088 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
2089 to FALSE for elf_has_no_copy_on_protected.
2090 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
2091 (elf_i386_link_hash_entry): Add def_protected.
2092 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2093 when checking info->nocopyreloc.
2094 (elf_i386_link_setup_gnu_properties): Don't set
2095 extern_protected_data here.
2096 (elf_i386_merge_symbol_attribute): New function.
2097 (elf_backend_merge_symbol_attribute): New.
2098 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
2099 (elf_x86_64_link_hash_entry): Add def_protected.
2100 (elf_x86_64_need_pic): Report protected symbol for def_protected.
2101 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
2102 when checking info->nocopyreloc.
2103 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
2104 relocation run-time overflow and unresolvable R_X86_64_32S
2105 relocation against protected data symbol defined in shared object
2106 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
2107 (elf_x86_64_link_setup_gnu_properties): Don't set
2108 extern_protected_data here.
2109 (elf_x86_64_merge_symbol_attribute): New function.
2110 (elf_backend_merge_symbol_attribute): New.
2112 2017-08-26 Alan Modra <amodra@gmail.com>
2114 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2115 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2116 (ppc_elf_relocate_section): Comment fix.
2117 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
2118 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
2119 Support dynamic relocs for TPREL16 when non-pic too.
2120 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
2121 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
2124 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
2126 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
2127 "symbol" in comments.
2128 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
2130 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2133 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
2134 R_X86_64_PC32 relocation run-time overflow and unresolvable
2135 R_X86_64_32S relocation with -z nocopyreloc.
2137 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
2139 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
2140 Undefined symbols may not have a type.
2141 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2143 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2145 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2146 bfd_link_info. Report shared, PIE or PDE object based on
2148 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2149 (elf_x86_64_relocate_section): Likewise.
2151 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2153 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2154 for function symbols.
2155 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2157 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2159 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2160 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2161 is set on any input relocatable file.
2162 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2164 2017-08-23 Alan Modra <amodra@gmail.com>
2167 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2168 ensure_undefweak_dynamic. Handle undefined too.
2169 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2170 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2171 (allocate_dynrelocs): Discard undefined non-default visibility
2172 relocs first. Make undefined syms dynamic. Tidy goto.
2174 2017-08-21 Alan Modra <amodra@gmail.com>
2175 H.J. Lu <hongjiu.lu@intel.com>
2178 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2179 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2181 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2184 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2185 undefined weak symbols.
2187 2017-08-18 Nick Clifton <nickc@redhat.com>
2190 * tekhex.c (getsym): Fix check for source pointer walking off the
2191 end of the input buffer.
2193 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2196 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2197 relocations in debug sections, change abort to _bfd_error_handler.
2199 2017-08-14 Nick Clifton <nickc@redhat.com>
2202 * elf.c (setup_group): Check for an empty or very small group
2204 * po/bfd.pot: Regenerate.
2206 2017-08-14 Alan Modra <amodra@gmail.com>
2209 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2210 alignment padding here.
2211 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2212 in a reverse pass over sections.
2214 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2217 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2218 for @plt suffixes first.
2219 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2221 2017-08-08 Nick Clifton <nickc@redhat.com>
2224 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2225 small section lengths.
2226 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2228 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2229 there is enough data present in the note.
2231 2017-08-08 Alan Modra <amodra@gmail.com>
2234 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2235 got.refcount for GOTOFF relocs, just create .got section.
2237 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2239 * elflink.c (elf_link_add_object_symbols): Move common symbol
2240 check after bed->common_definition.
2242 2017-08-07 Alan Modra <amodra@gmail.com>
2245 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2246 needed to define various dynamic tags have been discarded.
2248 2017-08-07 Nick Clifton <nickc@redhat.com>
2251 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2252 has not been set then use the bfd returned by
2253 _bfd_elf_link_setup_gnu_properties. If that is null then search
2254 through all the input bfds selecting the first normal, ELF format
2256 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2258 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2260 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2262 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2263 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2264 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2265 (elf_i386_link_check_relocs): New function.
2266 (bfd_elf32_bfd_link_check_relocs): New.
2267 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2269 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2270 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2271 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2272 (elf_x86_64_link_check_relocs): New function.
2273 (bfd_elf64_bfd_link_check_relocs): New.
2274 (bfd_elf32_bfd_link_check_relocs): Likewise.
2276 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2279 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2280 as undefined for --no-define-common.
2282 2017-08-05 Alan Modra <amodra@gmail.com>
2284 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2285 hppa_link_hash_table.
2287 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2289 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2290 entries for sysregs with negative indices.
2292 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2294 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2295 isn't the S/390 specific elf data.
2296 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2298 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2300 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2301 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2302 [R_RISCV_ADD16]: Likewise.
2303 [R_RISCV_ADD32]: Likewise.
2304 [R_RISCV_ADD64]: Likewise.
2305 [R_RISCV_SUB6]: Likewise.
2306 [R_RISCV_SUB8]: Likewise.
2307 [R_RISCV_SUB16]: Likewise.
2308 [R_RISCV_SUB32]: Likewise.
2309 [R_RISCV_SUB64]: Likewise.
2311 2017-07-31 Alan Modra <amodra@gmail.com>
2313 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2314 without ld.so checks.
2316 2017-07-29 Alan Modra <amodra@gmail.com>
2319 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2320 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2321 (is_elfv2_localentry0): Test non_zero_localentry.
2322 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2324 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2326 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2327 pointer check for htab->elf.irelplt.
2328 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2330 2017-07-27 Nick Clifton <nickc@redhat.com>
2333 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2335 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2337 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2339 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2341 (evax_bfd_print_emh): Check for invalid string lengths.
2343 2017-07-25 Nick Clifton <nickc@redhat.com>
2345 * po/fr.po: Updated French translation.
2347 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2350 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2351 16-bit absolute branches into 10-bit pc-relative branches on the
2352 MSP430 as well as the MSP430X.
2354 2017-07-25 Alan Modra <amodra@gmail.com>
2356 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2357 (stub_eh_frame_size): New function.
2358 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2359 (group_sections): Init group tls_get_addr_opt_bctrl.
2360 (ppc64_elf_size_stubs): Update sizing and initialization of
2361 .eh_frame. Iteration over stubs via group list.
2362 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2363 (ppc64_elf_finish_dynamic_sections): Update finalization of
2366 2017-07-24 Nick Clifton <nickc@redhat.com>
2369 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2370 of the relocs to the canonicalize_one_reloc routine.
2371 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2372 for the _bfd_mach_o_canonicalize_one_reloc field.
2373 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2374 res_base parameter. Use to check for corrupt pair relocs.
2375 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2377 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2379 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2382 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2383 enough data in the record before attempting to parse it.
2384 (_bfd_vms_slurp_eeom): Likewise.
2386 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2387 (image_set_ptr): Likewise.
2388 (alpha_vms_slurp_relocs): Likewise.
2390 (alpha_vms_object_p): Check for a truncated record.
2392 2017-07-24 Nick Clifton <nickc@redhat.com>
2395 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2396 an unrecognized reloc and sets the bfd_error value.
2397 * libbfd.h: Regenerate.
2398 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2400 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2401 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2402 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2403 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2404 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2406 2017-07-23 Alan Modra <amodra@gmail.com>
2408 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2411 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2414 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2415 reloc_class_ifunc for ifunc symbols.
2417 2017-07-19 Nick Clifton <nickc@redhat.com>
2420 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2421 correct magic bytes at the start, set the error to wrong format
2422 and clear the format selector before returning NULL.
2424 2017-07-19 Nick Clifton <nickc@redhat.com>
2427 * coff-rs6000.c (_bfd_strntol): New function.
2428 (_bfd_strntoll): New function.
2429 (GET_VALUE_IN_FIELD): New macro.
2430 (EQ_VALUE_IN_FIELD): new macro.
2431 (_bfd_xcoff_slurp_armap): Use new macros.
2432 (_bfd_xcoff_archive_p): Likewise.
2433 (_bfd_xcoff_read_ar_hdr): Likewise.
2434 (_bfd_xcoff_openr_next_archived_file): Likewise.
2435 (_bfd_xcoff_stat_arch_elt): Likewise.
2436 * coff64-rs6000.c (_bfd_strntol): New function.
2437 (_bfd_strntoll): New function.
2438 (GET_VALUE_IN_FIELD): New macro.
2439 (xcoff64_slurp_armap): Use new macros.
2441 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2442 John Eric Martin <John.Martin@emmicro-us.com>
2444 * bfd-in2.h: Regenerate.
2445 * libbfd.h: Regenerate.
2446 * elf32-arc.c (JLI): Define.
2447 * reloc.c: Add JLI relocations.
2449 2017-07-18 Nick Clifton <nickc@redhat.com>
2452 * coff-sh.c: Fix spelling typos.
2453 * compress.c: Likewise.
2454 * cpu-pdp11.c: Likewise.
2455 * ecofflink.c: Likewise.
2456 * elf-m10300.c: Likewise.
2458 * elf32-arm.c: Likewise.
2459 * elf32-m68k.c: Likewise.
2460 * elf32-nds32.c: Likewise.
2461 * elf32-ppc.c: Likewise.
2462 * elf32-sh.c: Likewise.
2463 * elf32-v850.c: Likewise.
2464 * elf64-ppc.c: Likewise.
2465 * elf64-x86-64.c: Likewise.
2466 * elflink.c: Likewise.
2467 * elfnn-aarch64.c: Likewise.
2468 * elfxx-mips.c: Likewise.
2470 * sunos.c: Likewise.
2471 * vms-alpha.c: Likewise.
2472 * xcofflink.c: Likewise.
2474 2017-07-18 Nick Clifton <nickc@redhat.com>
2477 * coffcode.h (handle_COMDAT): Replace abort with an error message
2480 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2483 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2486 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2488 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2490 2017-07-16 Alan Modra <amodra@gmail.com>
2492 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2493 __tls_index GOT entries when using __tls_get_addr_opt stub.
2494 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2496 2017-07-12 Alan Modra <amodra@gmail.com>
2498 * po/es.po: Update from translationproject.org/latest/bfd/.
2499 * po/fi.po: Likewise.
2500 * po/fr.po: Likewise.
2501 * po/id.po: Likewise.
2502 * po/ja.po: Likewise.
2503 * po/ro.po: Likewise.
2504 * po/ru.po: Likewise.
2505 * po/sr.po: Likewise.
2506 * po/sv.po: Likewise.
2507 * po/tr.po: Likewise.
2508 * po/uk.po: Likewise.
2509 * po/vi.po: Likewise.
2510 * po/zh_CN.po: Likewise.
2511 * po/hr.po: New file from translationproject.org.
2512 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2513 * configure: Regenerate.
2515 2017-07-12 Nick Clifton <nickc@redhat.com>
2517 Fix compile time warnings using gcc 7.1.1.
2518 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2520 (elf_xtensa_get_gotplt_section): Increase length of got_name
2522 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2523 default return of FALSE.
2524 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2525 default return of FALSE.
2527 2017-07-12 Alan Modra <amodra@gmail.com>
2529 * binary.c (binary_set_section_contents): Don't print filepos in
2531 (coff_write_object_contents): Cast size_t for error message.
2532 (coff_slurp_line_table): Don't use bfd_vma symndx.
2533 (coff_slurp_reloc_table): Remove unneeded cast.
2534 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2536 (find_abstract_instance_name): Likewise.
2537 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2538 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2539 (elf32_arm_check_relocs): Make r_symndx an int.
2540 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2542 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2544 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2546 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2547 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2548 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2549 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2550 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2551 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2552 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2553 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2554 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2555 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2556 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2557 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2558 and use %lu for error message.
2559 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2560 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2563 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2565 (elf32_arm_final_link_relocate): Likewise.
2566 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2567 * coffcode.h (styp_to_sec_flags): Likewise.
2568 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2569 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2570 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2571 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2572 (elf32_bfin_merge_private_bfd_data): Likewise.
2573 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2574 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2575 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2576 (i370_elf_relocate_section): Likewise.
2577 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2578 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2579 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2580 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2581 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2582 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2583 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2584 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2585 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2586 * ieee.c (ieee_write_id, read_id): Likewise.
2587 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2588 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2589 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2590 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2591 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2592 * stabs.c (_bfd_link_section_stabs): Likewise.
2594 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2596 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2597 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2598 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2599 * coff-sh.c (sh_relax_section): Likewise.
2600 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2601 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2602 * coffcode.h (coff_slurp_reloc_table): Likewise.
2603 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2604 (_bfd_coff_read_string_table): Likewise.
2605 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2606 * compress.c (bfd_get_full_section_contents): Likewise.
2607 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2608 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2609 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2610 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2611 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2612 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2613 (elf32_arm_write_section): Likewise.
2614 * elf32-bfin.c (bfin_relocate_section): Likewise.
2615 (bfinfdpic_relocate_section): Likewise.
2616 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2617 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2618 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2619 (elf_i386_relocate_section): Likewise.
2620 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2621 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2622 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2623 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2624 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2625 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2626 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2627 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2628 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2629 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2630 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2631 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2632 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2633 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2634 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2635 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2636 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2637 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2638 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2639 * elf32-sh.c (sh_elf_relax_section): Likewise.
2640 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2641 (sh_elf_relocate_section): Likewise.
2642 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2643 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2644 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2645 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2646 * elf32-v850.c (v850_elf_relax_section): Likewise.
2647 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2648 (elf_vax_relocate_section): Likewise.
2649 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2650 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2651 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2652 (do_fix_for_relocatable_link): Likewise.
2653 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2654 (elf64_alpha_relax_with_lituse): Likewise.
2655 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2656 (elf_hppa_final_link_relocate): Likewise.
2657 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2658 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2659 (elf64_vms_link_add_object_symbols): Likewise.
2660 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2661 (mmix_final_link_relocate): Likewise.
2662 * elf64-s390.c (invalid_tls_insn): Likewise.
2663 (elf_s390_relocate_section): Likewise.
2664 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2665 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2666 (elf_x86_64_relocate_section): Likewise.
2667 * elfcode.h (elf_slurp_symbol_table): Likewise.
2668 * elfcore.h (elf_core_file_p): Likewise.
2669 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2670 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2671 (elfNN_aarch64_relocate_section): Likewise.
2672 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2673 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2674 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2675 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2676 (_bfd_mips_elf_relocate_section): Likewise.
2677 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2678 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2679 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2680 * ieee.c (ieee_slurp_external_symbols): Likewise.
2681 * ihex.c (ihex_write_object_content): Likewise.
2682 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2683 * merge.c (_bfd_merged_section_offset): Likewise.
2684 * mmo.c (mmo_write_loc_chunk): Likewise.
2685 (mmo_write_object_contents): Likewise.
2686 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2687 * stabs.c (_bfd_link_section_stabs): Likewise.
2688 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2690 2017-07-11 Alan Modra <amodra@gmail.com>
2692 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2694 2017-07-11 Alan Modra <amodra@gmail.com>
2696 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2697 instruction" error using _bfd_error_handler, not einfo.
2699 2017-07-10 Nick Clifton <nickc@redhat.com>
2701 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2702 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2704 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2706 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2708 2017-07-07 Alan Modra <amodra@gmail.com>
2710 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2712 2017-07-07 Alan Modra <amodra@gmail.com>
2714 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2715 as long long. Move code replacing "ll" with "I64", and simplify.
2717 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2719 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2722 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2724 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2726 (line_info_add_file_name): Likewise.
2727 (decode_line_info): Likewise.
2729 2017-07-04 Tristan Gingold <gingold@adacore.com>
2731 * version.m4: Bump version to 2.29.51
2732 * configure: Regenerate.
2734 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2736 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2737 sanity check at the head of this function.
2739 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2741 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2742 dwarf_line_str_size.
2743 (struct attr_abbrev): Add field implicit_const.
2744 (dwarf_debug_sections): Add .debug_line_str.
2745 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2746 (dwarf_debug_section_assert): Add static assertion.
2747 (read_indirect_line_string): New.
2748 (read_abbrevs): Support DW_FORM_implicit_const.
2749 (is_str_attr): Support DW_FORM_line_strp.
2750 (read_attribute_value): Support DW_FORM_line_strp and
2751 DW_FORM_implicit_const.
2752 (read_attribute): Support DW_FORM_implicit_const.
2753 (line_info_add_include_dir, line_info_add_include_dir_stub):
2754 (line_info_add_file_name, read_formatted_entries): New.
2755 (decode_line_info, parse_comp_unit): Support DWARF 5.
2756 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2758 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2760 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2761 abort statement that was put for symbols that are not dynamic.
2763 2017-07-03 Tristan Gingold <gingold@adacore.com>
2765 * po/bfd.pot: Regenerate
2767 2017-07-03 Alan Modra <amodra@gmail.com>
2769 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2770 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2771 * elf.c (setup_group): Use "Lx" to print sh_size.
2772 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2773 unknown section type in hex.
2774 (copy_special_section_fields): Style fix.
2775 (bfd_section_from_shdr): Correct format for sh_link. Use a
2776 common error message for all the variants of unrecognized
2778 (assign_file_positions_for_load_sections): Use "Lx" for lma
2779 adjust error message.
2780 (assign_file_positions_for_non_load_sections): Formatting.
2781 (rewrite_elf_program_header): Formatting. Use "Lx" for
2782 bfd_vma values in error messages.
2783 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2784 ELF_R_SYM value to type expected by format.
2785 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2787 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2788 (elf_link_input_bfd): Use "Lx" for r_info.
2789 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2791 2017-07-03 Alan Modra <amodra@gmail.com>
2793 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2794 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2795 Microsoft C library variant of long long format specifier.
2796 (PRINT20): Cast value to bfd_uint64_t not long long.
2797 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2798 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2799 long long. Don't cast to bfd_vma.
2800 * elf32-score.c (score3_bfd_getl48): Likewise.
2801 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2803 2017-07-03 Alan Modra <amodra@gmail.com>
2805 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2807 (bfd_elf_print_symbol): Don't cast symbol->flags.
2808 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2809 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2810 _bfd_error_handler argument order.
2811 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2813 2017-07-03 Alan Modra <amodra@gmail.com>
2815 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2816 AC_TYPE_LONG_DOUBLE.
2817 * configure: Regenerate.
2818 * config.in: Regenerate.
2820 2017-06-29 Andrew Waterman <andrew@sifive.com>
2822 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2825 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2827 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2828 unless it is undefined weak.
2829 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2830 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2832 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2833 is not dynamic in PIC, abort.
2835 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2838 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2839 undefined weak symbols into dynamic.
2840 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2841 relocation for non-dynamic symbols.
2842 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2844 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2846 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2847 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2848 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2849 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2850 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2853 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2855 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2856 (elfcore_write_s390_gs_bc): Likewise.
2857 * elf.c (elfcore_grok_s390_gs_cb): New function.
2858 (elfcore_grok_s390_gs_bc): New function.
2859 (elfcore_grok_note): Call them.
2860 (elfcore_write_s390_gs_cb): New function.
2861 (elfcore_write_s390_gs_bc): New function.
2862 (elfcore_write_register_note): Call them.
2864 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2866 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2867 bfd_get_file_size. Check archive element size.
2868 (_bfd_generic_get_section_contents_in_window): Likewise.
2870 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2872 * bfd-in2.h: Regenerated.
2873 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2874 (bfd_get_file_size): Likewise.
2876 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2877 Matthew Fortune <matthew.fortune@imgtec.com>
2879 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2880 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2881 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2882 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2884 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2885 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2886 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2887 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2888 `bfd_mach_mips_interaptiv_mr2' entries.
2889 * bfd-in2.h: Regenerate.
2891 2017-06-27 Nick Clifton <nickc@redhat.com>
2893 * tekhex.c (pass_over): Revert accidental conversion of a local
2894 array to a static array.
2896 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2899 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2900 reloc addend if necessary. Adjust diff only if
2901 shrinked_insn_address < end_address.
2903 2017-06-27 Alan Modra <amodra@gmail.com>
2906 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2907 (_bfd_generic_get_section_contents_in_window): Likewise.
2909 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2911 * elfnn-riscv.c (perform_relocation): Support the new
2912 R_RISCV_32_PCREL relocation.
2913 (riscv_elf_relocate_section): Likewise.
2914 * elfxx-riscv.c (howto_table): Likewise.
2915 (riscv_reloc_map): Likewise.
2916 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2917 * libbfd.h: Regenerate.
2919 2017-06-27 Alan Modra <amodra@gmail.com>
2922 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2923 Use unsigned file pointer type, and remove cast.
2924 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2925 Add "count", not "sz".
2927 2017-06-26 Pedro Alves <palves@redhat.com>
2930 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2933 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2936 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2939 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2941 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2942 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2943 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2944 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2945 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2947 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2950 * compress.c (bfd_get_full_section_contents): Don't check the
2952 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2953 reject a section whose size + offset is greater than the size
2955 (_bfd_generic_get_section_contents_in_window): Likewise.
2957 2017-06-26 Nick Clifton <nickc@redhat.com>
2960 * tekhex.c (getvalue): Check for the source pointer exceeding the
2961 end pointer before the first byte is read.
2963 2017-06-26 Nick Clifton <nickc@redhat.com>
2966 * opncls.c (get_build_id): Check that the section is big enough
2967 to contain the whole note.
2968 * compress.c (bfd_get_full_section_contents): Check for and reject
2969 a section whose size is greater than the size of the entire file.
2970 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2971 contain a notes section.
2973 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2975 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2977 (elf_s390_modify_segment_map): Likewise.
2978 (bfd_elf_s390_set_options): Lisewise.
2980 2017-06-26 Alan Modra <amodra@gmail.com>
2982 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2984 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2985 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2986 .preinit_array on --just-syms bfds.
2987 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2988 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2989 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2991 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2993 * elf.c (find_link): Bounds check "hint".
2995 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2997 * elf32-arm.c (using_thumb_only): Update list of architectures in
2998 BFD_ASSERT for which the logic is valid.
2999 (using_thumb2_bl): Likewise.
3000 (using_thumb2): Likewise and return true for ARMv8-R.
3001 (arch_has_arm_nop): Likewise.
3002 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
3003 merging logic. Update commentis for value 15 of v8m_baseline,
3004 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
3005 merging of value 15 of Tag_CPU_arch.
3007 2017-06-23 Jiong Wang <jiong.wang@arm.com>
3009 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
3010 BFD_RELOC_AARCH64_ADR_GOT_PAGE
3011 * bfd-in2.h: Regenerate.
3013 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3015 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
3016 the error_alignment label forward. Properly align program
3017 property note section.
3019 2017-06-22 Eric Christopher <echristo@gmail.com>
3021 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
3022 abs to fix a truncation warning.
3024 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3026 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
3027 local undefined weak symbol to 0.
3028 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
3030 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3032 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
3033 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3034 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
3035 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3036 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
3037 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
3038 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
3039 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
3041 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
3043 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
3044 (elf_i386_lazy_ibt_plt_entry): Likewise.
3045 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
3046 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
3047 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
3048 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
3049 (elf_i386_lazy_plt_layout): Likewise.
3050 (elf_i386_non_lazy_plt_layout): Likewise.
3051 (elf_i386_link_hash_entry): Add plt_second.
3052 (elf_i386_link_hash_table): Add plt_second and
3053 plt_second_eh_frame.
3054 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
3055 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
3056 the second PLT. Check the second PLT.
3057 (elf_i386_relocate_section): Use the second PLT to resolve
3058 PLT reference if needed.
3059 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
3061 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
3062 second PLT. Generate unwind info for the second PLT.
3063 (elf_i386_plt_type): Add plt_second.
3064 (elf_i386_get_synthetic_symtab): Support the second PLT.
3065 (elf_i386_parse_gnu_properties): Support
3066 GNU_PROPERTY_X86_FEATURE_1_AND.
3067 (elf_i386_merge_gnu_properties): Support
3068 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3069 on GNU_PROPERTY_X86_FEATURE_1_IBT
3070 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
3071 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3072 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3073 is set on all relocatable inputs.
3074 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
3075 (elf_x32_lazy_ibt_plt_entry): Likewise.
3076 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
3077 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
3078 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
3079 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
3080 (elf_x86_64_lazy_ibt_plt): Likewise.
3081 (elf_x32_lazy_ibt_plt): Likewise.
3082 (elf_x86_64_non_lazy_ibt_plt): Likewise.
3083 (elf_x32_non_lazy_ibt_plt): Likewise.
3084 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
3085 (elf_x86_64_parse_gnu_properties): Support
3086 GNU_PROPERTY_X86_FEATURE_1_AND.
3087 (elf_x86_64_merge_gnu_properties): Support
3088 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
3089 on GNU_PROPERTY_X86_FEATURE_1_IBT
3090 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
3091 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
3092 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
3093 is set on all relocatable inputs.
3095 2017-06-22 Nick Clifton <nickc@redhat.com>
3098 * som.c (setup_sections): NUL terminate the space_strings buffer.
3099 Check that the space.name field does not index beyond the end of
3100 the space_strings buffer.
3102 2017-06-21 Nick Clifton <nickc@redhat.com>
3105 * coff-sh.c (sh_reloc): Check for an out of range reloc.
3107 2017-06-21 Nick Clifton <nickc@redhat.com>
3110 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
3111 type of the size parameter.
3112 (_bfd_vms_save_counted_string): Add second parameter - the maximum
3113 length of the counted string.
3114 * vms.h (_bfd_vms_save_sized_string): Update prototype.
3115 (_bfd_vms_save_counted_string): Likewise.
3116 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
3117 _bfd_vms_save_counted_string.
3118 (_bfd_vms_slurp_ehdr): Likewise.
3119 (_bfd_vms_slurp_egsd): Likewise.
3120 (Parse_module): Likewise.
3122 2017-06-21 Alan Modra <amodra@gmail.com>
3124 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
3125 calls before tocsave calls.
3126 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
3129 2017-06-21 Nick Clifton <nickc@redhat.com>
3132 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
3133 bfd_get_full_section_contents returns no contents.
3135 2017-06-21 Nick Clifton <nickc@redhat.com>
3138 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
3141 2017-06-21 Nick Clifton <nickc@redhat.com>
3144 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3146 (image_set_ptr): Likewise.
3147 (alpha_vms_fix_sec_rel): Likewise.
3148 (alpha_vms_slurp_relocs): Likewise.
3150 2017-06-21 Nick Clifton <nickc@redhat.com>
3153 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3155 (ieee_archive_p): Likewise.
3156 (ieee_object_p): Likewise.
3158 2017-06-21 Nick Clifton <nickc@redhat.com>
3161 * elf.c (setup_group): Zero the group section pointer list after
3162 allocation so that loops can be caught. Check for NULL pointers
3163 when processing a group list.
3165 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3167 * elf-s390.h: New file.
3168 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3170 (elf_s390_additional_program_headers): New function.
3171 (elf_s390_modify_segment_map): New function.
3172 (bfd_elf_s390_set_options): New function.
3173 (elf_backend_additional_program_headers)
3174 (elf_backend_modify_segment_map): Add macro definitions.
3176 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3179 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3180 the DYNAMIC bit instead of bfd_count_sections.
3182 2017-06-19 Nick Clifton <nickc@redhat.com>
3185 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3187 (evax_bfd_print_eeom): Likewise.
3188 (evax_bfd_print_egsd): Check for an overlarge record length.
3189 (evax_bfd_print_etir): Likewise.
3191 2017-06-19 Nick Clifton <nickc@redhat.com>
3194 * libieee.h (struct common_header_type): Add end_p field.
3195 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3197 (read_id): Check for a length that exceeds the remaining bytes in
3199 (ieee_seek): Initialise end_p.
3200 (ieee_archive_p): Likewise.
3201 (ieee_object_p): Likewise.
3203 2017-06-19 Nick Clifton <nickc@redhat.com>
3206 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3207 before reading the EIHS structure entries.
3209 2017-06-19 Nick Clifton <nickc@redhat.com>
3212 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3213 gsd_size. Check that there are enough bytes remaining to read the
3214 type and size of the next egsd. Check that the size of the egsd
3215 does not exceed the size of the record.
3217 2017-06-19 Alan Modra <amodra@gmail.com>
3219 * config.bfd: Correct targ_underscore for cris.
3221 2017-06-18 Alan Modra <amodra@gmail.com>
3223 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3224 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3226 2017-06-16 Nick Clifton <nickc@redhat.com>
3228 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3229 bucketlist is empty because there are no symbols to add to the
3232 2017-06-16 Alan Modra <amodra@gmail.com>
3238 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3239 (BFD_JUMP_TABLE_LINK): Likewise.
3240 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3241 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3242 (bfd_elf_define_start_stop): New function.
3243 * linker.c (bfd_generic_define_start_stop): New function.
3244 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3246 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3247 * aout-target.h (MY_bfd_define_start_stop): Define.
3248 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3249 * binary.c (binary_bfd_define_start_stop): Define.
3250 * bout.c (b_out_bfd_define_start_stop): Define.
3251 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3252 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3253 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3254 * coffcode.h (coff_bfd_define_start_stop): Define.
3255 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3256 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3257 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3258 * ieee.c (ieee_bfd_define_start_stop): Define.
3259 * ihex.c (ihex_bfd_define_start_stop): Define.
3260 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3261 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3262 * mmo.c (mmo_bfd_define_start_stop): Define.
3263 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3264 * oasys.c (oasys_bfd_define_start_stop): Define.
3265 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3266 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3267 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3268 * som.c (som_bfd_define_start_stop): Define.
3269 * srec.c (srec_bfd_define_start_stop): Define.
3270 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3271 * versados.c (versados_bfd_define_start_stop): Define.
3272 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3273 (alpha_vms_bfd_define_start_stop): Define.
3274 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3275 * bfd-in2.h: Regenerate.
3276 * libbfd.h: Regenerate.
3278 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3280 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3281 SYMBOL_REFERENCES_LOCAL.
3283 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3286 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3287 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3288 runtime for if there needs copy relocation elimination.
3289 (need_copy_relocation_p): New function. Return true for symbol with
3290 pc-relative references and if it's against read-only sections.
3291 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3292 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3293 that are related with accessing external objects.
3294 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3295 in elfNN_aarch64_check_relocs.
3297 2017-06-15 Nick Clifton <nickc@redhat.com>
3300 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3303 (ieee_archive_p): Likewise.
3305 2017-06-15 Nick Clifton <nickc@redhat.com>
3308 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3310 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3312 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3313 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3314 keep both windowed and call0 ABI PLT definitions.
3315 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3316 elf_xtensa_*_plt_entry endex.
3317 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3319 2017-06-14 Nick Clifton <nickc@redhat.com>
3322 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3325 2017-06-14 Nick Clifton <nickc@redhat.com>
3328 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3329 maximum value for the ascic pointer. Check that name processing
3330 does not read beyond this value.
3331 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3334 2017-06-14 Nick Clifton <nickc@redhat.com>
3337 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3338 (process_otr): Check for an invalid offset in the otr structure.
3340 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3342 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3344 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3350 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3351 vtable field to a union.
3352 (_bfd_elf_is_start_stop): Removed.
3353 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3354 __start_SECNAME and __stop_SECNAME symbols.
3355 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3356 * elflink.c (_bfd_elf_is_start_stop): Removed.
3357 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3358 _bfd_elf_is_start_stop.
3359 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3360 __stop_SECNAME symbols. Updated.
3361 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3362 (bfd_elf_gc_record_vtinherit): Likewise.
3363 (bfd_elf_gc_record_vtentry): Likewise.
3365 2017-06-13 Nick Clifton <nickc@redhat.com>
3368 * elflink.c (elf_link_adjust_relocs): Generate an error when
3369 encountering a reloc against a symbol removed by garbage
3372 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3374 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3375 to merge_gnu_properties.
3376 * elf-properties.c (elf_merge_gnu_properties): Add struct
3377 bfd_link_info * and pass it to merge_gnu_properties.
3378 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3379 and pass it to elf_merge_gnu_properties.
3380 (_bfd_elf_link_setup_gnu_properties): Pass info to
3381 elf_merge_gnu_property_list.
3382 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3384 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3386 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3389 * binary.c (binary_set_section_contents): Scale lma by octets
3390 per byte to set filepos.
3392 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3394 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3397 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3399 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3402 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3404 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3405 patched section contents for TLS IE reloc.
3406 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3408 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3410 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3411 RELOC_FOR_GLOBAL_SYMBOL macro.
3413 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3415 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3418 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3420 * config/tc-arc.c (md_undefined_symbol): Changed.
3421 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3423 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3425 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3428 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3430 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3431 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3433 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3435 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3438 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3440 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3441 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3442 is non-zero. Add clarifying comments.
3444 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3446 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3447 name. Use local IFUNC symbol name string to report unsupported
3448 non-PIC call to IFUNC function.
3449 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3450 when generating R_386_IRELATIVE relocation.
3451 (elf_i386_finish_dynamic_symbol): Likewise.
3452 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3454 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3455 when generating R_X86_64_IRELATIVE relocation.
3456 (elf_x86_64_finish_dynamic_symbol): Likewise.
3458 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3460 * elf.c (setup_group): Make sure BFD sections are created for all
3461 group sections in the input file when processing SHF_GROUP
3463 (bfd_section_from_shdr): Avoid duplicating logic already
3464 implemented in `setup_group'.
3466 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3469 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3470 if the hint address is zero.
3472 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3475 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3476 ELF_COMMON_DEF_P for common symbols.
3478 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3480 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3481 SEC_GROUP sections as SEC_EXCLUDE.
3482 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3483 (assign_section_numbers): Use resolve_section_groups flag instead
3484 of relocatable link type.
3485 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3486 flag instead of checking the final_link flag for part of the
3487 checks in here. Fix white space as a result.
3488 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3489 instead of relocatable link type.
3490 (bfd_elf_final_link): Likewise.
3492 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3494 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3496 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3497 (s3_bfd_score_elf_check_relocs): Likewise.
3498 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3499 (score_elf_final_link_relocate): Likewise.
3500 (s7_bfd_score_elf_check_relocs): Likewise.
3502 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3504 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3507 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3509 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3510 from `reloc_count' rather than decrementing it.
3511 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3512 `reloc_count' by `int_rels_per_ext_rel'.
3513 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3514 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3515 entry determination.
3516 (s3_bfd_score_elf_check_relocs): Likewise.
3517 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3518 (s7_bfd_score_elf_relocate_section): Likewise.
3519 (s7_bfd_score_elf_check_relocs): Likewise.
3520 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3521 prototype and function.
3522 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3523 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3524 triple rather than once the sum of REL and RELA relocation entry
3526 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3527 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3528 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3529 storage allocation size determination.
3530 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3531 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3532 by `int_rels_per_ext_rel' for last relocation entry
3534 (bfd_elf_final_link): Do not multiply `reloc_count' by
3535 `int_rels_per_ext_rel' for internal relocation storage
3536 allocation size determination.
3537 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3538 `int_rels_per_ext_rel' for last relocation entry determination.
3539 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3540 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3541 (_bfd_mips_elf_relocate_section): Likewise.
3543 2017-06-05 Alan Modra <amodra@gmail.com>
3546 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3548 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3550 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3551 determine structure sizes.
3552 (elfcore_grok_freebsd_prstatus): Likewise.
3554 2017-06-01 Alan Modra <amodra@gmail.com>
3556 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3557 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3559 (is_elfv2_localentry0): New function.
3560 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3561 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3562 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3563 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3564 optimized localentry:0 stubs.
3565 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3566 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3568 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3570 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3572 2017-05-30 Casey Smith <clegg89@gmail.com>
3575 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3576 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3578 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3580 * cpu-arc.c (arc_compatible): New function.
3582 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3584 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3586 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3589 * bfdio.c (bfd_get_file_size): New function.
3590 * bfd-in2.h: Regenerated.
3592 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3594 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3597 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3599 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3600 dynobj instead of htab->elf.dynobj.
3602 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3604 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3606 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3607 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3608 actual number of internal relocations retrieved. Adjust
3609 function description.
3610 (bfd_elf64_canonicalize_reloc): Remove macro.
3611 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3613 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3615 * archures.c (bfd_mach_sparc_v9m8): Define.
3616 (bfd_mach_sparc_v8plusm8): Likewise.
3617 (bfd_mach_sparc_v9_p): Adjust to M8.
3618 (bfd_mach_sparc_64bit_p): Likewise.
3619 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3620 bfd_mach_sparc_v8plusm8.
3621 * bfd-in2.h: Regenerated.
3622 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3624 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3625 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3626 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3628 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3629 bfd_mach_sparc_v8plusm8.
3631 2017-05-19 Alan Modra <amodra@gmail.com>
3633 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3634 debug and special sections when no non-note alloc sections in an
3637 2017-05-18 Alan Modra <amodra@gmail.com>
3639 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3640 * elf-m10300.c: Likewise.
3642 * elf32-arc.c: Likewise.
3643 * elf32-bfin.c: Likewise.
3644 * elf32-m68k.c: Likewise.
3645 * elf32-nds32.c: Likewise.
3646 * elf32-tilepro.c: Likewise.
3647 * elflink.c: Likewise.
3648 * elfnn-aarch64.c: Likewise.
3649 * elfnn-riscv.c: Likewise.
3650 * elfxx-tilegx.c: Likewise.
3651 * mach-o.c: Likewise.
3652 * peXXigen.c: Likewise.
3653 * vms-alpha.c: Likewise.
3654 * vms-lib.c: Likewise.
3656 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3659 * elflink.c (elf_gc_mark_debug_section): New function.
3660 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3661 referenced by kept debug sections.
3663 2017-05-16 Alan Modra <amodra@gmail.com>
3665 * elf-m10300.c: Rename occurrences of non_ir_ref.
3666 * elf32-arm.c: Likewise.
3667 * elf32-bfin.c: Likewise.
3668 * elf32-cr16.c: Likewise.
3669 * elf32-cris.c: Likewise.
3670 * elf32-d10v.c: Likewise.
3671 * elf32-dlx.c: Likewise.
3672 * elf32-fr30.c: Likewise.
3673 * elf32-frv.c: Likewise.
3674 * elf32-hppa.c: Likewise.
3675 * elf32-i370.c: Likewise.
3676 * elf32-i386.c: Likewise.
3677 * elf32-iq2000.c: Likewise.
3678 * elf32-lm32.c: Likewise.
3679 * elf32-m32c.c: Likewise.
3680 * elf32-m32r.c: Likewise.
3681 * elf32-m68hc1x.c: Likewise.
3682 * elf32-m68k.c: Likewise.
3683 * elf32-mcore.c: Likewise.
3684 * elf32-metag.c: Likewise.
3685 * elf32-microblaze.c: Likewise.
3686 * elf32-moxie.c: Likewise.
3687 * elf32-msp430.c: Likewise.
3688 * elf32-mt.c: Likewise.
3689 * elf32-nios2.c: Likewise.
3690 * elf32-or1k.c: Likewise.
3691 * elf32-ppc.c: Likewise.
3692 * elf32-rl78.c: Likewise.
3693 * elf32-s390.c: Likewise.
3694 * elf32-score.c: Likewise.
3695 * elf32-score7.c: Likewise.
3696 * elf32-sh.c: Likewise.
3697 * elf32-tic6x.c: Likewise.
3698 * elf32-tilepro.c: Likewise.
3699 * elf32-v850.c: Likewise.
3700 * elf32-vax.c: Likewise.
3701 * elf32-xstormy16.c: Likewise.
3702 * elf32-xtensa.c: Likewise.
3703 * elf64-alpha.c: Likewise.
3704 * elf64-hppa.c: Likewise.
3705 * elf64-ia64-vms.c: Likewise.
3706 * elf64-mmix.c: Likewise.
3707 * elf64-ppc.c: Likewise.
3708 * elf64-s390.c: Likewise.
3709 * elf64-sh64.c: Likewise.
3710 * elf64-x86-64.c: Likewise.
3711 * elflink.c: Likewise.
3712 * elfnn-aarch64.c: Likewise.
3713 * elfnn-ia64.c: Likewise.
3714 * elfnn-riscv.c: Likewise.
3715 * elfxx-mips.c: Likewise.
3716 * elfxx-sparc.c: Likewise.
3717 * elfxx-tilegx.c: Likewise.
3718 * linker.c: Likewise.
3720 2017-05-16 Alan Modra <amodra@gmail.com>
3722 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3723 * elflink.c (elf_link_add_object_symbols): Update to use
3725 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3727 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3729 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3731 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3733 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3735 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3736 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3738 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3740 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3742 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3744 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3745 to plt_second/plt_second_eh_frame.
3746 (elf_x86_64_link_hash_newfunc): Updated.
3747 (elf_x86_64_allocate_dynrelocs): Likewise.
3748 (elf_x86_64_size_dynamic_sections): Likewise.
3749 (elf_x86_64_relocate_section): Likewise.
3750 (elf_x86_64_finish_dynamic_symbol): Likewise.
3751 (elf_x86_64_finish_dynamic_sections): Likewise.
3752 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3753 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3755 (elf_backend_setup_gnu_properties): Updated. Create the
3756 .plt.sec section instead of the .plt.sec section.
3758 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3760 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3761 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3762 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3764 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3766 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3767 (bfd_elf64_set_reloc): Define.
3768 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3770 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3772 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3773 (struct bfd_target): New field _bfd_set_reloc.
3774 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3775 * reloc.c (_bfd_generic_set_reloc): New function.
3776 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3777 * nlm-target.h (nlm_set_reloc): Likewise.
3778 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3779 * aout-tic30.c (MY_set_reloc): Likewise.
3780 * aout-target.h (MY_set_reloc): Likewise.
3781 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3782 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3783 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3784 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3785 * aout-adobe.c (aout_32_set_reloc): Likewise.
3786 * bout.c (b_out_set_reloc): Likewise.
3787 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3788 * i386os9k.c (aout_32_set_reloc): Likewise.
3789 * ieee.c (ieee_set_reloc): Likewise.
3790 * oasys.c (oasys_set_reloc): Likewise.
3791 * som.c (som_set_reloc): Likewise.
3792 * versados.c (versados_set_reloc): Likewise.
3793 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3794 _bfd_generic_set_reloc.
3795 (rs6000_xcoff64_aix_vec): LIkewise.
3796 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3797 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3798 * i386msdos.c (msdos_set_reloc): Define to
3799 _bfd_norelocs_set_reloc.
3800 * elfcode.h (elf_set_reloc): Define.
3801 * bfd-in2.h: Regenerated.
3803 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3806 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3807 for IFUNC function address.
3809 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3811 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3812 (CONFLICT_LIST): Likewise.
3813 (opcode/arc-attrs.h): Include.
3814 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3815 (arc_extract_features): New file.
3816 (arc_stralloc): Likewise.
3817 (arc_elf_merge_attributes): Likewise.
3818 (arc_elf_merge_private_bfd_data): Use object attributes.
3819 (bfd_arc_get_mach_from_attributes): New function.
3820 (arc_elf_object_p): Use object attributes.
3821 (arc_elf_final_write_processing): Likewise.
3822 (elf32_arc_obj_attrs_arg_type): New function.
3823 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3824 (elf32_arc_section_from_shdr): Likewise.
3825 (elf_backend_obj_attrs_vendor): Define.
3826 (elf_backend_obj_attrs_section): Likewise.
3827 (elf_backend_obj_attrs_arg_type): Likewise.
3828 (elf_backend_obj_attrs_section_type): Likewise.
3829 (elf_backend_obj_attrs_handle_unknown): Likewise.
3830 (elf_backend_section_from_shdr): Likewise.
3832 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3835 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3836 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3837 and the destination is a Thumb symbol.
3839 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3841 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3842 initializer to silence GCC 4.2.
3843 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3845 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3847 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3848 (LAZY_PLT_ENTRY_SIZE): This.
3849 (NON_LAZY_PLT_ENTRY_SIZE): New.
3850 (elf_x86_64_plt0_entry): Renamed to ...
3851 (elf_x86_64_lazy_plt0_entry): This.
3852 (elf_x86_64_plt_entry): Renamed to ...
3853 (elf_x86_64_lazy_plt_entry): This.
3854 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3855 (elf_x86_64_lazy_bnd_plt0_entry): This.
3856 (elf_x86_64_legacy_plt_entry): Removed.
3857 (elf_x86_64_bnd_plt_entry): Renamed to ...
3858 (elf_x86_64_lazy_bnd_plt_entry): This.
3859 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3860 (elf_x86_64_non_lazy_plt_entry): This.
3861 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3862 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3863 (elf_x86_64_eh_frame_plt): Renamed to ...
3864 (elf_x86_64_eh_frame_lazy_plt): This.
3865 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3866 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3867 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3868 (elf_x86_64_eh_frame_non_lazy_plt): This.
3869 (elf_x86_64_lazy_plt_layout): New.
3870 (elf_x86_64_non_lazy_plt_layout): Likewise.
3871 (elf_x86_64_plt_layout): Likewise.
3872 (elf_x86_64_backend_data): Remove PLT layout information. Add
3873 os for target system.
3874 (GET_PLT_ENTRY_SIZE): Removed.
3875 (elf_x86_64_lazy_plt): New.
3876 (elf_x86_64_non_lazy_plt): Likewise.
3877 (elf_x86_64_lazy_bnd_plt): Likewise.
3878 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3879 (elf_x86-64_arch_bed): Updated.
3880 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3881 (elf_x86_64_create_dynamic_sections): Removed.
3882 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3883 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3884 (elf_x86-64_adjust_dynamic_symbol): Updated.
3885 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3886 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3887 size for PLT0 if there is no PLT0. Get plt_entry_size from
3888 non_lazy_plt for non-lazy PLT entries.
3889 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3890 from non_lazy_plt for non-lazy PLT entries.
3891 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3892 if there is no PLT0.
3893 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3894 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3895 entries with non-lazy PLT layout. Don't fill the second and third
3896 slots in the PLT entry if there is no PLT0.
3897 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3898 if there is no PLT0. Set sh_entsize on the .plt.got section.
3899 (compare_relocs): New.
3900 (elf_x86_64_plt_type): Likewise.
3901 (elf_x86_64_plt): Likewise.
3902 (elf_x86_64_nacl_plt): New. Forward declaration.
3903 (elf_x86_64_get_plt_sym_val): Removed.
3904 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3905 against all dynamic relocations.
3906 (elf_x86_64_link_setup_gnu_properties): New function.
3907 (elf_backend_create_dynamic_sections): Updated.
3908 (elf_backend_setup_gnu_properties): New.
3909 (elf_x86_64_nacl_plt): New.
3910 (elf_x86_64_nacl_arch_bed): Updated.
3912 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3914 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3915 (LAZY_PLT_ENTRY_SIZE): This.
3916 (NON_LAZY_PLT_ENTRY_SIZE): New.
3917 (elf_i386_plt0_entry): Renamed to ...
3918 (elf_i386_lazy_plt0_entry): This.
3919 (elf_i386_plt_entry): Renamed to ...
3920 (elf_i386_lazy_plt_entry): This.
3921 (elf_i386_pic_plt0_entry): Renamed to ...
3922 (elf_i386_pic_lazy_plt0_entry): This.
3923 (elf_i386_pic_plt_entry): Renamed to ...
3924 (elf_i386_pic_lazy_plt_entry): This.
3925 (elf_i386_got_plt_entry): Renamed to ...
3926 (elf_i386_non_lazy_plt_entry): This.
3927 (elf_i386_pic_got_plt_entry): Renamed to ...
3928 (elf_i386_pic_non_lazy_plt_entry): This.
3929 (elf_i386_eh_frame_plt): Renamed to ...
3930 (elf_i386_eh_frame_lazy_plt): This.
3931 (elf_i386_eh_frame_plt_got): Renamed to ...
3932 (elf_i386_eh_frame_non_lazy_plt): This.
3933 (elf_i386_plt_layout): Renamed to ...
3934 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3935 eh_frame_plt_got_size.
3936 (elf_i386_non_lazy_plt_layout): New.
3937 (elf_i386_plt_layout): Likewise.
3938 (elf_i386_non_lazy_plt): Likewise.
3939 (GET_PLT_ENTRY_SIZE): Removed.
3940 (elf_i386_plt): Renamed to ...
3941 (elf_i386_lazy_plt): This.
3942 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3943 (elf_i386_arch_bed): Updated.
3944 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3945 (elf_i386_create_dynamic_sections): Removed.
3946 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3947 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3948 (elf_i386_adjust_dynamic_symbol): Updated.
3949 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3950 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3951 size for PLT0 if there is no PLT0.
3952 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3953 output section is discarded only if GOT isn't empty.
3954 (elf_i386_relocate_section): Updated. Properly get PLT index
3955 if there is no PLT0.
3956 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3957 second and third slots in the PLT entry if there is no PLT0.
3958 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3959 if there is no PLT0. Set sh_entsize on the .plt.got section.
3960 (elf_i386_nacl_plt): Forward declaration.
3961 (elf_i386_get_plt_sym_val): Removed.
3962 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3963 against all dynamic relocations.
3964 (elf_i386_link_setup_gnu_properties): New function.
3965 (elf_backend_create_dynamic_sections): Updated.
3966 (elf_backend_setup_gnu_properties): New.
3967 (elf_i386_nacl_plt): Updated.
3968 (elf_i386_nacl_arch_bed): Likewise.
3969 (elf_i386_vxworks_arch_bed): Likewise.
3971 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3973 * elflink.c (elf_output_implib): Remove executable flag from import
3975 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3976 library is a relocatable object file.
3978 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3981 * elf32-avr.c (avr_should_move_sym): New function.
3982 (avr_should_reduce_sym_size): Likewise.
3983 (avr_should_increase_sym_size): Likewise.
3984 (elf32_avr_relax_delete_bytes): Adjust symbol values
3985 and sizes by calling new functions.
3987 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3989 * config.bfd (riscv32-*): Enable rv64.
3991 2017-05-02 Alan Modra <amodra@gmail.com>
3994 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3995 rather than h->root.type == bfd_link_hash_new.
3996 (bfd_elf_record_link_assignment): Similarly, call
3997 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3999 2017-04-29 Alan Modra <amodra@gmail.com>
4002 * reloc.c (reloc_offset_in_range): New function.
4003 (bfd_perform_relocation, bfd_install_relocation): Use it.
4004 (_bfd_final_link_relocate): Likewise.
4006 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
4008 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
4009 before using .plt.got.
4010 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
4012 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4014 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
4015 instead of "+=" to update 0.
4017 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4019 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
4020 .plt.got section here.
4021 (elf_i386_check_relocs): Don't create the .plt.got section.
4022 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
4023 the .plt.got and .plt.bnd sections here.
4024 (elf_x86_64_check_relocs): Don't create the .plt.got nor
4027 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4029 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
4031 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
4032 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
4033 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
4034 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
4037 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4039 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
4041 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
4042 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
4043 the first relocatable ELF input with GNU properties.
4045 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
4047 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
4048 VxWorks for non-PIC.
4050 2017-04-27 Alan Modra <amodra@gmail.com>
4052 * elf-bfd.h (struct elf_backend_data): Make asection param of
4053 elf_backend_eh_frame_address_size const.
4054 (_bfd_elf_eh_frame_address_size): Likewise.
4055 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
4056 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
4057 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
4058 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
4059 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
4060 (next_cie_fde_offset): Constify params.
4061 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
4063 2017-04-27 Alan Modra <amodra@gmail.com>
4065 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
4066 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
4067 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
4069 (offset_adjust): New function.
4070 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
4071 (adjust_eh_frame_local_symbols): Likewise.
4072 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
4073 after changing anything. Return true if anything changed.
4074 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
4075 _bfd_elf_adjust_eh_frame_global_symbol for globals.
4077 2017-04-27 Alan Modra <amodra@gmail.com>
4079 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
4082 2017-04-27 Alan Modra <amodra@gmail.com>
4084 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4085 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
4086 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
4087 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
4088 for undef and undefweak dyn_relocs.
4089 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
4090 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
4091 (allocate_got, allocate_dynrelocs): Likewise.
4092 (ppc64_elf_relocate_section): Likewise.
4094 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
4096 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
4097 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
4098 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
4099 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
4101 2017-04-26 Nick Clifton <nickc@redhat.com>
4104 * reloc.c (bfd_perform_relocation): Check for a negative address
4107 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4110 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
4112 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
4113 (elf_backend_always_renumber_dynsyms): Define.
4114 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
4115 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
4116 * elflink.c (bfd_elf_size_dynamic_sections): Also call
4117 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
4119 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
4121 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
4123 * elflink.c (bfd_elf_size_dynamic_sections): Only call
4124 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
4125 sections have been created.
4127 2017-04-26 Nick Clifton <nickc@redhat.com>
4130 * compress.c (bfd_init_section_compress_status): Check the return
4131 value from bfd_malloc.
4133 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4135 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
4136 no_finish_dynamic_symbol.
4137 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
4139 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
4140 weak symbol, don't make it dynamic.
4141 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
4142 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
4143 relocation for GOT reference.
4144 (elf_x86_64_finish_dynamic_symbol): Abort if
4145 no_finish_dynamic_symbol isn't 0.
4147 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4150 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4151 undefined weak symbol, don't make it dynamic.
4152 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4153 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4154 relocation for R_386_GOT32.
4156 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4159 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4161 2017-04-23 Alan Modra <amodra@gmail.com>
4164 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4165 * elf.c (lcomm_sym): New.
4166 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4167 * bfd-in2.h: Regenerate.
4169 2017-04-23 Alan Modra <amodra@gmail.com>
4172 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4173 parameters and comment.
4174 (_bfd_elf_get_reloc_section): Delete.
4175 (_bfd_elf_plt_get_reloc_section): Declare.
4176 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4177 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4179 (_bfd_elf_get_reloc_section): ..here. Delete.
4180 (assign_section_numbers): Call elf_get_reloc_section.
4181 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4182 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4184 2017-04-23 Alan Modra <amodra@gmail.com>
4187 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4190 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4193 * elf32-i386.c (elf_i386_link_hash_entry): Add
4194 no_finish_dynamic_symbol.
4195 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4196 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4197 symbol, don't make it dynamic in PIE.
4198 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4199 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4200 relocation for R_386_GOT32
4201 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4204 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4208 * elflink.c (elf_link_add_object_symbols): Require
4209 --no-dynamic-linker with -E/--dynamic-list when creating
4212 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4214 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4217 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4219 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4220 dynamic symbol sorting.
4222 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4225 * elflink.c (elf_link_add_object_symbols): Preserve
4226 dynamic_ref_after_ir_def when restoring the symbol table for
4227 unneeded dynamic object.
4229 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4232 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4233 on on undefined IFUNC symbol in the second PLT.
4235 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4237 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4239 2017-04-19 Alan Modra <amodra@gmail.com>
4241 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4242 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4243 * elf32-ppc.c:Formatting.
4244 (ensure_undefweak_dynamic): Don't make dynamic when
4245 info->dynamic_undefined_weak is zero.
4246 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4247 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4248 not default visibility. Discard undef and undefweak
4250 (ppc_elf_relocate_section): Adjust to suit.
4251 * elf64-ppc.c: Formatting.
4252 (ensure_undefweak_dynamic): Don't make dynamic when
4253 info->dynamic_undefined_weak is zero.
4254 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4255 info->dynamic_undefined_weak. Discard them earlier.
4257 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4260 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4261 before generating the version definition section.
4263 2017-04-17 Alan Modra <amodra@gmail.com>
4265 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4266 state when a regular object file defines a symbol with
4267 incompatible type to that defined by an earlier shared lib.
4269 2017-04-13 Alan Modra <amodra@gmail.com>
4271 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4273 * elf32-arm.c: Likewise.
4274 * elf32-i386.c: Likewise.
4275 * elf32-mep.c: Likewise.
4276 * elf64-ia64-vms.c: Likewise.
4277 * elf64-x86-64.c: Likewise.
4278 * elflink.c: Likewise.
4279 * elfnn-ia64.c: Likewise.
4280 * elfxx-mips.c: Likewise.
4282 2017-04-13 Alan Modra <amodra@gmail.com>
4284 * aoutx.h: Use %B and %A in error messages throughout file.
4285 * aout-cris.c: Likewise.
4286 * archive.c: Likewise.
4287 * binary.c: Likewise.
4288 * coff-rs6000.c: Likewise.
4289 * coff-tic4x.c: Likewise.
4290 * coffcode.h: Likewise.
4291 * coffgen.c: Likewise.
4292 * cofflink.c: Likewise.
4293 * coffswap.h: Likewise.
4294 * cpu-arm.c: Likewise.
4295 * elf-eh-frame.c: Likewise.
4296 * elf-m10300.c: Likewise.
4298 * elf32-arc.c: Likewise.
4299 * elf32-arm.c: Likewise.
4300 * elf32-bfin.c: Likewise.
4301 * elf32-frv.c: Likewise.
4302 * elf32-iq2000.c: Likewise.
4303 * elf32-m32c.c: Likewise.
4304 * elf32-microblaze.c: Likewise.
4305 * elf32-nds32.c: Likewise.
4306 * elf32-rl78.c: Likewise.
4307 * elf32-rx.c: Likewise.
4308 * elf32-score.c: Likewise.
4309 * elf32-score7.c: Likewise.
4310 * elf32-sh64.c: Likewise.
4311 * elf32-v850.c: Likewise.
4312 * elf32-vax.c: Likewise.
4313 * elf32-visium.c: Likewise.
4314 * elf64-ia64-vms.c: Likewise.
4315 * elf64-mmix.c: Likewise.
4316 * elf64-sh64.c: Likewise.
4317 * elfcode.h: Likewise.
4318 * elfnn-aarch64.c: Likewise.
4319 * elfnn-ia64.c: Likewise.
4320 * elfxx-mips.c: Likewise.
4321 * hpux-core.c: Likewise.
4324 * linker.c: Likewise.
4325 * merge.c: Likewise.
4327 * oasys.c: Likewise.
4328 * pdp11.c: Likewise.
4329 * peXXigen.c: Likewise.
4330 * rs6000-core.c: Likewise.
4331 * vms-alpha.c: Likewise.
4332 * xcofflink.c: Likewise.
4334 2017-04-13 Alan Modra <amodra@gmail.com>
4336 * bfd.c (PRINT_TYPE): Define.
4337 (_doprnt): New function.
4338 (error_handler_internal): Use _doprnt.
4339 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4340 calls in their natural order, throughout file.
4341 * coff-mcore.c: Likewise.
4342 * coff-ppc.c: Likewise.
4343 * coff-tic80.c: Likewise.
4344 * cofflink.c: Likewise.
4345 * elf-s390-common.c: Likewise.
4347 * elf32-arm.c: Likewise.
4348 * elf32-i386.c: Likewise.
4349 * elf32-m32r.c: Likewise.
4350 * elf32-msp430.c: Likewise.
4351 * elf32-spu.c: Likewise.
4352 * elf64-ia64-vms.c: Likewise.
4353 * elf64-sparc.c: Likewise.
4354 * elf64-x86-64.c: Likewise.
4355 * elflink.c: Likewise.
4356 * elfnn-aarch64.c: Likewise.
4357 * elfnn-ia64.c: Likewise.
4358 * elfxx-mips.c: Likewise.
4360 2017-04-13 Alan Modra <amodra@gmail.com>
4362 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4363 branch veneers" error. Fix double space and format message.
4364 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4365 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4367 2017-04-13 Alan Modra <amodra@gmail.com>
4369 * bfd-in2.h: Regenerate.
4371 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4373 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4374 extra `\n' in warning/error messages.
4375 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4376 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4378 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4380 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4381 processor-specific properties with generic ELF target vector.
4383 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4385 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4386 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4387 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4388 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4390 (link_hash_newfunc): Initialize has_got_reloc and
4392 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4394 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4396 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4398 (_bfd_sparc_elf_fixup_symbol): New function.
4399 (allocate_dynrelocs): Don't allocate space for dynamic
4400 relocations and discard relocations against resolved undefined
4401 weak symbols in executable. Don't make resolved undefined weak
4402 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4403 relocation against undefined weak symbols in PIE.
4404 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4405 relocations against resolved undefined weak symbols in PIE
4406 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4407 without ynamic PLT/GOT relocations for resolved undefined weak
4409 Don't generate dynamic relocation against resolved undefined
4410 weak symbol in executable.
4411 (pie_finish_undefweak_symbol): New function.
4412 (_bfd_sparc_elf_finish_dynamic_sections): Call
4413 pie_finish_undefweak_symbol on all symbols in PIE.
4414 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4415 (_bfd_sparc_elf_fixup_symbol): New function.
4417 2017-04-10 Nick Clifton <nickc@redhat.com>
4419 * config.bfd: Remove ns32k from obsolete list.
4421 2017-04-10 Alan Modra <amodra@gmail.com>
4424 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4425 (special_sections_i): Likewise for .init_array.
4426 (special_sections_p): Likewise for .preinit_array.
4428 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4432 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4433 ELF_COMMON_DEF_P for common symbols.
4434 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4435 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4436 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4437 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4438 07492f668d2173da7a2bda3707ff0985e0f460b6.
4440 2017-04-07 Pedro Alves <palves@redhat.com>
4442 * opncls.c (bfd_get_debug_link_info): Rename to...
4443 (bfd_get_debug_link_info_1): ... this. Change type of second
4444 parameter to void pointer. Adjust.
4445 (bfd_get_debug_link_info): Reimplement on top of
4446 bfd_get_debug_link_info_1.
4447 (separate_debug_file_exists, separate_alt_debug_file_exists):
4448 Change type of second parameter to void pointer. Adjust.
4449 (get_func_type, check_func_type): Change type of second parameter
4451 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4452 the callback functions instead of passing the address of a local.
4453 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4454 find_separate_debug_file.
4455 (get_alt_debug_link_info_shim): Change type of second parameter to
4456 void pointer. Adjust.
4457 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4458 find_separate_debug_file.
4459 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4460 of second parameter to void pointer. Adjust.
4461 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4462 pointer local to find_separate_debug_file.
4464 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4466 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4467 external symbols with a definition.
4468 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4470 2017-04-07 Alan Modra <amodra@gmail.com>
4472 * po/SRC-POTFILES.in: Regenerate.
4474 2017-04-05 Alan Modra <amodra@gmail.com>
4476 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4479 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4481 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4482 numbers for DataDirectory entry indicies passed to
4485 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4487 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4488 each GNU_MBIND section and align GNU_MBIND section to page size.
4489 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4490 segment for each GNU_MBIND section.
4491 (_bfd_elf_init_private_section_data): Copy sh_info from input
4492 for GNU_MBIND section.
4494 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4496 * elfnn-riscv.c (GP_NAME): Delete.
4497 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4498 (_bfd_riscv_relax_lui): Likewise.
4500 2017-04-04 Nick Clifton <nickc@redhat.com>
4503 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4505 (bfd_elf_final_link): Only initialize the extended symbol index
4506 section if there are extended symbol tables to list.
4508 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4510 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4511 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4512 * configure.ac (elf): Add elf-properties.lo.
4513 * Makefile.in: Regenerated.
4514 * configure: Likewise.
4515 * elf-bfd.h (elf_property_kind): New.
4516 (elf_property): Likewise.
4517 (elf_property_list): Likewise.
4518 (elf_properties): Likewise.
4519 (_bfd_elf_parse_gnu_properties): Likewise.
4520 (_bfd_elf_get_property): Likewise.
4521 (_bfd_elf_link_setup_gnu_properties): Likewise.
4522 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4523 and setup_gnu_properties.
4524 (elf_obj_tdata): Add properties.
4525 * elf-properties.c: New file.
4526 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4527 (elf_i386_merge_gnu_properties): Likewise.
4528 (elf_backend_parse_gnu_properties): Likewise.
4529 (elf_backend_merge_gnu_properties): Likewise.
4530 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4531 (elf_x86_64_merge_gnu_properties): Likewise.
4532 (elf_backend_parse_gnu_properties): Likewise.
4533 (elf_backend_merge_gnu_properties): Likewise.
4534 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4535 (elf_backend_parse_gnu_properties): Likewise.
4536 (elf_backend_setup_gnu_properties): Likewise.
4537 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4538 elf_backend_merge_gnu_properties and
4539 elf_backend_setup_gnu_properties.
4541 2017-03-30 Pip Cet <pipcet@gmail.com>
4543 * elf32-wasm32.c: Add relocation code, two relocs.
4544 * reloc.c: Add wasm32 relocations.
4545 * libbfd.h: Regenerate.
4546 * bfd-in2.h: Regenerate.
4547 * bfd/po/bfd.pot: Regenerate.
4549 2017-03-29 Nick Clifton <nickc@redhat.com>
4552 * coff-bfd.h (struct coff_section_data): Add new fields:
4553 saved_bias and bias.
4554 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4555 computed for PE binaries.
4556 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4559 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4562 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4563 to handle a local symbol with a hash-symbol-entry; without PLT.
4564 Add BFD_ASSERT for an incidental case with GOT entry present.
4565 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4566 isn't forced-or-set local.
4568 2017-03-27 Pip Cet <pipcet@gmail.com>
4570 * wasm-module.c: New file to support WebAssembly modules.
4571 * wasm-module.h: New file to support WebAssembly modules.
4572 * doc/webassembly.texi: Start documenting wasm-module.c.
4573 * config.bfd: Add wasm_vec.
4574 * targets.c: Likewise.
4575 * configure.ac: Likewise.
4576 * Makefile.am: Add entries for wasm-module.c.
4577 * Makefile.in: Regenerate.
4578 * configure: Regenerate.
4579 * po/SRC-POTFILES.in: Regenerate.
4581 2017-03-27 Pip Cet <pipcet@gmail.com>
4583 * cpu-wasm32.c: New file to support wasm32 architecture.
4584 * elf32-wasm32.c: New file to support wasm32 architecture.
4585 * Makefile.am: Add wasm32 architecture.
4586 * archures.c: Likewise.
4587 * config.bfd: Likewise.
4588 * configure.ac: Likewise.
4589 * targets.c: Likewise.
4590 * Makefile.in: Regenerate.
4591 * bfd-in2.h: Regenerate.
4592 * configure: Regenerate.
4593 * po/SRC-POTFILES.in: Regenerate.
4595 2017-03-20 Alan Modra <amodra@gmail.com>
4598 * elf64-ppc.c (compare_symbols): Stabilize sort.
4600 2017-03-18 Alan Modra <amodra@gmail.com>
4602 * elf64-ppc.c (struct ppc_link_hash_table): Add
4603 local_ifunc_resolver and maybe_local_ifunc_resolver.
4604 (ppc_build_one_stub): Set flags on emitting dynamic
4605 relocation to ifunc.
4606 (ppc64_elf_relocate_section): Likewise.
4607 (ppc64_elf_finish_dynamic_symbol): Likewise.
4608 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4609 local dynamic relocs to ifuncs.
4610 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4611 local_ifunc_resolver and maybe_local_ifunc_resolver.
4612 (ppc_elf_relocate_section): Set flag on emitting dynamic
4613 relocation to ifuncs.
4614 (ppc_elf_finish_dynamic_symbol): Likewise.
4615 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4616 dynamic relocs to ifuncs.
4618 2017-03-13 Nick Clifton <nickc@redhat.com>
4621 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4622 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4623 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4624 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4625 * bfd-in2.h: Regenerate.
4626 * libbfd.h: Regenerate.
4627 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4629 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4630 (elfNN_aarch64_howto_table): Likewise.
4631 (aarch64_tls_transition_without_check): Likewise.
4632 (aarch64_reloc_got_type): Likewise.
4633 (elfNN_aarch64_final_link_relocate): Likewise.
4634 (elfNN_aarch64_tls_relax): Likewise.
4635 (elfNN_aarch64_relocate_section): Likewise.
4636 (elfNN_aarch64_gc_sweep_hook): Likewise.
4637 (elfNN_aarch64_check_relocs): Likewise.
4638 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4639 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4641 2017-03-11 Alan Modra <amodra@gmail.com>
4643 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4644 parameter is in fact used. Whitespace fixes.
4645 * elf64-ppc.c: Likewise.
4647 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4649 * rs6000-core.c (CORE_NEW): Simplify macro when
4650 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4652 2017-03-07 Alan Modra <amodra@gmail.com>
4656 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4659 2017-03-05 Alan Modra <amodra@gmail.com>
4661 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4662 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4663 (next_cie_fde_offset): New function.
4664 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4665 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4666 four bytes. Align CIEs to four or eight bytes depending on
4667 per_encoding_aligned8. Align FDEs according to their encoding.
4668 Pad last FDE to output section alignment.
4669 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4671 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4672 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4673 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4675 2017-03-02 Martin Bickel <binutils@ineranves.de>
4678 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4679 empty segments which have a zero filesz, but a non-zero memsz.
4681 2017-03-02 Alan Modra <amodra@gmail.com>
4683 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4685 2017-02-28 Alan Modra <amodra@gmail.com>
4687 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4688 (ppc64_elf_relocate_section): Likewise.
4690 2017-02-28 Alan Modra <amodra@gmail.com>
4693 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4694 rather than elf32_nios2_hash_table or elf_hash_table.
4695 (create_got_section): Likewise.
4696 (nios2_elf32_finish_dynamic_symbol): Likewise.
4697 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4698 (nios2_elf32_size_dynamic_sections): Likewise.
4699 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4700 vars. Use htab equivalents directly instead. Don't create
4701 all dynamic sections on needing just the GOT. Use a goto
4702 rather than a fall-through with reloc test. Ensure
4703 htab->dynobj is set when making dynamic sreloc section.
4704 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4705 equivalent directly instead. Don't segfault on looking for
4706 .dynamic when dynamic sections have not been created. Don't
4707 segfault on .got.plt being discarded.
4708 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4709 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4710 fixme and another not so relevant comment.
4711 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4712 already set, set hash table dynobj on creating .sbss.
4714 2017-02-28 Alan Modra <amodra@gmail.com>
4716 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4717 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4718 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4719 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4720 (ppc64_elf_relocate_section): Likewise.
4721 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4722 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4723 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4724 * libbfd.h: Regenerate.
4725 * bfd-in2.h: Regenerate.
4727 2017-02-28 Alan Modra <amodra@gmail.com>
4729 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4730 dynamic .data.rel.ro read-only.
4731 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4732 rather than section flags when deciding where copy reloc goes.
4733 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4734 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4735 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4736 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4737 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4738 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4739 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4740 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4741 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4742 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4743 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4744 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4745 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4746 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4747 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4748 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4749 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4750 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4751 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4753 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4755 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4756 `jalr $0, $25' instruction encoding.
4758 2017-02-27 Nick Clifton <nickc@redhat.com>
4761 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4762 generating a seg-fault when encountering a symbol that has been
4763 deleted by garbage collection.
4765 2017-02-25 Alan Modra <amodra@gmail.com>
4767 * elf32-arc.c (struct dynamic_sections): Delete.
4768 (enum dyn_section_types): Delete.
4769 (dyn_section_names): Delete.
4770 (arc_create_dynamic_sections): Delete.
4771 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4772 segfault on discarded .rela.plt section.
4773 (elf_arc_size_dynamic_sections): Formatting. Don't call
4774 arc_create_dynamic_sections. Don't allocate memory for sections
4775 handled by the generic linker. Correct code finding relocs in
4776 read-only sections. Set SEC_EXCLUDE on zero size .got,
4777 .got.plt, and .dynbss sections. Do set .interp for pies.
4779 2017-02-24 Andrew Waterman <andrew@sifive.com>
4781 * elfnn-riscv.c (GP_NAME): New macro.
4782 (riscv_global_pointer_value): Use it.
4783 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4784 output section, consider only that section's alignment.
4786 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4788 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4789 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4790 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4791 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4793 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4795 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4796 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4799 2017-02-23 Alan Modra <amodra@gmail.com>
4802 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4804 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4805 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4808 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4811 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4812 processing ahead of the call to `elf_gc_sweep_symbol'.
4814 2017-02-22 Nick Clifton <nickc@redhat.com>
4817 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4818 created section 4-byte alignment.
4820 2017-02-22 Alan Modra <amodra@gmail.com>
4822 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4823 on .got or .plt output section being discarded by script.
4824 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4827 2017-02-21 Alan Modra <amodra@gmail.com>
4829 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4830 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4832 2017-02-20 Alan Modra <amodra@gmail.com>
4835 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4836 if DT_RELSZ/DT_RELASZ is zero.
4838 2017-02-17 Nick Clifton <nickc@redhat.com>
4840 * compress.c (bfd_get_full_section_contents): Remember to reduce
4841 compressed size by the sizeof the compression header when
4842 decompressing the contents.
4844 2017-02-17 Pedro Alves <palves@redhat.com>
4846 * srec.c (Chunk): Rename to ...
4847 (_bfd_srec_len): ... this.
4848 (S3Forced): Rename to ...
4849 (_bfd_srec_forceS3): ... this.
4850 * objcopy.c: Adjust all references.
4852 2017-02-17 Pedro Alves <palves@redhat.com>
4854 * archive.c (bsd_write_armap): Rename to ...
4855 (_bfd_bsd_write_armap): ... this.
4856 (coff_write_armap): Rename to ...
4857 (_bfd_coff_write_armap): ... this.
4858 * libbfd-in.h (bsd_write_armap): Rename to ...
4859 (_bfd_bsd_write_armap): ... this.
4860 (coff_write_armap): Rename to ...
4861 (_bfd_coff_write_armap): ... this.
4862 * aout-target.h, aout-tic30.c: Adjust all users.
4863 * libbfd.h: Regenerate.
4865 2017-02-17 Pedro Alves <palves@redhat.com>
4867 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4868 (warn_deprecated): Rename to ...
4869 (_bfd_warn_deprecated): ... this.
4870 * libbfd.c (warn_deprecated): Rename to ...
4871 (_bfd_warn_deprecated): ... this.
4872 * bfd-in2.h: Regenerate.
4874 2017-02-17 Pedro Alves <palves@redhat.com>
4876 * bfdio.c (real_ftell): Rename to ...
4877 (_bfd_real_ftell): ... this.
4878 (real_fseek): Rename to ...
4879 (_bfd_real_fseek): ... this.
4880 (real_fopen): Rename to ...
4881 (_bfd_real_fopen): ... this.
4882 * libbfd-in.h (real_ftell): Rename to ...
4883 (_bfd_real_ftell): ... this.
4884 (real_fseek): Rename to ...
4885 (_bfd_real_fseek): ... this.
4886 (real_fopen): Rename to ...
4887 (_bfd_real_fopen): ... this.
4888 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4889 * libbfd.h: Regenerate.
4891 2017-02-17 Pedro Alves <palves@redhat.com>
4893 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4894 * libbfd.c (read_unsigned_leb128): Rename to ...
4895 (_bfd_read_unsigned_leb128): ... this.
4896 (read_signed_leb128): Rename to ...
4897 (_bfd_read_signed_leb128): ... this.
4898 (safe_read_leb128): Rename to ...
4899 (_bfd_safe_read_leb128): ... this.
4900 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4901 (_bfd_read_unsigned_leb128): ... this.
4902 (read_signed_leb128): Rename to ...
4903 (_bfd_read_signed_leb128): ... this.
4904 (safe_read_leb128): Rename to ...
4905 (_bfd_safe_read_leb128): ... this.
4906 * libbfd.h: Renegerate.
4908 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4910 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4911 before trying to fine matching file and line information.
4913 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4915 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4916 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4917 not match current bfd, then reload debug information. Record bfd
4918 we're loading debug info for in the stash. If we have debug
4919 informatin in the cache then perform section placement before
4922 2017-02-16 Alan Modra <amodra@gmail.com>
4925 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4926 * elfxx-target.h (elf_backend_no_page_alias): Define.
4927 (elfNN_bed): Init new field.
4928 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4929 ensure PT_LOAD segment starts on a new page.
4930 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4932 2017-02-16 Alan Modra <amodra@gmail.com>
4935 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4938 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4940 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4941 * bfd-in2.h: Regenerated.
4943 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4946 * elf32-i386.c (elf_i386_relocate_section): Allow
4947 "lea foo@GOT, %reg" in PIC.
4949 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4952 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4953 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4954 error against local IFUNC symbol without a base register for
4957 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4959 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4960 `%P: %H:' with `info->callbacks->einfo'.
4961 (ppc_elf_relocate_section): Likewise.
4962 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4963 (ppc64_elf_edit_toc): Likewise.
4964 (ppc64_elf_relocate_section): Likewise.
4966 2017-02-14 Alan Modra <amodra@gmail.com>
4968 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4969 --gc-keep-exported, and test versioned field of sym rather than
4970 looking for @ in name.
4972 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4974 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4977 2017-02-13 Nick Clifton <nickc@redhat.com>
4980 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4983 2017-02-07 Andrew Waterman <andrew@sifive.com>
4985 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4986 entry size if PLT header is written.
4988 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4990 Fix sparc64 dynamic relocation processing to use the dynamic
4992 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4993 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4996 2017-02-03 Nick Clifton <nickc@redhat.com>
4999 * coffcode.h (coff_write_object_contents): Enlarge size of
5000 s_name_buf in order to avoid compile time warning about possible
5002 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
5003 32-bits of insn value before printing into buffer.
5005 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5007 * elfxx-mips.c (mips_elf_hash_sort_data): Add
5008 `max_local_dynindx'.
5009 (mips_elf_sort_hash_table): Handle it.
5010 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
5011 symbols bump up `max_local_dynindx' rather than
5012 `max_non_got_dynindx'.
5014 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5016 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
5017 `min_got_dynindx', `max_unref_got_dynindx' and
5018 `max_non_got_dynindx' members to the `bfd_size_type' data type.
5019 (mips_elf_sort_hash_table): Adjust accordingly.
5021 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5023 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
5024 to access the hash table.
5026 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5028 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
5029 non-NULL `htab' to the beginning.
5031 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
5033 * elflink.c (elf_gc_sweep): Wrap overlong line.
5035 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
5037 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
5038 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
5039 * elfxx-mips.c (mips_elf_link_hash_table): Add
5040 `ignore_branch_isa' member.
5041 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
5042 in branch relocation calculation as an error if
5043 `ignore_branch_isa' has been set.
5044 (_bfd_mips_elf_insn32): Rename to...
5045 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
5046 parameter to `insn32' and add an `ignore_branch_isa' parameter.
5047 Handle the new parameter.
5049 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
5051 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
5052 local variable dynobj.
5055 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
5056 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
5057 executable from read-only sections into sdynrelro.
5058 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
5059 dynamic relocs in sdynrelro.
5060 (elf_backend_want_dynrelro): Define.
5062 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5064 * config.bfd (*-*-rtemsaout*): Mark as removed.
5066 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5068 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
5069 (arm-*-rtems*): Move to (arm*-*-eabi*).
5070 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
5071 (m68-*-rtems*): Move to (m68*-*-elf*).
5073 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
5075 * config.bfd (*-*-rtemscoff*): Mark as removed.
5077 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
5080 * elflink.c (bfd_elf_record_link_assignment): Revert last
5081 change and don't ever clear `forced_local'. Set `mark'
5083 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
5085 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
5086 (bfd_elf_size_dynamic_sections): ... here.
5087 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
5088 and set `mark' instead in `__tls_get_addr_opt' processing.
5089 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
5091 2017-01-24 Alan Modra <amodra@gmail.com>
5093 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
5094 where dynamic relocs are preferable. Allow ifunc too.
5095 (ensure_undefweak_dynamic): New function.
5096 (allocate_dynrelocs): Use it here. Move plt handling last and
5097 don't make symbols dynamic, simplifying loop. Only make undef
5098 weak symbols with GOT entries dynamic. Correct condition
5099 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
5100 comments. Remove goto.
5101 (ppc_elf_relocate_section): Correct test for using dynamic
5102 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5103 to suit. Set up explicit tls_index entries and implicit GOT
5104 tls_index entries resolvable at link time for
5105 __tls_get_addr_opt. Simplify test to clear mem for prelink.
5106 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
5107 (ensure_undefweak_dynamic): New function.
5108 (allocate_dynrelocs): Use it here. Only make undef weak symbols
5109 with GOT entries dynamic. Remove unnecessary test of
5110 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
5111 (ppc64_elf_relocate_section): Correct test for using dynamic
5112 symbol on GOT relocs. Rearrange test for emitting GOT relocs
5113 to suit. Set up explicit tls_index entries and implicit GOT
5114 tls_index entries resolvable at link time for __tls_get_addr_opt.
5115 Simplify expression to clear mem for prelink.
5117 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
5119 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
5121 2017-01-20 Jiong Wang <jiong.wang@arm.com>
5123 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
5124 (elf_backend_hash_symbol): Define.
5126 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
5129 * elflink.c (bfd_elf_record_link_assignment): Clear any
5130 `forced_local' marking for DSO symbols that are not being
5133 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
5135 * elfnn-riscv.c (riscv_elf_object_p): New function.
5137 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
5140 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
5142 (elf_x86_64_check_relocs): Create .eh_frame section for the
5144 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5145 .eh_frame section for the .plt.bnd section.
5146 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5147 for the .plt.bnd section.
5149 2017-01-12 Nick Clifton <nickc@redhat.com>
5152 * opncls.c (find_separate_debug_file): Add include_dirs
5153 parameter. Only include the directory part of the bfd's filename
5154 in search paths if include_dirs is true. Add a couple of extra
5155 locations for looking for debug files.
5156 ( bfd_follow_gnu_debuglink): Update invocation of
5157 find_separate_debug_file.
5158 (bfd_follow_gnu_debugaltlink): Likewise.
5159 (get_build_id): New function: Finds the build-id of the given bfd.
5160 (get_build_id_name): New function: Computes the name of the
5161 separate debug info file for a bfd, based upon its build-id.
5162 (check_build_id_file): New function: Checks to see if a separate
5163 debug info file exists at the given location, and that its
5164 build-id matches that of the original bfd.
5165 (bfd_follow_build_id_debuglink): New function: Finds a separate
5166 debug info file for a given bfd by using the build-id method.
5167 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5168 method of locating a separate debug info file before using the
5170 * bfd-in2.h: Regenerate.
5172 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5175 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5176 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5177 elf_x86_64_eh_frame_plt_got.
5178 (elf_x86_64_size_dynamic_sections): Get unwind info from
5179 elf_x86_64_bnd_arch_bed for the BND PLT.
5181 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5183 * config.bfd: Add entries for i686-redox and x86_64-redox.
5185 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5187 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5189 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5190 .eh_frame section to 4 bytes for x32.
5191 (elf_x86_64_check_relocs): Likewise.
5193 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5196 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5197 (PLT_GOT_FDE_LENGTH): Likewise.
5198 (elf_i386_plt_layout): Add eh_frame_plt_got and
5199 eh_frame_plt_got_size.
5200 (elf_i386_plt): Updated.
5201 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5202 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5203 (elf_i386_size_dynamic_sections): Allocate and initialize
5204 .eh_frame section for .plt.got.
5205 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5207 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5208 eh_frame_plt_got_size.
5209 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5210 (PLT_GOT_FDE_LENGTH): Likewise.
5211 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5212 eh_frame_plt_got_size.
5213 (elf_x86_64_arch_bed): Updated.
5214 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5215 eh_frame_plt_got_size.
5216 (elf_x86_64_nacl_arch_bed): Likewise.
5217 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5218 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5219 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5220 .eh_frame section for .plt.got.
5221 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5224 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5226 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5227 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5229 2017-01-09 Nick Clifton <nickc@redhat.com>
5231 * dwarf2.c (lookup_address_in_function_table): Return early if
5232 there are no functions in the given comp unit, or if the high
5233 address of the last function in the comp unit is less than the
5236 2017-01-09 Nick Clifton <nickc@redhat.com>
5239 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5240 message if there are too many symbols to load.
5242 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5244 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5245 if relocs are cached.
5247 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5250 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5251 for R_MICROBLAZE_GOTOFF_64.
5253 2017-01-03 Nick Clifton <nickc@redhat.com>
5255 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5256 warning about using a possibly uninitialised variable.
5258 2017-01-02 Alan Modra <amodra@gmail.com>
5260 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5261 (allocate_plt_static, allocate_dynrelocs): Use it.
5263 2017-01-02 Alan Modra <amodra@gmail.com>
5265 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5266 .PARISC.unwind section.
5268 2017-01-02 Alan Modra <amodra@gmail.com>
5271 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5272 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5273 indirect to GOT pointer relative code edit.
5275 2017-01-02 Alan Modra <amodra@gmail.com>
5277 Update year range in copyright notice of all files.
5279 For older changes see ChangeLog-2016
5281 Copyright (C) 2017 Free Software Foundation, Inc.
5283 Copying and distribution of this file, with or without modification,
5284 are permitted in any medium without royalty provided the copyright
5285 notice and this notice are preserved.
5291 version-control: never