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