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