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