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