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