1 2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
4 * elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
7 2017-11-12 Alan Modra <amodra@gmail.com>
9 * elflink.c (elf_link_add_object_symbols): Ignore anything but
10 defined and defweak symbols when setting up weakdefs.
12 2017-11-12 Alan Modra <amodra@gmail.com>
14 * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref
15 to keep dyn_relocs, clear to discard. Comment.
16 (allocate_dynrelocs): Always clear non_got_ref when clearing
17 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
18 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
19 dyn_relocs on undefined syms to handle for non-pic too.
20 (elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.
21 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref
22 to keep dyn_relocs, clear to discard. Comment.
23 (allocate_dynrelocs): Always clear non_got_ref when clearing
24 dyn_relocs in non-pic case. Invert non_got_ref test. Also test
25 dynamic_adjusted and ELF_COMMON_DEF_P. Move code deleting
26 dyn_relocs on undefined syms to handle for non-pic too.
27 (ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.
28 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard
29 dyn_relocs here. Don't bother setting non_got_ref. Comment.
30 (allocate_dynrelocs): Delete special handling of non-pic ELFv2
31 ifuncs. Move code deleting dyn_relocs on undefined symbols to
32 handle for non-pic too. Don't test non_got_ref. Do test
33 dynamic_adjusted and ELF_COMMON_DEF_P.
35 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
37 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
38 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
39 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
41 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
43 * elf32-mips.c (elf32_mips_write_core_note): New function.
44 (elf_backend_write_core_note): New macro.
45 * elf64-mips.c (elf64_mips_write_core_note): New function.
46 (elf_backend_write_core_note): New macro.
47 * elfn32-mips.c (elf32_mips_write_core_note): New function.
48 (elf_backend_write_core_note): New macro.
50 2017-11-07 Alan Modra <amodra@gmail.com>
52 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
55 2017-11-07 Alan Modra <amodra@gmail.com>
57 * sysdep.h: Formatting, comment fixes.
58 (gettext, ngettext): Redefine when ENABLE_NLS.
59 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
60 (_): Define using gettext.
61 (textdomain, bindtextdomain): Use safer "do nothing".
62 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
63 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
65 2017-11-05 Alan Modra <amodra@gmail.com>
68 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
71 2017-11-05 Alan Modra <amodra@gmail.com>
74 * bfd.c (union _bfd_doprnt_args): New.
75 (PRINT_TYPE): Add FIELD arg. Take value from args.
76 (_bfd_doprnt): Replace ap parameter with args. Adjust all
77 PRINT_TYPE invocations and reading of format args to suit.
78 Move "%%" handling out of switch handling args. Support
79 positional parameters.
80 (_bfd_doprnt_scan): New function.
81 (error_handler_internal): Call _bfd_doprnt_scan and read args.
83 2017-11-04 Alan Modra <amodra@gmail.com>
85 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
86 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
87 (ppc_elf_relocate_section): Don't output a dynamic relocation
88 for IE GOT entries in an executable.
89 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
90 (ppc64_elf_size_dynamic_sections): Likewise.
91 (ppc64_elf_relocate_section): Likewise.
93 2017-11-04 Alan Modra <amodra@gmail.com>
95 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
96 callers. Don't bother with SEC_ALLOC test. Return section pointer.
98 (maybe_set_textrel): ..here.
99 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
100 (maybe_set_textrel): Call minfo to print textrel warning to map file.
102 2017-11-04 Alan Modra <amodra@gmail.com>
104 * elf32-hppa.c (enum _tls_type): Move.
105 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
106 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
107 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
108 (got_entries_needed, got_relocs_needed): New functions.
109 (allocate_dynrelocs): Use them.
110 (elf32_hppa_size_dynamic_sections): Likewise.
111 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
112 Correct code emitting relocs on GD/IE got entries. Report an
113 error when a symbol has both normal and TLS GOT relocs.
115 2017-11-04 Alan Modra <amodra@gmail.com>
118 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
119 for plabels when non-pic.
120 (maybe_set_textrel): New function.
121 (readonly_dynrelocs): Move and rewrite.
122 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
123 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
124 for functions. Expand non_got_ref comments.
125 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
127 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
129 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
130 Don't use func_pointer_refcount. Don't set plt.refcount nor
131 non_got_ref for function pointer reference.
132 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
133 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
134 func_pointer_refcount.
135 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
136 func_pointer_refcount.
137 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
138 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
139 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
141 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
142 Nick Clifton <nickc@redhat.com>
145 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
146 overlarge raw syment count.
147 (coff_get_normalized_symtab): Likewise.
149 2017-11-01 James Bowman <james.bowman@ftdichip.com>
151 * archures.c: Add bfd_mach_ft32b.
152 * cpu-ft32.c: Add arch_info_struct.
153 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
155 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
157 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
158 (elf32_ft32_adjust_diff_reloc_value)
159 (elf32_ft32_adjust_reloc_if_spans_insn)
160 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
161 (ft32_elf_relax_section): New function.
162 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
163 * bfd-in2.h: Regenerate.
164 * libbfd.h: Regenerate.
166 2017-11-01 Nick Clifton <nickc@redhat.com>
169 * coffcode.h (coff_slurp_line_table): Check for an excessively
170 large line number count.
172 2017-11-01 Nick Clifton <nickc@redhat.com>
175 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
176 and offset in light of further possible bogus values.
178 2017-11-01 Alan Modra <amodra@gmail.com>
181 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
182 entry when just a dynamic reloc can serve. Ensure no dynamic
183 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
184 Expand and move the non_got_ref comment.
185 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
187 2017-11-01 Nick Clifton <nickc@redhat.com>
190 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
192 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
193 members of an archive.
195 2017-10-31 Nick Clifton <nickc@redhat.com>
198 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
201 2017-10-30 Alan Modra <amodra@gmail.com>
203 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
206 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
208 (bfd_elf_gc_sections): Likewise.
210 2017-10-30 Alan Modra <amodra@gmail.com>
213 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
214 ensure non_got_ref is not set due to debug references.
215 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
216 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
217 need for a plt entry.
218 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
219 dynamic relocs when pic. Remove bogus code attempting to handle
221 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
223 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
224 and SYMBOL_REFERENCES_LOCAL in GOT handling.
226 2017-10-28 Alan Modra <amodra@gmail.com>
229 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
230 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
231 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
232 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
234 2017-10-25 Alan Modra <amodra@gmail.com>
236 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
237 optionally prefixed with "_".
238 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
240 2017-10-24 Andrew Waterman <andrew@sifive.com>
242 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
245 2017-10-24 Renlin Li <renlin.li@arm.com>
248 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
250 2017-10-23 Nick Clifton <nickc@redhat.com>
253 * elflink.c (elf_link_output_extsym): Keep global undefined
254 symbols if they have been marked as needed.
256 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
258 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
260 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
261 `_bfd_mips_elf_mkobject'.
263 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
266 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
268 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
270 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
271 (riscv_pcgp_lo_reloc): Likewise.
272 (riscv_pcgp_relocs): Likewise.
273 (riscv_init_pcgp_relocs): New function.
274 (riscv_free_pcgp_relocs): Likewise.
275 (riscv_record_pcgp_hi_reloc): Likewise.
276 (riscv_record_pcgp_lo_reloc): Likewise.
277 (riscv_delete_pcgp_hi_reloc): Likewise.
278 (riscv_use_pcgp_hi_reloc): Likewise.
279 (riscv_record_pcgp_lo_reloc): Likewise.
280 (riscv_find_pcgp_lo_reloc): Likewise.
281 (riscv_delete_pcgp_lo_reloc): Likewise.
282 (_bfd_riscv_relax_pc): Likewise.
283 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
284 via the new functions above.
286 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
288 * elfnn-riscv.c (R_RISCV_DELETE): New define.
289 (_bfd_riscv_relax_delete): New function.
290 (perform_relocation): Handle R_RISCV_DELETE.
291 (_bfd_riscv_relax_section): Likewise.
293 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
296 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
297 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
298 bfd_link_executable for TLS check.
299 (tilegx_elf_check_relocs): Likewise.
300 (allocate_dynrelocs): Likewise.
301 (tilegx_elf_relocate_section): Likewise.
303 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
306 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
307 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
308 bfd_link_executable for TLS check.
309 (tilepro_elf_check_relocs): Likewise.
310 (allocate_dynrelocs): Likewise.
311 (tilepro_elf_relocate_section): Likewise.
313 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
316 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
317 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
318 bfd_link_executable for TLS check.
319 (_bfd_sparc_elf_check_relocs): Likewise.
320 (allocate_dynrelocs): Likewise.
321 (_bfd_sparc_elf_relocate_section): Likewise.
323 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
325 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
326 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
327 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
329 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
331 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
332 indirect and warning symbols.
334 2017-10-17 Alan Modra <amodra@gmail.com>
337 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
338 against size left rather than comparing pointers. Reorganise loop.
340 2017-10-17 Alan Modra <amodra@gmail.com>
343 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
344 and error for any other size that doesn't cover the header word.
346 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
348 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
349 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
350 (elf_backend_gc_sweep_hook): Likewise.
351 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
352 (bfinfdpic_gc_sweep_hook): Likewise.
353 (elf_backend_gc_sweep_hook): Likewise.
354 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
355 (elf_backend_gc_sweep_hook): Likewise.
356 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
357 (elf_backend_gc_sweep_hook): Likewise.
358 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
359 (elf_backend_gc_sweep_hook): Likewise.
360 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
361 (elf_backend_gc_sweep_hook): Likewise.
362 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
363 (elf_backend_gc_sweep_hook): Likewise.
364 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
366 (elf_m68k_remove_got_entry_type): Removed.
367 (elf_m68k_find_got_entry_ptr): Likewise.
368 (elf_m68k_remove_got_entry): Likewise.
369 (elf_m68k_gc_sweep_hook): Likewise.
370 (elf_backend_gc_sweep_hook): Likewise.
371 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
372 (elf_backend_gc_sweep_hook): Likewise.
373 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
374 (elf_backend_gc_sweep_hook): Likewise.
375 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
376 (elf_backend_gc_sweep_hook): Likewise.
377 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
378 (elf_backend_gc_sweep_hook): Likewise.
379 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
380 (elf_backend_gc_sweep_hook): Likewise.
381 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
382 (elf_backend_gc_sweep_hook): Likewise.
383 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
384 (elf_backend_gc_sweep_hook): Likewise.
385 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
386 (elf_backend_gc_sweep_hook): Likewise.
387 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
388 (elf_backend_gc_sweep_hook): Likewise.
389 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
390 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
391 (elf_backend_gc_sweep_hook): Likewise.
392 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
393 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
394 (elf_backend_gc_sweep_hook): Likewise.
395 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
396 (elf_backend_gc_sweep_hook): Likewise.
397 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
398 (elf_backend_gc_sweep_hook): Likewise.
399 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
400 (elf_backend_gc_sweep_hook): Likewise.
401 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
402 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
403 (elf_backend_gc_sweep_hook): Likewise.
404 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
405 (ppc64_elf_gc_sweep_hook): Likewise.
406 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
407 (elf_backend_gc_sweep_hook): Likewise.
408 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
409 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
410 * elflink.c (elf_link_add_object_symbols): Don't call
411 _bfd_elf_link_check_relocs here.
412 (gc_sweep_hook_fn): Removed.
413 (elf_gc_sweep): Remove gc_sweep_hook.
414 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
415 (elf_backend_gc_sweep_hook): Likewise.
416 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
417 (elf_backend_gc_sweep_hook): Likewise.
418 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
419 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
420 (elf_backend_gc_sweep_hook): Likewise.
421 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
422 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
423 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
424 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
425 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
426 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
428 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
430 * elf32-i386.c (elf_i386_backend_data): Removed.
431 (get_elf_i386_backend_data): Likewise.
432 (elf_i386_arch_bed): Replace elf_i386_backend_data with
433 elf_x86_backend_data.
434 (elf_i386_get_synthetic_symtab): Likewise.
435 (elf_i386_nacl_arch_bed): Likewise.
436 (elf_i386_vxworks_arch_bed): Likewise.
437 (elf_i386_relocate_section): Check target_os instead of
439 (elf_i386_finish_dynamic_symbol): Likewise.
440 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
441 Check target_os instead of is_vxworks.
442 (elf_i386_link_setup_gnu_properties): Remove normal_target and
443 is_vxworks. Initialize plt0_pad_byte.
444 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
445 (get_elf_x86_64_arch_data): Likewise.
446 (get_elf_x86_64_backend_data): Likewise.
447 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
448 elf_x86_backend_data.
449 (elf_x86_64_get_synthetic_symtab): Likewise.
450 (elf_x86_64_nacl_arch_bed): Likewise.
451 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
452 normal_target. Initialize plt0_pad_byte.
453 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
454 instead of is_vxworks.
455 (_bfd_x86_elf_size_dynamic_sections): Likewise.
456 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
457 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
458 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
459 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
460 Update normal_target. Set up plt0_pad_byte. Check target_os
461 instead of is_vxworks.
462 * elfxx-x86.h (elf_x86_target_os): New.
463 (elf_x86_backend_data): Likewise.
464 (get_elf_x86_backend_data): Likewise.
465 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
467 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
470 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
472 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
473 _bfd_x86_elf_finish_dynamic_sections.
474 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
475 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
477 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
480 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
483 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
484 hide symbol which was forced to be dynamic.
486 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
489 * elf32-cris.c (cris_elf_relocate_section): Don't generate
490 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
491 (cris_elf_check_relocs): Don't allocate dynamic relocation
492 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
494 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
497 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
498 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
499 (sh_elf_relocate_section): Don't generate dynamic relocation if
500 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
502 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
505 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
506 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
507 (elf_s390_relocate_section): Don't generate dynamic relocation
508 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
509 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
510 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
511 (elf_s390_relocate_section): Don't generate dynamic relocation
512 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
514 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
517 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
518 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
519 (allocate_dynrelocs): Discard dynamic relocations if
520 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
522 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
525 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
526 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
528 (allocate_dynrelocs): Discard dynamic relocations if
529 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
531 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
534 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
535 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
536 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
537 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
538 (elf_m68k_relocate_section): Don't generate dynamic relocation
539 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
541 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
544 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
545 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
546 (allocate_dynrelocs): Discard dynamic relocations if
547 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
548 (elf32_hppa_relocate_section): Don't generate dynamic
549 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
551 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
554 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
555 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
556 (allocate_fptr): Don't allocate function pointer if
557 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
558 (allocate_dynrel_entries): Don't allocate dynamic relocation
559 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
560 (set_got_entry): Don't set GOT entry if
561 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
562 (set_pltoff_entry): Don't set PLTOFF entry if
563 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
564 (elfNN_ia64_relocate_section): Don't install dynamic relocation
565 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
567 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
570 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
571 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
572 (allocate_dynrelocs): Don't allocate dynamic relocations if
573 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
575 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
578 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
579 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
580 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
581 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
583 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
586 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
587 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
588 (tilepro_elf_relocate_section): Don't generate dynamic
589 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
590 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
591 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
592 (tilegx_elf_relocate_section): Don't generate dynamic
593 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
595 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
598 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
599 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
601 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
602 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
604 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
606 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
607 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
608 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
610 2017-10-12 James Bowman <james.bowman@ftdichip.com>
612 * bfd-in2.h: Regenerate.
613 * libbfd.h: Regenerate.
614 * elf32-ft32.c: Add HOWTO R_FT32_15.
615 * reloc.c: Add BFD_RELOC_FT32_15.
617 2017-10-12 Nick Clifton <nickc@redhat.com>
619 * reloc.c (enum bfd_reloc_status): Start values at 2.
620 * bfd-in2.h: Regenerate.
621 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
622 that a TRUE return indicates success. Compare the result of
623 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
624 (build_one_stub): Change sense of tests against aarch64_relocate
626 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
627 than FALSE, when an error is detected.
628 (elfNN_aarch64_final_link_relocate): Likewise.
630 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
632 * elf32-i386.c (elf_backend_hide_symbol): New.
633 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
634 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
635 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
637 2017-10-12 Alan Modra <amodra@gmail.com>
639 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
640 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
641 (bfd_elf_define_start_stop): Likewise.
643 2017-10-12 Alan Modra <amodra@gmail.com>
645 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
646 when executable rather than non-PIC.
647 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
648 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
650 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
652 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
654 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
655 (elf_external_linux_prpsinfo64_ugid32): ... this.
656 (swap_linux_prpsinfo32_out): Rename to...
657 (swap_linux_prpsinfo32_ugid32_out): ... this.
658 (elf_external_linux_prpsinfo64_ugid16): New structure.
659 (swap_linux_prpsinfo64_ugid16_out): New function.
660 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
661 (elf_backend_linux_prpsinfo64_ugid16): Define.
662 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
663 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
664 of the 64-bit Linux core PRPSINFO note.
665 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
667 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
669 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
671 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
672 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
673 (elf_external_ppc_linux_prpsinfo32)
674 (swap_ppc_linux_prpsinfo32_out): Move to...
675 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
676 (swap_linux_prpsinfo32_ugid32_out): ... these.
677 (elf_external_linux_prpsinfo32): Rename to...
678 (elf_external_linux_prpsinfo32_ugid16): ... this.
679 (swap_linux_prpsinfo32_out): Rename to...
680 (swap_linux_prpsinfo32_ugid16_out): ... this.
681 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
682 (elf_backend_linux_prpsinfo32_ugid16): Define.
683 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
684 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
685 of the 32-bit Linux core PRPSINFO note.
686 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
687 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
688 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
689 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
690 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
691 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
692 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
693 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
694 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
695 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
697 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
699 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
700 `gap' member ahead of `pr_flag'.
702 2017-10-11 Pedro Alves <palves@redhat.com>
704 * bfd.c (_doprnt): Rename to ...
705 (_bfd_doprnt): ... this.
706 (error_handler_internal): Adjust.
708 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
710 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
711 instead of incrementing it.
712 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
714 2017-10-10 Renlin Li <renlin.li@arm.com>
717 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
718 symbols into dynamic.
720 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
723 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
724 (riscv_elf_link_hash_table_create): Initialize max_alignment to
726 (_bfd_riscv_relax_section): Cache the max alignment of output
727 sections if possible.
729 2017-10-10 Alan Modra <amodra@gmail.com>
731 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
732 .opd whenever .opd is present and non-zero size. Move code
733 setting abiversion to/from output file earlier. Only set
734 u.opd.func_sec when --gc-sections. Read relocs and set up
735 u.opd.func_sec values here..
736 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
738 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
740 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
742 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
745 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
747 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
748 .interp section with "ld --no-dynamic-linker".
750 2017-10-09 Alan Modra <amodra@gmail.com>
753 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
754 funcinfo_hash_table and varinfo_hash_table.
756 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
758 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
759 in read-only section with minfo.
760 (sh_elf_size_dynamic_sections): Likewise.
762 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
764 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
767 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
769 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
770 this_hdr.sh_entsize only if section size > 0.
772 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
774 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
776 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
778 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
779 in read-only section with minfo.
780 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
782 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
784 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
787 2017-10-06 John Baldwin <jhb@FreeBSD.org>
789 * elf-bfd.h (struct elf_backend_data): Add
790 `elf_backend_grok_freebsd_prstatus'.
791 * elf.c (elfcore_grok_freebsd_note): Call
792 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
794 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
796 (elf_backend_grok_freebsd_prstatus): Define.
797 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
798 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
800 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
802 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
803 and has_non_got_reloc with zero_undefweak.
804 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
805 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
807 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
808 has_non_got_reloc with zero_undefweak.
809 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
810 has_got_reloc and has_non_got_reloc with zero_undefweak.
811 (elf_x86_link_hash_entry): Likewise.
813 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
815 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
816 (VERIFY_COPY_RELOC): Likewise.
818 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
820 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
821 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
822 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
824 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
826 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
827 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
828 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
830 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
832 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
833 * elf32-i386.c (elf_i386_relocate_section): Use it.
834 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
836 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
838 * elf32-i386.c (X86_SIZE_TYPE_P): New.
839 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
840 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
841 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
842 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
844 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
846 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
847 (PLT_LOCAL_IFUNC_P): Likewise.
848 * elf32-i386.c (elf_i386_relocate_section): Use them.
849 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
851 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
853 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
854 * elf32-i386.c (elf_i386_relocate_section): Use it.
855 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
857 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
859 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
860 * elf32-i386.c (elf_i386_relocate_section): Use it.
861 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
863 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
865 * elf32-i386.c (X86_PCREL_TYPE_P): New.
866 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
867 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
868 (X86_PCREL_TYPE_P): This.
869 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
870 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
871 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
873 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
875 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
877 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
878 * elf32-i386.c (elf_i386_tls_transition): Use it.
879 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
881 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
883 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
884 Dump dynamic relocation in read-only section with minfo if
886 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
887 (maybe_set_textrel): Likewise.
888 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
889 read-only section with minfo.
891 2017-10-05 John Baldwin <jhb@FreeBSD.org>
893 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
895 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
897 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
898 in read-only section with minfo.
899 (tilepro_elf_size_dynamic_sections): Likewise.
900 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
901 (tilegx_elf_size_dynamic_sections): Likewise.
903 2017-10-05 Pedro Alves <palves@redhat.com>
906 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
907 ellipsis parameter. Split out bfd_error_on_input code to..
908 (bfd_set_input_error): .. New function.
909 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
910 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
911 * bfd-in2.h: Regenerate.
913 2017-10-05 Alan Modra <amodra@gmail.com>
915 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
916 fini_array error value.
918 2017-10-05 Alan Modra <amodra@gmail.com>
921 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
923 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
925 (elf_fake_sections): Adjust calls. Exit immediately on failure.
926 (bfd_elf_set_group_contents): Add associated reloc section indices
929 2017-10-04 Alan Modra <amodra@gmail.com>
931 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
932 classify symbols for ELFv2.
934 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
937 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
938 undergoes default promotion.
939 * bfd-in2.h: Regenerate.
941 2017-10-02 Alan Modra <amodra@gmail.com>
943 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
944 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
946 2017-10-01 Alan Modra <amodra@gmail.com>
949 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
950 (add_line_info): Always put end_sequence last.
952 2017-10-01 Alan Modra <amodra@gmail.com>
955 * dwarf2.c (read_section): Allocate buffer with extra byte for
956 bfd_simple_get_relocated_section_contents rather than copying
959 2017-09-29 Alan Modra <amodra@gmail.com>
961 * merge.c (merge_strings): Return FALSE on malloc failure.
962 (_bfd_merge_sections): Return failures from record_section and
965 2017-09-28 Alan Modra <amodra@gmail.com>
968 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
969 a case where plugin_notice isn't called.
971 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
973 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
976 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
979 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
980 output_bfd to info->callbacks->minfo.
982 2017-09-26 Nick Clifton <nickc@redhat.com>
985 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
986 assertion failure if elf_x86_64_rtype_to_howto has already issued
989 2017-09-26 Alan Modra <amodra@gmail.com>
992 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
995 2017-09-26 Nick Clifton <nickc@redhat.com>
998 * dwarf2.c (read_formatted_entries): Fail early if we know that
999 the loop parsing data entries will overflow the end of the
1002 2017-09-26 Alan Modra <amodra@gmail.com>
1005 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
1006 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
1007 to stash->info_ptr_memory, and check die_ref is within that memory.
1008 Set info_ptr_end correctly when another CU is refd. Check die_ref
1009 for DW_FORM_ref4 etc. is within CU.
1011 2017-09-26 Alan Modra <amodra@gmail.com>
1014 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
1015 (read_formatted_entries): Init "fe".
1016 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
1018 2017-09-26 Alan Modra <amodra@gmail.com>
1021 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
1022 bounds in inner loop.
1024 2017-09-25 Alan Modra <amodra@gmail.com>
1027 * dwarf1.c (parse_die): Sanity check pointer against section limit
1028 before dereferencing.
1029 (parse_line_table): Likewise.
1031 2017-09-25 Alan Modra <amodra@gmail.com>
1034 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1036 (parse_comp_unit): Likewise.
1038 2017-09-25 Alan Modra <amodra@gmail.com>
1041 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1043 2017-09-24 Alan Modra <amodra@gmail.com>
1046 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1047 within section bounds.
1049 2017-09-24 Alan Modra <amodra@gmail.com>
1052 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1054 2017-09-24 Alan Modra <amodra@gmail.com>
1057 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1058 pname param. Return status. Make name const. Don't abort,
1059 return an error. Formatting. Exit if current info_ptr matches
1060 orig_info_ptr. Update callers.
1061 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1062 nested_funcs an array of structs for extensibility. Formatting.
1064 2017-09-24 Alan Modra <amodra@gmail.com>
1067 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1068 rather than dividing by zero.
1070 2017-09-24 Alan Modra <amodra@gmail.com>
1073 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1075 2017-09-24 Alan Modra <amodra@gmail.com>
1078 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1080 2017-09-24 Alan Modra <amodra@gmail.com>
1083 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1084 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1087 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1090 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1093 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1096 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1097 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1099 2017-09-22 Pedro Alves <palves@redhat.com>
1100 Alan Modra <amodra@gmail.com>
1102 * version.h: Add comment.
1104 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1106 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1107 NT_S390_GS_BC, correct the previously swapped invocations of
1108 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1110 2017-09-19 Alan Modra <amodra@gmail.com>
1113 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1116 2017-09-19 Alan Modra <amodra@gmail.com>
1119 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1120 symbols before calculating verrefs. Don't renumber dynsyms
1121 after gc. Exclude .gnu.version when zero or one dynsym.
1122 Localize some vars and reindent.
1124 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1127 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1128 return from bfd_canonicalize_dynamic_reloc.
1130 2017-09-15 Alan Modra <amodra@gmail.com>
1133 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1134 overflows bfd_size_type.
1136 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1139 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1140 to indicate if conversion is performed.
1141 (elf_i386_check_relocs): Cache section contents and relocations
1142 if conversion is performed.
1143 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1144 contents and relocations if conversion is performed.
1146 2017-09-14 Nick Clifton <nickc@redhat.com>
1149 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1152 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1154 * elfxx-x86.h: Fix a typo in comments.
1156 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1158 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1160 2017-09-09 Alan Modra <amodra@gmail.com>
1162 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1165 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1167 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1168 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1169 (elf_i386_finish_dynamic_symbol): Likewise.
1170 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1171 (elf_x86_64_finish_dynamic_symbol): Likewise.
1172 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1173 (_bfd_x86_elf_fixup_symbol): Likewise.
1175 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1177 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1178 check has_non_got_reloc.
1180 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1183 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1184 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1185 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1186 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1187 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1188 and linker_def on __ehdr_start if it is referenced and not
1190 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1191 and return TRUE when building executable, if a symbol has
1192 non-GOT/non-PLT relocations in text section or there is no
1194 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1196 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1198 * elfxx-x86.h: Update comments.
1200 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1202 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1203 elf_x86_plt_layout_table with elf_x86_init_table.
1204 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1206 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1208 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1209 (elf_x86_init_table): This.
1210 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1211 elf_x86_plt_layout_table with elf_x86_init_table.
1213 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1215 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1216 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1217 * configure: Regenerated.
1218 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1219 and r_sym fields of plt_layout.
1220 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1222 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1223 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1224 r_info nor r_sym fields.
1225 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1227 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1229 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1231 * (_bfd_riscv_relax_align): Call bfd_set_error and
1232 print an error message when unable to relax a .align directive.
1234 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1236 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1237 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1238 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1239 R_RISCV_PCREL_HI20 relocs, and pass the result to
1240 riscv_record_pcrel_hi_reloc.
1242 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1244 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1245 r_type_p. Remove the converted argument. Replace
1246 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1247 the new relocation type via r_type_p.
1248 (elf_i386_relocate_section): Likewise.
1249 (elf_i386_finish_dynamic_symbol): Likewise.
1250 (need_convert_load): Removed.
1251 (check_relocs_failed): Updated.
1252 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1253 instead of setting need_convert_load.
1254 (_bfd_i386_elf_convert_load): Removed.
1255 * elf64-x86-64.c (need_convert_load): Removed.
1256 (check_relocs_failed): Updated.
1257 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1258 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1259 Return the new relocation type via r_type_p.
1260 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1261 instead of setting need_convert_load.
1262 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1264 (_bfd_x86_64_elf_convert_load): Removed.
1265 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1266 with SYMBOL_REFERENCES_LOCAL_P.
1267 (elf_x86_64_finish_dynamic_symbol): Likewise.
1268 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1270 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1271 (_bfd_x86_elf_link_symbol_references_local): New function.
1272 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1273 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1274 SYMBOL_REFERENCES_LOCAL_P.
1275 (elf_x86_link_hash_entry): Add local_ref.
1276 (elf_x86_link_hash_table): Remove convert_load.
1277 (_bfd_i386_elf_convert_load): Removed.
1278 (_bfd_x86_64_elf_convert_load): Likewise.
1279 (_bfd_x86_elf_link_symbol_references_local): New.
1281 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1283 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1284 (elf_x86_64_info_to_howto): Get the real relocation type by
1285 masking out R_X86_64_converted_reloc_bit.
1286 (elf_x86_64_check_tls_transition): Get the real relocation type
1287 by masking out R_X86_64_converted_reloc_bit.
1288 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1289 instead of setting converted_reloc.
1290 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1291 instead of converted_reloc. Get the real relocation type by
1292 masking out R_X86_64_converted_reloc_bit.
1293 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1294 R_X86_64_converted_reloc_bit is valid.
1295 * elfxx-x86.h (converted_reloc): Removed.
1297 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1299 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1300 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1301 to get the relocation type again.
1302 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1303 r_type when calling elf_x86_64_tls_transition. Don't use
1304 ELF32_R_TYPE to get the relocation type again.
1306 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1308 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1311 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1313 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1314 argument. Don't check relocation overflow. Avoid relocation
1315 overflow if --no-relax is used. Set converted_reloc on symbol
1316 if a GOTPCREL relocation is converted.
1317 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1318 --no-relax if GOTPCREL relocation conversion leads to relocation
1320 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1322 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1323 Edmar Wienskoski <edmar.wienskoski@nxp.com
1325 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1326 (ppc_elf_check_relocs): Handle it.
1327 (ppc_elf_vle_split20): New function.
1328 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1330 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1333 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1334 for x86-64 if GOT_TLS_GDESC_P is true.
1336 2017-09-03 Alan Modra <amodra@gmail.com>
1339 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1341 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1343 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1344 tls_get_addr for x86-64 in one place.
1346 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1348 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1349 with elfxx-x86.lo for 64-bit BFD.
1350 * configure: Regenerated.
1352 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1354 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1355 (_bfd_i386_elf_convert_load): This. Remove static.
1356 (elf_i386_size_dynamic_sections): Removed.
1357 (elf_backend_size_dynamic_sections): Likewise.
1358 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1359 (_bfd_x86_64_elf_convert_load): This. Remove static.
1360 (elf_x86_64_size_dynamic_sections): Removed.
1361 (elf_backend_size_dynamic_sections): Likewise.
1362 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1363 (elf_x86_allocate_dynrelocs): This. Make it static.
1364 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1365 (elf_x86_allocate_local_dynreloc): This. Make it static.
1366 (elf_i386_is_reloc_section): New function.
1367 (elf_x86_64_is_reloc_section): Likewise.
1368 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1369 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1370 Rearrange got_entry_size initialization.
1371 (_bfd_x86_elf_size_dynamic_sections): New function.
1372 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1373 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1374 (_bfd_i386_elf_convert_load): New.
1375 (_bfd_x86_64_elf_convert_load): Likewise.
1376 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1377 (elf_backend_size_dynamic_sections): Likewise.
1378 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1379 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1381 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1383 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1386 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1388 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1389 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1391 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1393 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1394 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1395 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1396 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1397 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1398 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1400 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1402 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1403 (elf_i386_allocate_local_dynrelocs): Likewise.
1404 (elf_i386_size_dynamic_sections): Replace
1405 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1406 with _bfd_x86_elf_allocate_dynrelocs and
1407 _bfd_x86_elf_allocate_local_dynrelocs.
1408 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1409 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1410 (elf_x86_64_size_dynamic_sections): Replace
1411 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1412 with _bfd_x86_elf_allocate_dynrelocs and
1413 _bfd_x86_elf_allocate_local_dynrelocs.
1414 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1415 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1416 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1417 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1419 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1421 * elf32-i386.c (is_i386_elf): Removed.
1422 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1423 (elf_i386_size_dynamic_sections): Likewise.
1424 (elf_i386_relocate_section): Likewise.
1425 * elf64-x86-64.c (is_x86_64_elf): Removed.
1426 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1428 (elf_x86_64_size_dynamic_sections): Likewise.
1429 (elf_x86_64_relocate_section): Likewise.
1430 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1432 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1435 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1437 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1438 (elf_i386_allocate_dynrelocs): Replace
1439 elf_i386_compute_jump_table_size with
1440 elf_x86_compute_jump_table_size.
1441 (elf_i386_size_dynamic_sections): Likewise.
1442 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1443 (elf_x86_64_allocate_dynrelocs): Replace
1444 elf_x86_64_compute_jump_table_size with
1445 elf_x86_compute_jump_table_size.
1446 (elf_x86_64_size_dynamic_sections): Likewise.
1447 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1449 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1450 (elf_x86_compute_jump_table_size): New.
1452 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1454 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1456 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1457 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1459 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1461 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1462 with htab->is_vxworks.
1463 (elf_i386_size_dynamic_sections): Likewise.
1464 (elf_i386_relocate_section): Likewise.
1465 (elf_i386_finish_dynamic_symbol): Likewise.
1466 (elf_i386_finish_dynamic_sections): Likewise.
1468 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1470 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1471 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1472 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1473 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1474 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1475 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1476 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1477 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1479 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1482 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1483 ELF_COMMON_DEF_P for common symbols.
1485 2017-09-02 Alan Modra <amodra@gmail.com>
1487 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1488 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1489 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1491 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1493 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1494 (elf_backend_gc_mark_hook): Likewise.
1495 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1496 (elf_backend_gc_mark_hook): Likewise.
1497 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1498 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1499 (elf_backend_gc_mark_hook): Likewise.
1501 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1503 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1504 (elf_backend_adjust_dynamic_symbol): Likewise.
1505 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1506 (elf_backend_adjust_dynamic_symbol): Likewise.
1507 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1508 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1509 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1510 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1511 (elf_backend_adjust_dynamic_symbol): Likewise.
1513 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1515 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1518 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1520 * elf32-i386.c (elf_i386_mkobject): Removed.
1521 (bfd_elf32_mkobject): Likewise.
1522 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1523 (bfd_elf64_mkobject): Likewise.
1524 (bfd_elf32_mkobject): Likewise.
1525 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1526 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1527 (bfd_elf64_mkobject): Likewise.
1528 (bfd_elf32_mkobject): Likewise.
1530 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1532 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1533 Call _bfd_x86_elf_link_setup_gnu_properties.
1534 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1535 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1537 (elf_x86_64_non_lazy_plt): Likewise.
1538 (elf_x86_64_lazy_bnd_plt): Likewise.
1539 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1540 (elf_x86_64_lazy_ibt_plt): Likewise.
1541 (elf_x32_lazy_ibt_plt): Likewise.
1542 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1543 (elf_x32_non_lazy_ibt_plt): Likewise.
1544 (elf_x86_64_nacl_plt): Likewise.
1545 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1546 _bfd_x86_elf_link_setup_gnu_properties.
1547 * elfxx-x86.c: Include elf-vxworks.h".
1548 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1549 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1550 comments for pic_plt0_entry and pic_plt_entry.
1551 (elf_x86_non_lazy_plt_layout): Likewise.
1552 (elf_x86_plt_layout_table): New.
1553 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1555 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1558 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1559 .eh_frame section for the second PLT.
1560 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1561 alignment of .eh_frame section for the second PLT.
1563 2017-09-01 Nick Clifton <nickc@redhat.com>
1566 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1569 2017-09-01 Nick Clifton <nickc@redhat.com>
1572 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1573 attribute buffer is NUL terminated.
1575 2017-08-31 Nick Clifton <nickc@redhat.com>
1578 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1579 to dwarf string sections.
1581 2017-08-31 Alan Modra <amodra@gmail.com>
1583 * po/SRC-POTFILES.in: Regenerate.
1585 2017-08-31 Alan Modra <amodra@gmail.com>
1587 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1588 for a section containing just a terminator. Allow multiple
1589 terminators at end of section.
1590 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1591 sections when not adding alignment. Assert on terminator in
1594 2017-08-31 Alan Modra <amodra@gmail.com>
1598 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1601 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1603 * configure.ac (bfd_backends): Add elf64.lo together with
1604 elfxx-x86.lo for 64-bit BFD.
1605 * configure: Regenerated.
1607 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1609 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1612 2017-08-31 Alan Modra <amodra@gmail.com>
1615 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1616 before _close_and_cleanup. Call iovec->bclose after.
1617 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1619 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1621 * elf32-i386.c (elf_i386_plt_type): Removed.
1622 (elf_i386_plt): Likewise.
1623 (elf_i386_get_synthetic_symtab): Updated. Call
1624 _bfd_x86_elf_get_synthetic_symtab.
1625 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1626 (elf_x86_64_plt): Likewise.
1627 (elf_x86_64_get_synthetic_symtab): Updated. Call
1628 _bfd_x86_elf_get_synthetic_symtab.
1629 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1630 (elf_x86_64_get_plt_got_vma): Likewise.
1631 (elf_i386_valid_plt_reloc_p): Likewise.
1632 (elf_x86_64_valid_plt_reloc_p): Likewise.
1633 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1634 * elfxx-x86.h (elf_x86_plt_type): New.
1635 (elf_x86_plt): Likewise.
1636 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1638 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1640 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1641 target_id instead of elf_machine_code.
1643 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1645 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1646 (elf_i386_lazy_plt_layout): Likewise.
1647 (elf_i386_non_lazy_plt_layout): Likewise.
1648 (elf_i386_plt_layout): Likewise.
1649 (elf_i386_link_hash_table): Likewise.
1650 (elf_i386_next_tls_desc_index): Likewise.
1651 (elf_i386_srelplt2): Likewise.
1652 (elf_i386_plt): Likewise.
1653 (elf_i386_lazy_plt): Likewise.
1654 (elf_i386_non_lazy_plt): Likewise.
1655 (elf_i386_link_hash_table_create): Likewise.
1656 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1657 (elf_i386_lazy_plt): Updated.
1658 (elf_i386_non_lazy_plt): Likewise.
1659 (elf_i386_lazy_ibt_plt): Likewise.
1660 (elf_i386_non_lazy_ibt_plt): Likewise.
1661 (elf_i386_allocate_dynrelocs): Likewise.
1662 (elf_i386_size_dynamic_sections): Likewise.
1663 (elf_i386_relocate_section): Likewise.
1664 (elf_i386_finish_dynamic_symbol): Likewise.
1665 (elf_i386_finish_dynamic_sections): Likewise.
1666 (elf_i386_get_synthetic_symtab): Likewise.
1667 (elf_i386_link_setup_gnu_properties): Likewise.
1668 (elf_i386_nacl_plt): Likewise.
1669 * elf64-x86-64.c (ABI_64_P): Removed.
1670 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1671 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1672 (elf_x86_64_lazy_plt_layout): Likewise.
1673 (elf_x86_64_non_lazy_plt_layout): Likewise.
1674 (elf_x86_64_plt_layout): Likewise.
1675 (elf_x86_64_link_hash_table): Likewise.
1676 (elf_x86_64_plt): Likewise.
1677 (elf_x86_64_lazy_plt): Likewise.
1678 (elf_x86_64_non_lazy_plt): Likewise.
1679 (elf_x86_64_link_hash_table_create): Likewise.
1680 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1681 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1682 (elf_x86_64_lazy_plt): Updated.
1683 (elf_x86_64_non_lazy_plt): Likewise.
1684 (elf_x86_64_lazy_bnd_plt): Likewise.
1685 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1686 (elf_x86_64_lazy_ibt_plt): Likewise.
1687 (elf_x32_lazy_ibt_plt): Likewise.
1688 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1689 (elf_x32_non_lazy_ibt_plt): Likewise.
1690 (elf_x86_64_allocate_dynrelocs): Likewise.
1691 (elf_x86_64_size_dynamic_sections): Likewise.
1692 (elf_x86_64_relocate_section): Likewise.
1693 (elf_x86_64_finish_dynamic_symbol): Likewise.
1694 (elf_x86_64_finish_dynamic_sections): Likewise.
1695 (elf_x86_64_get_synthetic_symtab): Likewise.
1696 (elf_x86_64_link_setup_gnu_properties): Likewise.
1697 (elf_x86_64_nacl_plt): Likewise.
1698 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1700 (ELF32_DYNAMIC_INTERPRETER): New.
1701 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1702 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1703 (_bfd_x86_elf_link_hash_table_create): Likewise.
1704 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1705 (elf_x86_link_hash_table_free): This. Make it static.
1706 * elfxx-x86.h: Don't include "objalloc.h".
1708 (elf_x86_lazy_plt_layout): Likewise.
1709 (elf_x86_non_lazy_plt_layout): Likewise.
1710 (elf_x86_plt_layout): Likewise.
1711 (_bfd_x86_elf_link_hash_table_create): Likewise.
1712 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1713 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1714 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1715 srelplt2 and next_tls_desc_index.
1716 (_bfd_x86_elf_link_hash_table_free): Removed.
1718 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1720 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1721 branch offset interpretation.
1723 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1726 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1728 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1730 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1731 (elf_x86_64_srelplt2): Likewise.
1733 2017-08-30 Alan Modra <amodra@gmail.com>
1735 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1736 (ppc64_elf_tls_optimize): Set it.
1737 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1738 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1739 addis would add zero.
1740 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1741 (ppc_elf_tls_optimize): Set it.
1742 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1743 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1745 2017-08-30 Alan Modra <amodra@gmail.com>
1747 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1748 __tls_get_addr call sequences to LE, don't move the addi down
1749 to the nop. Replace the bl with addi and leave the nop alone.
1751 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1753 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1755 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1757 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1759 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1761 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1762 (BFD64_BACKENDS): Likewise.
1763 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1764 (BFD64_BACKENDS_CFILES): Likewise.
1765 * Makefile.in: Regenerated.
1766 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1767 elf32-i386.lo and elf64-x86-64.lo.
1768 * configure: Regenerated.
1769 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1770 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1771 "objalloc.h" and "hashtab.h".
1772 (ELIMINATE_COPY_RELOCS): Removed.
1773 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1774 (SYMBOL_NO_COPYRELOC): Likewise.
1775 (elf_i386_link_hash_entry): Likewise.
1776 (GOT_UNKNOWN): Likewise.
1777 (GOT_NORMAL): Likewise.
1778 (GOT_TLS_GD): Likewise.
1779 (elf_i386_hash_entry): Likewise.
1780 (elf_i386_obj_tdata): Likewise.
1781 (elf_i386_tdata): Likewise.
1782 (elf_i386_local_got_tls_type): Likewise.
1783 (elf_i386_local_tlsdesc_gotent): Likewise.
1784 (elf_i386_hash_table): Likewise.
1785 (elf_i386_link_hash_newfunc): Likewise.
1786 (elf_i386_local_htab_hash): Likewise.
1787 (elf_i386_local_htab_eq): Likewise.
1788 (elf_i386_get_local_sym_hash): Likewise.
1789 (elf_i386_link_hash_table_free): Likewise.
1790 (elf_i386_copy_indirect_symbol): Likewise.
1791 (elf_i386_fixup_symbol): Likewise.
1792 (elf_i386_readonly_dynrelocs): Likewise.
1793 (elf_i386_always_size_sections): Likewise.
1794 (elf_i386_set_tls_module_base): Likewise.
1795 (elf_i386_dtpoff_base): Likewise.
1796 (compare_relocs): Likewise.
1797 (elf_i386_hash_symbol): Likewise.
1798 (elf_i386_parse_gnu_properties): Likewise.
1799 (elf_i386_merge_gnu_properties): Likewise.
1800 (elf_i386_link_check_relocs): Likewise.
1801 (elf_i386_merge_symbol_attribute): Likewise.
1802 (bfd_elf32_bfd_link_check_relocs): Likewise.
1803 (elf_backend_copy_indirect_symbol): Likewise.
1804 (elf_backend_always_size_sections): Likewise.
1805 (elf_backend_omit_section_dynsym): Likewise.
1806 (elf_backend_hash_symbol): Likewise.
1807 (elf_backend_fixup_symbol): Likewise.
1808 (elf_backend_parse_gnu_properties): Likewise.
1809 (elf_backend_merge_gnu_properties): Likewise.
1810 (elf_backend_merge_symbol_attribute): Likewise.
1811 (elf_i386_mkobject): Updated.
1812 (elf_i386_link_hash_table_create): Likewise.
1813 (elf_i386_check_tls_transition): Likewise.
1814 (elf_i386_tls_transition): Likewise.
1815 (elf_i386_convert_load_reloc): Likewise.
1816 (elf_i386_check_relocs): Likewise.
1817 (elf_i386_adjust_dynamic_symbol): Likewise.
1818 (elf_i386_allocate_dynrelocs): Likewise.
1819 (elf_i386_convert_load): Likewise.
1820 (elf_i386_size_dynamic_sections): Likewise.
1821 (elf_i386_relocate_section): Likewise.
1822 (elf_i386_finish_dynamic_symbol ): Likewise.
1823 (elf_i386_finish_dynamic_sections): Likewise.
1824 (elf_i386_output_arch_local_syms): Likewise.
1825 (elf_i386_get_synthetic_symtab): Likewise.
1826 (elf_i386_link_setup_gnu_properties): Likewise.
1827 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1828 of elf_link_hash_table, as base.
1829 (elf_i386_next_tls_desc_index): New.
1830 (elf_i386_srelplt2): Likewise.
1831 (elf_i386_plt): Likewise.
1832 (elf_i386_lazy_plt): Likewise.
1833 (elf_i386_non_lazy_plt): Likewise.
1834 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1835 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1836 "objalloc.h" and "hashtab.h".
1837 (ELIMINATE_COPY_RELOCS): Removed.
1838 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1839 (SYMBOL_NO_COPYRELOC): Likewise.
1840 (elf_x86_64_link_hash_entry): Likewise.
1841 (GOT_UNKNOWN): Likewise.
1842 (GOT_NORMAL): Likewise.
1843 (GOT_TLS_GD): Likewise.
1844 (elf_x86_64_hash_entry): Likewise.
1845 (elf_x86_64_obj_tdata): Likewise.
1846 (elf_x86_64_tdata): Likewise.
1847 (elf_x86_64_local_got_tls_type): Likewise.
1848 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1849 (elf_x86_64_hash_table): Likewise.
1850 (elf_x86_64_link_hash_newfunc): Likewise.
1851 (elf_x86_64_local_htab_hash): Likewise.
1852 (elf_x86_64_local_htab_eq): Likewise.
1853 (elf_x86_64_get_local_sym_hash): Likewise.
1854 (elf_x86_64_link_hash_table_free): Likewise.
1855 (elf_x86_64_copy_indirect_symbol): Likewise.
1856 (elf_x86_64_fixup_symbol): Likewise.
1857 (elf_x86_64_readonly_dynrelocs): Likewise.
1858 (elf_x86_64_always_size_sections): Likewise.
1859 (elf_x86_64_set_tls_module_base): Likewise.
1860 (elf_x86_64_dtpoff_base): Likewise.
1861 (compare_relocs): Likewise.
1862 (elf_x86_64_merge_symbol_attribute): Likewise.
1863 (elf_x86_64_hash_symbol): Likewise.
1864 (elf_x86_64_parse_gnu_properties): Likewise.
1865 (elf_x86_64_merge_gnu_properties): Likewise.
1866 (elf_x86_64_link_check_relocs): Likewise.
1867 (elf_backend_copy_indirect_symbol): Likewise.
1868 (elf_backend_always_size_sections): Likewise.
1869 (bfd_elf64_bfd_link_check_relocs): Likewise.
1870 (elf_backend_merge_symbol_attribute): Likewise.
1871 (elf_backend_hash_symbol): Likewise.
1872 (elf_backend_omit_section_dynsym): Likewise.
1873 (elf_backend_fixup_symbol): Likewise.
1874 (elf_backend_parse_gnu_properties): Likewise.
1875 (elf_backend_merge_gnu_properties): Likewise.
1876 (bfd_elf32_bfd_link_check_relocs): Likewise.
1877 (elf_x86_64_mkobject): Updated.
1878 (elf_x86_64_link_hash_table_create): Likewise.
1879 (elf_x86_64_check_tls_transition): Likewise.
1880 (elf_x86_64_tls_transition): Likewise.
1881 (elf_x86_64_convert_load_reloc): Likewise.
1882 (elf_x86_64_check_relocs): Likewise.
1883 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1884 (elf_x86_64_allocate_dynrelocs): Likewise.
1885 (elf_x86_64_convert_load): Likewise.
1886 (elf_x86_64_size_dynamic_sections): Likewise.
1887 (elf_x86_64_relocate_section): Likewise.
1888 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1889 (elf_x86_64_finish_dynamic_sections): Likewise.
1890 (elf_x86_64_output_arch_local_syms): Likewise.
1891 (elf_x86_64_get_synthetic_symtab): Likewise.
1892 (elf_x86_64_link_setup_gnu_properties): Likewise.
1893 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1894 instead of elf_link_hash_table, as base.
1895 (elf_x86_64_next_tls_desc_index): New.
1896 (elf_x86_64_srelplt2): Likewise.
1897 (elf_x86_64_plt): Likewise.
1898 (elf_x86_64_lazy_plt): Likewise.
1899 (elf_x86_64_non_lazy_plt): Likewise.
1900 * elfxx-x86.c: New file.
1901 * elfxx-x86.h: Likewise.
1903 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1905 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1907 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1909 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1911 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1912 sections before checking dynamic relocations and free invalid
1913 PLT section contents.
1914 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1916 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1918 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1919 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1921 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1924 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1926 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1928 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1930 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1932 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1934 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1937 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1938 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1939 Add a has_no_copy_on_protected bitfield.
1940 (elf_has_no_copy_on_protected): New.
1941 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1942 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1943 (elf_merge_gnu_property_list): Likewise.
1944 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1945 to FALSE for elf_has_no_copy_on_protected.
1946 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1947 (elf_i386_link_hash_entry): Add def_protected.
1948 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1949 when checking info->nocopyreloc.
1950 (elf_i386_link_setup_gnu_properties): Don't set
1951 extern_protected_data here.
1952 (elf_i386_merge_symbol_attribute): New function.
1953 (elf_backend_merge_symbol_attribute): New.
1954 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1955 (elf_x86_64_link_hash_entry): Add def_protected.
1956 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1957 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1958 when checking info->nocopyreloc.
1959 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1960 relocation run-time overflow and unresolvable R_X86_64_32S
1961 relocation against protected data symbol defined in shared object
1962 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1963 (elf_x86_64_link_setup_gnu_properties): Don't set
1964 extern_protected_data here.
1965 (elf_x86_64_merge_symbol_attribute): New function.
1966 (elf_backend_merge_symbol_attribute): New.
1968 2017-08-26 Alan Modra <amodra@gmail.com>
1970 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1971 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1972 (ppc_elf_relocate_section): Comment fix.
1973 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1974 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1975 Support dynamic relocs for TPREL16 when non-pic too.
1976 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1977 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1980 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1982 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1983 "symbol" in comments.
1984 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1986 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1989 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1990 R_X86_64_PC32 relocation run-time overflow and unresolvable
1991 R_X86_64_32S relocation with -z nocopyreloc.
1993 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1995 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1996 Undefined symbols may not have a type.
1997 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1999 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2001 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
2002 bfd_link_info. Report shared, PIE or PDE object based on
2004 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
2005 (elf_x86_64_relocate_section): Likewise.
2007 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2009 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
2010 for function symbols.
2011 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2013 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
2015 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
2016 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
2017 is set on any input relocatable file.
2018 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2020 2017-08-23 Alan Modra <amodra@gmail.com>
2023 * elf64-ppc.c (ensure_undef_dynamic): Rename from
2024 ensure_undefweak_dynamic. Handle undefined too.
2025 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
2026 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
2027 (allocate_dynrelocs): Discard undefined non-default visibility
2028 relocs first. Make undefined syms dynamic. Tidy goto.
2030 2017-08-21 Alan Modra <amodra@gmail.com>
2031 H.J. Lu <hongjiu.lu@intel.com>
2034 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2035 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2037 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2040 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2041 undefined weak symbols.
2043 2017-08-18 Nick Clifton <nickc@redhat.com>
2046 * tekhex.c (getsym): Fix check for source pointer walking off the
2047 end of the input buffer.
2049 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2052 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2053 relocations in debug sections, change abort to _bfd_error_handler.
2055 2017-08-14 Nick Clifton <nickc@redhat.com>
2058 * elf.c (setup_group): Check for an empty or very small group
2060 * po/bfd.pot: Regenerate.
2062 2017-08-14 Alan Modra <amodra@gmail.com>
2065 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2066 alignment padding here.
2067 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2068 in a reverse pass over sections.
2070 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2073 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2074 for @plt suffixes first.
2075 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2077 2017-08-08 Nick Clifton <nickc@redhat.com>
2080 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2081 small section lengths.
2082 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2084 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2085 there is enough data present in the note.
2087 2017-08-08 Alan Modra <amodra@gmail.com>
2090 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2091 got.refcount for GOTOFF relocs, just create .got section.
2093 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2095 * elflink.c (elf_link_add_object_symbols): Move common symbol
2096 check after bed->common_definition.
2098 2017-08-07 Alan Modra <amodra@gmail.com>
2101 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2102 needed to define various dynamic tags have been discarded.
2104 2017-08-07 Nick Clifton <nickc@redhat.com>
2107 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2108 has not been set then use the bfd returned by
2109 _bfd_elf_link_setup_gnu_properties. If that is null then search
2110 through all the input bfds selecting the first normal, ELF format
2112 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2114 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2116 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2118 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2119 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2120 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2121 (elf_i386_link_check_relocs): New function.
2122 (bfd_elf32_bfd_link_check_relocs): New.
2123 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2125 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2126 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2127 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2128 (elf_x86_64_link_check_relocs): New function.
2129 (bfd_elf64_bfd_link_check_relocs): New.
2130 (bfd_elf32_bfd_link_check_relocs): Likewise.
2132 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2135 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2136 as undefined for --no-define-common.
2138 2017-08-05 Alan Modra <amodra@gmail.com>
2140 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2141 hppa_link_hash_table.
2143 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2145 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2146 entries for sysregs with negative indices.
2148 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2150 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2151 isn't the S/390 specific elf data.
2152 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2154 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2156 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2157 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2158 [R_RISCV_ADD16]: Likewise.
2159 [R_RISCV_ADD32]: Likewise.
2160 [R_RISCV_ADD64]: Likewise.
2161 [R_RISCV_SUB6]: Likewise.
2162 [R_RISCV_SUB8]: Likewise.
2163 [R_RISCV_SUB16]: Likewise.
2164 [R_RISCV_SUB32]: Likewise.
2165 [R_RISCV_SUB64]: Likewise.
2167 2017-07-31 Alan Modra <amodra@gmail.com>
2169 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2170 without ld.so checks.
2172 2017-07-29 Alan Modra <amodra@gmail.com>
2175 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2176 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2177 (is_elfv2_localentry0): Test non_zero_localentry.
2178 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2180 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2182 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2183 pointer check for htab->elf.irelplt.
2184 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2186 2017-07-27 Nick Clifton <nickc@redhat.com>
2189 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2191 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2193 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2195 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2197 (evax_bfd_print_emh): Check for invalid string lengths.
2199 2017-07-25 Nick Clifton <nickc@redhat.com>
2201 * po/fr.po: Updated French translation.
2203 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2206 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2207 16-bit absolute branches into 10-bit pc-relative branches on the
2208 MSP430 as well as the MSP430X.
2210 2017-07-25 Alan Modra <amodra@gmail.com>
2212 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2213 (stub_eh_frame_size): New function.
2214 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2215 (group_sections): Init group tls_get_addr_opt_bctrl.
2216 (ppc64_elf_size_stubs): Update sizing and initialization of
2217 .eh_frame. Iteration over stubs via group list.
2218 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2219 (ppc64_elf_finish_dynamic_sections): Update finalization of
2222 2017-07-24 Nick Clifton <nickc@redhat.com>
2225 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2226 of the relocs to the canonicalize_one_reloc routine.
2227 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2228 for the _bfd_mach_o_canonicalize_one_reloc field.
2229 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2230 res_base parameter. Use to check for corrupt pair relocs.
2231 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2233 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2235 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2238 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2239 enough data in the record before attempting to parse it.
2240 (_bfd_vms_slurp_eeom): Likewise.
2242 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2243 (image_set_ptr): Likewise.
2244 (alpha_vms_slurp_relocs): Likewise.
2246 (alpha_vms_object_p): Check for a truncated record.
2248 2017-07-24 Nick Clifton <nickc@redhat.com>
2251 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2252 an unrecognized reloc and sets the bfd_error value.
2253 * libbfd.h: Regenerate.
2254 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2256 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2257 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2258 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2259 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2260 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2262 2017-07-23 Alan Modra <amodra@gmail.com>
2264 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2267 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2270 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2271 reloc_class_ifunc for ifunc symbols.
2273 2017-07-19 Nick Clifton <nickc@redhat.com>
2276 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2277 correct magic bytes at the start, set the error to wrong format
2278 and clear the format selector before returning NULL.
2280 2017-07-19 Nick Clifton <nickc@redhat.com>
2283 * coff-rs6000.c (_bfd_strntol): New function.
2284 (_bfd_strntoll): New function.
2285 (GET_VALUE_IN_FIELD): New macro.
2286 (EQ_VALUE_IN_FIELD): new macro.
2287 (_bfd_xcoff_slurp_armap): Use new macros.
2288 (_bfd_xcoff_archive_p): Likewise.
2289 (_bfd_xcoff_read_ar_hdr): Likewise.
2290 (_bfd_xcoff_openr_next_archived_file): Likewise.
2291 (_bfd_xcoff_stat_arch_elt): Likewise.
2292 * coff64-rs6000.c (_bfd_strntol): New function.
2293 (_bfd_strntoll): New function.
2294 (GET_VALUE_IN_FIELD): New macro.
2295 (xcoff64_slurp_armap): Use new macros.
2297 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2298 John Eric Martin <John.Martin@emmicro-us.com>
2300 * bfd-in2.h: Regenerate.
2301 * libbfd.h: Regenerate.
2302 * elf32-arc.c (JLI): Define.
2303 * reloc.c: Add JLI relocations.
2305 2017-07-18 Nick Clifton <nickc@redhat.com>
2308 * coff-sh.c: Fix spelling typos.
2309 * compress.c: Likewise.
2310 * cpu-pdp11.c: Likewise.
2311 * ecofflink.c: Likewise.
2312 * elf-m10300.c: Likewise.
2314 * elf32-arm.c: Likewise.
2315 * elf32-m68k.c: Likewise.
2316 * elf32-nds32.c: Likewise.
2317 * elf32-ppc.c: Likewise.
2318 * elf32-sh.c: Likewise.
2319 * elf32-v850.c: Likewise.
2320 * elf64-ppc.c: Likewise.
2321 * elf64-x86-64.c: Likewise.
2322 * elflink.c: Likewise.
2323 * elfnn-aarch64.c: Likewise.
2324 * elfxx-mips.c: Likewise.
2326 * sunos.c: Likewise.
2327 * vms-alpha.c: Likewise.
2328 * xcofflink.c: Likewise.
2330 2017-07-18 Nick Clifton <nickc@redhat.com>
2333 * coffcode.h (handle_COMDAT): Replace abort with an error message
2336 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2339 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2342 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2344 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2346 2017-07-16 Alan Modra <amodra@gmail.com>
2348 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2349 __tls_index GOT entries when using __tls_get_addr_opt stub.
2350 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2352 2017-07-12 Alan Modra <amodra@gmail.com>
2354 * po/es.po: Update from translationproject.org/latest/bfd/.
2355 * po/fi.po: Likewise.
2356 * po/fr.po: Likewise.
2357 * po/id.po: Likewise.
2358 * po/ja.po: Likewise.
2359 * po/ro.po: Likewise.
2360 * po/ru.po: Likewise.
2361 * po/sr.po: Likewise.
2362 * po/sv.po: Likewise.
2363 * po/tr.po: Likewise.
2364 * po/uk.po: Likewise.
2365 * po/vi.po: Likewise.
2366 * po/zh_CN.po: Likewise.
2367 * po/hr.po: New file from translationproject.org.
2368 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2369 * configure: Regenerate.
2371 2017-07-12 Nick Clifton <nickc@redhat.com>
2373 Fix compile time warnings using gcc 7.1.1.
2374 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2376 (elf_xtensa_get_gotplt_section): Increase length of got_name
2378 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2379 default return of FALSE.
2380 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2381 default return of FALSE.
2383 2017-07-12 Alan Modra <amodra@gmail.com>
2385 * binary.c (binary_set_section_contents): Don't print filepos in
2387 (coff_write_object_contents): Cast size_t for error message.
2388 (coff_slurp_line_table): Don't use bfd_vma symndx.
2389 (coff_slurp_reloc_table): Remove unneeded cast.
2390 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2392 (find_abstract_instance_name): Likewise.
2393 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2394 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2395 (elf32_arm_check_relocs): Make r_symndx an int.
2396 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2398 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2400 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2402 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2403 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2404 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2405 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2406 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2407 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2408 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2409 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2410 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2411 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2412 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2413 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2414 and use %lu for error message.
2415 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2416 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2419 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2421 (elf32_arm_final_link_relocate): Likewise.
2422 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2423 * coffcode.h (styp_to_sec_flags): Likewise.
2424 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2425 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2426 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2427 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2428 (elf32_bfin_merge_private_bfd_data): Likewise.
2429 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2430 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2431 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2432 (i370_elf_relocate_section): Likewise.
2433 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2434 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2435 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2436 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2437 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2438 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2439 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2440 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2441 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2442 * ieee.c (ieee_write_id, read_id): Likewise.
2443 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2444 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2445 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2446 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2447 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2448 * stabs.c (_bfd_link_section_stabs): Likewise.
2450 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2452 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2453 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2454 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2455 * coff-sh.c (sh_relax_section): Likewise.
2456 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2457 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2458 * coffcode.h (coff_slurp_reloc_table): Likewise.
2459 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2460 (_bfd_coff_read_string_table): Likewise.
2461 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2462 * compress.c (bfd_get_full_section_contents): Likewise.
2463 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2464 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2465 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2466 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2467 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2468 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2469 (elf32_arm_write_section): Likewise.
2470 * elf32-bfin.c (bfin_relocate_section): Likewise.
2471 (bfinfdpic_relocate_section): Likewise.
2472 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2473 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2474 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2475 (elf_i386_relocate_section): Likewise.
2476 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2477 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2478 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2479 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2480 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2481 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2482 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2483 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2484 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2485 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2486 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2487 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2488 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2489 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2490 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2491 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2492 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2493 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2494 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2495 * elf32-sh.c (sh_elf_relax_section): Likewise.
2496 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2497 (sh_elf_relocate_section): Likewise.
2498 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2499 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2500 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2501 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2502 * elf32-v850.c (v850_elf_relax_section): Likewise.
2503 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2504 (elf_vax_relocate_section): Likewise.
2505 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2506 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2507 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2508 (do_fix_for_relocatable_link): Likewise.
2509 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2510 (elf64_alpha_relax_with_lituse): Likewise.
2511 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2512 (elf_hppa_final_link_relocate): Likewise.
2513 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2514 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2515 (elf64_vms_link_add_object_symbols): Likewise.
2516 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2517 (mmix_final_link_relocate): Likewise.
2518 * elf64-s390.c (invalid_tls_insn): Likewise.
2519 (elf_s390_relocate_section): Likewise.
2520 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2521 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2522 (elf_x86_64_relocate_section): Likewise.
2523 * elfcode.h (elf_slurp_symbol_table): Likewise.
2524 * elfcore.h (elf_core_file_p): Likewise.
2525 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2526 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2527 (elfNN_aarch64_relocate_section): Likewise.
2528 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2529 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2530 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2531 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2532 (_bfd_mips_elf_relocate_section): Likewise.
2533 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2534 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2535 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2536 * ieee.c (ieee_slurp_external_symbols): Likewise.
2537 * ihex.c (ihex_write_object_content): Likewise.
2538 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2539 * merge.c (_bfd_merged_section_offset): Likewise.
2540 * mmo.c (mmo_write_loc_chunk): Likewise.
2541 (mmo_write_object_contents): Likewise.
2542 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2543 * stabs.c (_bfd_link_section_stabs): Likewise.
2544 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2546 2017-07-11 Alan Modra <amodra@gmail.com>
2548 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2550 2017-07-11 Alan Modra <amodra@gmail.com>
2552 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2553 instruction" error using _bfd_error_handler, not einfo.
2555 2017-07-10 Nick Clifton <nickc@redhat.com>
2557 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2558 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2560 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2562 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2564 2017-07-07 Alan Modra <amodra@gmail.com>
2566 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2568 2017-07-07 Alan Modra <amodra@gmail.com>
2570 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2571 as long long. Move code replacing "ll" with "I64", and simplify.
2573 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2575 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2578 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2580 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2582 (line_info_add_file_name): Likewise.
2583 (decode_line_info): Likewise.
2585 2017-07-04 Tristan Gingold <gingold@adacore.com>
2587 * version.m4: Bump version to 2.29.51
2588 * configure: Regenerate.
2590 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2592 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2593 sanity check at the head of this function.
2595 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2597 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2598 dwarf_line_str_size.
2599 (struct attr_abbrev): Add field implicit_const.
2600 (dwarf_debug_sections): Add .debug_line_str.
2601 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2602 (dwarf_debug_section_assert): Add static assertion.
2603 (read_indirect_line_string): New.
2604 (read_abbrevs): Support DW_FORM_implicit_const.
2605 (is_str_attr): Support DW_FORM_line_strp.
2606 (read_attribute_value): Support DW_FORM_line_strp and
2607 DW_FORM_implicit_const.
2608 (read_attribute): Support DW_FORM_implicit_const.
2609 (line_info_add_include_dir, line_info_add_include_dir_stub):
2610 (line_info_add_file_name, read_formatted_entries): New.
2611 (decode_line_info, parse_comp_unit): Support DWARF 5.
2612 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2614 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2616 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2617 abort statement that was put for symbols that are not dynamic.
2619 2017-07-03 Tristan Gingold <gingold@adacore.com>
2621 * po/bfd.pot: Regenerate
2623 2017-07-03 Alan Modra <amodra@gmail.com>
2625 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2626 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2627 * elf.c (setup_group): Use "Lx" to print sh_size.
2628 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2629 unknown section type in hex.
2630 (copy_special_section_fields): Style fix.
2631 (bfd_section_from_shdr): Correct format for sh_link. Use a
2632 common error message for all the variants of unrecognized
2634 (assign_file_positions_for_load_sections): Use "Lx" for lma
2635 adjust error message.
2636 (assign_file_positions_for_non_load_sections): Formatting.
2637 (rewrite_elf_program_header): Formatting. Use "Lx" for
2638 bfd_vma values in error messages.
2639 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2640 ELF_R_SYM value to type expected by format.
2641 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2643 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2644 (elf_link_input_bfd): Use "Lx" for r_info.
2645 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2647 2017-07-03 Alan Modra <amodra@gmail.com>
2649 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2650 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2651 Microsoft C library variant of long long format specifier.
2652 (PRINT20): Cast value to bfd_uint64_t not long long.
2653 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2654 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2655 long long. Don't cast to bfd_vma.
2656 * elf32-score.c (score3_bfd_getl48): Likewise.
2657 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2659 2017-07-03 Alan Modra <amodra@gmail.com>
2661 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2663 (bfd_elf_print_symbol): Don't cast symbol->flags.
2664 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2665 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2666 _bfd_error_handler argument order.
2667 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2669 2017-07-03 Alan Modra <amodra@gmail.com>
2671 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2672 AC_TYPE_LONG_DOUBLE.
2673 * configure: Regenerate.
2674 * config.in: Regenerate.
2676 2017-06-29 Andrew Waterman <andrew@sifive.com>
2678 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2681 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2683 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2684 unless it is undefined weak.
2685 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2686 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2688 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2689 is not dynamic in PIC, abort.
2691 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2694 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2695 undefined weak symbols into dynamic.
2696 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2697 relocation for non-dynamic symbols.
2698 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2700 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2702 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2703 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2704 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2705 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2706 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2709 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2711 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2712 (elfcore_write_s390_gs_bc): Likewise.
2713 * elf.c (elfcore_grok_s390_gs_cb): New function.
2714 (elfcore_grok_s390_gs_bc): New function.
2715 (elfcore_grok_note): Call them.
2716 (elfcore_write_s390_gs_cb): New function.
2717 (elfcore_write_s390_gs_bc): New function.
2718 (elfcore_write_register_note): Call them.
2720 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2722 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2723 bfd_get_file_size. Check archive element size.
2724 (_bfd_generic_get_section_contents_in_window): Likewise.
2726 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2728 * bfd-in2.h: Regenerated.
2729 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2730 (bfd_get_file_size): Likewise.
2732 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2733 Matthew Fortune <matthew.fortune@imgtec.com>
2735 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2736 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2737 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2738 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2740 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2741 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2742 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2743 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2744 `bfd_mach_mips_interaptiv_mr2' entries.
2745 * bfd-in2.h: Regenerate.
2747 2017-06-27 Nick Clifton <nickc@redhat.com>
2749 * tekhex.c (pass_over): Revert accidental conversion of a local
2750 array to a static array.
2752 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2755 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2756 reloc addend if necessary. Adjust diff only if
2757 shrinked_insn_address < end_address.
2759 2017-06-27 Alan Modra <amodra@gmail.com>
2762 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2763 (_bfd_generic_get_section_contents_in_window): Likewise.
2765 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2767 * elfnn-riscv.c (perform_relocation): Support the new
2768 R_RISCV_32_PCREL relocation.
2769 (riscv_elf_relocate_section): Likewise.
2770 * elfxx-riscv.c (howto_table): Likewise.
2771 (riscv_reloc_map): Likewise.
2772 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2773 * libbfd.h: Regenerate.
2775 2017-06-27 Alan Modra <amodra@gmail.com>
2778 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2779 Use unsigned file pointer type, and remove cast.
2780 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2781 Add "count", not "sz".
2783 2017-06-26 Pedro Alves <palves@redhat.com>
2786 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2789 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2792 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2795 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2797 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2798 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2799 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2800 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2801 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2803 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2806 * compress.c (bfd_get_full_section_contents): Don't check the
2808 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2809 reject a section whose size + offset is greater than the size
2811 (_bfd_generic_get_section_contents_in_window): Likewise.
2813 2017-06-26 Nick Clifton <nickc@redhat.com>
2816 * tekhex.c (getvalue): Check for the source pointer exceeding the
2817 end pointer before the first byte is read.
2819 2017-06-26 Nick Clifton <nickc@redhat.com>
2822 * opncls.c (get_build_id): Check that the section is big enough
2823 to contain the whole note.
2824 * compress.c (bfd_get_full_section_contents): Check for and reject
2825 a section whose size is greater than the size of the entire file.
2826 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2827 contain a notes section.
2829 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2831 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2833 (elf_s390_modify_segment_map): Likewise.
2834 (bfd_elf_s390_set_options): Lisewise.
2836 2017-06-26 Alan Modra <amodra@gmail.com>
2838 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2840 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2841 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2842 .preinit_array on --just-syms bfds.
2843 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2844 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2845 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2847 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2849 * elf.c (find_link): Bounds check "hint".
2851 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2853 * elf32-arm.c (using_thumb_only): Update list of architectures in
2854 BFD_ASSERT for which the logic is valid.
2855 (using_thumb2_bl): Likewise.
2856 (using_thumb2): Likewise and return true for ARMv8-R.
2857 (arch_has_arm_nop): Likewise.
2858 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2859 merging logic. Update commentis for value 15 of v8m_baseline,
2860 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2861 merging of value 15 of Tag_CPU_arch.
2863 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2865 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2866 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2867 * bfd-in2.h: Regenerate.
2869 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2871 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2872 the error_alignment label forward. Properly align program
2873 property note section.
2875 2017-06-22 Eric Christopher <echristo@gmail.com>
2877 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2878 abs to fix a truncation warning.
2880 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2882 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2883 local undefined weak symbol to 0.
2884 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2886 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2888 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2889 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2890 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2891 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2892 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2893 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2894 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2895 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2897 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2899 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2900 (elf_i386_lazy_ibt_plt_entry): Likewise.
2901 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2902 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2903 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2904 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2905 (elf_i386_lazy_plt_layout): Likewise.
2906 (elf_i386_non_lazy_plt_layout): Likewise.
2907 (elf_i386_link_hash_entry): Add plt_second.
2908 (elf_i386_link_hash_table): Add plt_second and
2909 plt_second_eh_frame.
2910 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2911 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2912 the second PLT. Check the second PLT.
2913 (elf_i386_relocate_section): Use the second PLT to resolve
2914 PLT reference if needed.
2915 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2917 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2918 second PLT. Generate unwind info for the second PLT.
2919 (elf_i386_plt_type): Add plt_second.
2920 (elf_i386_get_synthetic_symtab): Support the second PLT.
2921 (elf_i386_parse_gnu_properties): Support
2922 GNU_PROPERTY_X86_FEATURE_1_AND.
2923 (elf_i386_merge_gnu_properties): Support
2924 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2925 on GNU_PROPERTY_X86_FEATURE_1_IBT
2926 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2927 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2928 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2929 is set on all relocatable inputs.
2930 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2931 (elf_x32_lazy_ibt_plt_entry): Likewise.
2932 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2933 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2934 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2935 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2936 (elf_x86_64_lazy_ibt_plt): Likewise.
2937 (elf_x32_lazy_ibt_plt): Likewise.
2938 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2939 (elf_x32_non_lazy_ibt_plt): Likewise.
2940 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2941 (elf_x86_64_parse_gnu_properties): Support
2942 GNU_PROPERTY_X86_FEATURE_1_AND.
2943 (elf_x86_64_merge_gnu_properties): Support
2944 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2945 on GNU_PROPERTY_X86_FEATURE_1_IBT
2946 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2947 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2948 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2949 is set on all relocatable inputs.
2951 2017-06-22 Nick Clifton <nickc@redhat.com>
2954 * som.c (setup_sections): NUL terminate the space_strings buffer.
2955 Check that the space.name field does not index beyond the end of
2956 the space_strings buffer.
2958 2017-06-21 Nick Clifton <nickc@redhat.com>
2961 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2963 2017-06-21 Nick Clifton <nickc@redhat.com>
2966 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2967 type of the size parameter.
2968 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2969 length of the counted string.
2970 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2971 (_bfd_vms_save_counted_string): Likewise.
2972 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2973 _bfd_vms_save_counted_string.
2974 (_bfd_vms_slurp_ehdr): Likewise.
2975 (_bfd_vms_slurp_egsd): Likewise.
2976 (Parse_module): Likewise.
2978 2017-06-21 Alan Modra <amodra@gmail.com>
2980 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2981 calls before tocsave calls.
2982 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2985 2017-06-21 Nick Clifton <nickc@redhat.com>
2988 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2989 bfd_get_full_section_contents returns no contents.
2991 2017-06-21 Nick Clifton <nickc@redhat.com>
2994 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2997 2017-06-21 Nick Clifton <nickc@redhat.com>
3000 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
3002 (image_set_ptr): Likewise.
3003 (alpha_vms_fix_sec_rel): Likewise.
3004 (alpha_vms_slurp_relocs): Likewise.
3006 2017-06-21 Nick Clifton <nickc@redhat.com>
3009 * ieee.c (ieee_slurp_sections): Check for a NULL return from
3011 (ieee_archive_p): Likewise.
3012 (ieee_object_p): Likewise.
3014 2017-06-21 Nick Clifton <nickc@redhat.com>
3017 * elf.c (setup_group): Zero the group section pointer list after
3018 allocation so that loops can be caught. Check for NULL pointers
3019 when processing a group list.
3021 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
3023 * elf-s390.h: New file.
3024 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
3026 (elf_s390_additional_program_headers): New function.
3027 (elf_s390_modify_segment_map): New function.
3028 (bfd_elf_s390_set_options): New function.
3029 (elf_backend_additional_program_headers)
3030 (elf_backend_modify_segment_map): Add macro definitions.
3032 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3035 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3036 the DYNAMIC bit instead of bfd_count_sections.
3038 2017-06-19 Nick Clifton <nickc@redhat.com>
3041 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3043 (evax_bfd_print_eeom): Likewise.
3044 (evax_bfd_print_egsd): Check for an overlarge record length.
3045 (evax_bfd_print_etir): Likewise.
3047 2017-06-19 Nick Clifton <nickc@redhat.com>
3050 * libieee.h (struct common_header_type): Add end_p field.
3051 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3053 (read_id): Check for a length that exceeds the remaining bytes in
3055 (ieee_seek): Initialise end_p.
3056 (ieee_archive_p): Likewise.
3057 (ieee_object_p): Likewise.
3059 2017-06-19 Nick Clifton <nickc@redhat.com>
3062 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3063 before reading the EIHS structure entries.
3065 2017-06-19 Nick Clifton <nickc@redhat.com>
3068 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3069 gsd_size. Check that there are enough bytes remaining to read the
3070 type and size of the next egsd. Check that the size of the egsd
3071 does not exceed the size of the record.
3073 2017-06-19 Alan Modra <amodra@gmail.com>
3075 * config.bfd: Correct targ_underscore for cris.
3077 2017-06-18 Alan Modra <amodra@gmail.com>
3079 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3080 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3082 2017-06-16 Nick Clifton <nickc@redhat.com>
3084 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3085 bucketlist is empty because there are no symbols to add to the
3088 2017-06-16 Alan Modra <amodra@gmail.com>
3094 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3095 (BFD_JUMP_TABLE_LINK): Likewise.
3096 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3097 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3098 (bfd_elf_define_start_stop): New function.
3099 * linker.c (bfd_generic_define_start_stop): New function.
3100 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3102 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3103 * aout-target.h (MY_bfd_define_start_stop): Define.
3104 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3105 * binary.c (binary_bfd_define_start_stop): Define.
3106 * bout.c (b_out_bfd_define_start_stop): Define.
3107 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3108 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3109 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3110 * coffcode.h (coff_bfd_define_start_stop): Define.
3111 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3112 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3113 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3114 * ieee.c (ieee_bfd_define_start_stop): Define.
3115 * ihex.c (ihex_bfd_define_start_stop): Define.
3116 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3117 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3118 * mmo.c (mmo_bfd_define_start_stop): Define.
3119 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3120 * oasys.c (oasys_bfd_define_start_stop): Define.
3121 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3122 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3123 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3124 * som.c (som_bfd_define_start_stop): Define.
3125 * srec.c (srec_bfd_define_start_stop): Define.
3126 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3127 * versados.c (versados_bfd_define_start_stop): Define.
3128 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3129 (alpha_vms_bfd_define_start_stop): Define.
3130 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3131 * bfd-in2.h: Regenerate.
3132 * libbfd.h: Regenerate.
3134 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3136 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3137 SYMBOL_REFERENCES_LOCAL.
3139 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3142 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3143 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3144 runtime for if there needs copy relocation elimination.
3145 (need_copy_relocation_p): New function. Return true for symbol with
3146 pc-relative references and if it's against read-only sections.
3147 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3148 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3149 that are related with accessing external objects.
3150 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3151 in elfNN_aarch64_check_relocs.
3153 2017-06-15 Nick Clifton <nickc@redhat.com>
3156 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3159 (ieee_archive_p): Likewise.
3161 2017-06-15 Nick Clifton <nickc@redhat.com>
3164 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3166 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3168 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3169 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3170 keep both windowed and call0 ABI PLT definitions.
3171 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3172 elf_xtensa_*_plt_entry endex.
3173 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3175 2017-06-14 Nick Clifton <nickc@redhat.com>
3178 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3181 2017-06-14 Nick Clifton <nickc@redhat.com>
3184 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3185 maximum value for the ascic pointer. Check that name processing
3186 does not read beyond this value.
3187 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3190 2017-06-14 Nick Clifton <nickc@redhat.com>
3193 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3194 (process_otr): Check for an invalid offset in the otr structure.
3196 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3198 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3200 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3206 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3207 vtable field to a union.
3208 (_bfd_elf_is_start_stop): Removed.
3209 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3210 __start_SECNAME and __stop_SECNAME symbols.
3211 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3212 * elflink.c (_bfd_elf_is_start_stop): Removed.
3213 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3214 _bfd_elf_is_start_stop.
3215 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3216 __stop_SECNAME symbols. Updated.
3217 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3218 (bfd_elf_gc_record_vtinherit): Likewise.
3219 (bfd_elf_gc_record_vtentry): Likewise.
3221 2017-06-13 Nick Clifton <nickc@redhat.com>
3224 * elflink.c (elf_link_adjust_relocs): Generate an error when
3225 encountering a reloc against a symbol removed by garbage
3228 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3230 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3231 to merge_gnu_properties.
3232 * elf-properties.c (elf_merge_gnu_properties): Add struct
3233 bfd_link_info * and pass it to merge_gnu_properties.
3234 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3235 and pass it to elf_merge_gnu_properties.
3236 (_bfd_elf_link_setup_gnu_properties): Pass info to
3237 elf_merge_gnu_property_list.
3238 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3240 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3242 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3245 * binary.c (binary_set_section_contents): Scale lma by octets
3246 per byte to set filepos.
3248 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3250 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3253 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3255 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3258 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3260 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3261 patched section contents for TLS IE reloc.
3262 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3264 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3266 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3267 RELOC_FOR_GLOBAL_SYMBOL macro.
3269 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3271 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3274 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3276 * config/tc-arc.c (md_undefined_symbol): Changed.
3277 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3279 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3281 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3284 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3286 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3287 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3289 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3291 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3294 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3296 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3297 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3298 is non-zero. Add clarifying comments.
3300 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3302 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3303 name. Use local IFUNC symbol name string to report unsupported
3304 non-PIC call to IFUNC function.
3305 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3306 when generating R_386_IRELATIVE relocation.
3307 (elf_i386_finish_dynamic_symbol): Likewise.
3308 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3310 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3311 when generating R_X86_64_IRELATIVE relocation.
3312 (elf_x86_64_finish_dynamic_symbol): Likewise.
3314 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3316 * elf.c (setup_group): Make sure BFD sections are created for all
3317 group sections in the input file when processing SHF_GROUP
3319 (bfd_section_from_shdr): Avoid duplicating logic already
3320 implemented in `setup_group'.
3322 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3325 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3326 if the hint address is zero.
3328 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3331 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3332 ELF_COMMON_DEF_P for common symbols.
3334 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3336 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3337 SEC_GROUP sections as SEC_EXCLUDE.
3338 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3339 (assign_section_numbers): Use resolve_section_groups flag instead
3340 of relocatable link type.
3341 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3342 flag instead of checking the final_link flag for part of the
3343 checks in here. Fix white space as a result.
3344 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3345 instead of relocatable link type.
3346 (bfd_elf_final_link): Likewise.
3348 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3350 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3352 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3353 (s3_bfd_score_elf_check_relocs): Likewise.
3354 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3355 (score_elf_final_link_relocate): Likewise.
3356 (s7_bfd_score_elf_check_relocs): Likewise.
3358 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3360 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3363 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3365 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3366 from `reloc_count' rather than decrementing it.
3367 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3368 `reloc_count' by `int_rels_per_ext_rel'.
3369 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3370 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3371 entry determination.
3372 (s3_bfd_score_elf_check_relocs): Likewise.
3373 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3374 (s7_bfd_score_elf_relocate_section): Likewise.
3375 (s7_bfd_score_elf_check_relocs): Likewise.
3376 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3377 prototype and function.
3378 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3379 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3380 triple rather than once the sum of REL and RELA relocation entry
3382 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3383 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3384 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3385 storage allocation size determination.
3386 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3387 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3388 by `int_rels_per_ext_rel' for last relocation entry
3390 (bfd_elf_final_link): Do not multiply `reloc_count' by
3391 `int_rels_per_ext_rel' for internal relocation storage
3392 allocation size determination.
3393 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3394 `int_rels_per_ext_rel' for last relocation entry determination.
3395 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3396 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3397 (_bfd_mips_elf_relocate_section): Likewise.
3399 2017-06-05 Alan Modra <amodra@gmail.com>
3402 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3404 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3406 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3407 determine structure sizes.
3408 (elfcore_grok_freebsd_prstatus): Likewise.
3410 2017-06-01 Alan Modra <amodra@gmail.com>
3412 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3413 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3415 (is_elfv2_localentry0): New function.
3416 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3417 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3418 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3419 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3420 optimized localentry:0 stubs.
3421 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3422 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3424 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3426 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3428 2017-05-30 Casey Smith <clegg89@gmail.com>
3431 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3432 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3434 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3436 * cpu-arc.c (arc_compatible): New function.
3438 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3440 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3442 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3445 * bfdio.c (bfd_get_file_size): New function.
3446 * bfd-in2.h: Regenerated.
3448 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3450 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3453 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3455 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3456 dynobj instead of htab->elf.dynobj.
3458 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3460 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3462 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3463 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3464 actual number of internal relocations retrieved. Adjust
3465 function description.
3466 (bfd_elf64_canonicalize_reloc): Remove macro.
3467 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3469 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3471 * archures.c (bfd_mach_sparc_v9m8): Define.
3472 (bfd_mach_sparc_v8plusm8): Likewise.
3473 (bfd_mach_sparc_v9_p): Adjust to M8.
3474 (bfd_mach_sparc_64bit_p): Likewise.
3475 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3476 bfd_mach_sparc_v8plusm8.
3477 * bfd-in2.h: Regenerated.
3478 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3480 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3481 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3482 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3484 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3485 bfd_mach_sparc_v8plusm8.
3487 2017-05-19 Alan Modra <amodra@gmail.com>
3489 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3490 debug and special sections when no non-note alloc sections in an
3493 2017-05-18 Alan Modra <amodra@gmail.com>
3495 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3496 * elf-m10300.c: Likewise.
3498 * elf32-arc.c: Likewise.
3499 * elf32-bfin.c: Likewise.
3500 * elf32-m68k.c: Likewise.
3501 * elf32-nds32.c: Likewise.
3502 * elf32-tilepro.c: Likewise.
3503 * elflink.c: Likewise.
3504 * elfnn-aarch64.c: Likewise.
3505 * elfnn-riscv.c: Likewise.
3506 * elfxx-tilegx.c: Likewise.
3507 * mach-o.c: Likewise.
3508 * peXXigen.c: Likewise.
3509 * vms-alpha.c: Likewise.
3510 * vms-lib.c: Likewise.
3512 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3515 * elflink.c (elf_gc_mark_debug_section): New function.
3516 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3517 referenced by kept debug sections.
3519 2017-05-16 Alan Modra <amodra@gmail.com>
3521 * elf-m10300.c: Rename occurrences of non_ir_ref.
3522 * elf32-arm.c: Likewise.
3523 * elf32-bfin.c: Likewise.
3524 * elf32-cr16.c: Likewise.
3525 * elf32-cris.c: Likewise.
3526 * elf32-d10v.c: Likewise.
3527 * elf32-dlx.c: Likewise.
3528 * elf32-fr30.c: Likewise.
3529 * elf32-frv.c: Likewise.
3530 * elf32-hppa.c: Likewise.
3531 * elf32-i370.c: Likewise.
3532 * elf32-i386.c: Likewise.
3533 * elf32-iq2000.c: Likewise.
3534 * elf32-lm32.c: Likewise.
3535 * elf32-m32c.c: Likewise.
3536 * elf32-m32r.c: Likewise.
3537 * elf32-m68hc1x.c: Likewise.
3538 * elf32-m68k.c: Likewise.
3539 * elf32-mcore.c: Likewise.
3540 * elf32-metag.c: Likewise.
3541 * elf32-microblaze.c: Likewise.
3542 * elf32-moxie.c: Likewise.
3543 * elf32-msp430.c: Likewise.
3544 * elf32-mt.c: Likewise.
3545 * elf32-nios2.c: Likewise.
3546 * elf32-or1k.c: Likewise.
3547 * elf32-ppc.c: Likewise.
3548 * elf32-rl78.c: Likewise.
3549 * elf32-s390.c: Likewise.
3550 * elf32-score.c: Likewise.
3551 * elf32-score7.c: Likewise.
3552 * elf32-sh.c: Likewise.
3553 * elf32-tic6x.c: Likewise.
3554 * elf32-tilepro.c: Likewise.
3555 * elf32-v850.c: Likewise.
3556 * elf32-vax.c: Likewise.
3557 * elf32-xstormy16.c: Likewise.
3558 * elf32-xtensa.c: Likewise.
3559 * elf64-alpha.c: Likewise.
3560 * elf64-hppa.c: Likewise.
3561 * elf64-ia64-vms.c: Likewise.
3562 * elf64-mmix.c: Likewise.
3563 * elf64-ppc.c: Likewise.
3564 * elf64-s390.c: Likewise.
3565 * elf64-sh64.c: Likewise.
3566 * elf64-x86-64.c: Likewise.
3567 * elflink.c: Likewise.
3568 * elfnn-aarch64.c: Likewise.
3569 * elfnn-ia64.c: Likewise.
3570 * elfnn-riscv.c: Likewise.
3571 * elfxx-mips.c: Likewise.
3572 * elfxx-sparc.c: Likewise.
3573 * elfxx-tilegx.c: Likewise.
3574 * linker.c: Likewise.
3576 2017-05-16 Alan Modra <amodra@gmail.com>
3578 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3579 * elflink.c (elf_link_add_object_symbols): Update to use
3581 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3583 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3585 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3587 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3589 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3591 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3592 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3594 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3596 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3598 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3600 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3601 to plt_second/plt_second_eh_frame.
3602 (elf_x86_64_link_hash_newfunc): Updated.
3603 (elf_x86_64_allocate_dynrelocs): Likewise.
3604 (elf_x86_64_size_dynamic_sections): Likewise.
3605 (elf_x86_64_relocate_section): Likewise.
3606 (elf_x86_64_finish_dynamic_symbol): Likewise.
3607 (elf_x86_64_finish_dynamic_sections): Likewise.
3608 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3609 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3611 (elf_backend_setup_gnu_properties): Updated. Create the
3612 .plt.sec section instead of the .plt.sec section.
3614 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3616 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3617 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3618 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3620 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3622 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3623 (bfd_elf64_set_reloc): Define.
3624 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3626 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3628 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3629 (struct bfd_target): New field _bfd_set_reloc.
3630 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3631 * reloc.c (_bfd_generic_set_reloc): New function.
3632 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3633 * nlm-target.h (nlm_set_reloc): Likewise.
3634 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3635 * aout-tic30.c (MY_set_reloc): Likewise.
3636 * aout-target.h (MY_set_reloc): Likewise.
3637 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3638 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3639 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3640 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3641 * aout-adobe.c (aout_32_set_reloc): Likewise.
3642 * bout.c (b_out_set_reloc): Likewise.
3643 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3644 * i386os9k.c (aout_32_set_reloc): Likewise.
3645 * ieee.c (ieee_set_reloc): Likewise.
3646 * oasys.c (oasys_set_reloc): Likewise.
3647 * som.c (som_set_reloc): Likewise.
3648 * versados.c (versados_set_reloc): Likewise.
3649 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3650 _bfd_generic_set_reloc.
3651 (rs6000_xcoff64_aix_vec): LIkewise.
3652 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3653 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3654 * i386msdos.c (msdos_set_reloc): Define to
3655 _bfd_norelocs_set_reloc.
3656 * elfcode.h (elf_set_reloc): Define.
3657 * bfd-in2.h: Regenerated.
3659 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3662 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3663 for IFUNC function address.
3665 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3667 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3668 (CONFLICT_LIST): Likewise.
3669 (opcode/arc-attrs.h): Include.
3670 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3671 (arc_extract_features): New file.
3672 (arc_stralloc): Likewise.
3673 (arc_elf_merge_attributes): Likewise.
3674 (arc_elf_merge_private_bfd_data): Use object attributes.
3675 (bfd_arc_get_mach_from_attributes): New function.
3676 (arc_elf_object_p): Use object attributes.
3677 (arc_elf_final_write_processing): Likewise.
3678 (elf32_arc_obj_attrs_arg_type): New function.
3679 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3680 (elf32_arc_section_from_shdr): Likewise.
3681 (elf_backend_obj_attrs_vendor): Define.
3682 (elf_backend_obj_attrs_section): Likewise.
3683 (elf_backend_obj_attrs_arg_type): Likewise.
3684 (elf_backend_obj_attrs_section_type): Likewise.
3685 (elf_backend_obj_attrs_handle_unknown): Likewise.
3686 (elf_backend_section_from_shdr): Likewise.
3688 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3691 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3692 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3693 and the destination is a Thumb symbol.
3695 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3697 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3698 initializer to silence GCC 4.2.
3699 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3701 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3703 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3704 (LAZY_PLT_ENTRY_SIZE): This.
3705 (NON_LAZY_PLT_ENTRY_SIZE): New.
3706 (elf_x86_64_plt0_entry): Renamed to ...
3707 (elf_x86_64_lazy_plt0_entry): This.
3708 (elf_x86_64_plt_entry): Renamed to ...
3709 (elf_x86_64_lazy_plt_entry): This.
3710 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3711 (elf_x86_64_lazy_bnd_plt0_entry): This.
3712 (elf_x86_64_legacy_plt_entry): Removed.
3713 (elf_x86_64_bnd_plt_entry): Renamed to ...
3714 (elf_x86_64_lazy_bnd_plt_entry): This.
3715 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3716 (elf_x86_64_non_lazy_plt_entry): This.
3717 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3718 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3719 (elf_x86_64_eh_frame_plt): Renamed to ...
3720 (elf_x86_64_eh_frame_lazy_plt): This.
3721 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3722 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3723 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3724 (elf_x86_64_eh_frame_non_lazy_plt): This.
3725 (elf_x86_64_lazy_plt_layout): New.
3726 (elf_x86_64_non_lazy_plt_layout): Likewise.
3727 (elf_x86_64_plt_layout): Likewise.
3728 (elf_x86_64_backend_data): Remove PLT layout information. Add
3729 os for target system.
3730 (GET_PLT_ENTRY_SIZE): Removed.
3731 (elf_x86_64_lazy_plt): New.
3732 (elf_x86_64_non_lazy_plt): Likewise.
3733 (elf_x86_64_lazy_bnd_plt): Likewise.
3734 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3735 (elf_x86-64_arch_bed): Updated.
3736 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3737 (elf_x86_64_create_dynamic_sections): Removed.
3738 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3739 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3740 (elf_x86-64_adjust_dynamic_symbol): Updated.
3741 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3742 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3743 size for PLT0 if there is no PLT0. Get plt_entry_size from
3744 non_lazy_plt for non-lazy PLT entries.
3745 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3746 from non_lazy_plt for non-lazy PLT entries.
3747 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3748 if there is no PLT0.
3749 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3750 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3751 entries with non-lazy PLT layout. Don't fill the second and third
3752 slots in the PLT entry if there is no PLT0.
3753 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3754 if there is no PLT0. Set sh_entsize on the .plt.got section.
3755 (compare_relocs): New.
3756 (elf_x86_64_plt_type): Likewise.
3757 (elf_x86_64_plt): Likewise.
3758 (elf_x86_64_nacl_plt): New. Forward declaration.
3759 (elf_x86_64_get_plt_sym_val): Removed.
3760 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3761 against all dynamic relocations.
3762 (elf_x86_64_link_setup_gnu_properties): New function.
3763 (elf_backend_create_dynamic_sections): Updated.
3764 (elf_backend_setup_gnu_properties): New.
3765 (elf_x86_64_nacl_plt): New.
3766 (elf_x86_64_nacl_arch_bed): Updated.
3768 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3770 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3771 (LAZY_PLT_ENTRY_SIZE): This.
3772 (NON_LAZY_PLT_ENTRY_SIZE): New.
3773 (elf_i386_plt0_entry): Renamed to ...
3774 (elf_i386_lazy_plt0_entry): This.
3775 (elf_i386_plt_entry): Renamed to ...
3776 (elf_i386_lazy_plt_entry): This.
3777 (elf_i386_pic_plt0_entry): Renamed to ...
3778 (elf_i386_pic_lazy_plt0_entry): This.
3779 (elf_i386_pic_plt_entry): Renamed to ...
3780 (elf_i386_pic_lazy_plt_entry): This.
3781 (elf_i386_got_plt_entry): Renamed to ...
3782 (elf_i386_non_lazy_plt_entry): This.
3783 (elf_i386_pic_got_plt_entry): Renamed to ...
3784 (elf_i386_pic_non_lazy_plt_entry): This.
3785 (elf_i386_eh_frame_plt): Renamed to ...
3786 (elf_i386_eh_frame_lazy_plt): This.
3787 (elf_i386_eh_frame_plt_got): Renamed to ...
3788 (elf_i386_eh_frame_non_lazy_plt): This.
3789 (elf_i386_plt_layout): Renamed to ...
3790 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3791 eh_frame_plt_got_size.
3792 (elf_i386_non_lazy_plt_layout): New.
3793 (elf_i386_plt_layout): Likewise.
3794 (elf_i386_non_lazy_plt): Likewise.
3795 (GET_PLT_ENTRY_SIZE): Removed.
3796 (elf_i386_plt): Renamed to ...
3797 (elf_i386_lazy_plt): This.
3798 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3799 (elf_i386_arch_bed): Updated.
3800 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3801 (elf_i386_create_dynamic_sections): Removed.
3802 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3803 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3804 (elf_i386_adjust_dynamic_symbol): Updated.
3805 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3806 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3807 size for PLT0 if there is no PLT0.
3808 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3809 output section is discarded only if GOT isn't empty.
3810 (elf_i386_relocate_section): Updated. Properly get PLT index
3811 if there is no PLT0.
3812 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3813 second and third slots in the PLT entry if there is no PLT0.
3814 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3815 if there is no PLT0. Set sh_entsize on the .plt.got section.
3816 (elf_i386_nacl_plt): Forward declaration.
3817 (elf_i386_get_plt_sym_val): Removed.
3818 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3819 against all dynamic relocations.
3820 (elf_i386_link_setup_gnu_properties): New function.
3821 (elf_backend_create_dynamic_sections): Updated.
3822 (elf_backend_setup_gnu_properties): New.
3823 (elf_i386_nacl_plt): Updated.
3824 (elf_i386_nacl_arch_bed): Likewise.
3825 (elf_i386_vxworks_arch_bed): Likewise.
3827 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3829 * elflink.c (elf_output_implib): Remove executable flag from import
3831 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3832 library is a relocatable object file.
3834 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3837 * elf32-avr.c (avr_should_move_sym): New function.
3838 (avr_should_reduce_sym_size): Likewise.
3839 (avr_should_increase_sym_size): Likewise.
3840 (elf32_avr_relax_delete_bytes): Adjust symbol values
3841 and sizes by calling new functions.
3843 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3845 * config.bfd (riscv32-*): Enable rv64.
3847 2017-05-02 Alan Modra <amodra@gmail.com>
3850 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3851 rather than h->root.type == bfd_link_hash_new.
3852 (bfd_elf_record_link_assignment): Similarly, call
3853 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3855 2017-04-29 Alan Modra <amodra@gmail.com>
3858 * reloc.c (reloc_offset_in_range): New function.
3859 (bfd_perform_relocation, bfd_install_relocation): Use it.
3860 (_bfd_final_link_relocate): Likewise.
3862 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3864 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3865 before using .plt.got.
3866 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3868 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3870 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3871 instead of "+=" to update 0.
3873 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3875 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3876 .plt.got section here.
3877 (elf_i386_check_relocs): Don't create the .plt.got section.
3878 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3879 the .plt.got and .plt.bnd sections here.
3880 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3883 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3885 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3887 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3888 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3889 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3890 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3893 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3895 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3897 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3898 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3899 the first relocatable ELF input with GNU properties.
3901 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3903 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3904 VxWorks for non-PIC.
3906 2017-04-27 Alan Modra <amodra@gmail.com>
3908 * elf-bfd.h (struct elf_backend_data): Make asection param of
3909 elf_backend_eh_frame_address_size const.
3910 (_bfd_elf_eh_frame_address_size): Likewise.
3911 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3912 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3913 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3914 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3915 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3916 (next_cie_fde_offset): Constify params.
3917 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3919 2017-04-27 Alan Modra <amodra@gmail.com>
3921 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3922 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3923 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3925 (offset_adjust): New function.
3926 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3927 (adjust_eh_frame_local_symbols): Likewise.
3928 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3929 after changing anything. Return true if anything changed.
3930 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3931 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3933 2017-04-27 Alan Modra <amodra@gmail.com>
3935 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3938 2017-04-27 Alan Modra <amodra@gmail.com>
3940 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3941 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3942 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3943 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3944 for undef and undefweak dyn_relocs.
3945 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3946 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3947 (allocate_got, allocate_dynrelocs): Likewise.
3948 (ppc64_elf_relocate_section): Likewise.
3950 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3952 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3953 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3954 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3955 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3957 2017-04-26 Nick Clifton <nickc@redhat.com>
3960 * reloc.c (bfd_perform_relocation): Check for a negative address
3963 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3966 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3968 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3969 (elf_backend_always_renumber_dynsyms): Define.
3970 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3971 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3972 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3973 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3975 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3977 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3979 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3980 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3981 sections have been created.
3983 2017-04-26 Nick Clifton <nickc@redhat.com>
3986 * compress.c (bfd_init_section_compress_status): Check the return
3987 value from bfd_malloc.
3989 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3991 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3992 no_finish_dynamic_symbol.
3993 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3995 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3996 weak symbol, don't make it dynamic.
3997 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3998 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3999 relocation for GOT reference.
4000 (elf_x86_64_finish_dynamic_symbol): Abort if
4001 no_finish_dynamic_symbol isn't 0.
4003 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4006 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
4007 undefined weak symbol, don't make it dynamic.
4008 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
4009 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4010 relocation for R_386_GOT32.
4012 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
4015 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
4017 2017-04-23 Alan Modra <amodra@gmail.com>
4020 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
4021 * elf.c (lcomm_sym): New.
4022 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
4023 * bfd-in2.h: Regenerate.
4025 2017-04-23 Alan Modra <amodra@gmail.com>
4028 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
4029 parameters and comment.
4030 (_bfd_elf_get_reloc_section): Delete.
4031 (_bfd_elf_plt_get_reloc_section): Declare.
4032 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
4033 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4035 (_bfd_elf_get_reloc_section): ..here. Delete.
4036 (assign_section_numbers): Call elf_get_reloc_section.
4037 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4038 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4040 2017-04-23 Alan Modra <amodra@gmail.com>
4043 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4046 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4049 * elf32-i386.c (elf_i386_link_hash_entry): Add
4050 no_finish_dynamic_symbol.
4051 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4052 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4053 symbol, don't make it dynamic in PIE.
4054 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4055 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4056 relocation for R_386_GOT32
4057 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4060 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4064 * elflink.c (elf_link_add_object_symbols): Require
4065 --no-dynamic-linker with -E/--dynamic-list when creating
4068 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4070 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4073 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4075 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4076 dynamic symbol sorting.
4078 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4081 * elflink.c (elf_link_add_object_symbols): Preserve
4082 dynamic_ref_after_ir_def when restoring the symbol table for
4083 unneeded dynamic object.
4085 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4088 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4089 on on undefined IFUNC symbol in the second PLT.
4091 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4093 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4095 2017-04-19 Alan Modra <amodra@gmail.com>
4097 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4098 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4099 * elf32-ppc.c:Formatting.
4100 (ensure_undefweak_dynamic): Don't make dynamic when
4101 info->dynamic_undefined_weak is zero.
4102 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4103 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4104 not default visibility. Discard undef and undefweak
4106 (ppc_elf_relocate_section): Adjust to suit.
4107 * elf64-ppc.c: Formatting.
4108 (ensure_undefweak_dynamic): Don't make dynamic when
4109 info->dynamic_undefined_weak is zero.
4110 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4111 info->dynamic_undefined_weak. Discard them earlier.
4113 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4116 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4117 before generating the version definition section.
4119 2017-04-17 Alan Modra <amodra@gmail.com>
4121 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4122 state when a regular object file defines a symbol with
4123 incompatible type to that defined by an earlier shared lib.
4125 2017-04-13 Alan Modra <amodra@gmail.com>
4127 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4129 * elf32-arm.c: Likewise.
4130 * elf32-i386.c: Likewise.
4131 * elf32-mep.c: Likewise.
4132 * elf64-ia64-vms.c: Likewise.
4133 * elf64-x86-64.c: Likewise.
4134 * elflink.c: Likewise.
4135 * elfnn-ia64.c: Likewise.
4136 * elfxx-mips.c: Likewise.
4138 2017-04-13 Alan Modra <amodra@gmail.com>
4140 * aoutx.h: Use %B and %A in error messages throughout file.
4141 * aout-cris.c: Likewise.
4142 * archive.c: Likewise.
4143 * binary.c: Likewise.
4144 * coff-rs6000.c: Likewise.
4145 * coff-tic4x.c: Likewise.
4146 * coffcode.h: Likewise.
4147 * coffgen.c: Likewise.
4148 * cofflink.c: Likewise.
4149 * coffswap.h: Likewise.
4150 * cpu-arm.c: Likewise.
4151 * elf-eh-frame.c: Likewise.
4152 * elf-m10300.c: Likewise.
4154 * elf32-arc.c: Likewise.
4155 * elf32-arm.c: Likewise.
4156 * elf32-bfin.c: Likewise.
4157 * elf32-frv.c: Likewise.
4158 * elf32-iq2000.c: Likewise.
4159 * elf32-m32c.c: Likewise.
4160 * elf32-microblaze.c: Likewise.
4161 * elf32-nds32.c: Likewise.
4162 * elf32-rl78.c: Likewise.
4163 * elf32-rx.c: Likewise.
4164 * elf32-score.c: Likewise.
4165 * elf32-score7.c: Likewise.
4166 * elf32-sh64.c: Likewise.
4167 * elf32-v850.c: Likewise.
4168 * elf32-vax.c: Likewise.
4169 * elf32-visium.c: Likewise.
4170 * elf64-ia64-vms.c: Likewise.
4171 * elf64-mmix.c: Likewise.
4172 * elf64-sh64.c: Likewise.
4173 * elfcode.h: Likewise.
4174 * elfnn-aarch64.c: Likewise.
4175 * elfnn-ia64.c: Likewise.
4176 * elfxx-mips.c: Likewise.
4177 * hpux-core.c: Likewise.
4180 * linker.c: Likewise.
4181 * merge.c: Likewise.
4183 * oasys.c: Likewise.
4184 * pdp11.c: Likewise.
4185 * peXXigen.c: Likewise.
4186 * rs6000-core.c: Likewise.
4187 * vms-alpha.c: Likewise.
4188 * xcofflink.c: Likewise.
4190 2017-04-13 Alan Modra <amodra@gmail.com>
4192 * bfd.c (PRINT_TYPE): Define.
4193 (_doprnt): New function.
4194 (error_handler_internal): Use _doprnt.
4195 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4196 calls in their natural order, throughout file.
4197 * coff-mcore.c: Likewise.
4198 * coff-ppc.c: Likewise.
4199 * coff-tic80.c: Likewise.
4200 * cofflink.c: Likewise.
4201 * elf-s390-common.c: Likewise.
4203 * elf32-arm.c: Likewise.
4204 * elf32-i386.c: Likewise.
4205 * elf32-m32r.c: Likewise.
4206 * elf32-msp430.c: Likewise.
4207 * elf32-spu.c: Likewise.
4208 * elf64-ia64-vms.c: Likewise.
4209 * elf64-sparc.c: Likewise.
4210 * elf64-x86-64.c: Likewise.
4211 * elflink.c: Likewise.
4212 * elfnn-aarch64.c: Likewise.
4213 * elfnn-ia64.c: Likewise.
4214 * elfxx-mips.c: Likewise.
4216 2017-04-13 Alan Modra <amodra@gmail.com>
4218 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4219 branch veneers" error. Fix double space and format message.
4220 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4221 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4223 2017-04-13 Alan Modra <amodra@gmail.com>
4225 * bfd-in2.h: Regenerate.
4227 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4229 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4230 extra `\n' in warning/error messages.
4231 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4232 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4234 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4236 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4237 processor-specific properties with generic ELF target vector.
4239 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4241 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4242 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4243 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4244 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4246 (link_hash_newfunc): Initialize has_got_reloc and
4248 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4250 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4252 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4254 (_bfd_sparc_elf_fixup_symbol): New function.
4255 (allocate_dynrelocs): Don't allocate space for dynamic
4256 relocations and discard relocations against resolved undefined
4257 weak symbols in executable. Don't make resolved undefined weak
4258 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4259 relocation against undefined weak symbols in PIE.
4260 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4261 relocations against resolved undefined weak symbols in PIE
4262 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4263 without ynamic PLT/GOT relocations for resolved undefined weak
4265 Don't generate dynamic relocation against resolved undefined
4266 weak symbol in executable.
4267 (pie_finish_undefweak_symbol): New function.
4268 (_bfd_sparc_elf_finish_dynamic_sections): Call
4269 pie_finish_undefweak_symbol on all symbols in PIE.
4270 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4271 (_bfd_sparc_elf_fixup_symbol): New function.
4273 2017-04-10 Nick Clifton <nickc@redhat.com>
4275 * config.bfd: Remove ns32k from obsolete list.
4277 2017-04-10 Alan Modra <amodra@gmail.com>
4280 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4281 (special_sections_i): Likewise for .init_array.
4282 (special_sections_p): Likewise for .preinit_array.
4284 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4288 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4289 ELF_COMMON_DEF_P for common symbols.
4290 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4291 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4292 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4293 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4294 07492f668d2173da7a2bda3707ff0985e0f460b6.
4296 2017-04-07 Pedro Alves <palves@redhat.com>
4298 * opncls.c (bfd_get_debug_link_info): Rename to...
4299 (bfd_get_debug_link_info_1): ... this. Change type of second
4300 parameter to void pointer. Adjust.
4301 (bfd_get_debug_link_info): Reimplement on top of
4302 bfd_get_debug_link_info_1.
4303 (separate_debug_file_exists, separate_alt_debug_file_exists):
4304 Change type of second parameter to void pointer. Adjust.
4305 (get_func_type, check_func_type): Change type of second parameter
4307 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4308 the callback functions instead of passing the address of a local.
4309 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4310 find_separate_debug_file.
4311 (get_alt_debug_link_info_shim): Change type of second parameter to
4312 void pointer. Adjust.
4313 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4314 find_separate_debug_file.
4315 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4316 of second parameter to void pointer. Adjust.
4317 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4318 pointer local to find_separate_debug_file.
4320 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4322 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4323 external symbols with a definition.
4324 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4326 2017-04-07 Alan Modra <amodra@gmail.com>
4328 * po/SRC-POTFILES.in: Regenerate.
4330 2017-04-05 Alan Modra <amodra@gmail.com>
4332 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4335 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4337 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4338 numbers for DataDirectory entry indicies passed to
4341 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4343 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4344 each GNU_MBIND section and align GNU_MBIND section to page size.
4345 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4346 segment for each GNU_MBIND section.
4347 (_bfd_elf_init_private_section_data): Copy sh_info from input
4348 for GNU_MBIND section.
4350 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4352 * elfnn-riscv.c (GP_NAME): Delete.
4353 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4354 (_bfd_riscv_relax_lui): Likewise.
4356 2017-04-04 Nick Clifton <nickc@redhat.com>
4359 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4361 (bfd_elf_final_link): Only initialize the extended symbol index
4362 section if there are extended symbol tables to list.
4364 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4366 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4367 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4368 * configure.ac (elf): Add elf-properties.lo.
4369 * Makefile.in: Regenerated.
4370 * configure: Likewise.
4371 * elf-bfd.h (elf_property_kind): New.
4372 (elf_property): Likewise.
4373 (elf_property_list): Likewise.
4374 (elf_properties): Likewise.
4375 (_bfd_elf_parse_gnu_properties): Likewise.
4376 (_bfd_elf_get_property): Likewise.
4377 (_bfd_elf_link_setup_gnu_properties): Likewise.
4378 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4379 and setup_gnu_properties.
4380 (elf_obj_tdata): Add properties.
4381 * elf-properties.c: New file.
4382 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4383 (elf_i386_merge_gnu_properties): Likewise.
4384 (elf_backend_parse_gnu_properties): Likewise.
4385 (elf_backend_merge_gnu_properties): Likewise.
4386 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4387 (elf_x86_64_merge_gnu_properties): Likewise.
4388 (elf_backend_parse_gnu_properties): Likewise.
4389 (elf_backend_merge_gnu_properties): Likewise.
4390 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4391 (elf_backend_parse_gnu_properties): Likewise.
4392 (elf_backend_setup_gnu_properties): Likewise.
4393 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4394 elf_backend_merge_gnu_properties and
4395 elf_backend_setup_gnu_properties.
4397 2017-03-30 Pip Cet <pipcet@gmail.com>
4399 * elf32-wasm32.c: Add relocation code, two relocs.
4400 * reloc.c: Add wasm32 relocations.
4401 * libbfd.h: Regenerate.
4402 * bfd-in2.h: Regenerate.
4403 * bfd/po/bfd.pot: Regenerate.
4405 2017-03-29 Nick Clifton <nickc@redhat.com>
4408 * coff-bfd.h (struct coff_section_data): Add new fields:
4409 saved_bias and bias.
4410 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4411 computed for PE binaries.
4412 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4415 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4418 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4419 to handle a local symbol with a hash-symbol-entry; without PLT.
4420 Add BFD_ASSERT for an incidental case with GOT entry present.
4421 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4422 isn't forced-or-set local.
4424 2017-03-27 Pip Cet <pipcet@gmail.com>
4426 * wasm-module.c: New file to support WebAssembly modules.
4427 * wasm-module.h: New file to support WebAssembly modules.
4428 * doc/webassembly.texi: Start documenting wasm-module.c.
4429 * config.bfd: Add wasm_vec.
4430 * targets.c: Likewise.
4431 * configure.ac: Likewise.
4432 * Makefile.am: Add entries for wasm-module.c.
4433 * Makefile.in: Regenerate.
4434 * configure: Regenerate.
4435 * po/SRC-POTFILES.in: Regenerate.
4437 2017-03-27 Pip Cet <pipcet@gmail.com>
4439 * cpu-wasm32.c: New file to support wasm32 architecture.
4440 * elf32-wasm32.c: New file to support wasm32 architecture.
4441 * Makefile.am: Add wasm32 architecture.
4442 * archures.c: Likewise.
4443 * config.bfd: Likewise.
4444 * configure.ac: Likewise.
4445 * targets.c: Likewise.
4446 * Makefile.in: Regenerate.
4447 * bfd-in2.h: Regenerate.
4448 * configure: Regenerate.
4449 * po/SRC-POTFILES.in: Regenerate.
4451 2017-03-20 Alan Modra <amodra@gmail.com>
4454 * elf64-ppc.c (compare_symbols): Stabilize sort.
4456 2017-03-18 Alan Modra <amodra@gmail.com>
4458 * elf64-ppc.c (struct ppc_link_hash_table): Add
4459 local_ifunc_resolver and maybe_local_ifunc_resolver.
4460 (ppc_build_one_stub): Set flags on emitting dynamic
4461 relocation to ifunc.
4462 (ppc64_elf_relocate_section): Likewise.
4463 (ppc64_elf_finish_dynamic_symbol): Likewise.
4464 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4465 local dynamic relocs to ifuncs.
4466 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4467 local_ifunc_resolver and maybe_local_ifunc_resolver.
4468 (ppc_elf_relocate_section): Set flag on emitting dynamic
4469 relocation to ifuncs.
4470 (ppc_elf_finish_dynamic_symbol): Likewise.
4471 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4472 dynamic relocs to ifuncs.
4474 2017-03-13 Nick Clifton <nickc@redhat.com>
4477 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4478 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4479 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4480 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4481 * bfd-in2.h: Regenerate.
4482 * libbfd.h: Regenerate.
4483 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4485 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4486 (elfNN_aarch64_howto_table): Likewise.
4487 (aarch64_tls_transition_without_check): Likewise.
4488 (aarch64_reloc_got_type): Likewise.
4489 (elfNN_aarch64_final_link_relocate): Likewise.
4490 (elfNN_aarch64_tls_relax): Likewise.
4491 (elfNN_aarch64_relocate_section): Likewise.
4492 (elfNN_aarch64_gc_sweep_hook): Likewise.
4493 (elfNN_aarch64_check_relocs): Likewise.
4494 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4495 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4497 2017-03-11 Alan Modra <amodra@gmail.com>
4499 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4500 parameter is in fact used. Whitespace fixes.
4501 * elf64-ppc.c: Likewise.
4503 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4505 * rs6000-core.c (CORE_NEW): Simplify macro when
4506 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4508 2017-03-07 Alan Modra <amodra@gmail.com>
4512 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4515 2017-03-05 Alan Modra <amodra@gmail.com>
4517 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4518 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4519 (next_cie_fde_offset): New function.
4520 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4521 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4522 four bytes. Align CIEs to four or eight bytes depending on
4523 per_encoding_aligned8. Align FDEs according to their encoding.
4524 Pad last FDE to output section alignment.
4525 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4527 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4528 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4529 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4531 2017-03-02 Martin Bickel <binutils@ineranves.de>
4534 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4535 empty segments which have a zero filesz, but a non-zero memsz.
4537 2017-03-02 Alan Modra <amodra@gmail.com>
4539 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4541 2017-02-28 Alan Modra <amodra@gmail.com>
4543 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4544 (ppc64_elf_relocate_section): Likewise.
4546 2017-02-28 Alan Modra <amodra@gmail.com>
4549 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4550 rather than elf32_nios2_hash_table or elf_hash_table.
4551 (create_got_section): Likewise.
4552 (nios2_elf32_finish_dynamic_symbol): Likewise.
4553 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4554 (nios2_elf32_size_dynamic_sections): Likewise.
4555 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4556 vars. Use htab equivalents directly instead. Don't create
4557 all dynamic sections on needing just the GOT. Use a goto
4558 rather than a fall-through with reloc test. Ensure
4559 htab->dynobj is set when making dynamic sreloc section.
4560 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4561 equivalent directly instead. Don't segfault on looking for
4562 .dynamic when dynamic sections have not been created. Don't
4563 segfault on .got.plt being discarded.
4564 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4565 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4566 fixme and another not so relevant comment.
4567 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4568 already set, set hash table dynobj on creating .sbss.
4570 2017-02-28 Alan Modra <amodra@gmail.com>
4572 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4573 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4574 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4575 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4576 (ppc64_elf_relocate_section): Likewise.
4577 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4578 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4579 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4580 * libbfd.h: Regenerate.
4581 * bfd-in2.h: Regenerate.
4583 2017-02-28 Alan Modra <amodra@gmail.com>
4585 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4586 dynamic .data.rel.ro read-only.
4587 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4588 rather than section flags when deciding where copy reloc goes.
4589 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4590 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4591 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4592 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4593 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4594 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4595 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4596 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4597 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4598 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4599 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4600 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4601 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4602 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4603 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4604 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4605 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4606 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4607 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4609 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4611 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4612 `jalr $0, $25' instruction encoding.
4614 2017-02-27 Nick Clifton <nickc@redhat.com>
4617 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4618 generating a seg-fault when encountering a symbol that has been
4619 deleted by garbage collection.
4621 2017-02-25 Alan Modra <amodra@gmail.com>
4623 * elf32-arc.c (struct dynamic_sections): Delete.
4624 (enum dyn_section_types): Delete.
4625 (dyn_section_names): Delete.
4626 (arc_create_dynamic_sections): Delete.
4627 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4628 segfault on discarded .rela.plt section.
4629 (elf_arc_size_dynamic_sections): Formatting. Don't call
4630 arc_create_dynamic_sections. Don't allocate memory for sections
4631 handled by the generic linker. Correct code finding relocs in
4632 read-only sections. Set SEC_EXCLUDE on zero size .got,
4633 .got.plt, and .dynbss sections. Do set .interp for pies.
4635 2017-02-24 Andrew Waterman <andrew@sifive.com>
4637 * elfnn-riscv.c (GP_NAME): New macro.
4638 (riscv_global_pointer_value): Use it.
4639 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4640 output section, consider only that section's alignment.
4642 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4644 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4645 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4646 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4647 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4649 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4651 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4652 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4655 2017-02-23 Alan Modra <amodra@gmail.com>
4658 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4660 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4661 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4664 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4667 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4668 processing ahead of the call to `elf_gc_sweep_symbol'.
4670 2017-02-22 Nick Clifton <nickc@redhat.com>
4673 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4674 created section 4-byte alignment.
4676 2017-02-22 Alan Modra <amodra@gmail.com>
4678 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4679 on .got or .plt output section being discarded by script.
4680 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4683 2017-02-21 Alan Modra <amodra@gmail.com>
4685 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4686 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4688 2017-02-20 Alan Modra <amodra@gmail.com>
4691 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4692 if DT_RELSZ/DT_RELASZ is zero.
4694 2017-02-17 Nick Clifton <nickc@redhat.com>
4696 * compress.c (bfd_get_full_section_contents): Remember to reduce
4697 compressed size by the sizeof the compression header when
4698 decompressing the contents.
4700 2017-02-17 Pedro Alves <palves@redhat.com>
4702 * srec.c (Chunk): Rename to ...
4703 (_bfd_srec_len): ... this.
4704 (S3Forced): Rename to ...
4705 (_bfd_srec_forceS3): ... this.
4706 * objcopy.c: Adjust all references.
4708 2017-02-17 Pedro Alves <palves@redhat.com>
4710 * archive.c (bsd_write_armap): Rename to ...
4711 (_bfd_bsd_write_armap): ... this.
4712 (coff_write_armap): Rename to ...
4713 (_bfd_coff_write_armap): ... this.
4714 * libbfd-in.h (bsd_write_armap): Rename to ...
4715 (_bfd_bsd_write_armap): ... this.
4716 (coff_write_armap): Rename to ...
4717 (_bfd_coff_write_armap): ... this.
4718 * aout-target.h, aout-tic30.c: Adjust all users.
4719 * libbfd.h: Regenerate.
4721 2017-02-17 Pedro Alves <palves@redhat.com>
4723 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4724 (warn_deprecated): Rename to ...
4725 (_bfd_warn_deprecated): ... this.
4726 * libbfd.c (warn_deprecated): Rename to ...
4727 (_bfd_warn_deprecated): ... this.
4728 * bfd-in2.h: Regenerate.
4730 2017-02-17 Pedro Alves <palves@redhat.com>
4732 * bfdio.c (real_ftell): Rename to ...
4733 (_bfd_real_ftell): ... this.
4734 (real_fseek): Rename to ...
4735 (_bfd_real_fseek): ... this.
4736 (real_fopen): Rename to ...
4737 (_bfd_real_fopen): ... this.
4738 * libbfd-in.h (real_ftell): Rename to ...
4739 (_bfd_real_ftell): ... this.
4740 (real_fseek): Rename to ...
4741 (_bfd_real_fseek): ... this.
4742 (real_fopen): Rename to ...
4743 (_bfd_real_fopen): ... this.
4744 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4745 * libbfd.h: Regenerate.
4747 2017-02-17 Pedro Alves <palves@redhat.com>
4749 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4750 * libbfd.c (read_unsigned_leb128): Rename to ...
4751 (_bfd_read_unsigned_leb128): ... this.
4752 (read_signed_leb128): Rename to ...
4753 (_bfd_read_signed_leb128): ... this.
4754 (safe_read_leb128): Rename to ...
4755 (_bfd_safe_read_leb128): ... this.
4756 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4757 (_bfd_read_unsigned_leb128): ... this.
4758 (read_signed_leb128): Rename to ...
4759 (_bfd_read_signed_leb128): ... this.
4760 (safe_read_leb128): Rename to ...
4761 (_bfd_safe_read_leb128): ... this.
4762 * libbfd.h: Renegerate.
4764 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4766 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4767 before trying to fine matching file and line information.
4769 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4771 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4772 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4773 not match current bfd, then reload debug information. Record bfd
4774 we're loading debug info for in the stash. If we have debug
4775 informatin in the cache then perform section placement before
4778 2017-02-16 Alan Modra <amodra@gmail.com>
4781 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4782 * elfxx-target.h (elf_backend_no_page_alias): Define.
4783 (elfNN_bed): Init new field.
4784 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4785 ensure PT_LOAD segment starts on a new page.
4786 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4788 2017-02-16 Alan Modra <amodra@gmail.com>
4791 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4794 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4796 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4797 * bfd-in2.h: Regenerated.
4799 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4802 * elf32-i386.c (elf_i386_relocate_section): Allow
4803 "lea foo@GOT, %reg" in PIC.
4805 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4808 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4809 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4810 error against local IFUNC symbol without a base register for
4813 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4815 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4816 `%P: %H:' with `info->callbacks->einfo'.
4817 (ppc_elf_relocate_section): Likewise.
4818 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4819 (ppc64_elf_edit_toc): Likewise.
4820 (ppc64_elf_relocate_section): Likewise.
4822 2017-02-14 Alan Modra <amodra@gmail.com>
4824 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4825 --gc-keep-exported, and test versioned field of sym rather than
4826 looking for @ in name.
4828 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4830 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4833 2017-02-13 Nick Clifton <nickc@redhat.com>
4836 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4839 2017-02-07 Andrew Waterman <andrew@sifive.com>
4841 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4842 entry size if PLT header is written.
4844 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4846 Fix sparc64 dynamic relocation processing to use the dynamic
4848 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4849 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4852 2017-02-03 Nick Clifton <nickc@redhat.com>
4855 * coffcode.h (coff_write_object_contents): Enlarge size of
4856 s_name_buf in order to avoid compile time warning about possible
4858 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4859 32-bits of insn value before printing into buffer.
4861 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4863 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4864 `max_local_dynindx'.
4865 (mips_elf_sort_hash_table): Handle it.
4866 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4867 symbols bump up `max_local_dynindx' rather than
4868 `max_non_got_dynindx'.
4870 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4872 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4873 `min_got_dynindx', `max_unref_got_dynindx' and
4874 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4875 (mips_elf_sort_hash_table): Adjust accordingly.
4877 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4879 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4880 to access the hash table.
4882 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4884 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4885 non-NULL `htab' to the beginning.
4887 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4889 * elflink.c (elf_gc_sweep): Wrap overlong line.
4891 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4893 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4894 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4895 * elfxx-mips.c (mips_elf_link_hash_table): Add
4896 `ignore_branch_isa' member.
4897 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4898 in branch relocation calculation as an error if
4899 `ignore_branch_isa' has been set.
4900 (_bfd_mips_elf_insn32): Rename to...
4901 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4902 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4903 Handle the new parameter.
4905 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4907 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4908 local variable dynobj.
4911 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4912 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4913 executable from read-only sections into sdynrelro.
4914 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4915 dynamic relocs in sdynrelro.
4916 (elf_backend_want_dynrelro): Define.
4918 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4920 * config.bfd (*-*-rtemsaout*): Mark as removed.
4922 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4924 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4925 (arm-*-rtems*): Move to (arm*-*-eabi*).
4926 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4927 (m68-*-rtems*): Move to (m68*-*-elf*).
4929 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4931 * config.bfd (*-*-rtemscoff*): Mark as removed.
4933 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4936 * elflink.c (bfd_elf_record_link_assignment): Revert last
4937 change and don't ever clear `forced_local'. Set `mark'
4939 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4941 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4942 (bfd_elf_size_dynamic_sections): ... here.
4943 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4944 and set `mark' instead in `__tls_get_addr_opt' processing.
4945 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4947 2017-01-24 Alan Modra <amodra@gmail.com>
4949 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4950 where dynamic relocs are preferable. Allow ifunc too.
4951 (ensure_undefweak_dynamic): New function.
4952 (allocate_dynrelocs): Use it here. Move plt handling last and
4953 don't make symbols dynamic, simplifying loop. Only make undef
4954 weak symbols with GOT entries dynamic. Correct condition
4955 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4956 comments. Remove goto.
4957 (ppc_elf_relocate_section): Correct test for using dynamic
4958 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4959 to suit. Set up explicit tls_index entries and implicit GOT
4960 tls_index entries resolvable at link time for
4961 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4962 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4963 (ensure_undefweak_dynamic): New function.
4964 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4965 with GOT entries dynamic. Remove unnecessary test of
4966 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4967 (ppc64_elf_relocate_section): Correct test for using dynamic
4968 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4969 to suit. Set up explicit tls_index entries and implicit GOT
4970 tls_index entries resolvable at link time for __tls_get_addr_opt.
4971 Simplify expression to clear mem for prelink.
4973 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4975 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4977 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4979 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4980 (elf_backend_hash_symbol): Define.
4982 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4985 * elflink.c (bfd_elf_record_link_assignment): Clear any
4986 `forced_local' marking for DSO symbols that are not being
4989 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4991 * elfnn-riscv.c (riscv_elf_object_p): New function.
4993 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4996 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4998 (elf_x86_64_check_relocs): Create .eh_frame section for the
5000 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5001 .eh_frame section for the .plt.bnd section.
5002 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5003 for the .plt.bnd section.
5005 2017-01-12 Nick Clifton <nickc@redhat.com>
5008 * opncls.c (find_separate_debug_file): Add include_dirs
5009 parameter. Only include the directory part of the bfd's filename
5010 in search paths if include_dirs is true. Add a couple of extra
5011 locations for looking for debug files.
5012 ( bfd_follow_gnu_debuglink): Update invocation of
5013 find_separate_debug_file.
5014 (bfd_follow_gnu_debugaltlink): Likewise.
5015 (get_build_id): New function: Finds the build-id of the given bfd.
5016 (get_build_id_name): New function: Computes the name of the
5017 separate debug info file for a bfd, based upon its build-id.
5018 (check_build_id_file): New function: Checks to see if a separate
5019 debug info file exists at the given location, and that its
5020 build-id matches that of the original bfd.
5021 (bfd_follow_build_id_debuglink): New function: Finds a separate
5022 debug info file for a given bfd by using the build-id method.
5023 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
5024 method of locating a separate debug info file before using the
5026 * bfd-in2.h: Regenerate.
5028 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
5031 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
5032 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
5033 elf_x86_64_eh_frame_plt_got.
5034 (elf_x86_64_size_dynamic_sections): Get unwind info from
5035 elf_x86_64_bnd_arch_bed for the BND PLT.
5037 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5039 * config.bfd: Add entries for i686-redox and x86_64-redox.
5041 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5043 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5045 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5046 .eh_frame section to 4 bytes for x32.
5047 (elf_x86_64_check_relocs): Likewise.
5049 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5052 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5053 (PLT_GOT_FDE_LENGTH): Likewise.
5054 (elf_i386_plt_layout): Add eh_frame_plt_got and
5055 eh_frame_plt_got_size.
5056 (elf_i386_plt): Updated.
5057 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5058 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5059 (elf_i386_size_dynamic_sections): Allocate and initialize
5060 .eh_frame section for .plt.got.
5061 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5063 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5064 eh_frame_plt_got_size.
5065 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5066 (PLT_GOT_FDE_LENGTH): Likewise.
5067 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5068 eh_frame_plt_got_size.
5069 (elf_x86_64_arch_bed): Updated.
5070 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5071 eh_frame_plt_got_size.
5072 (elf_x86_64_nacl_arch_bed): Likewise.
5073 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5074 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5075 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5076 .eh_frame section for .plt.got.
5077 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5080 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5082 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5083 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5085 2017-01-09 Nick Clifton <nickc@redhat.com>
5087 * dwarf2.c (lookup_address_in_function_table): Return early if
5088 there are no functions in the given comp unit, or if the high
5089 address of the last function in the comp unit is less than the
5092 2017-01-09 Nick Clifton <nickc@redhat.com>
5095 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5096 message if there are too many symbols to load.
5098 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5100 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5101 if relocs are cached.
5103 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5106 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5107 for R_MICROBLAZE_GOTOFF_64.
5109 2017-01-03 Nick Clifton <nickc@redhat.com>
5111 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5112 warning about using a possibly uninitialised variable.
5114 2017-01-02 Alan Modra <amodra@gmail.com>
5116 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5117 (allocate_plt_static, allocate_dynrelocs): Use it.
5119 2017-01-02 Alan Modra <amodra@gmail.com>
5121 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5122 .PARISC.unwind section.
5124 2017-01-02 Alan Modra <amodra@gmail.com>
5127 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5128 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5129 indirect to GOT pointer relative code edit.
5131 2017-01-02 Alan Modra <amodra@gmail.com>
5133 Update year range in copyright notice of all files.
5135 For older changes see ChangeLog-2016
5137 Copyright (C) 2017 Free Software Foundation, Inc.
5139 Copying and distribution of this file, with or without modification,
5140 are permitted in any medium without royalty provided the copyright
5141 notice and this notice are preserved.
5147 version-control: never