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