Automatic date update in version.in
[external/binutils.git] / bfd / ChangeLog
1 2018-07-04  Joel Brobecker  <brobecker@adacore.com>
2
3         * development.sh (development): Set to false.
4
5 2018-07-04  H.J. Lu  <hongjiu.lu@intel.com>
6
7         * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
8         * Makefile.in: Regenerated.
9
10 2018-07-03  Alan Modra  <amodra@gmail.com>
11
12         * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
13         sections.
14
15 2018-07-03  Alan Modra  <amodra@gmail.com>
16
17         * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
18         * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
19         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
20         ATTR_TYPE_FLAG_INT_VAL.  Set ATTR_TYPE_HAS_ERROR on finding
21         incompatible attribute.
22         (ppc_elf_merge_obj_attributes): Likewise.  Return
23         _bfd_elf_merge_object_attributes result.
24         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
25         _bfd_elf_merge_object_attributes result.
26
27 2018-07-03  Alan Modra  <amodra@gmail.com>
28
29         PR 17550
30         * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
31         in discarded sections.
32
33 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
34
35         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
36         `mark' for symbols created from `mips_elf_dynsym_rtproc_names'
37         list.
38
39 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
40
41         * elf64-mips.c (micromips_elf64_howto_table_rel): Add
42         R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
43         R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
44         R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
45         R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
46         R_MICROMIPS_PC23_S2 relocation entries.
47         (micromips_elf64_howto_table_rela): Likewise.
48         (micromips_reloc_map): Likewise.
49         * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
50         (elf_micromips_howto_table_rela): Likewise.
51         (micromips_reloc_map): Likewise.
52
53 2018-07-02  H.J. Lu  <hongjiu.lu@intel.com>
54
55         PR ld/23324
56         * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
57         R_X86_64_converted_reloc_bit bit.
58
59 2018-07-02  Jeff Muizelaar  <jrmuizel@gmail.com>
60             Tom Tromey  <tom@tromey.com>
61
62         PR 13157
63         PR 21787
64         * mach-o.c (bfd_mach_o_fat_close_and_cleanup): New function.
65         (bfd_mach_o_close_and_cleanup): Redefine.
66         * archive.c (_bfd_unlink_from_archive_parent): New function,
67         extracted from..
68         (_bfd_archive_close_and_cleanup): ..here.
69         (bfd_generic_archive_p): Do not clear archive's format.
70         * libbfd-in.h (_bfd_unlink_from_archive_parent): Declare.
71         * libbfd.h: Regenerate.
72
73 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
74
75         * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
76         bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
77         bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
78         bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
79         * bfd-in2.h: Regenerate.
80         * cpu-arm.c (arch_info_struct): Add entries for above new
81         bfd_mach_arm values.
82         * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
83         bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
84         architectures.  Force assert failure for any new Tag_CPU_arch value.
85
86 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
87
88         * doc/bfdint.texi: Use command-line consistently when used in a
89         compount word.
90         * doc/bfdsumm.texi: Likewise.
91
92 2018-06-29  Maciej W. Rozycki  <macro@mips.com>
93
94         * elfxx-mips.c (allocate_dynrelocs): Remove extraneous symbol
95         visibility check made for undefined weak symbols.
96
97 2018-06-26  Nick Clifton  <nickc@redhat.com>
98
99         * po/uk.po: Updated Ukranian translation.
100
101 2018-06-25  Nick Clifton  <nickc@redhat.com>
102
103         * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
104         for malloc returning NULL.
105         (_bfd_aarch64_erratum_843419_fixup): Check for
106         _bfd_aarch64_erratum_835769_stub_name returning NULL.
107
108 2018-06-24  Nick Clifton  <nickc@redhat.com>
109
110         * po/bfd.pot: Regenerate.
111
112 2018-06-24  Nick Clifton  <nickc@redhat.com>
113
114         * version.m4: Update version string to 2.31.51.
115         * configure: Regenerate.
116
117 2018-06-24  Nick Clifton  <nickc@redhat.com>
118
119         2.31 branch created.
120
121 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
122
123         * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
124         (_bfd_mips_elf_cant_unwind_opcode): Correct formatting.
125
126 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
127
128         * elfxx-mips.c (_bfd_mips_post_process_headers): Keep
129         EI_ABIVERSION setting together.
130
131 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
132
133         * elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
134         (MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
135         (MIPS_LIBC_ABI_MAX): New enumeration constants.
136         (_bfd_mips_post_process_headers): Use them in place of magic
137         numbers.
138
139 2018-06-21  Jim Wilson  <jimw@sifive.com>
140
141         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
142         Use SYMBOL_REFERENCES_LOCAL.  Add asserts for h->got.offset.
143
144 2018-06-21  Alan Modra  <amodra@gmail.com>
145
146         * doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
147         * doc/Makefile.in: Regenerate.
148
149 2018-06-20  Renlin Li  <renlin.li@arm.com>
150
151         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
152         to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
153         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
154         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
155         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
156         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
157         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
158         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
159         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
160
161 2018-06-20  Nick Clifton  <nickc@redhat.com>
162
163         PR 23316
164         * opncls.c (get_build_id): Check for a negative or excessive data
165         size in the build-id note.
166
167 2018-06-20  Nick Clifton  <nickc@redhat.com>
168
169         PR 23299
170         * mach-o.c (cputype): New function.
171         (cpusubtype): New function.
172         (bfd_mach_o_bfd_print_private_data): New function.  Dispalys the
173         values in the MACH-O file header.
174         (bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
175         cpusubtype fields from the input bfd's mach-o header to the output
176         bfd.
177         * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
178         Redefine to bfd_mach_o_bfd_print_private_data.
179         * mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.
180
181 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
182
183         PR ld/22966
184         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
185         `.got.plt' entry referred is in range.
186         (mips_finish_exec_plt): Correct the range check for `.got.plt'
187         start.  Replace the assertion used for that with a proper error
188         message.
189
190 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
191
192         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
193         formatting.
194
195 2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>
196
197         * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
198         (INCLUDES): Rename to ...
199         (AM_CPPFLAGS): ... this.
200         * configure.ac: Remove AC_PREREQ.
201         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
202         info-in-builddir no-texinfo.tex.
203         (info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
204         * doc/bfd.texinfo: Rename to ...
205         * doc/bfd.texi: ... this.
206         * Makefile.in: Re-generate.
207         * aclocal.m4: Re-generate.
208         * config.in: Re-generate.
209         * configure: Re-generate.
210         * doc/Makefile.in: Re-generate.
211
212 2018-06-18  Mephi  <mephi42@gmail.com>
213
214         PR 23297
215         * mach-o-x86-64.c (x86_64_howto_table): Add entry for
216         BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
217         (bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
218         (bfd_mach_o_x86_64_swap_reloc_out): Likewise.
219         * reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
220         * bfd-in2.h: Regenerate.
221         * libbfd.h: Regenerate.
222
223 2018-06-14  Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
224
225         * elfxx-mips.c (print_mips_ases): Add GINV extension.
226
227 2018-06-14  H.J. Lu  <hongjiu.lu@intel.com>
228
229         PR binutils/23267
230         * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
231         symbol version is base version.
232
233 2018-06-14  Alan Modra  <amodra@gmail.com>
234
235         * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
236         * elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
237         (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
238         (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
239         "dynamic_relocs" is not set.
240         * elfxx-mips.c (count_section_dynsyms): Likewise.
241
242 2018-06-14  Alan Modra  <amodra@gmail.com>
243
244         PR 23282
245         * bfdio.c (bfd_seek): Optimize away seeks to current position.
246
247 2018-06-13  Scott Egerton  <scott.egerton@imgtec.com>
248             Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
249
250         * elfxx-mips.c (print_mips_ases): Add CRC.
251
252 2018-06-08  H.J. Lu  <hongjiu.lu@intel.com>
253
254         PR ld/23161
255         * elfxx-x86.c (elf_x86_hide_linker_defined): New function.
256         (_bfd_x86_elf_link_check_relocs): Use it to hide hidden
257         __bss_start, _end and _edata in shared libraries.
258
259 2018-06-07  Alan Modra  <amodra@gmail.com>
260
261         * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
262         __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
263
264 2018-06-05  Alan Modra  <amodra@gmail.com>
265
266         * bfd.c (struct bfd): Update comment on "where" usage.
267         * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec",
268         "iostream", and "where" from containing archive file.  Return
269         error on NULL iovec.
270         (bfd_bread): Similarly, and return error attempted out of
271         bounds archive element access.
272         (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and
273         "where" from containing archive file.
274         (bfd_seek): Likewise.  Return error on NULL iovec.  Don't
275         attempt to optimize away seeks.  Don't paper over errors by
276         calling bfd_tell.
277         (bfd_get_mtime): Call bfd_stat rather than iovec->bstat.
278         (bfd_get_size): Likewise.
279         (bfd_mmap): Operate on and use iovec of containing archive
280         file.  Return error on NULL iovec.
281         * cache.c (bfd_cache_lookup_worker): Abort if working on
282         archive element bfd.
283         (cache_bread_1): Delete bfd parameter, add FILE* parameter.
284         Don't ignore zero byte reads.
285         (cache_bread): Look up FILE* in cache here.  Error on NULL
286         lookup.
287         (cache_bwrite): Rename "where" to "from".
288         (cache_bmmap): Don't handle archive elements.
289         * coffcode.h (coff_slurp_line_table): Exit early on zero
290         lineno count.
291         * bfd-in2.h: Regenerate.
292
293 2018-06-05  Alan Modra  <amodra@gmail.com>
294
295         PR 23254
296         * plugin.c (bfd_plugin_open_input): Allow for possibility of
297         nested archives.  Open file again for plugin.
298         (try_claim): Don't save and restore file position.  Close file
299         if not claimed.
300         * sysdep.h (O_BINARY): Define.
301
302 2018-06-04  Max Filippov  <jcmvbkbc@gmail.com>
303
304         * elf32-xtensa.c (xtensa_read_table_entries): Make global.
305         (compute_fill_extra_space): Drop declaration. Rename function to
306         xtensa_compute_fill_extra_space.
307         (compute_ebb_actions, remove_dead_literal): Update references to
308         compute_fill_extra_space.
309
310 2018-06-04  Volodymyr Arbatov  <arbatov@cadence.com>
311
312         * elf32-xtensa.c (elf32xtensa_separate_props): New global
313         variable.
314         (xtensa_add_names): New function.
315         (xtensa_property_section_name): Add new parameter
316         separate_sections, use it to choose property section name.
317         (xtensa_get_separate_property_section): New function.
318         (xtensa_get_property_section): Invoke
319         xtensa_get_separate_property_section to get individual property
320         section if it exists, common property section otherwise.
321         (xtensa_make_property_section): Pass elf32xtensa_separate_props
322         to xtensa_property_section_name.
323
324 2018-06-04  H.J. Lu  <hongjiu.lu@intel.com>
325
326         PR binutils/23146
327         * bfd-in.h: Include "diagnostics.h".
328         * bfd-in2.h: Regenerated.
329         * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
330         DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
331         DIAGNOSTIC_POP to silence GCC 8.1 warnings with
332         -Wstringop-truncation.
333         * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
334         * elf32-s390.c (elf_s390_write_core_note): Likewse.
335         * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
336         * elf64-s390.c (elf_s390_write_core_note): Likewse.
337         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
338
339 2018-06-03  Jim Wilson  <jimw@sifive.com>
340
341         PR ld/23244
342         * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check
343         for and handle an undefined weak with no PLT.
344
345         PR ld/22756
346         * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check
347         to code that ignores duplicate symbols.
348
349 2018-06-01  H.J. Lu  <hongjiu.lu@intel.com>
350
351         * version.m4: Bump version to 2.30.52
352         * configure: Regenerated.
353
354 2018-06-01  Alan Modra  <amodra@gmail.com>
355
356         * bfd.c (_bfd_error_handler): Arrange for this function to be
357         declared in bfd-in2.h.
358         * libbfd-in.h (_bfd_error_handler): Don't declare.
359         * libbfd.h: Regenerate.
360         * bfd-in2.h: Regenerate.
361
362 2018-05-30  Amaan Cheval <amaan.cheval@gmail.com>
363
364         * config.bfd (x86_64-*-*): Add pei-x86-64 target to x86_64-*-rtems*
365         This is needed to generate UEFI application image files from ELFs.
366
367 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
368
369         * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry,
370         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
371         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
372         plt_tlsdesc_got2_insn_end for TLSDESC entry.
373         (elf_i386_lazy_ibt_plt): Likewise.
374         (elf_i386_nacl_plt): Likewise.
375         * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ...
376         (elf_x86_64_tlsdesc_plt_entry): This.
377         (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry,
378         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
379         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
380         plt_tlsdesc_got2_insn_end for TLSDESC entry.
381         (elf_x86_64_lazy_bnd_plt): Likewise.
382         (elf_x86_64_lazy_ibt_plt): Likewise.
383         (elf_x32_lazy_ibt_plt): Likewise.
384         (elf_x86_64_nacl_plt): Likewise.
385         (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry,
386         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
387         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
388         plt_tlsdesc_got2_insn_end to update TLSDESC entry.
389         * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments.
390         Add plt_tlsdesc_entry, plt_tlsdesc_entry_size,
391         plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset,
392         plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end.
393         (elf_x86_non_lazy_plt_layout): Update comments.
394         (elf_x86_plt_layout): Likewise.
395
396 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
397
398         PR ld/23238
399         * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
400         * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
401         (elf_backend_add_symbol_hook): Likewise.
402         * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
403         (elf_backend_add_symbol_hook): Likewise.
404         * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
405         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
406         (elf_backend_add_symbol_hook): Likewise.
407         * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
408         * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
409         * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
410         (elf_backend_add_symbol_hook): Likewise.
411         * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
412         handling.
413         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
414         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
415         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
416         * elflink.c (elf_link_add_object_symbols): Set
417         elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
418
419 2018-05-26  H.J. Lu  <hongjiu.lu@intel.com>
420
421         PR ld/23194
422         * elf-bfd.h (_bfd_elf_link_hide_sym_by_version): New.
423         * elflink.c (_bfd_elf_link_hide_versioned_symbol): New function.
424         Extracted from _bfd_elf_link_assign_sym_version.
425         (_bfd_elf_link_hide_sym_by_version): New function.
426         (_bfd_elf_link_assign_sym_version): Use
427         _bfd_elf_link_hide_versioned_symbol.
428         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Call
429         _bfd_elf_link_hide_sym_by_version instead of
430         bfd_hide_sym_by_version.  Don't check unversioned symbol.
431
432 2018-05-25  Alan Modra  <amodra@gmail.com>
433
434         * Makefile.in: Regenerate.
435         * po/SRC-POTFILES.in: Regenerate.
436
437 2018-05-25  Alan Modra  <amodra@gmail.com>
438
439         * configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
440         * configure: Regenerate.
441
442 2018-05-23  H.J. Lu  <hongjiu.lu@intel.com>
443
444         * elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING
445         to data.
446
447 2018-05-22  Alan Modra  <amodra@gmail.com>
448
449         PR 23207
450         * elf32-hppa.c (hppa_get_stub_entry): Return NULL when link_sec
451         is NULL.
452         (elf32_hppa_size_stubs): Only create stubs for load, alloc, code
453         sections.
454         (final_link_relocate): Revert last change.
455
456 2018-05-22  Alan Modra  <amodra@gmail.com>
457
458         PR 23207
459         * elf32-hppa.c (final_link_relocate): Don't look for plt call
460         stubs in non-alloc sections.
461
462 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
463
464         PR ld/23201
465         * aout-target.h (MY_bfd_link_hide_symbol): New.
466         * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise.
467         * binary.c (binary_bfd_link_hide_symbol): Likewise.
468         * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
469         * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
470         * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise.
471         * coffcode.h (coff_bfd_link_hide_symbol): Likewise.
472         * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise.
473         * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise.
474         * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise.
475         * ihex.c (ihex_bfd_link_hide_symbol): Likewise.
476         * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise.
477         * linker.c (_bfd_generic_link_hide_symbol): Likewise.
478         (bfd_link_hide_symbol): Likewise.
479         * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise.
480         * mmo.c (mmo_bfd_link_hide_symbol): Likewise.
481         * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise.
482         * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise.
483         * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise.
484         * som.c (som_bfd_link_hide_symbol): Likewise.
485         * srec.c (srec_bfd_link_hide_symbol): Likewise.
486         * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise.
487         * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise.
488         (alpha_vms_bfd_link_hide_symbol): Likewise.
489         * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise.
490         * coff64-rs6000.c (rs6000_xcoff64_vec): Add
491         _bfd_generic_link_hide_symbol.
492         (rs6000_xcoff64_aix_vec): Likewise.
493         * elflink.c (bfd_elf_record_link_assignment): Don't make forced
494         local symbol dynamic.
495         (_bfd_elf_link_hide_symbol): New function.
496         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
497         check root.ldscript_def.
498         * targets.c (bfd_target): Add _bfd_link_hide_symbol.
499         (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol.
500         * bfd-in2.h: Regenerated.
501         * libbfd.h: Likewise.
502
503 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
504
505         PR binutils/23199
506         * elf.c (setup_group): Mark section in a section group with
507         SHF_GROUP.
508
509 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
510
511         PR ld/23194
512         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
513         set eh->local_ref to 1 if a symbol is versioned and there is a
514         version script.
515
516 2018-05-18  Kito Cheng  <kito.cheng@gmail.com>
517
518         * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
519         EF_RISCV_RVE.
520
521 2018-05-18  Jim Wilson  <jimw@sifive.com>
522
523         * elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
524         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
525         (riscv_elf_relocate_section): Don't generate dynamic relocation if
526         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
527         (riscv_elf_finish_dynamic_symbol): Likewise.
528
529 2018-05-18  John Darrington  <john@darrington.wattle.id.au>
530
531         * Makefile.am: Add s12z files.
532         * Makefile.in: Regenerate.
533         * archures.c: Add bfd_s12z_arch.
534         * bfd-in.h: Add exports of bfd_putb24 and bfd_putl24.
535         * bfd-in2.h: Regenerate.
536         * config.bfd: Add s12z target.
537         * configure.ac: Add s12z target.
538         * configure: Regenerate.
539         * cpu-s12z.c: New file.
540         * elf32-s12z.c: New file.
541         * libbfd.c (bfd_putb24): New function.
542         (bfd_putl24): New function.
543         * libbfd.h: Regenerate.
544         * reloc.c: Add s12z relocations.
545         (bfd_get_reloc_size): Handle size 5 relocs.
546         * targets.c: Add s12z_elf32_vec.
547
548 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
549
550         PR ld/23189
551         * elf32-i386.c (elf_i386_relocate_section): Handle R_386_GOT32X
552         like R_386_GOT32.
553         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
554         set eh->local_ref to 1 for linker defined symbols.
555
556 2018-05-18  Alan Modra  <amodra@gmail.com>
557
558         PR 23199
559         * elf.c (setup_group): Formatting.  Check that SHT_GROUP entries
560         don't point at other SHT_GROUP sections.  Set shdr corresponding
561         to invalid entry, to NULL rather than section 0.  Identify
562         SHT_GROUP section index when reporting an error.  Cope with NULL
563         shdr pointer.
564
565 2018-05-18  Alan Modra  <amodra@gmail.com>
566
567         * libbfd-in.h (ATTRIBUTE_HIDDEN): Define and use throughout.
568         * configure.ac (HAVE_HIDDEN): Check compiler support for hidden
569         visibility.
570         * libbfd.h: Regenerate.
571         * configure: Regenerate.
572         * config.in: Regenerate.
573
574 2018-05-18  Alan Modra  <amodra@gmail.com>
575
576         * libbfd-in.h: Add include guard.
577         * libcoff-in.h: Likewise.
578         * doc/Makefile.am (libbfd.h, libcoff.h): Append another #endif.
579         * doc/Makefile.in: Regenerate.
580         * libbfd.h: Regenerate.
581         * libcoff.h: Regenerate.
582
583 2018-05-16  Maciej W. Rozycki  <macro@mips.com>
584
585         * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
586
587 2018-05-16  Alan Modra  <amodra@gmail.com>
588
589         PR 22458
590         * format.c (struct bfd_preserve): Add section_id.
591         (bfd_preserve_save, bfd_preserve_restore): Save and restore
592         _bfd_section_id.
593         (bfd_reinit): Set _bfd_section_id.
594         (bfd_check_format_matches): Put all matches of any priority into
595         matching_vector.  Save initial section id and start each attempted
596         match at that section id.
597         * libbfd-in.h (_bfd_section_id): Declare.
598         * section.c (_bfd_section_id): Rename from section_id and make
599         global.  Adjust uses.
600         (bfd_get_next_section_id): Delete.
601         * elf64-ppc.c (ppc64_elf_setup_section_lists): Replace use of
602         bfd_get_section_id with _bfd_section_id.
603         * libbfd.h: Regenerate.
604         * bfd-in2.h: Regenerate.
605
606 2018-05-15  Christophe Guillon  <christophe.guillon@st.com>
607
608         * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields
609         of the aux structure are initialised.
610
611 2018-05-15  Francois H. Theron  <francois.theron@netronome.com>
612
613         * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef.
614
615 2018-05-15  Nick Clifton  <nickc@redhat.com>
616
617         * po/pt.po: New Portuguese translation.
618         * configure.ac (ALL_LINGUAS): Add pt.
619         * configure: Regenerate.
620
621 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
622
623         PR ld/23169
624         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
625         an error on IFUNC pointer defined in PDE.
626         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
627         _bfd_x86_elf_link_fixup_ifunc_symbol.
628         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
629         * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
630         function.
631         * elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
632
633 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
634
635         PR ld/23162
636         * elfxx-x86.c (elf_x86_linker_defined): New function.
637         (_bfd_x86_elf_link_check_relocs): Use it to mark __bss_start,
638         _end and _edata locally defined within executables.
639
640 2018-05-12  Alan Modra  <amodra@gmail.com>
641
642         PR 20659
643         * elf.c (rewrite_elf_program_header): Use segment_mark only for
644         PT_LOAD headers.  Delete first_matching_lma and first_suggested_lma.
645         Instead make matching_lma and suggested_lma pointers to the
646         sections.  Align section vma and lma calculated from segment.
647         Don't clear includes_phdrs or includes_filehdr based on p_paddr
648         test.  Try to handle alignment padding before first section by
649         adjusting new segment lma down.  Adjust PT_PHDR map p_paddr.
650
651 2018-05-09  Dimitar Dimitrov  <dimitar@dinux.eu>
652
653         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Make LDI32 relocation
654         conformant to TI ABI.
655         (pru_elf32_relax_section): Likewise.
656         (pru_elf_relax_delete_bytes): Fix offsets for new LDI32 code.
657         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Ignore addend.
658         (pru_elf32_pmem_relocate): Trap - should not get here.
659         (pru_elf32_relocate_section): Add support for REL relocations.
660         (elf_info_to_howto_rel): Enable REL.
661         (elf_backend_may_use_rel_p): Likewise.
662         (elf_backend_may_use_rela_p): Likewise.
663         (elf_backend_default_use_rela_p): Likewise.
664
665 2018-05-09  Alan Modra  <amodra@gmail.com>
666
667         PR 23148
668         * peXXigen.c (pe_print_edata): Correct minimum size.
669
670 2018-05-09  Alan Modra  <amodra@gmail.com>
671
672         PR 23147
673         * peXXigen.c (pe_print_idata): Bound check hint_addr.
674
675 2018-05-08  Nick Clifton  <nickc@redhat.com>
676
677         PR 22809
678         * elf.c (bfd_elf_get_str_section): Check for an excessively large
679         string section.
680         * elf-attrs.c (_bfd_elf_parse_attributes): Issue an error if the
681         attribute section is larger than the size of the file.
682
683 2018-05-07  Alan Modra  <amodra@gmail.com>
684
685         * cofflink.c (_bfd_coff_link_input_bfd): Use memcmp rather than
686         strncmp when checking for ".bf" special symbol.
687         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Make pe_required_section_flags
688         section name a char array, remove sentinal known_sections entry,
689         and adjust loop over known_sections to suit.  Use memcmp rather
690         than strncmp.
691
692 2018-05-04  Alan Modra  <amodra@gmail.com>
693
694         * elf-linux-core.h (struct elf_external_linux_prpsinfo32_ugid32),
695         (struct elf_external_linux_prpsinfo32_ugid16),
696         (struct elf_external_linux_prpsinfo64_ugid32),
697         (struct elf_external_linux_prpsinfo64_ugid16): Add ATTRIBUTE_NONSTRING
698         to pr_fname and pr_psargs fields.  Remove GCC diagnostic pragmas.
699         Move comment to..
700         * elf.c (elfcore_write_prpsinfo): ..here.  Indent nested preprocessor
701         directives.
702         * elf32-arm.c (elf32_arm_nabi_write_core_note): Add ATTRIBUTE_NONSTRING
703         to data.
704         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
705         * elf32-s390.c (elf_s390_write_core_note): Likewise.
706         * elf64-s390.c (elf_s390_write_core_note): Likewise.
707         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
708         * elf64-x86-64.c (elf_x86_64_write_core_note): Add GCC diagnostic
709         pragmas.
710         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Use strnlen to avoid
711         false positive gcc-8 warning.
712         * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
713
714 2018-05-04  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
715
716         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Fix the order
717         of arguments when warning about different long double types.
718
719 2018-05-03  Simon Atanasyan  <simon@atanasyan.com>
720
721         * elf32-mips.c: (elf32_mips_fixup_symbol): New function.
722         (elf_backend_fixup_symbol): New macro.
723         * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp
724         handling.
725         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
726
727 2018-04-30  Francois H. Theron <francois.theron@netronome.com>
728
729         * Makefile.am: Added NFP files to build.
730         * archures.c: Added bfd_arch_nfp
731         * config.bfd: Added NFP support.
732         * configure.ac: Added NFP support.
733         * cpu-nfp.c: New, for NFP support.
734         * elf-bfd.h: Added elf_section_info()
735         * elf64-nfp.c: New, for NFP support.
736         * po/SRC-POTFILES.in: Added NFP source files.
737         * targets.c: Added nfp_elf64_vec
738         * bfd-in2.h: Regenerate.
739         * Makefile.in: Regenerate.
740         * configure: Regenerate.
741
742 2018-04-27  Alan Modra  <amodra@gmail.com>
743
744         * bfd-in2.h: Regenerate.
745         * libbfd.h: Regenerate.
746
747 2018-04-27  Alan Modra  <amodra@gmail.com>
748
749         PR 23123
750         PR 22374
751         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
752         relocs for ifuncs.
753         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
754
755 2018-04-26  Pedro Alves  <palves@redhat.com>
756
757         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
758         ifunc and non-ifunc symbols duplicates.
759
760 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
761         Mickaël Guêné  <mickael.guene@st.com>
762
763         * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New.
764         (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case.
765         (elf32_arm_populate_plt_entry): Likewise.
766         (elf32_arm_output_plt_map_1): Likewise.
767         (elf32_arm_output_arch_local_syms): Likewise.
768
769 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
770         Mickaël Guêné  <mickael.guene@st.com>
771
772         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle
773         _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
774
775 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
776         Mickaël Guêné  <mickael.guene@st.com>
777
778         * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
779         for R_ARM_TARGET2.
780
781 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
782         Mickaël Guêné  <mickael.guene@st.com>
783
784         * elf32-arm.c (DEFAULT_STACK_SIZE): New.
785         (elf32_arm_always_size_sections): Create stack segment.
786
787 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
788         Mickaël Guêné  <mickael.guene@st.com>
789
790         * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC)
791         (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New
792         relocations.
793         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC,
794         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations.
795         (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC,
796         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC.
797         (struct elf32_arm_link_hash_table): Update comment.
798         (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations.
799         (IS_ARM_TLS_RELOC): Likewise.
800         (elf32_arm_check_relocs): Likewise.
801         (allocate_dynrelocs_for_symbol): Likewise.
802         (elf32_arm_size_dynamic_sections): Update comment.
803         * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC,
804         BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC.
805
806 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
807         Mickaël Guêné  <mickael.guene@st.com>
808
809         * elf32-arm.c (elf32_arm_fdpic_plt_entry): New.
810         (elf32_arm_create_dynamic_sections): Handle FDPIC.
811         (elf32_arm_allocate_plt_entry): Likewise.
812         (elf32_arm_populate_plt_entry): Likewise.
813         (elf32_arm_output_plt_map_1): Likewise.
814
815 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
816         Mickaël Guêné  <mickael.guene@st.com>
817
818         * elf32-arm.c (struct fdpic_local): New.
819         (elf_arm_obj_tdata): Add local_fdpic_cnts field.
820         (elf32_arm_local_fdpic_cnts): New.
821         (struct fdpic_global): New.
822         (elf32_arm_link_hash_entry): Add fdpic_cnts field.
823         (elf32_arm_link_hash_table): Add srofixup field.
824         (arm_elf_add_rofixup): New.
825         (arm_elf_fill_funcdesc): New.
826         (elf32_arm_link_hash_newfunc): Handle fdpic_cnts.
827         (elf32_arm_allocate_local_sym_info): Likewise.
828         (create_got_section): Create .rofixup section.
829         (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts.
830         (bfd_elf32_arm_set_target_params): Handle FDPIC.
831         (elf32_arm_final_link_relocate): Likewise.
832         (elf32_arm_check_relocs): Likewise.
833         (allocate_dynrelocs_for_symbol): Likewise.
834         (elf32_arm_size_dynamic_sections): Likewise.
835         (elf32_arm_finish_dynamic_sections): Likewise.
836         (elf32_arm_output_arch_local_syms): Likewise.
837         (elf32_arm_fdpic_omit_section_dynsym): New.
838
839 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
840         Mickaël Guêné  <mickael.guene@st.com>
841
842         * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC)
843         (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC)
844         (BFD_RELOC_ARM_FUNCDESC_VALUE): New.
845         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC,
846         R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE.
847         (elf32_arm_howto_from_type): Take new members of
848         elf32_arm_howto_table_2 into account.
849         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC,
850         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
851         BFD_RELOC_ARM_FUNCDESC_VALUE.
852         * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC,
853         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
854         BFD_RELOC_ARM_FUNCDESC_VALUE.
855
856 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
857         Mickaël Guêné  <mickael.guene@st.com>
858
859         * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
860         EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
861         (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
862         (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
863
864 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
865         Mickaël Guêné  <mickael.guene@st.com>
866
867         * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
868         arm_elf32_fdpic_le_vec to targ_selvecs. Accept
869         arm*-*-uclinuxfdpiceabi.
870         * configure.ac: Add support for arm_elf32_fdpic_be_vec and
871         arm_elf32_fdpic_le_vec.
872         * configure: Regenerate.
873         * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p.
874         (elf32_arm_link_hash_table_create): Initialize fdpic_p.
875         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM)
876         (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets.
877         (elf32_arm_fdpic_link_hash_table_create): New.
878         * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and
879         arm_elf32_fdpic_le_vec.
880
881 2018-04-25  Alan Modra  <amodra@gmail.com>
882
883         * elf-linux-core.h: Disable gcc-8 string truncation warning.
884         * elf.c (elfcore_write_prpsinfo): Likewise.
885
886 2018-04-25  Alan Modra  <amodra@gmail.com>
887
888         * Makefile.am: Remove arm-aout and arm-coff support.
889         * config.bfd: Likewise.
890         * configure.ac: Likewise.
891         * targets.c: Likewise.
892         * aout-arm.c: Delete.
893         * armnetbsd.c: Delete.
894         * riscix.c: Delete.
895         * Makefile.in: Regenerate.
896         * configure: Regenerate.
897         * po/SRC-POTFILES.in: Regenerate.
898
899 2018-04-24  Nick Clifton  <nickc@redhat.com>
900
901         PR 23113
902         * elf.c (ignore_section_sym): Check for the output_section pointer
903         being NULL before dereferencing it.
904
905         PR 23110
906         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for
907         a negative PE_DEBUG_DATA size before iterating over the debug data.
908
909 2018-04-23  Alan Modra  <amodra@gmail.com>
910
911         * elf-linux-core.h: Revert last change.
912         * elf.c: Likewise.
913
914 2018-04-23  Nick Clifton  <nickc@redhat.com>
915
916         PR 23056
917         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
918         the end of the string table, and zero it.
919
920 2018-04-23  Alan Modra  <amodra@gmail.com>
921
922         * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable
923         gcc-8 string truncation warning.
924         (swap_linux_prpsinfo32_ugid16_out): Likewise.
925         (swap_linux_prpsinfo64_ugid32_out): Likewise.
926         (swap_linux_prpsinfo64_ugid16_out): Likewise.
927         * elf.c (elfcore_write_prpsinfo): Likewise.
928
929 2018-04-23  Nick Clifton  <nickc@redhat.com>
930
931         PR 23056
932         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
933         the end of the string table, and zero it.
934
935 2018-04-20  Alan Modra  <amodra@gmail.com>
936
937         PR 22978
938         * elf32-hppa.c (got_relocs_needed): Add extra param to special
939         case both dtprel and tprel relocs.
940         (allocate_dynrelocs): Adjust conditions for got relocs.
941         (elf32_hppa_relocate_section): Likewise for local sym got relocs.
942         Emit dynamic relocs on TLS GOT entries for shared libraries,
943         not when pic.  Omit dynamic reloc on dtprel entry when local,
944         and on tprel entry when local and executable.
945
946 2018-04-19  Alan Modra  <amodra@gmail.com>
947
948         PR 22537
949         * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
950         (hppa_type_of_stub): Don't return a long branch stub for
951         symbols other than those defined statically.
952
953 2018-04-19  Alan Modra  <amodra@gmail.com>
954
955         * Makefile.am: Revert 2018-04-18 coff-mips changes.
956         * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec
957         to selvecs for mips targets change 2018-04-18.
958         * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec
959         and  mips_ecoff_bele_vec.
960         * targets.c: Likewise.
961         * coff-mips.c: Resurrect.
962         * Makefile.in: Regenerate.
963         * configure: Regenerate.
964         * po/SRC-POTFILES.in: Regenerate.
965
966 2018-04-18  Alan Modra  <amodra@gmail.com>
967
968         * Makefile.am: Remove mips aout and coff support.
969         * config.bfd: Likewise.
970         * configure.ac: Likewise.
971         * targets.c: Likewise.
972         * coff-mips.c: Delete
973         * mipsbsd.c: Delete
974         * pe-mips.c: Delete
975         * pei-mips.c: Delete
976         * Makefile.in: Regenerate.
977         * configure: Regenerate.
978         * po/SRC-POTFILES.in: Regenerate.
979
980 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
981
982         * elf32-i386.c (elf32_bed): Define before including
983         "elf32-target.h".
984         * elf64-x86-64.c (elf64_bed): Define before including
985         "elf64-target.h".
986         (elf32_bed): Define before including "elf32-target.h".
987
988 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
989
990         PR ld/23055
991         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
992         normal input file with compatible relocation.
993
994 2018-04-18  Alan Modra  <amodra@gmail.com>
995
996         * Makefile.am: Remove support for assorted i386 aout and coff targets.
997         * config.bfd: Likewise.
998         * configure.ac: Likewise.
999         * doc/bfdint.texi: Likewise.
1000         * targets.c: Likewise.
1001         * freebsd.h: Delete.
1002         * i386dynix.c: Delete.
1003         * i386freebsd.c: Delete.
1004         * i386linux.c: Delete.
1005         * i386mach3.c: Delete.
1006         * i386netbsd.c: Delete.
1007         * i386os9k.c: Delete.
1008         * Makefile.in: Regenerate.
1009         * configure: Regenerate.
1010         * po/SRC-POTFILES.in: Regenerate.
1011
1012 2018-04-17 Andrew Sadek  <andrew.sadek.se@gmail.com>
1013
1014         Microblaze Target: PIC data text relative
1015
1016         * bfd/reloc.c (2 new BFD relocations):
1017         BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
1018         BFD_RELOC_MICROBLAZE_64_TEXTPCREL
1019         * bfd/bfd-in2.h: Regenerate
1020         * bfd/libbfd.h: Regenerate
1021         * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3
1022         new relocs and handle them in both relocate and relax functions.
1023         (microblaze_elf_reloc_type_lookup): add mapping between for new
1024         bfd relocs.
1025         (microblaze_elf_relocate_section): Handle new relocs in case of
1026         elf relocation.
1027         (microblaze_elf_relax_section): Handle new relocs for elf relaxation.
1028
1029 2018-04-17  Nick Clifton  <nickc@redhat.com>
1030
1031         PR 23055
1032         * aoutx.h (find_nearest_line): Check that the symbol name exists
1033         and is long enough, before attempting to see if it is for a .o
1034         file.
1035         * hash.c (bfd_hash_hash): Add an assertion that the string is not
1036         NULL.
1037         * linker.c (bfd_link_hash_lookup): Fail if the table or string are
1038         NULL.
1039         (_bfd_generic_link_add_archive_symbols): Fail if an archive entry
1040         has no name.
1041
1042         PR 23065
1043         * dwarf2.c (concat_filename): Check for a NULL table pointer.
1044
1045 2018-04-16  Nick Clifton  <nickc@redhat.com>
1046
1047         PR 23061
1048         * coffgen.c (coff_pointerize_aux): Check for an out of range
1049         fixup.
1050
1051 2018-04-16  Alan Modra  <amodra@gmail.com>
1052
1053         * Makefile.am: Remove arm-epoc-pe support.
1054         * coff-arm.c: Likewise.
1055         * config.bfd: Likewise.
1056         * configure.ac: Likewise.
1057         * targets.c: Likewise.
1058         * epoc-pe-arm.c: Delete.
1059         * epoc-pei-arm.c: Delete.
1060         * Makefile.in: Regenerate.
1061         * configure: Regenerate.
1062         * po/SRC-POTFILES.in: Regenerate.
1063
1064 2018-04-16  Alan Modra  <amodra@gmail.com>
1065
1066         * Makefile.am: Remove sparc-aout and sparc-coff support.
1067         * config.bfd: Likewise.
1068         * configure.ac: Likewise.
1069         * targets.c: Likewise.
1070         * aout-sparcle.c: Delete.
1071         * aoutf1.h: Delete.
1072         * cf-sparclynx.c: Delete.
1073         * coff-sparc.c: Delete.
1074         * demo64.c: Delete.
1075         * sparclinux.c: Delete.
1076         * sparclynx.c: Delete.
1077         * sparcnetbsd.c: Delete.
1078         * sunos.c: Delete.
1079         * Makefile.in: Regenerate.
1080         * configure: Regenerate.
1081         * po/SRC-POTFILES.in: Regenerate.
1082
1083 2018-04-16  Alan Modra  <amodra@gmail.com>
1084
1085         * Makefile.am: Remove m68k-aout and m68k-coff support.
1086         * aoutf1.h: Likewise.
1087         * aoutx.h: Likewise.
1088         * archive.c: Likewise.
1089         * bfd-in.h: Likewise.
1090         * bfd.c: Likewise.
1091         * coffcode.h: Likewise.
1092         * coffswap.h: Likewise.
1093         * config.bfd: Likewise.
1094         * configure.ac: Likewise.
1095         * configure.host: Likewise.
1096         * doc/bfd.texinfo: Likewise.
1097         * doc/bfdint.texi: Likewise.
1098         * freebsd.h: Likewise.
1099         * gen-aout.c: Likewise.
1100         * hpux-core.c: Likewise.
1101         * libaout.h: Likewise.
1102         * libbfd-in.h: Likewise.
1103         * pdp11.c: Likewise.
1104         * peicode.h: Likewise.
1105         * riscix.c: Likewise.
1106         * targets.c: Likewise.
1107         * aout0.c: Delete.
1108         * coff-apollo.c: Delete.
1109         * coff-aux.c: Delete.
1110         * coff-m68k.c: Delete.
1111         * coff-svm68k.c: Delete.
1112         * coff-u68k.c: Delete.
1113         * hosts/delta68.h: Delete.
1114         * hosts/hp300bsd.h: Delete.
1115         * hosts/m68kaux.h: Delete.
1116         * hosts/news.h: Delete.
1117         * hp300bsd.c: Delete.
1118         * hp300hpux.c: Delete.
1119         * liboasys.h: Delete.
1120         * m68k4knetbsd.c: Delete.
1121         * m68klinux.c: Delete.
1122         * m68knetbsd.c: Delete.
1123         * oasys.c: Delete.
1124         * versados.c: Delete.
1125         * Makefile.in: Regenerate.
1126         * bfd-in2.h: Regenerate.
1127         * configure: Regenerate.
1128         * libbfd.h: Regenerate.
1129         * po/SRC-POTFILES.in: Regenerate.
1130
1131 2018-04-16  Alan Modra  <amodra@gmail.com>
1132
1133         * Makefile.am: Remove sh5 and sh64 support.
1134         * archures.c: Likewise.
1135         * config.bfd: Likewise.
1136         * configure.ac: Likewise.
1137         * cpu-sh.c: Likewise.
1138         * elf32-sh-relocs.h: Likewise.
1139         * elf32-sh.c: Likewise.
1140         * targets.c: Likewise.
1141         * elf32-sh64-com.c: Delete.
1142         * elf32-sh64.c: Delete.
1143         * elf32-sh64.h: Delete.
1144         * elf64-sh64.c: Delete.
1145         * Makefile.in: Regenerate.
1146         * bfd-in2.h: Regenerate.
1147         * configure: Regenerate.
1148         * po/SRC-POTFILES.in: Regenerate.
1149
1150 2018-04-16  Alan Modra  <amodra@gmail.com>
1151
1152         * Makefile.am: Remove sh-symbianelf support.
1153         * config.bfd: Likewise.
1154         * configure.ac: Likewise.
1155         * targets.c: Likewise.
1156         * elf32-sh-symbian.c: Delete.
1157         * Makefile.in: Regenerate.
1158         * configure: Regenerate.
1159         * po/SRC-POTFILES.in: Regenerate.
1160
1161 2018-04-16  Alan Modra  <amodra@gmail.com>
1162
1163         * Makefile.am: Remove vax-bsd and vax-ultrix support.
1164         * config.bfd: Likewise.
1165         * configure.ac: Likewise.
1166         * targets.c: Likewise.
1167         * vaxbsd.c: Delete.
1168         * Makefile.in: Regenerate.
1169         * configure: Regenerate.
1170         * po/SRC-POTFILES.in: Regenerate.
1171
1172 2018-04-16  Alan Modra  <amodra@gmail.com>
1173
1174         * Makefile.am: Remove w65 support.
1175         * archures.c: Likewise.
1176         * coffcode.h: Likewise.
1177         * config.bfd: Likewise.
1178         * configure.ac: Likewise.
1179         * targets.c: Likewise.
1180         * coff-w65.c: Delete.
1181         * cpu-w65.c: Delete.
1182         * Makefile.in: Regenerate.
1183         * bfd-in2.h: Regenerate.
1184         * configure: Regenerate.
1185         * po/SRC-POTFILES.in: Regenerate.
1186
1187 2018-04-16  Alan Modra  <amodra@gmail.com>
1188
1189         * Makefile.am: Remove we32k support.
1190         * archures.c: Likewise.
1191         * coffcode.h: Likewise.
1192         * config.bfd: Likewise.
1193         * configure.ac: Likewise.
1194         * targets.c: Likewise.
1195         * coff-we32k.c: Delete.
1196         * cpu-we32k.c: Delete.
1197         * Makefile.in: Regenerate.
1198         * bfd-in2.h: Regenerate.
1199         * configure: Regenerate.
1200         * po/SRC-POTFILES.in: Regenerate.
1201
1202 2018-04-16  Alan Modra  <amodra@gmail.com>
1203
1204         * Makefile.am: Remove m88k support.
1205         * aoutx.h: Likewise.
1206         * archures.c: Likewise.
1207         * coffcode.h: Likewise.
1208         * coffswap.h: Likewise.
1209         * config.bfd: Likewise.
1210         * configure.ac: Likewise.
1211         * cpu-ns32k.c: Likewise.
1212         * elf32-nds32.c: Likewise.
1213         * mach-o.c: Likewise.
1214         * netbsd-core.c: Likewise.
1215         * reloc.c: Likewise.
1216         * targets.c: Likewise.
1217         * coff-m88k.c: Delete.
1218         * cpu-m88k.c: Delete.
1219         * elf32-m88k.c: Delete.
1220         * hosts/m88kmach3.h: Delete.
1221         * m88kmach3.c: Delete.
1222         * m88kopenbsd.c: Delete.
1223         * Makefile.in: Regenerate.
1224         * bfd-in2.h: Regenerate.
1225         * configure: Regenerate.
1226         * po/SRC-POTFILES.in: Regenerate.
1227
1228 2018-04-16  Alan Modra  <amodra@gmail.com>
1229
1230         * Makefile.am: Remove i370 support.
1231         * archures.c: Likewise.
1232         * config.bfd: Likewise.
1233         * configure.ac: Likewise.
1234         * targets.c: Likewise.
1235         * cpu-i370.c: Delete.
1236         * elf32-i370.c: Delete.
1237         * Makefile.in: Regenerate.
1238         * bfd-in2.h: Regenerate.
1239         * configure: Regenerate.
1240         * po/SRC-POTFILES.in: Regenerate.
1241
1242 2018-04-16  Alan Modra  <amodra@gmail.com>
1243
1244         * Makefile.am: Remove h8500 support.
1245         * archures.c: Likewise.
1246         * coffcode.h: Likewise.
1247         * config.bfd: Likewise.
1248         * configure.ac: Likewise.
1249         * targets.c: Likewise.
1250         * coff-h8500.c: Delete.
1251         * cpu-h8500.c: Delete.
1252         * Makefile.in: Regenerate.
1253         * bfd-in2.h: Regenerate.
1254         * configure: Regenerate.
1255         * po/SRC-POTFILES.in: Regenerate.
1256
1257 2018-04-16  Alan Modra  <amodra@gmail.com>
1258
1259         * Makefile.am: Remove h8300-coff support.
1260         * coffcode.h: Likewise.
1261         * config.bfd: Likewise.
1262         * configure.ac: Likewise.
1263         * reloc16.c: Likewise.
1264         * targets.c: Likewise.
1265         * coff-h8300.c: Delete.
1266         * Makefile.in: Regenerate.
1267         * configure: Regenerate.
1268         * po/SRC-POTFILES.in: Regenerate.
1269
1270 2018-04-16  Alan Modra  <amodra@gmail.com>
1271
1272         * Makefile.am: Remove IEEE 695 support.
1273         * archures.c: Likewise.
1274         * bfd.c: Likewise.
1275         * config.bfd: Likewise.
1276         * configure.ac: Likewise.
1277         * doc/bfd.texinfo: Likewise.
1278         * doc/bfdint.texi: Likewise.
1279         * doc/bfdsumm.texi: Likewise.
1280         * section.c: Likewise.
1281         * targets.c: Likewise.
1282         * ieee.c: Delete.
1283         * libieee.h: Delete.
1284         * Makefile.in: Regenerate.
1285         * bfd-in2.h: Regenerate.
1286         * configure: Regenerate.
1287         * po/SRC-POTFILES.in: Regenerate.
1288
1289 2018-04-16  Alan Modra  <amodra@gmail.com>
1290
1291         * config.bfd: Remove tandem support.
1292
1293 2018-04-16  Alan Modra  <amodra@gmail.com>
1294
1295         * Makefile.am: Remove newsos3 support.
1296         * aoutx.h: Likewise.
1297         * config.bfd: Likewise.
1298         * configure.ac: Likewise.
1299         * targets.c: Likewise.
1300         * newsos3.c: Delete.
1301         * Makefile.in: Regenerate.
1302         * configure: Regenerate.
1303         * po/SRC-POTFILES.in: Regenerate.
1304
1305 2018-04-16  Alan Modra  <amodra@gmail.com>
1306
1307         * Makefile.am: Remove netware support.
1308         * bfd-in.h: Likewise.
1309         * bfd.c: Likewise.
1310         * config.bfd: Likewise.
1311         * configure.ac: Likewise.
1312         * doc/bfdint.texi: Likewise.
1313         * ecoff.c: Likewise.
1314         * targets.c: Likewise.
1315         * libnlm.h: Delete.
1316         * nlm-target.h: Delete.
1317         * nlm.c: Delete.
1318         * nlm32-alpha.c: Delete.
1319         * nlm32-i386.c: Delete.
1320         * nlm32-ppc.c: Delete.
1321         * nlm32-sparc.c: Delete.
1322         * nlm32.c: Delete.
1323         * nlm64.c: Delete.
1324         * nlmcode.h: Delete.
1325         * nlmswap.h: Delete.
1326         * Makefile.in: Regenerate.
1327         * bfd-in2.h: Regenerate.
1328         * configure: Regenerate.
1329         * po/SRC-POTFILES.in: Regenerate.
1330
1331 2018-04-16  Alan Modra  <amodra@gmail.com>
1332
1333         * archures.c: Remove tahoe support.
1334         * config.bfd: Likewise.
1335         * configure.ac: Likewise.
1336         * hosts/tahoe.h: Delete.
1337         * bfd-in2.h: Regenerate.
1338         * configure: Regenerate.
1339
1340 2018-04-14  Alan Modra  <amodra@gmail.com>
1341
1342         * elf-bfd.h (struct elf_backend_data): Add relropagesize.
1343         * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
1344         sanity test.
1345         (elfNN_bed): Init relropagesize.
1346         * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
1347         select relropagesize.
1348         * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1349         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1350         (ELF_MINPAGESIZE): Don't define.
1351         * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1352         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1353         * bfd-in2.h: Regenerate.
1354
1355 2018-04-14  Alan Modra  <amodra@gmail.com>
1356
1357         * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
1358         on __QNXTARGET__ define.
1359
1360 2018-04-14  Alan Modra  <amodra@gmail.com>
1361
1362         * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
1363         to obsolete list.
1364
1365 2018-04-11  Alan Modra  <amodra@gmail.com>
1366
1367         * aout-adobe.c: Delete.
1368         * bout.c: Delete.
1369         * coff-i860.c: Delete.
1370         * coff-i960.c: Delete.
1371         * cpu-i860.c: Delete.
1372         * cpu-i960.c: Delete.
1373         * elf32-i860.c: Delete.
1374         * elf32-i960.c: Delete.
1375         * hosts/i860mach3.h: Delete.
1376         * Makefile.am: Remove i860, i960, bout, and adobe support.
1377         * archures.c: Remove i860 and i960 support.
1378         * coffcode.h: Likewise.
1379         * reloc.c: Likewise.
1380         * aoutx.h: Comment updates.
1381         * archive.c: Remove BOUT and i960 support.
1382         * bfd.c: Remove BOUT support.
1383         * coffswap.h: Remove i960 support.
1384         * config.bfd: Remove i860, i960 and adobe targets.
1385         * configure.ac: Remove adode, bout, i860, i960, icoff targets.
1386         * targets.c: Likewise.
1387         * ieee.c: Remove i960 support.
1388         * mach-o.c: Remove i860 support.
1389         * Makefile.in: Regenerate.
1390         * bfd-in2.h: Regenerate.
1391         * configure: Regenerate.
1392         * libbfd.h: Regenerate.
1393         * po/SRC-POTFILES.in: Regenerate.
1394
1395 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
1396
1397         * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
1398         in the BFD symbol referred by the relocation.
1399         (mips_elf64_write_rela): Likewise.
1400
1401 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
1402
1403         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
1404         error for out-of-range `r_sym' values.
1405
1406 2018-04-09  Alan Modra  <amodra@gmail.com>
1407
1408         * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
1409         (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
1410         (ppc64_elf_check_relocs): Set has_pltcall.
1411         (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
1412         (ppc64_elf_inline_plt): New function.
1413         (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
1414         * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
1415         * elf32-ppc.c (has_pltcall): Define.
1416         (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
1417         (ppc_elf_check_relocs): Set has_pltcall.
1418         (ppc_elf_inline_plt): New function.
1419         (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
1420         (ppc_elf_size_dynamic_sections): Likewise.
1421         * elf32-ppc.h (ppc_elf_inline_plt): Declare.
1422
1423 2018-04-09  Alan Modra  <amodra@gmail.com>
1424
1425         * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
1426         (is_plt_seq_reloc): New function.
1427         (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
1428         (ppc_elf_tls_optimize): Handle inline plt call sequence.
1429         (ppc_elf_relax_section): Handle PLTCALL reloc.
1430         (ppc_elf_relocate_section): Nop out inline plt call sequence when
1431         resolving locally.
1432         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
1433         R_PPC64_PLTCALL entries.  Comment R_PPC64_TOCSAVE.
1434         (has_tls_get_addr_call): Correct comment.
1435         (is_branch_reloc): Add PLTCALL.
1436         (is_plt_seq_reloc): New function.
1437         (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc.  Set
1438         has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD.  Create plt
1439         entry for R_PPC64_PLTCALL.
1440         (ppc64_elf_tls_optimize): Handle inline plt call sequence.
1441         (ppc_type_of_stub): Handle PLTCALL reloc.
1442         (toc_adjusting_stub_needed): Likewise.
1443         (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
1444         reloc insn.  Nop out inline plt call sequence when resolving
1445         locally.  Handle __tls_get_addr inline plt call optimization.
1446
1447 2018-04-09  Alan Modra  <amodra@gmail.com>
1448
1449         * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
1450         (struct ppc_stub_hash_entry): Add symtype field.
1451         (PLT_KEEP): Define.
1452         (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
1453         (create_linkage_sections): Create pltlocal and relpltlocal.
1454         (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
1455         Set PLT_KEEP.
1456         (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1457         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1458         (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1459         Keep PLT entries for inline calls against locals.
1460         (ppc_build_one_stub): Use pltlocal as appropriate.
1461         (ppc_size_one_stub): Likewise.
1462         (ppc64_elf_size_stubs): Set symtype.
1463         (build_global_entry_stubs_and_plt): Init pltlocal and write
1464         relpltlocal for globals.
1465         (write_plt_relocs_for_local_syms): Likewise for local syms.
1466         (ppc64_elf_relocate_section): Support PLT for local syms.
1467         * elf32-ppc.c (PLT_KEEP): Define.
1468         (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
1469         (ppc_elf_create_glink): Create pltlocal and relpltlocal.
1470         (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
1471         Set PLT_KEEP.  Adjust update_local_sym_info call.
1472         (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1473         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1474         (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1475         (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
1476         (write_global_sym_plt): Init pltlocal and write relpltlocal.
1477         (ppc_finish_symbols): Likewise for locals.
1478
1479 2018-04-09  Alan Modra  <amodra@gmail.com>
1480
1481         * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
1482         for local symbols to..
1483         (write_plt_relocs_for_local_syms): ..here.  New function.
1484         (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
1485         global symbols to..
1486         (build_global_entry_stubs_and_plt): ..here.  Rename from
1487         build_global_entry_stubs.
1488         (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
1489         Call write_plt_relocs_for_local_syms.
1490         * elf32-ppc.c (get_sym_h): New function.
1491         (ppc_elf_relax_section): Use get_sym_h.
1492         (ppc_elf_relocate_section): Move output of PLT relocs and glink
1493         stubs for local symbols to..
1494         (ppc_finish_symbols): ..here.  New function.
1495         (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
1496         global syms to..
1497         (write_global_sym_plt): ..here.  New function.
1498         * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
1499         (ppc_finish_symbols): Declare.
1500
1501 2018-04-09  Alan Modra  <amodra@gmail.com>
1502
1503         * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
1504         (ppc_elf_relocate_section): Likewise.
1505         * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
1506         (ppc64_elf_relocate_section): Likewise.  Correct PLT16
1507         resolution to plt entry relative to toc pointer.
1508
1509 2018-04-09  Alan Modra  <amodra@gmail.com>
1510
1511         * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
1512         TLS_TPRELGD, TLS_EXPLICIT):  Renumber.  Test TLS_TLS throughout
1513         file when other TLS flags are tested in a mask.
1514         (TLS_MARK, NON_GOT): Define.
1515         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
1516         (update_local_sym_info): Don't create got entry when NON_GOT.
1517         (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
1518         Set TLS_MARK.
1519         (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
1520         (ppc64_elf_relocate_section): Likewise.
1521         (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
1522         __tls_get_addr calls lacking a marker reloc.
1523         * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
1524         TLS_TPRELGD): Renumber.  Update comment.
1525         (TLS_MARK, NON_GOT): Define.
1526         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
1527         (update_local_sym_info): Don't create got entry when NON_GOT.
1528         (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
1529         Set TLS_MARK.
1530         (ppc_elf_tls_optimize): Don't attempt to optimize indirect
1531         __tls_get_addr calls lacking a marker reloc.
1532
1533 2018-04-06  H.J. Lu  <hongjiu.lu@intel.com>
1534
1535         * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
1536         R_X86_64_converted_reloc_bit.
1537
1538 2018-04-05  H.J. Lu  <hongjiu.lu@intel.com>
1539
1540         PR gas/22318
1541         * configure: Regenerated.
1542
1543 2018-04-05  Alan Modra  <amodra@gmail.com>
1544
1545         * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
1546         (elf_hppa_info_to_howto_rel): Likewise.
1547
1548 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1549
1550         * elf-hppa.h (elf_hppa_info_to_howto): Also return
1551         unsuccessfully for unimplemented relocations.
1552         (elf_hppa_info_to_howto_rel): Likewise.
1553
1554 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1555
1556         * elf32-i860.c (lookup_howto): Add `abfd' parameter.  Set the
1557         `bfd_error_bad_value' error and call `_bfd_error_handler' on a
1558         howto lookup failure.
1559         (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
1560         accordingly.
1561         (elf32_i860_info_to_howto_rela): Likewise.
1562         (elf32_i860_relocate_splitn): Likewise.
1563         (elf32_i860_relocate_pc16): Likewise.
1564         (elf32_i860_relocate_pc26): Likewise.
1565         (elf32_i860_relocate_section): Likewise.
1566
1567 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1568
1569         * elf32-visium.c (visium_info_to_howto_rela): Correct the range
1570         check for `visium_elf_howto_table' table access.
1571
1572 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1573
1574         * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
1575         check for `iq2000_elf_howto_table' table access.
1576
1577 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1578
1579         * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
1580         for `elf32_frv_howto_table' table access.
1581
1582 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1583
1584         * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
1585         unsuccessfully for placeholder howtos.
1586         * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
1587         * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
1588
1589 2018-03-29  Maciej W. Rozycki  <macro@mips.com>
1590
1591         * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
1592         `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
1593
1594 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1595
1596         * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
1597         ATTRIBUTE_UNUSED from `abfd'.
1598
1599 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1600
1601         * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
1602         `_bfd_error_handler' call formatting.
1603
1604 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1605
1606         * elf32-mips.c (mips_info_to_howto_rel): Call
1607         `mips_elf32_rtype_to_howto' directly rather than via
1608         `->elf_backend_mips_rtype_to_howto'.
1609
1610 2018-03-28  Renlin Li  <renlin.li@arm.com>
1611
1612         PR ld/22970
1613         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
1614         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
1615         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1616         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
1617         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1618         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
1619         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1620         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
1621         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1622         (elfNN_aarch64_final_link_relocate): Support new relocations.
1623         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
1624         relocations.
1625         (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
1626
1627 2018-03-28  Renlin Li  <renlin.li@arm.com>
1628
1629         PR ld/22970
1630         * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
1631         BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
1632         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
1633         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1634         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
1635         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1636         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
1637         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1638         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
1639         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1640         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
1641         TLSLE_LDST16_TPREL_LO12,
1642         TLSLE_LDST16_TPREL_LO12_NC,
1643         TLSLE_LDST32_TPREL_LO12,
1644         TLSLE_LDST32_TPREL_LO12_NC,
1645         TLSLE_LDST64_TPREL_LO12,
1646         TLSLE_LDST64_TPREL_LO12_NC,
1647         TLSLE_LDST8_TPREL_LO12,
1648         TLSLE_LDST8_TPREL_LO12_NC.
1649         * bfd-in2.h: Regenerated.
1650         * libbfd.h: Regenerated.
1651
1652 2018-03-28  Eric Botcazou  <ebotcazou@adacore.com>
1653
1654         PR ld/22972
1655         * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
1656         has_old_style_got_reloc.
1657         (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
1658         relocations.  Fix a couple of long lines.
1659         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
1660         a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
1661         GOT relocations.
1662
1663 2018-03-25  H.J. Lu  <hongjiu.lu@intel.com>
1664
1665         PR ld/23000
1666         * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
1667         ENDBR64 to the TLSDESC PLT entry.
1668
1669 2018-03-21  Alan Modra  <amodra@gmail.com>
1670
1671         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
1672         symbols.  Use size_t counts.  Delete redundant opd test.
1673
1674 2018-03-21  Alan Modra  <amodra@gmail.com>
1675
1676         * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
1677
1678 2018-03-21  Alan Modra  <amodra@gmail.com>
1679
1680         * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
1681         field unsigned.
1682         (update_local_sym_info): Likewise for local_got_tls_masks.
1683         (ppc_elf_tls_optimize): Likewise for lgot_masks.
1684
1685 2018-03-21  Alan Modra  <amodra@gmail.com>
1686
1687         * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
1688         (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
1689         do in size_dynamic_sections.
1690
1691 2018-03-21  Alan Modra  <amodra@gmail.com>
1692
1693         * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
1694         without first checking array bounds.
1695         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1696
1697 2018-03-20  H.J. Lu  <hongjiu.lu@intel.com>
1698
1699         PR ld/22983
1700         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
1701         non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
1702
1703 2018-03-19  Nick Clifton  <nickc@redhat.com>
1704
1705         * po/es.po: Updated Spanish translation.
1706
1707 2018-03-15  Max Filippov  <jcmvbkbc@gmail.com>
1708
1709         * elf32-xtensa.c (xlate_map_entry): Change types of address
1710         fields from 'unsigned' to 'bfd_vma'.
1711         (xlate_offset_with_removed_text): Use struct xlate_map_entry as
1712         the key argument to bsearch. Allow offsets past the end of a
1713         section, use the last map entry for translation of such offsets.
1714
1715 2018-03-15  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
1716
1717         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
1718         Not support the target feature.
1719         (nds32_elf_ex9_itb_base): Likewise.
1720         (nds32_elf_ex9_import_table): Likewise.
1721         (nds32_elf_ex9_finish): Likewise.
1722         (nds32_elf_ex9_reloc_jmp): Likewise.
1723         (nds32_elf_get_insn_with_reg): Likewise.
1724         (nds32_get_local_syms): Likewise.
1725         (nds32_elf_ex9_replace_instruction): Likewise.
1726         (nds32_elf_ifc_calc): Likewise.
1727         (nds32_elf_ifc_finish): Likewise.
1728         (nds32_elf_ifc_replace): Likewise.
1729         (nds32_elf_ifc_reloc): Likewise.
1730
1731 2018-03-14  Alan Modra  <amodra@gmail.com>
1732
1733         * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
1734         sfpr size added before defining alias symbols.
1735         (ppc64_elf_build_stubs): Add stub section padding before
1736         copying sfpr contents and defining save/restore alias symbols.
1737
1738 2018-03-14  H.J. Lu  <hongjiu.lu@intel.com>
1739
1740         PR ld/20882
1741         * elflink.c (elf_gc_mark_debug_section): Also check the local
1742         debug definition section.
1743
1744 2018-03-13  Nick Clifton  <nickc@redhat.com>
1745
1746         PR 22113
1747         * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
1748         function.  Add an end address parameter.  Check access of the data
1749         pointer to make sure that they do not extend beyond the end
1750         address.  Return FALSE if any check fails.  Add the end address
1751         pointer to the ui structure.
1752         (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
1753         codes to make sure that they do not extend beyond the end address
1754         pointer.  Print an error message and return immediately if any
1755         check fails.
1756
1757 2018-03-09  Nick Clifton  <nickc@redhat.com>
1758
1759         * elf64-s390.c (elf_s390_relocate_section): Move check for
1760         relocations against non-allocated sections to before the code that
1761         handles ifunc relocations.
1762         * elf32-s390.c (elf_s390_relocate_section): Likewise.
1763         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
1764         relocs against IFUNC symbols in non-allocated sections as relocs
1765         against FUNC symbols.
1766         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1767
1768 2018-03-08  H.J. Lu  <hongjiu.lu@intel.com>
1769
1770         PR ld/22929
1771         * elf32-i386.c (elf_i386_relocate_section): Treat relocation
1772         against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
1773         relocation against FUNC symbol.
1774         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1775
1776 2018-03-07  Renlin Li  <renlin.li@arm.com>
1777
1778         PR ld/20402
1779         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
1780         symbol, and don't emit relocation in specific case.
1781
1782 2018-03-07  Alan Modra  <amodra@gmail.com>
1783
1784         * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
1785         (mips_elf64_slurp_one_reloc_table): Pass on error.
1786
1787 2018-03-03  James Cowgill  <james.cowgill@mips.com>
1788             Maciej W. Rozycki  <macro@mips.com>
1789
1790         PR ld/21900
1791         * elfxx-mips.c (mips_elf_calculate_relocation): Only return
1792         after calling `undefined_symbol' hook if this is an error
1793         condition.  Assume the value of 0 for the symbol requested
1794         otherwise.
1795
1796 2018-03-02  Jim Wilson  <jimw@sifive.com>
1797
1798         PR 22903
1799         * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
1800         and nop instead of 4.
1801         (elfNN_arch64_build_stubs): Add nop after branch.  Increase size by
1802         8 instead of 4.
1803
1804 2018-03-01  Jim Wilson  <jimw@sifive.com>
1805
1806         PR 22756
1807         * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
1808         else if instead of if.
1809
1810 2018-03-01  Alan Modra  <amodra@gmail.com>
1811
1812         * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
1813
1814 2018-02-28  Alan Modra  <amodra@gmail.com>
1815
1816         PR 22887
1817         * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
1818
1819 2018-02-28  Nick Clifton  <nickc@redhat.com>
1820
1821         PR 22895
1822         PR 22893
1823         * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
1824         pointer.  Drop unused abfd parameter.  Check the size of the block
1825         before initialising the data field.  Return the end pointer if the
1826         size is invalid.
1827         (read_attribute_value): Adjust invocations of read_n_bytes.
1828
1829         PR 22894
1830         * dwarf1.c (parse_die): Check the length of form blocks before
1831         advancing the data pointer.
1832
1833 2018-02-28  Alan Modra  <amodra@gmail.com>
1834
1835         PR 22887
1836         * aoutx.h (translate_symbol_table): Print an error message and set
1837         bfd_error on finding an invalid name string offset.
1838
1839 2018-02-27  H.J. Lu  <hongjiu.lu@intel.com>
1840
1841         * config.in: Regenerated.
1842         * configure: Likewise.
1843         * configure.ac: Add --enable-separate-code.
1844         (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED.  Default
1845         to 1 for Linux/x86 targets,
1846         * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
1847         DEFAULT_LD_Z_SEPARATE_CODE is 1.
1848
1849 2018-02-27  Nick Clifton  <nickc@redhat.com>
1850
1851         * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
1852         message.
1853         * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
1854         * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
1855         * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
1856         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
1857         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
1858         * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
1859         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
1860         * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
1861         * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
1862
1863         PR 22875
1864         * elf-bfd.h (struct elf_backend_data): Change the return type of
1865         the elf_info_to_howto and elf_info_to_howto_rel function pointers
1866         to bfd_boolean.
1867         * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
1868         value from the info_to_howto function and fail if that function
1869         failed.
1870         * elf32-h8300.c (elf32_h8_relocate_section): Check return value
1871         from the info_to_howto function.
1872         (elf32_h8_relax_section): Likewise.
1873         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
1874         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
1875         * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
1876         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
1877         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1878         * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
1879         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1880         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1881         * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
1882         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1883         (riscv_elf_relocate_section): Likewise.
1884         * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
1885         bfd_boolean.  Issue an error message, set an error value and
1886         return FALSE if the reloc is not recognized.
1887         (elf_hppa_info_to_howto_rel): Likewise.
1888         * elf-m10200.c (mn10200_info_to_howto): Likewise.
1889         * elf-m10300.c (mn10300_info_to_howto): Likewise.
1890         * elf.c (_bfd_elf_no_info_to_howto): Likewise.
1891         * elf32-arc.c (arc_info_to_howto_rel): Likewise.
1892         * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
1893         * elf32-avr.c (avr_info_to_howto_rela): Likewise.
1894         * elf32-bfin.c (bfin_info_to_howto): Likewise.
1895         * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
1896         * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
1897         * elf32-cris.c (elf_cr16c_info_to_howto_rel)
1898         (cris_info_to_howto_rela): Likewise.
1899         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
1900         * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
1901         * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
1902         Likewise.
1903         * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
1904         (elf32_dlx_info_to_howto_rel): Likewise.
1905         * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
1906         * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
1907         * elf32-frv.c (frv_info_to_howto_rela)
1908         (frvfdpic_info_to_howto_rel): Likewise.
1909         * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
1910         * elf32-gen.c (elf_generic_info_to_howto)
1911         (elf_generic_info_to_howto_rel): Likewise.
1912         * elf32-h8300.c (elf32_h8_info_to_howto)
1913         (elf32_h8_info_to_howto_rel): Likewise.
1914         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
1915         * elf32-i386.c (elf_i386_reloc_type_lookup)
1916         (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
1917         * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
1918         Likewise.
1919         * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
1920         * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
1921         * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
1922         * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
1923         * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
1924         * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
1925         Likewise.
1926         * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
1927         * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
1928         * elf32-m68k.c (rtype_to_howto): Likewise.
1929         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
1930         * elf32-mep.c (mep_info_to_howto_rela): Likewise.
1931         * elf32-metag.c (metag_info_to_howto_rela): Likewise.
1932         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
1933         * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
1934         Likewise.
1935         * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
1936         * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
1937         * elf32-mt.c (mt_info_to_howto_rela): Likewise.
1938         * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
1939         Likewise.
1940         * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
1941         * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
1942         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
1943         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
1944         * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
1945         * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
1946         * elf32-rx.c (rx_info_to_howto_rela): Likewise.
1947         * elf32-s390.c (elf_s390_info_to_howto): Likewise.
1948         * elf32-score.c (s3_bfd_score_info_to_howto)
1949         (_bfd_score_info_to_howto): Likewise.
1950         * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
1951         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
1952         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
1953         * elf32-tic6x.c (elf32_tic6x_info_to_howto)
1954         (elf32_tic6x_info_to_howto_rel): Likewise.
1955         * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
1956         * elf32-v850.c (v850_elf_info_to_howto_rel)
1957         (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
1958         * elf32-vax.c (rtype_to_howto): Likewise.
1959         * elf32-visium.c (visium_info_to_howto_rela): Likewise.
1960         * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
1961         (elf32_wasm32_info_to_howto_rela): Likewise.
1962         * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
1963         * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
1964         * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
1965         * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
1966         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
1967         * elf64-gen.c (elf_generic_info_to_howto)
1968         (elf_generic_info_to_howto_rel): Likewise.
1969         * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
1970         * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
1971         * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
1972         * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
1973         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
1974         * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
1975         Likewise.
1976         * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
1977         * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
1978         Likewise.
1979         * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
1980         * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
1981         * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
1982         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
1983         * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
1984         * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
1985         * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
1986         * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
1987         * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
1988         * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
1989         Default to NULL.
1990
1991 2018-02-26  Jim Wilson  <jimw@sifive.com>
1992             Stephan Schreiber <info@fs-driver.org>
1993
1994         PR 15904
1995         * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
1996         call, set changed_contents and changed_relocs.  Likewise after
1997         successful ia64_elf_relax_br call.
1998
1999 2018-02-26  Alan Modra  <amodra@gmail.com>
2000
2001         * elf.c (assign_file_positions_except_relocs): Don't segfault
2002         when actual number of phdrs is less than allocated.  Delete
2003         outdated comment.  Formatting.
2004
2005 2018-02-26  Alan Modra  <amodra@gmail.com>
2006
2007         * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
2008         * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
2009         * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
2010         * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
2011         * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
2012         * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
2013         * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
2014         * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
2015         * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
2016         * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
2017         error/warning messages.
2018
2019 2018-02-26  Alan Modra  <amodra@gmail.com>
2020
2021         * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
2022         * syms.c: Standardize error/warning messages.
2023
2024 2018-02-26  Alan Modra  <amodra@gmail.com>
2025
2026         * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
2027         * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
2028         * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
2029         * peXXigen.c, * peicode.h: Standardize error/warning messages.
2030
2031 2018-02-26  Alan Modra  <amodra@gmail.com>
2032
2033         * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
2034
2035 2018-02-26  Alan Modra  <amodra@gmail.com>
2036
2037         * elfxx-mips.c: Standardize error/warning messages.
2038
2039 2018-02-26  Alan Modra  <amodra@gmail.com>
2040
2041         * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
2042         * elflink.c: Standardize error/warning messages.  Replace use of
2043         linker callback einfo with _bfd_error_handler when possible.
2044
2045 2018-02-26  Alan Modra  <amodra@gmail.com>
2046
2047         * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
2048         * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
2049         * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
2050         * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
2051         * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
2052         * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
2053         * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
2054         * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
2055         * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
2056         * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
2057         * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
2058         * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
2059         * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
2060         * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
2061         * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
2062         * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
2063         * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
2064         * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
2065         * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
2066         * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
2067         * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
2068         unrecognized/unsupported reloc message.
2069
2070 2018-02-26  Alan Modra  <amodra@gmail.com>
2071
2072         * elf32-ppc.c: Standardize error/warning messages.  Use
2073         _bfd_error_handler rather than einfo when einfo features not used.
2074         * elf64-ppc.c: Likewise.
2075
2076 2018-02-23  Alan Modra  <amodra@gmail.com>
2077
2078         PR 22881
2079         * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
2080         segment if no matching LOAD segment.
2081
2082 2018-02-23  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
2083
2084         * elf32-nds32.h: Define mask for ict_model.
2085
2086 2018-02-20  Jason Duerstock  <jason.duerstock@gmail.com>
2087
2088         * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
2089
2090 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2091
2092         Revert
2093         2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
2094
2095         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
2096         .reginfo section has wrong size.
2097
2098 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2099
2100         * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
2101         SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
2102         `.MIPS.abiflags' sections.
2103         (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
2104         section's end.
2105
2106 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2107
2108         * section.c (SEC_FIXED_SIZE): New macro.
2109         * bfd-in2.h: Regenerate.
2110
2111 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2112
2113         * section.c (SEC_HAS_GOT_REF): Remove macro.
2114         * bfd-in2.h: Regenerate.
2115
2116 2018-02-19  Alan Modra  <amodra@gmail.com>
2117
2118         * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
2119         arguments.
2120         * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
2121         * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
2122         (_bfd_riscv_relax_pc): Likewise and fix typos.
2123         * libbfd-in.h (_bfd_error_handler): Add attribute printf.
2124         * libbfd.h: Regenerate.
2125
2126 2018-02-19  Alan Modra  <amodra@gmail.com>
2127
2128         * dwarf2.c (read_section): Don't use 'll' format modifier.
2129         (find_abstract_instance): Likewise.
2130         * elfcore.h (elf_core_file_p): Likewise.
2131
2132 2018-02-19  Alan Modra  <amodra@gmail.com>
2133
2134         * bfd-in.h: Include inttypes.h or if not available define
2135         PRId64, PRIu64 and PRIx64.
2136         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
2137         modifier to print bfd_vma.
2138         * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
2139         * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
2140         * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
2141         * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
2142         * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
2143         * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
2144         * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
2145         * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
2146         * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
2147         * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
2148         * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
2149         * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
2150         * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
2151         * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
2152         * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
2153         and cast input to uint64_t, and similarly for Ld and Lu.
2154         * bfd-in2.h: Regenerate.
2155
2156 2018-02-19  Alan Modra  <amodra@gmail.com>
2157
2158         * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
2159         * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
2160         * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
2161         * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
2162         * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
2163         * reloc.c: Replace use of %R and %T in format strings passed to
2164         einfo and friends by %pR and %pT.
2165
2166 2018-02-19  Alan Modra  <amodra@gmail.com>
2167
2168         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
2169         of %A and %B.
2170         * aout-adobe.c: Update all messages using %A and %B.
2171         * aout-cris.c: Likewise.
2172         * aoutx.h: Likewise.
2173         * archive.c: Likewise.
2174         * binary.c: Likewise.
2175         * cache.c: Likewise.
2176         * coff-alpha.c: Likewise.
2177         * coff-arm.c: Likewise.
2178         * coff-i860.c: Likewise.
2179         * coff-mcore.c: Likewise.
2180         * coff-ppc.c: Likewise.
2181         * coff-rs6000.c: Likewise.
2182         * coff-sh.c: Likewise.
2183         * coff-tic4x.c: Likewise.
2184         * coff-tic54x.c: Likewise.
2185         * coff-tic80.c: Likewise.
2186         * coff64-rs6000.c: Likewise.
2187         * coffcode.h: Likewise.
2188         * coffgen.c: Likewise.
2189         * cofflink.c: Likewise.
2190         * coffswap.h: Likewise.
2191         * compress.c: Likewise.
2192         * cpu-arm.c: Likewise.
2193         * ecoff.c: Likewise.
2194         * elf-attrs.c: Likewise.
2195         * elf-eh-frame.c: Likewise.
2196         * elf-ifunc.c: Likewise.
2197         * elf-m10300.c: Likewise.
2198         * elf-properties.c: Likewise.
2199         * elf-s390-common.c: Likewise.
2200         * elf.c: Likewise.
2201         * elf32-arc.c: Likewise.
2202         * elf32-arm.c: Likewise.
2203         * elf32-avr.c: Likewise.
2204         * elf32-bfin.c: Likewise.
2205         * elf32-cr16.c: Likewise.
2206         * elf32-cr16c.c: Likewise.
2207         * elf32-cris.c: Likewise.
2208         * elf32-crx.c: Likewise.
2209         * elf32-d10v.c: Likewise.
2210         * elf32-d30v.c: Likewise.
2211         * elf32-epiphany.c: Likewise.
2212         * elf32-fr30.c: Likewise.
2213         * elf32-frv.c: Likewise.
2214         * elf32-gen.c: Likewise.
2215         * elf32-hppa.c: Likewise.
2216         * elf32-i370.c: Likewise.
2217         * elf32-i386.c: Likewise.
2218         * elf32-i960.c: Likewise.
2219         * elf32-ip2k.c: Likewise.
2220         * elf32-iq2000.c: Likewise.
2221         * elf32-lm32.c: Likewise.
2222         * elf32-m32c.c: Likewise.
2223         * elf32-m32r.c: Likewise.
2224         * elf32-m68hc11.c: Likewise.
2225         * elf32-m68hc12.c: Likewise.
2226         * elf32-m68hc1x.c: Likewise.
2227         * elf32-m68k.c: Likewise.
2228         * elf32-mcore.c: Likewise.
2229         * elf32-mep.c: Likewise.
2230         * elf32-metag.c: Likewise.
2231         * elf32-microblaze.c: Likewise.
2232         * elf32-moxie.c: Likewise.
2233         * elf32-msp430.c: Likewise.
2234         * elf32-mt.c: Likewise.
2235         * elf32-nds32.c: Likewise.
2236         * elf32-nios2.c: Likewise.
2237         * elf32-or1k.c: Likewise.
2238         * elf32-pj.c: Likewise.
2239         * elf32-ppc.c: Likewise.
2240         * elf32-rl78.c: Likewise.
2241         * elf32-rx.c: Likewise.
2242         * elf32-s390.c: Likewise.
2243         * elf32-score.c: Likewise.
2244         * elf32-score7.c: Likewise.
2245         * elf32-sh-symbian.c: Likewise.
2246         * elf32-sh.c: Likewise.
2247         * elf32-sh64.c: Likewise.
2248         * elf32-sparc.c: Likewise.
2249         * elf32-spu.c: Likewise.
2250         * elf32-tic6x.c: Likewise.
2251         * elf32-tilepro.c: Likewise.
2252         * elf32-v850.c: Likewise.
2253         * elf32-vax.c: Likewise.
2254         * elf32-visium.c: Likewise.
2255         * elf32-wasm32.c: Likewise.
2256         * elf32-xgate.c: Likewise.
2257         * elf32-xtensa.c: Likewise.
2258         * elf64-alpha.c: Likewise.
2259         * elf64-gen.c: Likewise.
2260         * elf64-hppa.c: Likewise.
2261         * elf64-ia64-vms.c: Likewise.
2262         * elf64-mmix.c: Likewise.
2263         * elf64-ppc.c: Likewise.
2264         * elf64-s390.c: Likewise.
2265         * elf64-sh64.c: Likewise.
2266         * elf64-sparc.c: Likewise.
2267         * elf64-x86-64.c: Likewise.
2268         * elfcode.h: Likewise.
2269         * elfcore.h: Likewise.
2270         * elflink.c: Likewise.
2271         * elfnn-aarch64.c: Likewise.
2272         * elfnn-ia64.c: Likewise.
2273         * elfnn-riscv.c: Likewise.
2274         * elfxx-mips.c: Likewise.
2275         * elfxx-sparc.c: Likewise.
2276         * elfxx-tilegx.c: Likewise.
2277         * elfxx-x86.c: Likewise.
2278         * hpux-core.c: Likewise.
2279         * ieee.c: Likewise.
2280         * ihex.c: Likewise.
2281         * libbfd.c: Likewise.
2282         * linker.c: Likewise.
2283         * mach-o.c: Likewise.
2284         * merge.c: Likewise.
2285         * mmo.c: Likewise.
2286         * oasys.c: Likewise.
2287         * pdp11.c: Likewise.
2288         * pe-mips.c: Likewise.
2289         * peXXigen.c: Likewise.
2290         * peicode.h: Likewise.
2291         * reloc.c: Likewise.
2292         * rs6000-core.c: Likewise.
2293         * srec.c: Likewise.
2294         * stabs.c: Likewise.
2295         * vms-alpha.c: Likewise.
2296         * xcofflink.c: Likewise.
2297
2298 2018-02-19  Alan Modra  <amodra@gmail.com>
2299
2300         PR 22845
2301         * elf.c (IS_TBSS): Define.
2302         (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
2303         (assign_file_positions_for_non_load_sections): Revert last change.
2304         Properly calculate load segment limits to compare against relro limits.
2305
2306 2018-02-17  Alan Modra  <amodra@gmail.com>
2307
2308         PR 22845
2309         * elf.c (assign_file_positions_for_non_load_sections): Ignore
2310         degenerate zero size PT_LOAD segments when finding one overlapping
2311         the PT_GNU_RELRO segment.
2312
2313 2018-02-16  Alan Modra  <amodra@gmail.com>
2314
2315         * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
2316         (_bfd_bool_bfd_true): Rename from bfd_true.
2317         (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
2318         (_bfd_int_bfd_0): Rename from bfd_0.
2319         (_bfd_uint_bfd_0): Rename from bfd_0u.
2320         (_bfd_long_bfd_0): Rename from bfd_0l.
2321         (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
2322         (_bfd_void_bfd): Rename from bfd_void.
2323         (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
2324         (_bfd_bool_bfd_link_false_error),
2325         (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
2326         (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
2327         (_bfd_bool_bfd_asection_bfd_asection_true),
2328         (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
2329         (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
2330         * archive.c (_bfd_noarchive_get_elt_at_index),
2331         (_bfd_noarchive_openr_next_archived_file),
2332         (_bfd_noarchive_construct_extended_name_table),
2333         (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
2334         (_bfd_noarchive_write_armap): New functions.
2335         * archures.c (_bfd_nowrite_set_arch_mach): New function.
2336         * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
2337         (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
2338         (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
2339         (alpha_ecoff_swap_coff_lineno_out),
2340         (alpha_ecoff_swap_coff_reloc_out): New functions.
2341         * coff-mips.c (mips_ecoff_swap_coff_aux_in),
2342         (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
2343         (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
2344         (mips_ecoff_swap_coff_lineno_out),
2345         (mips_ecoff_swap_coff_reloc_out): New functions.
2346         * coffcode.h (coff_set_alignment_hook): Replace define with
2347         new function.
2348         (symname_in_debug_hook): Likewise.
2349         * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
2350         * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
2351         * elf.c (assign_file_positions_except_relocs): Test
2352         elf_backend_allow_non_load_phdr for NULL.
2353         * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
2354         _bfd_elf_link_omit_section_dynsym.  Update uses.
2355         (_bfd_elf_omit_section_dynsym_all): New function.
2356         * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
2357         (_bfd_elf_omit_section_dynsym_default): Declare.
2358         (_bfd_elf_omit_section_dynsym_all): Declare.
2359         * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
2360         (_bfd_nolink_bfd_get_relocated_section_contents),
2361         (_bfd_nolink_bfd_lookup_section_flags),
2362         (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
2363         (_bfd_nolink_bfd_link_hash_table_create),
2364         (_bfd_nolink_bfd_link_just_syms),
2365         (_bfd_nolink_bfd_copy_link_hash_symbol_type),
2366         (_bfd_nolink_bfd_link_split_section),
2367         (_bfd_nolink_section_already_linked),
2368         (_bfd_nolink_bfd_define_common_symbol),
2369         (_bfd_nolink_bfd_define_start_stop): New functions.
2370         * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
2371         (_bfd_norelocs_bfd_reloc_name_lookup),
2372         (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
2373         * section.c (_bfd_nowrite_set_section_contents): New function.
2374         * syms.c (_bfd_nosymbols_canonicalize_symtab),
2375         (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
2376         (_bfd_nosymbols_get_symbol_version_string),
2377         (_bfd_nosymbols_bfd_is_local_label_name),
2378         (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
2379         (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
2380         (_bfd_nosymbols_bfd_make_debug_symbol),
2381         ( _bfd_nosymbols_read_minisymbols),
2382         ( _bfd_nosymbols_minisymbol_to_symbol),
2383         (_bfd_nodynamic_get_synthetic_symtab): New functions.
2384         * libbfd-in.h: Declare new functions.  Update existing defines,
2385         removing casts.
2386         * aix386-core.c: Update to use new hooks.  Formatting.
2387         * aout-adobe.c: Likewise.
2388         * aout-arm.c: Likewise.
2389         * aout-target.h: Likewise.
2390         * aout-tic30.c: Likewise.
2391         * aoutf1.h: Likewise.
2392         * binary.c: Likewise.
2393         * bout.c: Likewise.
2394         * cisco-core.c: Likewise.
2395         * coff-alpha.c: Likewise.
2396         * coff-i386.c: Likewise.
2397         * coff-i860.c: Likewise.
2398         * coff-i960.c: Likewise.
2399         * coff-ia64.c: Likewise.
2400         * coff-mips.c: Likewise.
2401         * coff-ppc.c: Likewise.
2402         * coff-rs6000.c: Likewise.
2403         * coff-sh.c: Likewise.
2404         * coff-tic30.c: Likewise.
2405         * coff-tic54x.c: Likewise.
2406         * coff-x86_64.c: Likewise.
2407         * coff64-rs6000.c: Likewise.
2408         * coffcode.h: Likewise.
2409         * elf-m10300.c: Likewise.
2410         * elf32-cr16.c: Likewise.
2411         * elf32-lm32.c: Likewise.
2412         * elf32-m32r.c: Likewise.
2413         * elf32-metag.c: Likewise.
2414         * elf32-score.c: Likewise.
2415         * elf32-score7.c: Likewise.
2416         * elf32-tilepro.c: Likewise.
2417         * elf32-xstormy16.c: Likewise.
2418         * elf32-xtensa.c: Likewise.
2419         * elf64-alpha.c: Likewise.
2420         * elf64-hppa.c: Likewise.
2421         * elf64-ia64-vms.c: Likewise.
2422         * elf64-mmix.c: Likewise.
2423         * elf64-sh64.c: Likewise.
2424         * elfnn-ia64.c: Likewise.
2425         * elfxx-sparc.c: Likewise.
2426         * elfxx-target.h: Likewise.
2427         * elfxx-tilegx.c: Likewise.
2428         * elfxx-x86.h: Likewise.
2429         * hp300hpux.c: Likewise.
2430         * hppabsd-core.c: Likewise.
2431         * hpux-core.c: Likewise.
2432         * i386msdos.c: Likewise.
2433         * i386os9k.c: Likewise.
2434         * ieee.c: Likewise.
2435         * ihex.c: Likewise.
2436         * irix-core.c: Likewise.
2437         * libaout.h: Likewise.
2438         * libecoff.h: Likewise.
2439         * mach-o-target.c: Likewise.
2440         * mach-o.c: Likewise.
2441         * mipsbsd.c: Likewise.
2442         * mmo.c: Likewise.
2443         * netbsd-core.c: Likewise.
2444         * nlm-target.h: Likewise.
2445         * oasys.c: Likewise.
2446         * osf-core.c: Likewise.
2447         * pdp11.c: Likewise.
2448         * pe-mips.c: Likewise.
2449         * pe-x86_64.c: Likewise.
2450         * pef.c: Likewise.
2451         * plugin.c: Likewise.
2452         * ppcboot.c: Likewise.
2453         * ptrace-core.c: Likewise.
2454         * sco5-core.c: Likewise.
2455         * som.c: Likewise.
2456         * sparclynx.c: Likewise.
2457         * srec.c: Likewise.
2458         * tekhex.c: Likewise.
2459         * trad-core.c: Likewise.
2460         * verilog.c: Likewise.
2461         * versados.c: Likewise.
2462         * vms-alpha.c: Likewise.
2463         * vms-lib.c: Likewise.
2464         * wasm-module.c: Likewise.
2465         * xsym.c: Likewise.
2466         * libbfd.h: Regenerate.
2467
2468 2018-02-15  Jim Wilson  <jimw@sifive.com>
2469
2470         * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
2471         symbols whose section address is zero.
2472
2473         * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
2474         when pcrel_lo reloc has an addend.  Use reloc_dangerous callback for
2475         bfd_reloc_dangerous.  Use einfo instead of warning callback for errors.
2476         Add %X%P to error messages.
2477
2478 2018-02-15  Eric Botcazou  <ebotcazou@adacore.com>
2479
2480         PR ld/22832
2481         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
2482         Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
2483         and assert that the result of the call is not NULL.
2484
2485 2018-02-14  Nick Clifton  <nickc@redhat.com>
2486
2487         PR 22823
2488         Revert previous delta.  Add extra casts to avoid compile time
2489         warnings instead.
2490         * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
2491         cast to avoid warning from gcc v8 compiler.
2492         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
2493         (_bfd_generic_bfd_set_private_flags): Likewise.
2494         (_bfd_generic_bfd_copy_private_section_data): Likewise.
2495         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
2496         (_bfd_generic_bfd_copy_private_header_data): Likewise.
2497         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
2498         (_bfd_noarchive_construct_extended_name_table): Likewise.
2499         (_bfd_noarchive_truncate_arname): Likewise.
2500         (_bfd_noarchive_write_ar_hdr): Likewise.
2501         (_bfd_noarchive_get_elt_at_index): Likewise.
2502         (_bfd_nosymbols_canonicalize_symtab): Likewise.
2503         (_bfd_nosymbols_print_symbol): Likewise.
2504         (_bfd_nosymbols_get_symbol_info): Likewise.
2505         (_bfd_nosymbols_get_symbol_version_string): Likewise.
2506         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
2507         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
2508         (_bfd_nosymbols_get_lineno): Likewise.
2509         (_bfd_nosymbols_find_nearest_line): Likewise.
2510         (_bfd_nosymbols_find_line): Likewise.
2511         (_bfd_nosymbols_find_inliner_info): Likewise.
2512         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
2513         (_bfd_nosymbols_read_minisymbols): Likewise.
2514         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
2515         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
2516         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
2517         (_bfd_nowrite_set_arch_mach): Likewise.
2518         (_bfd_nowrite_set_section_contents): Likewise.
2519         (_bfd_nolink_sizeof_headers): Likewise.
2520         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
2521         (_bfd_nolink_bfd_relax_section): Likewise.
2522         (_bfd_nolink_bfd_gc_sections): Likewise.
2523         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
2524         (_bfd_nolink_bfd_merge_sections): Likewise.
2525         (_bfd_nolink_bfd_is_group_section): Likewise.
2526         (_bfd_nolink_bfd_discard_group): Likewise.
2527         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
2528         (_bfd_nolink_bfd_link_add_symbols): Likewise.
2529         (_bfd_nolink_bfd_link_just_syms): Likewise.
2530         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
2531         (_bfd_nolink_bfd_final_link): Likewise.
2532         (_bfd_nolink_bfd_link_split_section): Likewise.
2533         (_bfd_nolink_section_already_linked): Likewise.
2534         (_bfd_nolink_bfd_define_common_symbol): Likewise.
2535         (_bfd_nolink_bfd_define_start_stop): Likewise.
2536         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
2537         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
2538         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
2539         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
2540         * libbfd.c (bfd_false_any): Delete.
2541         (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
2542         (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
2543         * libbfd.h (extern): Regenerate
2544         * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
2545         cast to avoid warning from gcc v8 compiler.
2546         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
2547         * binary.c (binary_get_symbol_info): Likewise.
2548         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
2549         * coff-mips.c (mips_ecoff_backend_data): Likewise.
2550         * coffcode.h (coff_set_alignment_hook): Likewise.
2551         (symname_in_debug_hook): Likewise.
2552         (bfd_coff_backend_data bigobj_swap_table): Likewise.
2553         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
2554         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
2555         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
2556         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
2557         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
2558         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
2559         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
2560         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
2561         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
2562         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
2563         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
2564         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
2565         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
2566         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
2567         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
2568         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
2569         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
2570         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
2571         (bfd_elfNN_bfd_set_private_flags): Likewise.
2572         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
2573         (elf_backend_init_index_section): Likewise.
2574         (elf_backend_allow_non_load_phdr): Likewise.
2575         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
2576         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
2577         * ieee.c (ieee_construct_extended_name_table): Likewise.
2578         (ieee_write_armap): Likewise.
2579         (ieee_write_ar_hdr): Likewise.
2580         (ieee_bfd_is_target_special_symbol): Likewise.
2581         * ihex.c (ihex_canonicalize_symtab): Likewise.
2582         (ihex_bfd_is_target_special_symbol): Likewise.
2583         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
2584         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
2585         (_bfd_ecoff_set_alignment_hook): Likewise.
2586         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
2587         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
2588         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
2589         * oasys.c (oasys_construct_extended_name_table): Likewise.
2590         (oasys_write_armap): Likewise.
2591         (oasys_write_ar_hdr): Likewise.
2592         (oasys_bfd_is_target_special_symbol): Likewise.
2593         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
2594         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
2595         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
2596         * som.c (som_bfd_is_target_special_symbol): Likewise.
2597         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
2598         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
2599         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
2600         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
2601         (versados_bfd_reloc_name_lookup): Likewise.
2602         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
2603         (vms_bfd_define_start_stop): Likewise.
2604         (alpha_vms_bfd_is_target_special_symbol): Likewise.
2605         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
2606         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
2607
2608 2018-02-14  H.J. Lu  <hongjiu.lu@intel.com>
2609
2610         PR ld/22842
2611         * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
2612         PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
2613         * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
2614         R_X86_64_PC32 reloc against dynamic function in data section.
2615         Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
2616         (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
2617         against dynamic function in data section.
2618         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
2619         function address only if pcrel_plt is true.
2620         (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
2621         * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
2622         PC-relative PLT.  If PLT is PC-relative, don't generate dynamic
2623         PC-relative relocation against a function definition in data
2624         secton in PIE.  Remove the obsolete comments.
2625         (elf_x86_link_hash_table): Add pcrel_plt.
2626
2627 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
2628
2629         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
2630         instead of bfd_link_pic, for building shared library.
2631
2632 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
2633
2634         PR gas/22791
2635         * elf64-x86-64.c (is_32bit_relative_branch): Removed.
2636         (elf_x86_64_relocate_section): Check PIC relocations in PIE.
2637         Remove is_32bit_relative_branch usage.  Disallow PC32 reloc
2638         against protected function in shared object.
2639
2640 2018-02-13  Sergei Trofimovich  <slyfox@inbox.ru>
2641
2642         PR 22828
2643         * po/ru.po: Fix typo in Russian translation.
2644
2645 2018-02-13  Maciej W. Rozycki  <macro@mips.com>
2646
2647         * wasm-module.c (wasm_scan_name_function_section): Rename
2648         `index' local variable to `idx'.
2649
2650 2018-02-13  Nick Clifton  <nickc@redhat.com>
2651
2652         PR 22823
2653         Fix compile time warnings generated by gcc version 8.
2654         * libbfd-in.h: Remove extraneous text from prototypes.
2655         Add prototypes for bfd_false_any, bfd_true_any,
2656         bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
2657         bfd_n1_any, bfd_void_any.
2658         (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
2659         function.
2660         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
2661         (_bfd_generic_bfd_set_private_flags): Likewise.
2662         (_bfd_generic_bfd_copy_private_section_data): Likewise.
2663         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
2664         (_bfd_generic_bfd_copy_private_header_data): Likewise.
2665         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
2666         (_bfd_noarchive_construct_extended_name_table): Likewise.
2667         (_bfd_noarchive_truncate_arname): Likewise.
2668         (_bfd_noarchive_write_ar_hdr): Likewise.
2669         (_bfd_noarchive_get_elt_at_index): Likewise.
2670         (_bfd_nosymbols_canonicalize_symtab): Likewise.
2671         (_bfd_nosymbols_print_symbol): Likewise.
2672         (_bfd_nosymbols_get_symbol_info): Likewise.
2673         (_bfd_nosymbols_get_symbol_version_string): Likewise.
2674         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
2675         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
2676         (_bfd_nosymbols_get_lineno): Likewise.
2677         (_bfd_nosymbols_find_nearest_line): Likewise.
2678         (_bfd_nosymbols_find_line): Likewise.
2679         (_bfd_nosymbols_find_inliner_info): Likewise.
2680         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
2681         (_bfd_nosymbols_read_minisymbols): Likewise.
2682         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
2683         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
2684         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
2685         (_bfd_nowrite_set_arch_mach): Likewise.
2686         (_bfd_nowrite_set_section_contents): Likewise.
2687         (_bfd_nolink_sizeof_headers): Likewise.
2688         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
2689         (_bfd_nolink_bfd_relax_section): Likewise.
2690         (_bfd_nolink_bfd_gc_sections): Likewise.
2691         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
2692         (_bfd_nolink_bfd_merge_sections): Likewise.
2693         (_bfd_nolink_bfd_is_group_section): Likewise.
2694         (_bfd_nolink_bfd_discard_group): Likewise.
2695         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
2696         (_bfd_nolink_bfd_link_add_symbols): Likewise.
2697         (_bfd_nolink_bfd_link_just_syms): Likewise.
2698         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
2699         (_bfd_nolink_bfd_final_link): Likewise.
2700         (_bfd_nolink_bfd_link_split_section): Likewise.
2701         (_bfd_nolink_section_already_linked): Likewise.
2702         (_bfd_nolink_bfd_define_common_symbol): Likewise.
2703         (_bfd_nolink_bfd_define_start_stop): Likewise.
2704         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
2705         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
2706         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
2707         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
2708         * libbfd.c (bfd_false_any): New function.  Like bfd_false but
2709         accepts one or more arguments.
2710         (bfd_true_any): Likewise.
2711         (bfd_nullvoidptr_any): Likewise.
2712         (bfd_0_any): Likewise.
2713         (bfd_0u_any): Likewise.
2714         (bfd_0l_any): Likewise.
2715         (_bfd_n1_any): Likewise.
2716         (bfd_void_any): Likewise.
2717         * libbfd.h (extern): Regenerate
2718         * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
2719         based dummy function.
2720         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
2721         * binary.c (binary_get_symbol_info): Likewise.
2722         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
2723         * coff-mips.c (mips_ecoff_backend_data): Likewise.
2724         * coffcode.h (coff_set_alignment_hook): Likewise.
2725         (symname_in_debug_hook): Likewise.
2726         (bfd_coff_backend_data bigobj_swap_table): Likewise.
2727         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
2728         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
2729         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
2730         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
2731         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
2732         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
2733         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
2734         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
2735         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
2736         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
2737         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
2738         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
2739         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
2740         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
2741         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
2742         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
2743         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
2744         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
2745         (bfd_elfNN_bfd_set_private_flags): Likewise.
2746         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
2747         (elf_backend_init_index_section): Likewise.
2748         (elf_backend_allow_non_load_phdr): Likewise.
2749         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
2750         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
2751         * ieee.c (ieee_construct_extended_name_table): Likewise.
2752         (ieee_write_armap): Likewise.
2753         (ieee_write_ar_hdr): Likewise.
2754         (ieee_bfd_is_target_special_symbol): Likewise.
2755         * ihex.c (ihex_canonicalize_symtab): Likewise.
2756         (ihex_bfd_is_target_special_symbol): Likewise.
2757         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
2758         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
2759         (_bfd_ecoff_set_alignment_hook): Likewise.
2760         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
2761         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
2762         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
2763         * oasys.c (oasys_construct_extended_name_table): Likewise.
2764         (oasys_write_armap): Likewise.
2765         (oasys_write_ar_hdr): Likewise.
2766         (oasys_bfd_is_target_special_symbol): Likewise.
2767         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
2768         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
2769         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
2770         * som.c (som_bfd_is_target_special_symbol): Likewise.
2771         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
2772         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
2773         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
2774         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
2775         (versados_bfd_reloc_name_lookup): Likewise.
2776         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
2777         (vms_bfd_define_start_stop): Likewise.
2778         (alpha_vms_bfd_is_target_special_symbol): Likewise.
2779         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
2780         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
2781         * elf32-arc.c (get_replace_function): Assign replacement function
2782         to func pointer.
2783         * elf32-i370.c (i370_noop): Update prototype.
2784
2785 2018-02-13  Alan Modra  <amodra@gmail.com>
2786
2787         PR 22836
2788         * elf.c (_bfd_elf_fixup_group_sections): Account for removed
2789         relocation sections.  If size reduces to just the flag word,
2790         remove that too and mark with SEC_EXCLUDE.
2791         * elflink.c (bfd_elf_final_link): Strip empty group sections.
2792
2793 2018-02-13  Alan Modra  <amodra@gmail.com>
2794
2795         PR 22829
2796         * elf.c (assign_file_positions_for_non_load_sections): Rewrite
2797         PT_GNU_RELRO setup.
2798
2799 2018-02-12  Zebediah Figura  <z.figura12@gmail.com>
2800
2801         * i386msdos.c (msdos_mkobject); New function.
2802         (msdos_object_p): New function.
2803         (i386_msdos_vec): Use msdos_object_p as the check_format
2804         function.
2805         * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
2806         NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
2807         IMAGE_NT_SIGNATURE.
2808         * peXXigen.c: Likewise.
2809         * coff-ia64.c: Likewise.
2810
2811 2018-02-12  Nick Clifton  <nickc@redhat.com>
2812
2813         * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
2814         assignment.
2815         * elf32-arc.c (elf_arc_relocate_section): Likewise.
2816
2817 2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
2818
2819         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
2820         (sparc_elf_append_rela): Assert that there is enough room in section.
2821         (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
2822         (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
2823         (allocate_dynrelocs): Remove outdated comments and reorder conditions.
2824         For a symbol subject to a GOT relocation, reserve a slot in the
2825         relocation section if the symbol isn't dynamic and we are in PIC mode.
2826         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
2827         is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
2828         <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
2829         <R_SPARC_PC10>: Reorder conditions.  Remove always-false assertion.
2830         (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
2831         resolved_to_zero.  Do not generate a dynamic GOT relocation for an
2832         undefined weak symbol with non-default visibility.  Remove superfluous
2833         'else' and fix formatting.
2834
2835 2018-02-09  H.J. Lu  <hongjiu.lu@intel.com>
2836
2837         * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
2838         is_solaris.
2839         (i386_elf32_sol2_vec): Don't declare.
2840         (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
2841         Don't set need_global_offset_table.
2842         (elf_i386_solaris_arch_bed): New.
2843         (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
2844         Solaris.
2845         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
2846         target_os != is_nacl instead of target_os == is_normal.
2847         (x86_64_elf64_sol2_vec): Don't declare.
2848         (elf_x86_64_link_setup_gnu_properties): Check target_os !=
2849         is_nacl instead of target_os == is_normal.  Don't set
2850         need_global_offset_table.
2851         (elf_x86_64_solaris_arch_bed): New.
2852         (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
2853         Solaris.
2854         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
2855         _GLOBAL_OFFSET_TABLE_ for Solaris.
2856         (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
2857         need_global_offset_table.
2858         * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
2859         (elf_x86_link_hash_table): Remove need_global_offset_table.
2860         (elf_x86_init_table): Likewise.
2861
2862 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
2863
2864         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
2865         Remove prototype.
2866         (i386_elf32_sol2_vec): Declared.
2867         (elf_i386_link_setup_gnu_properties): Set
2868         need_global_offset_table with info->output_bfd->xvec.
2869         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
2870         Remove prototype.
2871         (x86_64_elf64_sol2_vec): Declared.
2872         (elf_x86_64_link_setup_gnu_properties): Set
2873         need_global_offset_table with info->output_bfd->xvec.
2874
2875 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
2876
2877         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
2878         New prototype.
2879         (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
2880         for Solaris.
2881         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
2882         New prototype.
2883         (elf_x86_64_link_setup_gnu_properties): Set
2884         need_global_offset_table for Solaris.
2885         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
2886         unused _GLOBAL_OFFSET_TABLE_ for Solaris.
2887         (_bfd_x86_elf_link_setup_gnu_properties): Copy
2888         need_global_offset_table.
2889         * elfxx-x86.h (elf_x86_link_hash_table): Add
2890         need_global_offset_table.
2891         (elf_x86_init_table): Likewise.
2892
2893 2018-02-08  Jim Wilson  <jimw@sifive.com>
2894
2895         * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
2896         change.
2897
2898 2018-02-08  Nick Clifton  <nickc@redhat.com>
2899
2900         PR 22788
2901         * elf.c (elf_parse_notes): Reject notes with excessuively large
2902         alignments.
2903
2904 2018-02-07  Alan Modra  <amodra@gmail.com>
2905
2906         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
2907         * elf32-ppc.c: Remove speculation barrier support.
2908         * elf32-ppc.h: Likewise.
2909         * elf64-ppc.c: Likewise.
2910         * elf64-ppc.h: Likewise.
2911
2912 2018-02-06  Jim Wilson  <jimw@sifive.com>
2913
2914         * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
2915         callback to report an error.
2916
2917 2018-02-06  Eric Botcazou  <ebotcazou@adacore.com>
2918
2919         PR ld/22263
2920         * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
2921         into call to !bfd_link_executable and tidy up.
2922         (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
2923         <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
2924         !bfd_link_executable.
2925         <R_SPARC_TLS_IE_HI22>: Likewise.
2926         <GOT relocations>: Remove useless code, tidy and merge related blocks.
2927         <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
2928         !bfd_link_executable.
2929         <R_SPARC_WPLT30>: Tidy up.
2930         (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
2931         !bfd_link_executable.
2932         (allocate_dynrelocs): Likewise.
2933         (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
2934         <R_SPARC_TLS_GD_HI22>: Merge into...
2935         <R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
2936         sparc_elf_tls_transition and remove redundant code.
2937         <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
2938         !bfd_link_executable.
2939         <R_SPARC_TLS_LDO_HIX22>: Likewise.
2940         <R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
2941         <R_SPARC_TLS_LDM_CALL>: Likewise.
2942         <R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
2943         <R_SPARC_TLS_GD_ADD>: Likewise.
2944         <R_SPARC_TLS_LDM_ADD>: Likewise.
2945         <R_SPARC_TLS_LDO_ADD>: Likewise.
2946         <R_SPARC_TLS_IE_LD>: Likewise.
2947
2948 2018-02-06  MiloÅ¡ Stojanović  <milos.stojanovic@rt-rk.com>
2949
2950         PR 22789
2951         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
2952         functions failed to find the function name, try the generic elf
2953         find function instead.
2954
2955 2018-02-06  Sergio Durigan Junior  <sergiodj@redhat.com>
2956
2957         * coff-rs6000.c (xcoff_write_archive_contents_old): Use
2958         'memcpy' instead of 'strncpy' when writing the magic number.
2959
2960 2018-02-06  Nick Clifton  <nickc@redhat.com>
2961
2962         PR 22794
2963         * opncls.c (bfd_get_debug_link_info_1): Check the size of the
2964         section before attempting to read it in.
2965         (bfd_get_alt_debug_link_info): Likewise.
2966
2967 2018-02-06  Paul Carroll  <pcarroll@codesourcery.com>
2968
2969         * bfd/dwarf2.c (find_abstract_name): Modified to return file and
2970         line information in addition to name, if they can be found.
2971
2972 2018-02-05  Renlin Li  <renlin.li@arm.com>
2973
2974         PR ld/22764
2975         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
2976         R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
2977         check for writeable section as well.
2978
2979 2018-02-05  H.J. Lu  <hongjiu.lu@intel.com>
2980
2981         PR ld/22782
2982         * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
2983         _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
2984         undefined weak symbol to 0.
2985         * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
2986         if _GLOBAL_OFFSET_TABLE_ is referenced.
2987         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
2988         got_referenced instead of ref_regular_nonweak.  Remove the
2989         unused _GLOBAL_OFFSET_TABLE_ from symbol table.
2990         * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
2991
2992 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
2993
2994         * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
2995         initialize `hi_reloc'.
2996
2997 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
2998
2999         * elfxx-mips.c (_bfd_mips_elf_section_processing): For
3000         SHT_MIPS_REGINFO sections don't assert the correct size and
3001         report an error instead.
3002
3003 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
3004
3005         * elf.c (_bfd_elf_write_object_contents): Propagate a failure
3006         status from `->elf_backend_section_processing'.
3007
3008 2018-02-02  Jim Wilson  <jimw@sifive.com>
3009
3010         PR ld/22756
3011         * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
3012         If link_info->wrap_hash, check for a duplicate symbol and ignore.
3013         (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
3014         Pass new argument to riscv_relax_delete_bytes.
3015         (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise.  Remove
3016         ATTRIBUTE_UNUSED from link_info parameter.
3017
3018 2018-02-02  Alan Modra  <amodra@gmail.com>
3019
3020         * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
3021         emitted for toc sequence optimization.  Set and use "howto" later.
3022
3023 2018-02-01  Simon Marchi  <simon.marchi@ericsson.com>
3024
3025         * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
3026         arithmetic on NULL pointer.
3027         * elflink.c (_bfd_elf_archive_symbol_lookup,
3028         elf_link_add_archive_symbols): Likewise.
3029
3030 2018-01-31  Michael Matz  <matz@suse.de>
3031
3032         * elflink.c (bfd_elf_define_start_stop): Fix check of
3033         def_dynamic.
3034
3035 2018-01-31  H.J. Lu  <hongjiu.lu@intel.com>
3036
3037         PR ld/21964
3038         * elflink.c (bfd_elf_define_start_stop): Check if __start and
3039         __stop symbols are referenced by shared objects.
3040
3041 2018-01-30  Alan Modra  <amodra@gmail.com>
3042
3043         PR 22758
3044         * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
3045         segment when demand paged with lma on the same page.  Test this
3046         before load/non-load, executable/non-executable,
3047         writable/non-writable tests and simplify.  Delete bogus relro
3048         condition in writable/non-writable test.  Delete outdated
3049         comment.  Formatting.
3050
3051 2018-01-30  Alan Modra  <amodra@gmail.com>
3052
3053         * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
3054         symbols dynamic.
3055
3056 2018-01-29  Alan Modra  <amodra@gmail.com>
3057
3058         PR 22741
3059         * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
3060         range before converting to a symbol table pointer.
3061
3062 2018-01-27  Nick Clifton  <nickc@redhat.com>
3063
3064         * po/ru.po: Updated Russian translation.
3065
3066 2018-01-26  Alan Modra  <amodra@gmail.com>
3067
3068         * elflink.c (bfd_elf_define_start_stop): Override symbols when
3069         they are defined dynamically.
3070
3071 2018-01-26  Alan Modra  <amodra@gmail.com>
3072
3073         * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
3074         .branch_lt changes size.
3075
3076 2018-01-25  Alan Modra  <amodra@gmail.com>
3077
3078         PR 22746
3079         * elfcode.h (elf_object_p): Avoid integer overflow.
3080
3081 2018-01-25  Eric Botcazou  <ebotcazou@adacore.com>
3082
3083         PR ld/22727
3084         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
3085         Do a mere lookup of the __tls_get_addr symbol instead of adding it.
3086
3087         Revert
3088         2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
3089
3090         PR ld/22263
3091         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
3092         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
3093         bfd_link_executable for TLS check.
3094         (_bfd_sparc_elf_check_relocs): Likewise.
3095         (allocate_dynrelocs): Likewise.
3096         (_bfd_sparc_elf_relocate_section): Likewise.
3097
3098 2018-01-24  Renlin Li  <renlin.li@arm.com>
3099
3100         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
3101         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3102         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3103         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3104         BFD_RELOC_AARCH64_MOVW_PREL_G3.
3105         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3106         (_bfd_aarch64_elf_resolve_relocation): Likewise.
3107
3108 2018-01-24  Renlin Li  <renlin.li@arm.com>
3109
3110         * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
3111         BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
3112         BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
3113         BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
3114         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
3115         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3116         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3117         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3118         BFD_RELOC_AARCH64_MOVW_PREL_G3.
3119         * bfd-in2.h: Regenerate.
3120         * libbfd.h: Regenerate.
3121
3122 2018-01-23  Maciej W. Rozycki  <macro@mips.com>
3123
3124         * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
3125         `mips_elf32_section_processing' comment reference.
3126
3127 2018-01-20  H.J. Lu  <hongjiu.lu@intel.com>
3128
3129         PR ld/22721
3130         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
3131         versioned __tls_get_addr symbol.
3132
3133 2018-01-19  Nick Clifton  <nickc@redhat.com>
3134
3135         * po/fr.po: Updated French translation.
3136
3137 2018-01-18  Alan Modra  <amodra@gmail.com>
3138
3139         * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
3140         * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
3141         (ppc64_elf_build_stubs): Likewise.
3142
3143 2018-01-17  Nick Clifton  <nickc@redhat.com>
3144
3145         * po/ru.po: Updated Russian translation.
3146         * po/uk/po: Updated Ukranian translation.
3147
3148 2018-01-17  Alan Modra  <amodra@gmail.com>
3149
3150         * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
3151
3152 2018-01-17  Alan Modra  <amodra@gmail.com>
3153
3154         * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
3155         (CRSETEQ, BEQCTRM): Define.
3156         (is_nonpic_glink_stub): Don't check bctr.
3157         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3158         (ppc_elf_relax_section): Size speculation barrier.
3159         (output_bctr): New function.
3160         (write_glink_stub): Use output_bctr.
3161         (ppc_elf_relocate_section): Use output_bctr for long branch stub.
3162         (ppc_elf_finish_dynamic_symbol): Likewise.
3163         (ppc_elf_finish_dynamic_sections): Use output_bctr.
3164         * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
3165         * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
3166         (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
3167         (size_global_entry_stubs): Handle speculation barrier sizing.
3168         (plt_stub_size): Likewise.
3169         (output_bctr): New function.
3170         (build_plt_stub, build_tls_get_addr_stub): Output speculation
3171         barrier.
3172         (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
3173         (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
3174         (build_global_entry_stubs): Output speculation barrier.
3175         (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
3176         * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
3177
3178 2018-01-17  Alan Modra  <amodra@gmail.com>
3179
3180         * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
3181         __tls_get_addr_opt, and alignment sizing.
3182         (TLS_GET_ADDR_GLINK_SIZE): Delete.
3183         (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
3184         (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
3185         or 8 insns.
3186         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3187         (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
3188         (ppc_elf_size_dynamic_sections): Likewise.  Size branch table
3189         by PLT reloc count.
3190         (write_glink_stub): Handle __tls_get_addr_opt stub.
3191         Pad out to size given by GLINK_ENTRY_SIZE.
3192         (ppc_elf_relocate_section): Adjust write_glink_stub call.
3193         (ppc_elf_finish_dynamic_symbol): Likewise.
3194         (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
3195         insn array since so many need rewriting.
3196         * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
3197         * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
3198         GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
3199         nops.  Adjust all uses.
3200         (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
3201         in glink_vma calculation.
3202         (struct ppc_link_hash_table): Add global_entry section pointer.
3203         (create_linkage_sections): Create separate section for global
3204         entry stubs.
3205         (PPC_LO, PPC_HI, PPC_HA): Move earlier.
3206         (size_global_entry_stubs): Handle sizing for aligned stubs.
3207         (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
3208         and don't stash end of glink branch table in rawsize.
3209         (ppc_build_one_stub): Rewrite stub size calculations.
3210         (build_global_entry_stubs): Use new section.
3211         (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
3212         Build lazy link stubs out to end of section.  Build global entry
3213         stubs in new section.
3214
3215 2018-01-15  Nick Clifton  <nickc@redhat.com>
3216
3217         * po/uk.po: Updated Ukranian translation.
3218
3219 2018-01-13  Nick Clifton  <nickc@redhat.com>
3220
3221         * po/bfd.pot: Regenerated.
3222
3223 2018-01-13  Nick Clifton  <nickc@redhat.com>
3224
3225         * version.m4: Bump version to 2.30.51
3226         * configure: Regenerate.
3227
3228 2018-01-13  Nick Clifton  <nickc@redhat.com>
3229
3230         2.30 branch created.
3231
3232 2018-01-12  Jens Widell  <jl@opera.com>
3233
3234         * elf.c (setup_group): Optimize search for group by remembering
3235         last found group and restarting search at that index.
3236         * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
3237
3238 2018-01-12  Gunther Nikl  <gnikl@users.sourceforge.net>
3239
3240         * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
3241         bfd_link_common_skip_none in switch.
3242
3243 2018-01-12  Alan Modra  <amodra@gmail.com>
3244
3245         PR ld/22649
3246         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
3247         references on forced local symbols.
3248
3249 2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
3250
3251         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
3252         .reginfo section has wrong size.
3253
3254 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3255
3256         PR ld/22393
3257         * elf.c (_bfd_elf_map_sections_to_segments): When generating
3258         separate code and read-only data LOAD segments, create a new
3259         LOAD segment if the previous section contains text and the
3260         current section doesn't or vice versa.  Don't put a writable
3261         section in a read-only segment if there is a RELRO segment.
3262
3263 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3264
3265         PR ld/22649
3266         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
3267         references on forced local symbols.
3268
3269 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3270
3271         PR ld/22677
3272         * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
3273         INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
3274
3275 2018-01-09  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3276
3277         PR 22662
3278         * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
3279
3280 2018-01-03  John Baldwin  <jhb@FreeBSD.org>
3281
3282         * elf.c (elfcore_grok_freebsd_note): Handle
3283         NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
3284         NT_FREEBSD_PROCSTAT_VMMAP.
3285
3286 2018-01-03  Alan Modra  <amodra@gmail.com>
3287
3288         Update year range in copyright notice of all files.
3289
3290 For older changes see ChangeLog-2017
3291 \f
3292 Copyright (C) 2018 Free Software Foundation, Inc.
3293
3294 Copying and distribution of this file, with or without modification,
3295 are permitted in any medium without royalty provided the copyright
3296 notice and this notice are preserved.
3297
3298 Local Variables:
3299 mode: change-log
3300 left-margin: 8
3301 fill-column: 74
3302 version-control: never
3303 End: