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