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