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