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