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