Update my e-mail address.
[binutils-gdb.git] / bfd / ChangeLog
blob2362ca0a4fc8788c0fd40f5096ae5b8c8a9442b3
1 2017-11-05  Alan Modra  <amodra@gmail.com>
3         PR 22397
4         * bfd.c (_bfd_doprnt_scan): Check args index before storing, not
5         after.
7 2017-11-05  Alan Modra  <amodra@gmail.com>
9         PR 22397
10         * bfd.c (union _bfd_doprnt_args): New.
11         (PRINT_TYPE): Add FIELD arg.  Take value from args.
12         (_bfd_doprnt): Replace ap parameter with args.  Adjust all
13         PRINT_TYPE invocations and reading of format args to suit.
14         Move "%%" handling out of switch handling args.  Support
15         positional parameters.
16         (_bfd_doprnt_scan): New function.
17         (error_handler_internal): Call _bfd_doprnt_scan and read args.
19 2017-11-04  Alan Modra  <amodra@gmail.com>
21         * elf32-ppc.c (got_entries_needed, got_relocs_needed): New functions.
22         (allocate_dynrelocs, ppc_elf_size_dynamic_sections): Use them here.
23         (ppc_elf_relocate_section): Don't output a dynamic relocation
24         for IE GOT entries in an executable.
25         * elf64-ppc.c (allocate_got): Trim unnecessary TPREL relocs.
26         (ppc64_elf_size_dynamic_sections): Likewise.
27         (ppc64_elf_relocate_section): Likewise.
29 2017-11-04  Alan Modra  <amodra@gmail.com>
31         * elf32-ppc.c (readonly_dynrelocs): Delete info param.  Update all
32         callers.  Don't bother with SEC_ALLOC test.  Return section pointer.
33         Move minfo call to..
34         (maybe_set_textrel): ..here.
35         * elf64-ppc.c (readonly_dynrelocs): Return section pointer.
36         (maybe_set_textrel): Call minfo to print textrel warning to map file.
38 2017-11-04  Alan Modra  <amodra@gmail.com>
40         * elf32-hppa.c (enum _tls_type): Move.
41         (struct elf32_hppa_link_hash_entry): Make tls_type a bitfield.
42         (elf32_hppa_check_relocs): Set DF_STATIC_TLS only for shared libraries.
43         Tidy tls_type handling.  Set symbol tls_type for GOT_TLS_LDM too.
44         (got_entries_needed, got_relocs_needed): New functions.
45         (allocate_dynrelocs): Use them.
46         (elf32_hppa_size_dynamic_sections): Likewise.
47         (elf32_hppa_relocate_section): Delete bogus FIXME.  Formatting.
48         Correct code emitting relocs on GD/IE got entries.  Report an
49         error when a symbol has both normal and TLS GOT relocs.
51 2017-11-04  Alan Modra  <amodra@gmail.com>
53         PR 22394
54         * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs
55         for plabels when non-pic.
56         (maybe_set_textrel): New function.
57         (readonly_dynrelocs): Move and rewrite.
58         (elf32_hppa_adjust_dynamic_symbol): Use it.  Don't create copy
59         relocs when def_regular or -z nocopyreloc.  Handle non_got_ref
60         for functions.  Expand non_got_ref comments.
61         (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
63 2017-11-03  H.J. Lu  <hongjiu.lu@intel.com>
65         * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1.
66         Don't use func_pointer_refcount.  Don't set plt.refcount nor
67         non_got_ref for function pointer reference.
68         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
69         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use
70         func_pointer_refcount.
71         (_bfd_x86_elf_copy_indirect_symbol): Don't copy
72         func_pointer_refcount.
73         (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount.
74         * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise.
75         (elf_x86_link_hash_entry): Remove func_pointer_refcount.
77 2017-11-03  Mingi Cho  <mgcho.minic@gmail.com>
78             Nick Clifton  <nickc@redhat.com>
80         PR 22385
81         * coffgen.c (_bfd_coff_get_external_symbols): Check for an
82         overlarge raw syment count.
83         (coff_get_normalized_symtab): Likewise.
85 2017-11-01  James Bowman  <james.bowman@ftdichip.com>
87         * archures.c: Add bfd_mach_ft32b.
88         * cpu-ft32.c: Add arch_info_struct.
89         * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1,
90         DIFF32.
91         (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1,
92         DIFF32.
93         (ft32_reloc_shortable, elf32_ft32_is_diff_reloc)
94         (elf32_ft32_adjust_diff_reloc_value)
95         (elf32_ft32_adjust_reloc_if_spans_insn)
96         (elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target)
97         (ft32_elf_relax_section): New function.
98         * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32.
99         * bfd-in2.h: Regenerate.
100         * libbfd.h: Regenerate.
102 2017-11-01  Nick Clifton  <nickc@redhat.com>
104         PR 22376
105         * coffcode.h (coff_slurp_line_table): Check for an excessively
106         large line number count.
108 2017-11-01  Nick Clifton  <nickc@redhat.com>
110         PR 22373
111         * peicode.h (pe_bfd_read_buildid): Revise check for invalid size
112         and offset in light of further possible bogus values.
114 2017-11-01  Alan Modra  <amodra@gmail.com>
116         PR 22374
117         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt
118         entry when just a dynamic reloc can serve.  Ensure no dynamic
119         relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref.
120         Expand and move the non_got_ref comment.
121         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
123 2017-11-01  Nick Clifton  <nickc@redhat.com>
125         PR 22369
126         * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF
127         file.
128         * cofflink.c (coff_link_check_archive_element): Skip non-COFF
129         members of an archive.
131 2017-10-31  Nick Clifton  <nickc@redhat.com>
133         PR 22373
134         * peicode.h (pe_bfd_read_buildid): Check for invalid size and data
135         offset values.
137 2017-10-30  Alan Modra  <amodra@gmail.com>
139         * elf32-frv.c (ELF_TARGET_ID): Don't define for generic
140         elf target.
142         * elflink.c (elf_gc_sweep): Test elf_object_id in addition to
143         relocs_compatible.
144         (bfd_elf_gc_sections): Likewise.
146 2017-10-30  Alan Modra  <amodra@gmail.com>
148         PR 22269
149         * elf32-hppa.c (elf32_hppa_check_relocs): Move SEC_ALLOC test to
150         ensure non_got_ref is not set due to debug references.
151         (elf32_hppa_adjust_dynamic_symbol): Tidy plabel handling.  Use
152         SYMBOL_CALLS_LOCAL and UNDEFWEAK_NO_DYNAMIC_RELOC when determining
153         need for a plt entry.
154         (allocate_dynrelocs): Similarly for got entries.  Tidy code discarding
155         dynamic relocs when pic.  Remove bogus code attempting to handle
156         commons.
157         (elf32_hppa_relocate_section): Similarly.  Delete resolved_to_zero
158         and simplify.
159         (elf32_hppa_finish_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC
160         and SYMBOL_REFERENCES_LOCAL in GOT handling.
162 2017-10-28  Alan Modra  <amodra@gmail.com>
164         PR 22300
165         * elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
166         * elf32-hppa.c (elf_backend_relocs_compatible): Define.
167         * elf32-ppc.c (elf_backend_relocs_compatible): Define.
168         * elf64-ppc.c (elf_backend_relocs_compatible): Define.
170 2017-10-25  Alan Modra  <amodra@gmail.com>
172         * archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
173         optionally prefixed with "_".
174         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
176 2017-10-24  Andrew Waterman  <andrew@sifive.com>
178         * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
179         when rd is x0.
181 2017-10-24  Renlin Li  <renlin.li@arm.com>
183         PR ld/21703
184         * elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
186 2017-10-23  Nick Clifton  <nickc@redhat.com>
188         PR 22319
189         * elflink.c (elf_link_output_extsym): Keep global undefined
190         symbols if they have been marked as needed.
192 2017-10-23  Maciej W. Rozycki  <macro@imgtec.com>
194         * elfn32-mips.c (mips_elf_n32_mkobject): New prototype and
195         function.
196         (bfd_elf32_mkobject): Use `mips_elf_n32_mkobject' rather than
197         `_bfd_mips_elf_mkobject'.
199 2017-10-22  Hans-Peter Nilsson  <hp@axis.com>
201         PR gas/22304
202         * config.bfd (cris-*-* | crisv32-*-*): Require a 64-bit BFD.
204 2017-10-19  Palmer Dabbelt  <palmer@dabbelt.com>
206         * elfnn-riscv.c (riscv_pcgp_hi_reloc): New structure.
207         (riscv_pcgp_lo_reloc): Likewise.
208         (riscv_pcgp_relocs): Likewise.
209         (riscv_init_pcgp_relocs): New function.
210         (riscv_free_pcgp_relocs): Likewise.
211         (riscv_record_pcgp_hi_reloc): Likewise.
212         (riscv_record_pcgp_lo_reloc): Likewise.
213         (riscv_delete_pcgp_hi_reloc): Likewise.
214         (riscv_use_pcgp_hi_reloc): Likewise.
215         (riscv_record_pcgp_lo_reloc): Likewise.
216         (riscv_find_pcgp_lo_reloc): Likewise.
217         (riscv_delete_pcgp_lo_reloc): Likewise.
218         (_bfd_riscv_relax_pc): Likewise.
219         (_bfd_riscv_relax_section): Handle R_RISCV_PCREL_* relocations
220         via the new functions above.
222 2017-10-19  Palmer Dabbelt  <palmer@dabbelt.com>
224         * elfnn-riscv.c (R_RISCV_DELETE): New define.
225         (_bfd_riscv_relax_delete): New function.
226         (perform_relocation): Handle R_RISCV_DELETE.
227         (_bfd_riscv_relax_section): Likewise.
229 2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
231         PR ld/22263
232         * elfxx-tilegx.c (tilegx_elf_tls_transition): Replace
233         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
234         bfd_link_executable for TLS check.
235         (tilegx_elf_check_relocs): Likewise.
236         (allocate_dynrelocs): Likewise.
237         (tilegx_elf_relocate_section): Likewise.
239 2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
241         PR ld/22263
242         * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
243         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
244         bfd_link_executable for TLS check.
245         (tilepro_elf_check_relocs): Likewise.
246         (allocate_dynrelocs): Likewise.
247         (tilepro_elf_relocate_section): Likewise.
249 2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
251         PR ld/22263
252         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
253         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
254         bfd_link_executable for TLS check.
255         (_bfd_sparc_elf_check_relocs): Likewise.
256         (allocate_dynrelocs): Likewise.
257         (_bfd_sparc_elf_relocate_section): Likewise.
259 2017-10-18  H.J. Lu  <hongjiu.lu@intel.com>
261         * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
262         _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
263         * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
265 2017-10-17  H.J. Lu  <hongjiu.lu@intel.com>
267         * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
268         indirect and warning symbols.
270 2017-10-17  Alan Modra  <amodra@gmail.com>
272         PR 22307
273         * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
274         against size left rather than comparing pointers.  Reorganise loop.
276 2017-10-17  Alan Modra  <amodra@gmail.com>
278         PR 22306
279         * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
280         and error for any other size that doesn't cover the header word.
282 2017-10-16  H.J. Lu  <hongjiu.lu@intel.com>
284         * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
285         * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
286         (elf_backend_gc_sweep_hook): Likewise.
287         * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
288         (bfinfdpic_gc_sweep_hook): Likewise.
289         (elf_backend_gc_sweep_hook): Likewise.
290         * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
291         (elf_backend_gc_sweep_hook): Likewise.
292         * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
293         (elf_backend_gc_sweep_hook): Likewise.
294         * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
295         (elf_backend_gc_sweep_hook): Likewise.
296         * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
297         (elf_backend_gc_sweep_hook): Likewise.
298         * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
299         (elf_backend_gc_sweep_hook): Likewise.
300         * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
301         from comments.
302         (elf_m68k_remove_got_entry_type): Removed.
303         (elf_m68k_find_got_entry_ptr): Likewise.
304         (elf_m68k_remove_got_entry): Likewise.
305         (elf_m68k_gc_sweep_hook): Likewise.
306         (elf_backend_gc_sweep_hook): Likewise.
307         * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
308         (elf_backend_gc_sweep_hook): Likewise.
309         * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
310         (elf_backend_gc_sweep_hook): Likewise.
311         * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
312         (elf_backend_gc_sweep_hook): Likewise.
313         * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
314         (elf_backend_gc_sweep_hook): Likewise.
315         * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
316         (elf_backend_gc_sweep_hook): Likewise.
317         * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
318         (elf_backend_gc_sweep_hook): Likewise.
319         * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
320         (elf_backend_gc_sweep_hook): Likewise.
321         * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
322         (elf_backend_gc_sweep_hook): Likewise.
323         * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
324         (elf_backend_gc_sweep_hook): Likewise.
325         * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
326         * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
327         (elf_backend_gc_sweep_hook): Likewise.
328         * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
329         * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
330         (elf_backend_gc_sweep_hook): Likewise.
331         * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
332         (elf_backend_gc_sweep_hook): Likewise.
333         * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
334         (elf_backend_gc_sweep_hook): Likewise.
335         * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
336         (elf_backend_gc_sweep_hook): Likewise.
337         * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
338         * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
339         (elf_backend_gc_sweep_hook): Likewise.
340         * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
341         (ppc64_elf_gc_sweep_hook): Likewise.
342         * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
343         (elf_backend_gc_sweep_hook): Likewise.
344         * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
345         * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
346         * elflink.c (elf_link_add_object_symbols): Don't call
347         _bfd_elf_link_check_relocs here.
348         (gc_sweep_hook_fn): Removed.
349         (elf_gc_sweep): Remove gc_sweep_hook.
350         * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
351         (elf_backend_gc_sweep_hook): Likewise.
352         * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
353         (elf_backend_gc_sweep_hook): Likewise.
354         * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
355         * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
356         (elf_backend_gc_sweep_hook): Likewise.
357         * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
358         * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
359         * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
360         (elfNN_bed): Remove elf_backend_gc_sweep_hook.
361         * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
362         * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
364 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
366         * elf32-i386.c (elf_i386_backend_data): Removed.
367         (get_elf_i386_backend_data): Likewise.
368         (elf_i386_arch_bed): Replace elf_i386_backend_data with
369         elf_x86_backend_data.
370         (elf_i386_get_synthetic_symtab): Likewise.
371         (elf_i386_nacl_arch_bed): Likewise.
372         (elf_i386_vxworks_arch_bed): Likewise.
373         (elf_i386_relocate_section): Check target_os instead of
374         is_vxworks.
375         (elf_i386_finish_dynamic_symbol): Likewise.
376         (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
377         Check target_os instead of is_vxworks.
378         (elf_i386_link_setup_gnu_properties): Remove normal_target and
379         is_vxworks.  Initialize plt0_pad_byte.
380         * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
381         (get_elf_x86_64_arch_data): Likewise.
382         (get_elf_x86_64_backend_data): Likewise.
383         (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
384         elf_x86_backend_data.
385         (elf_x86_64_get_synthetic_symtab): Likewise.
386         (elf_x86_64_nacl_arch_bed): Likewise.
387         (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
388         normal_target.  Initialize plt0_pad_byte.
389         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
390         instead of is_vxworks.
391         (_bfd_x86_elf_size_dynamic_sections): Likewise.
392         (_bfd_x86_elf_finish_dynamic_sections): Likewise.
393         (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
394         (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
395         (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
396         Update normal_target.  Set up plt0_pad_byte.  Check target_os
397         instead of is_vxworks.
398         * elfxx-x86.h (elf_x86_target_os): New.
399         (elf_x86_backend_data): Likewise.
400         (get_elf_x86_backend_data): Likewise.
401         (elf_x86_link_hash_table): Remove is_vxworks.  Add plt0_pad_byte
402         and target_os.
403         (elf_x86_init_table): Remove normal_target and is_vxworks.  Add
404         plt0_pad_byte.
406 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
408         * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
409         _bfd_x86_elf_finish_dynamic_sections.
410         * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
411         * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
412         function.
413         * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
414         prototype.
416 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
418         PR ld/21384
419         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
420         hide symbol which was forced to be dynamic.
422 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
424         PR ld/22269
425         * elf32-cris.c (cris_elf_relocate_section): Don't generate
426         dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
427         (cris_elf_check_relocs): Don't allocate dynamic relocation
428         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
430 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
432         PR ld/22269
433         * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
434         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
435         (sh_elf_relocate_section): Don't generate dynamic relocation if
436         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
438 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
440         PR ld/22269
441         * elf32-s390.c (allocate_dynrelocs): Discard dynamic
442         relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
443         (elf_s390_relocate_section): Don't generate dynamic relocation
444         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
445         * elf64-s390.c (allocate_dynrelocs): Discard dynamic
446         relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
447         (elf_s390_relocate_section): Don't generate dynamic relocation
448         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
450 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
452         PR ld/22269
453         * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
454         dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
455         (allocate_dynrelocs): Discard dynamic relocations if
456         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
458 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
460         PR ld/22269
461         * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
462         generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
463         true.
464         (allocate_dynrelocs): Discard dynamic relocations if
465         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
467 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
469         PR ld/22269
470         * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
471         relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
472         (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
473         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
474         (elf_m68k_relocate_section): Don't generate dynamic relocation
475         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
477 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
479         PR ld/22269
480         * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
481         symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
482         (allocate_dynrelocs): Discard dynamic relocations if
483         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
484         (elf32_hppa_relocate_section): Don't generate dynamic
485         relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
487 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
489         PR ld/22269
490         * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
491         dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
492         (allocate_fptr): Don't allocate function pointer if
493         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
494         (allocate_dynrel_entries): Don't allocate dynamic relocation
495         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
496         (set_got_entry): Don't set GOT entry if
497         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
498         (set_pltoff_entry): Don't set PLTOFF entry if
499         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
500         (elfNN_ia64_relocate_section): Don't install dynamic relocation
501         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
503 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
505         PR ld/22269
506         * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
507         dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
508         (allocate_dynrelocs): Don't allocate dynamic relocations if
509         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
511 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
513         PR ld/22269
514         * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
515         dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
516         (allocate_dynrelocs_for_symbol): Discard dynamic relocations
517         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
519 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
521         PR ld/22269
522         * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
523         relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
524         (tilepro_elf_relocate_section): Don't generate dynamic
525         relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
526         * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
527         relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
528         (tilegx_elf_relocate_section): Don't generate dynamic
529         relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
531 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
533         PR ld/22269
534         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
535         generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
536         true.
537         (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
538         if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
540 2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
542         * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
543         * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
544         * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
546 2017-10-12  James Bowman  <james.bowman@ftdichip.com>
548         * bfd-in2.h: Regenerate.
549         * libbfd.h: Regenerate.
550         * elf32-ft32.c: Add HOWTO R_FT32_15.
551         * reloc.c: Add BFD_RELOC_FT32_15.
553 2017-10-12  Nick Clifton  <nickc@redhat.com>
555         * reloc.c (enum bfd_reloc_status): Start values at 2.
556         * bfd-in2.h: Regenerate.
557         * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
558         that a TRUE return indicates success.  Compare the result of
559         calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
560         (build_one_stub): Change sense of tests against aarch64_relocate
561         return value.
562         (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
563         than FALSE, when an error is detected.
564         (elfNN_aarch64_final_link_relocate): Likewise.
566 2017-10-12  H.J. Lu  <hongjiu.lu@intel.com>
568         * elf32-i386.c (elf_backend_hide_symbol): New.
569         * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
570         * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
571         * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
573 2017-10-12  Alan Modra  <amodra@gmail.com>
575         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
576         elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
577         (bfd_elf_define_start_stop): Likewise.
579 2017-10-12  Alan Modra  <amodra@gmail.com>
581         * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
582         when executable rather than non-PIC.
583         * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
584         * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
586 2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
588         * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
589         member.
590         * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
591         (elf_external_linux_prpsinfo64_ugid32): ... this.
592         (swap_linux_prpsinfo32_out): Rename to...
593         (swap_linux_prpsinfo32_ugid32_out): ... this.
594         (elf_external_linux_prpsinfo64_ugid16): New structure.
595         (swap_linux_prpsinfo64_ugid16_out): New function.
596         * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
597         (elf_backend_linux_prpsinfo64_ugid16): Define.
598         (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
599         * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
600         of the 64-bit Linux core PRPSINFO note.
601         * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
603 2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
605         * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
606         member.
607         (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
608         * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
609         (elf_external_ppc_linux_prpsinfo32)
610         (swap_ppc_linux_prpsinfo32_out): Move to...
611         * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
612         (swap_linux_prpsinfo32_ugid32_out): ... these.
613         (elf_external_linux_prpsinfo32): Rename to...
614         (elf_external_linux_prpsinfo32_ugid16): ... this.
615         (swap_linux_prpsinfo32_out): Rename to...
616         (swap_linux_prpsinfo32_ugid16_out): ... this.
617         * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
618         (elf_backend_linux_prpsinfo32_ugid16): Define.
619         (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
620         * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
621         of the 32-bit Linux core PRPSINFO note.
622         * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
623         * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
624         * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
625         * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
626         * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
627         * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
628         * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
629         * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
630         * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
631         * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
633 2017-10-11  Maciej W. Rozycki  <macro@imgtec.com>
635         * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
636         `gap' member ahead of `pr_flag'.
638 2017-10-11  Pedro Alves  <palves@redhat.com>
640         * bfd.c (_doprnt): Rename to ...
641         (_bfd_doprnt): ... this.
642         (error_handler_internal): Adjust.
644 2017-10-10  H.J. Lu  <hongjiu.lu@intel.com>
646         * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
647         instead of incrementing it.
648         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
650 2017-10-10  Renlin Li  <renlin.li@arm.com>
652         PR ld/21402
653         * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
654          symbols into dynamic.
656 2017-10-09  H.J. Lu  <hongjiu.lu@intel.com>
658         PR ld/22274
659         * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
660         (riscv_elf_link_hash_table_create): Initialize max_alignment to
661         (bfd_vma) -1.
662         (_bfd_riscv_relax_section): Cache the max alignment of output
663         sections if possible.
665 2017-10-10  Alan Modra  <amodra@gmail.com>
667         * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
668         .opd whenever .opd is present and non-zero size.  Move code
669         setting abiversion to/from output file earlier.  Only set
670         u.opd.func_sec when --gc-sections.  Read relocs and set up
671         u.opd.func_sec values here..
672         (ppc64_elf_check_relocs): ..rather than here.  Simplify opd
673         section tests.
674         (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
676 2017-10-09  H.J. Lu  <hongjiu.lu@intel.com>
678         * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
679         isymbuf.
681 2017-10-09  H.J. Lu  <hongjiu.lu@intel.com>
683         * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
684         .interp section with "ld --no-dynamic-linker".
686 2017-10-09  Alan Modra  <amodra@gmail.com>
688         PR 22212
689         * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
690         funcinfo_hash_table and varinfo_hash_table.
692 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
694         * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
695         in read-only section with minfo.
696         (sh_elf_size_dynamic_sections): Likewise.
698 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
700         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
701         a strayed comment.
703 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
705         * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
706         this_hdr.sh_entsize only if section size > 0.
708 2017-10-08  H.J. Lu  <hongjiu.lu@intel.com>
710         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
712 2017-10-07  H.J. Lu  <hongjiu.lu@intel.com>
714         * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
715         in read-only section with minfo.
716         (_bfd_sparc_elf_size_dynamic_sections): Likewise.
718 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
720         * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
721         comments.
723 2017-10-06  John Baldwin  <jhb@FreeBSD.org>
725         * elf-bfd.h (struct elf_backend_data): Add
726         `elf_backend_grok_freebsd_prstatus'.
727         * elf.c (elfcore_grok_freebsd_note): Call
728         `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
729         present.
730         * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
731         function.
732         (elf_backend_grok_freebsd_prstatus): Define.
733         * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
734         (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
736 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
738         * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
739         and has_non_got_reloc with zero_undefweak.
740         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
741         * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
742         zero_undefweak to 1.
743         (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
744         has_non_got_reloc with zero_undefweak.
745         * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
746         has_got_reloc and has_non_got_reloc with zero_undefweak.
747         (elf_x86_link_hash_entry): Likewise.
749 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
751         * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
752         (VERIFY_COPY_RELOC): Likewise.
754 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
756         * elfxx-x86.h (VERIFY_COPY_RELOC): New.
757         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
758         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
760 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
762         * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
763         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
764         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
766 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
768         * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
769         * elf32-i386.c (elf_i386_relocate_section): Use it.
770         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
772 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
774         * elf32-i386.c (X86_SIZE_TYPE_P): New.
775         (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
776         * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
777         (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
778         * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
780 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
782         * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
783         (PLT_LOCAL_IFUNC_P): Likewise.
784         * elf32-i386.c (elf_i386_relocate_section): Use them.
785         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
787 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
789         * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
790         * elf32-i386.c (elf_i386_relocate_section): Use it.
791         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
793 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
795         * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
796         * elf32-i386.c (elf_i386_relocate_section): Use it.
797         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
799 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
801         * elf32-i386.c (X86_PCREL_TYPE_P): New.
802         (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
803         * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
804         (X86_PCREL_TYPE_P): This.
805         (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
806         Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
807         (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
808         X86_PCREL_TYPE_P.
809         * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
811 2017-10-06  H.J. Lu  <hongjiu.lu@intel.com>
813         * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
814         * elf32-i386.c (elf_i386_tls_transition): Use it.
815         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
817 2017-10-05  H.J. Lu  <hongjiu.lu@intel.com>
819         * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
820         Dump dynamic relocation in read-only section with minfo if
821         needed.
822         (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
823         (maybe_set_textrel): Likewise.
824         (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
825         read-only section with minfo.
827 2017-10-05  John Baldwin  <jhb@FreeBSD.org>
829         * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
831 2017-10-05  H.J. Lu  <hongjiu.lu@intel.com>
833         * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
834         in read-only section with minfo.
835         (tilepro_elf_size_dynamic_sections): Likewise.
836         * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
837         (tilegx_elf_size_dynamic_sections): Likewise.
839 2017-10-05  Pedro Alves  <palves@redhat.com>
841         PR 22245
842         * bfd.c (bfd_set_error): Revert 2017-10-04 change.  Remove
843         ellipsis parameter.  Split out bfd_error_on_input code to..
844         (bfd_set_input_error): .. New function.
845         * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
846         * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
847         * bfd-in2.h: Regenerate.
849 2017-10-05  Alan Modra  <amodra@gmail.com>
851         * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
852         fini_array error value.
854 2017-10-05  Alan Modra  <amodra@gmail.com>
856         PR 21167
857         * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
858         groups.
859         (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
860         flag from section.
861         (elf_fake_sections): Adjust calls.  Exit immediately on failure.
862         (bfd_elf_set_group_contents): Add associated reloc section indices
863         to group contents.
865 2017-10-04  Alan Modra  <amodra@gmail.com>
867         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
868         classify symbols for ELFv2.
870 2017-10-04  Pavel I. Kryukov <kryukov@frtk.ru>
872         PR 22245
873         * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
874         undergoes default promotion.
875         * bfd-in2.h: Regenerate.
877 2017-10-02  Alan Modra  <amodra@gmail.com>
879         * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
880         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
882 2017-10-01  Alan Modra  <amodra@gmail.com>
884         PR 21957
885         * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
886         (add_line_info): Always put end_sequence last.
888 2017-10-01  Alan Modra  <amodra@gmail.com>
890         PR 22047
891         * dwarf2.c (read_section): Allocate buffer with extra byte for
892         bfd_simple_get_relocated_section_contents rather than copying
893         afterwards.
895 2017-09-29  Alan Modra  <amodra@gmail.com>
897         * merge.c (merge_strings): Return FALSE on malloc failure.
898         (_bfd_merge_sections): Return failures from record_section and
899         merge_strings.
901 2017-09-28  Alan Modra  <amodra@gmail.com>
903         PR 22220
904         * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
905         a case where plugin_notice isn't called.
907 2017-09-27  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
909         * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
910         comparison.
912 2017-09-26  H.J. Lu  <hongjiu.lu@intel.com>
914         PR ld/22199
915         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
916         output_bfd to info->callbacks->minfo.
918 2017-09-26  Nick Clifton  <nickc@redhat.com>
920         PR 22172
921         * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
922         assertion failure if elf_x86_64_rtype_to_howto has already issued
923         an error message.
925 2017-09-26  Alan Modra  <amodra@gmail.com>
927         PR 22210
928         * dwarf2.c (read_formatted_entries): Use read_attribute_value to
929         read data.
931 2017-09-26  Nick Clifton  <nickc@redhat.com>
933         PR 22210
934         * dwarf2.c (read_formatted_entries): Fail early if we know that
935         the loop parsing data entries will overflow the end of the
936         section.
938 2017-09-26  Alan Modra  <amodra@gmail.com>
940         PR 22209
941         * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
942         (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
943         to stash->info_ptr_memory, and check die_ref is within that memory.
944         Set info_ptr_end correctly when another CU is refd.  Check die_ref
945         for DW_FORM_ref4 etc. is within CU.
947 2017-09-26  Alan Modra  <amodra@gmail.com>
949         PR 22205
950         * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
951         (read_formatted_entries): Init "fe".
952         (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
954 2017-09-26  Alan Modra  <amodra@gmail.com>
956         PR 22204
957         * dwarf2.c (decode_line_info): Ensure line_ptr stays within
958         bounds in inner loop.
960 2017-09-25  Alan Modra  <amodra@gmail.com>
962         PR 22202
963         * dwarf1.c (parse_die): Sanity check pointer against section limit
964         before dereferencing.
965         (parse_line_table): Likewise.
967 2017-09-25  Alan Modra  <amodra@gmail.com>
969         PR 22201
970         * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
971         has string form.
972         (parse_comp_unit): Likewise.
974 2017-09-25  Alan Modra  <amodra@gmail.com>
976         PR 22200
977         * dwarf2.c (read_formatted_entries): Error on format_count zero.
979 2017-09-24  Alan Modra  <amodra@gmail.com>
981         PR 22197
982         * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
983         within section bounds.
985 2017-09-24  Alan Modra  <amodra@gmail.com>
987         PR 22191
988         * dwarf2.c (decode_line_info): Properly free line sequences on error.
990 2017-09-24  Alan Modra  <amodra@gmail.com>
992         PR 22187
993         * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
994         pname param.  Return status.  Make name const.  Don't abort,
995         return an error.  Formatting.  Exit if current info_ptr matches
996         orig_info_ptr.  Update callers.
997         (scan_unit_for_symbols): Start at nesting_level of zero.  Make
998         nested_funcs an array of structs for extensibility.  Formatting.
1000 2017-09-24  Alan Modra  <amodra@gmail.com>
1002         PR 22186
1003         * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
1004         rather than dividing by zero.
1006 2017-09-24  Alan Modra  <amodra@gmail.com>
1008         PR 22169
1009         * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
1011 2017-09-24  Alan Modra  <amodra@gmail.com>
1013         PR 22167
1014         * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
1016 2017-09-24  Alan Modra  <amodra@gmail.com>
1018         PR 22166
1019         * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
1020         SHT_GNU_verneed section for sanity.  Don't zalloc memory for
1021         verref.
1023 2017-09-22  H.J. Lu  <hongjiu.lu@intel.com>
1025         PR binutils/22170
1026         * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
1027         corrupted PLT.
1029 2017-09-22  H.J. Lu  <hongjiu.lu@intel.com>
1031         PR binutils/22163
1032         * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
1033         -1 if bfd_canonicalize_dynamic_reloc returns 0.
1035 2017-09-22  Pedro Alves  <palves@redhat.com>
1036             Alan Modra  <amodra@gmail.com>
1038         * version.h: Add comment.
1040 2017-09-21  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1042         * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
1043         NT_S390_GS_BC, correct the previously swapped invocations of
1044         elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
1046 2017-09-19  Alan Modra  <amodra@gmail.com>
1048         PR 21441
1049         * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
1050         size.
1052 2017-09-19  Alan Modra  <amodra@gmail.com>
1054         PR 22150
1055         * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
1056         symbols before calculating verrefs.  Don't renumber dynsyms
1057         after gc.  Exclude .gnu.version when zero or one dynsym.
1058         Localize some vars and reindent.
1060 2017-09-18  H.J. Lu  <hongjiu.lu@intel.com>
1062         PR ld/22148
1063         * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
1064         return from bfd_canonicalize_dynamic_reloc.
1066 2017-09-15  Alan Modra  <amodra@gmail.com>
1068         PR 22116
1069         * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
1070         overflows bfd_size_type.
1072 2017-09-14  H.J. Lu  <hongjiu.lu@intel.com>
1074         PR ld/22135
1075         * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
1076         to indicate if conversion is performed.
1077         (elf_i386_check_relocs): Cache section contents and relocations
1078         if conversion is performed.
1079         * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
1080         contents and relocations if conversion is performed.
1082 2017-09-14  Nick Clifton  <nickc@redhat.com>
1084         PR binutils/22113
1085         * peXXigen.c (pe_print_idata): Extend check for HintName vector
1086         entries.
1088 2017-09-13  H.J. Lu  <hongjiu.lu@intel.com>
1090         * elfxx-x86.h: Fix a typo in comments.
1092 2017-09-09  Kamil Rytarowski  <n54@gmx.com>
1094         * elf32-nds32.c: Rename __BIT() to N32_BIT().
1096 2017-09-09  Alan Modra  <amodra@gmail.com>
1098         * elf64-ppp.c (plt_stub_pad): Handle positive and negative
1099         plt_stub_align.
1101 2017-09-09  H.J. Lu  <hongjiu.lu@intel.com>
1103         * elf32-i386.c (elf_i386_relocate_section): Update usage of
1104         UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1105         (elf_i386_finish_dynamic_symbol): Likewise.
1106         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1107         (elf_x86_64_finish_dynamic_symbol): Likewise.
1108         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
1109         (_bfd_x86_elf_fixup_symbol): Likewise.
1111 2017-09-09  H.J. Lu  <hongjiu.lu@intel.com>
1113         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
1114         check has_non_got_reloc.
1116 2017-09-09  H.J. Lu  <hongjiu.lu@intel.com>
1118         PR ld/22115
1119         * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
1120         Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1121         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
1122         linker_def.  Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
1123         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
1124         and linker_def on __ehdr_start if it is referenced and not
1125         defined.
1126         (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
1127         and return TRUE when building executable, if a symbol has
1128         non-GOT/non-PLT relocations in text section or there is no
1129         dynamic linker.
1130         * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
1132 2017-09-08  H.J. Lu  <hongjiu.lu@intel.com>
1134         * elfxx-x86.h: Update comments.
1136 2017-09-08  H.J. Lu  <hongjiu.lu@intel.com>
1138         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
1139         elf_x86_plt_layout_table with elf_x86_init_table.
1140         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1141         Likewise.
1142         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
1143         Likewise.
1144         * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
1145         (elf_x86_init_table): This.
1146         (_bfd_x86_elf_link_setup_gnu_properties): Replace
1147         elf_x86_plt_layout_table with elf_x86_init_table.
1149 2017-09-07  H.J. Lu  <hongjiu.lu@intel.com>
1151         * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
1152         elf64.lo together with elfxx-x86.lo for 64-bit BFD.
1153         * configure: Regenerated.
1154         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
1155         and r_sym fields of plt_layout.
1156         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
1157         Likewise.
1158         * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
1159         (_bfd_x86_elf_link_hash_table_create): Likewise.  Don't set
1160         r_info nor r_sym fields.
1161         (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
1162         fields of htab.
1163         * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
1165 2017-09-07  Palmer Dabbelt  <palmer@dabbelt.com>
1167         * (_bfd_riscv_relax_align): Call bfd_set_error and
1168         print an error message when unable to relax a .align directive.
1170 2017-09-07  Palmer Dabbelt  <palmer@dabbelt.com>
1172         * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
1173         (riscv_record_pcrel_hi_reloc): Add absolute argument.
1174         (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
1175         R_RISCV_PCREL_HI20 relocs, and pass the result to
1176         riscv_record_pcrel_hi_reloc.
1178 2017-09-07  H.J. Lu  <hongjiu.lu@intel.com>
1180         * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
1181         r_type_p.  Remove the converted argument.  Replace
1182         SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.  Return
1183         the new relocation type via r_type_p.
1184         (elf_i386_relocate_section): Likewise.
1185         (elf_i386_finish_dynamic_symbol): Likewise.
1186         (need_convert_load): Removed.
1187         (check_relocs_failed): Updated.
1188         (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
1189         instead of setting need_convert_load.
1190         (_bfd_i386_elf_convert_load): Removed.
1191         * elf64-x86-64.c (need_convert_load): Removed.
1192         (check_relocs_failed): Updated.
1193         (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
1194         Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
1195         Return the new relocation type via r_type_p.
1196         (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
1197         instead of setting need_convert_load.
1198         (elf_x86_64_check_relocs): Don't check PIC if relocation has
1199         been converted.
1200         (_bfd_x86_64_elf_convert_load): Removed.
1201         (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
1202         with SYMBOL_REFERENCES_LOCAL_P.
1203         (elf_x86_64_finish_dynamic_symbol): Likewise.
1204         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
1205         set convert_load.
1206         (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
1207         (_bfd_x86_elf_link_symbol_references_local): New function.
1208         * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
1209         (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
1210         SYMBOL_REFERENCES_LOCAL_P.
1211         (elf_x86_link_hash_entry): Add local_ref.
1212         (elf_x86_link_hash_table): Remove convert_load.
1213         (_bfd_i386_elf_convert_load): Removed.
1214         (_bfd_x86_64_elf_convert_load): Likewise.
1215         (_bfd_x86_elf_link_symbol_references_local): New.
1217 2017-09-06  H.J. Lu  <hongjiu.lu@intel.com>
1219         * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
1220         (elf_x86_64_info_to_howto): Get the real relocation type by
1221         masking out R_X86_64_converted_reloc_bit.
1222         (elf_x86_64_check_tls_transition): Get the real relocation type
1223         by masking out R_X86_64_converted_reloc_bit.
1224         (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
1225         instead of setting converted_reloc.
1226         (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
1227         instead of converted_reloc. Get the real relocation type by
1228         masking out R_X86_64_converted_reloc_bit.
1229         (elf_x86_64_link_setup_gnu_properties): Verify that the value of
1230         R_X86_64_converted_reloc_bit is valid.
1231         * elfxx-x86.h (converted_reloc): Removed.
1233 2017-09-06  H.J. Lu  <hongjiu.lu@intel.com>
1235         * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
1236         when calling elf_i386_tls_transition.  Don't use ELF32_R_TYPE
1237         to get the relocation type again.
1238         * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1239         r_type when calling elf_x86_64_tls_transition.  Don't use
1240         ELF32_R_TYPE to get the relocation type again.
1242 2017-09-05  H.J. Lu  <hongjiu.lu@intel.com>
1244         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1245         converted_reloc.
1247 2017-09-05  H.J. Lu  <hongjiu.lu@intel.com>
1249         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1250         argument.  Don't check relocation overflow.  Avoid relocation
1251         overflow if --no-relax is used.  Set converted_reloc on symbol
1252         if a GOTPCREL relocation is converted.
1253         (elf_x86_64_relocate_section): Issue a fatal error and suggest
1254         --no-relax if GOTPCREL relocation conversion leads to relocation
1255         overflow.
1256         * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1258 2017-09-05  Alexander Fedotov <alexander.fedotov@nxp.com>
1259             Edmar Wienskoski <edmar.wienskoski@nxp.com
1261         * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1262         (ppc_elf_check_relocs): Handle it.
1263         (ppc_elf_vle_split20): New function.
1264         (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1266 2017-09-03  H.J. Lu  <hongjiu.lu@intel.com>
1268         PR ld/22071
1269         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1270         for x86-64 if GOT_TLS_GDESC_P is true.
1272 2017-09-03  Alan Modra  <amodra@gmail.com>
1274         PR 22067
1275         * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1277 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1279         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1280         tls_get_addr for x86-64 in one place.
1282 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1284         * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1285         with elfxx-x86.lo for 64-bit BFD.
1286         * configure: Regenerated.
1288 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1290         * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1291         (_bfd_i386_elf_convert_load): This.  Remove static.
1292         (elf_i386_size_dynamic_sections): Removed.
1293         (elf_backend_size_dynamic_sections): Likewise.
1294         * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1295         (_bfd_x86_64_elf_convert_load): This.  Remove static.
1296         (elf_x86_64_size_dynamic_sections): Removed.
1297         (elf_backend_size_dynamic_sections): Likewise.
1298         * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1299         (elf_x86_allocate_dynrelocs): This.  Make it static.
1300         (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1301         (elf_x86_allocate_local_dynreloc): This.  Make it static.
1302         (elf_i386_is_reloc_section): New function.
1303         (elf_x86_64_is_reloc_section): Likewise.
1304         (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1305         is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1306         Rearrange got_entry_size initialization.
1307         (_bfd_x86_elf_size_dynamic_sections): New function.
1308         * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1309         is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1310         (_bfd_i386_elf_convert_load): New.
1311         (_bfd_x86_64_elf_convert_load): Likewise.
1312         (_bfd_x86_elf_size_dynamic_sections): Likewise.
1313         (elf_backend_size_dynamic_sections): Likewise.
1314         (_bfd_x86_elf_allocate_dynrelocs): Removed.
1315         (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1317 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1319         * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1320         update comments.
1322 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1324         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1325         sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1327 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1329         * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1330         PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1331         * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1332         PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1333         * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1334         PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1336 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1338         * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1339         (elf_i386_allocate_local_dynrelocs): Likewise.
1340         (elf_i386_size_dynamic_sections): Replace
1341         elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1342         with _bfd_x86_elf_allocate_dynrelocs and
1343         _bfd_x86_elf_allocate_local_dynrelocs.
1344         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1345         (elf_x86_64_allocate_local_dynrelocs): Likewise.
1346         (elf_x86_64_size_dynamic_sections): Replace
1347         elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1348         with _bfd_x86_elf_allocate_dynrelocs and
1349         _bfd_x86_elf_allocate_local_dynrelocs.
1350         * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1351         (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1352         * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1353         (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1355 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1357         * elf32-i386.c (is_i386_elf): Removed.
1358         (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1359         (elf_i386_size_dynamic_sections): Likewise.
1360         (elf_i386_relocate_section): Likewise.
1361         * elf64-x86-64.c (is_x86_64_elf): Removed.
1362         (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1363         is_x86_elf.
1364         (elf_x86_64_size_dynamic_sections): Likewise.
1365         (elf_x86_64_relocate_section): Likewise.
1366         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1367         target_id.
1368         * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1369         (is_x86_elf): New.
1371 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1373         * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1374         (elf_i386_allocate_dynrelocs): Replace
1375         elf_i386_compute_jump_table_size with
1376         elf_x86_compute_jump_table_size.
1377         (elf_i386_size_dynamic_sections): Likewise.
1378         * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1379         (elf_x86_64_allocate_dynrelocs): Replace
1380         elf_x86_64_compute_jump_table_size with
1381         elf_x86_compute_jump_table_size.
1382         (elf_x86_64_size_dynamic_sections): Likewise.
1383         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1384         got_entry_size.
1385         * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1386         (elf_x86_compute_jump_table_size): New.
1388 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1390         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1391         sizeof_reloc.
1392         (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1393         * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1395 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1397         * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1398         with htab->is_vxworks.
1399         (elf_i386_size_dynamic_sections): Likewise.
1400         (elf_i386_relocate_section): Likewise.
1401         (elf_i386_finish_dynamic_symbol): Likewise.
1402         (elf_i386_finish_dynamic_sections): Likewise.
1404 2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1406         * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1407         GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1408         GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1409         * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1410         GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1411         GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1412         * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1413         GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1415 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1417         PR ld/22064
1418         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1419         ELF_COMMON_DEF_P for common symbols.
1421 2017-09-02  Alan Modra  <amodra@gmail.com>
1423         * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1424         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1425         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1427 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1429         * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1430         (elf_backend_gc_mark_hook): Likewise.
1431         * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1432         (elf_backend_gc_mark_hook): Likewise.
1433         * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1434         * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1435         (elf_backend_gc_mark_hook): Likewise.
1437 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1439         * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1440         (elf_backend_adjust_dynamic_symbol): Likewise.
1441         * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1442         (elf_backend_adjust_dynamic_symbol): Likewise.
1443         * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1444         (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1445         * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1446         (_bfd_x86_elf_adjust_dynamic_symbol): New.
1447         (elf_backend_adjust_dynamic_symbol): Likewise.
1449 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1451         * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1452         comments.
1454 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1456         * elf32-i386.c (elf_i386_mkobject): Removed.
1457         (bfd_elf32_mkobject): Likewise.
1458         * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1459         (bfd_elf64_mkobject): Likewise.
1460         (bfd_elf32_mkobject): Likewise.
1461         * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1462         * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1463         (bfd_elf64_mkobject): Likewise.
1464         (bfd_elf32_mkobject): Likewise.
1466 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1468         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1469         Call _bfd_x86_elf_link_setup_gnu_properties.
1470         * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1471         pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1472         entries.
1473         (elf_x86_64_non_lazy_plt): Likewise.
1474         (elf_x86_64_lazy_bnd_plt): Likewise.
1475         (elf_x86_64_non_lazy_bnd_plt): Likewise.
1476         (elf_x86_64_lazy_ibt_plt): Likewise.
1477         (elf_x32_lazy_ibt_plt): Likewise.
1478         (elf_x86_64_non_lazy_ibt_plt): Likewise.
1479         (elf_x32_non_lazy_ibt_plt): Likewise.
1480         (elf_x86_64_nacl_plt): Likewise.
1481         (elf_x86_64_link_setup_gnu_properties): Updated.  Call
1482         _bfd_x86_elf_link_setup_gnu_properties.
1483         * elfxx-x86.c: Include elf-vxworks.h".
1484         (_bfd_x86_elf_link_setup_gnu_properties): New function.
1485         * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1486         comments for pic_plt0_entry and pic_plt_entry.
1487         (elf_x86_non_lazy_plt_layout): Likewise.
1488         (elf_x86_plt_layout_table): New.
1489         (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1491 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
1493         PR ld/22061
1494         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1495         .eh_frame section for the second PLT.
1496         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1497         alignment of .eh_frame section for the second PLT.
1499 2017-09-01  Nick Clifton  <nickc@redhat.com>
1501         PR 22059
1502         * dwarf2.c (decode_line_info): Fix test for an overlong line info
1503         structure.
1505 2017-09-01  Nick Clifton  <nickc@redhat.com>
1507         PR 22058
1508         * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1509         attribute buffer is NUL terminated.
1511 2017-08-31  Nick Clifton  <nickc@redhat.com>
1513         PR 22047
1514         * dwarf2.c (read_section): If necessary add a terminating NUL byte
1515         to dwarf string sections.
1517 2017-08-31  Alan Modra  <amodra@gmail.com>
1519         * po/SRC-POTFILES.in: Regenerate.
1521 2017-08-31  Alan Modra  <amodra@gmail.com>
1523         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1524         for a section containing just a terminator.  Allow multiple
1525         terminators at end of section.
1526         * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1527         sections when not adding alignment.  Assert on terminator in
1528         the middle of FDEs.
1530 2017-08-31  Alan Modra  <amodra@gmail.com>
1532         PR 21441
1533         PR 22048
1534         * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1535         terminators.
1537 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1539         * configure.ac (bfd_backends): Add elf64.lo together with
1540         elfxx-x86.lo for 64-bit BFD.
1541         * configure: Regenerated.
1543 2017-08-31  James Bowman  <james.bowman@ftdichip.com>
1545         * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1546         for R_FT32_18.
1548 2017-08-31  Alan Modra  <amodra@gmail.com>
1550         PR binutils/22032
1551         * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1552         before _close_and_cleanup.  Call iovec->bclose after.
1553         (bfd_close): Remove code common to, and call, bfd_close_all_done.
1555 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1557         * elf32-i386.c (elf_i386_plt_type): Removed.
1558         (elf_i386_plt): Likewise.
1559         (elf_i386_get_synthetic_symtab): Updated.   Call
1560         _bfd_x86_elf_get_synthetic_symtab.
1561         * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1562         (elf_x86_64_plt): Likewise.
1563         (elf_x86_64_get_synthetic_symtab): Updated.  Call
1564         _bfd_x86_elf_get_synthetic_symtab.
1565         * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1566         (elf_x86_64_get_plt_got_vma): Likewise.
1567         (elf_i386_valid_plt_reloc_p): Likewise.
1568         (elf_x86_64_valid_plt_reloc_p): Likewise.
1569         (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1570         * elfxx-x86.h (elf_x86_plt_type): New.
1571         (elf_x86_plt): Likewise.
1572         (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1574 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1576         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1577         target_id instead of elf_machine_code.
1579 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1581         * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1582         (elf_i386_lazy_plt_layout): Likewise.
1583         (elf_i386_non_lazy_plt_layout): Likewise.
1584         (elf_i386_plt_layout): Likewise.
1585         (elf_i386_link_hash_table): Likewise.
1586         (elf_i386_next_tls_desc_index): Likewise.
1587         (elf_i386_srelplt2): Likewise.
1588         (elf_i386_plt): Likewise.
1589         (elf_i386_lazy_plt): Likewise.
1590         (elf_i386_non_lazy_plt): Likewise.
1591         (elf_i386_link_hash_table_create): Likewise.
1592         (bfd_elf32_bfd_link_hash_table_create): Likewise.
1593         (elf_i386_lazy_plt): Updated.
1594         (elf_i386_non_lazy_plt): Likewise.
1595         (elf_i386_lazy_ibt_plt): Likewise.
1596         (elf_i386_non_lazy_ibt_plt): Likewise.
1597         (elf_i386_allocate_dynrelocs): Likewise.
1598         (elf_i386_size_dynamic_sections): Likewise.
1599         (elf_i386_relocate_section): Likewise.
1600         (elf_i386_finish_dynamic_symbol): Likewise.
1601         (elf_i386_finish_dynamic_sections): Likewise.
1602         (elf_i386_get_synthetic_symtab): Likewise.
1603         (elf_i386_link_setup_gnu_properties): Likewise.
1604         (elf_i386_nacl_plt): Likewise.
1605         * elf64-x86-64.c (ABI_64_P): Removed.
1606         (ELF64_DYNAMIC_INTERPRETER): Likewise.
1607         (ELF32_DYNAMIC_INTERPRETER): Likewise.
1608         (elf_x86_64_lazy_plt_layout): Likewise.
1609         (elf_x86_64_non_lazy_plt_layout): Likewise.
1610         (elf_x86_64_plt_layout): Likewise.
1611         (elf_x86_64_link_hash_table): Likewise.
1612         (elf_x86_64_plt): Likewise.
1613         (elf_x86_64_lazy_plt): Likewise.
1614         (elf_x86_64_non_lazy_plt): Likewise.
1615         (elf_x86_64_link_hash_table_create): Likewise.
1616         (bfd_elf64_bfd_link_hash_table_create): Likewise.
1617         (bfd_elf32_bfd_link_hash_table_create): Likewise.
1618         (elf_x86_64_lazy_plt): Updated.
1619         (elf_x86_64_non_lazy_plt): Likewise.
1620         (elf_x86_64_lazy_bnd_plt): Likewise.
1621         (elf_x86_64_non_lazy_bnd_plt): Likewise.
1622         (elf_x86_64_lazy_ibt_plt): Likewise.
1623         (elf_x32_lazy_ibt_plt): Likewise.
1624         (elf_x86_64_non_lazy_ibt_plt): Likewise.
1625         (elf_x32_non_lazy_ibt_plt): Likewise.
1626         (elf_x86_64_allocate_dynrelocs): Likewise.
1627         (elf_x86_64_size_dynamic_sections): Likewise.
1628         (elf_x86_64_relocate_section): Likewise.
1629         (elf_x86_64_finish_dynamic_symbol): Likewise.
1630         (elf_x86_64_finish_dynamic_sections): Likewise.
1631         (elf_x86_64_get_synthetic_symtab): Likewise.
1632         (elf_x86_64_link_setup_gnu_properties): Likewise.
1633         (elf_x86_64_nacl_plt): Likewise.
1634         * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1635         "elf/x86-64.h".
1636         (ELF32_DYNAMIC_INTERPRETER): New.
1637         (ELF64_DYNAMIC_INTERPRETER): Likewise.
1638         (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1639         (_bfd_x86_elf_link_hash_table_create): Likewise.
1640         (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1641         (elf_x86_link_hash_table_free): This.  Make it static.
1642         * elfxx-x86.h: Don't include "objalloc.h".
1643         (ABI_64_P): New.
1644         (elf_x86_lazy_plt_layout): Likewise.
1645         (elf_x86_non_lazy_plt_layout): Likewise.
1646         (elf_x86_plt_layout): Likewise.
1647         (_bfd_x86_elf_link_hash_table_create): Likewise.
1648         (bfd_elf64_bfd_link_hash_table_create): Likewise.
1649         (bfd_elf32_bfd_link_hash_table_create): Likewise.
1650         (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1651         srelplt2 and next_tls_desc_index.
1652         (_bfd_x86_elf_link_hash_table_free): Removed.
1654 2017-08-30  Maciej W. Rozycki  <macro@imgtec.com>
1656         * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1657         branch offset interpretation.
1659 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1661         PR binutils/22032
1662         * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1664 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
1666         * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1667         (elf_x86_64_srelplt2): Likewise.
1669 2017-08-30  Alan Modra  <amodra@gmail.com>
1671         * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1672         (ppc64_elf_tls_optimize): Set it.
1673         (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1674         insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1675         addis would add zero.
1676         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1677         (ppc_elf_tls_optimize): Set it.
1678         (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1679         insn on TPREL16_LO relocs to use r2 when addis would add zero.
1681 2017-08-30  Alan Modra  <amodra@gmail.com>
1683         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1684         __tls_get_addr call sequences to LE, don't move the addi down
1685         to the nop.  Replace the bl with addi and leave the nop alone.
1687 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
1689         * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1690         Re-indent.
1691         * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1692         Likewise.
1693         (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1695 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
1697         * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1698         (BFD64_BACKENDS): Likewise.
1699         (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1700         (BFD64_BACKENDS_CFILES): Likewise.
1701         * Makefile.in: Regenerated.
1702         * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1703         elf32-i386.lo and elf64-x86-64.lo.
1704         * configure: Regenerated.
1705         * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1706         "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1707         "objalloc.h" and "hashtab.h".
1708         (ELIMINATE_COPY_RELOCS): Removed.
1709         (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1710         (SYMBOL_NO_COPYRELOC): Likewise.
1711         (elf_i386_link_hash_entry): Likewise.
1712         (GOT_UNKNOWN): Likewise.
1713         (GOT_NORMAL): Likewise.
1714         (GOT_TLS_GD): Likewise.
1715         (elf_i386_hash_entry): Likewise.
1716         (elf_i386_obj_tdata): Likewise.
1717         (elf_i386_tdata): Likewise.
1718         (elf_i386_local_got_tls_type): Likewise.
1719         (elf_i386_local_tlsdesc_gotent): Likewise.
1720         (elf_i386_hash_table): Likewise.
1721         (elf_i386_link_hash_newfunc): Likewise.
1722         (elf_i386_local_htab_hash): Likewise.
1723         (elf_i386_local_htab_eq): Likewise.
1724         (elf_i386_get_local_sym_hash): Likewise.
1725         (elf_i386_link_hash_table_free): Likewise.
1726         (elf_i386_copy_indirect_symbol): Likewise.
1727         (elf_i386_fixup_symbol): Likewise.
1728         (elf_i386_readonly_dynrelocs): Likewise.
1729         (elf_i386_always_size_sections): Likewise.
1730         (elf_i386_set_tls_module_base): Likewise.
1731         (elf_i386_dtpoff_base): Likewise.
1732         (compare_relocs): Likewise.
1733         (elf_i386_hash_symbol): Likewise.
1734         (elf_i386_parse_gnu_properties): Likewise.
1735         (elf_i386_merge_gnu_properties): Likewise.
1736         (elf_i386_link_check_relocs): Likewise.
1737         (elf_i386_merge_symbol_attribute): Likewise.
1738         (bfd_elf32_bfd_link_check_relocs): Likewise.
1739         (elf_backend_copy_indirect_symbol): Likewise.
1740         (elf_backend_always_size_sections): Likewise.
1741         (elf_backend_omit_section_dynsym): Likewise.
1742         (elf_backend_hash_symbol): Likewise.
1743         (elf_backend_fixup_symbol): Likewise.
1744         (elf_backend_parse_gnu_properties): Likewise.
1745         (elf_backend_merge_gnu_properties): Likewise.
1746         (elf_backend_merge_symbol_attribute): Likewise.
1747         (elf_i386_mkobject): Updated.
1748         (elf_i386_link_hash_table_create): Likewise.
1749         (elf_i386_check_tls_transition): Likewise.
1750         (elf_i386_tls_transition): Likewise.
1751         (elf_i386_convert_load_reloc): Likewise.
1752         (elf_i386_check_relocs): Likewise.
1753         (elf_i386_adjust_dynamic_symbol): Likewise.
1754         (elf_i386_allocate_dynrelocs): Likewise.
1755         (elf_i386_convert_load): Likewise.
1756         (elf_i386_size_dynamic_sections): Likewise.
1757         (elf_i386_relocate_section): Likewise.
1758         (elf_i386_finish_dynamic_symbol ): Likewise.
1759         (elf_i386_finish_dynamic_sections): Likewise.
1760         (elf_i386_output_arch_local_syms): Likewise.
1761         (elf_i386_get_synthetic_symtab): Likewise.
1762         (elf_i386_link_setup_gnu_properties): Likewise.
1763         (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1764         of elf_link_hash_table, as base.
1765         (elf_i386_next_tls_desc_index): New.
1766         (elf_i386_srelplt2): Likewise.
1767         (elf_i386_plt): Likewise.
1768         (elf_i386_lazy_plt): Likewise.
1769         (elf_i386_non_lazy_plt): Likewise.
1770         * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1771         "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1772         "objalloc.h" and "hashtab.h".
1773         (ELIMINATE_COPY_RELOCS): Removed.
1774         (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1775         (SYMBOL_NO_COPYRELOC): Likewise.
1776         (elf_x86_64_link_hash_entry): Likewise.
1777         (GOT_UNKNOWN): Likewise.
1778         (GOT_NORMAL): Likewise.
1779         (GOT_TLS_GD): Likewise.
1780         (elf_x86_64_hash_entry): Likewise.
1781         (elf_x86_64_obj_tdata): Likewise.
1782         (elf_x86_64_tdata): Likewise.
1783         (elf_x86_64_local_got_tls_type): Likewise.
1784         (elf_x86_64_local_tlsdesc_gotent): Likewise.
1785         (elf_x86_64_hash_table): Likewise.
1786         (elf_x86_64_link_hash_newfunc): Likewise.
1787         (elf_x86_64_local_htab_hash): Likewise.
1788         (elf_x86_64_local_htab_eq): Likewise.
1789         (elf_x86_64_get_local_sym_hash): Likewise.
1790         (elf_x86_64_link_hash_table_free): Likewise.
1791         (elf_x86_64_copy_indirect_symbol): Likewise.
1792         (elf_x86_64_fixup_symbol): Likewise.
1793         (elf_x86_64_readonly_dynrelocs): Likewise.
1794         (elf_x86_64_always_size_sections): Likewise.
1795         (elf_x86_64_set_tls_module_base): Likewise.
1796         (elf_x86_64_dtpoff_base): Likewise.
1797         (compare_relocs): Likewise.
1798         (elf_x86_64_merge_symbol_attribute): Likewise.
1799         (elf_x86_64_hash_symbol): Likewise.
1800         (elf_x86_64_parse_gnu_properties): Likewise.
1801         (elf_x86_64_merge_gnu_properties): Likewise.
1802         (elf_x86_64_link_check_relocs): Likewise.
1803         (elf_backend_copy_indirect_symbol): Likewise.
1804         (elf_backend_always_size_sections): Likewise.
1805         (bfd_elf64_bfd_link_check_relocs): Likewise.
1806         (elf_backend_merge_symbol_attribute): Likewise.
1807         (elf_backend_hash_symbol): Likewise.
1808         (elf_backend_omit_section_dynsym): Likewise.
1809         (elf_backend_fixup_symbol): Likewise.
1810         (elf_backend_parse_gnu_properties): Likewise.
1811         (elf_backend_merge_gnu_properties): Likewise.
1812         (bfd_elf32_bfd_link_check_relocs): Likewise.
1813         (elf_x86_64_mkobject): Updated.
1814         (elf_x86_64_link_hash_table_create): Likewise.
1815         (elf_x86_64_check_tls_transition): Likewise.
1816         (elf_x86_64_tls_transition): Likewise.
1817         (elf_x86_64_convert_load_reloc): Likewise.
1818         (elf_x86_64_check_relocs): Likewise.
1819         (elf_x86_64_adjust_dynamic_symbol): Likewise.
1820         (elf_x86_64_allocate_dynrelocs): Likewise.
1821         (elf_x86_64_convert_load): Likewise.
1822         (elf_x86_64_size_dynamic_sections): Likewise.
1823         (elf_x86_64_relocate_section): Likewise.
1824         (elf_x86_64_finish_dynamic_symbol ): Likewise.
1825         (elf_x86_64_finish_dynamic_sections): Likewise.
1826         (elf_x86_64_output_arch_local_syms): Likewise.
1827         (elf_x86_64_get_synthetic_symtab): Likewise.
1828         (elf_x86_64_link_setup_gnu_properties): Likewise.
1829         (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1830         instead of elf_link_hash_table, as base.
1831         (elf_x86_64_next_tls_desc_index): New.
1832         (elf_x86_64_srelplt2): Likewise.
1833         (elf_x86_64_plt): Likewise.
1834         (elf_x86_64_lazy_plt): Likewise.
1835         (elf_x86_64_non_lazy_plt): Likewise.
1836         * elfxx-x86.c: New file.
1837         * elfxx-x86.h: Likewise.
1839 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
1841         * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1842         return.
1843         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1845 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
1847         * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1848         sections before checking dynamic relocations and free invalid
1849         PLT section contents.
1850         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1852 2017-08-28  H.J. Lu  <hongjiu.lu@intel.com>
1854         * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1855         * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1857 2017-08-28  H.J. Lu  <hongjiu.lu@intel.com>
1859         PR binutils/22018
1860         * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1861         PLT section size.
1862         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1864 2017-08-27  H.J. Lu  <hongjiu.lu@intel.com>
1866         * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1867         def_protected.
1868         * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1870 2017-08-26  H.J. Lu  <hongjiu.lu@intel.com>
1872         PR ld/21997
1873         * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1874         dyn_lib_class and has_gnu_symbols.  Change bad_symtab to bitfield.
1875         Add a has_no_copy_on_protected bitfield.
1876         (elf_has_no_copy_on_protected): New.
1877         * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1878         elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1879         (elf_merge_gnu_property_list): Likewise.
1880         (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1881         to FALSE for elf_has_no_copy_on_protected.
1882         * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1883         (elf_i386_link_hash_entry): Add def_protected.
1884         (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1885         when checking info->nocopyreloc.
1886         (elf_i386_link_setup_gnu_properties): Don't set
1887         extern_protected_data here.
1888         (elf_i386_merge_symbol_attribute): New function.
1889         (elf_backend_merge_symbol_attribute): New.
1890         * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1891         (elf_x86_64_link_hash_entry): Add def_protected.
1892         (elf_x86_64_need_pic): Report protected symbol for def_protected.
1893         (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1894         when checking info->nocopyreloc.
1895         (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1896         relocation run-time overflow and unresolvable R_X86_64_32S
1897         relocation against protected data symbol defined in shared object
1898         with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1899         (elf_x86_64_link_setup_gnu_properties): Don't set
1900         extern_protected_data here.
1901         (elf_x86_64_merge_symbol_attribute): New function.
1902         (elf_backend_merge_symbol_attribute): New.
1904 2017-08-26  Alan Modra  <amodra@gmail.com>
1906         * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll.  Comment.
1907         (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1908         (ppc_elf_relocate_section): Comment fix.
1909         * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll.  Comment.
1910         (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1911         Support dynamic relocs for TPREL16 when non-pic too.
1912         (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1913         (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1914         when non-pic too.
1916 2017-08-25  H.J. Lu  <hongjiu.lu@intel.com>
1918         * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1919         "symbol" in comments.
1920         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1922 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
1924         PR ld/22001
1925         * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1926         R_X86_64_PC32 relocation run-time overflow and unresolvable
1927         R_X86_64_32S relocation with -z nocopyreloc.
1929 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
1931         * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1932         Undefined symbols may not have a type.
1933         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1935 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
1937         * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1938         bfd_link_info.  Report shared, PIE or PDE object based on
1939         bfd_link_info.
1940         (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1941         (elf_x86_64_relocate_section): Likewise.
1943 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
1945         * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1946         for function symbols.
1947         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1949 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
1951         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1952         extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1953         is set on any input relocatable file.
1954         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1956 2017-08-23  Alan Modra  <amodra@gmail.com>
1958         PR 21988
1959         * elf64-ppc.c (ensure_undef_dynamic): Rename from
1960         ensure_undefweak_dynamic.  Handle undefined too.
1961         * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1962         * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1963         (allocate_dynrelocs): Discard undefined non-default visibility
1964         relocs first.  Make undefined syms dynamic.  Tidy goto.
1966 2017-08-21  Alan Modra  <amodra@gmail.com>
1967             H.J. Lu  <hongjiu.lu@intel.com>
1969         PR ld/21964
1970         * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1971         * elflink.c (bfd_elf_define_start_stop): Rewrite.
1973 2017-08-21  Hans-Peter Nilsson  <hp@bitrange.com>
1975         PR ld/20125
1976         * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1977         undefined weak symbols.
1979 2017-08-18  Nick Clifton  <nickc@redhat.com>
1981         PR binutils/21962
1982         * tekhex.c (getsym): Fix check for source pointer walking off the
1983         end of the input buffer.
1985 2017-08-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>
1987         PR ld/18808
1988         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1989         relocations in debug sections, change abort to _bfd_error_handler.
1991 2017-08-14  Nick Clifton  <nickc@redhat.com>
1993         PR 21957
1994         * elf.c (setup_group): Check for an empty or very small group
1995         section.
1996         * po/bfd.pot: Regenerate.
1998 2017-08-14  Alan Modra  <amodra@gmail.com>
2000         PR 21441
2001         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
2002         alignment padding here.
2003         * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
2004         in a reverse pass over sections.
2006 2017-08-11  H.J. Lu  <hongjiu.lu@intel.com>
2008         PR binutils/21943
2009         * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
2010         for @plt suffixes first.
2011         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2013 2017-08-08  Nick Clifton  <nickc@redhat.com>
2015         PR 21916
2016         * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
2017         small section lengths.
2018         * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
2019         table.
2020         (elfcore_grok_freebsd_prstatus): Add checks to make sure that
2021         there is enough data present in the note.
2023 2017-08-08  Alan Modra  <amodra@gmail.com>
2025         PR 21017
2026         * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
2027         got.refcount for GOTOFF relocs, just create .got section.
2029 2017-08-07  H.J. Lu  <hongjiu.lu@intel.com>
2031         * elflink.c (elf_link_add_object_symbols): Move common symbol
2032         check after bed->common_definition.
2034 2017-08-07  Alan Modra  <amodra@gmail.com>
2036         PR 21910
2037         * elflink.c (bfd_elf_final_link): Don't segfault when sections
2038         needed to define various dynamic tags have been discarded.
2040 2017-08-07  Nick Clifton  <nickc@redhat.com>
2042         PR 21884
2043         * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
2044         has not been set then use the bfd returned by
2045         _bfd_elf_link_setup_gnu_properties.  If that is null then search
2046         through all the input bfds selecting the first normal, ELF format
2047         one.
2048         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
2050 2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
2052         * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
2053         to 1 bit.
2054         (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
2055         (elf_i386_check_tls_transition): Check tls_get_addr directly.
2056         (elf_i386_convert_load_reloc): Update tls_get_addr check.
2057         (elf_i386_link_check_relocs): New function.
2058         (bfd_elf32_bfd_link_check_relocs): New.
2059         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
2060         to 1 bit.
2061         (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
2062         (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
2063         (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
2064         (elf_x86_64_link_check_relocs): New function.
2065         (bfd_elf64_bfd_link_check_relocs): New.
2066         (bfd_elf32_bfd_link_check_relocs): Likewise.
2068 2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
2070         PR ld/21903:
2071         * elflink.c (elf_link_add_object_symbols): Treat common symbol
2072         as undefined for --no-define-common.
2074 2017-08-05  Alan Modra  <amodra@gmail.com>
2076         * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
2077         hppa_link_hash_table.
2079 2017-08-02  Max Filippov  <jcmvbkbc@gmail.com>
2081         * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
2082         entries for sysregs with negative indices.
2084 2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2086         * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
2087         isn't the S/390 specific elf data.
2088         * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2090 2017-07-31  Kuan-Lin Chen  <rufus@andestech.com>
2092         * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
2093         * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
2094         [R_RISCV_ADD16]: Likewise.
2095         [R_RISCV_ADD32]: Likewise.
2096         [R_RISCV_ADD64]: Likewise.
2097         [R_RISCV_SUB6]: Likewise.
2098         [R_RISCV_SUB8]: Likewise.
2099         [R_RISCV_SUB16]: Likewise.
2100         [R_RISCV_SUB32]: Likewise.
2101         [R_RISCV_SUB64]: Likewise.
2103 2017-07-31  Alan Modra  <amodra@gmail.com>
2105         * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
2106         without ld.so checks.
2108 2017-07-29  Alan Modra  <amodra@gmail.com>
2110         PR 21847
2111         * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
2112         (ppc64_elf_merge_symbol): Set non_zero_localentry.
2113         (is_elfv2_localentry0): Test non_zero_localentry.
2114         (ppc64_elf_tls_setup): Default to --no-plt-localentry.
2116 2017-07-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2118         * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
2119         pointer check for htab->elf.irelplt.
2120         * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
2122 2017-07-27  Nick Clifton  <nickc@redhat.com>
2124         PR 21840
2125         * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
2126         size is -1.
2127         * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
2128         with error return.
2129         * section.c (bfd_make_section_with_flags): Fail if the name or bfd
2130         are NULL.
2131         * vms-alpha.c (bfd_make_section_with_flags): Correct computation
2132         of end pointer.
2133         (evax_bfd_print_emh): Check for invalid string lengths.
2135 2017-07-25  Nick Clifton  <nickc@redhat.com>
2137         * po/fr.po: Updated French translation.
2139 2017-07-25  Benjamin Green  <bengreen5mx@gmail.com>
2141         PR 21824
2142         * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
2143         16-bit absolute branches into 10-bit pc-relative branches on the
2144         MSP430 as well as the MSP430X.
2146 2017-07-25  Alan Modra  <amodra@gmail.com>
2148         * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
2149         (stub_eh_frame_size): New function.
2150         (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
2151         (group_sections): Init group tls_get_addr_opt_bctrl.
2152         (ppc64_elf_size_stubs): Update sizing and initialization of
2153         .eh_frame.  Iteration over stubs via group list.
2154         (ppc64_elf_build_stubs): Iterate over stubs via group list.
2155         (ppc64_elf_finish_dynamic_sections): Update finalization of
2156         .eh_frame.
2158 2017-07-24  Nick Clifton  <nickc@redhat.com>
2160         PR 21813
2161         * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
2162         of the relocs to the canonicalize_one_reloc routine.
2163         * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
2164         for the _bfd_mach_o_canonicalize_one_reloc field.
2165         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
2166         res_base parameter.  Use to check for corrupt pair relocs.
2167         * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
2168         Likewise.
2169         * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
2170         Likewise.
2171         * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
2172         Likewise.
2174         * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
2175         enough data in the record before attempting to parse it.
2176         (_bfd_vms_slurp_eeom): Likewise.
2178         (_bfd_vms_slurp_egsd): Check for an invalid section index.
2179         (image_set_ptr): Likewise.
2180         (alpha_vms_slurp_relocs): Likewise.
2182         (alpha_vms_object_p): Check for a truncated record.
2184 2017-07-24  Nick Clifton  <nickc@redhat.com>
2186         PR 21803
2187         * reloc.c (_bfd_unrecognized_reloc): New function.  Reports
2188         an unrecognized reloc and sets the bfd_error value.
2189         * libbfd.h: Regenerate.
2190         * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
2191         function.
2192         * elf32-i386.c (elf_i386_relocate_section): Likewise.
2193         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2194         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2195         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
2196         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2198 2017-07-23  Alan Modra  <amodra@gmail.com>
2200         * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
2201         restore of LR.
2203 2017-07-19  Szabolcs Nagy  <szabolcs.nagy@arm.com>
2205         PR ld/18841
2206         * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
2207         reloc_class_ifunc for ifunc symbols.
2209 2017-07-19  Nick Clifton  <nickc@redhat.com>
2211         PR 21787
2212         * archive.c (bfd_generic_archive_p): If the bfd does not have the
2213         correct magic bytes at the start, set the error to wrong format
2214         and clear the format selector before returning NULL.
2216 2017-07-19  Nick Clifton  <nickc@redhat.com>
2218         PR 21786
2219         * coff-rs6000.c (_bfd_strntol): New function.
2220         (_bfd_strntoll): New function.
2221         (GET_VALUE_IN_FIELD): New macro.
2222         (EQ_VALUE_IN_FIELD): new macro.
2223         (_bfd_xcoff_slurp_armap): Use new macros.
2224         (_bfd_xcoff_archive_p): Likewise.
2225         (_bfd_xcoff_read_ar_hdr): Likewise.
2226         (_bfd_xcoff_openr_next_archived_file): Likewise.
2227         (_bfd_xcoff_stat_arch_elt): Likewise.
2228         * coff64-rs6000.c (_bfd_strntol): New function.
2229         (_bfd_strntoll): New function.
2230         (GET_VALUE_IN_FIELD): New macro.
2231         (xcoff64_slurp_armap): Use new macros.
2233 2017-07-19  Claudiu Zissulescu  <claziss@synopsys.com>
2234             John Eric Martin  <John.Martin@emmicro-us.com>
2236         * bfd-in2.h: Regenerate.
2237         * libbfd.h: Regenerate.
2238         * elf32-arc.c (JLI): Define.
2239         * reloc.c: Add JLI relocations.
2241 2017-07-18  Nick Clifton  <nickc@redhat.com>
2243         PR 21775
2244         * coff-sh.c: Fix spelling typos.
2245         * compress.c: Likewise.
2246         * cpu-pdp11.c: Likewise.
2247         * ecofflink.c: Likewise.
2248         * elf-m10300.c: Likewise.
2249         * elf.c: Likewise.
2250         * elf32-arm.c: Likewise.
2251         * elf32-m68k.c: Likewise.
2252         * elf32-nds32.c: Likewise.
2253         * elf32-ppc.c: Likewise.
2254         * elf32-sh.c: Likewise.
2255         * elf32-v850.c: Likewise.
2256         * elf64-ppc.c: Likewise.
2257         * elf64-x86-64.c: Likewise.
2258         * elflink.c: Likewise.
2259         * elfnn-aarch64.c: Likewise.
2260         * elfxx-mips.c: Likewise.
2261         * som.c: Likewise.
2262         * sunos.c: Likewise.
2263         * vms-alpha.c: Likewise.
2264         * xcofflink.c: Likewise.
2266 2017-07-18  Nick Clifton  <nickc@redhat.com>
2268         PR binutils/21781
2269         * coffcode.h (handle_COMDAT): Replace abort with an error message
2270         and return.
2272 2017-07-17  H.J. Lu  <hongjiu.lu@intel.com>
2274         PR ld/21782
2275         * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2276         to shared library.
2278 2017-07-17  H.J. Lu  <hongjiu.lu@intel.com>
2280         * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2282 2017-07-16  Alan Modra  <amodra@gmail.com>
2284         * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2285         __tls_index GOT entries when using __tls_get_addr_opt stub.
2286         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2288 2017-07-12  Alan Modra  <amodra@gmail.com>
2290         * po/es.po: Update from translationproject.org/latest/bfd/.
2291         * po/fi.po: Likewise.
2292         * po/fr.po: Likewise.
2293         * po/id.po: Likewise.
2294         * po/ja.po: Likewise.
2295         * po/ro.po: Likewise.
2296         * po/ru.po: Likewise.
2297         * po/sr.po: Likewise.
2298         * po/sv.po: Likewise.
2299         * po/tr.po: Likewise.
2300         * po/uk.po: Likewise.
2301         * po/vi.po: Likewise.
2302         * po/zh_CN.po: Likewise.
2303         * po/hr.po: New file from translationproject.org.
2304         * configure.ac (ALL_LINGUAS): Add hr.  Sort.
2305         * configure: Regenerate.
2307 2017-07-12  Nick Clifton  <nickc@redhat.com>
2309         Fix compile time warnings using gcc 7.1.1.
2310         * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2311         plt_name buffer.
2312         (elf_xtensa_get_gotplt_section): Increase length of got_name
2313         buffer.
2314         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2315         default return of FALSE.
2316         * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2317         default return of FALSE.
2319 2017-07-12  Alan Modra  <amodra@gmail.com>
2321         * binary.c (binary_set_section_contents): Don't print filepos in
2322         error message.
2323         (coff_write_object_contents): Cast size_t for error message.
2324         (coff_slurp_line_table): Don't use bfd_vma symndx.
2325         (coff_slurp_reloc_table): Remove unneeded cast.
2326         * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2327         error message.
2328         (find_abstract_instance_name): Likewise.
2329         * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2330         (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2331         (elf32_arm_check_relocs): Make r_symndx an int.
2332         * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2333         format string.
2334         * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2335         message arg.
2336         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2337         error message.
2338         * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2339         * elf32-s390.c (elf_s390_check_relocs): Likewise.
2340         * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2341         * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2342         * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2343         * elf64-s390.c (elf_s390_check_relocs): Likewise.
2344         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2345         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2346         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2347         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2348         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2349         * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2350         and use %lu for error message.
2351         * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2352         * mmo.c (mmo_scan): Make stab_loc a file_ptr.  Cast expression for
2353         error message.
2355         * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2356         in error message.
2357         (elf32_arm_final_link_relocate): Likewise.
2358         * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2359         * coffcode.h (styp_to_sec_flags): Likewise.
2360         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2361         * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2362         * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2363         * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2364         (elf32_bfin_merge_private_bfd_data): Likewise.
2365         * elf32-cris.c (cris_elf_relocate_section): Likewise.
2366         * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2367         * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2368         (i370_elf_relocate_section): Likewise.
2369         * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2370         * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2371         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2372         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2373         * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2374         * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2375         * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2376         * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2377         (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2378         * ieee.c (ieee_write_id, read_id): Likewise.
2379         * mach-o.c (bfd_mach_o_write_contents): Likewise.
2380         (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2381         (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2382         (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2383         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2384         * stabs.c (_bfd_link_section_stabs): Likewise.
2386         * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2387         format.
2388         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2389         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2390         * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2391         * coff-sh.c (sh_relax_section): Likewise.
2392         (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2393         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2394         * coffcode.h (coff_slurp_reloc_table): Likewise.
2395         * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2396         (_bfd_coff_read_string_table): Likewise.
2397         * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2398         * compress.c (bfd_get_full_section_contents): Likewise.
2399         * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2400         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2401         * elf.c (bfd_elf_string_from_elf_section): Likewise.
2402         * elf32-arc.c (arc_special_overflow_checks): Likewise.
2403         * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2404         (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2405         (elf32_arm_write_section): Likewise.
2406         * elf32-bfin.c (bfin_relocate_section): Likewise.
2407         (bfinfdpic_relocate_section): Likewise.
2408         * elf32-hppa.c (hppa_build_one_stub): Likewise.
2409         (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2410         * elf32-i386.c (elf_i386_tls_transition): Likewise.
2411         (elf_i386_relocate_section): Likewise.
2412         * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2413         * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2414         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2415         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2416         * elf32-metag.c (elf_metag_relocate_section): Likewise.
2417         * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2418         (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2419         (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2420         (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2421         (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2422         (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2423         (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2424         (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2425         (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2426         * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2427         * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2428         * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2429         * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2430         * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2431         * elf32-sh.c (sh_elf_relax_section): Likewise.
2432         (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2433         (sh_elf_relocate_section): Likewise.
2434         * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2435         * elf32-spu.c (spu_elf_relocate_section): Likewise.
2436         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2437         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2438         * elf32-v850.c (v850_elf_relax_section): Likewise.
2439         * elf32-vax.c (elf_vax_check_relocs): Likewise.
2440         (elf_vax_relocate_section): Likewise.
2441         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2442         (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2443         (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2444         (do_fix_for_relocatable_link): Likewise.
2445         * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2446         (elf64_alpha_relax_with_lituse): Likewise.
2447         * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2448         (elf_hppa_final_link_relocate): Likewise.
2449         * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2450         (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2451         (elf64_vms_link_add_object_symbols): Likewise.
2452         * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2453         (mmix_final_link_relocate): Likewise.
2454         * elf64-s390.c (invalid_tls_insn): Likewise.
2455         (elf_s390_relocate_section): Likewise.
2456         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2457         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2458         (elf_x86_64_relocate_section): Likewise.
2459         * elfcode.h (elf_slurp_symbol_table): Likewise.
2460         * elfcore.h (elf_core_file_p): Likewise.
2461         * elflink.c (elf_link_read_relocs_from_section): Likewise.
2462         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2463         (elfNN_aarch64_relocate_section): Likewise.
2464         * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2465         (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2466         * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2467         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2468         (_bfd_mips_elf_relocate_section): Likewise.
2469         (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2470         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2471         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2472         * ieee.c (ieee_slurp_external_symbols): Likewise.
2473         * ihex.c (ihex_write_object_content): Likewise.
2474         * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2475         * merge.c (_bfd_merged_section_offset): Likewise.
2476         * mmo.c (mmo_write_loc_chunk): Likewise.
2477         (mmo_write_object_contents): Likewise.
2478         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2479         * stabs.c (_bfd_link_section_stabs): Likewise.
2480         * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2482 2017-07-11  Alan Modra  <amodra@gmail.com>
2484         * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2486 2017-07-11  Alan Modra  <amodra@gmail.com>
2488         * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2489         instruction" error using _bfd_error_handler, not einfo.
2491 2017-07-10  Nick Clifton  <nickc@redhat.com>
2493         * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2494         for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2496 2017-07-07  John Baldwin  <jhb@FreeBSD.org>
2498         * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2500 2017-07-07  Alan Modra  <amodra@gmail.com>
2502         * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2504 2017-07-07  Alan Modra  <amodra@gmail.com>
2506         * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2507         as long long.  Move code replacing "ll" with "I64", and simplify.
2509 2017-07-06  H.J. Lu  <hongjiu.lu@intel.com>
2511         * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2512         to 1.
2514 2017-07-05  H.J. Lu  <hongjiu.lu@intel.com>
2516         * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2517         xtime.
2518         (line_info_add_file_name): Likewise.
2519         (decode_line_info): Likewise.
2521 2017-07-04  Tristan Gingold  <gingold@adacore.com>
2523         * version.m4: Bump version to 2.29.51
2524         * configure: Regenerate.
2526 2017-07-04  Jiong Wang  <jiong.wang@arm.com>
2528         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2529         sanity check at the head of this function.
2531 2017-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
2533         * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2534         dwarf_line_str_size.
2535         (struct attr_abbrev): Add field implicit_const.
2536         (dwarf_debug_sections): Add .debug_line_str.
2537         (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2538         (dwarf_debug_section_assert): Add static assertion.
2539         (read_indirect_line_string): New.
2540         (read_abbrevs): Support DW_FORM_implicit_const.
2541         (is_str_attr): Support DW_FORM_line_strp.
2542         (read_attribute_value): Support DW_FORM_line_strp and
2543         DW_FORM_implicit_const.
2544         (read_attribute): Support DW_FORM_implicit_const.
2545         (line_info_add_include_dir, line_info_add_include_dir_stub):
2546         (line_info_add_file_name, read_formatted_entries): New.
2547         (decode_line_info, parse_comp_unit): Support DWARF 5.
2548         (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2550 2017-07-03  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
2552         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2553         abort statement that was put for symbols that are not dynamic.
2555 2017-07-03  Tristan Gingold  <gingold@adacore.com>
2557         * po/bfd.pot: Regenerate
2559 2017-07-03  Alan Modra  <amodra@gmail.com>
2561         * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2562         __MSVCRT__.  Support "L" modifier for bfd_vma.  Formatting.
2563         * elf.c (setup_group): Use "Lx" to print sh_size.
2564         (_bfd_elf_setup_sections): Remove unnecessary cast and print
2565         unknown section type in hex.
2566         (copy_special_section_fields): Style fix.
2567         (bfd_section_from_shdr): Correct format for sh_link.  Use a
2568         common error message for all the variants of unrecognized
2569         section types.
2570         (assign_file_positions_for_load_sections): Use "Lx" for lma
2571         adjust error message.
2572         (assign_file_positions_for_non_load_sections): Formatting.
2573         (rewrite_elf_program_header): Formatting.  Use "Lx" for
2574         bfd_vma values in error messages.
2575         * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2576         ELF_R_SYM value to type expected by format.
2577         * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2578         in error messages.
2579         (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2580         (elf_link_input_bfd): Use "Lx" for r_info.
2581         (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2583 2017-07-03  Alan Modra  <amodra@gmail.com>
2585         * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2586         * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2587         Microsoft C library variant of long long format specifier.
2588         (PRINT20): Cast value to bfd_uint64_t not long long.
2589         * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2590         * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2591         long long.  Don't cast to bfd_vma.
2592         * elf32-score.c (score3_bfd_getl48): Likewise.
2593         * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2595 2017-07-03  Alan Modra  <amodra@gmail.com>
2597         * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2598         print d_tag.
2599         (bfd_elf_print_symbol): Don't cast symbol->flags.
2600         (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2601         * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2602         _bfd_error_handler argument order.
2603         (ppc_elf_merge_private_bfd_data): Don't cast flags.
2605 2017-07-03  Alan Modra  <amodra@gmail.com>
2607         * configure.ac: Invoke AC_CHECK_TYPES for long long.  Invoke
2608         AC_TYPE_LONG_DOUBLE.
2609         * configure: Regenerate.
2610         * config.in: Regenerate.
2612 2017-06-29  Andrew Waterman  <andrew@sifive.com>
2614         * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2615         relocs.
2617 2017-06-29  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
2619         * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2620         unless it is undefined weak.
2621         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2622         relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2623         relocation.
2624         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2625         is not dynamic in PIC, abort.
2627 2017-06-29  Jiong Wang  <jiong.wang@arm.com>
2629         PR ld/21402
2630         * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2631         undefined weak symbols into dynamic.
2632         (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2633         relocation for non-dynamic symbols.
2634         (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2636 2017-06-29  Jiong Wang  <jiong.wang@arm.com>
2638         * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2639         (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2640         BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2641         BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2642         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2643         support for them.
2645 2017-06-29  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2647         * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2648         (elfcore_write_s390_gs_bc): Likewise.
2649         * elf.c (elfcore_grok_s390_gs_cb): New function.
2650         (elfcore_grok_s390_gs_bc): New function.
2651         (elfcore_grok_note): Call them.
2652         (elfcore_write_s390_gs_cb): New function.
2653         (elfcore_write_s390_gs_bc): New function.
2654         (elfcore_write_register_note): Call them.
2656 2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>
2658         * libbfd.c (_bfd_generic_get_section_contents): Don't call
2659         bfd_get_file_size.  Check archive element size.
2660         (_bfd_generic_get_section_contents_in_window): Likewise.
2662 2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>
2664         * bfd-in2.h: Regenerated.
2665         * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2666         (bfd_get_file_size): Likewise.
2668 2017-06-28  Maciej W. Rozycki  <macro@imgtec.com>
2669             Matthew Fortune  <matthew.fortune@imgtec.com>
2671         * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2672         * cpu-mips.c (I_interaptiv_mr2): New enum value.
2673         (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2674         * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2675         case.
2676         (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2677         (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2678         (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2679         (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2680         `bfd_mach_mips_interaptiv_mr2' entries.
2681         * bfd-in2.h: Regenerate.
2683 2017-06-27  Nick Clifton  <nickc@redhat.com>
2685         * tekhex.c (pass_over): Revert accidental conversion of a local
2686         array to a static array.
2688 2017-06-27  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
2690         PR ld/13402
2691         * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2692         reloc addend if necessary. Adjust diff only if
2693         shrinked_insn_address < end_address.
2695 2017-06-27  Alan Modra  <amodra@gmail.com>
2697         PR binutils/21665
2698         * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2699         (_bfd_generic_get_section_contents_in_window): Likewise.
2701 2017-06-26  Kuan-Lin Chen  <rufus@andestech.com>
2703         * elfnn-riscv.c (perform_relocation): Support the new
2704         R_RISCV_32_PCREL relocation.
2705         (riscv_elf_relocate_section): Likewise.
2706         * elfxx-riscv.c (howto_table): Likewise.
2707         (riscv_reloc_map): Likewise.
2708         * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2709         * libbfd.h: Regenerate.
2711 2017-06-27  Alan Modra  <amodra@gmail.com>
2713         PR binutils/21665
2714         * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2715         Use unsigned file pointer type, and remove cast.
2716         * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2717         Add "count", not "sz".
2719 2017-06-26  Pedro Alves  <palves@redhat.com>
2721         PR binutils/21665
2722         * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2723         "sz".
2725 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
2727         PR binutils/21665
2728         * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2729         a missing line.
2731 2017-06-26  Maciej W. Rozycki  <macro@imgtec.com>
2733         * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2734         * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2735         E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2736         (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2737         `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2739 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
2741         PR binutils/21665
2742         * compress.c (bfd_get_full_section_contents): Don't check the
2743         file size here.
2744         * libbfd.c (_bfd_generic_get_section_contents): Check for and
2745         reject a section whose size + offset is greater than the size
2746         of the entire file.
2747         (_bfd_generic_get_section_contents_in_window): Likewise.
2749 2017-06-26  Nick Clifton  <nickc@redhat.com>
2751         PR binutils/21670
2752         * tekhex.c (getvalue): Check for the source pointer exceeding the
2753         end pointer before the first byte is read.
2755 2017-06-26  Nick Clifton  <nickc@redhat.com>
2757         PR binutils/21665
2758         * opncls.c (get_build_id): Check that the section is big enough
2759         to contain the whole note.
2760         * compress.c (bfd_get_full_section_contents): Check for and reject
2761         a section whose size is greater than the size of the entire file.
2762         * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2763         contain a notes section.
2765 2017-06-26  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2767         * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2768         pointer checks.
2769         (elf_s390_modify_segment_map): Likewise.
2770         (bfd_elf_s390_set_options): Lisewise.
2772 2017-06-26  Alan Modra  <amodra@gmail.com>
2774         * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2775         a --just-syms bfd.
2776         (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2777         (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2778         .preinit_array on --just-syms bfds.
2779         (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2780         (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2781         (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2783 2017-06-25  Sergei Trofimovich  <slyfox@gentoo.org>
2785         * elf.c (find_link): Bounds check "hint".
2787 2017-06-24  Thomas Preud'homme  <thomas.preudhomme@arm.com>
2789         * elf32-arm.c (using_thumb_only): Update list of architectures in
2790         BFD_ASSERT for which the logic is valid.
2791         (using_thumb2_bl): Likewise.
2792         (using_thumb2): Likewise and return true for ARMv8-R.
2793         (arch_has_arm_nop): Likewise.
2794         (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2795         merging logic.  Update commentis for value 15 of v8m_baseline,
2796         v8m_mainline and v4t_plus_v6_m arrays.  Use v8r array to decide
2797         merging of value 15 of Tag_CPU_arch.
2799 2017-06-23  Jiong Wang  <jiong.wang@arm.com>
2801         * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2802         BFD_RELOC_AARCH64_ADR_GOT_PAGE
2803         * bfd-in2.h: Regenerate.
2805 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
2807         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2808         the error_alignment label forward.  Properly align program
2809         property note section.
2811 2017-06-22  Eric Christopher  <echristo@gmail.com>
2813         * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2814         abs to fix a truncation warning.
2816 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
2818         * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2819         local undefined weak symbol to 0.
2820         * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2822 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
2824         * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2825         is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2826         (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2827         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2828         * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2829         info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2830         (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2831         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2833 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
2835         * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2836         (elf_i386_lazy_ibt_plt_entry): Likewise.
2837         (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2838         (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2839         (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2840         (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2841         (elf_i386_lazy_plt_layout): Likewise.
2842         (elf_i386_non_lazy_plt_layout): Likewise.
2843         (elf_i386_link_hash_entry): Add plt_second.
2844         (elf_i386_link_hash_table): Add plt_second and
2845         plt_second_eh_frame.
2846         (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2847         (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2848         the second PLT.  Check the second PLT.
2849         (elf_i386_relocate_section): Use the second PLT to resolve
2850         PLT reference if needed.
2851         (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2852         needed.
2853         (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2854         second PLT.  Generate unwind info for the second PLT.
2855         (elf_i386_plt_type): Add plt_second.
2856         (elf_i386_get_synthetic_symtab): Support the second PLT.
2857         (elf_i386_parse_gnu_properties): Support
2858         GNU_PROPERTY_X86_FEATURE_1_AND.
2859         (elf_i386_merge_gnu_properties): Support
2860         GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
2861         on GNU_PROPERTY_X86_FEATURE_1_IBT
2862         (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2863         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
2864         for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2865         is set on all relocatable inputs.
2866         * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2867         (elf_x32_lazy_ibt_plt_entry): Likewise.
2868         (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2869         (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2870         (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2871         (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2872         (elf_x86_64_lazy_ibt_plt): Likewise.
2873         (elf_x32_lazy_ibt_plt): Likewise.
2874         (elf_x86_64_non_lazy_ibt_plt): Likewise.
2875         (elf_x32_non_lazy_ibt_plt): Likewise.
2876         (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2877         (elf_x86_64_parse_gnu_properties): Support
2878         GNU_PROPERTY_X86_FEATURE_1_AND.
2879         (elf_x86_64_merge_gnu_properties): Support
2880         GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
2881         on GNU_PROPERTY_X86_FEATURE_1_IBT
2882         (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2883         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
2884         for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2885         is set on all relocatable inputs.
2887 2017-06-22  Nick Clifton  <nickc@redhat.com>
2889         PR binutils/21649
2890         * som.c (setup_sections): NUL terminate the space_strings buffer.
2891         Check that the space.name field does not index beyond the end of
2892         the space_strings buffer.
2894 2017-06-21  Nick Clifton  <nickc@redhat.com>
2896         PR binutils/21646
2897         * coff-sh.c (sh_reloc): Check for an out of range reloc.
2899 2017-06-21  Nick Clifton  <nickc@redhat.com>
2901         PR binutils/21639
2902         * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2903         type of the size parameter.
2904         (_bfd_vms_save_counted_string): Add second parameter - the maximum
2905         length of the counted string.
2906         * vms.h (_bfd_vms_save_sized_string): Update prototype.
2907         (_bfd_vms_save_counted_string): Likewise.
2908         * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2909         _bfd_vms_save_counted_string.
2910         (_bfd_vms_slurp_ehdr): Likewise.
2911         (_bfd_vms_slurp_egsd): Likewise.
2912         (Parse_module): Likewise.
2914 2017-06-21  Alan Modra  <amodra@gmail.com>
2916         * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2917         calls before tocsave calls.
2918         (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2919         following nop.
2921 2017-06-21  Nick Clifton  <nickc@redhat.com>
2923         PR binutils/21645
2924         * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2925         bfd_get_full_section_contents returns no contents.
2927 2017-06-21  Nick Clifton  <nickc@redhat.com>
2929         PR binutils/21638
2930         * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2931         record.
2933 2017-06-21  Nick Clifton  <nickc@redhat.com>
2935         PR binutils/21637
2936         * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2937         list.
2938         (image_set_ptr): Likewise.
2939         (alpha_vms_fix_sec_rel): Likewise.
2940         (alpha_vms_slurp_relocs): Likewise.
2942 2017-06-21  Nick Clifton  <nickc@redhat.com>
2944         PR binutils/21633
2945         * ieee.c (ieee_slurp_sections): Check for a NULL return from
2946         read_id.
2947         (ieee_archive_p): Likewise.
2948         (ieee_object_p): Likewise.
2950 2017-06-21  Nick Clifton  <nickc@redhat.com>
2952         PR binutils/21640
2953         * elf.c (setup_group): Zero the group section pointer list after
2954         allocation so that loops can be caught.  Check for NULL pointers
2955         when processing a group list.
2957 2017-06-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2959         * elf-s390.h: New file.
2960         * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2961         field.
2962         (elf_s390_additional_program_headers): New function.
2963         (elf_s390_modify_segment_map): New function.
2964         (bfd_elf_s390_set_options): New function.
2965         (elf_backend_additional_program_headers)
2966         (elf_backend_modify_segment_map): Add macro definitions.
2968 2017-06-19  H.J. Lu  <hongjiu.lu@intel.com>
2970         PR ld/21626
2971         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2972         the DYNAMIC bit instead of bfd_count_sections.
2974 2017-06-19  Nick Clifton  <nickc@redhat.com>
2976         PR binutils/21618
2977         * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2978         length.
2979         (evax_bfd_print_eeom): Likewise.
2980         (evax_bfd_print_egsd): Check for an overlarge record length.
2981         (evax_bfd_print_etir): Likewise.
2983 2017-06-19  Nick Clifton  <nickc@redhat.com>
2985         PR binutils/21612
2986         * libieee.h (struct common_header_type): Add end_p field.
2987         * ieee.c (this_byte_and_next): Do not advance input_p beyond
2988         end_p.
2989         (read_id): Check for a length that exceeds the remaining bytes in
2990         the input buffer.
2991         (ieee_seek): Initialise end_p.
2992         (ieee_archive_p): Likewise.
2993         (ieee_object_p): Likewise.
2995 2017-06-19  Nick Clifton  <nickc@redhat.com>
2997         PR binutils/21611
2998         * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2999         before reading the EIHS structure entries.
3001 2017-06-19  Nick Clifton  <nickc@redhat.com>
3003         PR binutils/21615
3004         * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
3005         gsd_size.  Check that there are enough bytes remaining to read the
3006         type and size of the next egsd.  Check that the size of the egsd
3007         does not exceed the size of the record.
3009 2017-06-19  Alan Modra  <amodra@gmail.com>
3011         * config.bfd: Correct targ_underscore for cris.
3013 2017-06-18  Alan Modra  <amodra@gmail.com>
3015         * config.bfd: Correct targ_underscore for epiphany, ip2k,
3016         m32c, mn10200, pru, rl78, rx, crisv32 and v850.
3018 2017-06-16  Nick Clifton  <nickc@redhat.com>
3020         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
3021         bucketlist is empty because there are no symbols to add to the
3022         list.
3024 2017-06-16  Alan Modra  <amodra@gmail.com>
3026         PR ld/20022
3027         PR ld/21557
3028         PR ld/21562
3029         PR ld/21571
3030         * targets.c (struct bfd_target): Add _bfd_define_start_stop.
3031         (BFD_JUMP_TABLE_LINK): Likewise.
3032         * elf-bfd.h (bfd_elf_define_start_stop): Declare.
3033         * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
3034         (bfd_elf_define_start_stop): New function.
3035         * linker.c (bfd_generic_define_start_stop): New function.
3036         * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
3037         new field.
3038         * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
3039         * aout-target.h (MY_bfd_define_start_stop): Define.
3040         * aout-tic30.c (MY_bfd_define_start_stop): Define.
3041         * binary.c (binary_bfd_define_start_stop): Define.
3042         * bout.c (b_out_bfd_define_start_stop): Define.
3043         * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
3044         * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
3045         * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
3046         * coffcode.h (coff_bfd_define_start_stop): Define.
3047         * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
3048         * i386msdos.c (msdos_bfd_define_start_stop): Define.
3049         * i386os9k.c (os9k_bfd_define_start_stop): Define.
3050         * ieee.c (ieee_bfd_define_start_stop): Define.
3051         * ihex.c (ihex_bfd_define_start_stop): Define.
3052         * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
3053         * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
3054         * mmo.c (mmo_bfd_define_start_stop): Define.
3055         * nlm-target.h (nlm_bfd_define_start_stop): Define.
3056         * oasys.c (oasys_bfd_define_start_stop): Define.
3057         * pef.c (bfd_pef_bfd_define_start_stop): Define.
3058         * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
3059         * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
3060         * som.c (som_bfd_define_start_stop): Define.
3061         * srec.c (srec_bfd_define_start_stop): Define.
3062         * tekhex.c (tekhex_bfd_define_start_stop): Define.
3063         * versados.c (versados_bfd_define_start_stop): Define.
3064         * vms-alpha.c (vms_bfd_define_start_stop): Define.
3065         (alpha_vms_bfd_define_start_stop): Define.
3066         * xsym.c (bfd_sym_bfd_define_start_stop): Define.
3067         * bfd-in2.h: Regenerate.
3068         * libbfd.h: Regenerate.
3070 2017-06-16  Jiong Wang  <jiong.wang@arm.com>
3072         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
3073         SYMBOL_REFERENCES_LOCAL.
3075 2017-06-15  Jiong Wang  <jiong.wang@arm.com>
3077         PR ld/21532
3078         * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
3079         (elfNN_aarch64_final_link_relocate): Also propagate relocations to
3080         runtime for if there needs copy relocation elimination.
3081         (need_copy_relocation_p): New function.  Return true for symbol with
3082         pc-relative references and if it's against read-only sections.
3083         (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
3084         (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
3085         that are related with accessing external objects.
3086         (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
3087         in elfNN_aarch64_check_relocs.
3089 2017-06-15  Nick Clifton  <nickc@redhat.com>
3091         PR binutils/21582
3092         * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
3093         bugs.
3094         PR binutils/21581
3095         (ieee_archive_p): Likewise.
3097 2017-06-15  Nick Clifton  <nickc@redhat.com>
3099         PR binutils/21579
3100         * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
3102 2017-06-14  Max Filippov  <jcmvbkbc@gmail.com>
3104         * elf32-xtensa.c (elf_xtensa_be_plt_entry,
3105         elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
3106         keep both windowed and call0 ABI PLT definitions.
3107         (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
3108         elf_xtensa_*_plt_entry endex.
3109         (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
3111 2017-06-14  Nick Clifton  <nickc@redhat.com>
3113         PR binutils/21578
3114         * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
3115         flag value.
3117 2017-06-14  Nick Clifton  <nickc@redhat.com>
3119         PR binutils/21589
3120         * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
3121         maximum value for the ascic pointer.  Check that name processing
3122         does not read beyond this value.
3123         (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
3124         end of etir record.
3126 2017-06-14  Nick Clifton  <nickc@redhat.com>
3128         PR binutils/21591
3129         * versados.c (versados_mkobject): Zero the allocated tdata structure.
3130         (process_otr): Check for an invalid offset in the otr structure.
3132 2017-06-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3134         * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
3136 2017-06-13  H.J. Lu  <hongjiu.lu@intel.com>
3138         PR ld/20022
3139         PR ld/21557
3140         PR ld/21562
3141         PR ld/21571
3142         * elf-bfd.h (elf_link_hash_entry): Add start_stop.  Change the
3143         vtable field to a union.
3144         (_bfd_elf_is_start_stop): Removed.
3145         * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
3146         __start_SECNAME and __stop_SECNAME symbols.
3147         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
3148         * elflink.c (_bfd_elf_is_start_stop): Removed.
3149         (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
3150         _bfd_elf_is_start_stop.
3151         (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
3152         __stop_SECNAME symbols.  Updated.
3153         (elf_gc_smash_unused_vtentry_relocs): Likewise.
3154         (bfd_elf_gc_record_vtinherit): Likewise.
3155         (bfd_elf_gc_record_vtentry): Likewise.
3157 2017-06-13  Nick Clifton  <nickc@redhat.com>
3159         PR ld/21524
3160         * elflink.c (elf_link_adjust_relocs): Generate an error when
3161         encountering a reloc against a symbol removed by garbage
3162         collection.
3164 2017-06-12  H.J. Lu  <hongjiu.lu@intel.com>
3166         * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
3167         to merge_gnu_properties.
3168         * elf-properties.c (elf_merge_gnu_properties): Add struct
3169         bfd_link_info * and pass it to merge_gnu_properties.
3170         (elf_merge_gnu_property_list): Add struct bfd_link_info *
3171         and pass it to elf_merge_gnu_properties.
3172         (_bfd_elf_link_setup_gnu_properties): Pass info to
3173         elf_merge_gnu_property_list.
3174         * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
3175         bfd_link_info *.
3176         * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
3178 2017-06-11  Joe Zbiciak  <joe.zbiciak@leftturnonly.info>
3180         PR 21564
3181         * binary.c (binary_set_section_contents): Scale lma by octets
3182         per byte to set filepos.
3184 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3186         * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
3187         dynamic sections.
3189 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3191         * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
3192         require TEXTREL.
3194 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3196         * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
3197         patched section contents for TLS IE reloc.
3198         * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
3200 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3202         * elf32-arc.c (elf_arc_relocate_section): Added "call" to
3203         RELOC_FOR_GLOBAL_SYMBOL macro.
3205 2018-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3207         * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
3208         changes.
3210 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3212         * config/tc-arc.c (md_undefined_symbol): Changed.
3213         * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
3215 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3217         * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
3218         symbols.
3220 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3222         * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
3223         warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
3225 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
3227         * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
3228         object is created.
3230 2017-06-08  Richard Earnshaw  <rearnsha@arm.com>
3232         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
3233         that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
3234         is non-zero.  Add clarifying comments.
3236 2017-06-08  H.J. Lu  <hongjiu.lu@intel.com>
3238         * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3239         name.  Use local IFUNC symbol name string to report unsupported
3240         non-PIC call to IFUNC function.
3241         (elf_i386_relocate_section): Dump local IFUNC name with minfo
3242         when generating R_386_IRELATIVE relocation.
3243         (elf_i386_finish_dynamic_symbol): Likewise.
3244         * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3245         IFUNC symbol name.
3246         (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3247         when generating R_X86_64_IRELATIVE relocation.
3248         (elf_x86_64_finish_dynamic_symbol): Likewise.
3250 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
3252         * elf.c (setup_group): Make sure BFD sections are created for all
3253         group sections in the input file when processing SHF_GROUP
3254         sections.
3255         (bfd_section_from_shdr): Avoid duplicating logic already
3256         implemented in `setup_group'.
3258 2017-06-06  Daniel Bonniot de Ruisselet  <bonniot@gmail.com>
3260         PR binutils/21546
3261         * peXXigen.c (pe_print_idata): Use the address of the first thunk
3262         if the hint address is zero.
3264 2017-06-06  James Clarke  <jrtc27@jrtc27.com>
3266         PR ld/19579
3267         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3268         ELF_COMMON_DEF_P for common symbols.
3270 2017-06-06  Andrew Burgess  <andrew.burgess@embecosm.com>
3272         * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3273         SEC_GROUP sections as SEC_EXCLUDE.
3274         (bfd_elf_set_group_contents): Replace use of abort with an assert.
3275         (assign_section_numbers): Use resolve_section_groups flag instead
3276         of relocatable link type.
3277         (_bfd_elf_init_private_section_data): Use resolve_section_groups
3278         flag instead of checking the final_link flag for part of the
3279         checks in here.  Fix white space as a result.
3280         * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3281         instead of relocatable link type.
3282         (bfd_elf_final_link): Likewise.
3284 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
3286         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3287         variable `bed'.
3288         * elf32-score.c (score_elf_final_link_relocate): Likewise.
3289         (s3_bfd_score_elf_check_relocs): Likewise.
3290         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3291         (score_elf_final_link_relocate): Likewise.
3292         (s7_bfd_score_elf_check_relocs): Likewise.
3294 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
3296         * elflink.c (init_reloc_cookie_rels): Remove unused variable
3297         `bed'.
3299 2017-06-06  Maciej W. Rozycki  <macro@imgtec.com>
3301         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3302         from `reloc_count' rather than decrementing it.
3303         * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3304         `reloc_count' by `int_rels_per_ext_rel'.
3305         * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3306         `reloc_count' by `int_rels_per_ext_rel' for last relocation
3307         entry determination.
3308         (s3_bfd_score_elf_check_relocs): Likewise.
3309         * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3310         (s7_bfd_score_elf_relocate_section): Likewise.
3311         (s7_bfd_score_elf_check_relocs): Likewise.
3312         * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3313         prototype and function.
3314         (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3315         (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3316         triple rather than once the sum of REL and RELA relocation entry
3317         counts.
3318         (bfd_elf64_get_reloc_upper_bound): Remove macro.
3319         * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3320         `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3321         storage allocation size determination.
3322         (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3323         size by `int_rels_per_ext_rel'.  Do not multiply `reloc_count'
3324         by `int_rels_per_ext_rel' for last relocation entry
3325         determination.
3326         (bfd_elf_final_link): Do not multiply `reloc_count' by
3327         `int_rels_per_ext_rel' for internal relocation storage
3328         allocation size determination.
3329         (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3330         `int_rels_per_ext_rel' for last relocation entry determination.
3331         (elf_gc_smash_unused_vtentry_relocs): Likewise.
3332         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3333         (_bfd_mips_elf_relocate_section): Likewise.
3335 2017-06-05  Alan Modra  <amodra@gmail.com>
3337         PR 21529
3338         * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3340 2017-06-01  John Baldwin  <jhb@FreeBSD.org>
3342         * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3343         determine structure sizes.
3344         (elfcore_grok_freebsd_prstatus): Likewise.
3346 2017-06-01  Alan Modra  <amodra@gmail.com>
3348         * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3349         (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3350         dynamic objects.
3351         (is_elfv2_localentry0): New function.
3352         (ppc64_elf_tls_setup): Default params->plt_localentry0.
3353         (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3354         (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3355         (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3356         optimized localentry:0 stubs.
3357         (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3358         (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3359         localentry:0 stubs.
3360         (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3361         DT_PPC64_OPT.
3362         * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3364 2017-05-30  Casey Smith  <clegg89@gmail.com>
3366         PR ld/21523
3367         * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3368         value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3370 2017-05-30  Anton Kolesov  Anton.Kolesov@synopsys.com
3372         * cpu-arc.c (arc_compatible): New function.
3374 2017-05-30  Anton Kolesov  <anton.kolesov@synopsys.com>
3376         * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3378 2017-05-30  H.J. Lu  <hongjiu.lu@intel.com>
3380         PR binutils/21519
3381         * bfdio.c (bfd_get_file_size): New function.
3382         * bfd-in2.h: Regenerated.
3384 2017-05-23  Dilian Palauzov  <git-dpa@aegee.org>
3386         * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3387         comments.
3389 2017-05-22  H.J. Lu  <hongjiu.lu@intel.com>
3391         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3392         dynobj instead of htab->elf.dynobj.
3394 2017-05-19  Maciej W. Rozycki  <macro@imgtec.com>
3396         * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3397         and function.
3398         (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3399         (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3400         actual number of internal relocations retrieved.  Adjust
3401         function description.
3402         (bfd_elf64_canonicalize_reloc): Remove macro.
3403         (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3405 2017-05-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
3407         * archures.c (bfd_mach_sparc_v9m8): Define.
3408         (bfd_mach_sparc_v8plusm8): Likewise.
3409         (bfd_mach_sparc_v9_p): Adjust to M8.
3410         (bfd_mach_sparc_64bit_p): Likewise.
3411         * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3412         bfd_mach_sparc_v8plusm8.
3413         * bfd-in2.h: Regenerated.
3414         * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3415         sparc:v8plusm8.
3416         * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3417         bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3418         capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3419         SHA3.
3420         * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3421         bfd_mach_sparc_v8plusm8.
3423 2017-05-19  Alan Modra  <amodra@gmail.com>
3425         * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3426         debug and special sections when no non-note alloc sections in an
3427         object are kept.
3429 2017-05-18  Alan Modra  <amodra@gmail.com>
3431         * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3432         * elf-m10300.c: Likewise.
3433         * elf.c: Likewise.
3434         * elf32-arc.c: Likewise.
3435         * elf32-bfin.c: Likewise.
3436         * elf32-m68k.c: Likewise.
3437         * elf32-nds32.c: Likewise.
3438         * elf32-tilepro.c: Likewise.
3439         * elflink.c: Likewise.
3440         * elfnn-aarch64.c: Likewise.
3441         * elfnn-riscv.c: Likewise.
3442         * elfxx-tilegx.c: Likewise.
3443         * mach-o.c: Likewise.
3444         * peXXigen.c: Likewise.
3445         * vms-alpha.c: Likewise.
3446         * vms-lib.c: Likewise.
3448 2017-05-17  H.J. Lu  <hongjiu.lu@intel.com>
3450         PR ld/20882
3451         * elflink.c (elf_gc_mark_debug_section): New function.
3452         (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3453         referenced by kept debug sections.
3455 2017-05-16  Alan Modra  <amodra@gmail.com>
3457         * elf-m10300.c: Rename occurrences of non_ir_ref.
3458         * elf32-arm.c: Likewise.
3459         * elf32-bfin.c: Likewise.
3460         * elf32-cr16.c: Likewise.
3461         * elf32-cris.c: Likewise.
3462         * elf32-d10v.c: Likewise.
3463         * elf32-dlx.c: Likewise.
3464         * elf32-fr30.c: Likewise.
3465         * elf32-frv.c: Likewise.
3466         * elf32-hppa.c: Likewise.
3467         * elf32-i370.c: Likewise.
3468         * elf32-i386.c: Likewise.
3469         * elf32-iq2000.c: Likewise.
3470         * elf32-lm32.c: Likewise.
3471         * elf32-m32c.c: Likewise.
3472         * elf32-m32r.c: Likewise.
3473         * elf32-m68hc1x.c: Likewise.
3474         * elf32-m68k.c: Likewise.
3475         * elf32-mcore.c: Likewise.
3476         * elf32-metag.c: Likewise.
3477         * elf32-microblaze.c: Likewise.
3478         * elf32-moxie.c: Likewise.
3479         * elf32-msp430.c: Likewise.
3480         * elf32-mt.c: Likewise.
3481         * elf32-nios2.c: Likewise.
3482         * elf32-or1k.c: Likewise.
3483         * elf32-ppc.c: Likewise.
3484         * elf32-rl78.c: Likewise.
3485         * elf32-s390.c: Likewise.
3486         * elf32-score.c: Likewise.
3487         * elf32-score7.c: Likewise.
3488         * elf32-sh.c: Likewise.
3489         * elf32-tic6x.c: Likewise.
3490         * elf32-tilepro.c: Likewise.
3491         * elf32-v850.c: Likewise.
3492         * elf32-vax.c: Likewise.
3493         * elf32-xstormy16.c: Likewise.
3494         * elf32-xtensa.c: Likewise.
3495         * elf64-alpha.c: Likewise.
3496         * elf64-hppa.c: Likewise.
3497         * elf64-ia64-vms.c: Likewise.
3498         * elf64-mmix.c: Likewise.
3499         * elf64-ppc.c: Likewise.
3500         * elf64-s390.c: Likewise.
3501         * elf64-sh64.c: Likewise.
3502         * elf64-x86-64.c: Likewise.
3503         * elflink.c: Likewise.
3504         * elfnn-aarch64.c: Likewise.
3505         * elfnn-ia64.c: Likewise.
3506         * elfnn-riscv.c: Likewise.
3507         * elfxx-mips.c: Likewise.
3508         * elfxx-sparc.c: Likewise.
3509         * elfxx-tilegx.c: Likewise.
3510         * linker.c: Likewise.
3512 2017-05-16  Alan Modra  <amodra@gmail.com>
3514         * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3515         * elflink.c (elf_link_add_object_symbols): Update to use
3516         non_ir_ref_dynamic.
3517         (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3518         non_ir_ref.
3519         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3521 2017-05-15  Maciej W. Rozycki  <macro@imgtec.com>
3523         * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3525 2017-05-12  H.J. Lu  <hongjiu.lu@intel.com>
3527         * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3528         GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3529         properties.
3530         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3532 2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>
3534         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3535         to plt_second.
3536         (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3537         to plt_second/plt_second_eh_frame.
3538         (elf_x86_64_link_hash_newfunc): Updated.
3539         (elf_x86_64_allocate_dynrelocs): Likewise.
3540         (elf_x86_64_size_dynamic_sections): Likewise.
3541         (elf_x86_64_relocate_section): Likewise.
3542         (elf_x86_64_finish_dynamic_symbol): Likewise.
3543         (elf_x86_64_finish_dynamic_sections): Likewise.
3544         (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3545         (elf_x86_64_get_synthetic_symtab): Updated.  Also scan the
3546         .plt.sec section.
3547         (elf_backend_setup_gnu_properties): Updated.  Create the
3548         .plt.sec section instead of the .plt.sec section.
3550 2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>
3552         * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3553         commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3554         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3556 2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>
3558         * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3559         (bfd_elf64_set_reloc): Define.
3560         (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3562 2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>
3564         * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3565         (struct bfd_target): New field _bfd_set_reloc.
3566         * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3567         * reloc.c (_bfd_generic_set_reloc): New function.
3568         * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3569         * nlm-target.h (nlm_set_reloc): Likewise.
3570         * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3571         * aout-tic30.c (MY_set_reloc): Likewise.
3572         * aout-target.h (MY_set_reloc): Likewise.
3573         * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3574         * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3575         * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3576         * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3577         * aout-adobe.c (aout_32_set_reloc): Likewise.
3578         * bout.c (b_out_set_reloc): Likewise.
3579         * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3580         * i386os9k.c (aout_32_set_reloc): Likewise.
3581         * ieee.c (ieee_set_reloc): Likewise.
3582         * oasys.c (oasys_set_reloc): Likewise.
3583         * som.c (som_set_reloc): Likewise.
3584         * versados.c (versados_set_reloc): Likewise.
3585         * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3586         _bfd_generic_set_reloc.
3587         (rs6000_xcoff64_aix_vec): LIkewise.
3588         * libbfd.c (_bfd_norelocs_set_reloc): New function.
3589         * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3590         * i386msdos.c (msdos_set_reloc): Define to
3591         _bfd_norelocs_set_reloc.
3592         * elfcode.h (elf_set_reloc): Define.
3593         * bfd-in2.h: Regenerated.
3595 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
3597         PR ld/21481
3598         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3599         for IFUNC function address.
3601 2017-05-10  Claudiu Zissulescu  <claziss@synopsys.com>
3603         * elf32-arc.c (FEATURE_LIST_NAME): Define.
3604         (CONFLICT_LIST): Likewise.
3605         (opcode/arc-attrs.h): Include.
3606         (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3607         (arc_extract_features): New file.
3608         (arc_stralloc): Likewise.
3609         (arc_elf_merge_attributes): Likewise.
3610         (arc_elf_merge_private_bfd_data): Use object attributes.
3611         (bfd_arc_get_mach_from_attributes): New function.
3612         (arc_elf_object_p): Use object attributes.
3613         (arc_elf_final_write_processing): Likewise.
3614         (elf32_arc_obj_attrs_arg_type): New function.
3615         (elf32_arc_obj_attrs_handle_unknown): Likewise.
3616         (elf32_arc_section_from_shdr): Likewise.
3617         (elf_backend_obj_attrs_vendor): Define.
3618         (elf_backend_obj_attrs_section): Likewise.
3619         (elf_backend_obj_attrs_arg_type): Likewise.
3620         (elf_backend_obj_attrs_section_type): Likewise.
3621         (elf_backend_obj_attrs_handle_unknown): Likewise.
3622         (elf_backend_section_from_shdr): Likewise.
3624 2017-05-09  Andrew Goedhart  <Andrewgoedhart@simplepowersolutions.co.za>
3626         PR ld/21458
3627         * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3628         of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3629         and the destination is a Thumb symbol.
3631 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
3633         * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3634         initializer to silence GCC 4.2.
3635         * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3637 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
3639         * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3640         (LAZY_PLT_ENTRY_SIZE): This.
3641         (NON_LAZY_PLT_ENTRY_SIZE): New.
3642         (elf_x86_64_plt0_entry): Renamed to ...
3643         (elf_x86_64_lazy_plt0_entry): This.
3644         (elf_x86_64_plt_entry): Renamed to ...
3645         (elf_x86_64_lazy_plt_entry): This.
3646         (elf_x86_64_bnd_plt0_entry): Renamed to ...
3647         (elf_x86_64_lazy_bnd_plt0_entry): This.
3648         (elf_x86_64_legacy_plt_entry): Removed.
3649         (elf_x86_64_bnd_plt_entry): Renamed to ...
3650         (elf_x86_64_lazy_bnd_plt_entry): This.
3651         (elf_x86_64_legacy_plt2_entry): Renamed to ...
3652         (elf_x86_64_non_lazy_plt_entry): This.
3653         (elf_x86_64_bnd_plt2_entry): Renamed to ...
3654         (elf_x86_64_non_lazy_bnd_plt_entry): This.
3655         (elf_x86_64_eh_frame_plt): Renamed to ...
3656         (elf_x86_64_eh_frame_lazy_plt): This.
3657         (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3658         (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3659         (elf_x86_64_eh_frame_plt_got): Renamed to ...
3660         (elf_x86_64_eh_frame_non_lazy_plt): This.
3661         (elf_x86_64_lazy_plt_layout): New.
3662         (elf_x86_64_non_lazy_plt_layout): Likewise.
3663         (elf_x86_64_plt_layout): Likewise.
3664         (elf_x86_64_backend_data): Remove PLT layout information.  Add
3665         os for target system.
3666         (GET_PLT_ENTRY_SIZE): Removed.
3667         (elf_x86_64_lazy_plt): New.
3668         (elf_x86_64_non_lazy_plt): Likewise.
3669         (elf_x86_64_lazy_bnd_plt): Likewise.
3670         (elf_x86_64_non_lazy_bnd_plt): Likewise.
3671         (elf_x86-64_arch_bed): Updated.
3672         (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3673         (elf_x86_64_create_dynamic_sections): Removed.
3674         (elf_x86_64_check_relocs): Don't check elf.dynobj.  Don't call
3675         _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3676         (elf_x86-64_adjust_dynamic_symbol): Updated.
3677         (elf_x86_64_allocate_dynrelocs): Updated.  Pass 0 as PLT header
3678         size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3679         size for PLT0 if there is no PLT0.  Get plt_entry_size from
3680         non_lazy_plt for non-lazy PLT entries.
3681         (elf_x86_64_size_dynamic_sections): Updated.  Get plt_entry_size
3682         from non_lazy_plt for non-lazy PLT entries.
3683         (elf_x86-64_relocate_section): Updated.  Properly get PLT index
3684         if there is no PLT0.
3685         (elf_x86_64_finish_dynamic_symbol): Updated.  Fill the first slot
3686         in the PLT entry with generic PLT layout.  Fill the non-lazy PLT
3687         entries with non-lazy PLT layout.  Don't fill the second and third
3688         slots in the PLT entry if there is no PLT0.
3689         (elf_x86_64_finish_dynamic_sections): Updated.  Don't fill PLT0
3690         if there is no PLT0.  Set sh_entsize on the .plt.got section.
3691         (compare_relocs): New.
3692         (elf_x86_64_plt_type): Likewise.
3693         (elf_x86_64_plt): Likewise.
3694         (elf_x86_64_nacl_plt): New. Forward declaration.
3695         (elf_x86_64_get_plt_sym_val): Removed.
3696         (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3697         against all dynamic relocations.
3698         (elf_x86_64_link_setup_gnu_properties): New function.
3699         (elf_backend_create_dynamic_sections): Updated.
3700         (elf_backend_setup_gnu_properties): New.
3701         (elf_x86_64_nacl_plt): New.
3702         (elf_x86_64_nacl_arch_bed): Updated.
3704 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
3706         * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3707         (LAZY_PLT_ENTRY_SIZE): This.
3708         (NON_LAZY_PLT_ENTRY_SIZE): New.
3709         (elf_i386_plt0_entry): Renamed to ...
3710         (elf_i386_lazy_plt0_entry): This.
3711         (elf_i386_plt_entry): Renamed to ...
3712         (elf_i386_lazy_plt_entry): This.
3713         (elf_i386_pic_plt0_entry): Renamed to ...
3714         (elf_i386_pic_lazy_plt0_entry): This.
3715         (elf_i386_pic_plt_entry): Renamed to ...
3716         (elf_i386_pic_lazy_plt_entry): This.
3717         (elf_i386_got_plt_entry): Renamed to ...
3718         (elf_i386_non_lazy_plt_entry): This.
3719         (elf_i386_pic_got_plt_entry): Renamed to ...
3720         (elf_i386_pic_non_lazy_plt_entry): This.
3721         (elf_i386_eh_frame_plt): Renamed to ...
3722         (elf_i386_eh_frame_lazy_plt): This.
3723         (elf_i386_eh_frame_plt_got): Renamed to ...
3724         (elf_i386_eh_frame_non_lazy_plt): This.
3725         (elf_i386_plt_layout): Renamed to ...
3726         (elf_i386_lazy_plt_layout): This.  Remove eh_frame_plt_got and
3727         eh_frame_plt_got_size.
3728         (elf_i386_non_lazy_plt_layout): New.
3729         (elf_i386_plt_layout): Likewise.
3730         (elf_i386_non_lazy_plt): Likewise.
3731         (GET_PLT_ENTRY_SIZE): Removed.
3732         (elf_i386_plt): Renamed to ...
3733         (elf_i386_lazy_plt): This.
3734         (elf_i386_backend_data): Remove plt.  Rename is_vxworks to os.
3735         (elf_i386_arch_bed): Updated.
3736         (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3737         (elf_i386_create_dynamic_sections): Removed.
3738         (elf_i386_check_relocs): Don't check elf.dynobj.  Don't call
3739         _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3740         (elf_i386_adjust_dynamic_symbol): Updated.
3741         (elf_i386_allocate_dynrelocs): Updated.  Pass 0 as PLT header
3742         size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3743         size for PLT0 if there is no PLT0.
3744         (elf_i386_size_dynamic_sections): Updated.  Check whether GOT
3745         output section is discarded only if GOT isn't empty.
3746         (elf_i386_relocate_section): Updated.  Properly get PLT index
3747         if there is no PLT0.
3748         (elf_i386_finish_dynamic_symbol): Updated.  Don't fill the
3749         second and third slots in the PLT entry if there is no PLT0.
3750         (elf_i386_finish_dynamic_sections): Updated.  Don't fill PLT0
3751         if there is no PLT0.  Set sh_entsize on the .plt.got section.
3752         (elf_i386_nacl_plt): Forward declaration.
3753         (elf_i386_get_plt_sym_val): Removed.
3754         (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3755         against all dynamic relocations.
3756         (elf_i386_link_setup_gnu_properties): New function.
3757         (elf_backend_create_dynamic_sections): Updated.
3758         (elf_backend_setup_gnu_properties): New.
3759         (elf_i386_nacl_plt): Updated.
3760         (elf_i386_nacl_arch_bed): Likewise.
3761         (elf_i386_vxworks_arch_bed): Likewise.
3763 2017-05-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>
3765         * elflink.c (elf_output_implib): Remove executable flag from import
3766         library bfd.
3767         * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3768         library is a relocatable object file.
3770 2017-05-01  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
3772         PR ld/21404
3773         * elf32-avr.c (avr_should_move_sym): New function.
3774         (avr_should_reduce_sym_size): Likewise.
3775         (avr_should_increase_sym_size): Likewise.
3776         (elf32_avr_relax_delete_bytes): Adjust symbol values
3777         and sizes by calling new functions.
3779 2017-05-01  Palmer Dabbelt  <palmer@dabbelt.com>
3781         * config.bfd (riscv32-*): Enable rv64.
3783 2017-05-02  Alan Modra  <amodra@gmail.com>
3785         PR 21384
3786         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3787         rather than h->root.type == bfd_link_hash_new.
3788         (bfd_elf_record_link_assignment): Similarly, call
3789         bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3791 2017-04-29  Alan Modra  <amodra@gmail.com>
3793         PR 21432
3794         * reloc.c (reloc_offset_in_range): New function.
3795         (bfd_perform_relocation, bfd_install_relocation): Use it.
3796         (_bfd_final_link_relocate): Likewise.
3798 2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>
3800         * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3801         before using .plt.got.
3802         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3804 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3806         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3807         instead of "+=" to update 0.
3809 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3811         * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3812         .plt.got section here.
3813         (elf_i386_check_relocs): Don't create the .plt.got section.
3814         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3815         the .plt.got and .plt.bnd sections here.
3816         (elf_x86_64_check_relocs): Don't create the .plt.got nor
3817         .plt.bnd sections.
3819 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3821         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3822         has_bnd_reloc.
3823         (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3824         (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3825         (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3826         (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3827         has_bnd_reloc.
3829 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3831         * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3832         to return bfd *.
3833         (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3834         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3835         the first relocatable ELF input with GNU properties.
3837 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
3839         * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3840         VxWorks for non-PIC.
3842 2017-04-27  Alan Modra  <amodra@gmail.com>
3844         * elf-bfd.h (struct elf_backend_data): Make asection param of
3845         elf_backend_eh_frame_address_size const.
3846         (_bfd_elf_eh_frame_address_size): Likewise.
3847         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3848         * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3849         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3850         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3851         * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3852         (next_cie_fde_offset): Constify params.
3853         (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3855 2017-04-27  Alan Modra  <amodra@gmail.com>
3857         * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3858         (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3859         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3860         aug_data_len.
3861         (offset_adjust): New function.
3862         (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3863         (adjust_eh_frame_local_symbols): Likewise.
3864         (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3865         after changing anything.  Return true if anything changed.
3866         * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3867         _bfd_elf_adjust_eh_frame_global_symbol for globals.
3869 2017-04-27  Alan Modra  <amodra@gmail.com>
3871         * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3872         when force_local.
3874 2017-04-27  Alan Modra  <amodra@gmail.com>
3876         * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3877         (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3878         (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3879         (ppc_elf_relocate_section): Likewise.  Delete silly optimisation
3880         for undef and undefweak dyn_relocs.
3881         * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3882         (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3883         (allocate_got, allocate_dynrelocs): Likewise.
3884         (ppc64_elf_relocate_section): Likewise.
3886 2017-04-26  H.J. Lu  <hongjiu.lu@intel.com>
3888         * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3889         DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3890         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3891         add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3893 2017-04-26  Nick Clifton  <nickc@redhat.com>
3895         PR binutils/21434
3896         * reloc.c (bfd_perform_relocation): Check for a negative address
3897         in the reloc.
3899 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
3901         PR ld/21334
3902         * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3903         member.
3904         * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3905         (elf_backend_always_renumber_dynsyms): Define.
3906         (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3907         * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3908         * elflink.c (bfd_elf_size_dynamic_sections): Also call
3909         `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3910         it.
3911         (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3913 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
3915         * elflink.c (bfd_elf_size_dynamic_sections): Only call
3916         `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3917         sections have been created.
3919 2017-04-26  Nick Clifton  <nickc@redhat.com>
3921         PR binutils/21431
3922         * compress.c (bfd_init_section_compress_status): Check the return
3923         value from bfd_malloc.
3925 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
3927         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3928         no_finish_dynamic_symbol.
3929         (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3930         0.
3931         (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3932         weak symbol, don't make it dynamic.
3933         (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3934         set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3935         relocation for GOT reference.
3936         (elf_x86_64_finish_dynamic_symbol): Abort if
3937         no_finish_dynamic_symbol isn't 0.
3939 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
3941         PR ld/21402
3942         * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3943         undefined weak symbol, don't make it dynamic.
3944         (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3945         set no_finish_dynamic_symbol and generate R_386_RELATIVE
3946         relocation for R_386_GOT32.
3948 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
3950         PR ld/21425
3951         * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3953 2017-04-23  Alan Modra  <amodra@gmail.com>
3955         PR 21414
3956         * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3957         * elf.c (lcomm_sym): New.
3958         (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3959         * bfd-in2.h: Regenerate.
3961 2017-04-23  Alan Modra  <amodra@gmail.com>
3963         PR 21412
3964         * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3965         parameters and comment.
3966         (_bfd_elf_get_reloc_section): Delete.
3967         (_bfd_elf_plt_get_reloc_section): Declare.
3968         * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3969         New functions.  Don't blindly skip over assumed .rel/.rela prefix.
3970         Extracted from..
3971         (_bfd_elf_get_reloc_section): ..here.  Delete.
3972         (assign_section_numbers): Call elf_get_reloc_section.
3973         * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3974         * elfxx-target.h (elf_backend_get_reloc_section): Update.
3976 2017-04-23  Alan Modra  <amodra@gmail.com>
3978         PR 21409
3979         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3980         no symbols.
3982 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
3984         PR ld/21402
3985         * elf32-i386.c (elf_i386_link_hash_entry): Add
3986         no_finish_dynamic_symbol.
3987         (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3988         (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3989         symbol, don't make it dynamic in PIE.
3990         (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3991         set no_finish_dynamic_symbol and generate R_386_RELATIVE
3992         relocation for R_386_GOT32
3993         (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3994         isn't 0.
3996 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
3998         PR ld/19617
3999         PR ld/21086
4000         * elflink.c (elf_link_add_object_symbols): Require
4001         --no-dynamic-linker with -E/--dynamic-list when creating
4002         dynamic sections.
4004 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
4006         * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
4007         if forced local.
4009 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
4011         * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
4012         dynamic symbol sorting.
4014 2017-04-20  H.J. Lu  <hongjiu.lu@intel.com>
4016         PR ld/21382
4017         * elflink.c (elf_link_add_object_symbols): Preserve
4018         dynamic_ref_after_ir_def when restoring the symbol table for
4019         unneeded dynamic object.
4021 2017-04-19  H.J. Lu  <hongjiu.lu@intel.com>
4023         PR ld/21401
4024         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
4025         on on undefined IFUNC symbol in the second PLT.
4027 2017-04-19  Wedson Almeida Filho  <wedsonaf@gmail.com>
4029         * peXXigen.c (pe_print_reloc): Correct chunk_end.
4031 2017-04-19  Alan Modra  <amodra@gmail.com>
4033         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
4034         or make dynamic for info->dynamic_undefined_weak 0 and 1.
4035         * elf32-ppc.c:Formatting.
4036         (ensure_undefweak_dynamic): Don't make dynamic when
4037         info->dynamic_undefined_weak is zero.
4038         (allocate_dynrelocs): Discard undefweak dyn_relocs for
4039         info->dynamic_undefined_weak.  Discard undef dyn_relocs when
4040         not default visibility.  Discard undef and undefweak
4041         dyn_relocs earlier.
4042         (ppc_elf_relocate_section): Adjust to suit.
4043         * elf64-ppc.c: Formatting.
4044         (ensure_undefweak_dynamic): Don't make dynamic when
4045         info->dynamic_undefined_weak is zero.
4046         (allocate_dynrelocs): Discard undefweak dyn_relocs for
4047         info->dynamic_undefined_weak.  Discard them earlier.
4049 2017-04-17  H.J. Lu  <hongjiu.lu@intel.com>
4051         PR ld/21389
4052         * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
4053         before generating the version definition section.
4055 2017-04-17  Alan Modra  <amodra@gmail.com>
4057         * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
4058         state when a regular object file defines a symbol with
4059         incompatible type to that defined by an earlier shared lib.
4061 2017-04-13  Alan Modra  <amodra@gmail.com>
4063         * coffcode.h: Wrap some overly long _bfd_error_handler args.
4064         * elf.c: Likewise.
4065         * elf32-arm.c: Likewise.
4066         * elf32-i386.c: Likewise.
4067         * elf32-mep.c: Likewise.
4068         * elf64-ia64-vms.c: Likewise.
4069         * elf64-x86-64.c: Likewise.
4070         * elflink.c: Likewise.
4071         * elfnn-ia64.c: Likewise.
4072         * elfxx-mips.c: Likewise.
4074 2017-04-13  Alan Modra  <amodra@gmail.com>
4076         * aoutx.h: Use %B and %A in error messages throughout file.
4077         * aout-cris.c: Likewise.
4078         * archive.c: Likewise.
4079         * binary.c: Likewise.
4080         * coff-rs6000.c: Likewise.
4081         * coff-tic4x.c: Likewise.
4082         * coffcode.h: Likewise.
4083         * coffgen.c: Likewise.
4084         * cofflink.c: Likewise.
4085         * coffswap.h: Likewise.
4086         * cpu-arm.c: Likewise.
4087         * elf-eh-frame.c: Likewise.
4088         * elf-m10300.c: Likewise.
4089         * elf.c: Likewise.
4090         * elf32-arc.c: Likewise.
4091         * elf32-arm.c: Likewise.
4092         * elf32-bfin.c: Likewise.
4093         * elf32-frv.c: Likewise.
4094         * elf32-iq2000.c: Likewise.
4095         * elf32-m32c.c: Likewise.
4096         * elf32-microblaze.c: Likewise.
4097         * elf32-nds32.c: Likewise.
4098         * elf32-rl78.c: Likewise.
4099         * elf32-rx.c: Likewise.
4100         * elf32-score.c: Likewise.
4101         * elf32-score7.c: Likewise.
4102         * elf32-sh64.c: Likewise.
4103         * elf32-v850.c: Likewise.
4104         * elf32-vax.c: Likewise.
4105         * elf32-visium.c: Likewise.
4106         * elf64-ia64-vms.c: Likewise.
4107         * elf64-mmix.c: Likewise.
4108         * elf64-sh64.c: Likewise.
4109         * elfcode.h: Likewise.
4110         * elfnn-aarch64.c: Likewise.
4111         * elfnn-ia64.c: Likewise.
4112         * elfxx-mips.c: Likewise.
4113         * hpux-core.c: Likewise.
4114         * ieee.c: Likewise.
4115         * ihex.c: Likewise.
4116         * linker.c: Likewise.
4117         * merge.c: Likewise.
4118         * mmo.c: Likewise.
4119         * oasys.c: Likewise.
4120         * pdp11.c: Likewise.
4121         * peXXigen.c: Likewise.
4122         * rs6000-core.c: Likewise.
4123         * vms-alpha.c: Likewise.
4124         * xcofflink.c: Likewise.
4126 2017-04-13  Alan Modra  <amodra@gmail.com>
4128         * bfd.c (PRINT_TYPE): Define.
4129         (_doprnt): New function.
4130         (error_handler_internal): Use _doprnt.
4131         * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
4132         calls in their natural order, throughout file.
4133         * coff-mcore.c: Likewise.
4134         * coff-ppc.c: Likewise.
4135         * coff-tic80.c: Likewise.
4136         * cofflink.c: Likewise.
4137         * elf-s390-common.c: Likewise.
4138         * elf.c: Likewise.
4139         * elf32-arm.c: Likewise.
4140         * elf32-i386.c: Likewise.
4141         * elf32-m32r.c: Likewise.
4142         * elf32-msp430.c: Likewise.
4143         * elf32-spu.c: Likewise.
4144         * elf64-ia64-vms.c: Likewise.
4145         * elf64-sparc.c: Likewise.
4146         * elf64-x86-64.c: Likewise.
4147         * elflink.c: Likewise.
4148         * elfnn-aarch64.c: Likewise.
4149         * elfnn-ia64.c: Likewise.
4150         * elfxx-mips.c: Likewise.
4152 2017-04-13  Alan Modra  <amodra@gmail.com>
4154         * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
4155         branch veneers" error.  Fix double space and format message.
4156         * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
4157         * elf64-ppc.c (tocsave_find): Supply missing %B arg.
4159 2017-04-13  Alan Modra  <amodra@gmail.com>
4161         * bfd-in2.h: Regenerate.
4163 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
4165         * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
4166         extra `\n' in warning/error messages.
4167         * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
4168         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4170 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
4172         * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
4173         processor-specific properties with generic ELF target vector.
4175 2017-04-10  Qing Zhao  <qing.zhao@oracle.com>
4177         * elf32-sparc.c (elf_backend_fixup_symbol): New.
4178         * elf64-sparc.c (elf_backend_fixup_symbol): New.
4179         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
4180         (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
4181         has_non_got_reloc.
4182         (link_hash_newfunc): Initialize has_got_reloc and
4183         has_non_got_reloc.
4184         (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
4185         section.
4186         (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
4187         has_non_got_reloc.
4188         (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
4189         has_non_got_reloc.
4190         (_bfd_sparc_elf_fixup_symbol): New function.
4191         (allocate_dynrelocs): Don't allocate space for dynamic
4192         relocations and discard relocations against resolved undefined
4193         weak symbols in executable.  Don't make resolved undefined weak
4194         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
4195         relocation against undefined weak symbols in PIE.
4196         (_bfd_sparc_elf_relocate_section): Don't generate dynamic
4197         relocations against resolved undefined weak symbols in PIE
4198         (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
4199         without ynamic PLT/GOT relocations for resolved undefined weak
4200         symbols.
4201         Don't generate dynamic relocation against resolved undefined
4202         weak symbol in executable.
4203         (pie_finish_undefweak_symbol): New function.
4204         (_bfd_sparc_elf_finish_dynamic_sections): Call
4205         pie_finish_undefweak_symbol on all symbols in PIE.
4206         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
4207         (_bfd_sparc_elf_fixup_symbol): New function.
4209 2017-04-10  Nick Clifton  <nickc@redhat.com>
4211         * config.bfd: Remove ns32k from obsolete list.
4213 2017-04-10  Alan Modra  <amodra@gmail.com>
4215         PR 21287
4216         * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
4217         (special_sections_i): Likewise for .init_array.
4218         (special_sections_p): Likewise for .preinit_array.
4220 2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>
4222         PR ld/19579
4223         PR ld/21306
4224         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
4225         ELF_COMMON_DEF_P for common symbols.
4226         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4227         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
4228         * elflink.c (_bfd_elf_merge_symbol): Revert commits
4229         202ac193bbbecc96a4978d1ac3d17148253f9b01 and
4230         07492f668d2173da7a2bda3707ff0985e0f460b6.
4232 2017-04-07  Pedro Alves  <palves@redhat.com>
4234         * opncls.c (bfd_get_debug_link_info): Rename to...
4235         (bfd_get_debug_link_info_1): ... this.  Change type of second
4236         parameter to void pointer.  Adjust.
4237         (bfd_get_debug_link_info): Reimplement on top of
4238         bfd_get_debug_link_info_1.
4239         (separate_debug_file_exists, separate_alt_debug_file_exists):
4240         Change type of second parameter to void pointer.  Adjust.
4241         (get_func_type, check_func_type): Change type of second parameter
4242         to void pointer.
4243         (find_separate_debug_file): Add 'func_data' parameter.  Pass it to
4244         the callback functions instead of passing the address of a local.
4245         (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4246         find_separate_debug_file.
4247         (get_alt_debug_link_info_shim): Change type of second parameter to
4248         void pointer.  Adjust.
4249         (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4250         find_separate_debug_file.
4251         (get_build_id_name, bfd_boolean check_build_id_file): Change type
4252         of second parameter to void pointer.  Adjust.
4253         (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4254         pointer local to find_separate_debug_file.
4256 2017-04-07  Tristan Gingold  <gingold@gingold-Precision-7510>
4258         * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4259         external symbols with a definition.
4260         (_bfd_coff_gc_mark_extra_sections): Fix typo.
4262 2017-04-07  Alan Modra  <amodra@gmail.com>
4264         * po/SRC-POTFILES.in: Regenerate.
4266 2017-04-05  Alan Modra  <amodra@gmail.com>
4268         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4269         reference counting.
4271 2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>
4273         (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4274         numbers for DataDirectory entry indicies passed to
4275         add_data_entry().
4277 2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>
4279         * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4280         each GNU_MBIND section and align GNU_MBIND section to page size.
4281         (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4282         segment for each GNU_MBIND section.
4283         (_bfd_elf_init_private_section_data): Copy sh_info from input
4284         for GNU_MBIND section.
4286 2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>
4288         * elfnn-riscv.c (GP_NAME): Delete.
4289         (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4290         (_bfd_riscv_relax_lui): Likewise.
4292 2017-04-04  Nick Clifton  <nickc@redhat.com>
4294         PR binutils/21342
4295         * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4296         dereference.
4297         (bfd_elf_final_link): Only initialize the extended symbol index
4298         section if there are extended symbol tables to list.
4300 2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>
4302         * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4303         (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4304         * configure.ac (elf): Add elf-properties.lo.
4305         * Makefile.in: Regenerated.
4306         * configure: Likewise.
4307         * elf-bfd.h (elf_property_kind): New.
4308         (elf_property): Likewise.
4309         (elf_property_list): Likewise.
4310         (elf_properties): Likewise.
4311         (_bfd_elf_parse_gnu_properties): Likewise.
4312         (_bfd_elf_get_property): Likewise.
4313         (_bfd_elf_link_setup_gnu_properties): Likewise.
4314         (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4315         and setup_gnu_properties.
4316         (elf_obj_tdata): Add properties.
4317         * elf-properties.c: New file.
4318         * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4319         (elf_i386_merge_gnu_properties): Likewise.
4320         (elf_backend_parse_gnu_properties): Likewise.
4321         (elf_backend_merge_gnu_properties): Likewise.
4322         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4323         (elf_x86_64_merge_gnu_properties): Likewise.
4324         (elf_backend_parse_gnu_properties): Likewise.
4325         (elf_backend_merge_gnu_properties): Likewise.
4326         * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4327         (elf_backend_parse_gnu_properties): Likewise.
4328         (elf_backend_setup_gnu_properties): Likewise.
4329         (elfNN_bed): Add elf_backend_parse_gnu_properties,
4330         elf_backend_merge_gnu_properties and
4331         elf_backend_setup_gnu_properties.
4333 2017-03-30  Pip Cet  <pipcet@gmail.com>
4335         * elf32-wasm32.c: Add relocation code, two relocs.
4336         * reloc.c: Add wasm32 relocations.
4337         * libbfd.h: Regenerate.
4338         * bfd-in2.h: Regenerate.
4339         * bfd/po/bfd.pot: Regenerate.
4341 2017-03-29  Nick Clifton  <nickc@redhat.com>
4343         PR binutils/18025
4344         * coff-bfd.h (struct coff_section_data): Add new fields:
4345         saved_bias and bias.
4346         * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4347         computed for PE binaries.
4348         * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4349         missing abbrev.
4351 2017-03-28  Hans-Peter Nilsson  <hp@axis.com>
4353         PR ld/16044
4354         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4355         to handle a local symbol with a hash-symbol-entry; without PLT.
4356         Add BFD_ASSERT for an incidental case with GOT entry present.
4357         (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4358         isn't forced-or-set local.
4360 2017-03-27  Pip Cet  <pipcet@gmail.com>
4362         * wasm-module.c: New file to support WebAssembly modules.
4363         * wasm-module.h: New file to support WebAssembly modules.
4364         * doc/webassembly.texi: Start documenting wasm-module.c.
4365         * config.bfd: Add wasm_vec.
4366         * targets.c: Likewise.
4367         * configure.ac: Likewise.
4368         * Makefile.am: Add entries for wasm-module.c.
4369         * Makefile.in: Regenerate.
4370         * configure: Regenerate.
4371         * po/SRC-POTFILES.in: Regenerate.
4373 2017-03-27  Pip Cet  <pipcet@gmail.com>
4375         * cpu-wasm32.c: New file to support wasm32 architecture.
4376         * elf32-wasm32.c: New file to support wasm32 architecture.
4377         * Makefile.am: Add wasm32 architecture.
4378         * archures.c: Likewise.
4379         * config.bfd: Likewise.
4380         * configure.ac: Likewise.
4381         * targets.c: Likewise.
4382         * Makefile.in: Regenerate.
4383         * bfd-in2.h: Regenerate.
4384         * configure: Regenerate.
4385         * po/SRC-POTFILES.in: Regenerate.
4387 2017-03-20  Alan Modra  <amodra@gmail.com>
4389         PR 21266
4390         * elf64-ppc.c (compare_symbols): Stabilize sort.
4392 2017-03-18  Alan Modra  <amodra@gmail.com>
4394         * elf64-ppc.c (struct ppc_link_hash_table): Add
4395         local_ifunc_resolver and maybe_local_ifunc_resolver.
4396         (ppc_build_one_stub): Set flags on emitting dynamic
4397         relocation to ifunc.
4398         (ppc64_elf_relocate_section): Likewise.
4399         (ppc64_elf_finish_dynamic_symbol): Likewise.
4400         (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4401         local dynamic relocs to ifuncs.
4402         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4403         local_ifunc_resolver and maybe_local_ifunc_resolver.
4404         (ppc_elf_relocate_section): Set flag on emitting dynamic
4405         relocation to ifuncs.
4406         (ppc_elf_finish_dynamic_symbol): Likewise.
4407         (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4408         dynamic relocs to ifuncs.
4410 2017-03-13  Nick Clifton  <nickc@redhat.com>
4412         PR binutils/21202
4413         * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4414         BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4415         (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4416         BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4417         * bfd-in2.h: Regenerate.
4418         * libbfd.h: Regenerate.
4419         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4420         names.
4421         (IS_AARCH64_TLSDESC_RELOC): Likewise.
4422         (elfNN_aarch64_howto_table): Likewise.
4423         (aarch64_tls_transition_without_check): Likewise.
4424         (aarch64_reloc_got_type): Likewise.
4425         (elfNN_aarch64_final_link_relocate): Likewise.
4426         (elfNN_aarch64_tls_relax): Likewise.
4427         (elfNN_aarch64_relocate_section): Likewise.
4428         (elfNN_aarch64_gc_sweep_hook): Likewise.
4429         (elfNN_aarch64_check_relocs): Likewise.
4430         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4431         (_bfd_aarch64_elf_resolve_relocation): Likewise.
4433 2017-03-11  Alan Modra  <amodra@gmail.com>
4435         * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4436         parameter is in fact used.  Whitespace fixes.
4437         * elf64-ppc.c: Likewise.
4439 2017-03-09  Sam Thursfield  <sam.thursfield@codethink.co.uk>
4441         * rs6000-core.c (CORE_NEW): Simplify macro when
4442         AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4444 2017-03-07  Alan Modra  <amodra@gmail.com>
4446         PR 21224
4447         PR 20519
4448         * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4449         dyn_relocs check.
4451 2017-03-05  Alan Modra  <amodra@gmail.com>
4453         * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4454         * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4455         (next_cie_fde_offset): New function.
4456         (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4457         (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4458         four bytes.  Align CIEs to four or eight bytes depending on
4459         per_encoding_aligned8.  Align FDEs according to their encoding.
4460         Pad last FDE to output section alignment.
4461         (_bfd_elf_write_section_eh_frame): Adjust to suit.  Remove
4462         assertion.
4463         * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4464         (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4465         (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4467 2017-03-02  Martin Bickel  <binutils@ineranves.de>
4469         PR ld/21212
4470         * elf.c (rewrite_elf_program_header): Do not issue a warning for
4471         empty segments which have a zero filesz, but a non-zero memsz.
4473 2017-03-02  Alan Modra  <amodra@gmail.com>
4475         * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4477 2017-02-28  Alan Modra  <amodra@gmail.com>
4479         * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4480         (ppc64_elf_relocate_section): Likewise.
4482 2017-02-28  Alan Modra  <amodra@gmail.com>
4484         PR 20995
4485         * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4486         rather than elf32_nios2_hash_table or elf_hash_table.
4487         (create_got_section): Likewise.
4488         (nios2_elf32_finish_dynamic_symbol): Likewise.
4489         (nios2_elf32_adjust_dynamic_symbol): Likewise.
4490         (nios2_elf32_size_dynamic_sections): Likewise.
4491         (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4492         vars.  Use htab equivalents directly instead.  Don't create
4493         all dynamic sections on needing just the GOT.  Use a goto
4494         rather than a fall-through with reloc test.  Ensure
4495         htab->dynobj is set when making dynamic sreloc section.
4496         (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4497         equivalent directly instead.  Don't segfault on looking for
4498         .dynamic when dynamic sections have not been created.  Don't
4499         segfault on .got.plt being discarded.
4500         (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4501         Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
4502         fixme and another not so relevant comment.
4503         (nios2_elf_add_symbol_hook): Delete dynobj var.  If not
4504         already set, set hash table dynobj on creating .sbss.
4506 2017-02-28  Alan Modra  <amodra@gmail.com>
4508         * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4509         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4510         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4511         (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4512         (ppc64_elf_relocate_section): Likewise.
4513         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4514         (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4515         (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4516         * libbfd.h: Regenerate.
4517         * bfd-in2.h: Regenerate.
4519 2017-02-28  Alan Modra  <amodra@gmail.com>
4521         * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4522         dynamic .data.rel.ro read-only.
4523         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4524         rather than section flags when deciding where copy reloc goes.
4525         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4526         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4527         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4528         * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4529         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4530         * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4531         * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4532         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4533         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4534         * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4535         * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4536         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4537         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4538         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4539         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4540         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4541         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4542         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4543         * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4545 2017-02-28  Maciej W. Rozycki  <macro@imgtec.com>
4547         * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4548         `jalr $0, $25' instruction encoding.
4550 2017-02-27  Nick Clifton  <nickc@redhat.com>
4552         PR ld/21180
4553         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4554         generating a seg-fault when encountering a symbol that has been
4555         deleted by garbage collection.
4557 2017-02-25  Alan Modra  <amodra@gmail.com>
4559         * elf32-arc.c (struct dynamic_sections): Delete.
4560         (enum dyn_section_types): Delete.
4561         (dyn_section_names): Delete.
4562         (arc_create_dynamic_sections): Delete.
4563         (elf_arc_finish_dynamic_sections): Don't call the above.  Don't
4564         segfault on discarded .rela.plt section.
4565         (elf_arc_size_dynamic_sections): Formatting.  Don't call
4566         arc_create_dynamic_sections.  Don't allocate memory for sections
4567         handled by the generic linker.  Correct code finding relocs in
4568         read-only sections.  Set SEC_EXCLUDE on zero size .got,
4569         .got.plt, and .dynbss sections.  Do set .interp for pies.
4571 2017-02-24  Andrew Waterman  <andrew@sifive.com>
4573         * elfnn-riscv.c (GP_NAME): New macro.
4574         (riscv_global_pointer_value): Use it.
4575         (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4576         output section, consider only that section's alignment.
4578 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
4580         * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4581         * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4582         * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4583         * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4585 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
4587         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4588         <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4589         or misaligned.
4591 2017-02-23  Alan Modra  <amodra@gmail.com>
4593         PR 20744
4594         * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4595         16D relocations.
4596         (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4597         (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4598         relocs.
4600 2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>
4602         PR ld/20828
4603         * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4604         processing ahead of the call to `elf_gc_sweep_symbol'.
4606 2017-02-22  Nick Clifton  <nickc@redhat.com>
4608         PR binutils/21193
4609         * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4610         created section 4-byte alignment.
4612 2017-02-22  Alan Modra  <amodra@gmail.com>
4614         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4615         on .got or .plt output section being discarded by script.
4616         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
4617         vxworks splt temp.
4619 2017-02-21  Alan Modra  <amodra@gmail.com>
4621         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4622         DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4624 2017-02-20  Alan Modra  <amodra@gmail.com>
4626         PR 21181
4627         * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4628         if DT_RELSZ/DT_RELASZ is zero.
4630 2017-02-17  Nick Clifton  <nickc@redhat.com>
4632         * compress.c (bfd_get_full_section_contents): Remember to reduce
4633         compressed size by the sizeof the compression header when
4634         decompressing the contents.
4636 2017-02-17  Pedro Alves  <palves@redhat.com>
4638         * srec.c (Chunk): Rename to ...
4639         (_bfd_srec_len): ... this.
4640         (S3Forced): Rename to ...
4641         (_bfd_srec_forceS3): ... this.
4642         * objcopy.c: Adjust all references.
4644 2017-02-17  Pedro Alves  <palves@redhat.com>
4646         * archive.c (bsd_write_armap): Rename to ...
4647         (_bfd_bsd_write_armap): ... this.
4648         (coff_write_armap): Rename to ...
4649         (_bfd_coff_write_armap): ... this.
4650         * libbfd-in.h (bsd_write_armap): Rename to ...
4651         (_bfd_bsd_write_armap): ... this.
4652         (coff_write_armap): Rename to ...
4653         (_bfd_coff_write_armap): ... this.
4654         * aout-target.h, aout-tic30.c: Adjust all users.
4655         * libbfd.h: Regenerate.
4657 2017-02-17  Pedro Alves  <palves@redhat.com>
4659         * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4660         (warn_deprecated): Rename to ...
4661         (_bfd_warn_deprecated): ... this.
4662         * libbfd.c (warn_deprecated): Rename to ...
4663         (_bfd_warn_deprecated): ... this.
4664         * bfd-in2.h: Regenerate.
4666 2017-02-17  Pedro Alves  <palves@redhat.com>
4668         * bfdio.c (real_ftell): Rename to ...
4669         (_bfd_real_ftell): ... this.
4670         (real_fseek): Rename to ...
4671         (_bfd_real_fseek): ... this.
4672         (real_fopen): Rename to ...
4673         (_bfd_real_fopen): ... this.
4674         * libbfd-in.h (real_ftell): Rename to ...
4675         (_bfd_real_ftell): ... this.
4676         (real_fseek): Rename to ...
4677         (_bfd_real_fseek): ... this.
4678         (real_fopen): Rename to ...
4679         (_bfd_real_fopen): ... this.
4680         * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4681         * libbfd.h: Regenerate.
4683 2017-02-17  Pedro Alves  <palves@redhat.com>
4685         * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4686         * libbfd.c (read_unsigned_leb128): Rename to ...
4687         (_bfd_read_unsigned_leb128): ... this.
4688         (read_signed_leb128): Rename to ...
4689         (_bfd_read_signed_leb128): ... this.
4690         (safe_read_leb128): Rename to ...
4691         (_bfd_safe_read_leb128): ... this.
4692         * libbfd-in.h (read_unsigned_leb128): Rename to ...
4693         (_bfd_read_unsigned_leb128): ... this.
4694         (read_signed_leb128): Rename to ...
4695         (_bfd_read_signed_leb128): ... this.
4696         (safe_read_leb128): Rename to ...
4697         (_bfd_safe_read_leb128): ... this.
4698         * libbfd.h: Renegerate.
4700 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
4702         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4703         before trying to fine matching file and line information.
4705 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
4707         * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4708         (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4709         not match current bfd, then reload debug information.  Record bfd
4710         we're loading debug info for in the stash.  If we have debug
4711         informatin in the cache then perform section placement before
4712         returning.
4714 2017-02-16  Alan Modra  <amodra@gmail.com>
4716         PR 21000
4717         * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4718         * elfxx-target.h (elf_backend_no_page_alias): Define.
4719         (elfNN_bed): Init new field.
4720         * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4721         ensure PT_LOAD segment starts on a new page.
4722         * elf32-hppa.c (elf_backend_no_page_alias): Define.
4724 2017-02-16  Alan Modra  <amodra@gmail.com>
4726         PR 21132
4727         * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4728         if pic.
4730 2017-02-16  Jiong Wang <jiong.wang@arm.com>
4732         * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4733         * bfd-in2.h: Regenerated.
4735 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
4737         PR ld/21168
4738         * elf32-i386.c (elf_i386_relocate_section): Allow
4739         "lea foo@GOT, %reg" in PIC.
4741 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
4743         PR ld/20244
4744         * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4745         symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4746         error against local IFUNC symbol without a base register for
4747         PIC.
4749 2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>
4751         * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4752         `%P: %H:' with `info->callbacks->einfo'.
4753         (ppc_elf_relocate_section): Likewise.
4754         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4755         (ppc64_elf_edit_toc): Likewise.
4756         (ppc64_elf_relocate_section): Likewise.
4758 2017-02-14  Alan Modra  <amodra@gmail.com>
4760         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4761         --gc-keep-exported, and test versioned field of sym rather than
4762         looking for @ in name.
4764 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
4766         * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4767         __global_pointer$.
4769 2017-02-13  Nick Clifton  <nickc@redhat.com>
4771         PR binutils/21151
4772         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4773         unit length field.
4775 2017-02-07  Andrew Waterman  <andrew@sifive.com>
4777         * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4778         entry size if PLT header is written.
4780 2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>
4782         Fix sparc64 dynamic relocation processing to use the dynamic
4783         symbol count.
4784         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4785         to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4786         should be used.
4788 2017-02-03  Nick Clifton  <nickc@redhat.com>
4790         PR 21096
4791         * coffcode.h (coff_write_object_contents): Enlarge size of
4792         s_name_buf in order to avoid compile time warning about possible
4793         integer truncation.
4794         * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4795         32-bits of insn value before printing into buffer.
4797 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
4799         * elfxx-mips.c (mips_elf_hash_sort_data): Add
4800         `max_local_dynindx'.
4801         (mips_elf_sort_hash_table): Handle it.
4802         (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4803         symbols bump up `max_local_dynindx' rather than
4804         `max_non_got_dynindx'.
4806 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
4808         * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4809         `min_got_dynindx', `max_unref_got_dynindx' and
4810         `max_non_got_dynindx' members to the `bfd_size_type' data type.
4811         (mips_elf_sort_hash_table): Adjust accordingly.
4813 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
4815         * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4816         to access the hash table.
4818 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
4820         * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4821         non-NULL `htab' to the beginning.
4823 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
4825         * elflink.c (elf_gc_sweep): Wrap overlong line.
4827 2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>
4829         * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4830         (_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
4831         * elfxx-mips.c (mips_elf_link_hash_table): Add
4832         `ignore_branch_isa' member.
4833         (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4834         in branch relocation calculation as an error if
4835         `ignore_branch_isa' has been set.
4836         (_bfd_mips_elf_insn32): Rename to...
4837         (_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
4838         parameter to `insn32' and add an `ignore_branch_isa' parameter.
4839         Handle the new parameter.
4841 2017-01-27  Hans-Peter Nilsson  <hp@axis.com>
4843         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4844         local variable dynobj.
4846         PR ld/20995
4847         * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4848         (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4849         executable from read-only sections into sdynrelro.
4850         (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4851         dynamic relocs in sdynrelro.
4852         (elf_backend_want_dynrelro): Define.
4854 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
4856         * config.bfd (*-*-rtemsaout*): Mark as removed.
4858 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
4860         * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4861         (arm-*-rtems*): Move to (arm*-*-eabi*).
4862         (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4863         (m68-*-rtems*): Move to (m68*-*-elf*).
4865 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
4867         * config.bfd (*-*-rtemscoff*): Mark as removed.
4869 2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>
4871         PR ld/20828
4872         * elflink.c (bfd_elf_record_link_assignment): Revert last
4873         change and don't ever clear `forced_local'.  Set `mark'
4874         unconditionally.
4875         (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4876         file.
4877         (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4878         (bfd_elf_size_dynamic_sections): ... here.
4879         * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4880         and set `mark' instead in `__tls_get_addr_opt' processing.
4881         * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4883 2017-01-24  Alan Modra  <amodra@gmail.com>
4885         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4886         where dynamic relocs are preferable.  Allow ifunc too.
4887         (ensure_undefweak_dynamic): New function.
4888         (allocate_dynrelocs): Use it here.  Move plt handling last and
4889         don't make symbols dynamic, simplifying loop.  Only make undef
4890         weak symbols with GOT entries dynamic.  Correct condition
4891         for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
4892         comments.  Remove goto.
4893         (ppc_elf_relocate_section): Correct test for using dynamic
4894         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
4895         to suit.  Set up explicit tls_index entries and implicit GOT
4896         tls_index entries resolvable at link time for
4897         __tls_get_addr_opt.  Simplify test to clear mem for prelink.
4898         * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4899         (ensure_undefweak_dynamic): New function.
4900         (allocate_dynrelocs): Use it here.  Only make undef weak symbols
4901         with GOT entries dynamic.  Remove unnecessary test of
4902         WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4903         (ppc64_elf_relocate_section): Correct test for using dynamic
4904         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
4905         to suit.  Set up explicit tls_index entries and implicit GOT
4906         tls_index entries resolvable at link time for __tls_get_addr_opt.
4907         Simplify expression to clear mem for prelink.
4909 2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>
4911         * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4913 2017-01-20  Jiong Wang <jiong.wang@arm.com>
4915         * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4916         (elf_backend_hash_symbol): Define.
4918 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
4920         PR ld/20828
4921         * elflink.c (bfd_elf_record_link_assignment): Clear any
4922         `forced_local' marking for DSO symbols that are not being
4923         provided.
4925 2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
4927         * elfnn-riscv.c (riscv_elf_object_p): New function.
4929 2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>
4931         PR ld/21038
4932         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4933         plt_bnd_eh_frame.
4934         (elf_x86_64_check_relocs): Create .eh_frame section for the
4935         .plt.bnd section.
4936         (elf_x86_64_size_dynamic_sections): Allocate and initialize
4937         .eh_frame section for the .plt.bnd section.
4938         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4939         for the .plt.bnd section.
4941 2017-01-12  Nick Clifton  <nickc@redhat.com>
4943         PR binutils/20876
4944         * opncls.c (find_separate_debug_file): Add include_dirs
4945         parameter.  Only include the directory part of the bfd's filename
4946         in search paths if include_dirs is true.  Add a couple of extra
4947         locations for looking for debug files.
4948         ( bfd_follow_gnu_debuglink): Update invocation of
4949         find_separate_debug_file.
4950         (bfd_follow_gnu_debugaltlink): Likewise.
4951         (get_build_id): New function: Finds the build-id of the given bfd.
4952         (get_build_id_name): New function: Computes the name of the
4953         separate debug info file for a bfd, based upon its build-id.
4954         (check_build_id_file): New function: Checks to see if a separate
4955         debug info file exists at the given location, and that its
4956         build-id matches that of the original bfd.
4957         (bfd_follow_build_id_debuglink): New function: Finds a separate
4958         debug info file for a given bfd by using the build-id method.
4959         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4960         method of locating a separate debug info file before using the
4961         debuglink method.
4962         * bfd-in2.h: Regenerate.
4964 2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>
4966         PR ld/21038
4967         * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4968         (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4969         elf_x86_64_eh_frame_plt_got.
4970         (elf_x86_64_size_dynamic_sections): Get unwind info from
4971         elf_x86_64_bnd_arch_bed for the BND PLT.
4973 2017-01-11  Jeremy Soller  <jackpot51@gmail.com>
4975         * config.bfd: Add entries for i686-redox and x86_64-redox.
4977 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
4979         * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4980         to 4 bytes.
4981         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4982         .eh_frame section to 4 bytes for x32.
4983         (elf_x86_64_check_relocs): Likewise.
4985 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
4987         PR ld/20830
4988         * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4989         (PLT_GOT_FDE_LENGTH): Likewise.
4990         (elf_i386_plt_layout): Add eh_frame_plt_got and
4991         eh_frame_plt_got_size.
4992         (elf_i386_plt): Updated.
4993         (elf_i386_link_hash_table): Add plt_got_eh_frame.
4994         (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4995         (elf_i386_size_dynamic_sections): Allocate and initialize
4996         .eh_frame section for .plt.got.
4997         (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4998         .plt.got.
4999         (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
5000         eh_frame_plt_got_size.
5001         * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
5002         (PLT_GOT_FDE_LENGTH): Likewise.
5003         (elf_x86_64_backend_data): Add eh_frame_plt_got and
5004         eh_frame_plt_got_size.
5005         (elf_x86_64_arch_bed): Updated.
5006         (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
5007         eh_frame_plt_got_size.
5008         (elf_x86_64_nacl_arch_bed): Likewise.
5009         (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
5010         (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
5011         (elf_x86_64_size_dynamic_sections): Allocate and initialize
5012         .eh_frame section for .plt.got.
5013         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
5014         for .plt.got.
5016 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
5018         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
5019         plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
5021 2017-01-09  Nick Clifton  <nickc@redhat.com>
5023         * dwarf2.c (lookup_address_in_function_table): Return early if
5024         there are no functions in the given comp unit, or if the high
5025         address of the last function in the comp unit is less than the
5026         desired address.
5028 2017-01-09  Nick Clifton  <nickc@redhat.com>
5030         PR binutils/21013
5031         * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
5032         message if there are too many symbols to load.
5034 2017-01-04  James Clarke  <jrtc27@jrtc27.com>
5036         * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
5037         if relocs are cached.
5039 2017-01-03  Rich Felker  <bugdal@aerifal.cx>
5041         PR ld/21017
5042         * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
5043         for R_MICROBLAZE_GOTOFF_64.
5045 2017-01-03  Nick Clifton  <nickc@redhat.com>
5047         * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
5048         warning about using a possibly uninitialised variable.
5050 2017-01-02  Alan Modra  <amodra@gmail.com>
5052         * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
5053         (allocate_plt_static, allocate_dynrelocs): Use it.
5055 2017-01-02  Alan Modra  <amodra@gmail.com>
5057         * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
5058         .PARISC.unwind section.
5060 2017-01-02  Alan Modra  <amodra@gmail.com>
5062         PR ld/20989
5063         * elfxx-sparc.c (gdop_relative_offset_ok): New function.
5064         (_bfd_sparc_elf_relocate_section): Use it to validate GOT
5065         indirect to GOT pointer relative code edit.
5067 2017-01-02  Alan Modra  <amodra@gmail.com>
5069         Update year range in copyright notice of all files.
5071 For older changes see ChangeLog-2016
5073 Copyright (C) 2017 Free Software Foundation, Inc.
5075 Copying and distribution of this file, with or without modification,
5076 are permitted in any medium without royalty provided the copyright
5077 notice and this notice are preserved.
5079 Local Variables:
5080 mode: change-log
5081 left-margin: 8
5082 fill-column: 74
5083 version-control: never
5084 End: