x86: Correct unwind information for the second PLT
[external/binutils.git] / bfd / ChangeLog
1 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
2
3         PR ld/22061
4         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
5         .eh_frame section for the second PLT.
6         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
7         alignment of .eh_frame section for the second PLT.
8
9 2017-09-01  Nick Clifton  <nickc@redhat.com>
10
11         PR 22059
12         * dwarf2.c (decode_line_info): Fix test for an overlong line info
13         structure.
14
15 2017-09-01  Nick Clifton  <nickc@redhat.com>
16
17         PR 22058
18         * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
19         attribute buffer is NUL terminated.
20
21 2017-08-31  Nick Clifton  <nickc@redhat.com>
22
23         PR 22047
24         * dwarf2.c (read_section): If necessary add a terminating NUL byte
25         to dwarf string sections.
26
27 2017-08-31  Alan Modra  <amodra@gmail.com>
28
29         * po/SRC-POTFILES.in: Regenerate.
30
31 2017-08-31  Alan Modra  <amodra@gmail.com>
32
33         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
34         for a section containing just a terminator.  Allow multiple
35         terminators at end of section.
36         * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
37         sections when not adding alignment.  Assert on terminator in
38         the middle of FDEs.
39
40 2017-08-31  Alan Modra  <amodra@gmail.com>
41
42         PR 21441
43         PR 22048
44         * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
45         terminators.
46
47 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
48
49         * configure.ac (bfd_backends): Add elf64.lo together with
50         elfxx-x86.lo for 64-bit BFD.
51         * configure: Regenerated.
52
53 2017-08-31  James Bowman  <james.bowman@ftdichip.com>
54
55         * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
56         for R_FT32_18.
57
58 2017-08-31  Alan Modra  <amodra@gmail.com>
59
60         PR binutils/22032
61         * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
62         before _close_and_cleanup.  Call iovec->bclose after.
63         (bfd_close): Remove code common to, and call, bfd_close_all_done.
64
65 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
66
67         * elf32-i386.c (elf_i386_plt_type): Removed.
68         (elf_i386_plt): Likewise.
69         (elf_i386_get_synthetic_symtab): Updated.   Call
70         _bfd_x86_elf_get_synthetic_symtab.
71         * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
72         (elf_x86_64_plt): Likewise.
73         (elf_x86_64_get_synthetic_symtab): Updated.  Call
74         _bfd_x86_elf_get_synthetic_symtab.
75         * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
76         (elf_x86_64_get_plt_got_vma): Likewise.
77         (elf_i386_valid_plt_reloc_p): Likewise.
78         (elf_x86_64_valid_plt_reloc_p): Likewise.
79         (_bfd_x86_elf_get_synthetic_symtab): Likewise.
80         * elfxx-x86.h (elf_x86_plt_type): New.
81         (elf_x86_plt): Likewise.
82         (_bfd_x86_elf_get_synthetic_symtab): Likewise.
83
84 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
85
86         * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
87         target_id instead of elf_machine_code.
88
89 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
90
91         * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
92         (elf_i386_lazy_plt_layout): Likewise.
93         (elf_i386_non_lazy_plt_layout): Likewise.
94         (elf_i386_plt_layout): Likewise.
95         (elf_i386_link_hash_table): Likewise.
96         (elf_i386_next_tls_desc_index): Likewise.
97         (elf_i386_srelplt2): Likewise.
98         (elf_i386_plt): Likewise.
99         (elf_i386_lazy_plt): Likewise.
100         (elf_i386_non_lazy_plt): Likewise.
101         (elf_i386_link_hash_table_create): Likewise.
102         (bfd_elf32_bfd_link_hash_table_create): Likewise.
103         (elf_i386_lazy_plt): Updated.
104         (elf_i386_non_lazy_plt): Likewise.
105         (elf_i386_lazy_ibt_plt): Likewise.
106         (elf_i386_non_lazy_ibt_plt): Likewise.
107         (elf_i386_allocate_dynrelocs): Likewise.
108         (elf_i386_size_dynamic_sections): Likewise.
109         (elf_i386_relocate_section): Likewise.
110         (elf_i386_finish_dynamic_symbol): Likewise.
111         (elf_i386_finish_dynamic_sections): Likewise.
112         (elf_i386_get_synthetic_symtab): Likewise.
113         (elf_i386_link_setup_gnu_properties): Likewise.
114         (elf_i386_nacl_plt): Likewise.
115         * elf64-x86-64.c (ABI_64_P): Removed.
116         (ELF64_DYNAMIC_INTERPRETER): Likewise.
117         (ELF32_DYNAMIC_INTERPRETER): Likewise.
118         (elf_x86_64_lazy_plt_layout): Likewise.
119         (elf_x86_64_non_lazy_plt_layout): Likewise.
120         (elf_x86_64_plt_layout): Likewise.
121         (elf_x86_64_link_hash_table): Likewise.
122         (elf_x86_64_plt): Likewise.
123         (elf_x86_64_lazy_plt): Likewise.
124         (elf_x86_64_non_lazy_plt): Likewise.
125         (elf_x86_64_link_hash_table_create): Likewise.
126         (bfd_elf64_bfd_link_hash_table_create): Likewise.
127         (bfd_elf32_bfd_link_hash_table_create): Likewise.
128         (elf_x86_64_lazy_plt): Updated.
129         (elf_x86_64_non_lazy_plt): Likewise.
130         (elf_x86_64_lazy_bnd_plt): Likewise.
131         (elf_x86_64_non_lazy_bnd_plt): Likewise.
132         (elf_x86_64_lazy_ibt_plt): Likewise.
133         (elf_x32_lazy_ibt_plt): Likewise.
134         (elf_x86_64_non_lazy_ibt_plt): Likewise.
135         (elf_x32_non_lazy_ibt_plt): Likewise.
136         (elf_x86_64_allocate_dynrelocs): Likewise.
137         (elf_x86_64_size_dynamic_sections): Likewise.
138         (elf_x86_64_relocate_section): Likewise.
139         (elf_x86_64_finish_dynamic_symbol): Likewise.
140         (elf_x86_64_finish_dynamic_sections): Likewise.
141         (elf_x86_64_get_synthetic_symtab): Likewise.
142         (elf_x86_64_link_setup_gnu_properties): Likewise.
143         (elf_x86_64_nacl_plt): Likewise.
144         * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
145         "elf/x86-64.h".
146         (ELF32_DYNAMIC_INTERPRETER): New.
147         (ELF64_DYNAMIC_INTERPRETER): Likewise.
148         (ELFX32_DYNAMIC_INTERPRETER): Likewise.
149         (_bfd_x86_elf_link_hash_table_create): Likewise.
150         (_bfd_x86_elf_link_hash_table_free): Renamed to ...
151         (elf_x86_link_hash_table_free): This.  Make it static.
152         * elfxx-x86.h: Don't include "objalloc.h".
153         (ABI_64_P): New.
154         (elf_x86_lazy_plt_layout): Likewise.
155         (elf_x86_non_lazy_plt_layout): Likewise.
156         (elf_x86_plt_layout): Likewise.
157         (_bfd_x86_elf_link_hash_table_create): Likewise.
158         (bfd_elf64_bfd_link_hash_table_create): Likewise.
159         (bfd_elf32_bfd_link_hash_table_create): Likewise.
160         (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
161         srelplt2 and next_tls_desc_index.
162         (_bfd_x86_elf_link_hash_table_free): Removed.
163
164 2017-08-30  Maciej W. Rozycki  <macro@imgtec.com>
165
166         * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
167         branch offset interpretation.
168
169 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
170
171         PR binutils/22032
172         * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
173
174 2017-08-30  H.J. Lu  <hongjiu.lu@intel.com>
175
176         * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
177         (elf_x86_64_srelplt2): Likewise.
178
179 2017-08-30  Alan Modra  <amodra@gmail.com>
180
181         * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
182         (ppc64_elf_tls_optimize): Set it.
183         (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
184         insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
185         addis would add zero.
186         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
187         (ppc_elf_tls_optimize): Set it.
188         (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
189         insn on TPREL16_LO relocs to use r2 when addis would add zero.
190
191 2017-08-30  Alan Modra  <amodra@gmail.com>
192
193         * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
194         __tls_get_addr call sequences to LE, don't move the addi down
195         to the nop.  Replace the bl with addi and leave the nop alone.
196
197 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
198
199         * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
200         Re-indent.
201         * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
202         Likewise.
203         (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
204
205 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
206
207         * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
208         (BFD64_BACKENDS): Likewise.
209         (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
210         (BFD64_BACKENDS_CFILES): Likewise.
211         * Makefile.in: Regenerated.
212         * configure.ac (bfd_backends): Add elfxx-x86.lo together with
213         elf32-i386.lo and elf64-x86-64.lo.
214         * configure: Regenerated.
215         * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
216         "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
217         "objalloc.h" and "hashtab.h".
218         (ELIMINATE_COPY_RELOCS): Removed.
219         (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
220         (SYMBOL_NO_COPYRELOC): Likewise.
221         (elf_i386_link_hash_entry): Likewise.
222         (GOT_UNKNOWN): Likewise.
223         (GOT_NORMAL): Likewise.
224         (GOT_TLS_GD): Likewise.
225         (elf_i386_hash_entry): Likewise.
226         (elf_i386_obj_tdata): Likewise.
227         (elf_i386_tdata): Likewise.
228         (elf_i386_local_got_tls_type): Likewise.
229         (elf_i386_local_tlsdesc_gotent): Likewise.
230         (elf_i386_hash_table): Likewise.
231         (elf_i386_link_hash_newfunc): Likewise.
232         (elf_i386_local_htab_hash): Likewise.
233         (elf_i386_local_htab_eq): Likewise.
234         (elf_i386_get_local_sym_hash): Likewise.
235         (elf_i386_link_hash_table_free): Likewise.
236         (elf_i386_copy_indirect_symbol): Likewise.
237         (elf_i386_fixup_symbol): Likewise.
238         (elf_i386_readonly_dynrelocs): Likewise.
239         (elf_i386_always_size_sections): Likewise.
240         (elf_i386_set_tls_module_base): Likewise.
241         (elf_i386_dtpoff_base): Likewise.
242         (compare_relocs): Likewise.
243         (elf_i386_hash_symbol): Likewise.
244         (elf_i386_parse_gnu_properties): Likewise.
245         (elf_i386_merge_gnu_properties): Likewise.
246         (elf_i386_link_check_relocs): Likewise.
247         (elf_i386_merge_symbol_attribute): Likewise.
248         (bfd_elf32_bfd_link_check_relocs): Likewise.
249         (elf_backend_copy_indirect_symbol): Likewise.
250         (elf_backend_always_size_sections): Likewise.
251         (elf_backend_omit_section_dynsym): Likewise.
252         (elf_backend_hash_symbol): Likewise.
253         (elf_backend_fixup_symbol): Likewise.
254         (elf_backend_parse_gnu_properties): Likewise.
255         (elf_backend_merge_gnu_properties): Likewise.
256         (elf_backend_merge_symbol_attribute): Likewise.
257         (elf_i386_mkobject): Updated.
258         (elf_i386_link_hash_table_create): Likewise.
259         (elf_i386_check_tls_transition): Likewise.
260         (elf_i386_tls_transition): Likewise.
261         (elf_i386_convert_load_reloc): Likewise.
262         (elf_i386_check_relocs): Likewise.
263         (elf_i386_adjust_dynamic_symbol): Likewise.
264         (elf_i386_allocate_dynrelocs): Likewise.
265         (elf_i386_convert_load): Likewise.
266         (elf_i386_size_dynamic_sections): Likewise.
267         (elf_i386_relocate_section): Likewise.
268         (elf_i386_finish_dynamic_symbol ): Likewise.
269         (elf_i386_finish_dynamic_sections): Likewise.
270         (elf_i386_output_arch_local_syms): Likewise.
271         (elf_i386_get_synthetic_symtab): Likewise.
272         (elf_i386_link_setup_gnu_properties): Likewise.
273         (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
274         of elf_link_hash_table, as base.
275         (elf_i386_next_tls_desc_index): New.
276         (elf_i386_srelplt2): Likewise.
277         (elf_i386_plt): Likewise.
278         (elf_i386_lazy_plt): Likewise.
279         (elf_i386_non_lazy_plt): Likewise.
280         * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
281         "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
282         "objalloc.h" and "hashtab.h".
283         (ELIMINATE_COPY_RELOCS): Removed.
284         (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
285         (SYMBOL_NO_COPYRELOC): Likewise.
286         (elf_x86_64_link_hash_entry): Likewise.
287         (GOT_UNKNOWN): Likewise.
288         (GOT_NORMAL): Likewise.
289         (GOT_TLS_GD): Likewise.
290         (elf_x86_64_hash_entry): Likewise.
291         (elf_x86_64_obj_tdata): Likewise.
292         (elf_x86_64_tdata): Likewise.
293         (elf_x86_64_local_got_tls_type): Likewise.
294         (elf_x86_64_local_tlsdesc_gotent): Likewise.
295         (elf_x86_64_hash_table): Likewise.
296         (elf_x86_64_link_hash_newfunc): Likewise.
297         (elf_x86_64_local_htab_hash): Likewise.
298         (elf_x86_64_local_htab_eq): Likewise.
299         (elf_x86_64_get_local_sym_hash): Likewise.
300         (elf_x86_64_link_hash_table_free): Likewise.
301         (elf_x86_64_copy_indirect_symbol): Likewise.
302         (elf_x86_64_fixup_symbol): Likewise.
303         (elf_x86_64_readonly_dynrelocs): Likewise.
304         (elf_x86_64_always_size_sections): Likewise.
305         (elf_x86_64_set_tls_module_base): Likewise.
306         (elf_x86_64_dtpoff_base): Likewise.
307         (compare_relocs): Likewise.
308         (elf_x86_64_merge_symbol_attribute): Likewise.
309         (elf_x86_64_hash_symbol): Likewise.
310         (elf_x86_64_parse_gnu_properties): Likewise.
311         (elf_x86_64_merge_gnu_properties): Likewise.
312         (elf_x86_64_link_check_relocs): Likewise.
313         (elf_backend_copy_indirect_symbol): Likewise.
314         (elf_backend_always_size_sections): Likewise.
315         (bfd_elf64_bfd_link_check_relocs): Likewise.
316         (elf_backend_merge_symbol_attribute): Likewise.
317         (elf_backend_hash_symbol): Likewise.
318         (elf_backend_omit_section_dynsym): Likewise.
319         (elf_backend_fixup_symbol): Likewise.
320         (elf_backend_parse_gnu_properties): Likewise.
321         (elf_backend_merge_gnu_properties): Likewise.
322         (bfd_elf32_bfd_link_check_relocs): Likewise.
323         (elf_x86_64_mkobject): Updated.
324         (elf_x86_64_link_hash_table_create): Likewise.
325         (elf_x86_64_check_tls_transition): Likewise.
326         (elf_x86_64_tls_transition): Likewise.
327         (elf_x86_64_convert_load_reloc): Likewise.
328         (elf_x86_64_check_relocs): Likewise.
329         (elf_x86_64_adjust_dynamic_symbol): Likewise.
330         (elf_x86_64_allocate_dynrelocs): Likewise.
331         (elf_x86_64_convert_load): Likewise.
332         (elf_x86_64_size_dynamic_sections): Likewise.
333         (elf_x86_64_relocate_section): Likewise.
334         (elf_x86_64_finish_dynamic_symbol ): Likewise.
335         (elf_x86_64_finish_dynamic_sections): Likewise.
336         (elf_x86_64_output_arch_local_syms): Likewise.
337         (elf_x86_64_get_synthetic_symtab): Likewise.
338         (elf_x86_64_link_setup_gnu_properties): Likewise.
339         (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
340         instead of elf_link_hash_table, as base.
341         (elf_x86_64_next_tls_desc_index): New.
342         (elf_x86_64_srelplt2): Likewise.
343         (elf_x86_64_plt): Likewise.
344         (elf_x86_64_lazy_plt): Likewise.
345         (elf_x86_64_non_lazy_plt): Likewise.
346         * elfxx-x86.c: New file.
347         * elfxx-x86.h: Likewise.
348
349 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
350
351         * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
352         return.
353         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
354
355 2017-08-29  H.J. Lu  <hongjiu.lu@intel.com>
356
357         * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
358         sections before checking dynamic relocations and free invalid
359         PLT section contents.
360         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
361
362 2017-08-28  H.J. Lu  <hongjiu.lu@intel.com>
363
364         * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
365         * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
366
367 2017-08-28  H.J. Lu  <hongjiu.lu@intel.com>
368
369         PR binutils/22018
370         * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
371         PLT section size.
372         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
373
374 2017-08-27  H.J. Lu  <hongjiu.lu@intel.com>
375
376         * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
377         def_protected.
378         * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
379
380 2017-08-26  H.J. Lu  <hongjiu.lu@intel.com>
381
382         PR ld/21997
383         * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
384         dyn_lib_class and has_gnu_symbols.  Change bad_symtab to bitfield.
385         Add a has_no_copy_on_protected bitfield.
386         (elf_has_no_copy_on_protected): New.
387         * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
388         elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
389         (elf_merge_gnu_property_list): Likewise.
390         (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
391         to FALSE for elf_has_no_copy_on_protected.
392         * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
393         (elf_i386_link_hash_entry): Add def_protected.
394         (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
395         when checking info->nocopyreloc.
396         (elf_i386_link_setup_gnu_properties): Don't set
397         extern_protected_data here.
398         (elf_i386_merge_symbol_attribute): New function.
399         (elf_backend_merge_symbol_attribute): New.
400         * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
401         (elf_x86_64_link_hash_entry): Add def_protected.
402         (elf_x86_64_need_pic): Report protected symbol for def_protected.
403         (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
404         when checking info->nocopyreloc.
405         (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
406         relocation run-time overflow and unresolvable R_X86_64_32S
407         relocation against protected data symbol defined in shared object
408         with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
409         (elf_x86_64_link_setup_gnu_properties): Don't set
410         extern_protected_data here.
411         (elf_x86_64_merge_symbol_attribute): New function.
412         (elf_backend_merge_symbol_attribute): New.
413
414 2017-08-26  Alan Modra  <amodra@gmail.com>
415
416         * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll.  Comment.
417         (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
418         (ppc_elf_relocate_section): Comment fix.
419         * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll.  Comment.
420         (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
421         Support dynamic relocs for TPREL16 when non-pic too.
422         (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
423         (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
424         when non-pic too.
425
426 2017-08-25  H.J. Lu  <hongjiu.lu@intel.com>
427
428         * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
429         "symbol" in comments.
430         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
431
432 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
433
434         PR ld/22001
435         * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
436         R_X86_64_PC32 relocation run-time overflow and unresolvable
437         R_X86_64_32S relocation with -z nocopyreloc.
438
439 2017-08-24  H.J. Lu  <hongjiu.lu@intel.com>
440
441         * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
442         Undefined symbols may not have a type.
443         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
444
445 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
446
447         * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
448         bfd_link_info.  Report shared, PIE or PDE object based on
449         bfd_link_info.
450         (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
451         (elf_x86_64_relocate_section): Likewise.
452
453 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
454
455         * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
456         for function symbols.
457         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
458
459 2017-08-23  H.J. Lu  <hongjiu.lu@intel.com>
460
461         * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
462         extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
463         is set on any input relocatable file.
464         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
465
466 2017-08-23  Alan Modra  <amodra@gmail.com>
467
468         PR 21988
469         * elf64-ppc.c (ensure_undef_dynamic): Rename from
470         ensure_undefweak_dynamic.  Handle undefined too.
471         * elf32-ppc.c (ensure_undef_dynamic): Likewise.
472         * elf32-hppa.c (ensure_undef_dynamic): Likewise.
473         (allocate_dynrelocs): Discard undefined non-default visibility
474         relocs first.  Make undefined syms dynamic.  Tidy goto.
475
476 2017-08-21  Alan Modra  <amodra@gmail.com>
477             H.J. Lu  <hongjiu.lu@intel.com>
478
479         PR ld/21964
480         * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
481         * elflink.c (bfd_elf_define_start_stop): Rewrite.
482
483 2017-08-21  Hans-Peter Nilsson  <hp@bitrange.com>
484
485         PR ld/20125
486         * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
487         undefined weak symbols.
488
489 2017-08-18  Nick Clifton  <nickc@redhat.com>
490
491         PR binutils/21962
492         * tekhex.c (getsym): Fix check for source pointer walking off the
493         end of the input buffer.
494
495 2017-08-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>
496
497         PR ld/18808
498         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
499         relocations in debug sections, change abort to _bfd_error_handler.
500
501 2017-08-14  Nick Clifton  <nickc@redhat.com>
502
503         PR 21957
504         * elf.c (setup_group): Check for an empty or very small group
505         section.
506         * po/bfd.pot: Regenerate.
507
508 2017-08-14  Alan Modra  <amodra@gmail.com>
509
510         PR 21441
511         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
512         alignment padding here.
513         * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
514         in a reverse pass over sections.
515
516 2017-08-11  H.J. Lu  <hongjiu.lu@intel.com>
517
518         PR binutils/21943
519         * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
520         for @plt suffixes first.
521         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
522
523 2017-08-08  Nick Clifton  <nickc@redhat.com>
524
525         PR 21916
526         * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
527         small section lengths.
528         * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
529         table.
530         (elfcore_grok_freebsd_prstatus): Add checks to make sure that
531         there is enough data present in the note.
532
533 2017-08-08  Alan Modra  <amodra@gmail.com>
534
535         PR 21017
536         * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
537         got.refcount for GOTOFF relocs, just create .got section.
538
539 2017-08-07  H.J. Lu  <hongjiu.lu@intel.com>
540
541         * elflink.c (elf_link_add_object_symbols): Move common symbol
542         check after bed->common_definition.
543
544 2017-08-07  Alan Modra  <amodra@gmail.com>
545
546         PR 21910
547         * elflink.c (bfd_elf_final_link): Don't segfault when sections
548         needed to define various dynamic tags have been discarded.
549
550 2017-08-07  Nick Clifton  <nickc@redhat.com>
551
552         PR 21884
553         * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
554         has not been set then use the bfd returned by
555         _bfd_elf_link_setup_gnu_properties.  If that is null then search
556         through all the input bfds selecting the first normal, ELF format
557         one.
558         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
559
560 2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
561
562         * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
563         to 1 bit.
564         (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
565         (elf_i386_check_tls_transition): Check tls_get_addr directly.
566         (elf_i386_convert_load_reloc): Update tls_get_addr check.
567         (elf_i386_link_check_relocs): New function.
568         (bfd_elf32_bfd_link_check_relocs): New.
569         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
570         to 1 bit.
571         (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
572         (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
573         (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
574         (elf_x86_64_link_check_relocs): New function.
575         (bfd_elf64_bfd_link_check_relocs): New.
576         (bfd_elf32_bfd_link_check_relocs): Likewise.
577
578 2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
579
580         PR ld/21903:
581         * elflink.c (elf_link_add_object_symbols): Treat common symbol
582         as undefined for --no-define-common.
583
584 2017-08-05  Alan Modra  <amodra@gmail.com>
585
586         * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
587         hppa_link_hash_table.
588
589 2017-08-02  Max Filippov  <jcmvbkbc@gmail.com>
590
591         * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
592         entries for sysregs with negative indices.
593
594 2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
595
596         * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
597         isn't the S/390 specific elf data.
598         * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
599
600 2017-07-31  Kuan-Lin Chen  <rufus@andestech.com>
601
602         * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
603         * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
604         [R_RISCV_ADD16]: Likewise.
605         [R_RISCV_ADD32]: Likewise.
606         [R_RISCV_ADD64]: Likewise.
607         [R_RISCV_SUB6]: Likewise.
608         [R_RISCV_SUB8]: Likewise.
609         [R_RISCV_SUB16]: Likewise.
610         [R_RISCV_SUB32]: Likewise.
611         [R_RISCV_SUB64]: Likewise.
612
613 2017-07-31  Alan Modra  <amodra@gmail.com>
614
615         * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
616         without ld.so checks.
617
618 2017-07-29  Alan Modra  <amodra@gmail.com>
619
620         PR 21847
621         * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
622         (ppc64_elf_merge_symbol): Set non_zero_localentry.
623         (is_elfv2_localentry0): Test non_zero_localentry.
624         (ppc64_elf_tls_setup): Default to --no-plt-localentry.
625
626 2017-07-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
627
628         * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
629         pointer check for htab->elf.irelplt.
630         * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
631
632 2017-07-27  Nick Clifton  <nickc@redhat.com>
633
634         PR 21840
635         * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
636         size is -1.
637         * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
638         with error return.
639         * section.c (bfd_make_section_with_flags): Fail if the name or bfd
640         are NULL.
641         * vms-alpha.c (bfd_make_section_with_flags): Correct computation
642         of end pointer.
643         (evax_bfd_print_emh): Check for invalid string lengths.
644
645 2017-07-25  Nick Clifton  <nickc@redhat.com>
646
647         * po/fr.po: Updated French translation.
648
649 2017-07-25  Benjamin Green  <bengreen5mx@gmail.com>
650
651         PR 21824
652         * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
653         16-bit absolute branches into 10-bit pc-relative branches on the
654         MSP430 as well as the MSP430X.
655
656 2017-07-25  Alan Modra  <amodra@gmail.com>
657
658         * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
659         (stub_eh_frame_size): New function.
660         (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
661         (group_sections): Init group tls_get_addr_opt_bctrl.
662         (ppc64_elf_size_stubs): Update sizing and initialization of
663         .eh_frame.  Iteration over stubs via group list.
664         (ppc64_elf_build_stubs): Iterate over stubs via group list.
665         (ppc64_elf_finish_dynamic_sections): Update finalization of
666         .eh_frame.
667
668 2017-07-24  Nick Clifton  <nickc@redhat.com>
669
670         PR 21813
671         * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
672         of the relocs to the canonicalize_one_reloc routine.
673         * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
674         for the _bfd_mach_o_canonicalize_one_reloc field.
675         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
676         res_base parameter.  Use to check for corrupt pair relocs.
677         * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
678         Likewise.
679         * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
680         Likewise.
681         * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
682         Likewise.
683
684         * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
685         enough data in the record before attempting to parse it.
686         (_bfd_vms_slurp_eeom): Likewise.
687
688         (_bfd_vms_slurp_egsd): Check for an invalid section index.
689         (image_set_ptr): Likewise.
690         (alpha_vms_slurp_relocs): Likewise.
691
692         (alpha_vms_object_p): Check for a truncated record.
693
694 2017-07-24  Nick Clifton  <nickc@redhat.com>
695
696         PR 21803
697         * reloc.c (_bfd_unrecognized_reloc): New function.  Reports
698         an unrecognized reloc and sets the bfd_error value.
699         * libbfd.h: Regenerate.
700         * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
701         function.
702         * elf32-i386.c (elf_i386_relocate_section): Likewise.
703         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
704         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
705         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
706         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
707
708 2017-07-23  Alan Modra  <amodra@gmail.com>
709
710         * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
711         restore of LR.
712
713 2017-07-19  Szabolcs Nagy  <szabolcs.nagy@arm.com>
714
715         PR ld/18841
716         * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
717         reloc_class_ifunc for ifunc symbols.
718
719 2017-07-19  Nick Clifton  <nickc@redhat.com>
720
721         PR 21787
722         * archive.c (bfd_generic_archive_p): If the bfd does not have the
723         correct magic bytes at the start, set the error to wrong format
724         and clear the format selector before returning NULL.
725
726 2017-07-19  Nick Clifton  <nickc@redhat.com>
727
728         PR 21786
729         * coff-rs6000.c (_bfd_strntol): New function.
730         (_bfd_strntoll): New function.
731         (GET_VALUE_IN_FIELD): New macro.
732         (EQ_VALUE_IN_FIELD): new macro.
733         (_bfd_xcoff_slurp_armap): Use new macros.
734         (_bfd_xcoff_archive_p): Likewise.
735         (_bfd_xcoff_read_ar_hdr): Likewise.
736         (_bfd_xcoff_openr_next_archived_file): Likewise.
737         (_bfd_xcoff_stat_arch_elt): Likewise.
738         * coff64-rs6000.c (_bfd_strntol): New function.
739         (_bfd_strntoll): New function.
740         (GET_VALUE_IN_FIELD): New macro.
741         (xcoff64_slurp_armap): Use new macros.
742
743 2017-07-19  Claudiu Zissulescu  <claziss@synopsys.com>
744             John Eric Martin  <John.Martin@emmicro-us.com>
745
746         * bfd-in2.h: Regenerate.
747         * libbfd.h: Regenerate.
748         * elf32-arc.c (JLI): Define.
749         * reloc.c: Add JLI relocations.
750
751 2017-07-18  Nick Clifton  <nickc@redhat.com>
752
753         PR 21775
754         * coff-sh.c: Fix spelling typos.
755         * compress.c: Likewise.
756         * cpu-pdp11.c: Likewise.
757         * ecofflink.c: Likewise.
758         * elf-m10300.c: Likewise.
759         * elf.c: Likewise.
760         * elf32-arm.c: Likewise.
761         * elf32-m68k.c: Likewise.
762         * elf32-nds32.c: Likewise.
763         * elf32-ppc.c: Likewise.
764         * elf32-sh.c: Likewise.
765         * elf32-v850.c: Likewise.
766         * elf64-ppc.c: Likewise.
767         * elf64-x86-64.c: Likewise.
768         * elflink.c: Likewise.
769         * elfnn-aarch64.c: Likewise.
770         * elfxx-mips.c: Likewise.
771         * som.c: Likewise.
772         * sunos.c: Likewise.
773         * vms-alpha.c: Likewise.
774         * xcofflink.c: Likewise.
775
776 2017-07-18  Nick Clifton  <nickc@redhat.com>
777
778         PR binutils/21781
779         * coffcode.h (handle_COMDAT): Replace abort with an error message
780         and return.
781
782 2017-07-17  H.J. Lu  <hongjiu.lu@intel.com>
783
784         PR ld/21782
785         * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
786         to shared library.
787
788 2017-07-17  H.J. Lu  <hongjiu.lu@intel.com>
789
790         * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
791
792 2017-07-16  Alan Modra  <amodra@gmail.com>
793
794         * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
795         __tls_index GOT entries when using __tls_get_addr_opt stub.
796         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
797
798 2017-07-12  Alan Modra  <amodra@gmail.com>
799
800         * po/es.po: Update from translationproject.org/latest/bfd/.
801         * po/fi.po: Likewise.
802         * po/fr.po: Likewise.
803         * po/id.po: Likewise.
804         * po/ja.po: Likewise.
805         * po/ro.po: Likewise.
806         * po/ru.po: Likewise.
807         * po/sr.po: Likewise.
808         * po/sv.po: Likewise.
809         * po/tr.po: Likewise.
810         * po/uk.po: Likewise.
811         * po/vi.po: Likewise.
812         * po/zh_CN.po: Likewise.
813         * po/hr.po: New file from translationproject.org.
814         * configure.ac (ALL_LINGUAS): Add hr.  Sort.
815         * configure: Regenerate.
816
817 2017-07-12  Nick Clifton  <nickc@redhat.com>
818
819         Fix compile time warnings using gcc 7.1.1.
820         * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
821         plt_name buffer.
822         (elf_xtensa_get_gotplt_section): Increase length of got_name
823         buffer.
824         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
825         default return of FALSE.
826         * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
827         default return of FALSE.
828
829 2017-07-12  Alan Modra  <amodra@gmail.com>
830
831         * binary.c (binary_set_section_contents): Don't print filepos in
832         error message.
833         (coff_write_object_contents): Cast size_t for error message.
834         (coff_slurp_line_table): Don't use bfd_vma symndx.
835         (coff_slurp_reloc_table): Remove unneeded cast.
836         * dwarf2.c (read_section): Cast bfd_int64_t to long long for
837         error message.
838         (find_abstract_instance_name): Likewise.
839         * elf32-arm.c (arm_type_of_stub): Correct error arg order.
840         (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
841         (elf32_arm_check_relocs): Make r_symndx an int.
842         * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
843         format string.
844         * elf32-metag.c (elf_metag_relocate_section): Delete extra error
845         message arg.
846         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
847         error message.
848         * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
849         * elf32-s390.c (elf_s390_check_relocs): Likewise.
850         * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
851         * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
852         * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
853         * elf64-s390.c (elf_s390_check_relocs): Likewise.
854         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
855         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
856         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
857         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
858         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
859         * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
860         and use %lu for error message.
861         * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
862         * mmo.c (mmo_scan): Make stab_loc a file_ptr.  Cast expression for
863         error message.
864
865         * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
866         in error message.
867         (elf32_arm_final_link_relocate): Likewise.
868         * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
869         * coffcode.h (styp_to_sec_flags): Likewise.
870         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
871         * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
872         * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
873         * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
874         (elf32_bfin_merge_private_bfd_data): Likewise.
875         * elf32-cris.c (cris_elf_relocate_section): Likewise.
876         * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
877         * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
878         (i370_elf_relocate_section): Likewise.
879         * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
880         * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
881         * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
882         * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
883         * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
884         * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
885         * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
886         * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
887         (_bfd_mips_elf_merge_private_bfd_data): Likewise.
888         * ieee.c (ieee_write_id, read_id): Likewise.
889         * mach-o.c (bfd_mach_o_write_contents): Likewise.
890         (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
891         (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
892         (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
893         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
894         * stabs.c (_bfd_link_section_stabs): Likewise.
895
896         * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
897         format.
898         * coff-mcore.c (coff_mcore_relocate_section): Likewise.
899         * coff-ppc.c (coff_ppc_relocate_section): Likewise.
900         * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
901         * coff-sh.c (sh_relax_section): Likewise.
902         (sh_relax_delete_bytes, sh_swap_insns): Likewise.
903         * coff-tic80.c (coff_tic80_relocate_section): Likewise.
904         * coffcode.h (coff_slurp_reloc_table): Likewise.
905         * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
906         (_bfd_coff_read_string_table): Likewise.
907         * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
908         * compress.c (bfd_get_full_section_contents): Likewise.
909         * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
910         * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
911         * elf.c (bfd_elf_string_from_elf_section): Likewise.
912         * elf32-arc.c (arc_special_overflow_checks): Likewise.
913         * elf32-arm.c (elf32_arm_tls_relax): Likewise.
914         (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
915         (elf32_arm_write_section): Likewise.
916         * elf32-bfin.c (bfin_relocate_section): Likewise.
917         (bfinfdpic_relocate_section): Likewise.
918         * elf32-hppa.c (hppa_build_one_stub): Likewise.
919         (final_link_relocate, elf32_hppa_relocate_section): Likewise.
920         * elf32-i386.c (elf_i386_tls_transition): Likewise.
921         (elf_i386_relocate_section): Likewise.
922         * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
923         * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
924         * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
925         * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
926         * elf32-metag.c (elf_metag_relocate_section): Likewise.
927         * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
928         (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
929         (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
930         (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
931         (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
932         (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
933         (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
934         (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
935         (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
936         * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
937         * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
938         * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
939         * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
940         * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
941         * elf32-sh.c (sh_elf_relax_section): Likewise.
942         (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
943         (sh_elf_relocate_section): Likewise.
944         * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
945         * elf32-spu.c (spu_elf_relocate_section): Likewise.
946         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
947         * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
948         * elf32-v850.c (v850_elf_relax_section): Likewise.
949         * elf32-vax.c (elf_vax_check_relocs): Likewise.
950         (elf_vax_relocate_section): Likewise.
951         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
952         (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
953         (compute_text_actions, compute_ebb_proposed_actions): Likewise.
954         (do_fix_for_relocatable_link): Likewise.
955         * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
956         (elf64_alpha_relax_with_lituse): Likewise.
957         * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
958         (elf_hppa_final_link_relocate): Likewise.
959         * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
960         (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
961         (elf64_vms_link_add_object_symbols): Likewise.
962         * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
963         (mmix_final_link_relocate): Likewise.
964         * elf64-s390.c (invalid_tls_insn): Likewise.
965         (elf_s390_relocate_section): Likewise.
966         * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
967         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
968         (elf_x86_64_relocate_section): Likewise.
969         * elfcode.h (elf_slurp_symbol_table): Likewise.
970         * elfcore.h (elf_core_file_p): Likewise.
971         * elflink.c (elf_link_read_relocs_from_section): Likewise.
972         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
973         (elfNN_aarch64_relocate_section): Likewise.
974         * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
975         (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
976         * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
977         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
978         (_bfd_mips_elf_relocate_section): Likewise.
979         (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
980         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
981         * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
982         * ieee.c (ieee_slurp_external_symbols): Likewise.
983         * ihex.c (ihex_write_object_content): Likewise.
984         * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
985         * merge.c (_bfd_merged_section_offset): Likewise.
986         * mmo.c (mmo_write_loc_chunk): Likewise.
987         (mmo_write_object_contents): Likewise.
988         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
989         * stabs.c (_bfd_link_section_stabs): Likewise.
990         * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
991
992 2017-07-11  Alan Modra  <amodra@gmail.com>
993
994         * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
995
996 2017-07-11  Alan Modra  <amodra@gmail.com>
997
998         * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
999         instruction" error using _bfd_error_handler, not einfo.
1000
1001 2017-07-10  Nick Clifton  <nickc@redhat.com>
1002
1003         * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1004         for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1005
1006 2017-07-07  John Baldwin  <jhb@FreeBSD.org>
1007
1008         * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1009
1010 2017-07-07  Alan Modra  <amodra@gmail.com>
1011
1012         * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1013
1014 2017-07-07  Alan Modra  <amodra@gmail.com>
1015
1016         * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1017         as long long.  Move code replacing "ll" with "I64", and simplify.
1018
1019 2017-07-06  H.J. Lu  <hongjiu.lu@intel.com>
1020
1021         * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1022         to 1.
1023
1024 2017-07-05  H.J. Lu  <hongjiu.lu@intel.com>
1025
1026         * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1027         xtime.
1028         (line_info_add_file_name): Likewise.
1029         (decode_line_info): Likewise.
1030
1031 2017-07-04  Tristan Gingold  <gingold@adacore.com>
1032
1033         * version.m4: Bump version to 2.29.51
1034         * configure: Regenerate.
1035
1036 2017-07-04  Jiong Wang  <jiong.wang@arm.com>
1037
1038         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1039         sanity check at the head of this function.
1040
1041 2017-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
1042
1043         * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1044         dwarf_line_str_size.
1045         (struct attr_abbrev): Add field implicit_const.
1046         (dwarf_debug_sections): Add .debug_line_str.
1047         (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1048         (dwarf_debug_section_assert): Add static assertion.
1049         (read_indirect_line_string): New.
1050         (read_abbrevs): Support DW_FORM_implicit_const.
1051         (is_str_attr): Support DW_FORM_line_strp.
1052         (read_attribute_value): Support DW_FORM_line_strp and
1053         DW_FORM_implicit_const.
1054         (read_attribute): Support DW_FORM_implicit_const.
1055         (line_info_add_include_dir, line_info_add_include_dir_stub):
1056         (line_info_add_file_name, read_formatted_entries): New.
1057         (decode_line_info, parse_comp_unit): Support DWARF 5.
1058         (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1059
1060 2017-07-03  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
1061
1062         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1063         abort statement that was put for symbols that are not dynamic.
1064
1065 2017-07-03  Tristan Gingold  <gingold@adacore.com>
1066
1067         * po/bfd.pot: Regenerate
1068
1069 2017-07-03  Alan Modra  <amodra@gmail.com>
1070
1071         * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1072         __MSVCRT__.  Support "L" modifier for bfd_vma.  Formatting.
1073         * elf.c (setup_group): Use "Lx" to print sh_size.
1074         (_bfd_elf_setup_sections): Remove unnecessary cast and print
1075         unknown section type in hex.
1076         (copy_special_section_fields): Style fix.
1077         (bfd_section_from_shdr): Correct format for sh_link.  Use a
1078         common error message for all the variants of unrecognized
1079         section types.
1080         (assign_file_positions_for_load_sections): Use "Lx" for lma
1081         adjust error message.
1082         (assign_file_positions_for_non_load_sections): Formatting.
1083         (rewrite_elf_program_header): Formatting.  Use "Lx" for
1084         bfd_vma values in error messages.
1085         * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1086         ELF_R_SYM value to type expected by format.
1087         * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1088         in error messages.
1089         (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1090         (elf_link_input_bfd): Use "Lx" for r_info.
1091         (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1092
1093 2017-07-03  Alan Modra  <amodra@gmail.com>
1094
1095         * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1096         * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1097         Microsoft C library variant of long long format specifier.
1098         (PRINT20): Cast value to bfd_uint64_t not long long.
1099         * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1100         * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1101         long long.  Don't cast to bfd_vma.
1102         * elf32-score.c (score3_bfd_getl48): Likewise.
1103         * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1104
1105 2017-07-03  Alan Modra  <amodra@gmail.com>
1106
1107         * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1108         print d_tag.
1109         (bfd_elf_print_symbol): Don't cast symbol->flags.
1110         (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1111         * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1112         _bfd_error_handler argument order.
1113         (ppc_elf_merge_private_bfd_data): Don't cast flags.
1114
1115 2017-07-03  Alan Modra  <amodra@gmail.com>
1116
1117         * configure.ac: Invoke AC_CHECK_TYPES for long long.  Invoke
1118         AC_TYPE_LONG_DOUBLE.
1119         * configure: Regenerate.
1120         * config.in: Regenerate.
1121
1122 2017-06-29  Andrew Waterman  <andrew@sifive.com>
1123
1124         * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1125         relocs.
1126
1127 2017-06-29  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>
1128
1129         * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1130         unless it is undefined weak.
1131         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1132         relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1133         relocation.
1134         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1135         is not dynamic in PIC, abort.
1136
1137 2017-06-29  Jiong Wang  <jiong.wang@arm.com>
1138
1139         PR ld/21402
1140         * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1141         undefined weak symbols into dynamic.
1142         (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1143         relocation for non-dynamic symbols.
1144         (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1145
1146 2017-06-29  Jiong Wang  <jiong.wang@arm.com>
1147
1148         * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1149         (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1150         BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1151         BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1152         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1153         support for them.
1154
1155 2017-06-29  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1156
1157         * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1158         (elfcore_write_s390_gs_bc): Likewise.
1159         * elf.c (elfcore_grok_s390_gs_cb): New function.
1160         (elfcore_grok_s390_gs_bc): New function.
1161         (elfcore_grok_note): Call them.
1162         (elfcore_write_s390_gs_cb): New function.
1163         (elfcore_write_s390_gs_bc): New function.
1164         (elfcore_write_register_note): Call them.
1165
1166 2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>
1167
1168         * libbfd.c (_bfd_generic_get_section_contents): Don't call
1169         bfd_get_file_size.  Check archive element size.
1170         (_bfd_generic_get_section_contents_in_window): Likewise.
1171
1172 2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>
1173
1174         * bfd-in2.h: Regenerated.
1175         * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
1176         (bfd_get_file_size): Likewise.
1177
1178 2017-06-28  Maciej W. Rozycki  <macro@imgtec.com>
1179             Matthew Fortune  <matthew.fortune@imgtec.com>
1180
1181         * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
1182         * cpu-mips.c (I_interaptiv_mr2): New enum value.
1183         (arch_info_struct): Add "mips:interaptiv-mr2" entry.
1184         * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
1185         case.
1186         (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1187         (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
1188         (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
1189         (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
1190         `bfd_mach_mips_interaptiv_mr2' entries.
1191         * bfd-in2.h: Regenerate.
1192
1193 2017-06-27  Nick Clifton  <nickc@redhat.com>
1194
1195         * tekhex.c (pass_over): Revert accidental conversion of a local
1196         array to a static array.
1197
1198 2017-06-27  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
1199
1200         PR ld/13402
1201         * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
1202         reloc addend if necessary. Adjust diff only if
1203         shrinked_insn_address < end_address.
1204
1205 2017-06-27  Alan Modra  <amodra@gmail.com>
1206
1207         PR binutils/21665
1208         * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
1209         (_bfd_generic_get_section_contents_in_window): Likewise.
1210
1211 2017-06-26  Kuan-Lin Chen  <rufus@andestech.com>
1212
1213         * elfnn-riscv.c (perform_relocation): Support the new
1214         R_RISCV_32_PCREL relocation.
1215         (riscv_elf_relocate_section): Likewise.
1216         * elfxx-riscv.c (howto_table): Likewise.
1217         (riscv_reloc_map): Likewise.
1218         * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
1219         * libbfd.h: Regenerate.
1220
1221 2017-06-27  Alan Modra  <amodra@gmail.com>
1222
1223         PR binutils/21665
1224         * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
1225         Use unsigned file pointer type, and remove cast.
1226         * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
1227         Add "count", not "sz".
1228
1229 2017-06-26  Pedro Alves  <palves@redhat.com>
1230
1231         PR binutils/21665
1232         * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
1233         "sz".
1234
1235 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
1236
1237         PR binutils/21665
1238         * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
1239         a missing line.
1240
1241 2017-06-26  Maciej W. Rozycki  <macro@imgtec.com>
1242
1243         * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
1244         * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
1245         E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
1246         (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
1247         `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
1248
1249 2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>
1250
1251         PR binutils/21665
1252         * compress.c (bfd_get_full_section_contents): Don't check the
1253         file size here.
1254         * libbfd.c (_bfd_generic_get_section_contents): Check for and
1255         reject a section whose size + offset is greater than the size
1256         of the entire file.
1257         (_bfd_generic_get_section_contents_in_window): Likewise.
1258
1259 2017-06-26  Nick Clifton  <nickc@redhat.com>
1260
1261         PR binutils/21670
1262         * tekhex.c (getvalue): Check for the source pointer exceeding the
1263         end pointer before the first byte is read.
1264
1265 2017-06-26  Nick Clifton  <nickc@redhat.com>
1266
1267         PR binutils/21665
1268         * opncls.c (get_build_id): Check that the section is big enough
1269         to contain the whole note.
1270         * compress.c (bfd_get_full_section_contents): Check for and reject
1271         a section whose size is greater than the size of the entire file.
1272         * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
1273         contain a notes section.
1274
1275 2017-06-26  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
1276
1277         * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
1278         pointer checks.
1279         (elf_s390_modify_segment_map): Likewise.
1280         (bfd_elf_s390_set_options): Lisewise.
1281
1282 2017-06-26  Alan Modra  <amodra@gmail.com>
1283
1284         * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
1285         a --just-syms bfd.
1286         (_bfd_elf_size_group_sections): Skip --just-syms bfds.
1287         (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
1288         .preinit_array on --just-syms bfds.
1289         (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
1290         (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
1291         (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
1292
1293 2017-06-25  Sergei Trofimovich  <slyfox@gentoo.org>
1294
1295         * elf.c (find_link): Bounds check "hint".
1296
1297 2017-06-24  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1298
1299         * elf32-arm.c (using_thumb_only): Update list of architectures in
1300         BFD_ASSERT for which the logic is valid.
1301         (using_thumb2_bl): Likewise.
1302         (using_thumb2): Likewise and return true for ARMv8-R.
1303         (arch_has_arm_nop): Likewise.
1304         (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
1305         merging logic.  Update commentis for value 15 of v8m_baseline,
1306         v8m_mainline and v4t_plus_v6_m arrays.  Use v8r array to decide
1307         merging of value 15 of Tag_CPU_arch.
1308
1309 2017-06-23  Jiong Wang  <jiong.wang@arm.com>
1310
1311         * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
1312         BFD_RELOC_AARCH64_ADR_GOT_PAGE
1313         * bfd-in2.h: Regenerate.
1314
1315 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
1316
1317         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
1318         the error_alignment label forward.  Properly align program
1319         property note section.
1320
1321 2017-06-22  Eric Christopher  <echristo@gmail.com>
1322
1323         * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
1324         abs to fix a truncation warning.
1325
1326 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
1327
1328         * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
1329         local undefined weak symbol to 0.
1330         * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
1331
1332 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
1333
1334         * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
1335         is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1336         (elf_i386_link_setup_gnu_properties): If info->shstk is set,
1337         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1338         * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
1339         info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
1340         (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
1341         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
1342
1343 2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>
1344
1345         * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
1346         (elf_i386_lazy_ibt_plt_entry): Likewise.
1347         (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
1348         (elf_i386_non_lazy_ibt_plt_entry): Likewise.
1349         (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
1350         (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
1351         (elf_i386_lazy_plt_layout): Likewise.
1352         (elf_i386_non_lazy_plt_layout): Likewise.
1353         (elf_i386_link_hash_entry): Add plt_second.
1354         (elf_i386_link_hash_table): Add plt_second and
1355         plt_second_eh_frame.
1356         (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
1357         (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
1358         the second PLT.  Check the second PLT.
1359         (elf_i386_relocate_section): Use the second PLT to resolve
1360         PLT reference if needed.
1361         (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
1362         needed.
1363         (elf_i386_finish_dynamic_sections): Set sh_entsize on the
1364         second PLT.  Generate unwind info for the second PLT.
1365         (elf_i386_plt_type): Add plt_second.
1366         (elf_i386_get_synthetic_symtab): Support the second PLT.
1367         (elf_i386_parse_gnu_properties): Support
1368         GNU_PROPERTY_X86_FEATURE_1_AND.
1369         (elf_i386_merge_gnu_properties): Support
1370         GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
1371         on GNU_PROPERTY_X86_FEATURE_1_IBT
1372         (elf_i386_link_setup_gnu_properties): If info->ibt is set,
1373         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
1374         for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1375         is set on all relocatable inputs.
1376         * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
1377         (elf_x32_lazy_ibt_plt_entry): Likewise.
1378         (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
1379         (elf_x32_non_lazy_ibt_plt_entry): Likewise.
1380         (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
1381         (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
1382         (elf_x86_64_lazy_ibt_plt): Likewise.
1383         (elf_x32_lazy_ibt_plt): Likewise.
1384         (elf_x86_64_non_lazy_ibt_plt): Likewise.
1385         (elf_x32_non_lazy_ibt_plt): Likewise.
1386         (elf_x86_64_get_synthetic_symtab): Support the second PLT.
1387         (elf_x86_64_parse_gnu_properties): Support
1388         GNU_PROPERTY_X86_FEATURE_1_AND.
1389         (elf_x86_64_merge_gnu_properties): Support
1390         GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
1391         on GNU_PROPERTY_X86_FEATURE_1_IBT
1392         (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
1393         turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
1394         for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
1395         is set on all relocatable inputs.
1396
1397 2017-06-22  Nick Clifton  <nickc@redhat.com>
1398
1399         PR binutils/21649
1400         * som.c (setup_sections): NUL terminate the space_strings buffer.
1401         Check that the space.name field does not index beyond the end of
1402         the space_strings buffer.
1403
1404 2017-06-21  Nick Clifton  <nickc@redhat.com>
1405
1406         PR binutils/21646
1407         * coff-sh.c (sh_reloc): Check for an out of range reloc.
1408
1409 2017-06-21  Nick Clifton  <nickc@redhat.com>
1410
1411         PR binutils/21639
1412         * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
1413         type of the size parameter.
1414         (_bfd_vms_save_counted_string): Add second parameter - the maximum
1415         length of the counted string.
1416         * vms.h (_bfd_vms_save_sized_string): Update prototype.
1417         (_bfd_vms_save_counted_string): Likewise.
1418         * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
1419         _bfd_vms_save_counted_string.
1420         (_bfd_vms_slurp_ehdr): Likewise.
1421         (_bfd_vms_slurp_egsd): Likewise.
1422         (Parse_module): Likewise.
1423
1424 2017-06-21  Alan Modra  <amodra@gmail.com>
1425
1426         * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
1427         calls before tocsave calls.
1428         (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
1429         following nop.
1430
1431 2017-06-21  Nick Clifton  <nickc@redhat.com>
1432
1433         PR binutils/21645
1434         * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
1435         bfd_get_full_section_contents returns no contents.
1436
1437 2017-06-21  Nick Clifton  <nickc@redhat.com>
1438
1439         PR binutils/21638
1440         * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
1441         record.
1442
1443 2017-06-21  Nick Clifton  <nickc@redhat.com>
1444
1445         PR binutils/21637
1446         * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
1447         list.
1448         (image_set_ptr): Likewise.
1449         (alpha_vms_fix_sec_rel): Likewise.
1450         (alpha_vms_slurp_relocs): Likewise.
1451
1452 2017-06-21  Nick Clifton  <nickc@redhat.com>
1453
1454         PR binutils/21633
1455         * ieee.c (ieee_slurp_sections): Check for a NULL return from
1456         read_id.
1457         (ieee_archive_p): Likewise.
1458         (ieee_object_p): Likewise.
1459
1460 2017-06-21  Nick Clifton  <nickc@redhat.com>
1461
1462         PR binutils/21640
1463         * elf.c (setup_group): Zero the group section pointer list after
1464         allocation so that loops can be caught.  Check for NULL pointers
1465         when processing a group list.
1466
1467 2017-06-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
1468
1469         * elf-s390.h: New file.
1470         * elf64-s390.c (struct elf_s390_link_hash_table): Add params
1471         field.
1472         (elf_s390_additional_program_headers): New function.
1473         (elf_s390_modify_segment_map): New function.
1474         (bfd_elf_s390_set_options): New function.
1475         (elf_backend_additional_program_headers)
1476         (elf_backend_modify_segment_map): Add macro definitions.
1477
1478 2017-06-19  H.J. Lu  <hongjiu.lu@intel.com>
1479
1480         PR ld/21626
1481         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
1482         the DYNAMIC bit instead of bfd_count_sections.
1483
1484 2017-06-19  Nick Clifton  <nickc@redhat.com>
1485
1486         PR binutils/21618
1487         * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
1488         length.
1489         (evax_bfd_print_eeom): Likewise.
1490         (evax_bfd_print_egsd): Check for an overlarge record length.
1491         (evax_bfd_print_etir): Likewise.
1492
1493 2017-06-19  Nick Clifton  <nickc@redhat.com>
1494
1495         PR binutils/21612
1496         * libieee.h (struct common_header_type): Add end_p field.
1497         * ieee.c (this_byte_and_next): Do not advance input_p beyond
1498         end_p.
1499         (read_id): Check for a length that exceeds the remaining bytes in
1500         the input buffer.
1501         (ieee_seek): Initialise end_p.
1502         (ieee_archive_p): Likewise.
1503         (ieee_object_p): Likewise.
1504
1505 2017-06-19  Nick Clifton  <nickc@redhat.com>
1506
1507         PR binutils/21611
1508         * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
1509         before reading the EIHS structure entries.
1510
1511 2017-06-19  Nick Clifton  <nickc@redhat.com>
1512
1513         PR binutils/21615
1514         * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
1515         gsd_size.  Check that there are enough bytes remaining to read the
1516         type and size of the next egsd.  Check that the size of the egsd
1517         does not exceed the size of the record.
1518
1519 2017-06-19  Alan Modra  <amodra@gmail.com>
1520
1521         * config.bfd: Correct targ_underscore for cris.
1522
1523 2017-06-18  Alan Modra  <amodra@gmail.com>
1524
1525         * config.bfd: Correct targ_underscore for epiphany, ip2k,
1526         m32c, mn10200, pru, rl78, rx, crisv32 and v850.
1527
1528 2017-06-16  Nick Clifton  <nickc@redhat.com>
1529
1530         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
1531         bucketlist is empty because there are no symbols to add to the
1532         list.
1533
1534 2017-06-16  Alan Modra  <amodra@gmail.com>
1535
1536         PR ld/20022
1537         PR ld/21557
1538         PR ld/21562
1539         PR ld/21571
1540         * targets.c (struct bfd_target): Add _bfd_define_start_stop.
1541         (BFD_JUMP_TABLE_LINK): Likewise.
1542         * elf-bfd.h (bfd_elf_define_start_stop): Declare.
1543         * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
1544         (bfd_elf_define_start_stop): New function.
1545         * linker.c (bfd_generic_define_start_stop): New function.
1546         * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
1547         new field.
1548         * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
1549         * aout-target.h (MY_bfd_define_start_stop): Define.
1550         * aout-tic30.c (MY_bfd_define_start_stop): Define.
1551         * binary.c (binary_bfd_define_start_stop): Define.
1552         * bout.c (b_out_bfd_define_start_stop): Define.
1553         * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
1554         * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
1555         * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
1556         * coffcode.h (coff_bfd_define_start_stop): Define.
1557         * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
1558         * i386msdos.c (msdos_bfd_define_start_stop): Define.
1559         * i386os9k.c (os9k_bfd_define_start_stop): Define.
1560         * ieee.c (ieee_bfd_define_start_stop): Define.
1561         * ihex.c (ihex_bfd_define_start_stop): Define.
1562         * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
1563         * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
1564         * mmo.c (mmo_bfd_define_start_stop): Define.
1565         * nlm-target.h (nlm_bfd_define_start_stop): Define.
1566         * oasys.c (oasys_bfd_define_start_stop): Define.
1567         * pef.c (bfd_pef_bfd_define_start_stop): Define.
1568         * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
1569         * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
1570         * som.c (som_bfd_define_start_stop): Define.
1571         * srec.c (srec_bfd_define_start_stop): Define.
1572         * tekhex.c (tekhex_bfd_define_start_stop): Define.
1573         * versados.c (versados_bfd_define_start_stop): Define.
1574         * vms-alpha.c (vms_bfd_define_start_stop): Define.
1575         (alpha_vms_bfd_define_start_stop): Define.
1576         * xsym.c (bfd_sym_bfd_define_start_stop): Define.
1577         * bfd-in2.h: Regenerate.
1578         * libbfd.h: Regenerate.
1579
1580 2017-06-16  Jiong Wang  <jiong.wang@arm.com>
1581
1582         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
1583         SYMBOL_REFERENCES_LOCAL.
1584
1585 2017-06-15  Jiong Wang  <jiong.wang@arm.com>
1586
1587         PR ld/21532
1588         * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
1589         (elfNN_aarch64_final_link_relocate): Also propagate relocations to
1590         runtime for if there needs copy relocation elimination.
1591         (need_copy_relocation_p): New function.  Return true for symbol with
1592         pc-relative references and if it's against read-only sections.
1593         (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
1594         (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
1595         that are related with accessing external objects.
1596         (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
1597         in elfNN_aarch64_check_relocs.
1598
1599 2017-06-15  Nick Clifton  <nickc@redhat.com>
1600
1601         PR binutils/21582
1602         * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
1603         bugs.
1604         PR binutils/21581
1605         (ieee_archive_p): Likewise.
1606
1607 2017-06-15  Nick Clifton  <nickc@redhat.com>
1608
1609         PR binutils/21579
1610         * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
1611
1612 2017-06-14  Max Filippov  <jcmvbkbc@gmail.com>
1613
1614         * elf32-xtensa.c (elf_xtensa_be_plt_entry,
1615         elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
1616         keep both windowed and call0 ABI PLT definitions.
1617         (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
1618         elf_xtensa_*_plt_entry endex.
1619         (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
1620
1621 2017-06-14  Nick Clifton  <nickc@redhat.com>
1622
1623         PR binutils/21578
1624         * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
1625         flag value.
1626
1627 2017-06-14  Nick Clifton  <nickc@redhat.com>
1628
1629         PR binutils/21589
1630         * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
1631         maximum value for the ascic pointer.  Check that name processing
1632         does not read beyond this value.
1633         (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
1634         end of etir record.
1635
1636 2017-06-14  Nick Clifton  <nickc@redhat.com>
1637
1638         PR binutils/21591
1639         * versados.c (versados_mkobject): Zero the allocated tdata structure.
1640         (process_otr): Check for an invalid offset in the otr structure.
1641
1642 2017-06-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>
1643
1644         * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
1645
1646 2017-06-13  H.J. Lu  <hongjiu.lu@intel.com>
1647
1648         PR ld/20022
1649         PR ld/21557
1650         PR ld/21562
1651         PR ld/21571
1652         * elf-bfd.h (elf_link_hash_entry): Add start_stop.  Change the
1653         vtable field to a union.
1654         (_bfd_elf_is_start_stop): Removed.
1655         * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
1656         __start_SECNAME and __stop_SECNAME symbols.
1657         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1658         * elflink.c (_bfd_elf_is_start_stop): Removed.
1659         (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
1660         _bfd_elf_is_start_stop.
1661         (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
1662         __stop_SECNAME symbols.  Updated.
1663         (elf_gc_smash_unused_vtentry_relocs): Likewise.
1664         (bfd_elf_gc_record_vtinherit): Likewise.
1665         (bfd_elf_gc_record_vtentry): Likewise.
1666
1667 2017-06-13  Nick Clifton  <nickc@redhat.com>
1668
1669         PR ld/21524
1670         * elflink.c (elf_link_adjust_relocs): Generate an error when
1671         encountering a reloc against a symbol removed by garbage
1672         collection.
1673
1674 2017-06-12  H.J. Lu  <hongjiu.lu@intel.com>
1675
1676         * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
1677         to merge_gnu_properties.
1678         * elf-properties.c (elf_merge_gnu_properties): Add struct
1679         bfd_link_info * and pass it to merge_gnu_properties.
1680         (elf_merge_gnu_property_list): Add struct bfd_link_info *
1681         and pass it to elf_merge_gnu_properties.
1682         (_bfd_elf_link_setup_gnu_properties): Pass info to
1683         elf_merge_gnu_property_list.
1684         * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
1685         bfd_link_info *.
1686         * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
1687
1688 2017-06-11  Joe Zbiciak  <joe.zbiciak@leftturnonly.info>
1689
1690         PR 21564
1691         * binary.c (binary_set_section_contents): Scale lma by octets
1692         per byte to set filepos.
1693
1694 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1695
1696         * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
1697         dynamic sections.
1698
1699 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1700
1701         * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
1702         require TEXTREL.
1703
1704 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1705
1706         * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
1707         patched section contents for TLS IE reloc.
1708         * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
1709
1710 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1711
1712         * elf32-arc.c (elf_arc_relocate_section): Added "call" to
1713         RELOC_FOR_GLOBAL_SYMBOL macro.
1714
1715 2018-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1716
1717         * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
1718         changes.
1719
1720 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1721
1722         * config/tc-arc.c (md_undefined_symbol): Changed.
1723         * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
1724
1725 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1726
1727         * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
1728         symbols.
1729
1730 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1731
1732         * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
1733         warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
1734
1735 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
1736
1737         * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
1738         object is created.
1739
1740 2017-06-08  Richard Earnshaw  <rearnsha@arm.com>
1741
1742         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
1743         that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
1744         is non-zero.  Add clarifying comments.
1745
1746 2017-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1747
1748         * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
1749         name.  Use local IFUNC symbol name string to report unsupported
1750         non-PIC call to IFUNC function.
1751         (elf_i386_relocate_section): Dump local IFUNC name with minfo
1752         when generating R_386_IRELATIVE relocation.
1753         (elf_i386_finish_dynamic_symbol): Likewise.
1754         * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
1755         IFUNC symbol name.
1756         (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
1757         when generating R_X86_64_IRELATIVE relocation.
1758         (elf_x86_64_finish_dynamic_symbol): Likewise.
1759
1760 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
1761
1762         * elf.c (setup_group): Make sure BFD sections are created for all
1763         group sections in the input file when processing SHF_GROUP
1764         sections.
1765         (bfd_section_from_shdr): Avoid duplicating logic already
1766         implemented in `setup_group'.
1767
1768 2017-06-06  Daniel Bonniot de Ruisselet  <bonniot@gmail.com>
1769
1770         PR binutils/21546
1771         * peXXigen.c (pe_print_idata): Use the address of the first thunk
1772         if the hint address is zero.
1773
1774 2017-06-06  James Clarke  <jrtc27@jrtc27.com>
1775
1776         PR ld/19579
1777         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
1778         ELF_COMMON_DEF_P for common symbols.
1779
1780 2017-06-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1781
1782         * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
1783         SEC_GROUP sections as SEC_EXCLUDE.
1784         (bfd_elf_set_group_contents): Replace use of abort with an assert.
1785         (assign_section_numbers): Use resolve_section_groups flag instead
1786         of relocatable link type.
1787         (_bfd_elf_init_private_section_data): Use resolve_section_groups
1788         flag instead of checking the final_link flag for part of the
1789         checks in here.  Fix white space as a result.
1790         * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
1791         instead of relocatable link type.
1792         (bfd_elf_final_link): Likewise.
1793
1794 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
1795
1796         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
1797         variable `bed'.
1798         * elf32-score.c (score_elf_final_link_relocate): Likewise.
1799         (s3_bfd_score_elf_check_relocs): Likewise.
1800         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1801         (score_elf_final_link_relocate): Likewise.
1802         (s7_bfd_score_elf_check_relocs): Likewise.
1803
1804 2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>
1805
1806         * elflink.c (init_reloc_cookie_rels): Remove unused variable
1807         `bed'.
1808
1809 2017-06-06  Maciej W. Rozycki  <macro@imgtec.com>
1810
1811         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
1812         from `reloc_count' rather than decrementing it.
1813         * elf.c (bfd_section_from_shdr): Multiply the adjustment to
1814         `reloc_count' by `int_rels_per_ext_rel'.
1815         * elf32-score.c (score_elf_final_link_relocate): Do not multiply
1816         `reloc_count' by `int_rels_per_ext_rel' for last relocation
1817         entry determination.
1818         (s3_bfd_score_elf_check_relocs): Likewise.
1819         * elf32-score7.c (score_elf_final_link_relocate): Likewise.
1820         (s7_bfd_score_elf_relocate_section): Likewise.
1821         (s7_bfd_score_elf_check_relocs): Likewise.
1822         * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
1823         prototype and function.
1824         (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
1825         (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
1826         triple rather than once the sum of REL and RELA relocation entry
1827         counts.
1828         (bfd_elf64_get_reloc_upper_bound): Remove macro.
1829         * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
1830         `reloc_count' by `int_rels_per_ext_rel' for internal relocation
1831         storage allocation size determination.
1832         (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
1833         size by `int_rels_per_ext_rel'.  Do not multiply `reloc_count'
1834         by `int_rels_per_ext_rel' for last relocation entry
1835         determination.
1836         (bfd_elf_final_link): Do not multiply `reloc_count' by
1837         `int_rels_per_ext_rel' for internal relocation storage
1838         allocation size determination.
1839         (init_reloc_cookie_rels): Do not multiply `reloc_count' by
1840         `int_rels_per_ext_rel' for last relocation entry determination.
1841         (elf_gc_smash_unused_vtentry_relocs): Likewise.
1842         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1843         (_bfd_mips_elf_relocate_section): Likewise.
1844
1845 2017-06-05  Alan Modra  <amodra@gmail.com>
1846
1847         PR 21529
1848         * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
1849
1850 2017-06-01  John Baldwin  <jhb@FreeBSD.org>
1851
1852         * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
1853         determine structure sizes.
1854         (elfcore_grok_freebsd_prstatus): Likewise.
1855
1856 2017-06-01  Alan Modra  <amodra@gmail.com>
1857
1858         * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
1859         (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
1860         dynamic objects.
1861         (is_elfv2_localentry0): New function.
1862         (ppc64_elf_tls_setup): Default params->plt_localentry0.
1863         (plt_stub_size): Adjust size for tls_get_addr_opt stub.
1864         (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
1865         (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
1866         optimized localentry:0 stubs.
1867         (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
1868         (ppc64_elf_relocate_section): Leave nop unchanged for optimized
1869         localentry:0 stubs.
1870         (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
1871         DT_PPC64_OPT.
1872         * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
1873
1874 2017-05-30  Casey Smith  <clegg89@gmail.com>
1875
1876         PR ld/21523
1877         * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
1878         value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
1879
1880 2017-05-30  Anton Kolesov  Anton.Kolesov@synopsys.com
1881
1882         * cpu-arc.c (arc_compatible): New function.
1883
1884 2017-05-30  Anton Kolesov  <anton.kolesov@synopsys.com>
1885
1886         * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
1887
1888 2017-05-30  H.J. Lu  <hongjiu.lu@intel.com>
1889
1890         PR binutils/21519
1891         * bfdio.c (bfd_get_file_size): New function.
1892         * bfd-in2.h: Regenerated.
1893
1894 2017-05-23  Dilian Palauzov  <git-dpa@aegee.org>
1895
1896         * elf32-arc.c (arc_elf_merge_attributes): Add fall through
1897         comments.
1898
1899 2017-05-22  H.J. Lu  <hongjiu.lu@intel.com>
1900
1901         * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
1902         dynobj instead of htab->elf.dynobj.
1903
1904 2017-05-19  Maciej W. Rozycki  <macro@imgtec.com>
1905
1906         * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
1907         and function.
1908         (mips_elf64_canonicalize_dynamic_reloc): Likewise.
1909         (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
1910         actual number of internal relocations retrieved.  Adjust
1911         function description.
1912         (bfd_elf64_canonicalize_reloc): Remove macro.
1913         (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
1914
1915 2017-05-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
1916
1917         * archures.c (bfd_mach_sparc_v9m8): Define.
1918         (bfd_mach_sparc_v8plusm8): Likewise.
1919         (bfd_mach_sparc_v9_p): Adjust to M8.
1920         (bfd_mach_sparc_64bit_p): Likewise.
1921         * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
1922         bfd_mach_sparc_v8plusm8.
1923         * bfd-in2.h: Regenerated.
1924         * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
1925         sparc:v8plusm8.
1926         * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
1927         bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
1928         capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
1929         SHA3.
1930         * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
1931         bfd_mach_sparc_v8plusm8.
1932
1933 2017-05-19  Alan Modra  <amodra@gmail.com>
1934
1935         * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
1936         debug and special sections when no non-note alloc sections in an
1937         object are kept.
1938
1939 2017-05-18  Alan Modra  <amodra@gmail.com>
1940
1941         * arc-got.h: Don't compare boolean values against TRUE or FALSE.
1942         * elf-m10300.c: Likewise.
1943         * elf.c: Likewise.
1944         * elf32-arc.c: Likewise.
1945         * elf32-bfin.c: Likewise.
1946         * elf32-m68k.c: Likewise.
1947         * elf32-nds32.c: Likewise.
1948         * elf32-tilepro.c: Likewise.
1949         * elflink.c: Likewise.
1950         * elfnn-aarch64.c: Likewise.
1951         * elfnn-riscv.c: Likewise.
1952         * elfxx-tilegx.c: Likewise.
1953         * mach-o.c: Likewise.
1954         * peXXigen.c: Likewise.
1955         * vms-alpha.c: Likewise.
1956         * vms-lib.c: Likewise.
1957
1958 2017-05-17  H.J. Lu  <hongjiu.lu@intel.com>
1959
1960         PR ld/20882
1961         * elflink.c (elf_gc_mark_debug_section): New function.
1962         (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
1963         referenced by kept debug sections.
1964
1965 2017-05-16  Alan Modra  <amodra@gmail.com>
1966
1967         * elf-m10300.c: Rename occurrences of non_ir_ref.
1968         * elf32-arm.c: Likewise.
1969         * elf32-bfin.c: Likewise.
1970         * elf32-cr16.c: Likewise.
1971         * elf32-cris.c: Likewise.
1972         * elf32-d10v.c: Likewise.
1973         * elf32-dlx.c: Likewise.
1974         * elf32-fr30.c: Likewise.
1975         * elf32-frv.c: Likewise.
1976         * elf32-hppa.c: Likewise.
1977         * elf32-i370.c: Likewise.
1978         * elf32-i386.c: Likewise.
1979         * elf32-iq2000.c: Likewise.
1980         * elf32-lm32.c: Likewise.
1981         * elf32-m32c.c: Likewise.
1982         * elf32-m32r.c: Likewise.
1983         * elf32-m68hc1x.c: Likewise.
1984         * elf32-m68k.c: Likewise.
1985         * elf32-mcore.c: Likewise.
1986         * elf32-metag.c: Likewise.
1987         * elf32-microblaze.c: Likewise.
1988         * elf32-moxie.c: Likewise.
1989         * elf32-msp430.c: Likewise.
1990         * elf32-mt.c: Likewise.
1991         * elf32-nios2.c: Likewise.
1992         * elf32-or1k.c: Likewise.
1993         * elf32-ppc.c: Likewise.
1994         * elf32-rl78.c: Likewise.
1995         * elf32-s390.c: Likewise.
1996         * elf32-score.c: Likewise.
1997         * elf32-score7.c: Likewise.
1998         * elf32-sh.c: Likewise.
1999         * elf32-tic6x.c: Likewise.
2000         * elf32-tilepro.c: Likewise.
2001         * elf32-v850.c: Likewise.
2002         * elf32-vax.c: Likewise.
2003         * elf32-xstormy16.c: Likewise.
2004         * elf32-xtensa.c: Likewise.
2005         * elf64-alpha.c: Likewise.
2006         * elf64-hppa.c: Likewise.
2007         * elf64-ia64-vms.c: Likewise.
2008         * elf64-mmix.c: Likewise.
2009         * elf64-ppc.c: Likewise.
2010         * elf64-s390.c: Likewise.
2011         * elf64-sh64.c: Likewise.
2012         * elf64-x86-64.c: Likewise.
2013         * elflink.c: Likewise.
2014         * elfnn-aarch64.c: Likewise.
2015         * elfnn-ia64.c: Likewise.
2016         * elfnn-riscv.c: Likewise.
2017         * elfxx-mips.c: Likewise.
2018         * elfxx-sparc.c: Likewise.
2019         * elfxx-tilegx.c: Likewise.
2020         * linker.c: Likewise.
2021
2022 2017-05-16  Alan Modra  <amodra@gmail.com>
2023
2024         * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2025         * elflink.c (elf_link_add_object_symbols): Update to use
2026         non_ir_ref_dynamic.
2027         (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2028         non_ir_ref.
2029         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2030
2031 2017-05-15  Maciej W. Rozycki  <macro@imgtec.com>
2032
2033         * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2034
2035 2017-05-12  H.J. Lu  <hongjiu.lu@intel.com>
2036
2037         * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2038         GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2039         properties.
2040         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2041
2042 2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>
2043
2044         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2045         to plt_second.
2046         (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2047         to plt_second/plt_second_eh_frame.
2048         (elf_x86_64_link_hash_newfunc): Updated.
2049         (elf_x86_64_allocate_dynrelocs): Likewise.
2050         (elf_x86_64_size_dynamic_sections): Likewise.
2051         (elf_x86_64_relocate_section): Likewise.
2052         (elf_x86_64_finish_dynamic_symbol): Likewise.
2053         (elf_x86_64_finish_dynamic_sections): Likewise.
2054         (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2055         (elf_x86_64_get_synthetic_symtab): Updated.  Also scan the
2056         .plt.sec section.
2057         (elf_backend_setup_gnu_properties): Updated.  Create the
2058         .plt.sec section instead of the .plt.sec section.
2059
2060 2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>
2061
2062         * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2063         commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2064         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2065
2066 2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>
2067
2068         * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2069         (bfd_elf64_set_reloc): Define.
2070         (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2071
2072 2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>
2073
2074         * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2075         (struct bfd_target): New field _bfd_set_reloc.
2076         * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2077         * reloc.c (_bfd_generic_set_reloc): New function.
2078         * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2079         * nlm-target.h (nlm_set_reloc): Likewise.
2080         * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2081         * aout-tic30.c (MY_set_reloc): Likewise.
2082         * aout-target.h (MY_set_reloc): Likewise.
2083         * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2084         * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2085         * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2086         * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2087         * aout-adobe.c (aout_32_set_reloc): Likewise.
2088         * bout.c (b_out_set_reloc): Likewise.
2089         * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2090         * i386os9k.c (aout_32_set_reloc): Likewise.
2091         * ieee.c (ieee_set_reloc): Likewise.
2092         * oasys.c (oasys_set_reloc): Likewise.
2093         * som.c (som_set_reloc): Likewise.
2094         * versados.c (versados_set_reloc): Likewise.
2095         * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2096         _bfd_generic_set_reloc.
2097         (rs6000_xcoff64_aix_vec): LIkewise.
2098         * libbfd.c (_bfd_norelocs_set_reloc): New function.
2099         * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2100         * i386msdos.c (msdos_set_reloc): Define to
2101         _bfd_norelocs_set_reloc.
2102         * elfcode.h (elf_set_reloc): Define.
2103         * bfd-in2.h: Regenerated.
2104
2105 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
2106
2107         PR ld/21481
2108         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2109         for IFUNC function address.
2110
2111 2017-05-10  Claudiu Zissulescu  <claziss@synopsys.com>
2112
2113         * elf32-arc.c (FEATURE_LIST_NAME): Define.
2114         (CONFLICT_LIST): Likewise.
2115         (opcode/arc-attrs.h): Include.
2116         (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2117         (arc_extract_features): New file.
2118         (arc_stralloc): Likewise.
2119         (arc_elf_merge_attributes): Likewise.
2120         (arc_elf_merge_private_bfd_data): Use object attributes.
2121         (bfd_arc_get_mach_from_attributes): New function.
2122         (arc_elf_object_p): Use object attributes.
2123         (arc_elf_final_write_processing): Likewise.
2124         (elf32_arc_obj_attrs_arg_type): New function.
2125         (elf32_arc_obj_attrs_handle_unknown): Likewise.
2126         (elf32_arc_section_from_shdr): Likewise.
2127         (elf_backend_obj_attrs_vendor): Define.
2128         (elf_backend_obj_attrs_section): Likewise.
2129         (elf_backend_obj_attrs_arg_type): Likewise.
2130         (elf_backend_obj_attrs_section_type): Likewise.
2131         (elf_backend_obj_attrs_handle_unknown): Likewise.
2132         (elf_backend_section_from_shdr): Likewise.
2133
2134 2017-05-09  Andrew Goedhart  <Andrewgoedhart@simplepowersolutions.co.za>
2135
2136         PR ld/21458
2137         * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2138         of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2139         and the destination is a Thumb symbol.
2140
2141 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
2142
2143         * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2144         initializer to silence GCC 4.2.
2145         * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2146
2147 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
2148
2149         * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2150         (LAZY_PLT_ENTRY_SIZE): This.
2151         (NON_LAZY_PLT_ENTRY_SIZE): New.
2152         (elf_x86_64_plt0_entry): Renamed to ...
2153         (elf_x86_64_lazy_plt0_entry): This.
2154         (elf_x86_64_plt_entry): Renamed to ...
2155         (elf_x86_64_lazy_plt_entry): This.
2156         (elf_x86_64_bnd_plt0_entry): Renamed to ...
2157         (elf_x86_64_lazy_bnd_plt0_entry): This.
2158         (elf_x86_64_legacy_plt_entry): Removed.
2159         (elf_x86_64_bnd_plt_entry): Renamed to ...
2160         (elf_x86_64_lazy_bnd_plt_entry): This.
2161         (elf_x86_64_legacy_plt2_entry): Renamed to ...
2162         (elf_x86_64_non_lazy_plt_entry): This.
2163         (elf_x86_64_bnd_plt2_entry): Renamed to ...
2164         (elf_x86_64_non_lazy_bnd_plt_entry): This.
2165         (elf_x86_64_eh_frame_plt): Renamed to ...
2166         (elf_x86_64_eh_frame_lazy_plt): This.
2167         (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
2168         (elf_x86_64_eh_frame_lazy_bnd_plt): This.
2169         (elf_x86_64_eh_frame_plt_got): Renamed to ...
2170         (elf_x86_64_eh_frame_non_lazy_plt): This.
2171         (elf_x86_64_lazy_plt_layout): New.
2172         (elf_x86_64_non_lazy_plt_layout): Likewise.
2173         (elf_x86_64_plt_layout): Likewise.
2174         (elf_x86_64_backend_data): Remove PLT layout information.  Add
2175         os for target system.
2176         (GET_PLT_ENTRY_SIZE): Removed.
2177         (elf_x86_64_lazy_plt): New.
2178         (elf_x86_64_non_lazy_plt): Likewise.
2179         (elf_x86_64_lazy_bnd_plt): Likewise.
2180         (elf_x86_64_non_lazy_bnd_plt): Likewise.
2181         (elf_x86-64_arch_bed): Updated.
2182         (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2183         (elf_x86_64_create_dynamic_sections): Removed.
2184         (elf_x86_64_check_relocs): Don't check elf.dynobj.  Don't call
2185         _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2186         (elf_x86-64_adjust_dynamic_symbol): Updated.
2187         (elf_x86_64_allocate_dynrelocs): Updated.  Pass 0 as PLT header
2188         size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2189         size for PLT0 if there is no PLT0.  Get plt_entry_size from
2190         non_lazy_plt for non-lazy PLT entries.
2191         (elf_x86_64_size_dynamic_sections): Updated.  Get plt_entry_size
2192         from non_lazy_plt for non-lazy PLT entries.
2193         (elf_x86-64_relocate_section): Updated.  Properly get PLT index
2194         if there is no PLT0.
2195         (elf_x86_64_finish_dynamic_symbol): Updated.  Fill the first slot
2196         in the PLT entry with generic PLT layout.  Fill the non-lazy PLT
2197         entries with non-lazy PLT layout.  Don't fill the second and third
2198         slots in the PLT entry if there is no PLT0.
2199         (elf_x86_64_finish_dynamic_sections): Updated.  Don't fill PLT0
2200         if there is no PLT0.  Set sh_entsize on the .plt.got section.
2201         (compare_relocs): New.
2202         (elf_x86_64_plt_type): Likewise.
2203         (elf_x86_64_plt): Likewise.
2204         (elf_x86_64_nacl_plt): New. Forward declaration.
2205         (elf_x86_64_get_plt_sym_val): Removed.
2206         (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
2207         against all dynamic relocations.
2208         (elf_x86_64_link_setup_gnu_properties): New function.
2209         (elf_backend_create_dynamic_sections): Updated.
2210         (elf_backend_setup_gnu_properties): New.
2211         (elf_x86_64_nacl_plt): New.
2212         (elf_x86_64_nacl_arch_bed): Updated.
2213
2214 2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>
2215
2216         * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
2217         (LAZY_PLT_ENTRY_SIZE): This.
2218         (NON_LAZY_PLT_ENTRY_SIZE): New.
2219         (elf_i386_plt0_entry): Renamed to ...
2220         (elf_i386_lazy_plt0_entry): This.
2221         (elf_i386_plt_entry): Renamed to ...
2222         (elf_i386_lazy_plt_entry): This.
2223         (elf_i386_pic_plt0_entry): Renamed to ...
2224         (elf_i386_pic_lazy_plt0_entry): This.
2225         (elf_i386_pic_plt_entry): Renamed to ...
2226         (elf_i386_pic_lazy_plt_entry): This.
2227         (elf_i386_got_plt_entry): Renamed to ...
2228         (elf_i386_non_lazy_plt_entry): This.
2229         (elf_i386_pic_got_plt_entry): Renamed to ...
2230         (elf_i386_pic_non_lazy_plt_entry): This.
2231         (elf_i386_eh_frame_plt): Renamed to ...
2232         (elf_i386_eh_frame_lazy_plt): This.
2233         (elf_i386_eh_frame_plt_got): Renamed to ...
2234         (elf_i386_eh_frame_non_lazy_plt): This.
2235         (elf_i386_plt_layout): Renamed to ...
2236         (elf_i386_lazy_plt_layout): This.  Remove eh_frame_plt_got and
2237         eh_frame_plt_got_size.
2238         (elf_i386_non_lazy_plt_layout): New.
2239         (elf_i386_plt_layout): Likewise.
2240         (elf_i386_non_lazy_plt): Likewise.
2241         (GET_PLT_ENTRY_SIZE): Removed.
2242         (elf_i386_plt): Renamed to ...
2243         (elf_i386_lazy_plt): This.
2244         (elf_i386_backend_data): Remove plt.  Rename is_vxworks to os.
2245         (elf_i386_arch_bed): Updated.
2246         (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
2247         (elf_i386_create_dynamic_sections): Removed.
2248         (elf_i386_check_relocs): Don't check elf.dynobj.  Don't call
2249         _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
2250         (elf_i386_adjust_dynamic_symbol): Updated.
2251         (elf_i386_allocate_dynrelocs): Updated.  Pass 0 as PLT header
2252         size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
2253         size for PLT0 if there is no PLT0.
2254         (elf_i386_size_dynamic_sections): Updated.  Check whether GOT
2255         output section is discarded only if GOT isn't empty.
2256         (elf_i386_relocate_section): Updated.  Properly get PLT index
2257         if there is no PLT0.
2258         (elf_i386_finish_dynamic_symbol): Updated.  Don't fill the
2259         second and third slots in the PLT entry if there is no PLT0.
2260         (elf_i386_finish_dynamic_sections): Updated.  Don't fill PLT0
2261         if there is no PLT0.  Set sh_entsize on the .plt.got section.
2262         (elf_i386_nacl_plt): Forward declaration.
2263         (elf_i386_get_plt_sym_val): Removed.
2264         (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
2265         against all dynamic relocations.
2266         (elf_i386_link_setup_gnu_properties): New function.
2267         (elf_backend_create_dynamic_sections): Updated.
2268         (elf_backend_setup_gnu_properties): New.
2269         (elf_i386_nacl_plt): Updated.
2270         (elf_i386_nacl_arch_bed): Likewise.
2271         (elf_i386_vxworks_arch_bed): Likewise.
2272
2273 2017-05-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>
2274
2275         * elflink.c (elf_output_implib): Remove executable flag from import
2276         library bfd.
2277         * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
2278         library is a relocatable object file.
2279
2280 2017-05-01  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
2281
2282         PR ld/21404
2283         * elf32-avr.c (avr_should_move_sym): New function.
2284         (avr_should_reduce_sym_size): Likewise.
2285         (avr_should_increase_sym_size): Likewise.
2286         (elf32_avr_relax_delete_bytes): Adjust symbol values
2287         and sizes by calling new functions.
2288
2289 2017-05-01  Palmer Dabbelt  <palmer@dabbelt.com>
2290
2291         * config.bfd (riscv32-*): Enable rv64.
2292
2293 2017-05-02  Alan Modra  <amodra@gmail.com>
2294
2295         PR 21384
2296         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
2297         rather than h->root.type == bfd_link_hash_new.
2298         (bfd_elf_record_link_assignment): Similarly, call
2299         bfd_elf_link_mark_dynamic_symbol when h->non_elf.
2300
2301 2017-04-29  Alan Modra  <amodra@gmail.com>
2302
2303         PR 21432
2304         * reloc.c (reloc_offset_in_range): New function.
2305         (bfd_perform_relocation, bfd_install_relocation): Use it.
2306         (_bfd_final_link_relocate): Likewise.
2307
2308 2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>
2309
2310         * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
2311         before using .plt.got.
2312         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
2313
2314 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2315
2316         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
2317         instead of "+=" to update 0.
2318
2319 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2320
2321         * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
2322         .plt.got section here.
2323         (elf_i386_check_relocs): Don't create the .plt.got section.
2324         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
2325         the .plt.got and .plt.bnd sections here.
2326         (elf_x86_64_check_relocs): Don't create the .plt.got nor
2327         .plt.bnd sections.
2328
2329 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2330
2331         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
2332         has_bnd_reloc.
2333         (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
2334         (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
2335         (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
2336         (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
2337         has_bnd_reloc.
2338
2339 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2340
2341         * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
2342         to return bfd *.
2343         (_bfd_elf_link_setup_gnu_properties): Return bfd *.
2344         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
2345         the first relocatable ELF input with GNU properties.
2346
2347 2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>
2348
2349         * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
2350         VxWorks for non-PIC.
2351
2352 2017-04-27  Alan Modra  <amodra@gmail.com>
2353
2354         * elf-bfd.h (struct elf_backend_data): Make asection param of
2355         elf_backend_eh_frame_address_size const.
2356         (_bfd_elf_eh_frame_address_size): Likewise.
2357         * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
2358         * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
2359         * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
2360         * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
2361         * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
2362         (next_cie_fde_offset): Constify params.
2363         (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
2364
2365 2017-04-27  Alan Modra  <amodra@gmail.com>
2366
2367         * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
2368         (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
2369         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
2370         aug_data_len.
2371         (offset_adjust): New function.
2372         (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
2373         (adjust_eh_frame_local_symbols): Likewise.
2374         (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
2375         after changing anything.  Return true if anything changed.
2376         * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
2377         _bfd_elf_adjust_eh_frame_global_symbol for globals.
2378
2379 2017-04-27  Alan Modra  <amodra@gmail.com>
2380
2381         * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
2382         when force_local.
2383
2384 2017-04-27  Alan Modra  <amodra@gmail.com>
2385
2386         * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2387         (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
2388         (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
2389         (ppc_elf_relocate_section): Likewise.  Delete silly optimisation
2390         for undef and undefweak dyn_relocs.
2391         * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
2392         (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
2393         (allocate_got, allocate_dynrelocs): Likewise.
2394         (ppc64_elf_relocate_section): Likewise.
2395
2396 2017-04-26  H.J. Lu  <hongjiu.lu@intel.com>
2397
2398         * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
2399         DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
2400         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
2401         add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
2402
2403 2017-04-26  Nick Clifton  <nickc@redhat.com>
2404
2405         PR binutils/21434
2406         * reloc.c (bfd_perform_relocation): Check for a negative address
2407         in the reloc.
2408
2409 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
2410
2411         PR ld/21334
2412         * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
2413         member.
2414         * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
2415         (elf_backend_always_renumber_dynsyms): Define.
2416         (elfNN_bed): Initialize `always_renumber_dynsyms' member.
2417         * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
2418         * elflink.c (bfd_elf_size_dynamic_sections): Also call
2419         `_bfd_elf_link_renumber_dynsyms' if the backend has requested
2420         it.
2421         (bfd_elf_size_dynsym_hash_dynstr): Likewise.
2422
2423 2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>
2424
2425         * elflink.c (bfd_elf_size_dynamic_sections): Only call
2426         `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
2427         sections have been created.
2428
2429 2017-04-26  Nick Clifton  <nickc@redhat.com>
2430
2431         PR binutils/21431
2432         * compress.c (bfd_init_section_compress_status): Check the return
2433         value from bfd_malloc.
2434
2435 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
2436
2437         * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
2438         no_finish_dynamic_symbol.
2439         (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
2440         0.
2441         (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
2442         weak symbol, don't make it dynamic.
2443         (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
2444         set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
2445         relocation for GOT reference.
2446         (elf_x86_64_finish_dynamic_symbol): Abort if
2447         no_finish_dynamic_symbol isn't 0.
2448
2449 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
2450
2451         PR ld/21402
2452         * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
2453         undefined weak symbol, don't make it dynamic.
2454         (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
2455         set no_finish_dynamic_symbol and generate R_386_RELATIVE
2456         relocation for R_386_GOT32.
2457
2458 2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>
2459
2460         PR ld/21425
2461         * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
2462
2463 2017-04-23  Alan Modra  <amodra@gmail.com>
2464
2465         PR 21414
2466         * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
2467         * elf.c (lcomm_sym): New.
2468         (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
2469         * bfd-in2.h: Regenerate.
2470
2471 2017-04-23  Alan Modra  <amodra@gmail.com>
2472
2473         PR 21412
2474         * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
2475         parameters and comment.
2476         (_bfd_elf_get_reloc_section): Delete.
2477         (_bfd_elf_plt_get_reloc_section): Declare.
2478         * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
2479         New functions.  Don't blindly skip over assumed .rel/.rela prefix.
2480         Extracted from..
2481         (_bfd_elf_get_reloc_section): ..here.  Delete.
2482         (assign_section_numbers): Call elf_get_reloc_section.
2483         * elf64-ppc.c (elf_backend_get_reloc_section): Define.
2484         * elfxx-target.h (elf_backend_get_reloc_section): Update.
2485
2486 2017-04-23  Alan Modra  <amodra@gmail.com>
2487
2488         PR 21409
2489         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
2490         no symbols.
2491
2492 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2493
2494         PR ld/21402
2495         * elf32-i386.c (elf_i386_link_hash_entry): Add
2496         no_finish_dynamic_symbol.
2497         (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
2498         (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
2499         symbol, don't make it dynamic in PIE.
2500         (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
2501         set no_finish_dynamic_symbol and generate R_386_RELATIVE
2502         relocation for R_386_GOT32
2503         (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
2504         isn't 0.
2505
2506 2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2507
2508         PR ld/19617
2509         PR ld/21086
2510         * elflink.c (elf_link_add_object_symbols): Require
2511         --no-dynamic-linker with -E/--dynamic-list when creating
2512         dynamic sections.
2513
2514 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
2515
2516         * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
2517         if forced local.
2518
2519 2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>
2520
2521         * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
2522         dynamic symbol sorting.
2523
2524 2017-04-20  H.J. Lu  <hongjiu.lu@intel.com>
2525
2526         PR ld/21382
2527         * elflink.c (elf_link_add_object_symbols): Preserve
2528         dynamic_ref_after_ir_def when restoring the symbol table for
2529         unneeded dynamic object.
2530
2531 2017-04-19  H.J. Lu  <hongjiu.lu@intel.com>
2532
2533         PR ld/21401
2534         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
2535         on on undefined IFUNC symbol in the second PLT.
2536
2537 2017-04-19  Wedson Almeida Filho  <wedsonaf@gmail.com>
2538
2539         * peXXigen.c (pe_print_reloc): Correct chunk_end.
2540
2541 2017-04-19  Alan Modra  <amodra@gmail.com>
2542
2543         * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
2544         or make dynamic for info->dynamic_undefined_weak 0 and 1.
2545         * elf32-ppc.c:Formatting.
2546         (ensure_undefweak_dynamic): Don't make dynamic when
2547         info->dynamic_undefined_weak is zero.
2548         (allocate_dynrelocs): Discard undefweak dyn_relocs for
2549         info->dynamic_undefined_weak.  Discard undef dyn_relocs when
2550         not default visibility.  Discard undef and undefweak
2551         dyn_relocs earlier.
2552         (ppc_elf_relocate_section): Adjust to suit.
2553         * elf64-ppc.c: Formatting.
2554         (ensure_undefweak_dynamic): Don't make dynamic when
2555         info->dynamic_undefined_weak is zero.
2556         (allocate_dynrelocs): Discard undefweak dyn_relocs for
2557         info->dynamic_undefined_weak.  Discard them earlier.
2558
2559 2017-04-17  H.J. Lu  <hongjiu.lu@intel.com>
2560
2561         PR ld/21389
2562         * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
2563         before generating the version definition section.
2564
2565 2017-04-17  Alan Modra  <amodra@gmail.com>
2566
2567         * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
2568         state when a regular object file defines a symbol with
2569         incompatible type to that defined by an earlier shared lib.
2570
2571 2017-04-13  Alan Modra  <amodra@gmail.com>
2572
2573         * coffcode.h: Wrap some overly long _bfd_error_handler args.
2574         * elf.c: Likewise.
2575         * elf32-arm.c: Likewise.
2576         * elf32-i386.c: Likewise.
2577         * elf32-mep.c: Likewise.
2578         * elf64-ia64-vms.c: Likewise.
2579         * elf64-x86-64.c: Likewise.
2580         * elflink.c: Likewise.
2581         * elfnn-ia64.c: Likewise.
2582         * elfxx-mips.c: Likewise.
2583
2584 2017-04-13  Alan Modra  <amodra@gmail.com>
2585
2586         * aoutx.h: Use %B and %A in error messages throughout file.
2587         * aout-cris.c: Likewise.
2588         * archive.c: Likewise.
2589         * binary.c: Likewise.
2590         * coff-rs6000.c: Likewise.
2591         * coff-tic4x.c: Likewise.
2592         * coffcode.h: Likewise.
2593         * coffgen.c: Likewise.
2594         * cofflink.c: Likewise.
2595         * coffswap.h: Likewise.
2596         * cpu-arm.c: Likewise.
2597         * elf-eh-frame.c: Likewise.
2598         * elf-m10300.c: Likewise.
2599         * elf.c: Likewise.
2600         * elf32-arc.c: Likewise.
2601         * elf32-arm.c: Likewise.
2602         * elf32-bfin.c: Likewise.
2603         * elf32-frv.c: Likewise.
2604         * elf32-iq2000.c: Likewise.
2605         * elf32-m32c.c: Likewise.
2606         * elf32-microblaze.c: Likewise.
2607         * elf32-nds32.c: Likewise.
2608         * elf32-rl78.c: Likewise.
2609         * elf32-rx.c: Likewise.
2610         * elf32-score.c: Likewise.
2611         * elf32-score7.c: Likewise.
2612         * elf32-sh64.c: Likewise.
2613         * elf32-v850.c: Likewise.
2614         * elf32-vax.c: Likewise.
2615         * elf32-visium.c: Likewise.
2616         * elf64-ia64-vms.c: Likewise.
2617         * elf64-mmix.c: Likewise.
2618         * elf64-sh64.c: Likewise.
2619         * elfcode.h: Likewise.
2620         * elfnn-aarch64.c: Likewise.
2621         * elfnn-ia64.c: Likewise.
2622         * elfxx-mips.c: Likewise.
2623         * hpux-core.c: Likewise.
2624         * ieee.c: Likewise.
2625         * ihex.c: Likewise.
2626         * linker.c: Likewise.
2627         * merge.c: Likewise.
2628         * mmo.c: Likewise.
2629         * oasys.c: Likewise.
2630         * pdp11.c: Likewise.
2631         * peXXigen.c: Likewise.
2632         * rs6000-core.c: Likewise.
2633         * vms-alpha.c: Likewise.
2634         * xcofflink.c: Likewise.
2635
2636 2017-04-13  Alan Modra  <amodra@gmail.com>
2637
2638         * bfd.c (PRINT_TYPE): Define.
2639         (_doprnt): New function.
2640         (error_handler_internal): Use _doprnt.
2641         * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
2642         calls in their natural order, throughout file.
2643         * coff-mcore.c: Likewise.
2644         * coff-ppc.c: Likewise.
2645         * coff-tic80.c: Likewise.
2646         * cofflink.c: Likewise.
2647         * elf-s390-common.c: Likewise.
2648         * elf.c: Likewise.
2649         * elf32-arm.c: Likewise.
2650         * elf32-i386.c: Likewise.
2651         * elf32-m32r.c: Likewise.
2652         * elf32-msp430.c: Likewise.
2653         * elf32-spu.c: Likewise.
2654         * elf64-ia64-vms.c: Likewise.
2655         * elf64-sparc.c: Likewise.
2656         * elf64-x86-64.c: Likewise.
2657         * elflink.c: Likewise.
2658         * elfnn-aarch64.c: Likewise.
2659         * elfnn-ia64.c: Likewise.
2660         * elfxx-mips.c: Likewise.
2661
2662 2017-04-13  Alan Modra  <amodra@gmail.com>
2663
2664         * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
2665         branch veneers" error.  Fix double space and format message.
2666         * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
2667         * elf64-ppc.c (tocsave_find): Supply missing %B arg.
2668
2669 2017-04-13  Alan Modra  <amodra@gmail.com>
2670
2671         * bfd-in2.h: Regenerate.
2672
2673 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2674
2675         * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
2676         extra `\n' in warning/error messages.
2677         * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
2678         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2679
2680 2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>
2681
2682         * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
2683         processor-specific properties with generic ELF target vector.
2684
2685 2017-04-10  Qing Zhao  <qing.zhao@oracle.com>
2686
2687         * elf32-sparc.c (elf_backend_fixup_symbol): New.
2688         * elf64-sparc.c (elf_backend_fixup_symbol): New.
2689         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
2690         (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
2691         has_non_got_reloc.
2692         (link_hash_newfunc): Initialize has_got_reloc and
2693         has_non_got_reloc.
2694         (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
2695         section.
2696         (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
2697         has_non_got_reloc.
2698         (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
2699         has_non_got_reloc.
2700         (_bfd_sparc_elf_fixup_symbol): New function.
2701         (allocate_dynrelocs): Don't allocate space for dynamic
2702         relocations and discard relocations against resolved undefined
2703         weak symbols in executable.  Don't make resolved undefined weak
2704         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
2705         relocation against undefined weak symbols in PIE.
2706         (_bfd_sparc_elf_relocate_section): Don't generate dynamic
2707         relocations against resolved undefined weak symbols in PIE
2708         (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
2709         without ynamic PLT/GOT relocations for resolved undefined weak
2710         symbols.
2711         Don't generate dynamic relocation against resolved undefined
2712         weak symbol in executable.
2713         (pie_finish_undefweak_symbol): New function.
2714         (_bfd_sparc_elf_finish_dynamic_sections): Call
2715         pie_finish_undefweak_symbol on all symbols in PIE.
2716         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
2717         (_bfd_sparc_elf_fixup_symbol): New function.
2718
2719 2017-04-10  Nick Clifton  <nickc@redhat.com>
2720
2721         * config.bfd: Remove ns32k from obsolete list.
2722
2723 2017-04-10  Alan Modra  <amodra@gmail.com>
2724
2725         PR 21287
2726         * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
2727         (special_sections_i): Likewise for .init_array.
2728         (special_sections_p): Likewise for .preinit_array.
2729
2730 2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>
2731
2732         PR ld/19579
2733         PR ld/21306
2734         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
2735         ELF_COMMON_DEF_P for common symbols.
2736         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
2737         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2738         * elflink.c (_bfd_elf_merge_symbol): Revert commits
2739         202ac193bbbecc96a4978d1ac3d17148253f9b01 and
2740         07492f668d2173da7a2bda3707ff0985e0f460b6.
2741
2742 2017-04-07  Pedro Alves  <palves@redhat.com>
2743
2744         * opncls.c (bfd_get_debug_link_info): Rename to...
2745         (bfd_get_debug_link_info_1): ... this.  Change type of second
2746         parameter to void pointer.  Adjust.
2747         (bfd_get_debug_link_info): Reimplement on top of
2748         bfd_get_debug_link_info_1.
2749         (separate_debug_file_exists, separate_alt_debug_file_exists):
2750         Change type of second parameter to void pointer.  Adjust.
2751         (get_func_type, check_func_type): Change type of second parameter
2752         to void pointer.
2753         (find_separate_debug_file): Add 'func_data' parameter.  Pass it to
2754         the callback functions instead of passing the address of a local.
2755         (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
2756         find_separate_debug_file.
2757         (get_alt_debug_link_info_shim): Change type of second parameter to
2758         void pointer.  Adjust.
2759         (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
2760         find_separate_debug_file.
2761         (get_build_id_name, bfd_boolean check_build_id_file): Change type
2762         of second parameter to void pointer.  Adjust.
2763         (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
2764         pointer local to find_separate_debug_file.
2765
2766 2017-04-07  Tristan Gingold  <gingold@gingold-Precision-7510>
2767
2768         * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
2769         external symbols with a definition.
2770         (_bfd_coff_gc_mark_extra_sections): Fix typo.
2771
2772 2017-04-07  Alan Modra  <amodra@gmail.com>
2773
2774         * po/SRC-POTFILES.in: Regenerate.
2775
2776 2017-04-05  Alan Modra  <amodra@gmail.com>
2777
2778         * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
2779         reference counting.
2780
2781 2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>
2782
2783         (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
2784         numbers for DataDirectory entry indicies passed to
2785         add_data_entry().
2786
2787 2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>
2788
2789         * elf.c (get_program_header_size): Add a GNU_MBIND segment for
2790         each GNU_MBIND section and align GNU_MBIND section to page size.
2791         (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
2792         segment for each GNU_MBIND section.
2793         (_bfd_elf_init_private_section_data): Copy sh_info from input
2794         for GNU_MBIND section.
2795
2796 2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>
2797
2798         * elfnn-riscv.c (GP_NAME): Delete.
2799         (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
2800         (_bfd_riscv_relax_lui): Likewise.
2801
2802 2017-04-04  Nick Clifton  <nickc@redhat.com>
2803
2804         PR binutils/21342
2805         * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
2806         dereference.
2807         (bfd_elf_final_link): Only initialize the extended symbol index
2808         section if there are extended symbol tables to list.
2809
2810 2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>
2811
2812         * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
2813         (BFD32_BACKENDS_CFILES): Add elf-properties.c.
2814         * configure.ac (elf): Add elf-properties.lo.
2815         * Makefile.in: Regenerated.
2816         * configure: Likewise.
2817         * elf-bfd.h (elf_property_kind): New.
2818         (elf_property): Likewise.
2819         (elf_property_list): Likewise.
2820         (elf_properties): Likewise.
2821         (_bfd_elf_parse_gnu_properties): Likewise.
2822         (_bfd_elf_get_property): Likewise.
2823         (_bfd_elf_link_setup_gnu_properties): Likewise.
2824         (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
2825         and setup_gnu_properties.
2826         (elf_obj_tdata): Add properties.
2827         * elf-properties.c: New file.
2828         * elf32-i386.c (elf_i386_parse_gnu_properties): New.
2829         (elf_i386_merge_gnu_properties): Likewise.
2830         (elf_backend_parse_gnu_properties): Likewise.
2831         (elf_backend_merge_gnu_properties): Likewise.
2832         * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2833         (elf_x86_64_merge_gnu_properties): Likewise.
2834         (elf_backend_parse_gnu_properties): Likewise.
2835         (elf_backend_merge_gnu_properties): Likewise.
2836         * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
2837         (elf_backend_parse_gnu_properties): Likewise.
2838         (elf_backend_setup_gnu_properties): Likewise.
2839         (elfNN_bed): Add elf_backend_parse_gnu_properties,
2840         elf_backend_merge_gnu_properties and
2841         elf_backend_setup_gnu_properties.
2842
2843 2017-03-30  Pip Cet  <pipcet@gmail.com>
2844
2845         * elf32-wasm32.c: Add relocation code, two relocs.
2846         * reloc.c: Add wasm32 relocations.
2847         * libbfd.h: Regenerate.
2848         * bfd-in2.h: Regenerate.
2849         * bfd/po/bfd.pot: Regenerate.
2850
2851 2017-03-29  Nick Clifton  <nickc@redhat.com>
2852
2853         PR binutils/18025
2854         * coff-bfd.h (struct coff_section_data): Add new fields:
2855         saved_bias and bias.
2856         * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
2857         computed for PE binaries.
2858         * dwarf2.c (scan_unit_for_symbols): Only warn once about each
2859         missing abbrev.
2860
2861 2017-03-28  Hans-Peter Nilsson  <hp@axis.com>
2862
2863         PR ld/16044
2864         * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
2865         to handle a local symbol with a hash-symbol-entry; without PLT.
2866         Add BFD_ASSERT for an incidental case with GOT entry present.
2867         (cris_elf_check_relocs): Increment PLT refcount only if the symbol
2868         isn't forced-or-set local.
2869
2870 2017-03-27  Pip Cet  <pipcet@gmail.com>
2871
2872         * wasm-module.c: New file to support WebAssembly modules.
2873         * wasm-module.h: New file to support WebAssembly modules.
2874         * doc/webassembly.texi: Start documenting wasm-module.c.
2875         * config.bfd: Add wasm_vec.
2876         * targets.c: Likewise.
2877         * configure.ac: Likewise.
2878         * Makefile.am: Add entries for wasm-module.c.
2879         * Makefile.in: Regenerate.
2880         * configure: Regenerate.
2881         * po/SRC-POTFILES.in: Regenerate.
2882
2883 2017-03-27  Pip Cet  <pipcet@gmail.com>
2884
2885         * cpu-wasm32.c: New file to support wasm32 architecture.
2886         * elf32-wasm32.c: New file to support wasm32 architecture.
2887         * Makefile.am: Add wasm32 architecture.
2888         * archures.c: Likewise.
2889         * config.bfd: Likewise.
2890         * configure.ac: Likewise.
2891         * targets.c: Likewise.
2892         * Makefile.in: Regenerate.
2893         * bfd-in2.h: Regenerate.
2894         * configure: Regenerate.
2895         * po/SRC-POTFILES.in: Regenerate.
2896
2897 2017-03-20  Alan Modra  <amodra@gmail.com>
2898
2899         PR 21266
2900         * elf64-ppc.c (compare_symbols): Stabilize sort.
2901
2902 2017-03-18  Alan Modra  <amodra@gmail.com>
2903
2904         * elf64-ppc.c (struct ppc_link_hash_table): Add
2905         local_ifunc_resolver and maybe_local_ifunc_resolver.
2906         (ppc_build_one_stub): Set flags on emitting dynamic
2907         relocation to ifunc.
2908         (ppc64_elf_relocate_section): Likewise.
2909         (ppc64_elf_finish_dynamic_symbol): Likewise.
2910         (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
2911         local dynamic relocs to ifuncs.
2912         * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
2913         local_ifunc_resolver and maybe_local_ifunc_resolver.
2914         (ppc_elf_relocate_section): Set flag on emitting dynamic
2915         relocation to ifuncs.
2916         (ppc_elf_finish_dynamic_symbol): Likewise.
2917         (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
2918         dynamic relocs to ifuncs.
2919
2920 2017-03-13  Nick Clifton  <nickc@redhat.com>
2921
2922         PR binutils/21202
2923         * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
2924         BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
2925         (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
2926         BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
2927         * bfd-in2.h: Regenerate.
2928         * libbfd.h: Regenerate.
2929         * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
2930         names.
2931         (IS_AARCH64_TLSDESC_RELOC): Likewise.
2932         (elfNN_aarch64_howto_table): Likewise.
2933         (aarch64_tls_transition_without_check): Likewise.
2934         (aarch64_reloc_got_type): Likewise.
2935         (elfNN_aarch64_final_link_relocate): Likewise.
2936         (elfNN_aarch64_tls_relax): Likewise.
2937         (elfNN_aarch64_relocate_section): Likewise.
2938         (elfNN_aarch64_gc_sweep_hook): Likewise.
2939         (elfNN_aarch64_check_relocs): Likewise.
2940         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
2941         (_bfd_aarch64_elf_resolve_relocation): Likewise.
2942
2943 2017-03-11  Alan Modra  <amodra@gmail.com>
2944
2945         * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
2946         parameter is in fact used.  Whitespace fixes.
2947         * elf64-ppc.c: Likewise.
2948
2949 2017-03-09  Sam Thursfield  <sam.thursfield@codethink.co.uk>
2950
2951         * rs6000-core.c (CORE_NEW): Simplify macro when
2952         AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
2953
2954 2017-03-07  Alan Modra  <amodra@gmail.com>
2955
2956         PR 21224
2957         PR 20519
2958         * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
2959         dyn_relocs check.
2960
2961 2017-03-05  Alan Modra  <amodra@gmail.com>
2962
2963         * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
2964         * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
2965         (next_cie_fde_offset): New function.
2966         (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
2967         (_bfd_elf_discard_section_eh_frame): Align zero terminator to
2968         four bytes.  Align CIEs to four or eight bytes depending on
2969         per_encoding_aligned8.  Align FDEs according to their encoding.
2970         Pad last FDE to output section alignment.
2971         (_bfd_elf_write_section_eh_frame): Adjust to suit.  Remove
2972         assertion.
2973         * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
2974         (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
2975         (ppc64_elf_finish_dynamic_sections): Adjust to suit.
2976
2977 2017-03-02  Martin Bickel  <binutils@ineranves.de>
2978
2979         PR ld/21212
2980         * elf.c (rewrite_elf_program_header): Do not issue a warning for
2981         empty segments which have a zero filesz, but a non-zero memsz.
2982
2983 2017-03-02  Alan Modra  <amodra@gmail.com>
2984
2985         * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
2986
2987 2017-02-28  Alan Modra  <amodra@gmail.com>
2988
2989         * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
2990         (ppc64_elf_relocate_section): Likewise.
2991
2992 2017-02-28  Alan Modra  <amodra@gmail.com>
2993
2994         PR 20995
2995         * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
2996         rather than elf32_nios2_hash_table or elf_hash_table.
2997         (create_got_section): Likewise.
2998         (nios2_elf32_finish_dynamic_symbol): Likewise.
2999         (nios2_elf32_adjust_dynamic_symbol): Likewise.
3000         (nios2_elf32_size_dynamic_sections): Likewise.
3001         (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3002         vars.  Use htab equivalents directly instead.  Don't create
3003         all dynamic sections on needing just the GOT.  Use a goto
3004         rather than a fall-through with reloc test.  Ensure
3005         htab->dynobj is set when making dynamic sreloc section.
3006         (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3007         equivalent directly instead.  Don't segfault on looking for
3008         .dynamic when dynamic sections have not been created.  Don't
3009         segfault on .got.plt being discarded.
3010         (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3011         Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
3012         fixme and another not so relevant comment.
3013         (nios2_elf_add_symbol_hook): Delete dynobj var.  If not
3014         already set, set hash table dynobj on creating .sbss.
3015
3016 2017-02-28  Alan Modra  <amodra@gmail.com>
3017
3018         * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3019         * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3020         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3021         (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3022         (ppc64_elf_relocate_section): Likewise.
3023         * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3024         (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3025         (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3026         * libbfd.h: Regenerate.
3027         * bfd-in2.h: Regenerate.
3028
3029 2017-02-28  Alan Modra  <amodra@gmail.com>
3030
3031         * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3032         dynamic .data.rel.ro read-only.
3033         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3034         rather than section flags when deciding where copy reloc goes.
3035         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3036         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3037         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3038         * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3039         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3040         * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3041         * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3042         * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3043         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3044         * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3045         * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3046         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3047         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3048         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3049         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3050         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3051         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3052         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3053         * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3054
3055 2017-02-28  Maciej W. Rozycki  <macro@imgtec.com>
3056
3057         * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3058         `jalr $0, $25' instruction encoding.
3059
3060 2017-02-27  Nick Clifton  <nickc@redhat.com>
3061
3062         PR ld/21180
3063         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3064         generating a seg-fault when encountering a symbol that has been
3065         deleted by garbage collection.
3066
3067 2017-02-25  Alan Modra  <amodra@gmail.com>
3068
3069         * elf32-arc.c (struct dynamic_sections): Delete.
3070         (enum dyn_section_types): Delete.
3071         (dyn_section_names): Delete.
3072         (arc_create_dynamic_sections): Delete.
3073         (elf_arc_finish_dynamic_sections): Don't call the above.  Don't
3074         segfault on discarded .rela.plt section.
3075         (elf_arc_size_dynamic_sections): Formatting.  Don't call
3076         arc_create_dynamic_sections.  Don't allocate memory for sections
3077         handled by the generic linker.  Correct code finding relocs in
3078         read-only sections.  Set SEC_EXCLUDE on zero size .got,
3079         .got.plt, and .dynbss sections.  Do set .interp for pies.
3080
3081 2017-02-24  Andrew Waterman  <andrew@sifive.com>
3082
3083         * elfnn-riscv.c (GP_NAME): New macro.
3084         (riscv_global_pointer_value): Use it.
3085         (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3086         output section, consider only that section's alignment.
3087
3088 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
3089
3090         * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3091         * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3092         * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3093         * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3094
3095 2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>
3096
3097         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3098         <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3099         or misaligned.
3100
3101 2017-02-23  Alan Modra  <amodra@gmail.com>
3102
3103         PR 20744
3104         * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3105         16D relocations.
3106         (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3107         (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3108         relocs.
3109
3110 2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>
3111
3112         PR ld/20828
3113         * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3114         processing ahead of the call to `elf_gc_sweep_symbol'.
3115
3116 2017-02-22  Nick Clifton  <nickc@redhat.com>
3117
3118         PR binutils/21193
3119         * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3120         created section 4-byte alignment.
3121
3122 2017-02-22  Alan Modra  <amodra@gmail.com>
3123
3124         * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3125         on .got or .plt output section being discarded by script.
3126         * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
3127         vxworks splt temp.
3128
3129 2017-02-21  Alan Modra  <amodra@gmail.com>
3130
3131         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3132         DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3133
3134 2017-02-20  Alan Modra  <amodra@gmail.com>
3135
3136         PR 21181
3137         * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3138         if DT_RELSZ/DT_RELASZ is zero.
3139
3140 2017-02-17  Nick Clifton  <nickc@redhat.com>
3141
3142         * compress.c (bfd_get_full_section_contents): Remember to reduce
3143         compressed size by the sizeof the compression header when
3144         decompressing the contents.
3145
3146 2017-02-17  Pedro Alves  <palves@redhat.com>
3147
3148         * srec.c (Chunk): Rename to ...
3149         (_bfd_srec_len): ... this.
3150         (S3Forced): Rename to ...
3151         (_bfd_srec_forceS3): ... this.
3152         * objcopy.c: Adjust all references.
3153
3154 2017-02-17  Pedro Alves  <palves@redhat.com>
3155
3156         * archive.c (bsd_write_armap): Rename to ...
3157         (_bfd_bsd_write_armap): ... this.
3158         (coff_write_armap): Rename to ...
3159         (_bfd_coff_write_armap): ... this.
3160         * libbfd-in.h (bsd_write_armap): Rename to ...
3161         (_bfd_bsd_write_armap): ... this.
3162         (coff_write_armap): Rename to ...
3163         (_bfd_coff_write_armap): ... this.
3164         * aout-target.h, aout-tic30.c: Adjust all users.
3165         * libbfd.h: Regenerate.
3166
3167 2017-02-17  Pedro Alves  <palves@redhat.com>
3168
3169         * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
3170         (warn_deprecated): Rename to ...
3171         (_bfd_warn_deprecated): ... this.
3172         * libbfd.c (warn_deprecated): Rename to ...
3173         (_bfd_warn_deprecated): ... this.
3174         * bfd-in2.h: Regenerate.
3175
3176 2017-02-17  Pedro Alves  <palves@redhat.com>
3177
3178         * bfdio.c (real_ftell): Rename to ...
3179         (_bfd_real_ftell): ... this.
3180         (real_fseek): Rename to ...
3181         (_bfd_real_fseek): ... this.
3182         (real_fopen): Rename to ...
3183         (_bfd_real_fopen): ... this.
3184         * libbfd-in.h (real_ftell): Rename to ...
3185         (_bfd_real_ftell): ... this.
3186         (real_fseek): Rename to ...
3187         (_bfd_real_fseek): ... this.
3188         (real_fopen): Rename to ...
3189         (_bfd_real_fopen): ... this.
3190         * cache.c, dwarf2.c, opncls.c: Adjust all callers.
3191         * libbfd.h: Regenerate.
3192
3193 2017-02-17  Pedro Alves  <palves@redhat.com>
3194
3195         * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
3196         * libbfd.c (read_unsigned_leb128): Rename to ...
3197         (_bfd_read_unsigned_leb128): ... this.
3198         (read_signed_leb128): Rename to ...
3199         (_bfd_read_signed_leb128): ... this.
3200         (safe_read_leb128): Rename to ...
3201         (_bfd_safe_read_leb128): ... this.
3202         * libbfd-in.h (read_unsigned_leb128): Rename to ...
3203         (_bfd_read_unsigned_leb128): ... this.
3204         (read_signed_leb128): Rename to ...
3205         (_bfd_read_signed_leb128): ... this.
3206         (safe_read_leb128): Rename to ...
3207         (_bfd_safe_read_leb128): ... this.
3208         * libbfd.h: Renegerate.
3209
3210 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
3211
3212         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
3213         before trying to fine matching file and line information.
3214
3215 2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>
3216
3217         * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
3218         (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
3219         not match current bfd, then reload debug information.  Record bfd
3220         we're loading debug info for in the stash.  If we have debug
3221         informatin in the cache then perform section placement before
3222         returning.
3223
3224 2017-02-16  Alan Modra  <amodra@gmail.com>
3225
3226         PR 21000
3227         * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
3228         * elfxx-target.h (elf_backend_no_page_alias): Define.
3229         (elfNN_bed): Init new field.
3230         * elf.c (assign_file_positions_for_load_sections): If no_page_alias
3231         ensure PT_LOAD segment starts on a new page.
3232         * elf32-hppa.c (elf_backend_no_page_alias): Define.
3233
3234 2017-02-16  Alan Modra  <amodra@gmail.com>
3235
3236         PR 21132
3237         * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
3238         if pic.
3239
3240 2017-02-16  Jiong Wang <jiong.wang@arm.com>
3241
3242         * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
3243         * bfd-in2.h: Regenerated.
3244
3245 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
3246
3247         PR ld/21168
3248         * elf32-i386.c (elf_i386_relocate_section): Allow
3249         "lea foo@GOT, %reg" in PIC.
3250
3251 2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>
3252
3253         PR ld/20244
3254         * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
3255         symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
3256         error against local IFUNC symbol without a base register for
3257         PIC.
3258
3259 2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>
3260
3261         * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
3262         `%P: %H:' with `info->callbacks->einfo'.
3263         (ppc_elf_relocate_section): Likewise.
3264         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
3265         (ppc64_elf_edit_toc): Likewise.
3266         (ppc64_elf_relocate_section): Likewise.
3267
3268 2017-02-14  Alan Modra  <amodra@gmail.com>
3269
3270         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
3271         --gc-keep-exported, and test versioned field of sym rather than
3272         looking for @ in name.
3273
3274 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
3275
3276         * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
3277         __global_pointer$.
3278
3279 2017-02-13  Nick Clifton  <nickc@redhat.com>
3280
3281         PR binutils/21151
3282         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
3283         unit length field.
3284
3285 2017-02-07  Andrew Waterman  <andrew@sifive.com>
3286
3287         * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
3288         entry size if PLT header is written.
3289
3290 2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>
3291
3292         Fix sparc64 dynamic relocation processing to use the dynamic
3293         symbol count.
3294         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
3295         to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
3296         should be used.
3297
3298 2017-02-03  Nick Clifton  <nickc@redhat.com>
3299
3300         PR 21096
3301         * coffcode.h (coff_write_object_contents): Enlarge size of
3302         s_name_buf in order to avoid compile time warning about possible
3303         integer truncation.
3304         * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
3305         32-bits of insn value before printing into buffer.
3306
3307 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
3308
3309         * elfxx-mips.c (mips_elf_hash_sort_data): Add
3310         `max_local_dynindx'.
3311         (mips_elf_sort_hash_table): Handle it.
3312         (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
3313         symbols bump up `max_local_dynindx' rather than
3314         `max_non_got_dynindx'.
3315
3316 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
3317
3318         * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
3319         `min_got_dynindx', `max_unref_got_dynindx' and
3320         `max_non_got_dynindx' members to the `bfd_size_type' data type.
3321         (mips_elf_sort_hash_table): Adjust accordingly.
3322
3323 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
3324
3325         * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
3326         to access the hash table.
3327
3328 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
3329
3330         * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
3331         non-NULL `htab' to the beginning.
3332
3333 2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>
3334
3335         * elflink.c (elf_gc_sweep): Wrap overlong line.
3336
3337 2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>
3338
3339         * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
3340         (_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
3341         * elfxx-mips.c (mips_elf_link_hash_table): Add
3342         `ignore_branch_isa' member.
3343         (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
3344         in branch relocation calculation as an error if
3345         `ignore_branch_isa' has been set.
3346         (_bfd_mips_elf_insn32): Rename to...
3347         (_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
3348         parameter to `insn32' and add an `ignore_branch_isa' parameter.
3349         Handle the new parameter.
3350
3351 2017-01-27  Hans-Peter Nilsson  <hp@axis.com>
3352
3353         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
3354         local variable dynobj.
3355
3356         PR ld/20995
3357         * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
3358         (elf_cris_adjust_dynamic_symbol): Place variables copied into the
3359         executable from read-only sections into sdynrelro.
3360         (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
3361         dynamic relocs in sdynrelro.
3362         (elf_backend_want_dynrelro): Define.
3363
3364 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3365
3366         * config.bfd (*-*-rtemsaout*): Mark as removed.
3367
3368 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3369
3370         * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
3371         (arm-*-rtems*): Move to (arm*-*-eabi*).
3372         (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
3373         (m68-*-rtems*): Move to (m68*-*-elf*).
3374
3375 2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>
3376
3377         * config.bfd (*-*-rtemscoff*): Mark as removed.
3378
3379 2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>
3380
3381         PR ld/20828
3382         * elflink.c (bfd_elf_record_link_assignment): Revert last
3383         change and don't ever clear `forced_local'.  Set `mark'
3384         unconditionally.
3385         (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
3386         file.
3387         (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
3388         (bfd_elf_size_dynamic_sections): ... here.
3389         * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
3390         and set `mark' instead in `__tls_get_addr_opt' processing.
3391         * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
3392
3393 2017-01-24  Alan Modra  <amodra@gmail.com>
3394
3395         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
3396         where dynamic relocs are preferable.  Allow ifunc too.
3397         (ensure_undefweak_dynamic): New function.
3398         (allocate_dynrelocs): Use it here.  Move plt handling last and
3399         don't make symbols dynamic, simplifying loop.  Only make undef
3400         weak symbols with GOT entries dynamic.  Correct condition
3401         for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
3402         comments.  Remove goto.
3403         (ppc_elf_relocate_section): Correct test for using dynamic
3404         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
3405         to suit.  Set up explicit tls_index entries and implicit GOT
3406         tls_index entries resolvable at link time for
3407         __tls_get_addr_opt.  Simplify test to clear mem for prelink.
3408         * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
3409         (ensure_undefweak_dynamic): New function.
3410         (allocate_dynrelocs): Use it here.  Only make undef weak symbols
3411         with GOT entries dynamic.  Remove unnecessary test of
3412         WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
3413         (ppc64_elf_relocate_section): Correct test for using dynamic
3414         symbol on GOT relocs.  Rearrange test for emitting GOT relocs
3415         to suit.  Set up explicit tls_index entries and implicit GOT
3416         tls_index entries resolvable at link time for __tls_get_addr_opt.
3417         Simplify expression to clear mem for prelink.
3418
3419 2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>
3420
3421         * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
3422
3423 2017-01-20  Jiong Wang <jiong.wang@arm.com>
3424
3425         * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
3426         (elf_backend_hash_symbol): Define.
3427
3428 2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>
3429
3430         PR ld/20828
3431         * elflink.c (bfd_elf_record_link_assignment): Clear any
3432         `forced_local' marking for DSO symbols that are not being
3433         provided.
3434
3435 2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3436
3437         * elfnn-riscv.c (riscv_elf_object_p): New function.
3438
3439 2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>
3440
3441         PR ld/21038
3442         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
3443         plt_bnd_eh_frame.
3444         (elf_x86_64_check_relocs): Create .eh_frame section for the
3445         .plt.bnd section.
3446         (elf_x86_64_size_dynamic_sections): Allocate and initialize
3447         .eh_frame section for the .plt.bnd section.
3448         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3449         for the .plt.bnd section.
3450
3451 2017-01-12  Nick Clifton  <nickc@redhat.com>
3452
3453         PR binutils/20876
3454         * opncls.c (find_separate_debug_file): Add include_dirs
3455         parameter.  Only include the directory part of the bfd's filename
3456         in search paths if include_dirs is true.  Add a couple of extra
3457         locations for looking for debug files.
3458         ( bfd_follow_gnu_debuglink): Update invocation of
3459         find_separate_debug_file.
3460         (bfd_follow_gnu_debugaltlink): Likewise.
3461         (get_build_id): New function: Finds the build-id of the given bfd.
3462         (get_build_id_name): New function: Computes the name of the
3463         separate debug info file for a bfd, based upon its build-id.
3464         (check_build_id_file): New function: Checks to see if a separate
3465         debug info file exists at the given location, and that its
3466         build-id matches that of the original bfd.
3467         (bfd_follow_build_id_debuglink): New function: Finds a separate
3468         debug info file for a given bfd by using the build-id method.
3469         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
3470         method of locating a separate debug info file before using the
3471         debuglink method.
3472         * bfd-in2.h: Regenerate.
3473
3474 2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3475
3476         PR ld/21038
3477         * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
3478         (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
3479         elf_x86_64_eh_frame_plt_got.
3480         (elf_x86_64_size_dynamic_sections): Get unwind info from
3481         elf_x86_64_bnd_arch_bed for the BND PLT.
3482
3483 2017-01-11  Jeremy Soller  <jackpot51@gmail.com>
3484
3485         * config.bfd: Add entries for i686-redox and x86_64-redox.
3486
3487 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
3488
3489         * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
3490         to 4 bytes.
3491         * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
3492         .eh_frame section to 4 bytes for x32.
3493         (elf_x86_64_check_relocs): Likewise.
3494
3495 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
3496
3497         PR ld/20830
3498         * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
3499         (PLT_GOT_FDE_LENGTH): Likewise.
3500         (elf_i386_plt_layout): Add eh_frame_plt_got and
3501         eh_frame_plt_got_size.
3502         (elf_i386_plt): Updated.
3503         (elf_i386_link_hash_table): Add plt_got_eh_frame.
3504         (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
3505         (elf_i386_size_dynamic_sections): Allocate and initialize
3506         .eh_frame section for .plt.got.
3507         (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
3508         .plt.got.
3509         (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
3510         eh_frame_plt_got_size.
3511         * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
3512         (PLT_GOT_FDE_LENGTH): Likewise.
3513         (elf_x86_64_backend_data): Add eh_frame_plt_got and
3514         eh_frame_plt_got_size.
3515         (elf_x86_64_arch_bed): Updated.
3516         (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
3517         eh_frame_plt_got_size.
3518         (elf_x86_64_nacl_arch_bed): Likewise.
3519         (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
3520         (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
3521         (elf_x86_64_size_dynamic_sections): Allocate and initialize
3522         .eh_frame section for .plt.got.
3523         (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
3524         for .plt.got.
3525
3526 2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>
3527
3528         * elf32-i386.c (elf_i386_size_dynamic_sections): Set
3529         plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
3530
3531 2017-01-09  Nick Clifton  <nickc@redhat.com>
3532
3533         * dwarf2.c (lookup_address_in_function_table): Return early if
3534         there are no functions in the given comp unit, or if the high
3535         address of the last function in the comp unit is less than the
3536         desired address.
3537
3538 2017-01-09  Nick Clifton  <nickc@redhat.com>
3539
3540         PR binutils/21013
3541         * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
3542         message if there are too many symbols to load.
3543
3544 2017-01-04  James Clarke  <jrtc27@jrtc27.com>
3545
3546         * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
3547         if relocs are cached.
3548
3549 2017-01-03  Rich Felker  <bugdal@aerifal.cx>
3550
3551         PR ld/21017
3552         * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
3553         for R_MICROBLAZE_GOTOFF_64.
3554
3555 2017-01-03  Nick Clifton  <nickc@redhat.com>
3556
3557         * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
3558         warning about using a possibly uninitialised variable.
3559
3560 2017-01-02  Alan Modra  <amodra@gmail.com>
3561
3562         * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
3563         (allocate_plt_static, allocate_dynrelocs): Use it.
3564
3565 2017-01-02  Alan Modra  <amodra@gmail.com>
3566
3567         * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
3568         .PARISC.unwind section.
3569
3570 2017-01-02  Alan Modra  <amodra@gmail.com>
3571
3572         PR ld/20989
3573         * elfxx-sparc.c (gdop_relative_offset_ok): New function.
3574         (_bfd_sparc_elf_relocate_section): Use it to validate GOT
3575         indirect to GOT pointer relative code edit.
3576
3577 2017-01-02  Alan Modra  <amodra@gmail.com>
3578
3579         Update year range in copyright notice of all files.
3580
3581 For older changes see ChangeLog-2016
3582 \f
3583 Copyright (C) 2017 Free Software Foundation, Inc.
3584
3585 Copying and distribution of this file, with or without modification,
3586 are permitted in any medium without royalty provided the copyright
3587 notice and this notice are preserved.
3588
3589 Local Variables:
3590 mode: change-log
3591 left-margin: 8
3592 fill-column: 74
3593 version-control: never
3594 End: