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