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