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