1 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
3 * elf32-mips.c (elf32_mips_grok_psinfo): Extract core->pid.
4 * elf64-mips.c (elf64_mips_grok_psinfo): Likewise.
5 * elfn32-mips.c (elf32_mips_grok_psinfo): Likewise.
7 2017-11-08 Djordje Todorovic <djordje.todorovic@rt-rk.com>
9 * elf32-mips.c (elf32_mips_write_core_note): New function.
10 (elf_backend_write_core_note): New macro.
11 * elf64-mips.c (elf64_mips_write_core_note): New function.
12 (elf_backend_write_core_note): New macro.
13 * elfn32-mips.c (elf32_mips_write_core_note): New function.
14 (elf_backend_write_core_note): New macro.
16 2017-11-07 Alan Modra <amodra@gmail.com>
18 * elf64-ppc.c (ppc64_elf_build_stubs): Correct pluralization in
21 2017-11-07 Alan Modra <amodra@gmail.com>
23 * sysdep.h: Formatting, comment fixes.
24 (gettext, ngettext): Redefine when ENABLE_NLS.
25 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
26 (_): Define using gettext.
27 (textdomain, bindtextdomain): Use safer "do nothing".
28 * hosts/alphavms.h (textdomain, bindtextdomain): Likewise.
29 (ngettext, dngettext, dcngettext): Define when !ENABLE_NLS.
31 2017-11-05 Alan Modra <amodra@gmail.com>
34 * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
37 2017-11-05 Alan Modra <amodra@gmail.com>
40 * bfd.c (union _bfd_doprnt_args): New.
41 (PRINT_TYPE): Add FIELD arg. Take value from args.
42 (_bfd_doprnt): Replace ap parameter with args. Adjust all
43 PRINT_TYPE invocations and reading of format args to suit.
44 Move "%%" handling out of switch handling args. Support
45 positional parameters.
46 (_bfd_doprnt_scan): New function.
47 (error_handler_internal): Call _bfd_doprnt_scan and read args.
49 2017-11-04 Alan Modra <amodra@gmail.com>
51 * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
52 (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
53 (ppc_elf_relocate_section): Don't output a dynamic relocation
54 for IE GOT entries in an executable.
55 * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
56 (ppc64_elf_size_dynamic_sections): Likewise.
57 (ppc64_elf_relocate_section): Likewise.
59 2017-11-04 Alan Modra <amodra@gmail.com>
61 * elf32-ppc.c (readonly_dynrelocs): Delete info param. Update all
62 callers. Don't bother with SEC_ALLOC test. Return section pointer.
64 (maybe_set_textrel): ..here.
65 * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
66 (maybe_set_textrel): Call minfo to print textrel warning to map file.
68 2017-11-04 Alan Modra <amodra@gmail.com>
70 * elf32-hppa.c (enum _tls_type): Move.
71 (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
72 (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
73 Tidy tls_type handling. Set symbol tls_type for GOT_TLS_LDM too.
74 (got_entries_needed, got_relocs_needed): New functions.
75 (allocate_dynrelocs): Use them.
76 (elf32_hppa_size_dynamic_sections): Likewise.
77 (elf32_hppa_relocate_section): Delete bogus FIXME. Formatting.
78 Correct code emitting relocs on GD/IE got entries. Report an
79 error when a symbol has both normal and TLS GOT relocs.
81 2017-11-04 Alan Modra <amodra@gmail.com>
84 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
85 for plabels when non-pic.
86 (maybe_set_textrel): New function.
87 (readonly_dynrelocs): Move and rewrite.
88 (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy
89 relocs when def_regular or -z nocopyreloc. Handle non_got_ref
90 for functions. Expand non_got_ref comments.
91 (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
93 2017-11-03 H.J. Lu <hongjiu.lu@intel.com>
95 * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
96 Don't use func_pointer_refcount. Don't set plt.refcount nor
97 non_got_ref for function pointer reference.
98 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
99 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
100 func_pointer_refcount.
101 (_bfd_x86_elf_copy_indirect_symbol): Don't copy
102 func_pointer_refcount.
103 (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
104 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
105 (elf_x86_link_hash_entry): Remove func_pointer_refcount.
107 2017-11-03 Mingi Cho <mgcho.minic@gmail.com>
108 Nick Clifton <nickc@redhat.com>
111 * coffgen.c (_bfd_coff_get_external_symbols): Check for an
112 overlarge raw syment count.
113 (coff_get_normalized_symtab): Likewise.
115 2017-11-01 James Bowman <james.bowman@ftdichip.com>
117 * archures.c: Add bfd_mach_ft32b.
118 * cpu-ft32.c: Add arch_info_struct.
119 * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
121 (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
123 (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
124 (elf32_ft32_adjust_diff_reloc_value)
125 (elf32_ft32_adjust_reloc_if_spans_insn)
126 (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
127 (ft32_elf_relax_section): New function.
128 * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
129 * bfd-in2.h: Regenerate.
130 * libbfd.h: Regenerate.
132 2017-11-01 Nick Clifton <nickc@redhat.com>
135 * coffcode.h (coff_slurp_line_table): Check for an excessively
136 large line number count.
138 2017-11-01 Nick Clifton <nickc@redhat.com>
141 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
142 and offset in light of further possible bogus values.
144 2017-11-01 Alan Modra <amodra@gmail.com>
147 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
148 entry when just a dynamic reloc can serve. Ensure no dynamic
149 relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
150 Expand and move the non_got_ref comment.
151 * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
153 2017-11-01 Nick Clifton <nickc@redhat.com>
156 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
158 * cofflink.c (coff_link_check_archive_element): Skip non-COFF
159 members of an archive.
161 2017-10-31 Nick Clifton <nickc@redhat.com>
164 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
167 2017-10-30 Alan Modra <amodra@gmail.com>
169 * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
172 * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
174 (bfd_elf_gc_sections): Likewise.
176 2017-10-30 Alan Modra <amodra@gmail.com>
179 * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
180 ensure non_got_ref is not set due to debug references.
181 (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling. Use
182 SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
183 need for a plt entry.
184 (allocate_dynrelocs): Similarly for got entries. Tidy code discarding
185 dynamic relocs when pic. Remove bogus code attempting to handle
187 (elf32_hppa_relocate_section): Similarly. Delete resolved_to_zero
189 (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
190 and SYMBOL_REFERENCES_LOCAL in GOT handling.
192 2017-10-28 Alan Modra <amodra@gmail.com>
195 * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
196 * elf32-hppa.c (elf_backend_relocs_compatible): Define.
197 * elf32-ppc.c (elf_backend_relocs_compatible): Define.
198 * elf64-ppc.c (elf_backend_relocs_compatible): Define.
200 2017-10-25 Alan Modra <amodra@gmail.com>
202 * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
203 optionally prefixed with "_".
204 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
206 2017-10-24 Andrew Waterman <andrew@sifive.com>
208 * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
211 2017-10-24 Renlin Li <renlin.li@arm.com>
214 * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
216 2017-10-23 Nick Clifton <nickc@redhat.com>
219 * elflink.c (elf_link_output_extsym): Keep global undefined
220 symbols if they have been marked as needed.
222 2017-10-23 Maciej W. Rozycki <macro@imgtec.com>
224 * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
226 (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
227 `_bfd_mips_elf_mkobject'.
229 2017-10-22 Hans-Peter Nilsson <hp@axis.com>
232 * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
234 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
236 * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
237 (riscv_pcgp_lo_reloc): Likewise.
238 (riscv_pcgp_relocs): Likewise.
239 (riscv_init_pcgp_relocs): New function.
240 (riscv_free_pcgp_relocs): Likewise.
241 (riscv_record_pcgp_hi_reloc): Likewise.
242 (riscv_record_pcgp_lo_reloc): Likewise.
243 (riscv_delete_pcgp_hi_reloc): Likewise.
244 (riscv_use_pcgp_hi_reloc): Likewise.
245 (riscv_record_pcgp_lo_reloc): Likewise.
246 (riscv_find_pcgp_lo_reloc): Likewise.
247 (riscv_delete_pcgp_lo_reloc): Likewise.
248 (_bfd_riscv_relax_pc): Likewise.
249 (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
250 via the new functions above.
252 2017-10-19 Palmer Dabbelt <palmer@dabbelt.com>
254 * elfnn-riscv.c (R_RISCV_DELETE): New define.
255 (_bfd_riscv_relax_delete): New function.
256 (perform_relocation): Handle R_RISCV_DELETE.
257 (_bfd_riscv_relax_section): Likewise.
259 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
262 * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
263 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
264 bfd_link_executable for TLS check.
265 (tilegx_elf_check_relocs): Likewise.
266 (allocate_dynrelocs): Likewise.
267 (tilegx_elf_relocate_section): Likewise.
269 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
272 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
273 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
274 bfd_link_executable for TLS check.
275 (tilepro_elf_check_relocs): Likewise.
276 (allocate_dynrelocs): Likewise.
277 (tilepro_elf_relocate_section): Likewise.
279 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
282 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
283 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
284 bfd_link_executable for TLS check.
285 (_bfd_sparc_elf_check_relocs): Likewise.
286 (allocate_dynrelocs): Likewise.
287 (_bfd_sparc_elf_relocate_section): Likewise.
289 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
291 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
292 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
293 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
295 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
297 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
298 indirect and warning symbols.
300 2017-10-17 Alan Modra <amodra@gmail.com>
303 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
304 against size left rather than comparing pointers. Reorganise loop.
306 2017-10-17 Alan Modra <amodra@gmail.com>
309 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
310 and error for any other size that doesn't cover the header word.
312 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
314 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
315 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
316 (elf_backend_gc_sweep_hook): Likewise.
317 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
318 (bfinfdpic_gc_sweep_hook): Likewise.
319 (elf_backend_gc_sweep_hook): Likewise.
320 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
321 (elf_backend_gc_sweep_hook): Likewise.
322 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
323 (elf_backend_gc_sweep_hook): Likewise.
324 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
325 (elf_backend_gc_sweep_hook): Likewise.
326 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
327 (elf_backend_gc_sweep_hook): Likewise.
328 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
329 (elf_backend_gc_sweep_hook): Likewise.
330 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
332 (elf_m68k_remove_got_entry_type): Removed.
333 (elf_m68k_find_got_entry_ptr): Likewise.
334 (elf_m68k_remove_got_entry): Likewise.
335 (elf_m68k_gc_sweep_hook): Likewise.
336 (elf_backend_gc_sweep_hook): Likewise.
337 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
338 (elf_backend_gc_sweep_hook): Likewise.
339 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
340 (elf_backend_gc_sweep_hook): Likewise.
341 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
342 (elf_backend_gc_sweep_hook): Likewise.
343 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
344 (elf_backend_gc_sweep_hook): Likewise.
345 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
346 (elf_backend_gc_sweep_hook): Likewise.
347 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
348 (elf_backend_gc_sweep_hook): Likewise.
349 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
350 (elf_backend_gc_sweep_hook): Likewise.
351 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
352 (elf_backend_gc_sweep_hook): Likewise.
353 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
354 (elf_backend_gc_sweep_hook): Likewise.
355 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
356 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
357 (elf_backend_gc_sweep_hook): Likewise.
358 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
359 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
360 (elf_backend_gc_sweep_hook): Likewise.
361 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
362 (elf_backend_gc_sweep_hook): Likewise.
363 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
364 (elf_backend_gc_sweep_hook): Likewise.
365 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
366 (elf_backend_gc_sweep_hook): Likewise.
367 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
368 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
369 (elf_backend_gc_sweep_hook): Likewise.
370 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
371 (ppc64_elf_gc_sweep_hook): Likewise.
372 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
373 (elf_backend_gc_sweep_hook): Likewise.
374 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
375 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
376 * elflink.c (elf_link_add_object_symbols): Don't call
377 _bfd_elf_link_check_relocs here.
378 (gc_sweep_hook_fn): Removed.
379 (elf_gc_sweep): Remove gc_sweep_hook.
380 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
381 (elf_backend_gc_sweep_hook): Likewise.
382 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
383 (elf_backend_gc_sweep_hook): Likewise.
384 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
385 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
386 (elf_backend_gc_sweep_hook): Likewise.
387 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
388 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
389 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
390 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
391 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
392 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
394 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
396 * elf32-i386.c (elf_i386_backend_data): Removed.
397 (get_elf_i386_backend_data): Likewise.
398 (elf_i386_arch_bed): Replace elf_i386_backend_data with
399 elf_x86_backend_data.
400 (elf_i386_get_synthetic_symtab): Likewise.
401 (elf_i386_nacl_arch_bed): Likewise.
402 (elf_i386_vxworks_arch_bed): Likewise.
403 (elf_i386_relocate_section): Check target_os instead of
405 (elf_i386_finish_dynamic_symbol): Likewise.
406 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
407 Check target_os instead of is_vxworks.
408 (elf_i386_link_setup_gnu_properties): Remove normal_target and
409 is_vxworks. Initialize plt0_pad_byte.
410 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
411 (get_elf_x86_64_arch_data): Likewise.
412 (get_elf_x86_64_backend_data): Likewise.
413 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
414 elf_x86_backend_data.
415 (elf_x86_64_get_synthetic_symtab): Likewise.
416 (elf_x86_64_nacl_arch_bed): Likewise.
417 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
418 normal_target. Initialize plt0_pad_byte.
419 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
420 instead of is_vxworks.
421 (_bfd_x86_elf_size_dynamic_sections): Likewise.
422 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
423 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
424 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
425 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
426 Update normal_target. Set up plt0_pad_byte. Check target_os
427 instead of is_vxworks.
428 * elfxx-x86.h (elf_x86_target_os): New.
429 (elf_x86_backend_data): Likewise.
430 (get_elf_x86_backend_data): Likewise.
431 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
433 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
436 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
438 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
439 _bfd_x86_elf_finish_dynamic_sections.
440 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
441 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
443 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
446 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
449 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
450 hide symbol which was forced to be dynamic.
452 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
455 * elf32-cris.c (cris_elf_relocate_section): Don't generate
456 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
457 (cris_elf_check_relocs): Don't allocate dynamic relocation
458 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
460 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
463 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
464 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
465 (sh_elf_relocate_section): Don't generate dynamic relocation if
466 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
468 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
471 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
472 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
473 (elf_s390_relocate_section): Don't generate dynamic relocation
474 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
475 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
476 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
477 (elf_s390_relocate_section): Don't generate dynamic relocation
478 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
480 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
483 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
484 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
485 (allocate_dynrelocs): Discard dynamic relocations if
486 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
488 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
491 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
492 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
494 (allocate_dynrelocs): Discard dynamic relocations if
495 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
497 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
500 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
501 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
502 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
503 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
504 (elf_m68k_relocate_section): Don't generate dynamic relocation
505 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
507 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
510 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
511 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
512 (allocate_dynrelocs): Discard dynamic relocations if
513 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
514 (elf32_hppa_relocate_section): Don't generate dynamic
515 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
517 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
520 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
521 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
522 (allocate_fptr): Don't allocate function pointer if
523 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
524 (allocate_dynrel_entries): Don't allocate dynamic relocation
525 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
526 (set_got_entry): Don't set GOT entry if
527 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
528 (set_pltoff_entry): Don't set PLTOFF entry if
529 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
530 (elfNN_ia64_relocate_section): Don't install dynamic relocation
531 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
533 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
536 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
537 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
538 (allocate_dynrelocs): Don't allocate dynamic relocations if
539 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
541 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
544 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
545 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
546 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
547 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
549 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
552 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
553 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
554 (tilepro_elf_relocate_section): Don't generate dynamic
555 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
556 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
557 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
558 (tilegx_elf_relocate_section): Don't generate dynamic
559 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
561 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
564 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
565 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
567 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
568 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
570 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
572 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
573 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
574 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
576 2017-10-12 James Bowman <james.bowman@ftdichip.com>
578 * bfd-in2.h: Regenerate.
579 * libbfd.h: Regenerate.
580 * elf32-ft32.c: Add HOWTO R_FT32_15.
581 * reloc.c: Add BFD_RELOC_FT32_15.
583 2017-10-12 Nick Clifton <nickc@redhat.com>
585 * reloc.c (enum bfd_reloc_status): Start values at 2.
586 * bfd-in2.h: Regenerate.
587 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
588 that a TRUE return indicates success. Compare the result of
589 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
590 (build_one_stub): Change sense of tests against aarch64_relocate
592 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
593 than FALSE, when an error is detected.
594 (elfNN_aarch64_final_link_relocate): Likewise.
596 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
598 * elf32-i386.c (elf_backend_hide_symbol): New.
599 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
600 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
601 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
603 2017-10-12 Alan Modra <amodra@gmail.com>
605 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
606 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
607 (bfd_elf_define_start_stop): Likewise.
609 2017-10-12 Alan Modra <amodra@gmail.com>
611 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
612 when executable rather than non-PIC.
613 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
614 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
616 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
618 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
620 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
621 (elf_external_linux_prpsinfo64_ugid32): ... this.
622 (swap_linux_prpsinfo32_out): Rename to...
623 (swap_linux_prpsinfo32_ugid32_out): ... this.
624 (elf_external_linux_prpsinfo64_ugid16): New structure.
625 (swap_linux_prpsinfo64_ugid16_out): New function.
626 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
627 (elf_backend_linux_prpsinfo64_ugid16): Define.
628 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
629 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
630 of the 64-bit Linux core PRPSINFO note.
631 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
633 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
635 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
637 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
638 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
639 (elf_external_ppc_linux_prpsinfo32)
640 (swap_ppc_linux_prpsinfo32_out): Move to...
641 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
642 (swap_linux_prpsinfo32_ugid32_out): ... these.
643 (elf_external_linux_prpsinfo32): Rename to...
644 (elf_external_linux_prpsinfo32_ugid16): ... this.
645 (swap_linux_prpsinfo32_out): Rename to...
646 (swap_linux_prpsinfo32_ugid16_out): ... this.
647 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
648 (elf_backend_linux_prpsinfo32_ugid16): Define.
649 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
650 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
651 of the 32-bit Linux core PRPSINFO note.
652 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
653 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
654 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
655 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
656 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
657 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
658 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
659 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
660 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
661 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
663 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
665 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
666 `gap' member ahead of `pr_flag'.
668 2017-10-11 Pedro Alves <palves@redhat.com>
670 * bfd.c (_doprnt): Rename to ...
671 (_bfd_doprnt): ... this.
672 (error_handler_internal): Adjust.
674 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
676 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
677 instead of incrementing it.
678 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
680 2017-10-10 Renlin Li <renlin.li@arm.com>
683 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
684 symbols into dynamic.
686 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
689 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
690 (riscv_elf_link_hash_table_create): Initialize max_alignment to
692 (_bfd_riscv_relax_section): Cache the max alignment of output
693 sections if possible.
695 2017-10-10 Alan Modra <amodra@gmail.com>
697 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
698 .opd whenever .opd is present and non-zero size. Move code
699 setting abiversion to/from output file earlier. Only set
700 u.opd.func_sec when --gc-sections. Read relocs and set up
701 u.opd.func_sec values here..
702 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
704 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
706 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
708 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
711 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
713 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
714 .interp section with "ld --no-dynamic-linker".
716 2017-10-09 Alan Modra <amodra@gmail.com>
719 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
720 funcinfo_hash_table and varinfo_hash_table.
722 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
724 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
725 in read-only section with minfo.
726 (sh_elf_size_dynamic_sections): Likewise.
728 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
730 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
733 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
735 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
736 this_hdr.sh_entsize only if section size > 0.
738 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
740 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
742 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
744 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
745 in read-only section with minfo.
746 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
748 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
750 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
753 2017-10-06 John Baldwin <jhb@FreeBSD.org>
755 * elf-bfd.h (struct elf_backend_data): Add
756 `elf_backend_grok_freebsd_prstatus'.
757 * elf.c (elfcore_grok_freebsd_note): Call
758 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
760 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
762 (elf_backend_grok_freebsd_prstatus): Define.
763 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
764 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
766 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
768 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
769 and has_non_got_reloc with zero_undefweak.
770 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
771 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
773 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
774 has_non_got_reloc with zero_undefweak.
775 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
776 has_got_reloc and has_non_got_reloc with zero_undefweak.
777 (elf_x86_link_hash_entry): Likewise.
779 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
781 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
782 (VERIFY_COPY_RELOC): Likewise.
784 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
786 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
787 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
788 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
790 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
792 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
793 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
794 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
796 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
798 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
799 * elf32-i386.c (elf_i386_relocate_section): Use it.
800 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
802 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
804 * elf32-i386.c (X86_SIZE_TYPE_P): New.
805 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
806 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
807 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
808 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
810 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
812 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
813 (PLT_LOCAL_IFUNC_P): Likewise.
814 * elf32-i386.c (elf_i386_relocate_section): Use them.
815 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
817 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
819 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
820 * elf32-i386.c (elf_i386_relocate_section): Use it.
821 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
823 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
825 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
826 * elf32-i386.c (elf_i386_relocate_section): Use it.
827 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
829 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
831 * elf32-i386.c (X86_PCREL_TYPE_P): New.
832 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
833 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
834 (X86_PCREL_TYPE_P): This.
835 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
836 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
837 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
839 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
841 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
843 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
844 * elf32-i386.c (elf_i386_tls_transition): Use it.
845 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
847 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
849 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
850 Dump dynamic relocation in read-only section with minfo if
852 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
853 (maybe_set_textrel): Likewise.
854 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
855 read-only section with minfo.
857 2017-10-05 John Baldwin <jhb@FreeBSD.org>
859 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
861 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
863 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
864 in read-only section with minfo.
865 (tilepro_elf_size_dynamic_sections): Likewise.
866 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
867 (tilegx_elf_size_dynamic_sections): Likewise.
869 2017-10-05 Pedro Alves <palves@redhat.com>
872 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
873 ellipsis parameter. Split out bfd_error_on_input code to..
874 (bfd_set_input_error): .. New function.
875 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
876 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
877 * bfd-in2.h: Regenerate.
879 2017-10-05 Alan Modra <amodra@gmail.com>
881 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
882 fini_array error value.
884 2017-10-05 Alan Modra <amodra@gmail.com>
887 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
889 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
891 (elf_fake_sections): Adjust calls. Exit immediately on failure.
892 (bfd_elf_set_group_contents): Add associated reloc section indices
895 2017-10-04 Alan Modra <amodra@gmail.com>
897 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
898 classify symbols for ELFv2.
900 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
903 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
904 undergoes default promotion.
905 * bfd-in2.h: Regenerate.
907 2017-10-02 Alan Modra <amodra@gmail.com>
909 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
910 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
912 2017-10-01 Alan Modra <amodra@gmail.com>
915 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
916 (add_line_info): Always put end_sequence last.
918 2017-10-01 Alan Modra <amodra@gmail.com>
921 * dwarf2.c (read_section): Allocate buffer with extra byte for
922 bfd_simple_get_relocated_section_contents rather than copying
925 2017-09-29 Alan Modra <amodra@gmail.com>
927 * merge.c (merge_strings): Return FALSE on malloc failure.
928 (_bfd_merge_sections): Return failures from record_section and
931 2017-09-28 Alan Modra <amodra@gmail.com>
934 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
935 a case where plugin_notice isn't called.
937 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
939 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
942 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
945 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
946 output_bfd to info->callbacks->minfo.
948 2017-09-26 Nick Clifton <nickc@redhat.com>
951 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
952 assertion failure if elf_x86_64_rtype_to_howto has already issued
955 2017-09-26 Alan Modra <amodra@gmail.com>
958 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
961 2017-09-26 Nick Clifton <nickc@redhat.com>
964 * dwarf2.c (read_formatted_entries): Fail early if we know that
965 the loop parsing data entries will overflow the end of the
968 2017-09-26 Alan Modra <amodra@gmail.com>
971 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
972 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
973 to stash->info_ptr_memory, and check die_ref is within that memory.
974 Set info_ptr_end correctly when another CU is refd. Check die_ref
975 for DW_FORM_ref4 etc. is within CU.
977 2017-09-26 Alan Modra <amodra@gmail.com>
980 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
981 (read_formatted_entries): Init "fe".
982 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
984 2017-09-26 Alan Modra <amodra@gmail.com>
987 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
988 bounds in inner loop.
990 2017-09-25 Alan Modra <amodra@gmail.com>
993 * dwarf1.c (parse_die): Sanity check pointer against section limit
994 before dereferencing.
995 (parse_line_table): Likewise.
997 2017-09-25 Alan Modra <amodra@gmail.com>
1000 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
1002 (parse_comp_unit): Likewise.
1004 2017-09-25 Alan Modra <amodra@gmail.com>
1007 * dwarf2.c (read_formatted_entries): Error on format_count zero.
1009 2017-09-24 Alan Modra <amodra@gmail.com>
1012 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
1013 within section bounds.
1015 2017-09-24 Alan Modra <amodra@gmail.com>
1018 * dwarf2.c (decode_line_info): Properly free line sequences on error.
1020 2017-09-24 Alan Modra <amodra@gmail.com>
1023 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
1024 pname param. Return status. Make name const. Don't abort,
1025 return an error. Formatting. Exit if current info_ptr matches
1026 orig_info_ptr. Update callers.
1027 (scan_unit_for_symbols): Start at nesting_level of zero. Make
1028 nested_funcs an array of structs for extensibility. Formatting.
1030 2017-09-24 Alan Modra <amodra@gmail.com>
1033 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1034 rather than dividing by zero.
1036 2017-09-24 Alan Modra <amodra@gmail.com>
1039 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1041 2017-09-24 Alan Modra <amodra@gmail.com>
1044 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1046 2017-09-24 Alan Modra <amodra@gmail.com>
1049 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1050 SHT_GNU_verneed section for sanity. Don't zalloc memory for
1053 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1056 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1059 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
1062 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1063 -1 if bfd_canonicalize_dynamic_reloc returns 0.
1065 2017-09-22 Pedro Alves <palves@redhat.com>
1066 Alan Modra <amodra@gmail.com>
1068 * version.h: Add comment.
1070 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
1072 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1073 NT_S390_GS_BC, correct the previously swapped invocations of
1074 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1076 2017-09-19 Alan Modra <amodra@gmail.com>
1079 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1082 2017-09-19 Alan Modra <amodra@gmail.com>
1085 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1086 symbols before calculating verrefs. Don't renumber dynsyms
1087 after gc. Exclude .gnu.version when zero or one dynsym.
1088 Localize some vars and reindent.
1090 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
1093 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1094 return from bfd_canonicalize_dynamic_reloc.
1096 2017-09-15 Alan Modra <amodra@gmail.com>
1099 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1100 overflows bfd_size_type.
1102 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
1105 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1106 to indicate if conversion is performed.
1107 (elf_i386_check_relocs): Cache section contents and relocations
1108 if conversion is performed.
1109 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1110 contents and relocations if conversion is performed.
1112 2017-09-14 Nick Clifton <nickc@redhat.com>
1115 * peXXigen.c (pe_print_idata): Extend check for HintName vector
1118 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
1120 * elfxx-x86.h: Fix a typo in comments.
1122 2017-09-09 Kamil Rytarowski <n54@gmx.com>
1124 * elf32-nds32.c: Rename __BIT() to N32_BIT().
1126 2017-09-09 Alan Modra <amodra@gmail.com>
1128 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1131 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1133 * elf32-i386.c (elf_i386_relocate_section): Update usage of
1134 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1135 (elf_i386_finish_dynamic_symbol): Likewise.
1136 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1137 (elf_x86_64_finish_dynamic_symbol): Likewise.
1138 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1139 (_bfd_x86_elf_fixup_symbol): Likewise.
1141 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1143 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1144 check has_non_got_reloc.
1146 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
1149 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1150 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1151 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1152 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1153 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1154 and linker_def on __ehdr_start if it is referenced and not
1156 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1157 and return TRUE when building executable, if a symbol has
1158 non-GOT/non-PLT relocations in text section or there is no
1160 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1162 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1164 * elfxx-x86.h: Update comments.
1166 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
1168 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1169 elf_x86_plt_layout_table with elf_x86_init_table.
1170 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1172 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1174 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1175 (elf_x86_init_table): This.
1176 (_bfd_x86_elf_link_setup_gnu_properties): Replace
1177 elf_x86_plt_layout_table with elf_x86_init_table.
1179 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1181 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1182 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1183 * configure: Regenerated.
1184 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1185 and r_sym fields of plt_layout.
1186 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1188 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1189 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
1190 r_info nor r_sym fields.
1191 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1193 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1195 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1197 * (_bfd_riscv_relax_align): Call bfd_set_error and
1198 print an error message when unable to relax a .align directive.
1200 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
1202 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1203 (riscv_record_pcrel_hi_reloc): Add absolute argument.
1204 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1205 R_RISCV_PCREL_HI20 relocs, and pass the result to
1206 riscv_record_pcrel_hi_reloc.
1208 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
1210 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1211 r_type_p. Remove the converted argument. Replace
1212 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
1213 the new relocation type via r_type_p.
1214 (elf_i386_relocate_section): Likewise.
1215 (elf_i386_finish_dynamic_symbol): Likewise.
1216 (need_convert_load): Removed.
1217 (check_relocs_failed): Updated.
1218 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1219 instead of setting need_convert_load.
1220 (_bfd_i386_elf_convert_load): Removed.
1221 * elf64-x86-64.c (need_convert_load): Removed.
1222 (check_relocs_failed): Updated.
1223 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1224 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1225 Return the new relocation type via r_type_p.
1226 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1227 instead of setting need_convert_load.
1228 (elf_x86_64_check_relocs): Don't check PIC if relocation has
1230 (_bfd_x86_64_elf_convert_load): Removed.
1231 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1232 with SYMBOL_REFERENCES_LOCAL_P.
1233 (elf_x86_64_finish_dynamic_symbol): Likewise.
1234 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1236 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1237 (_bfd_x86_elf_link_symbol_references_local): New function.
1238 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1239 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1240 SYMBOL_REFERENCES_LOCAL_P.
1241 (elf_x86_link_hash_entry): Add local_ref.
1242 (elf_x86_link_hash_table): Remove convert_load.
1243 (_bfd_i386_elf_convert_load): Removed.
1244 (_bfd_x86_64_elf_convert_load): Likewise.
1245 (_bfd_x86_elf_link_symbol_references_local): New.
1247 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1249 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1250 (elf_x86_64_info_to_howto): Get the real relocation type by
1251 masking out R_X86_64_converted_reloc_bit.
1252 (elf_x86_64_check_tls_transition): Get the real relocation type
1253 by masking out R_X86_64_converted_reloc_bit.
1254 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1255 instead of setting converted_reloc.
1256 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1257 instead of converted_reloc. Get the real relocation type by
1258 masking out R_X86_64_converted_reloc_bit.
1259 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1260 R_X86_64_converted_reloc_bit is valid.
1261 * elfxx-x86.h (converted_reloc): Removed.
1263 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
1265 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1266 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
1267 to get the relocation type again.
1268 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1269 r_type when calling elf_x86_64_tls_transition. Don't use
1270 ELF32_R_TYPE to get the relocation type again.
1272 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1274 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1277 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1279 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1280 argument. Don't check relocation overflow. Avoid relocation
1281 overflow if --no-relax is used. Set converted_reloc on symbol
1282 if a GOTPCREL relocation is converted.
1283 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1284 --no-relax if GOTPCREL relocation conversion leads to relocation
1286 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1288 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1289 Edmar Wienskoski <edmar.wienskoski@nxp.com
1291 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1292 (ppc_elf_check_relocs): Handle it.
1293 (ppc_elf_vle_split20): New function.
1294 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1296 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1299 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1300 for x86-64 if GOT_TLS_GDESC_P is true.
1302 2017-09-03 Alan Modra <amodra@gmail.com>
1305 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1307 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1309 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1310 tls_get_addr for x86-64 in one place.
1312 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1314 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1315 with elfxx-x86.lo for 64-bit BFD.
1316 * configure: Regenerated.
1318 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1320 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1321 (_bfd_i386_elf_convert_load): This. Remove static.
1322 (elf_i386_size_dynamic_sections): Removed.
1323 (elf_backend_size_dynamic_sections): Likewise.
1324 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1325 (_bfd_x86_64_elf_convert_load): This. Remove static.
1326 (elf_x86_64_size_dynamic_sections): Removed.
1327 (elf_backend_size_dynamic_sections): Likewise.
1328 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1329 (elf_x86_allocate_dynrelocs): This. Make it static.
1330 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1331 (elf_x86_allocate_local_dynreloc): This. Make it static.
1332 (elf_i386_is_reloc_section): New function.
1333 (elf_x86_64_is_reloc_section): Likewise.
1334 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1335 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1336 Rearrange got_entry_size initialization.
1337 (_bfd_x86_elf_size_dynamic_sections): New function.
1338 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1339 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1340 (_bfd_i386_elf_convert_load): New.
1341 (_bfd_x86_64_elf_convert_load): Likewise.
1342 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1343 (elf_backend_size_dynamic_sections): Likewise.
1344 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1345 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1347 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1349 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1352 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1354 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1355 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1357 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1359 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1360 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1361 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1362 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1363 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1364 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1366 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1368 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1369 (elf_i386_allocate_local_dynrelocs): Likewise.
1370 (elf_i386_size_dynamic_sections): Replace
1371 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1372 with _bfd_x86_elf_allocate_dynrelocs and
1373 _bfd_x86_elf_allocate_local_dynrelocs.
1374 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1375 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1376 (elf_x86_64_size_dynamic_sections): Replace
1377 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1378 with _bfd_x86_elf_allocate_dynrelocs and
1379 _bfd_x86_elf_allocate_local_dynrelocs.
1380 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1381 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1382 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1383 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1385 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1387 * elf32-i386.c (is_i386_elf): Removed.
1388 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1389 (elf_i386_size_dynamic_sections): Likewise.
1390 (elf_i386_relocate_section): Likewise.
1391 * elf64-x86-64.c (is_x86_64_elf): Removed.
1392 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1394 (elf_x86_64_size_dynamic_sections): Likewise.
1395 (elf_x86_64_relocate_section): Likewise.
1396 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1398 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1401 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1403 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1404 (elf_i386_allocate_dynrelocs): Replace
1405 elf_i386_compute_jump_table_size with
1406 elf_x86_compute_jump_table_size.
1407 (elf_i386_size_dynamic_sections): Likewise.
1408 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1409 (elf_x86_64_allocate_dynrelocs): Replace
1410 elf_x86_64_compute_jump_table_size with
1411 elf_x86_compute_jump_table_size.
1412 (elf_x86_64_size_dynamic_sections): Likewise.
1413 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1415 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1416 (elf_x86_compute_jump_table_size): New.
1418 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1420 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1422 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1423 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1425 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1427 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1428 with htab->is_vxworks.
1429 (elf_i386_size_dynamic_sections): Likewise.
1430 (elf_i386_relocate_section): Likewise.
1431 (elf_i386_finish_dynamic_symbol): Likewise.
1432 (elf_i386_finish_dynamic_sections): Likewise.
1434 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1436 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1437 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1438 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1439 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1440 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1441 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1442 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1443 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1445 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1448 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1449 ELF_COMMON_DEF_P for common symbols.
1451 2017-09-02 Alan Modra <amodra@gmail.com>
1453 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1454 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1455 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1457 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1459 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1460 (elf_backend_gc_mark_hook): Likewise.
1461 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1462 (elf_backend_gc_mark_hook): Likewise.
1463 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1464 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1465 (elf_backend_gc_mark_hook): Likewise.
1467 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1469 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1470 (elf_backend_adjust_dynamic_symbol): Likewise.
1471 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1472 (elf_backend_adjust_dynamic_symbol): Likewise.
1473 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1474 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1475 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1476 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1477 (elf_backend_adjust_dynamic_symbol): Likewise.
1479 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1481 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1484 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1486 * elf32-i386.c (elf_i386_mkobject): Removed.
1487 (bfd_elf32_mkobject): Likewise.
1488 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1489 (bfd_elf64_mkobject): Likewise.
1490 (bfd_elf32_mkobject): Likewise.
1491 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1492 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1493 (bfd_elf64_mkobject): Likewise.
1494 (bfd_elf32_mkobject): Likewise.
1496 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1498 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1499 Call _bfd_x86_elf_link_setup_gnu_properties.
1500 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1501 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1503 (elf_x86_64_non_lazy_plt): Likewise.
1504 (elf_x86_64_lazy_bnd_plt): Likewise.
1505 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1506 (elf_x86_64_lazy_ibt_plt): Likewise.
1507 (elf_x32_lazy_ibt_plt): Likewise.
1508 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1509 (elf_x32_non_lazy_ibt_plt): Likewise.
1510 (elf_x86_64_nacl_plt): Likewise.
1511 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1512 _bfd_x86_elf_link_setup_gnu_properties.
1513 * elfxx-x86.c: Include elf-vxworks.h".
1514 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1515 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1516 comments for pic_plt0_entry and pic_plt_entry.
1517 (elf_x86_non_lazy_plt_layout): Likewise.
1518 (elf_x86_plt_layout_table): New.
1519 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1521 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1524 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1525 .eh_frame section for the second PLT.
1526 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1527 alignment of .eh_frame section for the second PLT.
1529 2017-09-01 Nick Clifton <nickc@redhat.com>
1532 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1535 2017-09-01 Nick Clifton <nickc@redhat.com>
1538 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1539 attribute buffer is NUL terminated.
1541 2017-08-31 Nick Clifton <nickc@redhat.com>
1544 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1545 to dwarf string sections.
1547 2017-08-31 Alan Modra <amodra@gmail.com>
1549 * po/SRC-POTFILES.in: Regenerate.
1551 2017-08-31 Alan Modra <amodra@gmail.com>
1553 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1554 for a section containing just a terminator. Allow multiple
1555 terminators at end of section.
1556 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1557 sections when not adding alignment. Assert on terminator in
1560 2017-08-31 Alan Modra <amodra@gmail.com>
1564 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1567 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1569 * configure.ac (bfd_backends): Add elf64.lo together with
1570 elfxx-x86.lo for 64-bit BFD.
1571 * configure: Regenerated.
1573 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1575 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1578 2017-08-31 Alan Modra <amodra@gmail.com>
1581 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1582 before _close_and_cleanup. Call iovec->bclose after.
1583 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1585 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1587 * elf32-i386.c (elf_i386_plt_type): Removed.
1588 (elf_i386_plt): Likewise.
1589 (elf_i386_get_synthetic_symtab): Updated. Call
1590 _bfd_x86_elf_get_synthetic_symtab.
1591 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1592 (elf_x86_64_plt): Likewise.
1593 (elf_x86_64_get_synthetic_symtab): Updated. Call
1594 _bfd_x86_elf_get_synthetic_symtab.
1595 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1596 (elf_x86_64_get_plt_got_vma): Likewise.
1597 (elf_i386_valid_plt_reloc_p): Likewise.
1598 (elf_x86_64_valid_plt_reloc_p): Likewise.
1599 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1600 * elfxx-x86.h (elf_x86_plt_type): New.
1601 (elf_x86_plt): Likewise.
1602 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1604 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1606 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1607 target_id instead of elf_machine_code.
1609 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1611 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1612 (elf_i386_lazy_plt_layout): Likewise.
1613 (elf_i386_non_lazy_plt_layout): Likewise.
1614 (elf_i386_plt_layout): Likewise.
1615 (elf_i386_link_hash_table): Likewise.
1616 (elf_i386_next_tls_desc_index): Likewise.
1617 (elf_i386_srelplt2): Likewise.
1618 (elf_i386_plt): Likewise.
1619 (elf_i386_lazy_plt): Likewise.
1620 (elf_i386_non_lazy_plt): Likewise.
1621 (elf_i386_link_hash_table_create): Likewise.
1622 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1623 (elf_i386_lazy_plt): Updated.
1624 (elf_i386_non_lazy_plt): Likewise.
1625 (elf_i386_lazy_ibt_plt): Likewise.
1626 (elf_i386_non_lazy_ibt_plt): Likewise.
1627 (elf_i386_allocate_dynrelocs): Likewise.
1628 (elf_i386_size_dynamic_sections): Likewise.
1629 (elf_i386_relocate_section): Likewise.
1630 (elf_i386_finish_dynamic_symbol): Likewise.
1631 (elf_i386_finish_dynamic_sections): Likewise.
1632 (elf_i386_get_synthetic_symtab): Likewise.
1633 (elf_i386_link_setup_gnu_properties): Likewise.
1634 (elf_i386_nacl_plt): Likewise.
1635 * elf64-x86-64.c (ABI_64_P): Removed.
1636 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1637 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1638 (elf_x86_64_lazy_plt_layout): Likewise.
1639 (elf_x86_64_non_lazy_plt_layout): Likewise.
1640 (elf_x86_64_plt_layout): Likewise.
1641 (elf_x86_64_link_hash_table): Likewise.
1642 (elf_x86_64_plt): Likewise.
1643 (elf_x86_64_lazy_plt): Likewise.
1644 (elf_x86_64_non_lazy_plt): Likewise.
1645 (elf_x86_64_link_hash_table_create): Likewise.
1646 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1647 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1648 (elf_x86_64_lazy_plt): Updated.
1649 (elf_x86_64_non_lazy_plt): Likewise.
1650 (elf_x86_64_lazy_bnd_plt): Likewise.
1651 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1652 (elf_x86_64_lazy_ibt_plt): Likewise.
1653 (elf_x32_lazy_ibt_plt): Likewise.
1654 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1655 (elf_x32_non_lazy_ibt_plt): Likewise.
1656 (elf_x86_64_allocate_dynrelocs): Likewise.
1657 (elf_x86_64_size_dynamic_sections): Likewise.
1658 (elf_x86_64_relocate_section): Likewise.
1659 (elf_x86_64_finish_dynamic_symbol): Likewise.
1660 (elf_x86_64_finish_dynamic_sections): Likewise.
1661 (elf_x86_64_get_synthetic_symtab): Likewise.
1662 (elf_x86_64_link_setup_gnu_properties): Likewise.
1663 (elf_x86_64_nacl_plt): Likewise.
1664 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1666 (ELF32_DYNAMIC_INTERPRETER): New.
1667 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1668 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1669 (_bfd_x86_elf_link_hash_table_create): Likewise.
1670 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1671 (elf_x86_link_hash_table_free): This. Make it static.
1672 * elfxx-x86.h: Don't include "objalloc.h".
1674 (elf_x86_lazy_plt_layout): Likewise.
1675 (elf_x86_non_lazy_plt_layout): Likewise.
1676 (elf_x86_plt_layout): Likewise.
1677 (_bfd_x86_elf_link_hash_table_create): Likewise.
1678 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1679 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1680 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1681 srelplt2 and next_tls_desc_index.
1682 (_bfd_x86_elf_link_hash_table_free): Removed.
1684 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1686 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1687 branch offset interpretation.
1689 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1692 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1694 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1696 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1697 (elf_x86_64_srelplt2): Likewise.
1699 2017-08-30 Alan Modra <amodra@gmail.com>
1701 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1702 (ppc64_elf_tls_optimize): Set it.
1703 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1704 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1705 addis would add zero.
1706 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1707 (ppc_elf_tls_optimize): Set it.
1708 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1709 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1711 2017-08-30 Alan Modra <amodra@gmail.com>
1713 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1714 __tls_get_addr call sequences to LE, don't move the addi down
1715 to the nop. Replace the bl with addi and leave the nop alone.
1717 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1719 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1721 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1723 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1725 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1727 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1728 (BFD64_BACKENDS): Likewise.
1729 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1730 (BFD64_BACKENDS_CFILES): Likewise.
1731 * Makefile.in: Regenerated.
1732 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1733 elf32-i386.lo and elf64-x86-64.lo.
1734 * configure: Regenerated.
1735 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1736 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1737 "objalloc.h" and "hashtab.h".
1738 (ELIMINATE_COPY_RELOCS): Removed.
1739 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1740 (SYMBOL_NO_COPYRELOC): Likewise.
1741 (elf_i386_link_hash_entry): Likewise.
1742 (GOT_UNKNOWN): Likewise.
1743 (GOT_NORMAL): Likewise.
1744 (GOT_TLS_GD): Likewise.
1745 (elf_i386_hash_entry): Likewise.
1746 (elf_i386_obj_tdata): Likewise.
1747 (elf_i386_tdata): Likewise.
1748 (elf_i386_local_got_tls_type): Likewise.
1749 (elf_i386_local_tlsdesc_gotent): Likewise.
1750 (elf_i386_hash_table): Likewise.
1751 (elf_i386_link_hash_newfunc): Likewise.
1752 (elf_i386_local_htab_hash): Likewise.
1753 (elf_i386_local_htab_eq): Likewise.
1754 (elf_i386_get_local_sym_hash): Likewise.
1755 (elf_i386_link_hash_table_free): Likewise.
1756 (elf_i386_copy_indirect_symbol): Likewise.
1757 (elf_i386_fixup_symbol): Likewise.
1758 (elf_i386_readonly_dynrelocs): Likewise.
1759 (elf_i386_always_size_sections): Likewise.
1760 (elf_i386_set_tls_module_base): Likewise.
1761 (elf_i386_dtpoff_base): Likewise.
1762 (compare_relocs): Likewise.
1763 (elf_i386_hash_symbol): Likewise.
1764 (elf_i386_parse_gnu_properties): Likewise.
1765 (elf_i386_merge_gnu_properties): Likewise.
1766 (elf_i386_link_check_relocs): Likewise.
1767 (elf_i386_merge_symbol_attribute): Likewise.
1768 (bfd_elf32_bfd_link_check_relocs): Likewise.
1769 (elf_backend_copy_indirect_symbol): Likewise.
1770 (elf_backend_always_size_sections): Likewise.
1771 (elf_backend_omit_section_dynsym): Likewise.
1772 (elf_backend_hash_symbol): Likewise.
1773 (elf_backend_fixup_symbol): Likewise.
1774 (elf_backend_parse_gnu_properties): Likewise.
1775 (elf_backend_merge_gnu_properties): Likewise.
1776 (elf_backend_merge_symbol_attribute): Likewise.
1777 (elf_i386_mkobject): Updated.
1778 (elf_i386_link_hash_table_create): Likewise.
1779 (elf_i386_check_tls_transition): Likewise.
1780 (elf_i386_tls_transition): Likewise.
1781 (elf_i386_convert_load_reloc): Likewise.
1782 (elf_i386_check_relocs): Likewise.
1783 (elf_i386_adjust_dynamic_symbol): Likewise.
1784 (elf_i386_allocate_dynrelocs): Likewise.
1785 (elf_i386_convert_load): Likewise.
1786 (elf_i386_size_dynamic_sections): Likewise.
1787 (elf_i386_relocate_section): Likewise.
1788 (elf_i386_finish_dynamic_symbol ): Likewise.
1789 (elf_i386_finish_dynamic_sections): Likewise.
1790 (elf_i386_output_arch_local_syms): Likewise.
1791 (elf_i386_get_synthetic_symtab): Likewise.
1792 (elf_i386_link_setup_gnu_properties): Likewise.
1793 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1794 of elf_link_hash_table, as base.
1795 (elf_i386_next_tls_desc_index): New.
1796 (elf_i386_srelplt2): Likewise.
1797 (elf_i386_plt): Likewise.
1798 (elf_i386_lazy_plt): Likewise.
1799 (elf_i386_non_lazy_plt): Likewise.
1800 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1801 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1802 "objalloc.h" and "hashtab.h".
1803 (ELIMINATE_COPY_RELOCS): Removed.
1804 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1805 (SYMBOL_NO_COPYRELOC): Likewise.
1806 (elf_x86_64_link_hash_entry): Likewise.
1807 (GOT_UNKNOWN): Likewise.
1808 (GOT_NORMAL): Likewise.
1809 (GOT_TLS_GD): Likewise.
1810 (elf_x86_64_hash_entry): Likewise.
1811 (elf_x86_64_obj_tdata): Likewise.
1812 (elf_x86_64_tdata): Likewise.
1813 (elf_x86_64_local_got_tls_type): Likewise.
1814 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1815 (elf_x86_64_hash_table): Likewise.
1816 (elf_x86_64_link_hash_newfunc): Likewise.
1817 (elf_x86_64_local_htab_hash): Likewise.
1818 (elf_x86_64_local_htab_eq): Likewise.
1819 (elf_x86_64_get_local_sym_hash): Likewise.
1820 (elf_x86_64_link_hash_table_free): Likewise.
1821 (elf_x86_64_copy_indirect_symbol): Likewise.
1822 (elf_x86_64_fixup_symbol): Likewise.
1823 (elf_x86_64_readonly_dynrelocs): Likewise.
1824 (elf_x86_64_always_size_sections): Likewise.
1825 (elf_x86_64_set_tls_module_base): Likewise.
1826 (elf_x86_64_dtpoff_base): Likewise.
1827 (compare_relocs): Likewise.
1828 (elf_x86_64_merge_symbol_attribute): Likewise.
1829 (elf_x86_64_hash_symbol): Likewise.
1830 (elf_x86_64_parse_gnu_properties): Likewise.
1831 (elf_x86_64_merge_gnu_properties): Likewise.
1832 (elf_x86_64_link_check_relocs): Likewise.
1833 (elf_backend_copy_indirect_symbol): Likewise.
1834 (elf_backend_always_size_sections): Likewise.
1835 (bfd_elf64_bfd_link_check_relocs): Likewise.
1836 (elf_backend_merge_symbol_attribute): Likewise.
1837 (elf_backend_hash_symbol): Likewise.
1838 (elf_backend_omit_section_dynsym): Likewise.
1839 (elf_backend_fixup_symbol): Likewise.
1840 (elf_backend_parse_gnu_properties): Likewise.
1841 (elf_backend_merge_gnu_properties): Likewise.
1842 (bfd_elf32_bfd_link_check_relocs): Likewise.
1843 (elf_x86_64_mkobject): Updated.
1844 (elf_x86_64_link_hash_table_create): Likewise.
1845 (elf_x86_64_check_tls_transition): Likewise.
1846 (elf_x86_64_tls_transition): Likewise.
1847 (elf_x86_64_convert_load_reloc): Likewise.
1848 (elf_x86_64_check_relocs): Likewise.
1849 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1850 (elf_x86_64_allocate_dynrelocs): Likewise.
1851 (elf_x86_64_convert_load): Likewise.
1852 (elf_x86_64_size_dynamic_sections): Likewise.
1853 (elf_x86_64_relocate_section): Likewise.
1854 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1855 (elf_x86_64_finish_dynamic_sections): Likewise.
1856 (elf_x86_64_output_arch_local_syms): Likewise.
1857 (elf_x86_64_get_synthetic_symtab): Likewise.
1858 (elf_x86_64_link_setup_gnu_properties): Likewise.
1859 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1860 instead of elf_link_hash_table, as base.
1861 (elf_x86_64_next_tls_desc_index): New.
1862 (elf_x86_64_srelplt2): Likewise.
1863 (elf_x86_64_plt): Likewise.
1864 (elf_x86_64_lazy_plt): Likewise.
1865 (elf_x86_64_non_lazy_plt): Likewise.
1866 * elfxx-x86.c: New file.
1867 * elfxx-x86.h: Likewise.
1869 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1871 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1873 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1875 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1877 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1878 sections before checking dynamic relocations and free invalid
1879 PLT section contents.
1880 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1882 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1884 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1885 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1887 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1890 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1892 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1894 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1896 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1898 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1900 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1903 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1904 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1905 Add a has_no_copy_on_protected bitfield.
1906 (elf_has_no_copy_on_protected): New.
1907 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1908 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1909 (elf_merge_gnu_property_list): Likewise.
1910 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1911 to FALSE for elf_has_no_copy_on_protected.
1912 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1913 (elf_i386_link_hash_entry): Add def_protected.
1914 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1915 when checking info->nocopyreloc.
1916 (elf_i386_link_setup_gnu_properties): Don't set
1917 extern_protected_data here.
1918 (elf_i386_merge_symbol_attribute): New function.
1919 (elf_backend_merge_symbol_attribute): New.
1920 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1921 (elf_x86_64_link_hash_entry): Add def_protected.
1922 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1923 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1924 when checking info->nocopyreloc.
1925 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1926 relocation run-time overflow and unresolvable R_X86_64_32S
1927 relocation against protected data symbol defined in shared object
1928 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1929 (elf_x86_64_link_setup_gnu_properties): Don't set
1930 extern_protected_data here.
1931 (elf_x86_64_merge_symbol_attribute): New function.
1932 (elf_backend_merge_symbol_attribute): New.
1934 2017-08-26 Alan Modra <amodra@gmail.com>
1936 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1937 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1938 (ppc_elf_relocate_section): Comment fix.
1939 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1940 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1941 Support dynamic relocs for TPREL16 when non-pic too.
1942 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1943 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1946 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1948 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1949 "symbol" in comments.
1950 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1952 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1955 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1956 R_X86_64_PC32 relocation run-time overflow and unresolvable
1957 R_X86_64_32S relocation with -z nocopyreloc.
1959 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1961 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1962 Undefined symbols may not have a type.
1963 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1965 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1967 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1968 bfd_link_info. Report shared, PIE or PDE object based on
1970 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1971 (elf_x86_64_relocate_section): Likewise.
1973 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1975 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1976 for function symbols.
1977 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1979 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1981 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1982 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1983 is set on any input relocatable file.
1984 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1986 2017-08-23 Alan Modra <amodra@gmail.com>
1989 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1990 ensure_undefweak_dynamic. Handle undefined too.
1991 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1992 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1993 (allocate_dynrelocs): Discard undefined non-default visibility
1994 relocs first. Make undefined syms dynamic. Tidy goto.
1996 2017-08-21 Alan Modra <amodra@gmail.com>
1997 H.J. Lu <hongjiu.lu@intel.com>
2000 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
2001 * elflink.c (bfd_elf_define_start_stop): Rewrite.
2003 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
2006 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
2007 undefined weak symbols.
2009 2017-08-18 Nick Clifton <nickc@redhat.com>
2012 * tekhex.c (getsym): Fix check for source pointer walking off the
2013 end of the input buffer.
2015 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
2018 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
2019 relocations in debug sections, change abort to _bfd_error_handler.
2021 2017-08-14 Nick Clifton <nickc@redhat.com>
2024 * elf.c (setup_group): Check for an empty or very small group
2026 * po/bfd.pot: Regenerate.
2028 2017-08-14 Alan Modra <amodra@gmail.com>
2031 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2032 alignment padding here.
2033 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2034 in a reverse pass over sections.
2036 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
2039 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2040 for @plt suffixes first.
2041 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2043 2017-08-08 Nick Clifton <nickc@redhat.com>
2046 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2047 small section lengths.
2048 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2050 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2051 there is enough data present in the note.
2053 2017-08-08 Alan Modra <amodra@gmail.com>
2056 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2057 got.refcount for GOTOFF relocs, just create .got section.
2059 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
2061 * elflink.c (elf_link_add_object_symbols): Move common symbol
2062 check after bed->common_definition.
2064 2017-08-07 Alan Modra <amodra@gmail.com>
2067 * elflink.c (bfd_elf_final_link): Don't segfault when sections
2068 needed to define various dynamic tags have been discarded.
2070 2017-08-07 Nick Clifton <nickc@redhat.com>
2073 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2074 has not been set then use the bfd returned by
2075 _bfd_elf_link_setup_gnu_properties. If that is null then search
2076 through all the input bfds selecting the first normal, ELF format
2078 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2080 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2082 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2084 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2085 (elf_i386_check_tls_transition): Check tls_get_addr directly.
2086 (elf_i386_convert_load_reloc): Update tls_get_addr check.
2087 (elf_i386_link_check_relocs): New function.
2088 (bfd_elf32_bfd_link_check_relocs): New.
2089 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2091 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2092 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2093 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2094 (elf_x86_64_link_check_relocs): New function.
2095 (bfd_elf64_bfd_link_check_relocs): New.
2096 (bfd_elf32_bfd_link_check_relocs): Likewise.
2098 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
2101 * elflink.c (elf_link_add_object_symbols): Treat common symbol
2102 as undefined for --no-define-common.
2104 2017-08-05 Alan Modra <amodra@gmail.com>
2106 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2107 hppa_link_hash_table.
2109 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
2111 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2112 entries for sysregs with negative indices.
2114 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2116 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2117 isn't the S/390 specific elf data.
2118 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2120 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
2122 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2123 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2124 [R_RISCV_ADD16]: Likewise.
2125 [R_RISCV_ADD32]: Likewise.
2126 [R_RISCV_ADD64]: Likewise.
2127 [R_RISCV_SUB6]: Likewise.
2128 [R_RISCV_SUB8]: Likewise.
2129 [R_RISCV_SUB16]: Likewise.
2130 [R_RISCV_SUB32]: Likewise.
2131 [R_RISCV_SUB64]: Likewise.
2133 2017-07-31 Alan Modra <amodra@gmail.com>
2135 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2136 without ld.so checks.
2138 2017-07-29 Alan Modra <amodra@gmail.com>
2141 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2142 (ppc64_elf_merge_symbol): Set non_zero_localentry.
2143 (is_elfv2_localentry0): Test non_zero_localentry.
2144 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2146 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2148 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2149 pointer check for htab->elf.irelplt.
2150 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2152 2017-07-27 Nick Clifton <nickc@redhat.com>
2155 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2157 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2159 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2161 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2163 (evax_bfd_print_emh): Check for invalid string lengths.
2165 2017-07-25 Nick Clifton <nickc@redhat.com>
2167 * po/fr.po: Updated French translation.
2169 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
2172 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2173 16-bit absolute branches into 10-bit pc-relative branches on the
2174 MSP430 as well as the MSP430X.
2176 2017-07-25 Alan Modra <amodra@gmail.com>
2178 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2179 (stub_eh_frame_size): New function.
2180 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2181 (group_sections): Init group tls_get_addr_opt_bctrl.
2182 (ppc64_elf_size_stubs): Update sizing and initialization of
2183 .eh_frame. Iteration over stubs via group list.
2184 (ppc64_elf_build_stubs): Iterate over stubs via group list.
2185 (ppc64_elf_finish_dynamic_sections): Update finalization of
2188 2017-07-24 Nick Clifton <nickc@redhat.com>
2191 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2192 of the relocs to the canonicalize_one_reloc routine.
2193 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2194 for the _bfd_mach_o_canonicalize_one_reloc field.
2195 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2196 res_base parameter. Use to check for corrupt pair relocs.
2197 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2199 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2201 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2204 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2205 enough data in the record before attempting to parse it.
2206 (_bfd_vms_slurp_eeom): Likewise.
2208 (_bfd_vms_slurp_egsd): Check for an invalid section index.
2209 (image_set_ptr): Likewise.
2210 (alpha_vms_slurp_relocs): Likewise.
2212 (alpha_vms_object_p): Check for a truncated record.
2214 2017-07-24 Nick Clifton <nickc@redhat.com>
2217 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
2218 an unrecognized reloc and sets the bfd_error value.
2219 * libbfd.h: Regenerate.
2220 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2222 * elf32-i386.c (elf_i386_relocate_section): Likewise.
2223 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2224 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2225 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2226 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2228 2017-07-23 Alan Modra <amodra@gmail.com>
2230 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2233 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
2236 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2237 reloc_class_ifunc for ifunc symbols.
2239 2017-07-19 Nick Clifton <nickc@redhat.com>
2242 * archive.c (bfd_generic_archive_p): If the bfd does not have the
2243 correct magic bytes at the start, set the error to wrong format
2244 and clear the format selector before returning NULL.
2246 2017-07-19 Nick Clifton <nickc@redhat.com>
2249 * coff-rs6000.c (_bfd_strntol): New function.
2250 (_bfd_strntoll): New function.
2251 (GET_VALUE_IN_FIELD): New macro.
2252 (EQ_VALUE_IN_FIELD): new macro.
2253 (_bfd_xcoff_slurp_armap): Use new macros.
2254 (_bfd_xcoff_archive_p): Likewise.
2255 (_bfd_xcoff_read_ar_hdr): Likewise.
2256 (_bfd_xcoff_openr_next_archived_file): Likewise.
2257 (_bfd_xcoff_stat_arch_elt): Likewise.
2258 * coff64-rs6000.c (_bfd_strntol): New function.
2259 (_bfd_strntoll): New function.
2260 (GET_VALUE_IN_FIELD): New macro.
2261 (xcoff64_slurp_armap): Use new macros.
2263 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
2264 John Eric Martin <John.Martin@emmicro-us.com>
2266 * bfd-in2.h: Regenerate.
2267 * libbfd.h: Regenerate.
2268 * elf32-arc.c (JLI): Define.
2269 * reloc.c: Add JLI relocations.
2271 2017-07-18 Nick Clifton <nickc@redhat.com>
2274 * coff-sh.c: Fix spelling typos.
2275 * compress.c: Likewise.
2276 * cpu-pdp11.c: Likewise.
2277 * ecofflink.c: Likewise.
2278 * elf-m10300.c: Likewise.
2280 * elf32-arm.c: Likewise.
2281 * elf32-m68k.c: Likewise.
2282 * elf32-nds32.c: Likewise.
2283 * elf32-ppc.c: Likewise.
2284 * elf32-sh.c: Likewise.
2285 * elf32-v850.c: Likewise.
2286 * elf64-ppc.c: Likewise.
2287 * elf64-x86-64.c: Likewise.
2288 * elflink.c: Likewise.
2289 * elfnn-aarch64.c: Likewise.
2290 * elfxx-mips.c: Likewise.
2292 * sunos.c: Likewise.
2293 * vms-alpha.c: Likewise.
2294 * xcofflink.c: Likewise.
2296 2017-07-18 Nick Clifton <nickc@redhat.com>
2299 * coffcode.h (handle_COMDAT): Replace abort with an error message
2302 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2305 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2308 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2310 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2312 2017-07-16 Alan Modra <amodra@gmail.com>
2314 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2315 __tls_index GOT entries when using __tls_get_addr_opt stub.
2316 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2318 2017-07-12 Alan Modra <amodra@gmail.com>
2320 * po/es.po: Update from translationproject.org/latest/bfd/.
2321 * po/fi.po: Likewise.
2322 * po/fr.po: Likewise.
2323 * po/id.po: Likewise.
2324 * po/ja.po: Likewise.
2325 * po/ro.po: Likewise.
2326 * po/ru.po: Likewise.
2327 * po/sr.po: Likewise.
2328 * po/sv.po: Likewise.
2329 * po/tr.po: Likewise.
2330 * po/uk.po: Likewise.
2331 * po/vi.po: Likewise.
2332 * po/zh_CN.po: Likewise.
2333 * po/hr.po: New file from translationproject.org.
2334 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2335 * configure: Regenerate.
2337 2017-07-12 Nick Clifton <nickc@redhat.com>
2339 Fix compile time warnings using gcc 7.1.1.
2340 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2342 (elf_xtensa_get_gotplt_section): Increase length of got_name
2344 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2345 default return of FALSE.
2346 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2347 default return of FALSE.
2349 2017-07-12 Alan Modra <amodra@gmail.com>
2351 * binary.c (binary_set_section_contents): Don't print filepos in
2353 (coff_write_object_contents): Cast size_t for error message.
2354 (coff_slurp_line_table): Don't use bfd_vma symndx.
2355 (coff_slurp_reloc_table): Remove unneeded cast.
2356 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2358 (find_abstract_instance_name): Likewise.
2359 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2360 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2361 (elf32_arm_check_relocs): Make r_symndx an int.
2362 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2364 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2366 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2368 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2369 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2370 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2371 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2372 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2373 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2374 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2375 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2376 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2377 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2378 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2379 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2380 and use %lu for error message.
2381 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2382 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2385 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2387 (elf32_arm_final_link_relocate): Likewise.
2388 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2389 * coffcode.h (styp_to_sec_flags): Likewise.
2390 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2391 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2392 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2393 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2394 (elf32_bfin_merge_private_bfd_data): Likewise.
2395 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2396 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2397 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2398 (i370_elf_relocate_section): Likewise.
2399 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2400 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2401 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2402 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2403 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2404 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2405 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2406 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2407 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2408 * ieee.c (ieee_write_id, read_id): Likewise.
2409 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2410 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2411 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2412 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2413 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2414 * stabs.c (_bfd_link_section_stabs): Likewise.
2416 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2418 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2419 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2420 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2421 * coff-sh.c (sh_relax_section): Likewise.
2422 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2423 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2424 * coffcode.h (coff_slurp_reloc_table): Likewise.
2425 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2426 (_bfd_coff_read_string_table): Likewise.
2427 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2428 * compress.c (bfd_get_full_section_contents): Likewise.
2429 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2430 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2431 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2432 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2433 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2434 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2435 (elf32_arm_write_section): Likewise.
2436 * elf32-bfin.c (bfin_relocate_section): Likewise.
2437 (bfinfdpic_relocate_section): Likewise.
2438 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2439 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2440 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2441 (elf_i386_relocate_section): Likewise.
2442 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2443 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2444 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2445 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2446 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2447 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2448 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2449 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2450 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2451 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2452 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2453 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2454 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2455 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2456 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2457 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2458 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2459 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2460 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2461 * elf32-sh.c (sh_elf_relax_section): Likewise.
2462 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2463 (sh_elf_relocate_section): Likewise.
2464 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2465 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2466 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2467 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2468 * elf32-v850.c (v850_elf_relax_section): Likewise.
2469 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2470 (elf_vax_relocate_section): Likewise.
2471 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2472 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2473 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2474 (do_fix_for_relocatable_link): Likewise.
2475 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2476 (elf64_alpha_relax_with_lituse): Likewise.
2477 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2478 (elf_hppa_final_link_relocate): Likewise.
2479 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2480 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2481 (elf64_vms_link_add_object_symbols): Likewise.
2482 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2483 (mmix_final_link_relocate): Likewise.
2484 * elf64-s390.c (invalid_tls_insn): Likewise.
2485 (elf_s390_relocate_section): Likewise.
2486 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2487 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2488 (elf_x86_64_relocate_section): Likewise.
2489 * elfcode.h (elf_slurp_symbol_table): Likewise.
2490 * elfcore.h (elf_core_file_p): Likewise.
2491 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2492 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2493 (elfNN_aarch64_relocate_section): Likewise.
2494 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2495 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2496 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2497 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2498 (_bfd_mips_elf_relocate_section): Likewise.
2499 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2500 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2501 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2502 * ieee.c (ieee_slurp_external_symbols): Likewise.
2503 * ihex.c (ihex_write_object_content): Likewise.
2504 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2505 * merge.c (_bfd_merged_section_offset): Likewise.
2506 * mmo.c (mmo_write_loc_chunk): Likewise.
2507 (mmo_write_object_contents): Likewise.
2508 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2509 * stabs.c (_bfd_link_section_stabs): Likewise.
2510 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2512 2017-07-11 Alan Modra <amodra@gmail.com>
2514 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2516 2017-07-11 Alan Modra <amodra@gmail.com>
2518 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2519 instruction" error using _bfd_error_handler, not einfo.
2521 2017-07-10 Nick Clifton <nickc@redhat.com>
2523 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2524 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2526 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2528 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2530 2017-07-07 Alan Modra <amodra@gmail.com>
2532 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2534 2017-07-07 Alan Modra <amodra@gmail.com>
2536 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2537 as long long. Move code replacing "ll" with "I64", and simplify.
2539 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2541 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2544 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2546 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2548 (line_info_add_file_name): Likewise.
2549 (decode_line_info): Likewise.
2551 2017-07-04 Tristan Gingold <gingold@adacore.com>
2553 * version.m4: Bump version to 2.29.51
2554 * configure: Regenerate.
2556 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2558 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2559 sanity check at the head of this function.
2561 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2563 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2564 dwarf_line_str_size.
2565 (struct attr_abbrev): Add field implicit_const.
2566 (dwarf_debug_sections): Add .debug_line_str.
2567 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2568 (dwarf_debug_section_assert): Add static assertion.
2569 (read_indirect_line_string): New.
2570 (read_abbrevs): Support DW_FORM_implicit_const.
2571 (is_str_attr): Support DW_FORM_line_strp.
2572 (read_attribute_value): Support DW_FORM_line_strp and
2573 DW_FORM_implicit_const.
2574 (read_attribute): Support DW_FORM_implicit_const.
2575 (line_info_add_include_dir, line_info_add_include_dir_stub):
2576 (line_info_add_file_name, read_formatted_entries): New.
2577 (decode_line_info, parse_comp_unit): Support DWARF 5.
2578 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2580 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2582 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2583 abort statement that was put for symbols that are not dynamic.
2585 2017-07-03 Tristan Gingold <gingold@adacore.com>
2587 * po/bfd.pot: Regenerate
2589 2017-07-03 Alan Modra <amodra@gmail.com>
2591 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2592 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2593 * elf.c (setup_group): Use "Lx" to print sh_size.
2594 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2595 unknown section type in hex.
2596 (copy_special_section_fields): Style fix.
2597 (bfd_section_from_shdr): Correct format for sh_link. Use a
2598 common error message for all the variants of unrecognized
2600 (assign_file_positions_for_load_sections): Use "Lx" for lma
2601 adjust error message.
2602 (assign_file_positions_for_non_load_sections): Formatting.
2603 (rewrite_elf_program_header): Formatting. Use "Lx" for
2604 bfd_vma values in error messages.
2605 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2606 ELF_R_SYM value to type expected by format.
2607 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2609 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2610 (elf_link_input_bfd): Use "Lx" for r_info.
2611 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2613 2017-07-03 Alan Modra <amodra@gmail.com>
2615 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2616 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2617 Microsoft C library variant of long long format specifier.
2618 (PRINT20): Cast value to bfd_uint64_t not long long.
2619 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2620 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2621 long long. Don't cast to bfd_vma.
2622 * elf32-score.c (score3_bfd_getl48): Likewise.
2623 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2625 2017-07-03 Alan Modra <amodra@gmail.com>
2627 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2629 (bfd_elf_print_symbol): Don't cast symbol->flags.
2630 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2631 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2632 _bfd_error_handler argument order.
2633 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2635 2017-07-03 Alan Modra <amodra@gmail.com>
2637 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2638 AC_TYPE_LONG_DOUBLE.
2639 * configure: Regenerate.
2640 * config.in: Regenerate.
2642 2017-06-29 Andrew Waterman <andrew@sifive.com>
2644 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2647 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2649 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2650 unless it is undefined weak.
2651 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2652 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2654 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2655 is not dynamic in PIC, abort.
2657 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2660 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2661 undefined weak symbols into dynamic.
2662 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2663 relocation for non-dynamic symbols.
2664 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2666 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2668 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2669 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2670 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2671 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2672 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2675 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2677 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2678 (elfcore_write_s390_gs_bc): Likewise.
2679 * elf.c (elfcore_grok_s390_gs_cb): New function.
2680 (elfcore_grok_s390_gs_bc): New function.
2681 (elfcore_grok_note): Call them.
2682 (elfcore_write_s390_gs_cb): New function.
2683 (elfcore_write_s390_gs_bc): New function.
2684 (elfcore_write_register_note): Call them.
2686 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2688 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2689 bfd_get_file_size. Check archive element size.
2690 (_bfd_generic_get_section_contents_in_window): Likewise.
2692 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2694 * bfd-in2.h: Regenerated.
2695 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2696 (bfd_get_file_size): Likewise.
2698 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2699 Matthew Fortune <matthew.fortune@imgtec.com>
2701 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2702 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2703 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2704 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2706 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2707 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2708 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2709 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2710 `bfd_mach_mips_interaptiv_mr2' entries.
2711 * bfd-in2.h: Regenerate.
2713 2017-06-27 Nick Clifton <nickc@redhat.com>
2715 * tekhex.c (pass_over): Revert accidental conversion of a local
2716 array to a static array.
2718 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2721 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2722 reloc addend if necessary. Adjust diff only if
2723 shrinked_insn_address < end_address.
2725 2017-06-27 Alan Modra <amodra@gmail.com>
2728 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2729 (_bfd_generic_get_section_contents_in_window): Likewise.
2731 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2733 * elfnn-riscv.c (perform_relocation): Support the new
2734 R_RISCV_32_PCREL relocation.
2735 (riscv_elf_relocate_section): Likewise.
2736 * elfxx-riscv.c (howto_table): Likewise.
2737 (riscv_reloc_map): Likewise.
2738 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2739 * libbfd.h: Regenerate.
2741 2017-06-27 Alan Modra <amodra@gmail.com>
2744 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2745 Use unsigned file pointer type, and remove cast.
2746 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2747 Add "count", not "sz".
2749 2017-06-26 Pedro Alves <palves@redhat.com>
2752 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2755 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2758 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2761 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2763 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2764 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2765 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2766 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2767 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2769 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2772 * compress.c (bfd_get_full_section_contents): Don't check the
2774 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2775 reject a section whose size + offset is greater than the size
2777 (_bfd_generic_get_section_contents_in_window): Likewise.
2779 2017-06-26 Nick Clifton <nickc@redhat.com>
2782 * tekhex.c (getvalue): Check for the source pointer exceeding the
2783 end pointer before the first byte is read.
2785 2017-06-26 Nick Clifton <nickc@redhat.com>
2788 * opncls.c (get_build_id): Check that the section is big enough
2789 to contain the whole note.
2790 * compress.c (bfd_get_full_section_contents): Check for and reject
2791 a section whose size is greater than the size of the entire file.
2792 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2793 contain a notes section.
2795 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2797 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2799 (elf_s390_modify_segment_map): Likewise.
2800 (bfd_elf_s390_set_options): Lisewise.
2802 2017-06-26 Alan Modra <amodra@gmail.com>
2804 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2806 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2807 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2808 .preinit_array on --just-syms bfds.
2809 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2810 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2811 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2813 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2815 * elf.c (find_link): Bounds check "hint".
2817 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2819 * elf32-arm.c (using_thumb_only): Update list of architectures in
2820 BFD_ASSERT for which the logic is valid.
2821 (using_thumb2_bl): Likewise.
2822 (using_thumb2): Likewise and return true for ARMv8-R.
2823 (arch_has_arm_nop): Likewise.
2824 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2825 merging logic. Update commentis for value 15 of v8m_baseline,
2826 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2827 merging of value 15 of Tag_CPU_arch.
2829 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2831 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2832 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2833 * bfd-in2.h: Regenerate.
2835 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2837 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2838 the error_alignment label forward. Properly align program
2839 property note section.
2841 2017-06-22 Eric Christopher <echristo@gmail.com>
2843 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2844 abs to fix a truncation warning.
2846 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2848 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2849 local undefined weak symbol to 0.
2850 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2852 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2854 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2855 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2856 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2857 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2858 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2859 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2860 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2861 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2863 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2865 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2866 (elf_i386_lazy_ibt_plt_entry): Likewise.
2867 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2868 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2869 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2870 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2871 (elf_i386_lazy_plt_layout): Likewise.
2872 (elf_i386_non_lazy_plt_layout): Likewise.
2873 (elf_i386_link_hash_entry): Add plt_second.
2874 (elf_i386_link_hash_table): Add plt_second and
2875 plt_second_eh_frame.
2876 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2877 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2878 the second PLT. Check the second PLT.
2879 (elf_i386_relocate_section): Use the second PLT to resolve
2880 PLT reference if needed.
2881 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2883 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2884 second PLT. Generate unwind info for the second PLT.
2885 (elf_i386_plt_type): Add plt_second.
2886 (elf_i386_get_synthetic_symtab): Support the second PLT.
2887 (elf_i386_parse_gnu_properties): Support
2888 GNU_PROPERTY_X86_FEATURE_1_AND.
2889 (elf_i386_merge_gnu_properties): Support
2890 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2891 on GNU_PROPERTY_X86_FEATURE_1_IBT
2892 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2893 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2894 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2895 is set on all relocatable inputs.
2896 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2897 (elf_x32_lazy_ibt_plt_entry): Likewise.
2898 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2899 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2900 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2901 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2902 (elf_x86_64_lazy_ibt_plt): Likewise.
2903 (elf_x32_lazy_ibt_plt): Likewise.
2904 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2905 (elf_x32_non_lazy_ibt_plt): Likewise.
2906 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2907 (elf_x86_64_parse_gnu_properties): Support
2908 GNU_PROPERTY_X86_FEATURE_1_AND.
2909 (elf_x86_64_merge_gnu_properties): Support
2910 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2911 on GNU_PROPERTY_X86_FEATURE_1_IBT
2912 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2913 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2914 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2915 is set on all relocatable inputs.
2917 2017-06-22 Nick Clifton <nickc@redhat.com>
2920 * som.c (setup_sections): NUL terminate the space_strings buffer.
2921 Check that the space.name field does not index beyond the end of
2922 the space_strings buffer.
2924 2017-06-21 Nick Clifton <nickc@redhat.com>
2927 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2929 2017-06-21 Nick Clifton <nickc@redhat.com>
2932 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2933 type of the size parameter.
2934 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2935 length of the counted string.
2936 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2937 (_bfd_vms_save_counted_string): Likewise.
2938 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2939 _bfd_vms_save_counted_string.
2940 (_bfd_vms_slurp_ehdr): Likewise.
2941 (_bfd_vms_slurp_egsd): Likewise.
2942 (Parse_module): Likewise.
2944 2017-06-21 Alan Modra <amodra@gmail.com>
2946 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2947 calls before tocsave calls.
2948 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2951 2017-06-21 Nick Clifton <nickc@redhat.com>
2954 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2955 bfd_get_full_section_contents returns no contents.
2957 2017-06-21 Nick Clifton <nickc@redhat.com>
2960 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2963 2017-06-21 Nick Clifton <nickc@redhat.com>
2966 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2968 (image_set_ptr): Likewise.
2969 (alpha_vms_fix_sec_rel): Likewise.
2970 (alpha_vms_slurp_relocs): Likewise.
2972 2017-06-21 Nick Clifton <nickc@redhat.com>
2975 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2977 (ieee_archive_p): Likewise.
2978 (ieee_object_p): Likewise.
2980 2017-06-21 Nick Clifton <nickc@redhat.com>
2983 * elf.c (setup_group): Zero the group section pointer list after
2984 allocation so that loops can be caught. Check for NULL pointers
2985 when processing a group list.
2987 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2989 * elf-s390.h: New file.
2990 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2992 (elf_s390_additional_program_headers): New function.
2993 (elf_s390_modify_segment_map): New function.
2994 (bfd_elf_s390_set_options): New function.
2995 (elf_backend_additional_program_headers)
2996 (elf_backend_modify_segment_map): Add macro definitions.
2998 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
3001 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
3002 the DYNAMIC bit instead of bfd_count_sections.
3004 2017-06-19 Nick Clifton <nickc@redhat.com>
3007 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
3009 (evax_bfd_print_eeom): Likewise.
3010 (evax_bfd_print_egsd): Check for an overlarge record length.
3011 (evax_bfd_print_etir): Likewise.
3013 2017-06-19 Nick Clifton <nickc@redhat.com>
3016 * libieee.h (struct common_header_type): Add end_p field.
3017 * ieee.c (this_byte_and_next): Do not advance input_p beyond
3019 (read_id): Check for a length that exceeds the remaining bytes in
3021 (ieee_seek): Initialise end_p.
3022 (ieee_archive_p): Likewise.
3023 (ieee_object_p): Likewise.
3025 2017-06-19 Nick Clifton <nickc@redhat.com>
3028 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
3029 before reading the EIHS structure entries.
3031 2017-06-19 Nick Clifton <nickc@redhat.com>
3034 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3035 gsd_size. Check that there are enough bytes remaining to read the
3036 type and size of the next egsd. Check that the size of the egsd
3037 does not exceed the size of the record.
3039 2017-06-19 Alan Modra <amodra@gmail.com>
3041 * config.bfd: Correct targ_underscore for cris.
3043 2017-06-18 Alan Modra <amodra@gmail.com>
3045 * config.bfd: Correct targ_underscore for epiphany, ip2k,
3046 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3048 2017-06-16 Nick Clifton <nickc@redhat.com>
3050 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3051 bucketlist is empty because there are no symbols to add to the
3054 2017-06-16 Alan Modra <amodra@gmail.com>
3060 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3061 (BFD_JUMP_TABLE_LINK): Likewise.
3062 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3063 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3064 (bfd_elf_define_start_stop): New function.
3065 * linker.c (bfd_generic_define_start_stop): New function.
3066 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3068 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3069 * aout-target.h (MY_bfd_define_start_stop): Define.
3070 * aout-tic30.c (MY_bfd_define_start_stop): Define.
3071 * binary.c (binary_bfd_define_start_stop): Define.
3072 * bout.c (b_out_bfd_define_start_stop): Define.
3073 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3074 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3075 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3076 * coffcode.h (coff_bfd_define_start_stop): Define.
3077 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3078 * i386msdos.c (msdos_bfd_define_start_stop): Define.
3079 * i386os9k.c (os9k_bfd_define_start_stop): Define.
3080 * ieee.c (ieee_bfd_define_start_stop): Define.
3081 * ihex.c (ihex_bfd_define_start_stop): Define.
3082 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3083 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3084 * mmo.c (mmo_bfd_define_start_stop): Define.
3085 * nlm-target.h (nlm_bfd_define_start_stop): Define.
3086 * oasys.c (oasys_bfd_define_start_stop): Define.
3087 * pef.c (bfd_pef_bfd_define_start_stop): Define.
3088 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3089 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3090 * som.c (som_bfd_define_start_stop): Define.
3091 * srec.c (srec_bfd_define_start_stop): Define.
3092 * tekhex.c (tekhex_bfd_define_start_stop): Define.
3093 * versados.c (versados_bfd_define_start_stop): Define.
3094 * vms-alpha.c (vms_bfd_define_start_stop): Define.
3095 (alpha_vms_bfd_define_start_stop): Define.
3096 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3097 * bfd-in2.h: Regenerate.
3098 * libbfd.h: Regenerate.
3100 2017-06-16 Jiong Wang <jiong.wang@arm.com>
3102 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3103 SYMBOL_REFERENCES_LOCAL.
3105 2017-06-15 Jiong Wang <jiong.wang@arm.com>
3108 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3109 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3110 runtime for if there needs copy relocation elimination.
3111 (need_copy_relocation_p): New function. Return true for symbol with
3112 pc-relative references and if it's against read-only sections.
3113 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3114 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3115 that are related with accessing external objects.
3116 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3117 in elfNN_aarch64_check_relocs.
3119 2017-06-15 Nick Clifton <nickc@redhat.com>
3122 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3125 (ieee_archive_p): Likewise.
3127 2017-06-15 Nick Clifton <nickc@redhat.com>
3130 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3132 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
3134 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3135 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3136 keep both windowed and call0 ABI PLT definitions.
3137 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3138 elf_xtensa_*_plt_entry endex.
3139 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3141 2017-06-14 Nick Clifton <nickc@redhat.com>
3144 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3147 2017-06-14 Nick Clifton <nickc@redhat.com>
3150 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3151 maximum value for the ascic pointer. Check that name processing
3152 does not read beyond this value.
3153 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3156 2017-06-14 Nick Clifton <nickc@redhat.com>
3159 * versados.c (versados_mkobject): Zero the allocated tdata structure.
3160 (process_otr): Check for an invalid offset in the otr structure.
3162 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
3164 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3166 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
3172 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
3173 vtable field to a union.
3174 (_bfd_elf_is_start_stop): Removed.
3175 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3176 __start_SECNAME and __stop_SECNAME symbols.
3177 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3178 * elflink.c (_bfd_elf_is_start_stop): Removed.
3179 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3180 _bfd_elf_is_start_stop.
3181 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3182 __stop_SECNAME symbols. Updated.
3183 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3184 (bfd_elf_gc_record_vtinherit): Likewise.
3185 (bfd_elf_gc_record_vtentry): Likewise.
3187 2017-06-13 Nick Clifton <nickc@redhat.com>
3190 * elflink.c (elf_link_adjust_relocs): Generate an error when
3191 encountering a reloc against a symbol removed by garbage
3194 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
3196 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3197 to merge_gnu_properties.
3198 * elf-properties.c (elf_merge_gnu_properties): Add struct
3199 bfd_link_info * and pass it to merge_gnu_properties.
3200 (elf_merge_gnu_property_list): Add struct bfd_link_info *
3201 and pass it to elf_merge_gnu_properties.
3202 (_bfd_elf_link_setup_gnu_properties): Pass info to
3203 elf_merge_gnu_property_list.
3204 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3206 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3208 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
3211 * binary.c (binary_set_section_contents): Scale lma by octets
3212 per byte to set filepos.
3214 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3216 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3219 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3221 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3224 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3226 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3227 patched section contents for TLS IE reloc.
3228 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3230 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3232 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3233 RELOC_FOR_GLOBAL_SYMBOL macro.
3235 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3237 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3240 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3242 * config/tc-arc.c (md_undefined_symbol): Changed.
3243 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3245 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3247 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3250 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3252 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3253 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3255 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
3257 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3260 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
3262 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3263 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3264 is non-zero. Add clarifying comments.
3266 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3268 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3269 name. Use local IFUNC symbol name string to report unsupported
3270 non-PIC call to IFUNC function.
3271 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3272 when generating R_386_IRELATIVE relocation.
3273 (elf_i386_finish_dynamic_symbol): Likewise.
3274 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3276 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3277 when generating R_X86_64_IRELATIVE relocation.
3278 (elf_x86_64_finish_dynamic_symbol): Likewise.
3280 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3282 * elf.c (setup_group): Make sure BFD sections are created for all
3283 group sections in the input file when processing SHF_GROUP
3285 (bfd_section_from_shdr): Avoid duplicating logic already
3286 implemented in `setup_group'.
3288 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3291 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3292 if the hint address is zero.
3294 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3297 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3298 ELF_COMMON_DEF_P for common symbols.
3300 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3302 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3303 SEC_GROUP sections as SEC_EXCLUDE.
3304 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3305 (assign_section_numbers): Use resolve_section_groups flag instead
3306 of relocatable link type.
3307 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3308 flag instead of checking the final_link flag for part of the
3309 checks in here. Fix white space as a result.
3310 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3311 instead of relocatable link type.
3312 (bfd_elf_final_link): Likewise.
3314 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3316 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3318 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3319 (s3_bfd_score_elf_check_relocs): Likewise.
3320 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3321 (score_elf_final_link_relocate): Likewise.
3322 (s7_bfd_score_elf_check_relocs): Likewise.
3324 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3326 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3329 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3331 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3332 from `reloc_count' rather than decrementing it.
3333 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3334 `reloc_count' by `int_rels_per_ext_rel'.
3335 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3336 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3337 entry determination.
3338 (s3_bfd_score_elf_check_relocs): Likewise.
3339 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3340 (s7_bfd_score_elf_relocate_section): Likewise.
3341 (s7_bfd_score_elf_check_relocs): Likewise.
3342 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3343 prototype and function.
3344 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3345 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3346 triple rather than once the sum of REL and RELA relocation entry
3348 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3349 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3350 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3351 storage allocation size determination.
3352 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3353 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3354 by `int_rels_per_ext_rel' for last relocation entry
3356 (bfd_elf_final_link): Do not multiply `reloc_count' by
3357 `int_rels_per_ext_rel' for internal relocation storage
3358 allocation size determination.
3359 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3360 `int_rels_per_ext_rel' for last relocation entry determination.
3361 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3362 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3363 (_bfd_mips_elf_relocate_section): Likewise.
3365 2017-06-05 Alan Modra <amodra@gmail.com>
3368 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3370 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3372 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3373 determine structure sizes.
3374 (elfcore_grok_freebsd_prstatus): Likewise.
3376 2017-06-01 Alan Modra <amodra@gmail.com>
3378 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3379 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3381 (is_elfv2_localentry0): New function.
3382 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3383 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3384 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3385 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3386 optimized localentry:0 stubs.
3387 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3388 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3390 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3392 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3394 2017-05-30 Casey Smith <clegg89@gmail.com>
3397 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3398 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3400 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3402 * cpu-arc.c (arc_compatible): New function.
3404 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3406 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3408 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3411 * bfdio.c (bfd_get_file_size): New function.
3412 * bfd-in2.h: Regenerated.
3414 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3416 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3419 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3421 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3422 dynobj instead of htab->elf.dynobj.
3424 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3426 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3428 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3429 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3430 actual number of internal relocations retrieved. Adjust
3431 function description.
3432 (bfd_elf64_canonicalize_reloc): Remove macro.
3433 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3435 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3437 * archures.c (bfd_mach_sparc_v9m8): Define.
3438 (bfd_mach_sparc_v8plusm8): Likewise.
3439 (bfd_mach_sparc_v9_p): Adjust to M8.
3440 (bfd_mach_sparc_64bit_p): Likewise.
3441 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3442 bfd_mach_sparc_v8plusm8.
3443 * bfd-in2.h: Regenerated.
3444 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3446 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3447 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3448 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3450 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3451 bfd_mach_sparc_v8plusm8.
3453 2017-05-19 Alan Modra <amodra@gmail.com>
3455 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3456 debug and special sections when no non-note alloc sections in an
3459 2017-05-18 Alan Modra <amodra@gmail.com>
3461 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3462 * elf-m10300.c: Likewise.
3464 * elf32-arc.c: Likewise.
3465 * elf32-bfin.c: Likewise.
3466 * elf32-m68k.c: Likewise.
3467 * elf32-nds32.c: Likewise.
3468 * elf32-tilepro.c: Likewise.
3469 * elflink.c: Likewise.
3470 * elfnn-aarch64.c: Likewise.
3471 * elfnn-riscv.c: Likewise.
3472 * elfxx-tilegx.c: Likewise.
3473 * mach-o.c: Likewise.
3474 * peXXigen.c: Likewise.
3475 * vms-alpha.c: Likewise.
3476 * vms-lib.c: Likewise.
3478 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3481 * elflink.c (elf_gc_mark_debug_section): New function.
3482 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3483 referenced by kept debug sections.
3485 2017-05-16 Alan Modra <amodra@gmail.com>
3487 * elf-m10300.c: Rename occurrences of non_ir_ref.
3488 * elf32-arm.c: Likewise.
3489 * elf32-bfin.c: Likewise.
3490 * elf32-cr16.c: Likewise.
3491 * elf32-cris.c: Likewise.
3492 * elf32-d10v.c: Likewise.
3493 * elf32-dlx.c: Likewise.
3494 * elf32-fr30.c: Likewise.
3495 * elf32-frv.c: Likewise.
3496 * elf32-hppa.c: Likewise.
3497 * elf32-i370.c: Likewise.
3498 * elf32-i386.c: Likewise.
3499 * elf32-iq2000.c: Likewise.
3500 * elf32-lm32.c: Likewise.
3501 * elf32-m32c.c: Likewise.
3502 * elf32-m32r.c: Likewise.
3503 * elf32-m68hc1x.c: Likewise.
3504 * elf32-m68k.c: Likewise.
3505 * elf32-mcore.c: Likewise.
3506 * elf32-metag.c: Likewise.
3507 * elf32-microblaze.c: Likewise.
3508 * elf32-moxie.c: Likewise.
3509 * elf32-msp430.c: Likewise.
3510 * elf32-mt.c: Likewise.
3511 * elf32-nios2.c: Likewise.
3512 * elf32-or1k.c: Likewise.
3513 * elf32-ppc.c: Likewise.
3514 * elf32-rl78.c: Likewise.
3515 * elf32-s390.c: Likewise.
3516 * elf32-score.c: Likewise.
3517 * elf32-score7.c: Likewise.
3518 * elf32-sh.c: Likewise.
3519 * elf32-tic6x.c: Likewise.
3520 * elf32-tilepro.c: Likewise.
3521 * elf32-v850.c: Likewise.
3522 * elf32-vax.c: Likewise.
3523 * elf32-xstormy16.c: Likewise.
3524 * elf32-xtensa.c: Likewise.
3525 * elf64-alpha.c: Likewise.
3526 * elf64-hppa.c: Likewise.
3527 * elf64-ia64-vms.c: Likewise.
3528 * elf64-mmix.c: Likewise.
3529 * elf64-ppc.c: Likewise.
3530 * elf64-s390.c: Likewise.
3531 * elf64-sh64.c: Likewise.
3532 * elf64-x86-64.c: Likewise.
3533 * elflink.c: Likewise.
3534 * elfnn-aarch64.c: Likewise.
3535 * elfnn-ia64.c: Likewise.
3536 * elfnn-riscv.c: Likewise.
3537 * elfxx-mips.c: Likewise.
3538 * elfxx-sparc.c: Likewise.
3539 * elfxx-tilegx.c: Likewise.
3540 * linker.c: Likewise.
3542 2017-05-16 Alan Modra <amodra@gmail.com>
3544 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3545 * elflink.c (elf_link_add_object_symbols): Update to use
3547 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3549 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3551 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3553 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3555 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3557 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3558 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3560 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3562 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3564 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3566 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3567 to plt_second/plt_second_eh_frame.
3568 (elf_x86_64_link_hash_newfunc): Updated.
3569 (elf_x86_64_allocate_dynrelocs): Likewise.
3570 (elf_x86_64_size_dynamic_sections): Likewise.
3571 (elf_x86_64_relocate_section): Likewise.
3572 (elf_x86_64_finish_dynamic_symbol): Likewise.
3573 (elf_x86_64_finish_dynamic_sections): Likewise.
3574 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3575 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3577 (elf_backend_setup_gnu_properties): Updated. Create the
3578 .plt.sec section instead of the .plt.sec section.
3580 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3582 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3583 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3584 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3586 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3588 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3589 (bfd_elf64_set_reloc): Define.
3590 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3592 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3594 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3595 (struct bfd_target): New field _bfd_set_reloc.
3596 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3597 * reloc.c (_bfd_generic_set_reloc): New function.
3598 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3599 * nlm-target.h (nlm_set_reloc): Likewise.
3600 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3601 * aout-tic30.c (MY_set_reloc): Likewise.
3602 * aout-target.h (MY_set_reloc): Likewise.
3603 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3604 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3605 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3606 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3607 * aout-adobe.c (aout_32_set_reloc): Likewise.
3608 * bout.c (b_out_set_reloc): Likewise.
3609 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3610 * i386os9k.c (aout_32_set_reloc): Likewise.
3611 * ieee.c (ieee_set_reloc): Likewise.
3612 * oasys.c (oasys_set_reloc): Likewise.
3613 * som.c (som_set_reloc): Likewise.
3614 * versados.c (versados_set_reloc): Likewise.
3615 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3616 _bfd_generic_set_reloc.
3617 (rs6000_xcoff64_aix_vec): LIkewise.
3618 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3619 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3620 * i386msdos.c (msdos_set_reloc): Define to
3621 _bfd_norelocs_set_reloc.
3622 * elfcode.h (elf_set_reloc): Define.
3623 * bfd-in2.h: Regenerated.
3625 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3628 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3629 for IFUNC function address.
3631 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3633 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3634 (CONFLICT_LIST): Likewise.
3635 (opcode/arc-attrs.h): Include.
3636 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3637 (arc_extract_features): New file.
3638 (arc_stralloc): Likewise.
3639 (arc_elf_merge_attributes): Likewise.
3640 (arc_elf_merge_private_bfd_data): Use object attributes.
3641 (bfd_arc_get_mach_from_attributes): New function.
3642 (arc_elf_object_p): Use object attributes.
3643 (arc_elf_final_write_processing): Likewise.
3644 (elf32_arc_obj_attrs_arg_type): New function.
3645 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3646 (elf32_arc_section_from_shdr): Likewise.
3647 (elf_backend_obj_attrs_vendor): Define.
3648 (elf_backend_obj_attrs_section): Likewise.
3649 (elf_backend_obj_attrs_arg_type): Likewise.
3650 (elf_backend_obj_attrs_section_type): Likewise.
3651 (elf_backend_obj_attrs_handle_unknown): Likewise.
3652 (elf_backend_section_from_shdr): Likewise.
3654 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3657 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3658 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3659 and the destination is a Thumb symbol.
3661 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3663 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3664 initializer to silence GCC 4.2.
3665 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3667 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3669 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3670 (LAZY_PLT_ENTRY_SIZE): This.
3671 (NON_LAZY_PLT_ENTRY_SIZE): New.
3672 (elf_x86_64_plt0_entry): Renamed to ...
3673 (elf_x86_64_lazy_plt0_entry): This.
3674 (elf_x86_64_plt_entry): Renamed to ...
3675 (elf_x86_64_lazy_plt_entry): This.
3676 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3677 (elf_x86_64_lazy_bnd_plt0_entry): This.
3678 (elf_x86_64_legacy_plt_entry): Removed.
3679 (elf_x86_64_bnd_plt_entry): Renamed to ...
3680 (elf_x86_64_lazy_bnd_plt_entry): This.
3681 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3682 (elf_x86_64_non_lazy_plt_entry): This.
3683 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3684 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3685 (elf_x86_64_eh_frame_plt): Renamed to ...
3686 (elf_x86_64_eh_frame_lazy_plt): This.
3687 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3688 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3689 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3690 (elf_x86_64_eh_frame_non_lazy_plt): This.
3691 (elf_x86_64_lazy_plt_layout): New.
3692 (elf_x86_64_non_lazy_plt_layout): Likewise.
3693 (elf_x86_64_plt_layout): Likewise.
3694 (elf_x86_64_backend_data): Remove PLT layout information. Add
3695 os for target system.
3696 (GET_PLT_ENTRY_SIZE): Removed.
3697 (elf_x86_64_lazy_plt): New.
3698 (elf_x86_64_non_lazy_plt): Likewise.
3699 (elf_x86_64_lazy_bnd_plt): Likewise.
3700 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3701 (elf_x86-64_arch_bed): Updated.
3702 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3703 (elf_x86_64_create_dynamic_sections): Removed.
3704 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3705 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3706 (elf_x86-64_adjust_dynamic_symbol): Updated.
3707 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3708 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3709 size for PLT0 if there is no PLT0. Get plt_entry_size from
3710 non_lazy_plt for non-lazy PLT entries.
3711 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3712 from non_lazy_plt for non-lazy PLT entries.
3713 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3714 if there is no PLT0.
3715 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3716 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3717 entries with non-lazy PLT layout. Don't fill the second and third
3718 slots in the PLT entry if there is no PLT0.
3719 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3720 if there is no PLT0. Set sh_entsize on the .plt.got section.
3721 (compare_relocs): New.
3722 (elf_x86_64_plt_type): Likewise.
3723 (elf_x86_64_plt): Likewise.
3724 (elf_x86_64_nacl_plt): New. Forward declaration.
3725 (elf_x86_64_get_plt_sym_val): Removed.
3726 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3727 against all dynamic relocations.
3728 (elf_x86_64_link_setup_gnu_properties): New function.
3729 (elf_backend_create_dynamic_sections): Updated.
3730 (elf_backend_setup_gnu_properties): New.
3731 (elf_x86_64_nacl_plt): New.
3732 (elf_x86_64_nacl_arch_bed): Updated.
3734 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3736 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3737 (LAZY_PLT_ENTRY_SIZE): This.
3738 (NON_LAZY_PLT_ENTRY_SIZE): New.
3739 (elf_i386_plt0_entry): Renamed to ...
3740 (elf_i386_lazy_plt0_entry): This.
3741 (elf_i386_plt_entry): Renamed to ...
3742 (elf_i386_lazy_plt_entry): This.
3743 (elf_i386_pic_plt0_entry): Renamed to ...
3744 (elf_i386_pic_lazy_plt0_entry): This.
3745 (elf_i386_pic_plt_entry): Renamed to ...
3746 (elf_i386_pic_lazy_plt_entry): This.
3747 (elf_i386_got_plt_entry): Renamed to ...
3748 (elf_i386_non_lazy_plt_entry): This.
3749 (elf_i386_pic_got_plt_entry): Renamed to ...
3750 (elf_i386_pic_non_lazy_plt_entry): This.
3751 (elf_i386_eh_frame_plt): Renamed to ...
3752 (elf_i386_eh_frame_lazy_plt): This.
3753 (elf_i386_eh_frame_plt_got): Renamed to ...
3754 (elf_i386_eh_frame_non_lazy_plt): This.
3755 (elf_i386_plt_layout): Renamed to ...
3756 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3757 eh_frame_plt_got_size.
3758 (elf_i386_non_lazy_plt_layout): New.
3759 (elf_i386_plt_layout): Likewise.
3760 (elf_i386_non_lazy_plt): Likewise.
3761 (GET_PLT_ENTRY_SIZE): Removed.
3762 (elf_i386_plt): Renamed to ...
3763 (elf_i386_lazy_plt): This.
3764 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3765 (elf_i386_arch_bed): Updated.
3766 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3767 (elf_i386_create_dynamic_sections): Removed.
3768 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3769 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3770 (elf_i386_adjust_dynamic_symbol): Updated.
3771 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3772 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3773 size for PLT0 if there is no PLT0.
3774 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3775 output section is discarded only if GOT isn't empty.
3776 (elf_i386_relocate_section): Updated. Properly get PLT index
3777 if there is no PLT0.
3778 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3779 second and third slots in the PLT entry if there is no PLT0.
3780 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3781 if there is no PLT0. Set sh_entsize on the .plt.got section.
3782 (elf_i386_nacl_plt): Forward declaration.
3783 (elf_i386_get_plt_sym_val): Removed.
3784 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3785 against all dynamic relocations.
3786 (elf_i386_link_setup_gnu_properties): New function.
3787 (elf_backend_create_dynamic_sections): Updated.
3788 (elf_backend_setup_gnu_properties): New.
3789 (elf_i386_nacl_plt): Updated.
3790 (elf_i386_nacl_arch_bed): Likewise.
3791 (elf_i386_vxworks_arch_bed): Likewise.
3793 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3795 * elflink.c (elf_output_implib): Remove executable flag from import
3797 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3798 library is a relocatable object file.
3800 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3803 * elf32-avr.c (avr_should_move_sym): New function.
3804 (avr_should_reduce_sym_size): Likewise.
3805 (avr_should_increase_sym_size): Likewise.
3806 (elf32_avr_relax_delete_bytes): Adjust symbol values
3807 and sizes by calling new functions.
3809 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3811 * config.bfd (riscv32-*): Enable rv64.
3813 2017-05-02 Alan Modra <amodra@gmail.com>
3816 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3817 rather than h->root.type == bfd_link_hash_new.
3818 (bfd_elf_record_link_assignment): Similarly, call
3819 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3821 2017-04-29 Alan Modra <amodra@gmail.com>
3824 * reloc.c (reloc_offset_in_range): New function.
3825 (bfd_perform_relocation, bfd_install_relocation): Use it.
3826 (_bfd_final_link_relocate): Likewise.
3828 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3830 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3831 before using .plt.got.
3832 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3834 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3836 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3837 instead of "+=" to update 0.
3839 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3841 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3842 .plt.got section here.
3843 (elf_i386_check_relocs): Don't create the .plt.got section.
3844 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3845 the .plt.got and .plt.bnd sections here.
3846 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3849 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3851 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3853 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3854 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3855 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3856 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3859 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3861 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3863 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3864 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3865 the first relocatable ELF input with GNU properties.
3867 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3869 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3870 VxWorks for non-PIC.
3872 2017-04-27 Alan Modra <amodra@gmail.com>
3874 * elf-bfd.h (struct elf_backend_data): Make asection param of
3875 elf_backend_eh_frame_address_size const.
3876 (_bfd_elf_eh_frame_address_size): Likewise.
3877 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3878 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3879 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3880 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3881 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3882 (next_cie_fde_offset): Constify params.
3883 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3885 2017-04-27 Alan Modra <amodra@gmail.com>
3887 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3888 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3889 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3891 (offset_adjust): New function.
3892 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3893 (adjust_eh_frame_local_symbols): Likewise.
3894 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3895 after changing anything. Return true if anything changed.
3896 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3897 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3899 2017-04-27 Alan Modra <amodra@gmail.com>
3901 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3904 2017-04-27 Alan Modra <amodra@gmail.com>
3906 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3907 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3908 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3909 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3910 for undef and undefweak dyn_relocs.
3911 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3912 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3913 (allocate_got, allocate_dynrelocs): Likewise.
3914 (ppc64_elf_relocate_section): Likewise.
3916 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3918 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3919 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3920 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3921 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3923 2017-04-26 Nick Clifton <nickc@redhat.com>
3926 * reloc.c (bfd_perform_relocation): Check for a negative address
3929 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3932 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3934 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3935 (elf_backend_always_renumber_dynsyms): Define.
3936 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3937 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3938 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3939 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3941 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3943 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3945 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3946 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3947 sections have been created.
3949 2017-04-26 Nick Clifton <nickc@redhat.com>
3952 * compress.c (bfd_init_section_compress_status): Check the return
3953 value from bfd_malloc.
3955 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3957 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3958 no_finish_dynamic_symbol.
3959 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3961 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3962 weak symbol, don't make it dynamic.
3963 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3964 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3965 relocation for GOT reference.
3966 (elf_x86_64_finish_dynamic_symbol): Abort if
3967 no_finish_dynamic_symbol isn't 0.
3969 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3972 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3973 undefined weak symbol, don't make it dynamic.
3974 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3975 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3976 relocation for R_386_GOT32.
3978 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3981 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3983 2017-04-23 Alan Modra <amodra@gmail.com>
3986 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3987 * elf.c (lcomm_sym): New.
3988 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3989 * bfd-in2.h: Regenerate.
3991 2017-04-23 Alan Modra <amodra@gmail.com>
3994 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3995 parameters and comment.
3996 (_bfd_elf_get_reloc_section): Delete.
3997 (_bfd_elf_plt_get_reloc_section): Declare.
3998 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3999 New functions. Don't blindly skip over assumed .rel/.rela prefix.
4001 (_bfd_elf_get_reloc_section): ..here. Delete.
4002 (assign_section_numbers): Call elf_get_reloc_section.
4003 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
4004 * elfxx-target.h (elf_backend_get_reloc_section): Update.
4006 2017-04-23 Alan Modra <amodra@gmail.com>
4009 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
4012 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4015 * elf32-i386.c (elf_i386_link_hash_entry): Add
4016 no_finish_dynamic_symbol.
4017 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
4018 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
4019 symbol, don't make it dynamic in PIE.
4020 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
4021 set no_finish_dynamic_symbol and generate R_386_RELATIVE
4022 relocation for R_386_GOT32
4023 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
4026 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
4030 * elflink.c (elf_link_add_object_symbols): Require
4031 --no-dynamic-linker with -E/--dynamic-list when creating
4034 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4036 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4039 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
4041 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4042 dynamic symbol sorting.
4044 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
4047 * elflink.c (elf_link_add_object_symbols): Preserve
4048 dynamic_ref_after_ir_def when restoring the symbol table for
4049 unneeded dynamic object.
4051 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
4054 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4055 on on undefined IFUNC symbol in the second PLT.
4057 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
4059 * peXXigen.c (pe_print_reloc): Correct chunk_end.
4061 2017-04-19 Alan Modra <amodra@gmail.com>
4063 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4064 or make dynamic for info->dynamic_undefined_weak 0 and 1.
4065 * elf32-ppc.c:Formatting.
4066 (ensure_undefweak_dynamic): Don't make dynamic when
4067 info->dynamic_undefined_weak is zero.
4068 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4069 info->dynamic_undefined_weak. Discard undef dyn_relocs when
4070 not default visibility. Discard undef and undefweak
4072 (ppc_elf_relocate_section): Adjust to suit.
4073 * elf64-ppc.c: Formatting.
4074 (ensure_undefweak_dynamic): Don't make dynamic when
4075 info->dynamic_undefined_weak is zero.
4076 (allocate_dynrelocs): Discard undefweak dyn_relocs for
4077 info->dynamic_undefined_weak. Discard them earlier.
4079 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
4082 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4083 before generating the version definition section.
4085 2017-04-17 Alan Modra <amodra@gmail.com>
4087 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4088 state when a regular object file defines a symbol with
4089 incompatible type to that defined by an earlier shared lib.
4091 2017-04-13 Alan Modra <amodra@gmail.com>
4093 * coffcode.h: Wrap some overly long _bfd_error_handler args.
4095 * elf32-arm.c: Likewise.
4096 * elf32-i386.c: Likewise.
4097 * elf32-mep.c: Likewise.
4098 * elf64-ia64-vms.c: Likewise.
4099 * elf64-x86-64.c: Likewise.
4100 * elflink.c: Likewise.
4101 * elfnn-ia64.c: Likewise.
4102 * elfxx-mips.c: Likewise.
4104 2017-04-13 Alan Modra <amodra@gmail.com>
4106 * aoutx.h: Use %B and %A in error messages throughout file.
4107 * aout-cris.c: Likewise.
4108 * archive.c: Likewise.
4109 * binary.c: Likewise.
4110 * coff-rs6000.c: Likewise.
4111 * coff-tic4x.c: Likewise.
4112 * coffcode.h: Likewise.
4113 * coffgen.c: Likewise.
4114 * cofflink.c: Likewise.
4115 * coffswap.h: Likewise.
4116 * cpu-arm.c: Likewise.
4117 * elf-eh-frame.c: Likewise.
4118 * elf-m10300.c: Likewise.
4120 * elf32-arc.c: Likewise.
4121 * elf32-arm.c: Likewise.
4122 * elf32-bfin.c: Likewise.
4123 * elf32-frv.c: Likewise.
4124 * elf32-iq2000.c: Likewise.
4125 * elf32-m32c.c: Likewise.
4126 * elf32-microblaze.c: Likewise.
4127 * elf32-nds32.c: Likewise.
4128 * elf32-rl78.c: Likewise.
4129 * elf32-rx.c: Likewise.
4130 * elf32-score.c: Likewise.
4131 * elf32-score7.c: Likewise.
4132 * elf32-sh64.c: Likewise.
4133 * elf32-v850.c: Likewise.
4134 * elf32-vax.c: Likewise.
4135 * elf32-visium.c: Likewise.
4136 * elf64-ia64-vms.c: Likewise.
4137 * elf64-mmix.c: Likewise.
4138 * elf64-sh64.c: Likewise.
4139 * elfcode.h: Likewise.
4140 * elfnn-aarch64.c: Likewise.
4141 * elfnn-ia64.c: Likewise.
4142 * elfxx-mips.c: Likewise.
4143 * hpux-core.c: Likewise.
4146 * linker.c: Likewise.
4147 * merge.c: Likewise.
4149 * oasys.c: Likewise.
4150 * pdp11.c: Likewise.
4151 * peXXigen.c: Likewise.
4152 * rs6000-core.c: Likewise.
4153 * vms-alpha.c: Likewise.
4154 * xcofflink.c: Likewise.
4156 2017-04-13 Alan Modra <amodra@gmail.com>
4158 * bfd.c (PRINT_TYPE): Define.
4159 (_doprnt): New function.
4160 (error_handler_internal): Use _doprnt.
4161 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4162 calls in their natural order, throughout file.
4163 * coff-mcore.c: Likewise.
4164 * coff-ppc.c: Likewise.
4165 * coff-tic80.c: Likewise.
4166 * cofflink.c: Likewise.
4167 * elf-s390-common.c: Likewise.
4169 * elf32-arm.c: Likewise.
4170 * elf32-i386.c: Likewise.
4171 * elf32-m32r.c: Likewise.
4172 * elf32-msp430.c: Likewise.
4173 * elf32-spu.c: Likewise.
4174 * elf64-ia64-vms.c: Likewise.
4175 * elf64-sparc.c: Likewise.
4176 * elf64-x86-64.c: Likewise.
4177 * elflink.c: Likewise.
4178 * elfnn-aarch64.c: Likewise.
4179 * elfnn-ia64.c: Likewise.
4180 * elfxx-mips.c: Likewise.
4182 2017-04-13 Alan Modra <amodra@gmail.com>
4184 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4185 branch veneers" error. Fix double space and format message.
4186 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4187 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4189 2017-04-13 Alan Modra <amodra@gmail.com>
4191 * bfd-in2.h: Regenerate.
4193 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4195 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4196 extra `\n' in warning/error messages.
4197 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4198 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4200 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
4202 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4203 processor-specific properties with generic ELF target vector.
4205 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
4207 * elf32-sparc.c (elf_backend_fixup_symbol): New.
4208 * elf64-sparc.c (elf_backend_fixup_symbol): New.
4209 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4210 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4212 (link_hash_newfunc): Initialize has_got_reloc and
4214 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4216 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4218 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4220 (_bfd_sparc_elf_fixup_symbol): New function.
4221 (allocate_dynrelocs): Don't allocate space for dynamic
4222 relocations and discard relocations against resolved undefined
4223 weak symbols in executable. Don't make resolved undefined weak
4224 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
4225 relocation against undefined weak symbols in PIE.
4226 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4227 relocations against resolved undefined weak symbols in PIE
4228 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4229 without ynamic PLT/GOT relocations for resolved undefined weak
4231 Don't generate dynamic relocation against resolved undefined
4232 weak symbol in executable.
4233 (pie_finish_undefweak_symbol): New function.
4234 (_bfd_sparc_elf_finish_dynamic_sections): Call
4235 pie_finish_undefweak_symbol on all symbols in PIE.
4236 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4237 (_bfd_sparc_elf_fixup_symbol): New function.
4239 2017-04-10 Nick Clifton <nickc@redhat.com>
4241 * config.bfd: Remove ns32k from obsolete list.
4243 2017-04-10 Alan Modra <amodra@gmail.com>
4246 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4247 (special_sections_i): Likewise for .init_array.
4248 (special_sections_p): Likewise for .preinit_array.
4250 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
4254 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4255 ELF_COMMON_DEF_P for common symbols.
4256 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4257 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4258 * elflink.c (_bfd_elf_merge_symbol): Revert commits
4259 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4260 07492f668d2173da7a2bda3707ff0985e0f460b6.
4262 2017-04-07 Pedro Alves <palves@redhat.com>
4264 * opncls.c (bfd_get_debug_link_info): Rename to...
4265 (bfd_get_debug_link_info_1): ... this. Change type of second
4266 parameter to void pointer. Adjust.
4267 (bfd_get_debug_link_info): Reimplement on top of
4268 bfd_get_debug_link_info_1.
4269 (separate_debug_file_exists, separate_alt_debug_file_exists):
4270 Change type of second parameter to void pointer. Adjust.
4271 (get_func_type, check_func_type): Change type of second parameter
4273 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4274 the callback functions instead of passing the address of a local.
4275 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4276 find_separate_debug_file.
4277 (get_alt_debug_link_info_shim): Change type of second parameter to
4278 void pointer. Adjust.
4279 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4280 find_separate_debug_file.
4281 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4282 of second parameter to void pointer. Adjust.
4283 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4284 pointer local to find_separate_debug_file.
4286 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4288 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4289 external symbols with a definition.
4290 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4292 2017-04-07 Alan Modra <amodra@gmail.com>
4294 * po/SRC-POTFILES.in: Regenerate.
4296 2017-04-05 Alan Modra <amodra@gmail.com>
4298 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4301 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4303 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4304 numbers for DataDirectory entry indicies passed to
4307 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4309 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4310 each GNU_MBIND section and align GNU_MBIND section to page size.
4311 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4312 segment for each GNU_MBIND section.
4313 (_bfd_elf_init_private_section_data): Copy sh_info from input
4314 for GNU_MBIND section.
4316 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4318 * elfnn-riscv.c (GP_NAME): Delete.
4319 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4320 (_bfd_riscv_relax_lui): Likewise.
4322 2017-04-04 Nick Clifton <nickc@redhat.com>
4325 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4327 (bfd_elf_final_link): Only initialize the extended symbol index
4328 section if there are extended symbol tables to list.
4330 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4332 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4333 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4334 * configure.ac (elf): Add elf-properties.lo.
4335 * Makefile.in: Regenerated.
4336 * configure: Likewise.
4337 * elf-bfd.h (elf_property_kind): New.
4338 (elf_property): Likewise.
4339 (elf_property_list): Likewise.
4340 (elf_properties): Likewise.
4341 (_bfd_elf_parse_gnu_properties): Likewise.
4342 (_bfd_elf_get_property): Likewise.
4343 (_bfd_elf_link_setup_gnu_properties): Likewise.
4344 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4345 and setup_gnu_properties.
4346 (elf_obj_tdata): Add properties.
4347 * elf-properties.c: New file.
4348 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4349 (elf_i386_merge_gnu_properties): Likewise.
4350 (elf_backend_parse_gnu_properties): Likewise.
4351 (elf_backend_merge_gnu_properties): Likewise.
4352 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4353 (elf_x86_64_merge_gnu_properties): Likewise.
4354 (elf_backend_parse_gnu_properties): Likewise.
4355 (elf_backend_merge_gnu_properties): Likewise.
4356 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4357 (elf_backend_parse_gnu_properties): Likewise.
4358 (elf_backend_setup_gnu_properties): Likewise.
4359 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4360 elf_backend_merge_gnu_properties and
4361 elf_backend_setup_gnu_properties.
4363 2017-03-30 Pip Cet <pipcet@gmail.com>
4365 * elf32-wasm32.c: Add relocation code, two relocs.
4366 * reloc.c: Add wasm32 relocations.
4367 * libbfd.h: Regenerate.
4368 * bfd-in2.h: Regenerate.
4369 * bfd/po/bfd.pot: Regenerate.
4371 2017-03-29 Nick Clifton <nickc@redhat.com>
4374 * coff-bfd.h (struct coff_section_data): Add new fields:
4375 saved_bias and bias.
4376 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4377 computed for PE binaries.
4378 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4381 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4384 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4385 to handle a local symbol with a hash-symbol-entry; without PLT.
4386 Add BFD_ASSERT for an incidental case with GOT entry present.
4387 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4388 isn't forced-or-set local.
4390 2017-03-27 Pip Cet <pipcet@gmail.com>
4392 * wasm-module.c: New file to support WebAssembly modules.
4393 * wasm-module.h: New file to support WebAssembly modules.
4394 * doc/webassembly.texi: Start documenting wasm-module.c.
4395 * config.bfd: Add wasm_vec.
4396 * targets.c: Likewise.
4397 * configure.ac: Likewise.
4398 * Makefile.am: Add entries for wasm-module.c.
4399 * Makefile.in: Regenerate.
4400 * configure: Regenerate.
4401 * po/SRC-POTFILES.in: Regenerate.
4403 2017-03-27 Pip Cet <pipcet@gmail.com>
4405 * cpu-wasm32.c: New file to support wasm32 architecture.
4406 * elf32-wasm32.c: New file to support wasm32 architecture.
4407 * Makefile.am: Add wasm32 architecture.
4408 * archures.c: Likewise.
4409 * config.bfd: Likewise.
4410 * configure.ac: Likewise.
4411 * targets.c: Likewise.
4412 * Makefile.in: Regenerate.
4413 * bfd-in2.h: Regenerate.
4414 * configure: Regenerate.
4415 * po/SRC-POTFILES.in: Regenerate.
4417 2017-03-20 Alan Modra <amodra@gmail.com>
4420 * elf64-ppc.c (compare_symbols): Stabilize sort.
4422 2017-03-18 Alan Modra <amodra@gmail.com>
4424 * elf64-ppc.c (struct ppc_link_hash_table): Add
4425 local_ifunc_resolver and maybe_local_ifunc_resolver.
4426 (ppc_build_one_stub): Set flags on emitting dynamic
4427 relocation to ifunc.
4428 (ppc64_elf_relocate_section): Likewise.
4429 (ppc64_elf_finish_dynamic_symbol): Likewise.
4430 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4431 local dynamic relocs to ifuncs.
4432 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4433 local_ifunc_resolver and maybe_local_ifunc_resolver.
4434 (ppc_elf_relocate_section): Set flag on emitting dynamic
4435 relocation to ifuncs.
4436 (ppc_elf_finish_dynamic_symbol): Likewise.
4437 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4438 dynamic relocs to ifuncs.
4440 2017-03-13 Nick Clifton <nickc@redhat.com>
4443 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4444 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4445 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4446 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4447 * bfd-in2.h: Regenerate.
4448 * libbfd.h: Regenerate.
4449 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4451 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4452 (elfNN_aarch64_howto_table): Likewise.
4453 (aarch64_tls_transition_without_check): Likewise.
4454 (aarch64_reloc_got_type): Likewise.
4455 (elfNN_aarch64_final_link_relocate): Likewise.
4456 (elfNN_aarch64_tls_relax): Likewise.
4457 (elfNN_aarch64_relocate_section): Likewise.
4458 (elfNN_aarch64_gc_sweep_hook): Likewise.
4459 (elfNN_aarch64_check_relocs): Likewise.
4460 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4461 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4463 2017-03-11 Alan Modra <amodra@gmail.com>
4465 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4466 parameter is in fact used. Whitespace fixes.
4467 * elf64-ppc.c: Likewise.
4469 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4471 * rs6000-core.c (CORE_NEW): Simplify macro when
4472 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4474 2017-03-07 Alan Modra <amodra@gmail.com>
4478 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4481 2017-03-05 Alan Modra <amodra@gmail.com>
4483 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4484 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4485 (next_cie_fde_offset): New function.
4486 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4487 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4488 four bytes. Align CIEs to four or eight bytes depending on
4489 per_encoding_aligned8. Align FDEs according to their encoding.
4490 Pad last FDE to output section alignment.
4491 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4493 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4494 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4495 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4497 2017-03-02 Martin Bickel <binutils@ineranves.de>
4500 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4501 empty segments which have a zero filesz, but a non-zero memsz.
4503 2017-03-02 Alan Modra <amodra@gmail.com>
4505 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4507 2017-02-28 Alan Modra <amodra@gmail.com>
4509 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4510 (ppc64_elf_relocate_section): Likewise.
4512 2017-02-28 Alan Modra <amodra@gmail.com>
4515 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4516 rather than elf32_nios2_hash_table or elf_hash_table.
4517 (create_got_section): Likewise.
4518 (nios2_elf32_finish_dynamic_symbol): Likewise.
4519 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4520 (nios2_elf32_size_dynamic_sections): Likewise.
4521 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4522 vars. Use htab equivalents directly instead. Don't create
4523 all dynamic sections on needing just the GOT. Use a goto
4524 rather than a fall-through with reloc test. Ensure
4525 htab->dynobj is set when making dynamic sreloc section.
4526 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4527 equivalent directly instead. Don't segfault on looking for
4528 .dynamic when dynamic sections have not been created. Don't
4529 segfault on .got.plt being discarded.
4530 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4531 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4532 fixme and another not so relevant comment.
4533 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4534 already set, set hash table dynobj on creating .sbss.
4536 2017-02-28 Alan Modra <amodra@gmail.com>
4538 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4539 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4540 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4541 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4542 (ppc64_elf_relocate_section): Likewise.
4543 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4544 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4545 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4546 * libbfd.h: Regenerate.
4547 * bfd-in2.h: Regenerate.
4549 2017-02-28 Alan Modra <amodra@gmail.com>
4551 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4552 dynamic .data.rel.ro read-only.
4553 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4554 rather than section flags when deciding where copy reloc goes.
4555 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4556 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4557 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4558 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4559 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4560 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4561 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4562 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4563 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4564 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4565 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4566 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4567 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4568 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4569 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4570 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4571 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4572 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4573 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4575 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4577 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4578 `jalr $0, $25' instruction encoding.
4580 2017-02-27 Nick Clifton <nickc@redhat.com>
4583 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4584 generating a seg-fault when encountering a symbol that has been
4585 deleted by garbage collection.
4587 2017-02-25 Alan Modra <amodra@gmail.com>
4589 * elf32-arc.c (struct dynamic_sections): Delete.
4590 (enum dyn_section_types): Delete.
4591 (dyn_section_names): Delete.
4592 (arc_create_dynamic_sections): Delete.
4593 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4594 segfault on discarded .rela.plt section.
4595 (elf_arc_size_dynamic_sections): Formatting. Don't call
4596 arc_create_dynamic_sections. Don't allocate memory for sections
4597 handled by the generic linker. Correct code finding relocs in
4598 read-only sections. Set SEC_EXCLUDE on zero size .got,
4599 .got.plt, and .dynbss sections. Do set .interp for pies.
4601 2017-02-24 Andrew Waterman <andrew@sifive.com>
4603 * elfnn-riscv.c (GP_NAME): New macro.
4604 (riscv_global_pointer_value): Use it.
4605 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4606 output section, consider only that section's alignment.
4608 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4610 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4611 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4612 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4613 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4615 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4617 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4618 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4621 2017-02-23 Alan Modra <amodra@gmail.com>
4624 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4626 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4627 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4630 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4633 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4634 processing ahead of the call to `elf_gc_sweep_symbol'.
4636 2017-02-22 Nick Clifton <nickc@redhat.com>
4639 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4640 created section 4-byte alignment.
4642 2017-02-22 Alan Modra <amodra@gmail.com>
4644 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4645 on .got or .plt output section being discarded by script.
4646 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4649 2017-02-21 Alan Modra <amodra@gmail.com>
4651 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4652 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4654 2017-02-20 Alan Modra <amodra@gmail.com>
4657 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4658 if DT_RELSZ/DT_RELASZ is zero.
4660 2017-02-17 Nick Clifton <nickc@redhat.com>
4662 * compress.c (bfd_get_full_section_contents): Remember to reduce
4663 compressed size by the sizeof the compression header when
4664 decompressing the contents.
4666 2017-02-17 Pedro Alves <palves@redhat.com>
4668 * srec.c (Chunk): Rename to ...
4669 (_bfd_srec_len): ... this.
4670 (S3Forced): Rename to ...
4671 (_bfd_srec_forceS3): ... this.
4672 * objcopy.c: Adjust all references.
4674 2017-02-17 Pedro Alves <palves@redhat.com>
4676 * archive.c (bsd_write_armap): Rename to ...
4677 (_bfd_bsd_write_armap): ... this.
4678 (coff_write_armap): Rename to ...
4679 (_bfd_coff_write_armap): ... this.
4680 * libbfd-in.h (bsd_write_armap): Rename to ...
4681 (_bfd_bsd_write_armap): ... this.
4682 (coff_write_armap): Rename to ...
4683 (_bfd_coff_write_armap): ... this.
4684 * aout-target.h, aout-tic30.c: Adjust all users.
4685 * libbfd.h: Regenerate.
4687 2017-02-17 Pedro Alves <palves@redhat.com>
4689 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4690 (warn_deprecated): Rename to ...
4691 (_bfd_warn_deprecated): ... this.
4692 * libbfd.c (warn_deprecated): Rename to ...
4693 (_bfd_warn_deprecated): ... this.
4694 * bfd-in2.h: Regenerate.
4696 2017-02-17 Pedro Alves <palves@redhat.com>
4698 * bfdio.c (real_ftell): Rename to ...
4699 (_bfd_real_ftell): ... this.
4700 (real_fseek): Rename to ...
4701 (_bfd_real_fseek): ... this.
4702 (real_fopen): Rename to ...
4703 (_bfd_real_fopen): ... this.
4704 * libbfd-in.h (real_ftell): Rename to ...
4705 (_bfd_real_ftell): ... this.
4706 (real_fseek): Rename to ...
4707 (_bfd_real_fseek): ... this.
4708 (real_fopen): Rename to ...
4709 (_bfd_real_fopen): ... this.
4710 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4711 * libbfd.h: Regenerate.
4713 2017-02-17 Pedro Alves <palves@redhat.com>
4715 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4716 * libbfd.c (read_unsigned_leb128): Rename to ...
4717 (_bfd_read_unsigned_leb128): ... this.
4718 (read_signed_leb128): Rename to ...
4719 (_bfd_read_signed_leb128): ... this.
4720 (safe_read_leb128): Rename to ...
4721 (_bfd_safe_read_leb128): ... this.
4722 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4723 (_bfd_read_unsigned_leb128): ... this.
4724 (read_signed_leb128): Rename to ...
4725 (_bfd_read_signed_leb128): ... this.
4726 (safe_read_leb128): Rename to ...
4727 (_bfd_safe_read_leb128): ... this.
4728 * libbfd.h: Renegerate.
4730 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4732 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4733 before trying to fine matching file and line information.
4735 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4737 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4738 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4739 not match current bfd, then reload debug information. Record bfd
4740 we're loading debug info for in the stash. If we have debug
4741 informatin in the cache then perform section placement before
4744 2017-02-16 Alan Modra <amodra@gmail.com>
4747 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4748 * elfxx-target.h (elf_backend_no_page_alias): Define.
4749 (elfNN_bed): Init new field.
4750 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4751 ensure PT_LOAD segment starts on a new page.
4752 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4754 2017-02-16 Alan Modra <amodra@gmail.com>
4757 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4760 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4762 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4763 * bfd-in2.h: Regenerated.
4765 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4768 * elf32-i386.c (elf_i386_relocate_section): Allow
4769 "lea foo@GOT, %reg" in PIC.
4771 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4774 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4775 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4776 error against local IFUNC symbol without a base register for
4779 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4781 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4782 `%P: %H:' with `info->callbacks->einfo'.
4783 (ppc_elf_relocate_section): Likewise.
4784 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4785 (ppc64_elf_edit_toc): Likewise.
4786 (ppc64_elf_relocate_section): Likewise.
4788 2017-02-14 Alan Modra <amodra@gmail.com>
4790 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4791 --gc-keep-exported, and test versioned field of sym rather than
4792 looking for @ in name.
4794 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4796 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4799 2017-02-13 Nick Clifton <nickc@redhat.com>
4802 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4805 2017-02-07 Andrew Waterman <andrew@sifive.com>
4807 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4808 entry size if PLT header is written.
4810 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4812 Fix sparc64 dynamic relocation processing to use the dynamic
4814 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4815 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4818 2017-02-03 Nick Clifton <nickc@redhat.com>
4821 * coffcode.h (coff_write_object_contents): Enlarge size of
4822 s_name_buf in order to avoid compile time warning about possible
4824 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4825 32-bits of insn value before printing into buffer.
4827 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4829 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4830 `max_local_dynindx'.
4831 (mips_elf_sort_hash_table): Handle it.
4832 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4833 symbols bump up `max_local_dynindx' rather than
4834 `max_non_got_dynindx'.
4836 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4838 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4839 `min_got_dynindx', `max_unref_got_dynindx' and
4840 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4841 (mips_elf_sort_hash_table): Adjust accordingly.
4843 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4845 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4846 to access the hash table.
4848 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4850 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4851 non-NULL `htab' to the beginning.
4853 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4855 * elflink.c (elf_gc_sweep): Wrap overlong line.
4857 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4859 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4860 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4861 * elfxx-mips.c (mips_elf_link_hash_table): Add
4862 `ignore_branch_isa' member.
4863 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4864 in branch relocation calculation as an error if
4865 `ignore_branch_isa' has been set.
4866 (_bfd_mips_elf_insn32): Rename to...
4867 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4868 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4869 Handle the new parameter.
4871 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4873 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4874 local variable dynobj.
4877 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4878 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4879 executable from read-only sections into sdynrelro.
4880 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4881 dynamic relocs in sdynrelro.
4882 (elf_backend_want_dynrelro): Define.
4884 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4886 * config.bfd (*-*-rtemsaout*): Mark as removed.
4888 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4890 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4891 (arm-*-rtems*): Move to (arm*-*-eabi*).
4892 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4893 (m68-*-rtems*): Move to (m68*-*-elf*).
4895 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4897 * config.bfd (*-*-rtemscoff*): Mark as removed.
4899 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4902 * elflink.c (bfd_elf_record_link_assignment): Revert last
4903 change and don't ever clear `forced_local'. Set `mark'
4905 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4907 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4908 (bfd_elf_size_dynamic_sections): ... here.
4909 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4910 and set `mark' instead in `__tls_get_addr_opt' processing.
4911 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4913 2017-01-24 Alan Modra <amodra@gmail.com>
4915 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4916 where dynamic relocs are preferable. Allow ifunc too.
4917 (ensure_undefweak_dynamic): New function.
4918 (allocate_dynrelocs): Use it here. Move plt handling last and
4919 don't make symbols dynamic, simplifying loop. Only make undef
4920 weak symbols with GOT entries dynamic. Correct condition
4921 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4922 comments. Remove goto.
4923 (ppc_elf_relocate_section): Correct test for using dynamic
4924 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4925 to suit. Set up explicit tls_index entries and implicit GOT
4926 tls_index entries resolvable at link time for
4927 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4928 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4929 (ensure_undefweak_dynamic): New function.
4930 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4931 with GOT entries dynamic. Remove unnecessary test of
4932 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4933 (ppc64_elf_relocate_section): Correct test for using dynamic
4934 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4935 to suit. Set up explicit tls_index entries and implicit GOT
4936 tls_index entries resolvable at link time for __tls_get_addr_opt.
4937 Simplify expression to clear mem for prelink.
4939 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4941 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4943 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4945 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4946 (elf_backend_hash_symbol): Define.
4948 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4951 * elflink.c (bfd_elf_record_link_assignment): Clear any
4952 `forced_local' marking for DSO symbols that are not being
4955 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4957 * elfnn-riscv.c (riscv_elf_object_p): New function.
4959 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4962 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4964 (elf_x86_64_check_relocs): Create .eh_frame section for the
4966 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4967 .eh_frame section for the .plt.bnd section.
4968 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4969 for the .plt.bnd section.
4971 2017-01-12 Nick Clifton <nickc@redhat.com>
4974 * opncls.c (find_separate_debug_file): Add include_dirs
4975 parameter. Only include the directory part of the bfd's filename
4976 in search paths if include_dirs is true. Add a couple of extra
4977 locations for looking for debug files.
4978 ( bfd_follow_gnu_debuglink): Update invocation of
4979 find_separate_debug_file.
4980 (bfd_follow_gnu_debugaltlink): Likewise.
4981 (get_build_id): New function: Finds the build-id of the given bfd.
4982 (get_build_id_name): New function: Computes the name of the
4983 separate debug info file for a bfd, based upon its build-id.
4984 (check_build_id_file): New function: Checks to see if a separate
4985 debug info file exists at the given location, and that its
4986 build-id matches that of the original bfd.
4987 (bfd_follow_build_id_debuglink): New function: Finds a separate
4988 debug info file for a given bfd by using the build-id method.
4989 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4990 method of locating a separate debug info file before using the
4992 * bfd-in2.h: Regenerate.
4994 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4997 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4998 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4999 elf_x86_64_eh_frame_plt_got.
5000 (elf_x86_64_size_dynamic_sections): Get unwind info from
5001 elf_x86_64_bnd_arch_bed for the BND PLT.
5003 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
5005 * config.bfd: Add entries for i686-redox and x86_64-redox.
5007 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5009 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
5011 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
5012 .eh_frame section to 4 bytes for x32.
5013 (elf_x86_64_check_relocs): Likewise.
5015 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5018 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
5019 (PLT_GOT_FDE_LENGTH): Likewise.
5020 (elf_i386_plt_layout): Add eh_frame_plt_got and
5021 eh_frame_plt_got_size.
5022 (elf_i386_plt): Updated.
5023 (elf_i386_link_hash_table): Add plt_got_eh_frame.
5024 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
5025 (elf_i386_size_dynamic_sections): Allocate and initialize
5026 .eh_frame section for .plt.got.
5027 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
5029 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5030 eh_frame_plt_got_size.
5031 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5032 (PLT_GOT_FDE_LENGTH): Likewise.
5033 (elf_x86_64_backend_data): Add eh_frame_plt_got and
5034 eh_frame_plt_got_size.
5035 (elf_x86_64_arch_bed): Updated.
5036 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5037 eh_frame_plt_got_size.
5038 (elf_x86_64_nacl_arch_bed): Likewise.
5039 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5040 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5041 (elf_x86_64_size_dynamic_sections): Allocate and initialize
5042 .eh_frame section for .plt.got.
5043 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5046 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
5048 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5049 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5051 2017-01-09 Nick Clifton <nickc@redhat.com>
5053 * dwarf2.c (lookup_address_in_function_table): Return early if
5054 there are no functions in the given comp unit, or if the high
5055 address of the last function in the comp unit is less than the
5058 2017-01-09 Nick Clifton <nickc@redhat.com>
5061 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5062 message if there are too many symbols to load.
5064 2017-01-04 James Clarke <jrtc27@jrtc27.com>
5066 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5067 if relocs are cached.
5069 2017-01-03 Rich Felker <bugdal@aerifal.cx>
5072 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5073 for R_MICROBLAZE_GOTOFF_64.
5075 2017-01-03 Nick Clifton <nickc@redhat.com>
5077 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5078 warning about using a possibly uninitialised variable.
5080 2017-01-02 Alan Modra <amodra@gmail.com>
5082 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5083 (allocate_plt_static, allocate_dynrelocs): Use it.
5085 2017-01-02 Alan Modra <amodra@gmail.com>
5087 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5088 .PARISC.unwind section.
5090 2017-01-02 Alan Modra <amodra@gmail.com>
5093 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5094 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5095 indirect to GOT pointer relative code edit.
5097 2017-01-02 Alan Modra <amodra@gmail.com>
5099 Update year range in copyright notice of all files.
5101 For older changes see ChangeLog-2016
5103 Copyright (C) 2017 Free Software Foundation, Inc.
5105 Copying and distribution of this file, with or without modification,
5106 are permitted in any medium without royalty provided the copyright
5107 notice and this notice are preserved.
5113 version-control: never