Fix potential illegal memory access in AVR backend.
[external/binutils.git] / bfd / ChangeLog
1 2018-08-01  Nick Clifton  <nickc@redhat.com>
2
3         * elf32-avr.c (avr_stub_name): Check for a NULL return from
4         bfd_malloc.
5
6 2018-08-01  Zenith  <zenith432@users.sourceforge.net>
7
8         PR 23460
9         * plugin.c (bfd_plugin_open_input): Close file descriptor if the
10         call to fstat fails.
11         (try_claim): Always close the file descriptor at the end of the
12         function.
13         (try_load_plugin): If a plugin has already been registered, then
14         skip the dlopen and onload steps and go straight to claiming the
15         file.  If these is an error, close the plugin.
16
17 2018-08-01  Alan Modra  <amodra@gmail.com>
18
19         * elf64-ppc.c (plt_stub_pad): Delay plt_stub_size call until needed.
20         (ppc_build_one_stub): Don't set stub_offset, instead assert that
21         it is sane.  Don't adjust stub_offset for alignment.  Adjust size
22         calculation.  Use "targ" temp when calculating offsets.
23         (ppc_size_one_stub): Set stub_offset here.  Use "targ" temp when
24         calculating offsets.  Adjust for alignment before setting
25         tls_get_addr_opt_bctrl.
26
27 2018-08-01  Alan Modra  <amodra@gmail.com>
28
29         * po/SRC-POTFILES.in: Regenerate.
30
31 2018-07-30  Nick Clifton  <nickc@redhat.com>
32
33         PR 22706
34         * elf32-sh.c (sh_elf_relocate_section): When processing
35         translation relocs, fail if the relocation offset is too small.
36         Replace BFD_ASSERTs with more helpful error messages.
37
38 2018-07-30  Andrew Jenner  <andrew@codesourcery.com>
39
40         * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY.
41         (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise.
42         * Makefile.in: Regenerated.
43         * archures.c (enum bfd_architecture): Add bfd_arch_csky and
44         related bfd_mach defines.
45         (bfd_csky_arch): Declare.
46         (bfd_archures_list): Add C-SKY.
47         * bfd-in.h (elf32_csky_build_stubs): Declare.
48         (elf32_csky_size_stubs): Declare.
49         (elf32_csky_next_input_section: Declare.
50         (elf32_csky_setup_section_lists): Declare.
51         * bfd-in2.h: Regenerated.
52         * config.bfd: Add C-SKY.
53         * configure.ac: Likewise.
54         * configure: Regenerated.
55         * cpu-csky.c: New file.
56         * elf-bfd.h (enum elf_target_id): Add C-SKY.
57         * elf32-csky.c: New file.
58         * libbfd.h: Regenerated.
59         * reloc.c: Add C-SKY relocations.
60         * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare.
61         (_bfd_target_vector): Add C-SKY target vector entries.
62
63 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
64
65         * elf32-s12z.c (ELF_TARGET_ID): Don't define.
66
67 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
68
69         * libbfd.c (bfd_getb24, bfd_getl24): New functions.
70         (bfd_get_24, bfd_put_24): New macros.
71         * bfd-in2.h: Regenerate.
72
73 2018-07-27  John Darrington  <john@darrington.wattle.id.au>
74
75         * elf32-s12z.c (s12z_elf_set_mach_from_flags): Remove comment.
76
77 2018-07-26  Alan Modra  <amodra@gmail.com>
78
79         * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off
80         for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1.
81
82 2018-07-25  Alan Modra  <amodra@gmail.com>
83
84         * elf32-ppc.c (ppc_elf_relax_section): Ignore common or undef locals.
85         Avoid trashing toff with added when used as a symbol index.
86         Ignore R_PPC_PLTREL24 addends in unused example code.  Avoid
87         creating unnecessary fixups when relocatable.
88
89 2018-07-25  Alan Modra  <amodra@gmail.com>
90
91         * elf32-arm.c (elf32_arm_nabi_write_core_note): Disable
92         -Wstringop-truncation warning for gcc-8.0 too.
93         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
94         * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
95         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
96         * elf32-s390.c (elf_s390_write_core_note): Comment fix.
97         * elf64-s390.c (elf_s390_write_core_note): Likewise.
98
99 2018-07-24  Alan Modra  <amodra@gmail.com>
100
101         PR 23430
102         * dwarf2.c (dwarf_debug_section_enum): Fix comment typo.
103         * elf.c (bfd_section_from_shdr, elf_sort_sections): Likewise.
104
105 2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>
106
107         * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
108         relocation sections consistency check to always check both
109         .rela.dyn and .rela.plt when they exist. Rearrange variable
110         definition and assignment places.
111
112 2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>
113
114         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
115         relocations section for dynamic undefined weak symbols when
116         linking a shared object.
117
118 2018-07-23  Tom Tromey  <tom@tromey.com>
119
120         * elf.c (bfd_get_elf_phdrs): Don't call memcpy with size 0.
121
122 2018-07-21  Eric Botcazou  <ebotcazou@adacore.com>
123
124         * elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
125         cleanup for the case of a global symbol that binds locally.  Also
126         install a value in the GOT slot in the case of a local symbol in
127         a non-PIC link.
128
129 2018-07-20  H.J. Lu  <hongjiu.lu@intel.com>
130
131         PR ld/23428
132         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): If the
133         separate code program header is needed, make sure that the first
134         read-only PT_LOAD segment has no code by adding a
135         GNU_PROPERTY_X86_ISA_1_USED note.
136
137 2018-07-20  Chenghua Xu  <paul.hua.gm@gmail.com>
138             Maciej W. Rozycki  <macro@mips.com>
139
140         * elfxx-mips.c (print_mips_ases): Add MMI extension.
141
142 2018-07-20  Maciej W. Rozycki  <macro@mips.com>
143
144         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Do not
145         create DT_REL, DT_RELSZ or DT_RELENT dynamic entries if the
146         dynamic relocation section will be discarded from output.
147         (_bfd_mips_elf_finish_dynamic_sections) <DT_RELSZ>: Assert that
148         the dynamic relocation section will be retained in output.
149
150 2018-07-18  Maciej W. Rozycki  <macro@mips.com>
151
152         * xcofflink.c (xcoff_write_global_symbol): Fix symbol type
153         checks for defined weak symbols.
154
155 2018-07-17  Maciej W. Rozycki  <macro@mips.com>
156
157         * elf32-nds32.c (nds32_elf_relax_loadstore): Use
158         `bfd_is_abs_symbol' rather than `bfd_is_abs_section' in checking
159         whether the symbol is absolute.
160         (nds32_elf_relax_lo12): Likewise.
161         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
162         (elfNN_aarch64_check_relocs): Likewise.
163         * xcofflink.c (xcoff_need_ldrel_p): Likewise.
164         (bfd_xcoff_import_symbol): Likewise.
165         (xcoff_write_global_symbol): Likewise.
166
167 2018-07-17  Maciej W. Rozycki  <macro@mips.com>
168
169         * linker.c (bfd_is_abs_symbol): New macro.
170         * bfd-in2.h: Regenerate.
171
172 2018-07-16  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
173
174         * elf-bfd.h (elfcore_write_ppc_tar): Add prototype.
175         (elfcore_write_ppc_ppr): Likewise.
176         (elfcore_write_ppc_dscr): Likewise.
177         (elfcore_write_ppc_ebb): Likewise.
178         (elfcore_write_ppc_pmu): Likewise.
179         (elfcore_write_ppc_tm_cgpr): Likewise.
180         (elfcore_write_ppc_tm_cfpr): Likewise.
181         (elfcore_write_ppc_tm_cvmx): Likewise.
182         (elfcore_write_ppc_tm_cvsx): Likewise.
183         (elfcore_write_ppc_tm_spr): Likewise.
184         (elfcore_write_ppc_tm_ctar): Likewise.
185         (elfcore_write_ppc_tm_cppr): Likewise.
186         (elfcore_write_ppc_tm_cdscr): Likewise.
187         * elf.c (elfcore_write_ppc_tar): New function.
188         (elfcore_write_ppc_ppr): Likewise.
189         (elfcore_write_ppc_dscr): Likewise.
190         (elfcore_write_ppc_ebb): Likewise.
191         (elfcore_write_ppc_pmu): Likewise.
192         (elfcore_write_ppc_tm_cgpr): Likewise.
193         (elfcore_write_ppc_tm_cfpr): Likewise.
194         (elfcore_write_ppc_tm_cvmx): Likewise.
195         (elfcore_write_ppc_tm_cvsx): Likewise.
196         (elfcore_write_ppc_tm_spr): Likewise.
197         (elfcore_write_ppc_tm_ctar): Likewise.
198         (elfcore_write_ppc_tm_cppr): Likewise.
199         (elfcore_write_ppc_tm_cdscr): Likewise.
200         (elfcore_write_register_note): Call them.
201         (elfcore_grok_ppc_tar): New function.
202         (elfcore_grok_ppc_ppr): Likewise.
203         (elfcore_grok_ppc_dscr): Likewise.
204         (elfcore_grok_ppc_ebb): Likewise.
205         (elfcore_grok_ppc_pmu): Likewise.
206         (elfcore_grok_ppc_tm_cgpr): Likewise.
207         (elfcore_grok_ppc_tm_cfpr): Likewise.
208         (elfcore_grok_ppc_tm_cvmx): Likewise.
209         (elfcore_grok_ppc_tm_cvsx): Likewise.
210         (elfcore_grok_ppc_tm_spr): Likewise.
211         (elfcore_grok_ppc_tm_ctar): Likewise.
212         (elfcore_grok_ppc_tm_cppr): Likewise.
213         (elfcore_grok_ppc_tm_cdscr): Likewise.
214         (elfcore_grok_note): Call them.
215
216 2018-07-11  Maciej W. Rozycki  <macro@mips.com>
217
218         * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
219         than `!bfd_link_pic' in determining the dynamic symbol index.
220         Avoid the index of -1.
221         (mips_elf_initialize_tls_slots): Likewise.  Flatten code by
222         moving `dyn' to the beginning of the function block.
223
224 2018-07-11  Maciej W. Rozycki  <macro@mips.com>
225             Rich Felker  <bugdal@aerifal.cx>
226
227         PR ld/22570
228         * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
229         than `bfd_link_pic' to determine whether dynamic relocations are
230         to be produced.
231         (mips_elf_initialize_tls_slots): Likewise.
232
233 2018-07-10  Maciej W. Rozycki  <macro@mips.com>
234
235         * elflink.c (bfd_elf_final_link): Rename `remove' local variable
236         to `remove_section'.
237
238 2018-07-10  Alan Modra  <amodra@gmail.com>
239
240         * elf32-xgate.h: Delete.
241         * elf32-xgate.c: Delete unnecessary forward declarations, add two
242         that are now needed.
243         (xgate_elf_bfd_link_hash_table_create)
244         (xgate_elf_bfd_link_hash_table_free)
245         (xgate_elf_set_mach_from_flags, struct xgate_scan_param)
246         (stub_hash_newfunc, elf32_xgate_add_symbol_hook)
247         (elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
248         (elf32_xgate_build_stubs, elf32_xgate_check_relocs)
249         (elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
250         (elf32_xgate_post_process_headers): Delete.
251         (elf32_xgate_backend_symbol_processing): New function.
252         (xgate_elf_ignore_reloc, xgate_elf_special_reloc)
253         (_bfd_xgate_elf_print_private_bfd_data): Make static.
254         (ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
255         (elf_backend_relocate_section, elf_backend_object_p)
256         (elf_backend_final_write_processing, elf_backend_can_gc_sections)
257         (elf_backend_post_process_headers, elf_backend_add_symbol_hook)
258         (bfd_elf32_bfd_link_hash_table_create)
259         (bfd_elf32_bfd_set_private_flags)
260         (xgate_stub_hash_lookup): Don't define.
261         (elf_backend_symbol_processing): Define.
262         * elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
263
264 2018-07-09  Maciej W. Rozycki  <macro@mips.com>
265
266         * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
267         `->needs_lazy_stub' if the stubs output section is the absolute
268         section.
269
270 2018-07-09  H.J. Lu  <hongjiu.lu@intel.com>
271
272         PR ld/23388
273         * configure.ac: Use changequote for "i[3-7]86-*-linux-*".
274         * configure: Regenerated.
275
276 2018-07-09  Alan Modra  <amodra@gmail.com>
277
278         * elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
279         _bfd_elf_post_process_headers.
280
281 2018-07-06  Max Filippov  <jcmvbkbc@gmail.com>
282
283         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Don't allocate
284         space for dynamic relocation for undefined weak symbol.
285         (elf_xtensa_relocate_section): Don't emit R_XTENSA_RELATIVE
286         relocation for undefined weak symbols.
287         (shrink_dynamic_reloc_sections): Don't shrink dynamic relocation
288         section for relocations against undefined weak symbols.
289
290 2018-07-06  Alan Hayward  <alan.hayward@arm.com>
291
292         * elf.c (elfcore_grok_aarch_sve): New function.
293         (elfcore_grok_note): Check for Aarch64 SVE.
294         (elfcore_write_aarch_sve): New function.
295         (elfcore_write_register_note): Check for Aarch64 SVE.
296         * elf-bfd.h(elfcore_grok_aarch_sve): New declaration.
297
298 2018-07-06  Alan Modra  <amodra@gmail.com>
299
300         * elf32-arm.c (elf32_arm_nabi_write_core_note): Don't use
301         DIAGNOTIC_PUSH and DIAGNOSTIC_POP unconditionally.
302         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
303         * elf32-s390.c (elf_s390_write_core_note): Likewise.
304         * elf64-ppc.c (ppc64_elf_write_core_note): Likewise.
305         * elf64-s390.c (elf_s390_write_core_note): Likewise.
306         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
307
308 2018-07-05  Jim Wilson  <jimw@sifive.com>
309
310         * config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
311         (riscv64*-*-*): Likewise.
312         (riscv-*-*): Add as an alias for riscv32*-*-*.
313
314 2018-07-05  H.J. Lu  <hongjiu.lu@intel.com>
315
316         PR ld/23372
317         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
318         ISA properties with empty bits.
319
320 2018-07-05  Nick Clifton  <nickc@redhat.com>
321
322         * po/ru.po: Updated Russian translation.
323
324 2018-07-05  Alan Modra  <amodra@gmail.com>
325
326         * elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
327         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
328         on mismatch.  Remove "warning: " from messages.  Track last bfd
329         used to set tags.
330         (ppc_elf_merge_obj_attributes): Likewise.  Handle status from
331         _bfd_elf_ppc_merge_fp_attributes.
332         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
333         from _bfd_elf_ppc_merge_fp_attributes.
334
335 2018-07-04  H.J. Lu  <hongjiu.lu@intel.com>
336
337         * Makefile.am (bfdinclude_HEADERS): Add $(INCDIR)/diagnostics.h.
338         * Makefile.in: Regenerated.
339
340 2018-07-03  Alan Modra  <amodra@gmail.com>
341
342         * elflink.c (bfd_elf_final_link): Remove zero size .gnu.attributes
343         sections.
344
345 2018-07-03  Alan Modra  <amodra@gmail.com>
346
347         * elf-bfd.h (ATTR_TYPE_FLAG_ERROR, ATTR_TYPE_HAS_ERROR): Define.
348         * elf-attrs.c (is_default_attr): Handle ATTR_TYPE_HAS_ERROR.
349         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Use
350         ATTR_TYPE_FLAG_INT_VAL.  Set ATTR_TYPE_HAS_ERROR on finding
351         incompatible attribute.
352         (ppc_elf_merge_obj_attributes): Likewise.  Return
353         _bfd_elf_merge_object_attributes result.
354         * elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Return
355         _bfd_elf_merge_object_attributes result.
356
357 2018-07-03  Alan Modra  <amodra@gmail.com>
358
359         PR 17550
360         * elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
361         in discarded sections.
362
363 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
364
365         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Set
366         `mark' for symbols created from `mips_elf_dynsym_rtproc_names'
367         list.
368
369 2018-07-02  Maciej W. Rozycki  <macro@mips.com>
370
371         * elf64-mips.c (micromips_elf64_howto_table_rel): Add
372         R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
373         R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
374         R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
375         R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
376         R_MICROMIPS_PC23_S2 relocation entries.
377         (micromips_elf64_howto_table_rela): Likewise.
378         (micromips_reloc_map): Likewise.
379         * elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
380         (elf_micromips_howto_table_rela): Likewise.
381         (micromips_reloc_map): Likewise.
382
383 2018-07-02  H.J. Lu  <hongjiu.lu@intel.com>
384
385         PR ld/23324
386         * elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
387         R_X86_64_converted_reloc_bit bit.
388
389 2018-07-02  Jeff Muizelaar  <jrmuizel@gmail.com>
390             Tom Tromey  <tom@tromey.com>
391
392         PR 13157
393         PR 21787
394         * mach-o.c (bfd_mach_o_fat_close_and_cleanup): New function.
395         (bfd_mach_o_close_and_cleanup): Redefine.
396         * archive.c (_bfd_unlink_from_archive_parent): New function,
397         extracted from..
398         (_bfd_archive_close_and_cleanup): ..here.
399         (bfd_generic_archive_p): Do not clear archive's format.
400         * libbfd-in.h (_bfd_unlink_from_archive_parent): Declare.
401         * libbfd.h: Regenerate.
402
403 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
404
405         * archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
406         bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
407         bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
408         bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
409         * bfd-in2.h: Regenerate.
410         * cpu-arm.c (arch_info_struct): Add entries for above new
411         bfd_mach_arm values.
412         * elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
413         bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
414         architectures.  Force assert failure for any new Tag_CPU_arch value.
415
416 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
417
418         * doc/bfdint.texi: Use command-line consistently when used in a
419         compount word.
420         * doc/bfdsumm.texi: Likewise.
421
422 2018-06-29  Maciej W. Rozycki  <macro@mips.com>
423
424         * elfxx-mips.c (allocate_dynrelocs): Remove extraneous symbol
425         visibility check made for undefined weak symbols.
426
427 2018-06-26  Nick Clifton  <nickc@redhat.com>
428
429         * po/uk.po: Updated Ukranian translation.
430
431 2018-06-25  Nick Clifton  <nickc@redhat.com>
432
433         * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check
434         for malloc returning NULL.
435         (_bfd_aarch64_erratum_843419_fixup): Check for
436         _bfd_aarch64_erratum_835769_stub_name returning NULL.
437
438 2018-06-24  Nick Clifton  <nickc@redhat.com>
439
440         * po/bfd.pot: Regenerate.
441
442 2018-06-24  Nick Clifton  <nickc@redhat.com>
443
444         * version.m4: Update version string to 2.31.51.
445         * configure: Regenerate.
446
447 2018-06-24  Nick Clifton  <nickc@redhat.com>
448
449         2.31 branch created.
450
451 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
452
453         * elfxx-mips.c (_bfd_mips_elf_compact_eh_encoding)
454         (_bfd_mips_elf_cant_unwind_opcode): Correct formatting.
455
456 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
457
458         * elfxx-mips.c (_bfd_mips_post_process_headers): Keep
459         EI_ABIVERSION setting together.
460
461 2018-06-21  Maciej W. Rozycki  <macro@mips.com>
462
463         * elfxx-mips.c (MIPS_LIBC_ABI_DEFAULT, MIPS_LIBC_ABI_MIPS_PLT)
464         (MIPS_LIBC_ABI_UNIQUE, MIPS_LIBC_ABI_MIPS_O32_FP64)
465         (MIPS_LIBC_ABI_MAX): New enumeration constants.
466         (_bfd_mips_post_process_headers): Use them in place of magic
467         numbers.
468
469 2018-06-21  Jim Wilson  <jimw@sifive.com>
470
471         * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Update comment.
472         Use SYMBOL_REFERENCES_LOCAL.  Add asserts for h->got.offset.
473
474 2018-06-21  Alan Modra  <amodra@gmail.com>
475
476         * doc/Makefile.am (AUTOMAKE_OPTIONS): Add "foreign".
477         * doc/Makefile.in: Regenerate.
478
479 2018-06-20  Renlin Li  <renlin.li@arm.com>
480
481         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
482         to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
483         BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
484         BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
485         BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
486         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
487         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
488         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
489         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
490
491 2018-06-20  Nick Clifton  <nickc@redhat.com>
492
493         PR 23316
494         * opncls.c (get_build_id): Check for a negative or excessive data
495         size in the build-id note.
496
497 2018-06-20  Nick Clifton  <nickc@redhat.com>
498
499         PR 23299
500         * mach-o.c (cputype): New function.
501         (cpusubtype): New function.
502         (bfd_mach_o_bfd_print_private_data): New function.  Dispalys the
503         values in the MACH-O file header.
504         (bfd_mach_o_bfd_copy_private_header_data): Copy the cputype and
505         cpusubtype fields from the input bfd's mach-o header to the output
506         bfd.
507         * mach-o-target.c (bfd_mach_o_bfd_print_private_bfd_data):
508         Redefine to bfd_mach_o_bfd_print_private_data.
509         * mach-o.h (bfd_mach_o_bfd_print_private_bfd_data): Prototype.
510
511 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
512
513         PR ld/22966
514         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
515         `.got.plt' entry referred is in range.
516         (mips_finish_exec_plt): Correct the range check for `.got.plt'
517         start.  Replace the assertion used for that with a proper error
518         message.
519
520 2018-06-19  Maciej W. Rozycki  <macro@mips.com>
521
522         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Fix
523         formatting.
524
525 2018-06-19  Simon Marchi  <simon.marchi@ericsson.com>
526
527         * Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
528         (INCLUDES): Rename to ...
529         (AM_CPPFLAGS): ... this.
530         * configure.ac: Remove AC_PREREQ.
531         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
532         info-in-builddir no-texinfo.tex.
533         (info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
534         * doc/bfd.texinfo: Rename to ...
535         * doc/bfd.texi: ... this.
536         * Makefile.in: Re-generate.
537         * aclocal.m4: Re-generate.
538         * config.in: Re-generate.
539         * configure: Re-generate.
540         * doc/Makefile.in: Re-generate.
541
542 2018-06-18  Mephi  <mephi42@gmail.com>
543
544         PR 23297
545         * mach-o-x86-64.c (x86_64_howto_table): Add entry for
546         BFD_RELOC_MACH_O_X86_64_RELOC_TLV.
547         (bfd_mach_o_x86_64_canonicalize_one_reloc): Handle the new reloc.
548         (bfd_mach_o_x86_64_swap_reloc_out): Likewise.
549         * reloc.c (BFD_RELOC_MACH_O_X86_64_TV): New entry.
550         * bfd-in2.h: Regenerate.
551         * libbfd.h: Regenerate.
552
553 2018-06-14  Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
554
555         * elfxx-mips.c (print_mips_ases): Add GINV extension.
556
557 2018-06-14  H.J. Lu  <hongjiu.lu@intel.com>
558
559         PR binutils/23267
560         * elf.c (_bfd_elf_get_symbol_version_string): Check if the first
561         symbol version is base version.
562
563 2018-06-14  Alan Modra  <amodra@gmail.com>
564
565         * elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
566         * elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
567         (_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
568         (_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
569         "dynamic_relocs" is not set.
570         * elfxx-mips.c (count_section_dynsyms): Likewise.
571
572 2018-06-14  Alan Modra  <amodra@gmail.com>
573
574         PR 23282
575         * bfdio.c (bfd_seek): Optimize away seeks to current position.
576
577 2018-06-13  Scott Egerton  <scott.egerton@imgtec.com>
578             Faraz Shahbazker  <Faraz.Shahbazker@mips.com>
579
580         * elfxx-mips.c (print_mips_ases): Add CRC.
581
582 2018-06-08  H.J. Lu  <hongjiu.lu@intel.com>
583
584         PR ld/23161
585         * elfxx-x86.c (elf_x86_hide_linker_defined): New function.
586         (_bfd_x86_elf_link_check_relocs): Use it to hide hidden
587         __bss_start, _end and _edata in shared libraries.
588
589 2018-06-07  Alan Modra  <amodra@gmail.com>
590
591         * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
592         __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
593
594 2018-06-05  Alan Modra  <amodra@gmail.com>
595
596         * bfd.c (struct bfd): Update comment on "where" usage.
597         * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec",
598         "iostream", and "where" from containing archive file.  Return
599         error on NULL iovec.
600         (bfd_bread): Similarly, and return error attempted out of
601         bounds archive element access.
602         (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and
603         "where" from containing archive file.
604         (bfd_seek): Likewise.  Return error on NULL iovec.  Don't
605         attempt to optimize away seeks.  Don't paper over errors by
606         calling bfd_tell.
607         (bfd_get_mtime): Call bfd_stat rather than iovec->bstat.
608         (bfd_get_size): Likewise.
609         (bfd_mmap): Operate on and use iovec of containing archive
610         file.  Return error on NULL iovec.
611         * cache.c (bfd_cache_lookup_worker): Abort if working on
612         archive element bfd.
613         (cache_bread_1): Delete bfd parameter, add FILE* parameter.
614         Don't ignore zero byte reads.
615         (cache_bread): Look up FILE* in cache here.  Error on NULL
616         lookup.
617         (cache_bwrite): Rename "where" to "from".
618         (cache_bmmap): Don't handle archive elements.
619         * coffcode.h (coff_slurp_line_table): Exit early on zero
620         lineno count.
621         * bfd-in2.h: Regenerate.
622
623 2018-06-05  Alan Modra  <amodra@gmail.com>
624
625         PR 23254
626         * plugin.c (bfd_plugin_open_input): Allow for possibility of
627         nested archives.  Open file again for plugin.
628         (try_claim): Don't save and restore file position.  Close file
629         if not claimed.
630         * sysdep.h (O_BINARY): Define.
631
632 2018-06-04  Max Filippov  <jcmvbkbc@gmail.com>
633
634         * elf32-xtensa.c (xtensa_read_table_entries): Make global.
635         (compute_fill_extra_space): Drop declaration. Rename function to
636         xtensa_compute_fill_extra_space.
637         (compute_ebb_actions, remove_dead_literal): Update references to
638         compute_fill_extra_space.
639
640 2018-06-04  Volodymyr Arbatov  <arbatov@cadence.com>
641
642         * elf32-xtensa.c (elf32xtensa_separate_props): New global
643         variable.
644         (xtensa_add_names): New function.
645         (xtensa_property_section_name): Add new parameter
646         separate_sections, use it to choose property section name.
647         (xtensa_get_separate_property_section): New function.
648         (xtensa_get_property_section): Invoke
649         xtensa_get_separate_property_section to get individual property
650         section if it exists, common property section otherwise.
651         (xtensa_make_property_section): Pass elf32xtensa_separate_props
652         to xtensa_property_section_name.
653
654 2018-06-04  H.J. Lu  <hongjiu.lu@intel.com>
655
656         PR binutils/23146
657         * bfd-in.h: Include "diagnostics.h".
658         * bfd-in2.h: Regenerated.
659         * elf32-arm.c (elf32_arm_nabi_write_core_note): Use
660         DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and
661         DIAGNOSTIC_POP to silence GCC 8.1 warnings with
662         -Wstringop-truncation.
663         * elf32-ppc.c (ppc_elf_write_core_note): Likewse.
664         * elf32-s390.c (elf_s390_write_core_note): Likewse.
665         * elf64-ppc.c (ppc64_elf_write_core_note): Likewse.
666         * elf64-s390.c (elf_s390_write_core_note): Likewse.
667         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse.
668
669 2018-06-03  Jim Wilson  <jimw@sifive.com>
670
671         PR ld/23244
672         * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check
673         for and handle an undefined weak with no PLT.
674
675         PR ld/22756
676         * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check
677         to code that ignores duplicate symbols.
678
679 2018-06-01  H.J. Lu  <hongjiu.lu@intel.com>
680
681         * version.m4: Bump version to 2.30.52
682         * configure: Regenerated.
683
684 2018-06-01  Alan Modra  <amodra@gmail.com>
685
686         * bfd.c (_bfd_error_handler): Arrange for this function to be
687         declared in bfd-in2.h.
688         * libbfd-in.h (_bfd_error_handler): Don't declare.
689         * libbfd.h: Regenerate.
690         * bfd-in2.h: Regenerate.
691
692 2018-05-30  Amaan Cheval <amaan.cheval@gmail.com>
693
694         * config.bfd (x86_64-*-*): Add pei-x86-64 target to x86_64-*-rtems*
695         This is needed to generate UEFI application image files from ELFs.
696
697 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
698
699         * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry,
700         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
701         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
702         plt_tlsdesc_got2_insn_end for TLSDESC entry.
703         (elf_i386_lazy_ibt_plt): Likewise.
704         (elf_i386_nacl_plt): Likewise.
705         * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ...
706         (elf_x86_64_tlsdesc_plt_entry): This.
707         (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry,
708         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
709         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
710         plt_tlsdesc_got2_insn_end for TLSDESC entry.
711         (elf_x86_64_lazy_bnd_plt): Likewise.
712         (elf_x86_64_lazy_ibt_plt): Likewise.
713         (elf_x32_lazy_ibt_plt): Likewise.
714         (elf_x86_64_nacl_plt): Likewise.
715         (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry,
716         plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset,
717         plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and
718         plt_tlsdesc_got2_insn_end to update TLSDESC entry.
719         * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments.
720         Add plt_tlsdesc_entry, plt_tlsdesc_entry_size,
721         plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset,
722         plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end.
723         (elf_x86_non_lazy_plt_layout): Update comments.
724         (elf_x86_plt_layout): Likewise.
725
726 2018-05-28  H.J. Lu  <hongjiu.lu@intel.com>
727
728         PR ld/23238
729         * elf-s390-common.c (elf_s390_add_symbol_hook): Removed.
730         * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
731         (elf_backend_add_symbol_hook): Likewise.
732         * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
733         (elf_backend_add_symbol_hook): Likewise.
734         * elf32-s390.c (elf_backend_add_symbol_hook): Likewise.
735         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
736         (elf_backend_add_symbol_hook): Likewise.
737         * elf64-s390.c (elf_backend_add_symbol_hook): Likewise.
738         * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
739         * elfxx-aarch64.h (_bfd_aarch64_elf_add_symbol_hook): Likewise.
740         (elf_backend_add_symbol_hook): Likewise.
741         * elf32-arm.c (elf32_arm_add_symbol_hook): Remove STT_GNU_IFUNC
742         handling.
743         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
744         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
745         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
746         * elflink.c (elf_link_add_object_symbols): Set
747         elf_gnu_symbol_ifunc for STT_GNU_IFUNC symbols.
748
749 2018-05-26  H.J. Lu  <hongjiu.lu@intel.com>
750
751         PR ld/23194
752         * elf-bfd.h (_bfd_elf_link_hide_sym_by_version): New.
753         * elflink.c (_bfd_elf_link_hide_versioned_symbol): New function.
754         Extracted from _bfd_elf_link_assign_sym_version.
755         (_bfd_elf_link_hide_sym_by_version): New function.
756         (_bfd_elf_link_assign_sym_version): Use
757         _bfd_elf_link_hide_versioned_symbol.
758         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Call
759         _bfd_elf_link_hide_sym_by_version instead of
760         bfd_hide_sym_by_version.  Don't check unversioned symbol.
761
762 2018-05-25  Alan Modra  <amodra@gmail.com>
763
764         * Makefile.in: Regenerate.
765         * po/SRC-POTFILES.in: Regenerate.
766
767 2018-05-25  Alan Modra  <amodra@gmail.com>
768
769         * configure.ac (bfd_cv_hidden): Run test with -Werror in CFLAGS.
770         * configure: Regenerate.
771
772 2018-05-23  H.J. Lu  <hongjiu.lu@intel.com>
773
774         * elf64-ppc.c (ppc64_elf_write_core_note): Add ATTRIBUTE_NONSTRING
775         to data.
776
777 2018-05-22  Alan Modra  <amodra@gmail.com>
778
779         PR 23207
780         * elf32-hppa.c (hppa_get_stub_entry): Return NULL when link_sec
781         is NULL.
782         (elf32_hppa_size_stubs): Only create stubs for load, alloc, code
783         sections.
784         (final_link_relocate): Revert last change.
785
786 2018-05-22  Alan Modra  <amodra@gmail.com>
787
788         PR 23207
789         * elf32-hppa.c (final_link_relocate): Don't look for plt call
790         stubs in non-alloc sections.
791
792 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
793
794         PR ld/23201
795         * aout-target.h (MY_bfd_link_hide_symbol): New.
796         * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise.
797         * binary.c (binary_bfd_link_hide_symbol): Likewise.
798         * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
799         * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise.
800         * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise.
801         * coffcode.h (coff_bfd_link_hide_symbol): Likewise.
802         * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise.
803         * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise.
804         * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise.
805         * ihex.c (ihex_bfd_link_hide_symbol): Likewise.
806         * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise.
807         * linker.c (_bfd_generic_link_hide_symbol): Likewise.
808         (bfd_link_hide_symbol): Likewise.
809         * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise.
810         * mmo.c (mmo_bfd_link_hide_symbol): Likewise.
811         * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise.
812         * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise.
813         * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise.
814         * som.c (som_bfd_link_hide_symbol): Likewise.
815         * srec.c (srec_bfd_link_hide_symbol): Likewise.
816         * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise.
817         * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise.
818         (alpha_vms_bfd_link_hide_symbol): Likewise.
819         * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise.
820         * coff64-rs6000.c (rs6000_xcoff64_vec): Add
821         _bfd_generic_link_hide_symbol.
822         (rs6000_xcoff64_aix_vec): Likewise.
823         * elflink.c (bfd_elf_record_link_assignment): Don't make forced
824         local symbol dynamic.
825         (_bfd_elf_link_hide_symbol): New function.
826         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
827         check root.ldscript_def.
828         * targets.c (bfd_target): Add _bfd_link_hide_symbol.
829         (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol.
830         * bfd-in2.h: Regenerated.
831         * libbfd.h: Likewise.
832
833 2018-05-21  H.J. Lu  <hongjiu.lu@intel.com>
834
835         PR binutils/23199
836         * elf.c (setup_group): Mark section in a section group with
837         SHF_GROUP.
838
839 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
840
841         PR ld/23194
842         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
843         set eh->local_ref to 1 if a symbol is versioned and there is a
844         version script.
845
846 2018-05-18  Kito Cheng  <kito.cheng@gmail.com>
847
848         * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Handle
849         EF_RISCV_RVE.
850
851 2018-05-18  Jim Wilson  <jimw@sifive.com>
852
853         * elfnn-riscv.c (allocate_dynrelocs): Discard dynamic relocations if
854         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
855         (riscv_elf_relocate_section): Don't generate dynamic relocation if
856         UNDEFWEAK_NO_DYNAMIC_RELOC is true.
857         (riscv_elf_finish_dynamic_symbol): Likewise.
858
859 2018-05-18  John Darrington  <john@darrington.wattle.id.au>
860
861         * Makefile.am: Add s12z files.
862         * Makefile.in: Regenerate.
863         * archures.c: Add bfd_s12z_arch.
864         * bfd-in.h: Add exports of bfd_putb24 and bfd_putl24.
865         * bfd-in2.h: Regenerate.
866         * config.bfd: Add s12z target.
867         * configure.ac: Add s12z target.
868         * configure: Regenerate.
869         * cpu-s12z.c: New file.
870         * elf32-s12z.c: New file.
871         * libbfd.c (bfd_putb24): New function.
872         (bfd_putl24): New function.
873         * libbfd.h: Regenerate.
874         * reloc.c: Add s12z relocations.
875         (bfd_get_reloc_size): Handle size 5 relocs.
876         * targets.c: Add s12z_elf32_vec.
877
878 2018-05-18  H.J. Lu  <hongjiu.lu@intel.com>
879
880         PR ld/23189
881         * elf32-i386.c (elf_i386_relocate_section): Handle R_386_GOT32X
882         like R_386_GOT32.
883         * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
884         set eh->local_ref to 1 for linker defined symbols.
885
886 2018-05-18  Alan Modra  <amodra@gmail.com>
887
888         PR 23199
889         * elf.c (setup_group): Formatting.  Check that SHT_GROUP entries
890         don't point at other SHT_GROUP sections.  Set shdr corresponding
891         to invalid entry, to NULL rather than section 0.  Identify
892         SHT_GROUP section index when reporting an error.  Cope with NULL
893         shdr pointer.
894
895 2018-05-18  Alan Modra  <amodra@gmail.com>
896
897         * libbfd-in.h (ATTRIBUTE_HIDDEN): Define and use throughout.
898         * configure.ac (HAVE_HIDDEN): Check compiler support for hidden
899         visibility.
900         * libbfd.h: Regenerate.
901         * configure: Regenerate.
902         * config.in: Regenerate.
903
904 2018-05-18  Alan Modra  <amodra@gmail.com>
905
906         * libbfd-in.h: Add include guard.
907         * libcoff-in.h: Likewise.
908         * doc/Makefile.am (libbfd.h, libcoff.h): Append another #endif.
909         * doc/Makefile.in: Regenerate.
910         * libbfd.h: Regenerate.
911         * libcoff.h: Regenerate.
912
913 2018-05-16  Maciej W. Rozycki  <macro@mips.com>
914
915         * elf32-nds32.c (nds32_convert_32_to_16): Preset `insn_type'.
916
917 2018-05-16  Alan Modra  <amodra@gmail.com>
918
919         PR 22458
920         * format.c (struct bfd_preserve): Add section_id.
921         (bfd_preserve_save, bfd_preserve_restore): Save and restore
922         _bfd_section_id.
923         (bfd_reinit): Set _bfd_section_id.
924         (bfd_check_format_matches): Put all matches of any priority into
925         matching_vector.  Save initial section id and start each attempted
926         match at that section id.
927         * libbfd-in.h (_bfd_section_id): Declare.
928         * section.c (_bfd_section_id): Rename from section_id and make
929         global.  Adjust uses.
930         (bfd_get_next_section_id): Delete.
931         * elf64-ppc.c (ppc64_elf_setup_section_lists): Replace use of
932         bfd_get_section_id with _bfd_section_id.
933         * libbfd.h: Regenerate.
934         * bfd-in2.h: Regenerate.
935
936 2018-05-15  Christophe Guillon  <christophe.guillon@st.com>
937
938         * coffcode.h (coff_bigobj_swap_aux_in): Make sure that all fields
939         of the aux structure are initialised.
940
941 2018-05-15  Francois H. Theron  <francois.theron@netronome.com>
942
943         * targets.c: Wrap nfp_elf64_vec in BFD64 ifdef.
944
945 2018-05-15  Nick Clifton  <nickc@redhat.com>
946
947         * po/pt.po: New Portuguese translation.
948         * configure.ac (ALL_LINGUAS): Add pt.
949         * configure: Regenerate.
950
951 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
952
953         PR ld/23169
954         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Don't issue
955         an error on IFUNC pointer defined in PDE.
956         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Call
957         _bfd_x86_elf_link_fixup_ifunc_symbol.
958         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
959         * elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): New
960         function.
961         * elfxx-x86.h (_bfd_x86_elf_link_fixup_ifunc_symbol): New.
962
963 2018-05-14  H.J. Lu  <hongjiu.lu@intel.com>
964
965         PR ld/23162
966         * elfxx-x86.c (elf_x86_linker_defined): New function.
967         (_bfd_x86_elf_link_check_relocs): Use it to mark __bss_start,
968         _end and _edata locally defined within executables.
969
970 2018-05-12  Alan Modra  <amodra@gmail.com>
971
972         PR 20659
973         * elf.c (rewrite_elf_program_header): Use segment_mark only for
974         PT_LOAD headers.  Delete first_matching_lma and first_suggested_lma.
975         Instead make matching_lma and suggested_lma pointers to the
976         sections.  Align section vma and lma calculated from segment.
977         Don't clear includes_phdrs or includes_filehdr based on p_paddr
978         test.  Try to handle alignment padding before first section by
979         adjusting new segment lma down.  Adjust PT_PHDR map p_paddr.
980
981 2018-05-09  Dimitar Dimitrov  <dimitar@dinux.eu>
982
983         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Make LDI32 relocation
984         conformant to TI ABI.
985         (pru_elf32_relax_section): Likewise.
986         (pru_elf_relax_delete_bytes): Fix offsets for new LDI32 code.
987         * elf32-pru.c (pru_elf32_do_ldi32_relocate): Ignore addend.
988         (pru_elf32_pmem_relocate): Trap - should not get here.
989         (pru_elf32_relocate_section): Add support for REL relocations.
990         (elf_info_to_howto_rel): Enable REL.
991         (elf_backend_may_use_rel_p): Likewise.
992         (elf_backend_may_use_rela_p): Likewise.
993         (elf_backend_default_use_rela_p): Likewise.
994
995 2018-05-09  Alan Modra  <amodra@gmail.com>
996
997         PR 23148
998         * peXXigen.c (pe_print_edata): Correct minimum size.
999
1000 2018-05-09  Alan Modra  <amodra@gmail.com>
1001
1002         PR 23147
1003         * peXXigen.c (pe_print_idata): Bound check hint_addr.
1004
1005 2018-05-08  Nick Clifton  <nickc@redhat.com>
1006
1007         PR 22809
1008         * elf.c (bfd_elf_get_str_section): Check for an excessively large
1009         string section.
1010         * elf-attrs.c (_bfd_elf_parse_attributes): Issue an error if the
1011         attribute section is larger than the size of the file.
1012
1013 2018-05-07  Alan Modra  <amodra@gmail.com>
1014
1015         * cofflink.c (_bfd_coff_link_input_bfd): Use memcmp rather than
1016         strncmp when checking for ".bf" special symbol.
1017         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Make pe_required_section_flags
1018         section name a char array, remove sentinal known_sections entry,
1019         and adjust loop over known_sections to suit.  Use memcmp rather
1020         than strncmp.
1021
1022 2018-05-04  Alan Modra  <amodra@gmail.com>
1023
1024         * elf-linux-core.h (struct elf_external_linux_prpsinfo32_ugid32),
1025         (struct elf_external_linux_prpsinfo32_ugid16),
1026         (struct elf_external_linux_prpsinfo64_ugid32),
1027         (struct elf_external_linux_prpsinfo64_ugid16): Add ATTRIBUTE_NONSTRING
1028         to pr_fname and pr_psargs fields.  Remove GCC diagnostic pragmas.
1029         Move comment to..
1030         * elf.c (elfcore_write_prpsinfo): ..here.  Indent nested preprocessor
1031         directives.
1032         * elf32-arm.c (elf32_arm_nabi_write_core_note): Add ATTRIBUTE_NONSTRING
1033         to data.
1034         * elf32-ppc.c (ppc_elf_write_core_note): Likewise.
1035         * elf32-s390.c (elf_s390_write_core_note): Likewise.
1036         * elf64-s390.c (elf_s390_write_core_note): Likewise.
1037         * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewise.
1038         * elf64-x86-64.c (elf_x86_64_write_core_note): Add GCC diagnostic
1039         pragmas.
1040         * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Use strnlen to avoid
1041         false positive gcc-8 warning.
1042         * cofflink.c (_bfd_coff_link_input_bfd): Likewise.
1043
1044 2018-05-04  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
1045
1046         * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Fix the order
1047         of arguments when warning about different long double types.
1048
1049 2018-05-03  Simon Atanasyan  <simon@atanasyan.com>
1050
1051         * elf32-mips.c: (elf32_mips_fixup_symbol): New function.
1052         (elf_backend_fixup_symbol): New macro.
1053         * elfxx-mips.c: (mips_elf_output_extsym): Discard _gp_disp
1054         handling.
1055         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
1056
1057 2018-04-30  Francois H. Theron <francois.theron@netronome.com>
1058
1059         * Makefile.am: Added NFP files to build.
1060         * archures.c: Added bfd_arch_nfp
1061         * config.bfd: Added NFP support.
1062         * configure.ac: Added NFP support.
1063         * cpu-nfp.c: New, for NFP support.
1064         * elf-bfd.h: Added elf_section_info()
1065         * elf64-nfp.c: New, for NFP support.
1066         * po/SRC-POTFILES.in: Added NFP source files.
1067         * targets.c: Added nfp_elf64_vec
1068         * bfd-in2.h: Regenerate.
1069         * Makefile.in: Regenerate.
1070         * configure: Regenerate.
1071
1072 2018-04-27  Alan Modra  <amodra@gmail.com>
1073
1074         * bfd-in2.h: Regenerate.
1075         * libbfd.h: Regenerate.
1076
1077 2018-04-27  Alan Modra  <amodra@gmail.com>
1078
1079         PR 23123
1080         PR 22374
1081         * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
1082         relocs for ifuncs.
1083         * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
1084
1085 2018-04-26  Pedro Alves  <palves@redhat.com>
1086
1087         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
1088         ifunc and non-ifunc symbols duplicates.
1089
1090 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1091         Mickaël Guêné  <mickael.guene@st.com>
1092
1093         * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New.
1094         (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case.
1095         (elf32_arm_populate_plt_entry): Likewise.
1096         (elf32_arm_output_plt_map_1): Likewise.
1097         (elf32_arm_output_arch_local_syms): Likewise.
1098
1099 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1100         Mickaël Guêné  <mickael.guene@st.com>
1101
1102         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle
1103         _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
1104
1105 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1106         Mickaël Guêné  <mickael.guene@st.com>
1107
1108         * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case
1109         for R_ARM_TARGET2.
1110
1111 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1112         Mickaël Guêné  <mickael.guene@st.com>
1113
1114         * elf32-arm.c (DEFAULT_STACK_SIZE): New.
1115         (elf32_arm_always_size_sections): Create stack segment.
1116
1117 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1118         Mickaël Guêné  <mickael.guene@st.com>
1119
1120         * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC)
1121         (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New
1122         relocations.
1123         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC,
1124         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations.
1125         (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC,
1126         R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC.
1127         (struct elf32_arm_link_hash_table): Update comment.
1128         (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations.
1129         (IS_ARM_TLS_RELOC): Likewise.
1130         (elf32_arm_check_relocs): Likewise.
1131         (allocate_dynrelocs_for_symbol): Likewise.
1132         (elf32_arm_size_dynamic_sections): Update comment.
1133         * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC,
1134         BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC.
1135
1136 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1137         Mickaël Guêné  <mickael.guene@st.com>
1138
1139         * elf32-arm.c (elf32_arm_fdpic_plt_entry): New.
1140         (elf32_arm_create_dynamic_sections): Handle FDPIC.
1141         (elf32_arm_allocate_plt_entry): Likewise.
1142         (elf32_arm_populate_plt_entry): Likewise.
1143         (elf32_arm_output_plt_map_1): Likewise.
1144
1145 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1146         Mickaël Guêné  <mickael.guene@st.com>
1147
1148         * elf32-arm.c (struct fdpic_local): New.
1149         (elf_arm_obj_tdata): Add local_fdpic_cnts field.
1150         (elf32_arm_local_fdpic_cnts): New.
1151         (struct fdpic_global): New.
1152         (elf32_arm_link_hash_entry): Add fdpic_cnts field.
1153         (elf32_arm_link_hash_table): Add srofixup field.
1154         (arm_elf_add_rofixup): New.
1155         (arm_elf_fill_funcdesc): New.
1156         (elf32_arm_link_hash_newfunc): Handle fdpic_cnts.
1157         (elf32_arm_allocate_local_sym_info): Likewise.
1158         (create_got_section): Create .rofixup section.
1159         (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts.
1160         (bfd_elf32_arm_set_target_params): Handle FDPIC.
1161         (elf32_arm_final_link_relocate): Likewise.
1162         (elf32_arm_check_relocs): Likewise.
1163         (allocate_dynrelocs_for_symbol): Likewise.
1164         (elf32_arm_size_dynamic_sections): Likewise.
1165         (elf32_arm_finish_dynamic_sections): Likewise.
1166         (elf32_arm_output_arch_local_syms): Likewise.
1167         (elf32_arm_fdpic_omit_section_dynsym): New.
1168
1169 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1170         Mickaël Guêné  <mickael.guene@st.com>
1171
1172         * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC)
1173         (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC)
1174         (BFD_RELOC_ARM_FUNCDESC_VALUE): New.
1175         * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC,
1176         R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE.
1177         (elf32_arm_howto_from_type): Take new members of
1178         elf32_arm_howto_table_2 into account.
1179         (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC,
1180         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
1181         BFD_RELOC_ARM_FUNCDESC_VALUE.
1182         * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC,
1183         BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC,
1184         BFD_RELOC_ARM_FUNCDESC_VALUE.
1185
1186 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1187         Mickaël Guêné  <mickael.guene@st.com>
1188
1189         * elf32-arm.c (elf32_arm_print_private_bfd_data): Support
1190         EF_ARM_PIC and ELFOSABI_ARM_FDPIC.
1191         (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC.
1192         (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC.
1193
1194 2018-04-25  Christophe Lyon  <christophe.lyon@st.com>
1195         Mickaël Guêné  <mickael.guene@st.com>
1196
1197         * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and
1198         arm_elf32_fdpic_le_vec to targ_selvecs. Accept
1199         arm*-*-uclinuxfdpiceabi.
1200         * configure.ac: Add support for arm_elf32_fdpic_be_vec and
1201         arm_elf32_fdpic_le_vec.
1202         * configure: Regenerate.
1203         * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p.
1204         (elf32_arm_link_hash_table_create): Initialize fdpic_p.
1205         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM)
1206         (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets.
1207         (elf32_arm_fdpic_link_hash_table_create): New.
1208         * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and
1209         arm_elf32_fdpic_le_vec.
1210
1211 2018-04-25  Alan Modra  <amodra@gmail.com>
1212
1213         * elf-linux-core.h: Disable gcc-8 string truncation warning.
1214         * elf.c (elfcore_write_prpsinfo): Likewise.
1215
1216 2018-04-25  Alan Modra  <amodra@gmail.com>
1217
1218         * Makefile.am: Remove arm-aout and arm-coff support.
1219         * config.bfd: Likewise.
1220         * configure.ac: Likewise.
1221         * targets.c: Likewise.
1222         * aout-arm.c: Delete.
1223         * armnetbsd.c: Delete.
1224         * riscix.c: Delete.
1225         * Makefile.in: Regenerate.
1226         * configure: Regenerate.
1227         * po/SRC-POTFILES.in: Regenerate.
1228
1229 2018-04-24  Nick Clifton  <nickc@redhat.com>
1230
1231         PR 23113
1232         * elf.c (ignore_section_sym): Check for the output_section pointer
1233         being NULL before dereferencing it.
1234
1235         PR 23110
1236         * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for
1237         a negative PE_DEBUG_DATA size before iterating over the debug data.
1238
1239 2018-04-23  Alan Modra  <amodra@gmail.com>
1240
1241         * elf-linux-core.h: Revert last change.
1242         * elf.c: Likewise.
1243
1244 2018-04-23  Nick Clifton  <nickc@redhat.com>
1245
1246         PR 23056
1247         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
1248         the end of the string table, and zero it.
1249
1250 2018-04-23  Alan Modra  <amodra@gmail.com>
1251
1252         * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable
1253         gcc-8 string truncation warning.
1254         (swap_linux_prpsinfo32_ugid16_out): Likewise.
1255         (swap_linux_prpsinfo64_ugid32_out): Likewise.
1256         (swap_linux_prpsinfo64_ugid16_out): Likewise.
1257         * elf.c (elfcore_write_prpsinfo): Likewise.
1258
1259 2018-04-23  Nick Clifton  <nickc@redhat.com>
1260
1261         PR 23056
1262         * aoutx.h (aout_get_external_symbols): Allocate an extra byte at
1263         the end of the string table, and zero it.
1264
1265 2018-04-20  Alan Modra  <amodra@gmail.com>
1266
1267         PR 22978
1268         * elf32-hppa.c (got_relocs_needed): Add extra param to special
1269         case both dtprel and tprel relocs.
1270         (allocate_dynrelocs): Adjust conditions for got relocs.
1271         (elf32_hppa_relocate_section): Likewise for local sym got relocs.
1272         Emit dynamic relocs on TLS GOT entries for shared libraries,
1273         not when pic.  Omit dynamic reloc on dtprel entry when local,
1274         and on tprel entry when local and executable.
1275
1276 2018-04-19  Alan Modra  <amodra@gmail.com>
1277
1278         PR 22537
1279         * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1.
1280         (hppa_type_of_stub): Don't return a long branch stub for
1281         symbols other than those defined statically.
1282
1283 2018-04-19  Alan Modra  <amodra@gmail.com>
1284
1285         * Makefile.am: Revert 2018-04-18 coff-mips changes.
1286         * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec
1287         to selvecs for mips targets change 2018-04-18.
1288         * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec
1289         and  mips_ecoff_bele_vec.
1290         * targets.c: Likewise.
1291         * coff-mips.c: Resurrect.
1292         * Makefile.in: Regenerate.
1293         * configure: Regenerate.
1294         * po/SRC-POTFILES.in: Regenerate.
1295
1296 2018-04-18  Alan Modra  <amodra@gmail.com>
1297
1298         * Makefile.am: Remove mips aout and coff support.
1299         * config.bfd: Likewise.
1300         * configure.ac: Likewise.
1301         * targets.c: Likewise.
1302         * coff-mips.c: Delete
1303         * mipsbsd.c: Delete
1304         * pe-mips.c: Delete
1305         * pei-mips.c: Delete
1306         * Makefile.in: Regenerate.
1307         * configure: Regenerate.
1308         * po/SRC-POTFILES.in: Regenerate.
1309
1310 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
1311
1312         * elf32-i386.c (elf32_bed): Define before including
1313         "elf32-target.h".
1314         * elf64-x86-64.c (elf64_bed): Define before including
1315         "elf64-target.h".
1316         (elf32_bed): Define before including "elf32-target.h".
1317
1318 2018-04-17  H.J. Lu  <hongjiu.lu@intel.com>
1319
1320         PR ld/23055
1321         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a
1322         normal input file with compatible relocation.
1323
1324 2018-04-18  Alan Modra  <amodra@gmail.com>
1325
1326         * Makefile.am: Remove support for assorted i386 aout and coff targets.
1327         * config.bfd: Likewise.
1328         * configure.ac: Likewise.
1329         * doc/bfdint.texi: Likewise.
1330         * targets.c: Likewise.
1331         * freebsd.h: Delete.
1332         * i386dynix.c: Delete.
1333         * i386freebsd.c: Delete.
1334         * i386linux.c: Delete.
1335         * i386mach3.c: Delete.
1336         * i386netbsd.c: Delete.
1337         * i386os9k.c: Delete.
1338         * Makefile.in: Regenerate.
1339         * configure: Regenerate.
1340         * po/SRC-POTFILES.in: Regenerate.
1341
1342 2018-04-17 Andrew Sadek  <andrew.sadek.se@gmail.com>
1343
1344         Microblaze Target: PIC data text relative
1345
1346         * bfd/reloc.c (2 new BFD relocations):
1347         BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
1348         BFD_RELOC_MICROBLAZE_64_TEXTPCREL
1349         * bfd/bfd-in2.h: Regenerate
1350         * bfd/libbfd.h: Regenerate
1351         * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3
1352         new relocs and handle them in both relocate and relax functions.
1353         (microblaze_elf_reloc_type_lookup): add mapping between for new
1354         bfd relocs.
1355         (microblaze_elf_relocate_section): Handle new relocs in case of
1356         elf relocation.
1357         (microblaze_elf_relax_section): Handle new relocs for elf relaxation.
1358
1359 2018-04-17  Nick Clifton  <nickc@redhat.com>
1360
1361         PR 23055
1362         * aoutx.h (find_nearest_line): Check that the symbol name exists
1363         and is long enough, before attempting to see if it is for a .o
1364         file.
1365         * hash.c (bfd_hash_hash): Add an assertion that the string is not
1366         NULL.
1367         * linker.c (bfd_link_hash_lookup): Fail if the table or string are
1368         NULL.
1369         (_bfd_generic_link_add_archive_symbols): Fail if an archive entry
1370         has no name.
1371
1372         PR 23065
1373         * dwarf2.c (concat_filename): Check for a NULL table pointer.
1374
1375 2018-04-16  Nick Clifton  <nickc@redhat.com>
1376
1377         PR 23061
1378         * coffgen.c (coff_pointerize_aux): Check for an out of range
1379         fixup.
1380
1381 2018-04-16  Alan Modra  <amodra@gmail.com>
1382
1383         * Makefile.am: Remove arm-epoc-pe support.
1384         * coff-arm.c: Likewise.
1385         * config.bfd: Likewise.
1386         * configure.ac: Likewise.
1387         * targets.c: Likewise.
1388         * epoc-pe-arm.c: Delete.
1389         * epoc-pei-arm.c: Delete.
1390         * Makefile.in: Regenerate.
1391         * configure: Regenerate.
1392         * po/SRC-POTFILES.in: Regenerate.
1393
1394 2018-04-16  Alan Modra  <amodra@gmail.com>
1395
1396         * Makefile.am: Remove sparc-aout and sparc-coff support.
1397         * config.bfd: Likewise.
1398         * configure.ac: Likewise.
1399         * targets.c: Likewise.
1400         * aout-sparcle.c: Delete.
1401         * aoutf1.h: Delete.
1402         * cf-sparclynx.c: Delete.
1403         * coff-sparc.c: Delete.
1404         * demo64.c: Delete.
1405         * sparclinux.c: Delete.
1406         * sparclynx.c: Delete.
1407         * sparcnetbsd.c: Delete.
1408         * sunos.c: Delete.
1409         * Makefile.in: Regenerate.
1410         * configure: Regenerate.
1411         * po/SRC-POTFILES.in: Regenerate.
1412
1413 2018-04-16  Alan Modra  <amodra@gmail.com>
1414
1415         * Makefile.am: Remove m68k-aout and m68k-coff support.
1416         * aoutf1.h: Likewise.
1417         * aoutx.h: Likewise.
1418         * archive.c: Likewise.
1419         * bfd-in.h: Likewise.
1420         * bfd.c: Likewise.
1421         * coffcode.h: Likewise.
1422         * coffswap.h: Likewise.
1423         * config.bfd: Likewise.
1424         * configure.ac: Likewise.
1425         * configure.host: Likewise.
1426         * doc/bfd.texinfo: Likewise.
1427         * doc/bfdint.texi: Likewise.
1428         * freebsd.h: Likewise.
1429         * gen-aout.c: Likewise.
1430         * hpux-core.c: Likewise.
1431         * libaout.h: Likewise.
1432         * libbfd-in.h: Likewise.
1433         * pdp11.c: Likewise.
1434         * peicode.h: Likewise.
1435         * riscix.c: Likewise.
1436         * targets.c: Likewise.
1437         * aout0.c: Delete.
1438         * coff-apollo.c: Delete.
1439         * coff-aux.c: Delete.
1440         * coff-m68k.c: Delete.
1441         * coff-svm68k.c: Delete.
1442         * coff-u68k.c: Delete.
1443         * hosts/delta68.h: Delete.
1444         * hosts/hp300bsd.h: Delete.
1445         * hosts/m68kaux.h: Delete.
1446         * hosts/news.h: Delete.
1447         * hp300bsd.c: Delete.
1448         * hp300hpux.c: Delete.
1449         * liboasys.h: Delete.
1450         * m68k4knetbsd.c: Delete.
1451         * m68klinux.c: Delete.
1452         * m68knetbsd.c: Delete.
1453         * oasys.c: Delete.
1454         * versados.c: Delete.
1455         * Makefile.in: Regenerate.
1456         * bfd-in2.h: Regenerate.
1457         * configure: Regenerate.
1458         * libbfd.h: Regenerate.
1459         * po/SRC-POTFILES.in: Regenerate.
1460
1461 2018-04-16  Alan Modra  <amodra@gmail.com>
1462
1463         * Makefile.am: Remove sh5 and sh64 support.
1464         * archures.c: Likewise.
1465         * config.bfd: Likewise.
1466         * configure.ac: Likewise.
1467         * cpu-sh.c: Likewise.
1468         * elf32-sh-relocs.h: Likewise.
1469         * elf32-sh.c: Likewise.
1470         * targets.c: Likewise.
1471         * elf32-sh64-com.c: Delete.
1472         * elf32-sh64.c: Delete.
1473         * elf32-sh64.h: Delete.
1474         * elf64-sh64.c: Delete.
1475         * Makefile.in: Regenerate.
1476         * bfd-in2.h: Regenerate.
1477         * configure: Regenerate.
1478         * po/SRC-POTFILES.in: Regenerate.
1479
1480 2018-04-16  Alan Modra  <amodra@gmail.com>
1481
1482         * Makefile.am: Remove sh-symbianelf support.
1483         * config.bfd: Likewise.
1484         * configure.ac: Likewise.
1485         * targets.c: Likewise.
1486         * elf32-sh-symbian.c: Delete.
1487         * Makefile.in: Regenerate.
1488         * configure: Regenerate.
1489         * po/SRC-POTFILES.in: Regenerate.
1490
1491 2018-04-16  Alan Modra  <amodra@gmail.com>
1492
1493         * Makefile.am: Remove vax-bsd and vax-ultrix support.
1494         * config.bfd: Likewise.
1495         * configure.ac: Likewise.
1496         * targets.c: Likewise.
1497         * vaxbsd.c: Delete.
1498         * Makefile.in: Regenerate.
1499         * configure: Regenerate.
1500         * po/SRC-POTFILES.in: Regenerate.
1501
1502 2018-04-16  Alan Modra  <amodra@gmail.com>
1503
1504         * Makefile.am: Remove w65 support.
1505         * archures.c: Likewise.
1506         * coffcode.h: Likewise.
1507         * config.bfd: Likewise.
1508         * configure.ac: Likewise.
1509         * targets.c: Likewise.
1510         * coff-w65.c: Delete.
1511         * cpu-w65.c: Delete.
1512         * Makefile.in: Regenerate.
1513         * bfd-in2.h: Regenerate.
1514         * configure: Regenerate.
1515         * po/SRC-POTFILES.in: Regenerate.
1516
1517 2018-04-16  Alan Modra  <amodra@gmail.com>
1518
1519         * Makefile.am: Remove we32k support.
1520         * archures.c: Likewise.
1521         * coffcode.h: Likewise.
1522         * config.bfd: Likewise.
1523         * configure.ac: Likewise.
1524         * targets.c: Likewise.
1525         * coff-we32k.c: Delete.
1526         * cpu-we32k.c: Delete.
1527         * Makefile.in: Regenerate.
1528         * bfd-in2.h: Regenerate.
1529         * configure: Regenerate.
1530         * po/SRC-POTFILES.in: Regenerate.
1531
1532 2018-04-16  Alan Modra  <amodra@gmail.com>
1533
1534         * Makefile.am: Remove m88k support.
1535         * aoutx.h: Likewise.
1536         * archures.c: Likewise.
1537         * coffcode.h: Likewise.
1538         * coffswap.h: Likewise.
1539         * config.bfd: Likewise.
1540         * configure.ac: Likewise.
1541         * cpu-ns32k.c: Likewise.
1542         * elf32-nds32.c: Likewise.
1543         * mach-o.c: Likewise.
1544         * netbsd-core.c: Likewise.
1545         * reloc.c: Likewise.
1546         * targets.c: Likewise.
1547         * coff-m88k.c: Delete.
1548         * cpu-m88k.c: Delete.
1549         * elf32-m88k.c: Delete.
1550         * hosts/m88kmach3.h: Delete.
1551         * m88kmach3.c: Delete.
1552         * m88kopenbsd.c: Delete.
1553         * Makefile.in: Regenerate.
1554         * bfd-in2.h: Regenerate.
1555         * configure: Regenerate.
1556         * po/SRC-POTFILES.in: Regenerate.
1557
1558 2018-04-16  Alan Modra  <amodra@gmail.com>
1559
1560         * Makefile.am: Remove i370 support.
1561         * archures.c: Likewise.
1562         * config.bfd: Likewise.
1563         * configure.ac: Likewise.
1564         * targets.c: Likewise.
1565         * cpu-i370.c: Delete.
1566         * elf32-i370.c: Delete.
1567         * Makefile.in: Regenerate.
1568         * bfd-in2.h: Regenerate.
1569         * configure: Regenerate.
1570         * po/SRC-POTFILES.in: Regenerate.
1571
1572 2018-04-16  Alan Modra  <amodra@gmail.com>
1573
1574         * Makefile.am: Remove h8500 support.
1575         * archures.c: Likewise.
1576         * coffcode.h: Likewise.
1577         * config.bfd: Likewise.
1578         * configure.ac: Likewise.
1579         * targets.c: Likewise.
1580         * coff-h8500.c: Delete.
1581         * cpu-h8500.c: Delete.
1582         * Makefile.in: Regenerate.
1583         * bfd-in2.h: Regenerate.
1584         * configure: Regenerate.
1585         * po/SRC-POTFILES.in: Regenerate.
1586
1587 2018-04-16  Alan Modra  <amodra@gmail.com>
1588
1589         * Makefile.am: Remove h8300-coff support.
1590         * coffcode.h: Likewise.
1591         * config.bfd: Likewise.
1592         * configure.ac: Likewise.
1593         * reloc16.c: Likewise.
1594         * targets.c: Likewise.
1595         * coff-h8300.c: Delete.
1596         * Makefile.in: Regenerate.
1597         * configure: Regenerate.
1598         * po/SRC-POTFILES.in: Regenerate.
1599
1600 2018-04-16  Alan Modra  <amodra@gmail.com>
1601
1602         * Makefile.am: Remove IEEE 695 support.
1603         * archures.c: Likewise.
1604         * bfd.c: Likewise.
1605         * config.bfd: Likewise.
1606         * configure.ac: Likewise.
1607         * doc/bfd.texinfo: Likewise.
1608         * doc/bfdint.texi: Likewise.
1609         * doc/bfdsumm.texi: Likewise.
1610         * section.c: Likewise.
1611         * targets.c: Likewise.
1612         * ieee.c: Delete.
1613         * libieee.h: Delete.
1614         * Makefile.in: Regenerate.
1615         * bfd-in2.h: Regenerate.
1616         * configure: Regenerate.
1617         * po/SRC-POTFILES.in: Regenerate.
1618
1619 2018-04-16  Alan Modra  <amodra@gmail.com>
1620
1621         * config.bfd: Remove tandem support.
1622
1623 2018-04-16  Alan Modra  <amodra@gmail.com>
1624
1625         * Makefile.am: Remove newsos3 support.
1626         * aoutx.h: Likewise.
1627         * config.bfd: Likewise.
1628         * configure.ac: Likewise.
1629         * targets.c: Likewise.
1630         * newsos3.c: Delete.
1631         * Makefile.in: Regenerate.
1632         * configure: Regenerate.
1633         * po/SRC-POTFILES.in: Regenerate.
1634
1635 2018-04-16  Alan Modra  <amodra@gmail.com>
1636
1637         * Makefile.am: Remove netware support.
1638         * bfd-in.h: Likewise.
1639         * bfd.c: Likewise.
1640         * config.bfd: Likewise.
1641         * configure.ac: Likewise.
1642         * doc/bfdint.texi: Likewise.
1643         * ecoff.c: Likewise.
1644         * targets.c: Likewise.
1645         * libnlm.h: Delete.
1646         * nlm-target.h: Delete.
1647         * nlm.c: Delete.
1648         * nlm32-alpha.c: Delete.
1649         * nlm32-i386.c: Delete.
1650         * nlm32-ppc.c: Delete.
1651         * nlm32-sparc.c: Delete.
1652         * nlm32.c: Delete.
1653         * nlm64.c: Delete.
1654         * nlmcode.h: Delete.
1655         * nlmswap.h: Delete.
1656         * Makefile.in: Regenerate.
1657         * bfd-in2.h: Regenerate.
1658         * configure: Regenerate.
1659         * po/SRC-POTFILES.in: Regenerate.
1660
1661 2018-04-16  Alan Modra  <amodra@gmail.com>
1662
1663         * archures.c: Remove tahoe support.
1664         * config.bfd: Likewise.
1665         * configure.ac: Likewise.
1666         * hosts/tahoe.h: Delete.
1667         * bfd-in2.h: Regenerate.
1668         * configure: Regenerate.
1669
1670 2018-04-14  Alan Modra  <amodra@gmail.com>
1671
1672         * elf-bfd.h (struct elf_backend_data): Add relropagesize.
1673         * elfxx-target.h (ELF_RELROPAGESIZE): Provide default and
1674         sanity test.
1675         (elfNN_bed): Init relropagesize.
1676         * bfd.c (bfd_emul_get_commonpagesize): Add boolean param to
1677         select relropagesize.
1678         * elf32-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1679         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1680         (ELF_MINPAGESIZE): Don't define.
1681         * elf64-ppc.c (ELF_COMMONPAGESIZE): Define as 0x1000.
1682         (ELF_RELROPAGESIZE): Define as ELF_MAXPAGESIZE.
1683         * bfd-in2.h: Regenerate.
1684
1685 2018-04-14  Alan Modra  <amodra@gmail.com>
1686
1687         * elf32-ppc.c (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Don't depend
1688         on __QNXTARGET__ define.
1689
1690 2018-04-14  Alan Modra  <amodra@gmail.com>
1691
1692         * config.bfd: Add powerpc-*-lynxos* and powerpc-*-windiss*
1693         to obsolete list.
1694
1695 2018-04-11  Alan Modra  <amodra@gmail.com>
1696
1697         * aout-adobe.c: Delete.
1698         * bout.c: Delete.
1699         * coff-i860.c: Delete.
1700         * coff-i960.c: Delete.
1701         * cpu-i860.c: Delete.
1702         * cpu-i960.c: Delete.
1703         * elf32-i860.c: Delete.
1704         * elf32-i960.c: Delete.
1705         * hosts/i860mach3.h: Delete.
1706         * Makefile.am: Remove i860, i960, bout, and adobe support.
1707         * archures.c: Remove i860 and i960 support.
1708         * coffcode.h: Likewise.
1709         * reloc.c: Likewise.
1710         * aoutx.h: Comment updates.
1711         * archive.c: Remove BOUT and i960 support.
1712         * bfd.c: Remove BOUT support.
1713         * coffswap.h: Remove i960 support.
1714         * config.bfd: Remove i860, i960 and adobe targets.
1715         * configure.ac: Remove adode, bout, i860, i960, icoff targets.
1716         * targets.c: Likewise.
1717         * ieee.c: Remove i960 support.
1718         * mach-o.c: Remove i860 support.
1719         * Makefile.in: Regenerate.
1720         * bfd-in2.h: Regenerate.
1721         * configure: Regenerate.
1722         * libbfd.h: Regenerate.
1723         * po/SRC-POTFILES.in: Regenerate.
1724
1725 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
1726
1727         * elf64-mips.c (mips_elf64_write_rel): Handle a NULL BFD pointer
1728         in the BFD symbol referred by the relocation.
1729         (mips_elf64_write_rela): Likewise.
1730
1731 2018-04-09  Maciej W. Rozycki  <macro@mips.com>
1732
1733         * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Issue an
1734         error for out-of-range `r_sym' values.
1735
1736 2018-04-09  Alan Modra  <amodra@gmail.com>
1737
1738         * elf64-ppc.c (struct _ppc64_elf_section_data): Add has_pltcall field.
1739         (struct ppc_link_hash_table): Add can_convert_all_inline_plt.
1740         (ppc64_elf_check_relocs): Set has_pltcall.
1741         (ppc64_elf_adjust_dynamic_symbol): Discard some PLT entries.
1742         (ppc64_elf_inline_plt): New function.
1743         (ppc64_elf_size_dynamic_sections): Discard some PLT entries for locals.
1744         * elf64-ppc.h (ppc64_elf_inline_plt): Declare.
1745         * elf32-ppc.c (has_pltcall): Define.
1746         (struct ppc_elf_link_hash_table): Add can_convert_all_inline_plt.
1747         (ppc_elf_check_relocs): Set has_pltcall.
1748         (ppc_elf_inline_plt): New function.
1749         (ppc_elf_adjust_dynamic_symbol): Discard some PLT entries.
1750         (ppc_elf_size_dynamic_sections): Likewise.
1751         * elf32-ppc.h (ppc_elf_inline_plt): Declare.
1752
1753 2018-04-09  Alan Modra  <amodra@gmail.com>
1754
1755         * elf32-ppc.c (ppc_elf_howto_raw): Add PLTSEQ and PLTCALL howtos.
1756         (is_plt_seq_reloc): New function.
1757         (ppc_elf_check_relocs): Handle PLTSEQ and PLTCALL relocs.
1758         (ppc_elf_tls_optimize): Handle inline plt call sequence.
1759         (ppc_elf_relax_section): Handle PLTCALL reloc.
1760         (ppc_elf_relocate_section): Nop out inline plt call sequence when
1761         resolving locally.
1762         * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_PLTSEQ and
1763         R_PPC64_PLTCALL entries.  Comment R_PPC64_TOCSAVE.
1764         (has_tls_get_addr_call): Correct comment.
1765         (is_branch_reloc): Add PLTCALL.
1766         (is_plt_seq_reloc): New function.
1767         (ppc64_elf_check_relocs): Handle PLT16_LO_DS reloc.  Set
1768         has_tls_reloc for R_PPC64_TLSGD and R_PPC64_TLSLD.  Create plt
1769         entry for R_PPC64_PLTCALL.
1770         (ppc64_elf_tls_optimize): Handle inline plt call sequence.
1771         (ppc_type_of_stub): Handle PLTCALL reloc.
1772         (toc_adjusting_stub_needed): Likewise.
1773         (ppc64_elf_relocate_section): Set "can_plt_call" for PLTCALL
1774         reloc insn.  Nop out inline plt call sequence when resolving
1775         locally.  Handle __tls_get_addr inline plt call optimization.
1776
1777 2018-04-09  Alan Modra  <amodra@gmail.com>
1778
1779         * elf64-ppc.c (LOCAL_PLT_ENTRY_SIZE): Define.
1780         (struct ppc_stub_hash_entry): Add symtype field.
1781         (PLT_KEEP): Define.
1782         (struct ppc_link_hash_table): Add pltlocal and relpltlocal.
1783         (create_linkage_sections): Create pltlocal and relpltlocal.
1784         (ppc64_elf_check_relocs): Allow PLT relocs on local symbols.
1785         Set PLT_KEEP.
1786         (ppc64_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1787         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1788         (ppc64_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1789         Keep PLT entries for inline calls against locals.
1790         (ppc_build_one_stub): Use pltlocal as appropriate.
1791         (ppc_size_one_stub): Likewise.
1792         (ppc64_elf_size_stubs): Set symtype.
1793         (build_global_entry_stubs_and_plt): Init pltlocal and write
1794         relpltlocal for globals.
1795         (write_plt_relocs_for_local_syms): Likewise for local syms.
1796         (ppc64_elf_relocate_section): Support PLT for local syms.
1797         * elf32-ppc.c (PLT_KEEP): Define.
1798         (struct ppc_elf_link_hash_table): Add pltlocal and relpltlocal.
1799         (ppc_elf_create_glink): Create pltlocal and relpltlocal.
1800         (ppc_elf_check_relocs): Allow PLT relocs on local symbols.
1801         Set PLT_KEEP.  Adjust update_local_sym_info call.
1802         (ppc_elf_adjust_dynamic_symbol): Keep PLT entries for inline calls.
1803         (allocate_dynrelocs): Allocate pltlocal and relpltlocal.
1804         (ppc_elf_size_dynamic_sections): Size pltlocal and relpltlocal.
1805         (ppc_elf_relocate_section): Support PLT16 relocs for local syms.
1806         (write_global_sym_plt): Init pltlocal and write relpltlocal.
1807         (ppc_finish_symbols): Likewise for locals.
1808
1809 2018-04-09  Alan Modra  <amodra@gmail.com>
1810
1811         * elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
1812         for local symbols to..
1813         (write_plt_relocs_for_local_syms): ..here.  New function.
1814         (ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
1815         global symbols to..
1816         (build_global_entry_stubs_and_plt): ..here.  Rename from
1817         build_global_entry_stubs.
1818         (ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
1819         Call write_plt_relocs_for_local_syms.
1820         * elf32-ppc.c (get_sym_h): New function.
1821         (ppc_elf_relax_section): Use get_sym_h.
1822         (ppc_elf_relocate_section): Move output of PLT relocs and glink
1823         stubs for local symbols to..
1824         (ppc_finish_symbols): ..here.  New function.
1825         (ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
1826         global syms to..
1827         (write_global_sym_plt): ..here.  New function.
1828         * elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
1829         (ppc_finish_symbols): Declare.
1830
1831 2018-04-09  Alan Modra  <amodra@gmail.com>
1832
1833         * elf32-ppc.c (ppc_elf_check_relocs): Handle PLT16 relocs.
1834         (ppc_elf_relocate_section): Likewise.
1835         * elf64-ppc.c (ppc64_elf_check_relocs): Handle PLT16_LO_DS.
1836         (ppc64_elf_relocate_section): Likewise.  Correct PLT16
1837         resolution to plt entry relative to toc pointer.
1838
1839 2018-04-09  Alan Modra  <amodra@gmail.com>
1840
1841         * elf64-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
1842         TLS_TPRELGD, TLS_EXPLICIT):  Renumber.  Test TLS_TLS throughout
1843         file when other TLS flags are tested in a mask.
1844         (TLS_MARK, NON_GOT): Define.
1845         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
1846         (update_local_sym_info): Don't create got entry when NON_GOT.
1847         (ppc64_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
1848         Set TLS_MARK.
1849         (get_tls_mask): Do toc lookup if tls_mask is just TLS_MARK.
1850         (ppc64_elf_relocate_section): Likewise.
1851         (ppc64_elf_tls_optimize): Don't attempt to optimize indirect
1852         __tls_get_addr calls lacking a marker reloc.
1853         * elf32-ppc.c (TLS_TLS, TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL,
1854         TLS_TPRELGD): Renumber.  Update comment.
1855         (TLS_MARK, NON_GOT): Define.
1856         (PLT_IFUNC): Redefine, and test TLS_TLS throughout file as well.
1857         (update_local_sym_info): Don't create got entry when NON_GOT.
1858         (ppc_elf_check_relocs): Pass NON_GOT with PLT_IFUNC.
1859         Set TLS_MARK.
1860         (ppc_elf_tls_optimize): Don't attempt to optimize indirect
1861         __tls_get_addr calls lacking a marker reloc.
1862
1863 2018-04-06  H.J. Lu  <hongjiu.lu@intel.com>
1864
1865         * elf64-x86-64.c (elf_x86_64_info_to_howto): Don't mask out
1866         R_X86_64_converted_reloc_bit.
1867
1868 2018-04-05  H.J. Lu  <hongjiu.lu@intel.com>
1869
1870         PR gas/22318
1871         * configure: Regenerated.
1872
1873 2018-04-05  Alan Modra  <amodra@gmail.com>
1874
1875         * elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
1876         (elf_hppa_info_to_howto_rel): Likewise.
1877
1878 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1879
1880         * elf-hppa.h (elf_hppa_info_to_howto): Also return
1881         unsuccessfully for unimplemented relocations.
1882         (elf_hppa_info_to_howto_rel): Likewise.
1883
1884 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1885
1886         * elf32-i860.c (lookup_howto): Add `abfd' parameter.  Set the
1887         `bfd_error_bad_value' error and call `_bfd_error_handler' on a
1888         howto lookup failure.
1889         (elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
1890         accordingly.
1891         (elf32_i860_info_to_howto_rela): Likewise.
1892         (elf32_i860_relocate_splitn): Likewise.
1893         (elf32_i860_relocate_pc16): Likewise.
1894         (elf32_i860_relocate_pc26): Likewise.
1895         (elf32_i860_relocate_section): Likewise.
1896
1897 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1898
1899         * elf32-visium.c (visium_info_to_howto_rela): Correct the range
1900         check for `visium_elf_howto_table' table access.
1901
1902 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1903
1904         * elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
1905         check for `iq2000_elf_howto_table' table access.
1906
1907 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1908
1909         * elf32-frv.c (frv_info_to_howto_rela): Correct the range check
1910         for `elf32_frv_howto_table' table access.
1911
1912 2018-04-04  Maciej W. Rozycki  <macro@mips.com>
1913
1914         * elf32-mips.c (mips_elf32_rtype_to_howto): Also return
1915         unsuccessfully for placeholder howtos.
1916         * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
1917         * elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
1918
1919 2018-03-29  Maciej W. Rozycki  <macro@mips.com>
1920
1921         * elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
1922         `_bfd_error_handler' and to set the `bfd_error_bad_value' error.
1923
1924 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1925
1926         * elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
1927         ATTRIBUTE_UNUSED from `abfd'.
1928
1929 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1930
1931         * elf-hppa.h (elf_hppa_info_to_howto_rel): Correct
1932         `_bfd_error_handler' call formatting.
1933
1934 2018-03-28  Maciej W. Rozycki  <macro@mips.com>
1935
1936         * elf32-mips.c (mips_info_to_howto_rel): Call
1937         `mips_elf32_rtype_to_howto' directly rather than via
1938         `->elf_backend_mips_rtype_to_howto'.
1939
1940 2018-03-28  Renlin Li  <renlin.li@arm.com>
1941
1942         PR ld/22970
1943         * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Add cases for
1944         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
1945         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1946         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
1947         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1948         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
1949         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1950         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
1951         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1952         (elfNN_aarch64_final_link_relocate): Support new relocations.
1953         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Support new
1954         relocations.
1955         (_bfd_aarch64_elf_resolve_relocation): Support new relocations.
1956
1957 2018-03-28  Renlin Li  <renlin.li@arm.com>
1958
1959         PR ld/22970
1960         * reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
1961         BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
1962         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
1963         BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
1964         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
1965         BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
1966         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
1967         BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
1968         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
1969         BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
1970         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
1971         TLSLE_LDST16_TPREL_LO12,
1972         TLSLE_LDST16_TPREL_LO12_NC,
1973         TLSLE_LDST32_TPREL_LO12,
1974         TLSLE_LDST32_TPREL_LO12_NC,
1975         TLSLE_LDST64_TPREL_LO12,
1976         TLSLE_LDST64_TPREL_LO12_NC,
1977         TLSLE_LDST8_TPREL_LO12,
1978         TLSLE_LDST8_TPREL_LO12_NC.
1979         * bfd-in2.h: Regenerated.
1980         * libbfd.h: Regenerated.
1981
1982 2018-03-28  Eric Botcazou  <ebotcazou@adacore.com>
1983
1984         PR ld/22972
1985         * elfxx-sparc.c (struct _bfd_sparc_elf_link_hash_entry): Add new flag
1986         has_old_style_got_reloc.
1987         (_bfd_sparc_elf_check_relocs) <GOT relocations>: Set it for old-style
1988         relocations.  Fix a couple of long lines.
1989         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: Do not generate
1990         a R_SPARC_NONE for the GOT slot if the symbol is also subject to old-style
1991         GOT relocations.
1992
1993 2018-03-25  H.J. Lu  <hongjiu.lu@intel.com>
1994
1995         PR ld/23000
1996         * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
1997         ENDBR64 to the TLSDESC PLT entry.
1998
1999 2018-03-21  Alan Modra  <amodra@gmail.com>
2000
2001         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
2002         symbols.  Use size_t counts.  Delete redundant opd test.
2003
2004 2018-03-21  Alan Modra  <amodra@gmail.com>
2005
2006         * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
2007
2008 2018-03-21  Alan Modra  <amodra@gmail.com>
2009
2010         * elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
2011         field unsigned.
2012         (update_local_sym_info): Likewise for local_got_tls_masks.
2013         (ppc_elf_tls_optimize): Likewise for lgot_masks.
2014
2015 2018-03-21  Alan Modra  <amodra@gmail.com>
2016
2017         * elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
2018         (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
2019         do in size_dynamic_sections.
2020
2021 2018-03-21  Alan Modra  <amodra@gmail.com>
2022
2023         * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
2024         without first checking array bounds.
2025         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2026
2027 2018-03-20  H.J. Lu  <hongjiu.lu@intel.com>
2028
2029         PR ld/22983
2030         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
2031         non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.
2032
2033 2018-03-19  Nick Clifton  <nickc@redhat.com>
2034
2035         * po/es.po: Updated Spanish translation.
2036
2037 2018-03-15  Max Filippov  <jcmvbkbc@gmail.com>
2038
2039         * elf32-xtensa.c (xlate_map_entry): Change types of address
2040         fields from 'unsigned' to 'bfd_vma'.
2041         (xlate_offset_with_removed_text): Use struct xlate_map_entry as
2042         the key argument to bsearch. Allow offsets past the end of a
2043         section, use the last map entry for translation of such offsets.
2044
2045 2018-03-15  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
2046
2047         * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Removed.
2048         Not support the target feature.
2049         (nds32_elf_ex9_itb_base): Likewise.
2050         (nds32_elf_ex9_import_table): Likewise.
2051         (nds32_elf_ex9_finish): Likewise.
2052         (nds32_elf_ex9_reloc_jmp): Likewise.
2053         (nds32_elf_get_insn_with_reg): Likewise.
2054         (nds32_get_local_syms): Likewise.
2055         (nds32_elf_ex9_replace_instruction): Likewise.
2056         (nds32_elf_ifc_calc): Likewise.
2057         (nds32_elf_ifc_finish): Likewise.
2058         (nds32_elf_ifc_replace): Likewise.
2059         (nds32_elf_ifc_reloc): Likewise.
2060
2061 2018-03-14  Alan Modra  <amodra@gmail.com>
2062
2063         * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having
2064         sfpr size added before defining alias symbols.
2065         (ppc64_elf_build_stubs): Add stub section padding before
2066         copying sfpr contents and defining save/restore alias symbols.
2067
2068 2018-03-14  H.J. Lu  <hongjiu.lu@intel.com>
2069
2070         PR ld/20882
2071         * elflink.c (elf_gc_mark_debug_section): Also check the local
2072         debug definition section.
2073
2074 2018-03-13  Nick Clifton  <nickc@redhat.com>
2075
2076         PR 22113
2077         * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean
2078         function.  Add an end address parameter.  Check access of the data
2079         pointer to make sure that they do not extend beyond the end
2080         address.  Return FALSE if any check fails.  Add the end address
2081         pointer to the ui structure.
2082         (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind
2083         codes to make sure that they do not extend beyond the end address
2084         pointer.  Print an error message and return immediately if any
2085         check fails.
2086
2087 2018-03-09  Nick Clifton  <nickc@redhat.com>
2088
2089         * elf64-s390.c (elf_s390_relocate_section): Move check for
2090         relocations against non-allocated sections to before the code that
2091         handles ifunc relocations.
2092         * elf32-s390.c (elf_s390_relocate_section): Likewise.
2093         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat
2094         relocs against IFUNC symbols in non-allocated sections as relocs
2095         against FUNC symbols.
2096         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2097
2098 2018-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2099
2100         PR ld/22929
2101         * elf32-i386.c (elf_i386_relocate_section): Treat relocation
2102         against IFUNC symbol in SHT_NOTE section without SHF_ALLOC as
2103         relocation against FUNC symbol.
2104         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
2105
2106 2018-03-07  Renlin Li  <renlin.li@arm.com>
2107
2108         PR ld/20402
2109         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Check absolute
2110         symbol, and don't emit relocation in specific case.
2111
2112 2018-03-07  Alan Modra  <amodra@gmail.com>
2113
2114         * elf64-mips.c (mips_elf64_rtype_to_howto): Return NULL on error.
2115         (mips_elf64_slurp_one_reloc_table): Pass on error.
2116
2117 2018-03-03  James Cowgill  <james.cowgill@mips.com>
2118             Maciej W. Rozycki  <macro@mips.com>
2119
2120         PR ld/21900
2121         * elfxx-mips.c (mips_elf_calculate_relocation): Only return
2122         after calling `undefined_symbol' hook if this is an error
2123         condition.  Assume the value of 0 for the symbol requested
2124         otherwise.
2125
2126 2018-03-02  Jim Wilson  <jimw@sifive.com>
2127
2128         PR 22903
2129         * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch
2130         and nop instead of 4.
2131         (elfNN_arch64_build_stubs): Add nop after branch.  Increase size by
2132         8 instead of 4.
2133
2134 2018-03-01  Jim Wilson  <jimw@sifive.com>
2135
2136         PR 22756
2137         * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use
2138         else if instead of if.
2139
2140 2018-03-01  Alan Modra  <amodra@gmail.com>
2141
2142         * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test.
2143
2144 2018-02-28  Alan Modra  <amodra@gmail.com>
2145
2146         PR 22887
2147         * aoutx.h (swap_std_reloc_in): Correct r_index bound check.
2148
2149 2018-02-28  Nick Clifton  <nickc@redhat.com>
2150
2151         PR 22895
2152         PR 22893
2153         * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block
2154         pointer.  Drop unused abfd parameter.  Check the size of the block
2155         before initialising the data field.  Return the end pointer if the
2156         size is invalid.
2157         (read_attribute_value): Adjust invocations of read_n_bytes.
2158
2159         PR 22894
2160         * dwarf1.c (parse_die): Check the length of form blocks before
2161         advancing the data pointer.
2162
2163 2018-02-28  Alan Modra  <amodra@gmail.com>
2164
2165         PR 22887
2166         * aoutx.h (translate_symbol_table): Print an error message and set
2167         bfd_error on finding an invalid name string offset.
2168
2169 2018-02-27  H.J. Lu  <hongjiu.lu@intel.com>
2170
2171         * config.in: Regenerated.
2172         * configure: Likewise.
2173         * configure.ac: Add --enable-separate-code.
2174         (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED.  Default
2175         to 1 for Linux/x86 targets,
2176         * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if
2177         DEFAULT_LD_Z_SEPARATE_CODE is 1.
2178
2179 2018-02-27  Nick Clifton  <nickc@redhat.com>
2180
2181         * aout-cris.c (swap_ext_reloc_out): Standadize error/warning
2182         message.
2183         * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise.
2184         * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise.
2185         * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise.
2186         * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise.
2187         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
2188         * elf64-sh64.c (sh_elf64_info_to_howto): Likewise.
2189         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
2190         * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise.
2191         * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
2192
2193         PR 22875
2194         * elf-bfd.h (struct elf_backend_data): Change the return type of
2195         the elf_info_to_howto and elf_info_to_howto_rel function pointers
2196         to bfd_boolean.
2197         * elfcode.h (elf_slurp_reloc_table_from_section): Check the return
2198         value from the info_to_howto function and fail if that function
2199         failed.
2200         * elf32-h8300.c (elf32_h8_relocate_section): Check return value
2201         from the info_to_howto function.
2202         (elf32_h8_relax_section): Likewise.
2203         * elf32-lm32.c (lm32_elf_relocate_section): Likewise.
2204         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
2205         * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
2206         * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2207         * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2208         * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise.
2209         * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
2210         * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2211         * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise.
2212         * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2213         (riscv_elf_relocate_section): Likewise.
2214         * elf-hppa.h (elf_hppa_info_to_howto): Change return type to
2215         bfd_boolean.  Issue an error message, set an error value and
2216         return FALSE if the reloc is not recognized.
2217         (elf_hppa_info_to_howto_rel): Likewise.
2218         * elf-m10200.c (mn10200_info_to_howto): Likewise.
2219         * elf-m10300.c (mn10300_info_to_howto): Likewise.
2220         * elf.c (_bfd_elf_no_info_to_howto): Likewise.
2221         * elf32-arc.c (arc_info_to_howto_rel): Likewise.
2222         * elf32-arm.c (elf32_arm_info_to_howto): Likewise.
2223         * elf32-avr.c (avr_info_to_howto_rela): Likewise.
2224         * elf32-bfin.c (bfin_info_to_howto): Likewise.
2225         * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
2226         * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise.
2227         * elf32-cris.c (elf_cr16c_info_to_howto_rel)
2228         (cris_info_to_howto_rela): Likewise.
2229         * elf32-crx.c (elf_crx_info_to_howto): Likewise.
2230         * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
2231         * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela):
2232         Likewise.
2233         * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto)
2234         (elf32_dlx_info_to_howto_rel): Likewise.
2235         * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
2236         * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
2237         * elf32-frv.c (frv_info_to_howto_rela)
2238         (frvfdpic_info_to_howto_rel): Likewise.
2239         * elf32-ft32.c (ft32_info_to_howto_rela): Likewise.
2240         * elf32-gen.c (elf_generic_info_to_howto)
2241         (elf_generic_info_to_howto_rel): Likewise.
2242         * elf32-h8300.c (elf32_h8_info_to_howto)
2243         (elf32_h8_info_to_howto_rel): Likewise.
2244         * elf32-i370.c (i370_elf_info_to_howto): Likewise.
2245         * elf32-i386.c (elf_i386_reloc_type_lookup)
2246         (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise.
2247         * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela):
2248         Likewise.
2249         * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
2250         * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
2251         * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
2252         * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
2253         * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
2254         * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto):
2255         Likewise.
2256         * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
2257         * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
2258         * elf32-m68k.c (rtype_to_howto): Likewise.
2259         * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
2260         * elf32-mep.c (mep_info_to_howto_rela): Likewise.
2261         * elf32-metag.c (metag_info_to_howto_rela): Likewise.
2262         * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
2263         * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
2264         Likewise.
2265         * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
2266         * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
2267         * elf32-mt.c (mt_info_to_howto_rela): Likewise.
2268         * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto):
2269         Likewise.
2270         * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise.
2271         * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
2272         * elf32-pj.c (pj_elf_info_to_howto): Likewise.
2273         * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
2274         * elf32-pru.c (pru_elf32_info_to_howto): Likewise.
2275         * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
2276         * elf32-rx.c (rx_info_to_howto_rela): Likewise.
2277         * elf32-s390.c (elf_s390_info_to_howto): Likewise.
2278         * elf32-score.c (s3_bfd_score_info_to_howto)
2279         (_bfd_score_info_to_howto): Likewise.
2280         * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise.
2281         * elf32-sh.c (sh_elf_info_to_howto): Likewise.
2282         * elf32-spu.c (spu_elf_info_to_howto): Likewise.
2283         * elf32-tic6x.c (elf32_tic6x_info_to_howto)
2284         (elf32_tic6x_info_to_howto_rel): Likewise.
2285         * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise.
2286         * elf32-v850.c (v850_elf_info_to_howto_rel)
2287         (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise.
2288         * elf32-vax.c (rtype_to_howto): Likewise.
2289         * elf32-visium.c (visium_info_to_howto_rela): Likewise.
2290         * elf32-wasm32.c (elf32_wasm32_rtype_to_howto)
2291         (elf32_wasm32_info_to_howto_rela): Likewise.
2292         * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise.
2293         * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
2294         * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise.
2295         * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
2296         * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
2297         * elf64-gen.c (elf_generic_info_to_howto)
2298         (elf_generic_info_to_howto_rel): Likewise.
2299         * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise.
2300         * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise.
2301         * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
2302         * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise.
2303         * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise.
2304         * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto):
2305         Likewise.
2306         * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise.
2307         * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela):
2308         Likewise.
2309         * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise.
2310         * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise.
2311         * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise.
2312         * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise.
2313         * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise.
2314         * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise.
2315         * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype.
2316         * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype.
2317         * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype.
2318         * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel):
2319         Default to NULL.
2320
2321 2018-02-26  Jim Wilson  <jimw@sifive.com>
2322             Stephan Schreiber <info@fs-driver.org>
2323
2324         PR 15904
2325         * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl
2326         call, set changed_contents and changed_relocs.  Likewise after
2327         successful ia64_elf_relax_br call.
2328
2329 2018-02-26  Alan Modra  <amodra@gmail.com>
2330
2331         * elf.c (assign_file_positions_except_relocs): Don't segfault
2332         when actual number of phdrs is less than allocated.  Delete
2333         outdated comment.  Formatting.
2334
2335 2018-02-26  Alan Modra  <amodra@gmail.com>
2336
2337         * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
2338         * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
2339         * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
2340         * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
2341         * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
2342         * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
2343         * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
2344         * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
2345         * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
2346         * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
2347         error/warning messages.
2348
2349 2018-02-26  Alan Modra  <amodra@gmail.com>
2350
2351         * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
2352         * syms.c: Standardize error/warning messages.
2353
2354 2018-02-26  Alan Modra  <amodra@gmail.com>
2355
2356         * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
2357         * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
2358         * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
2359         * peXXigen.c, * peicode.h: Standardize error/warning messages.
2360
2361 2018-02-26  Alan Modra  <amodra@gmail.com>
2362
2363         * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
2364
2365 2018-02-26  Alan Modra  <amodra@gmail.com>
2366
2367         * elfxx-mips.c: Standardize error/warning messages.
2368
2369 2018-02-26  Alan Modra  <amodra@gmail.com>
2370
2371         * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
2372         * elflink.c: Standardize error/warning messages.  Replace use of
2373         linker callback einfo with _bfd_error_handler when possible.
2374
2375 2018-02-26  Alan Modra  <amodra@gmail.com>
2376
2377         * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
2378         * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
2379         * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
2380         * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
2381         * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
2382         * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
2383         * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
2384         * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
2385         * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
2386         * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
2387         * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
2388         * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
2389         * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
2390         * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
2391         * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
2392         * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
2393         * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
2394         * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
2395         * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
2396         * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
2397         * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
2398         unrecognized/unsupported reloc message.
2399
2400 2018-02-26  Alan Modra  <amodra@gmail.com>
2401
2402         * elf32-ppc.c: Standardize error/warning messages.  Use
2403         _bfd_error_handler rather than einfo when einfo features not used.
2404         * elf64-ppc.c: Likewise.
2405
2406 2018-02-23  Alan Modra  <amodra@gmail.com>
2407
2408         PR 22881
2409         * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
2410         segment if no matching LOAD segment.
2411
2412 2018-02-23  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
2413
2414         * elf32-nds32.h: Define mask for ict_model.
2415
2416 2018-02-20  Jason Duerstock  <jason.duerstock@gmail.com>
2417
2418         * elfnn-ia64.c (elf_backend_can_gc_sections): Enable.
2419
2420 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2421
2422         Revert
2423         2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
2424
2425         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
2426         .reginfo section has wrong size.
2427
2428 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2429
2430         * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set
2431         SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and
2432         `.MIPS.abiflags' sections.
2433         (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo'
2434         section's end.
2435
2436 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2437
2438         * section.c (SEC_FIXED_SIZE): New macro.
2439         * bfd-in2.h: Regenerate.
2440
2441 2018-02-19  Maciej W. Rozycki  <macro@mips.com>
2442
2443         * section.c (SEC_HAS_GOT_REF): Remove macro.
2444         * bfd-in2.h: Regenerate.
2445
2446 2018-02-19  Alan Modra  <amodra@gmail.com>
2447
2448         * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler
2449         arguments.
2450         * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise.
2451         * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
2452         (_bfd_riscv_relax_pc): Likewise and fix typos.
2453         * libbfd-in.h (_bfd_error_handler): Add attribute printf.
2454         * libbfd.h: Regenerate.
2455
2456 2018-02-19  Alan Modra  <amodra@gmail.com>
2457
2458         * dwarf2.c (read_section): Don't use 'll' format modifier.
2459         (find_abstract_instance): Likewise.
2460         * elfcore.h (elf_core_file_p): Likewise.
2461
2462 2018-02-19  Alan Modra  <amodra@gmail.com>
2463
2464         * bfd-in.h: Include inttypes.h or if not available define
2465         PRId64, PRIu64 and PRIx64.
2466         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L
2467         modifier to print bfd_vma.
2468         * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c,
2469         * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c,
2470         * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c,
2471         * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c,
2472         * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c,
2473         * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c,
2474         * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
2475         * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c,
2476         * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c,
2477         * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
2478         * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c,
2479         * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c,
2480         * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c,
2481         * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c,
2482         * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64,
2483         and cast input to uint64_t, and similarly for Ld and Lu.
2484         * bfd-in2.h: Regenerate.
2485
2486 2018-02-19  Alan Modra  <amodra@gmail.com>
2487
2488         * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c,
2489         * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c,
2490         * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c,
2491         * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c,
2492         * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c,
2493         * reloc.c: Replace use of %R and %T in format strings passed to
2494         einfo and friends by %pR and %pT.
2495
2496 2018-02-19  Alan Modra  <amodra@gmail.com>
2497
2498         * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place
2499         of %A and %B.
2500         * aout-adobe.c: Update all messages using %A and %B.
2501         * aout-cris.c: Likewise.
2502         * aoutx.h: Likewise.
2503         * archive.c: Likewise.
2504         * binary.c: Likewise.
2505         * cache.c: Likewise.
2506         * coff-alpha.c: Likewise.
2507         * coff-arm.c: Likewise.
2508         * coff-i860.c: Likewise.
2509         * coff-mcore.c: Likewise.
2510         * coff-ppc.c: Likewise.
2511         * coff-rs6000.c: Likewise.
2512         * coff-sh.c: Likewise.
2513         * coff-tic4x.c: Likewise.
2514         * coff-tic54x.c: Likewise.
2515         * coff-tic80.c: Likewise.
2516         * coff64-rs6000.c: Likewise.
2517         * coffcode.h: Likewise.
2518         * coffgen.c: Likewise.
2519         * cofflink.c: Likewise.
2520         * coffswap.h: Likewise.
2521         * compress.c: Likewise.
2522         * cpu-arm.c: Likewise.
2523         * ecoff.c: Likewise.
2524         * elf-attrs.c: Likewise.
2525         * elf-eh-frame.c: Likewise.
2526         * elf-ifunc.c: Likewise.
2527         * elf-m10300.c: Likewise.
2528         * elf-properties.c: Likewise.
2529         * elf-s390-common.c: Likewise.
2530         * elf.c: Likewise.
2531         * elf32-arc.c: Likewise.
2532         * elf32-arm.c: Likewise.
2533         * elf32-avr.c: Likewise.
2534         * elf32-bfin.c: Likewise.
2535         * elf32-cr16.c: Likewise.
2536         * elf32-cr16c.c: Likewise.
2537         * elf32-cris.c: Likewise.
2538         * elf32-crx.c: Likewise.
2539         * elf32-d10v.c: Likewise.
2540         * elf32-d30v.c: Likewise.
2541         * elf32-epiphany.c: Likewise.
2542         * elf32-fr30.c: Likewise.
2543         * elf32-frv.c: Likewise.
2544         * elf32-gen.c: Likewise.
2545         * elf32-hppa.c: Likewise.
2546         * elf32-i370.c: Likewise.
2547         * elf32-i386.c: Likewise.
2548         * elf32-i960.c: Likewise.
2549         * elf32-ip2k.c: Likewise.
2550         * elf32-iq2000.c: Likewise.
2551         * elf32-lm32.c: Likewise.
2552         * elf32-m32c.c: Likewise.
2553         * elf32-m32r.c: Likewise.
2554         * elf32-m68hc11.c: Likewise.
2555         * elf32-m68hc12.c: Likewise.
2556         * elf32-m68hc1x.c: Likewise.
2557         * elf32-m68k.c: Likewise.
2558         * elf32-mcore.c: Likewise.
2559         * elf32-mep.c: Likewise.
2560         * elf32-metag.c: Likewise.
2561         * elf32-microblaze.c: Likewise.
2562         * elf32-moxie.c: Likewise.
2563         * elf32-msp430.c: Likewise.
2564         * elf32-mt.c: Likewise.
2565         * elf32-nds32.c: Likewise.
2566         * elf32-nios2.c: Likewise.
2567         * elf32-or1k.c: Likewise.
2568         * elf32-pj.c: Likewise.
2569         * elf32-ppc.c: Likewise.
2570         * elf32-rl78.c: Likewise.
2571         * elf32-rx.c: Likewise.
2572         * elf32-s390.c: Likewise.
2573         * elf32-score.c: Likewise.
2574         * elf32-score7.c: Likewise.
2575         * elf32-sh-symbian.c: Likewise.
2576         * elf32-sh.c: Likewise.
2577         * elf32-sh64.c: Likewise.
2578         * elf32-sparc.c: Likewise.
2579         * elf32-spu.c: Likewise.
2580         * elf32-tic6x.c: Likewise.
2581         * elf32-tilepro.c: Likewise.
2582         * elf32-v850.c: Likewise.
2583         * elf32-vax.c: Likewise.
2584         * elf32-visium.c: Likewise.
2585         * elf32-wasm32.c: Likewise.
2586         * elf32-xgate.c: Likewise.
2587         * elf32-xtensa.c: Likewise.
2588         * elf64-alpha.c: Likewise.
2589         * elf64-gen.c: Likewise.
2590         * elf64-hppa.c: Likewise.
2591         * elf64-ia64-vms.c: Likewise.
2592         * elf64-mmix.c: Likewise.
2593         * elf64-ppc.c: Likewise.
2594         * elf64-s390.c: Likewise.
2595         * elf64-sh64.c: Likewise.
2596         * elf64-sparc.c: Likewise.
2597         * elf64-x86-64.c: Likewise.
2598         * elfcode.h: Likewise.
2599         * elfcore.h: Likewise.
2600         * elflink.c: Likewise.
2601         * elfnn-aarch64.c: Likewise.
2602         * elfnn-ia64.c: Likewise.
2603         * elfnn-riscv.c: Likewise.
2604         * elfxx-mips.c: Likewise.
2605         * elfxx-sparc.c: Likewise.
2606         * elfxx-tilegx.c: Likewise.
2607         * elfxx-x86.c: Likewise.
2608         * hpux-core.c: Likewise.
2609         * ieee.c: Likewise.
2610         * ihex.c: Likewise.
2611         * libbfd.c: Likewise.
2612         * linker.c: Likewise.
2613         * mach-o.c: Likewise.
2614         * merge.c: Likewise.
2615         * mmo.c: Likewise.
2616         * oasys.c: Likewise.
2617         * pdp11.c: Likewise.
2618         * pe-mips.c: Likewise.
2619         * peXXigen.c: Likewise.
2620         * peicode.h: Likewise.
2621         * reloc.c: Likewise.
2622         * rs6000-core.c: Likewise.
2623         * srec.c: Likewise.
2624         * stabs.c: Likewise.
2625         * vms-alpha.c: Likewise.
2626         * xcofflink.c: Likewise.
2627
2628 2018-02-19  Alan Modra  <amodra@gmail.com>
2629
2630         PR 22845
2631         * elf.c (IS_TBSS): Define.
2632         (_bfd_elf_map_sections_to_segments): Use IS_TBSS.
2633         (assign_file_positions_for_non_load_sections): Revert last change.
2634         Properly calculate load segment limits to compare against relro limits.
2635
2636 2018-02-17  Alan Modra  <amodra@gmail.com>
2637
2638         PR 22845
2639         * elf.c (assign_file_positions_for_non_load_sections): Ignore
2640         degenerate zero size PT_LOAD segments when finding one overlapping
2641         the PT_GNU_RELRO segment.
2642
2643 2018-02-16  Alan Modra  <amodra@gmail.com>
2644
2645         * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
2646         (_bfd_bool_bfd_true): Rename from bfd_true.
2647         (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
2648         (_bfd_int_bfd_0): Rename from bfd_0.
2649         (_bfd_uint_bfd_0): Rename from bfd_0u.
2650         (_bfd_long_bfd_0): Rename from bfd_0l.
2651         (_bfd_long_bfd_n1_error): Rename from _bfd_n1.
2652         (_bfd_void_bfd): Rename from bfd_void.
2653         (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
2654         (_bfd_bool_bfd_link_false_error),
2655         (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
2656         (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
2657         (_bfd_bool_bfd_asection_bfd_asection_true),
2658         (_bfd_bool_bfd_asymbol_bfd_asymbol_true),
2659         (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
2660         * archive.c (_bfd_noarchive_get_elt_at_index),
2661         (_bfd_noarchive_openr_next_archived_file),
2662         (_bfd_noarchive_construct_extended_name_table),
2663         (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
2664         (_bfd_noarchive_write_armap): New functions.
2665         * archures.c (_bfd_nowrite_set_arch_mach): New function.
2666         * coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
2667         (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
2668         (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
2669         (alpha_ecoff_swap_coff_lineno_out),
2670         (alpha_ecoff_swap_coff_reloc_out): New functions.
2671         * coff-mips.c (mips_ecoff_swap_coff_aux_in),
2672         (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
2673         (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
2674         (mips_ecoff_swap_coff_lineno_out),
2675         (mips_ecoff_swap_coff_reloc_out): New functions.
2676         * coffcode.h (coff_set_alignment_hook): Replace define with
2677         new function.
2678         (symname_in_debug_hook): Likewise.
2679         * ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
2680         * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
2681         * elf.c (assign_file_positions_except_relocs): Test
2682         elf_backend_allow_non_load_phdr for NULL.
2683         * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
2684         _bfd_elf_link_omit_section_dynsym.  Update uses.
2685         (_bfd_elf_omit_section_dynsym_all): New function.
2686         * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
2687         (_bfd_elf_omit_section_dynsym_default): Declare.
2688         (_bfd_elf_omit_section_dynsym_all): Declare.
2689         * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
2690         (_bfd_nolink_bfd_get_relocated_section_contents),
2691         (_bfd_nolink_bfd_lookup_section_flags),
2692         (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
2693         (_bfd_nolink_bfd_link_hash_table_create),
2694         (_bfd_nolink_bfd_link_just_syms),
2695         (_bfd_nolink_bfd_copy_link_hash_symbol_type),
2696         (_bfd_nolink_bfd_link_split_section),
2697         (_bfd_nolink_section_already_linked),
2698         (_bfd_nolink_bfd_define_common_symbol),
2699         (_bfd_nolink_bfd_define_start_stop): New functions.
2700         * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
2701         (_bfd_norelocs_bfd_reloc_name_lookup),
2702         (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
2703         * section.c (_bfd_nowrite_set_section_contents): New function.
2704         * syms.c (_bfd_nosymbols_canonicalize_symtab),
2705         (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
2706         (_bfd_nosymbols_get_symbol_version_string),
2707         (_bfd_nosymbols_bfd_is_local_label_name),
2708         (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
2709         (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
2710         (_bfd_nosymbols_bfd_make_debug_symbol),
2711         ( _bfd_nosymbols_read_minisymbols),
2712         ( _bfd_nosymbols_minisymbol_to_symbol),
2713         (_bfd_nodynamic_get_synthetic_symtab): New functions.
2714         * libbfd-in.h: Declare new functions.  Update existing defines,
2715         removing casts.
2716         * aix386-core.c: Update to use new hooks.  Formatting.
2717         * aout-adobe.c: Likewise.
2718         * aout-arm.c: Likewise.
2719         * aout-target.h: Likewise.
2720         * aout-tic30.c: Likewise.
2721         * aoutf1.h: Likewise.
2722         * binary.c: Likewise.
2723         * bout.c: Likewise.
2724         * cisco-core.c: Likewise.
2725         * coff-alpha.c: Likewise.
2726         * coff-i386.c: Likewise.
2727         * coff-i860.c: Likewise.
2728         * coff-i960.c: Likewise.
2729         * coff-ia64.c: Likewise.
2730         * coff-mips.c: Likewise.
2731         * coff-ppc.c: Likewise.
2732         * coff-rs6000.c: Likewise.
2733         * coff-sh.c: Likewise.
2734         * coff-tic30.c: Likewise.
2735         * coff-tic54x.c: Likewise.
2736         * coff-x86_64.c: Likewise.
2737         * coff64-rs6000.c: Likewise.
2738         * coffcode.h: Likewise.
2739         * elf-m10300.c: Likewise.
2740         * elf32-cr16.c: Likewise.
2741         * elf32-lm32.c: Likewise.
2742         * elf32-m32r.c: Likewise.
2743         * elf32-metag.c: Likewise.
2744         * elf32-score.c: Likewise.
2745         * elf32-score7.c: Likewise.
2746         * elf32-tilepro.c: Likewise.
2747         * elf32-xstormy16.c: Likewise.
2748         * elf32-xtensa.c: Likewise.
2749         * elf64-alpha.c: Likewise.
2750         * elf64-hppa.c: Likewise.
2751         * elf64-ia64-vms.c: Likewise.
2752         * elf64-mmix.c: Likewise.
2753         * elf64-sh64.c: Likewise.
2754         * elfnn-ia64.c: Likewise.
2755         * elfxx-sparc.c: Likewise.
2756         * elfxx-target.h: Likewise.
2757         * elfxx-tilegx.c: Likewise.
2758         * elfxx-x86.h: Likewise.
2759         * hp300hpux.c: Likewise.
2760         * hppabsd-core.c: Likewise.
2761         * hpux-core.c: Likewise.
2762         * i386msdos.c: Likewise.
2763         * i386os9k.c: Likewise.
2764         * ieee.c: Likewise.
2765         * ihex.c: Likewise.
2766         * irix-core.c: Likewise.
2767         * libaout.h: Likewise.
2768         * libecoff.h: Likewise.
2769         * mach-o-target.c: Likewise.
2770         * mach-o.c: Likewise.
2771         * mipsbsd.c: Likewise.
2772         * mmo.c: Likewise.
2773         * netbsd-core.c: Likewise.
2774         * nlm-target.h: Likewise.
2775         * oasys.c: Likewise.
2776         * osf-core.c: Likewise.
2777         * pdp11.c: Likewise.
2778         * pe-mips.c: Likewise.
2779         * pe-x86_64.c: Likewise.
2780         * pef.c: Likewise.
2781         * plugin.c: Likewise.
2782         * ppcboot.c: Likewise.
2783         * ptrace-core.c: Likewise.
2784         * sco5-core.c: Likewise.
2785         * som.c: Likewise.
2786         * sparclynx.c: Likewise.
2787         * srec.c: Likewise.
2788         * tekhex.c: Likewise.
2789         * trad-core.c: Likewise.
2790         * verilog.c: Likewise.
2791         * versados.c: Likewise.
2792         * vms-alpha.c: Likewise.
2793         * vms-lib.c: Likewise.
2794         * wasm-module.c: Likewise.
2795         * xsym.c: Likewise.
2796         * libbfd.h: Regenerate.
2797
2798 2018-02-15  Jim Wilson  <jimw@sifive.com>
2799
2800         * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore
2801         symbols whose section address is zero.
2802
2803         * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
2804         when pcrel_lo reloc has an addend.  Use reloc_dangerous callback for
2805         bfd_reloc_dangerous.  Use einfo instead of warning callback for errors.
2806         Add %X%P to error messages.
2807
2808 2018-02-15  Eric Botcazou  <ebotcazou@adacore.com>
2809
2810         PR ld/22832
2811         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
2812         Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
2813         and assert that the result of the call is not NULL.
2814
2815 2018-02-14  Nick Clifton  <nickc@redhat.com>
2816
2817         PR 22823
2818         Revert previous delta.  Add extra casts to avoid compile time
2819         warnings instead.
2820         * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
2821         cast to avoid warning from gcc v8 compiler.
2822         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
2823         (_bfd_generic_bfd_set_private_flags): Likewise.
2824         (_bfd_generic_bfd_copy_private_section_data): Likewise.
2825         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
2826         (_bfd_generic_bfd_copy_private_header_data): Likewise.
2827         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
2828         (_bfd_noarchive_construct_extended_name_table): Likewise.
2829         (_bfd_noarchive_truncate_arname): Likewise.
2830         (_bfd_noarchive_write_ar_hdr): Likewise.
2831         (_bfd_noarchive_get_elt_at_index): Likewise.
2832         (_bfd_nosymbols_canonicalize_symtab): Likewise.
2833         (_bfd_nosymbols_print_symbol): Likewise.
2834         (_bfd_nosymbols_get_symbol_info): Likewise.
2835         (_bfd_nosymbols_get_symbol_version_string): Likewise.
2836         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
2837         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
2838         (_bfd_nosymbols_get_lineno): Likewise.
2839         (_bfd_nosymbols_find_nearest_line): Likewise.
2840         (_bfd_nosymbols_find_line): Likewise.
2841         (_bfd_nosymbols_find_inliner_info): Likewise.
2842         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
2843         (_bfd_nosymbols_read_minisymbols): Likewise.
2844         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
2845         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
2846         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
2847         (_bfd_nowrite_set_arch_mach): Likewise.
2848         (_bfd_nowrite_set_section_contents): Likewise.
2849         (_bfd_nolink_sizeof_headers): Likewise.
2850         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
2851         (_bfd_nolink_bfd_relax_section): Likewise.
2852         (_bfd_nolink_bfd_gc_sections): Likewise.
2853         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
2854         (_bfd_nolink_bfd_merge_sections): Likewise.
2855         (_bfd_nolink_bfd_is_group_section): Likewise.
2856         (_bfd_nolink_bfd_discard_group): Likewise.
2857         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
2858         (_bfd_nolink_bfd_link_add_symbols): Likewise.
2859         (_bfd_nolink_bfd_link_just_syms): Likewise.
2860         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
2861         (_bfd_nolink_bfd_final_link): Likewise.
2862         (_bfd_nolink_bfd_link_split_section): Likewise.
2863         (_bfd_nolink_section_already_linked): Likewise.
2864         (_bfd_nolink_bfd_define_common_symbol): Likewise.
2865         (_bfd_nolink_bfd_define_start_stop): Likewise.
2866         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
2867         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
2868         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
2869         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
2870         * libbfd.c (bfd_false_any): Delete.
2871         (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
2872         (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
2873         * libbfd.h (extern): Regenerate
2874         * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
2875         cast to avoid warning from gcc v8 compiler.
2876         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
2877         * binary.c (binary_get_symbol_info): Likewise.
2878         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
2879         * coff-mips.c (mips_ecoff_backend_data): Likewise.
2880         * coffcode.h (coff_set_alignment_hook): Likewise.
2881         (symname_in_debug_hook): Likewise.
2882         (bfd_coff_backend_data bigobj_swap_table): Likewise.
2883         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
2884         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
2885         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
2886         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
2887         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
2888         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
2889         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
2890         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
2891         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
2892         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
2893         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
2894         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
2895         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
2896         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
2897         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
2898         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
2899         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
2900         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
2901         (bfd_elfNN_bfd_set_private_flags): Likewise.
2902         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
2903         (elf_backend_init_index_section): Likewise.
2904         (elf_backend_allow_non_load_phdr): Likewise.
2905         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
2906         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
2907         * ieee.c (ieee_construct_extended_name_table): Likewise.
2908         (ieee_write_armap): Likewise.
2909         (ieee_write_ar_hdr): Likewise.
2910         (ieee_bfd_is_target_special_symbol): Likewise.
2911         * ihex.c (ihex_canonicalize_symtab): Likewise.
2912         (ihex_bfd_is_target_special_symbol): Likewise.
2913         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
2914         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
2915         (_bfd_ecoff_set_alignment_hook): Likewise.
2916         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
2917         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
2918         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
2919         * oasys.c (oasys_construct_extended_name_table): Likewise.
2920         (oasys_write_armap): Likewise.
2921         (oasys_write_ar_hdr): Likewise.
2922         (oasys_bfd_is_target_special_symbol): Likewise.
2923         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
2924         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
2925         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
2926         * som.c (som_bfd_is_target_special_symbol): Likewise.
2927         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
2928         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
2929         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
2930         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
2931         (versados_bfd_reloc_name_lookup): Likewise.
2932         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
2933         (vms_bfd_define_start_stop): Likewise.
2934         (alpha_vms_bfd_is_target_special_symbol): Likewise.
2935         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
2936         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
2937
2938 2018-02-14  H.J. Lu  <hongjiu.lu@intel.com>
2939
2940         PR ld/22842
2941         * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
2942         PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
2943         * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
2944         R_X86_64_PC32 reloc against dynamic function in data section.
2945         Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
2946         (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
2947         against dynamic function in data section.
2948         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
2949         function address only if pcrel_plt is true.
2950         (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
2951         * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
2952         PC-relative PLT.  If PLT is PC-relative, don't generate dynamic
2953         PC-relative relocation against a function definition in data
2954         secton in PIE.  Remove the obsolete comments.
2955         (elf_x86_link_hash_table): Add pcrel_plt.
2956
2957 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
2958
2959         * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
2960         instead of bfd_link_pic, for building shared library.
2961
2962 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
2963
2964         PR gas/22791
2965         * elf64-x86-64.c (is_32bit_relative_branch): Removed.
2966         (elf_x86_64_relocate_section): Check PIC relocations in PIE.
2967         Remove is_32bit_relative_branch usage.  Disallow PC32 reloc
2968         against protected function in shared object.
2969
2970 2018-02-13  Sergei Trofimovich  <slyfox@inbox.ru>
2971
2972         PR 22828
2973         * po/ru.po: Fix typo in Russian translation.
2974
2975 2018-02-13  Maciej W. Rozycki  <macro@mips.com>
2976
2977         * wasm-module.c (wasm_scan_name_function_section): Rename
2978         `index' local variable to `idx'.
2979
2980 2018-02-13  Nick Clifton  <nickc@redhat.com>
2981
2982         PR 22823
2983         Fix compile time warnings generated by gcc version 8.
2984         * libbfd-in.h: Remove extraneous text from prototypes.
2985         Add prototypes for bfd_false_any, bfd_true_any,
2986         bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
2987         bfd_n1_any, bfd_void_any.
2988         (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
2989         function.
2990         (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
2991         (_bfd_generic_bfd_set_private_flags): Likewise.
2992         (_bfd_generic_bfd_copy_private_section_data): Likewise.
2993         (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
2994         (_bfd_generic_bfd_copy_private_header_data): Likewise.
2995         (_bfd_generic_bfd_print_private_bfd_data): Likewise.
2996         (_bfd_noarchive_construct_extended_name_table): Likewise.
2997         (_bfd_noarchive_truncate_arname): Likewise.
2998         (_bfd_noarchive_write_ar_hdr): Likewise.
2999         (_bfd_noarchive_get_elt_at_index): Likewise.
3000         (_bfd_nosymbols_canonicalize_symtab): Likewise.
3001         (_bfd_nosymbols_print_symbol): Likewise.
3002         (_bfd_nosymbols_get_symbol_info): Likewise.
3003         (_bfd_nosymbols_get_symbol_version_string): Likewise.
3004         (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
3005         (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
3006         (_bfd_nosymbols_get_lineno): Likewise.
3007         (_bfd_nosymbols_find_nearest_line): Likewise.
3008         (_bfd_nosymbols_find_line): Likewise.
3009         (_bfd_nosymbols_find_inliner_info): Likewise.
3010         (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
3011         (_bfd_nosymbols_read_minisymbols): Likewise.
3012         (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
3013         (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
3014         (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
3015         (_bfd_nowrite_set_arch_mach): Likewise.
3016         (_bfd_nowrite_set_section_contents): Likewise.
3017         (_bfd_nolink_sizeof_headers): Likewise.
3018         (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
3019         (_bfd_nolink_bfd_relax_section): Likewise.
3020         (_bfd_nolink_bfd_gc_sections): Likewise.
3021         (_bfd_nolink_bfd_lookup_section_flags): Likewise.
3022         (_bfd_nolink_bfd_merge_sections): Likewise.
3023         (_bfd_nolink_bfd_is_group_section): Likewise.
3024         (_bfd_nolink_bfd_discard_group): Likewise.
3025         (_bfd_nolink_bfd_link_hash_table_create): Likewise.
3026         (_bfd_nolink_bfd_link_add_symbols): Likewise.
3027         (_bfd_nolink_bfd_link_just_syms): Likewise.
3028         (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
3029         (_bfd_nolink_bfd_final_link): Likewise.
3030         (_bfd_nolink_bfd_link_split_section): Likewise.
3031         (_bfd_nolink_section_already_linked): Likewise.
3032         (_bfd_nolink_bfd_define_common_symbol): Likewise.
3033         (_bfd_nolink_bfd_define_start_stop): Likewise.
3034         (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
3035         (_bfd_nodynamic_get_synthetic_symtab): Likewise.
3036         (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
3037         (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
3038         * libbfd.c (bfd_false_any): New function.  Like bfd_false but
3039         accepts one or more arguments.
3040         (bfd_true_any): Likewise.
3041         (bfd_nullvoidptr_any): Likewise.
3042         (bfd_0_any): Likewise.
3043         (bfd_0u_any): Likewise.
3044         (bfd_0l_any): Likewise.
3045         (_bfd_n1_any): Likewise.
3046         (bfd_void_any): Likewise.
3047         * libbfd.h (extern): Regenerate
3048         * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
3049         based dummy function.
3050         * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
3051         * binary.c (binary_get_symbol_info): Likewise.
3052         * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
3053         * coff-mips.c (mips_ecoff_backend_data): Likewise.
3054         * coffcode.h (coff_set_alignment_hook): Likewise.
3055         (symname_in_debug_hook): Likewise.
3056         (bfd_coff_backend_data bigobj_swap_table): Likewise.
3057         * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
3058         * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
3059         * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
3060         * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
3061         * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
3062         * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
3063         * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
3064         * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
3065         * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
3066         * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
3067         * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
3068         * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
3069         * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
3070         * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
3071         * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
3072         * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
3073         (bfd_elfNN_bfd_make_debug_symbol): Likewise.
3074         (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
3075         (bfd_elfNN_bfd_set_private_flags): Likewise.
3076         (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
3077         (elf_backend_init_index_section): Likewise.
3078         (elf_backend_allow_non_load_phdr): Likewise.
3079         * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
3080         * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
3081         * ieee.c (ieee_construct_extended_name_table): Likewise.
3082         (ieee_write_armap): Likewise.
3083         (ieee_write_ar_hdr): Likewise.
3084         (ieee_bfd_is_target_special_symbol): Likewise.
3085         * ihex.c (ihex_canonicalize_symtab): Likewise.
3086         (ihex_bfd_is_target_special_symbol): Likewise.
3087         * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
3088         * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
3089         (_bfd_ecoff_set_alignment_hook): Likewise.
3090         * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
3091         * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
3092         * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
3093         * oasys.c (oasys_construct_extended_name_table): Likewise.
3094         (oasys_write_armap): Likewise.
3095         (oasys_write_ar_hdr): Likewise.
3096         (oasys_bfd_is_target_special_symbol): Likewise.
3097         * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
3098         * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
3099         * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
3100         * som.c (som_bfd_is_target_special_symbol): Likewise.
3101         * srec.c (srec_bfd_is_target_special_symbol): Likewise.
3102         * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
3103         * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
3104         * versados.c (versados_bfd_is_target_special_symbol): Likewise.
3105         (versados_bfd_reloc_name_lookup): Likewise.
3106         * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
3107         (vms_bfd_define_start_stop): Likewise.
3108         (alpha_vms_bfd_is_target_special_symbol): Likewise.
3109         * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
3110         * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
3111         * elf32-arc.c (get_replace_function): Assign replacement function
3112         to func pointer.
3113         * elf32-i370.c (i370_noop): Update prototype.
3114
3115 2018-02-13  Alan Modra  <amodra@gmail.com>
3116
3117         PR 22836
3118         * elf.c (_bfd_elf_fixup_group_sections): Account for removed
3119         relocation sections.  If size reduces to just the flag word,
3120         remove that too and mark with SEC_EXCLUDE.
3121         * elflink.c (bfd_elf_final_link): Strip empty group sections.
3122
3123 2018-02-13  Alan Modra  <amodra@gmail.com>
3124
3125         PR 22829
3126         * elf.c (assign_file_positions_for_non_load_sections): Rewrite
3127         PT_GNU_RELRO setup.
3128
3129 2018-02-12  Zebediah Figura  <z.figura12@gmail.com>
3130
3131         * i386msdos.c (msdos_mkobject); New function.
3132         (msdos_object_p): New function.
3133         (i386_msdos_vec): Use msdos_object_p as the check_format
3134         function.
3135         * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
3136         NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
3137         IMAGE_NT_SIGNATURE.
3138         * peXXigen.c: Likewise.
3139         * coff-ia64.c: Likewise.
3140
3141 2018-02-12  Nick Clifton  <nickc@redhat.com>
3142
3143         * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
3144         assignment.
3145         * elf32-arc.c (elf_arc_relocate_section): Likewise.
3146
3147 2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
3148
3149         * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
3150         (sparc_elf_append_rela): Assert that there is enough room in section.
3151         (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
3152         (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
3153         (allocate_dynrelocs): Remove outdated comments and reorder conditions.
3154         For a symbol subject to a GOT relocation, reserve a slot in the
3155         relocation section if the symbol isn't dynamic and we are in PIC mode.
3156         (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
3157         is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
3158         <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
3159         <R_SPARC_PC10>: Reorder conditions.  Remove always-false assertion.
3160         (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
3161         resolved_to_zero.  Do not generate a dynamic GOT relocation for an
3162         undefined weak symbol with non-default visibility.  Remove superfluous
3163         'else' and fix formatting.
3164
3165 2018-02-09  H.J. Lu  <hongjiu.lu@intel.com>
3166
3167         * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
3168         is_solaris.
3169         (i386_elf32_sol2_vec): Don't declare.
3170         (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
3171         Don't set need_global_offset_table.
3172         (elf_i386_solaris_arch_bed): New.
3173         (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
3174         Solaris.
3175         * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
3176         target_os != is_nacl instead of target_os == is_normal.
3177         (x86_64_elf64_sol2_vec): Don't declare.
3178         (elf_x86_64_link_setup_gnu_properties): Check target_os !=
3179         is_nacl instead of target_os == is_normal.  Don't set
3180         need_global_offset_table.
3181         (elf_x86_64_solaris_arch_bed): New.
3182         (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
3183         Solaris.
3184         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
3185         _GLOBAL_OFFSET_TABLE_ for Solaris.
3186         (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
3187         need_global_offset_table.
3188         * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
3189         (elf_x86_link_hash_table): Remove need_global_offset_table.
3190         (elf_x86_init_table): Likewise.
3191
3192 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
3193
3194         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
3195         Remove prototype.
3196         (i386_elf32_sol2_vec): Declared.
3197         (elf_i386_link_setup_gnu_properties): Set
3198         need_global_offset_table with info->output_bfd->xvec.
3199         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
3200         Remove prototype.
3201         (x86_64_elf64_sol2_vec): Declared.
3202         (elf_x86_64_link_setup_gnu_properties): Set
3203         need_global_offset_table with info->output_bfd->xvec.
3204
3205 2018-02-08  H.J. Lu  <hongjiu.lu@intel.com>
3206
3207         * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
3208         New prototype.
3209         (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
3210         for Solaris.
3211         * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
3212         New prototype.
3213         (elf_x86_64_link_setup_gnu_properties): Set
3214         need_global_offset_table for Solaris.
3215         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
3216         unused _GLOBAL_OFFSET_TABLE_ for Solaris.
3217         (_bfd_x86_elf_link_setup_gnu_properties): Copy
3218         need_global_offset_table.
3219         * elfxx-x86.h (elf_x86_link_hash_table): Add
3220         need_global_offset_table.
3221         (elf_x86_init_table): Likewise.
3222
3223 2018-02-08  Jim Wilson  <jimw@sifive.com>
3224
3225         * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
3226         change.
3227
3228 2018-02-08  Nick Clifton  <nickc@redhat.com>
3229
3230         PR 22788
3231         * elf.c (elf_parse_notes): Reject notes with excessuively large
3232         alignments.
3233
3234 2018-02-07  Alan Modra  <amodra@gmail.com>
3235
3236         Revert 2018-01-17  Alan Modra  <amodra@gmail.com>
3237         * elf32-ppc.c: Remove speculation barrier support.
3238         * elf32-ppc.h: Likewise.
3239         * elf64-ppc.c: Likewise.
3240         * elf64-ppc.h: Likewise.
3241
3242 2018-02-06  Jim Wilson  <jimw@sifive.com>
3243
3244         * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
3245         callback to report an error.
3246
3247 2018-02-06  Eric Botcazou  <ebotcazou@adacore.com>
3248
3249         PR ld/22263
3250         * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
3251         into call to !bfd_link_executable and tidy up.
3252         (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
3253         <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
3254         !bfd_link_executable.
3255         <R_SPARC_TLS_IE_HI22>: Likewise.
3256         <GOT relocations>: Remove useless code, tidy and merge related blocks.
3257         <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
3258         !bfd_link_executable.
3259         <R_SPARC_WPLT30>: Tidy up.
3260         (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
3261         !bfd_link_executable.
3262         (allocate_dynrelocs): Likewise.
3263         (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
3264         <R_SPARC_TLS_GD_HI22>: Merge into...
3265         <R_SPARC_TLS_GD_LO10>: ...this.  Adjust 4th argument in call to
3266         sparc_elf_tls_transition and remove redundant code.
3267         <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
3268         !bfd_link_executable.
3269         <R_SPARC_TLS_LDO_HIX22>: Likewise.
3270         <R_SPARC_TLS_LE_HIX22>: Likewise.  Tidy up.
3271         <R_SPARC_TLS_LDM_CALL>: Likewise.
3272         <R_SPARC_TLS_GD_CALL>: Likewise.  Tidy up.
3273         <R_SPARC_TLS_GD_ADD>: Likewise.
3274         <R_SPARC_TLS_LDM_ADD>: Likewise.
3275         <R_SPARC_TLS_LDO_ADD>: Likewise.
3276         <R_SPARC_TLS_IE_LD>: Likewise.
3277
3278 2018-02-06  MiloÅ¡ Stojanović  <milos.stojanovic@rt-rk.com>
3279
3280         PR 22789
3281         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
3282         functions failed to find the function name, try the generic elf
3283         find function instead.
3284
3285 2018-02-06  Sergio Durigan Junior  <sergiodj@redhat.com>
3286
3287         * coff-rs6000.c (xcoff_write_archive_contents_old): Use
3288         'memcpy' instead of 'strncpy' when writing the magic number.
3289
3290 2018-02-06  Nick Clifton  <nickc@redhat.com>
3291
3292         PR 22794
3293         * opncls.c (bfd_get_debug_link_info_1): Check the size of the
3294         section before attempting to read it in.
3295         (bfd_get_alt_debug_link_info): Likewise.
3296
3297 2018-02-06  Paul Carroll  <pcarroll@codesourcery.com>
3298
3299         * bfd/dwarf2.c (find_abstract_name): Modified to return file and
3300         line information in addition to name, if they can be found.
3301
3302 2018-02-05  Renlin Li  <renlin.li@arm.com>
3303
3304         PR ld/22764
3305         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
3306         R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
3307         check for writeable section as well.
3308
3309 2018-02-05  H.J. Lu  <hongjiu.lu@intel.com>
3310
3311         PR ld/22782
3312         * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
3313         _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
3314         undefined weak symbol to 0.
3315         * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
3316         if _GLOBAL_OFFSET_TABLE_ is referenced.
3317         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
3318         got_referenced instead of ref_regular_nonweak.  Remove the
3319         unused _GLOBAL_OFFSET_TABLE_ from symbol table.
3320         * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
3321
3322 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
3323
3324         * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
3325         initialize `hi_reloc'.
3326
3327 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
3328
3329         * elfxx-mips.c (_bfd_mips_elf_section_processing): For
3330         SHT_MIPS_REGINFO sections don't assert the correct size and
3331         report an error instead.
3332
3333 2018-02-05  Maciej W. Rozycki  <macro@mips.com>
3334
3335         * elf.c (_bfd_elf_write_object_contents): Propagate a failure
3336         status from `->elf_backend_section_processing'.
3337
3338 2018-02-02  Jim Wilson  <jimw@sifive.com>
3339
3340         PR ld/22756
3341         * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
3342         If link_info->wrap_hash, check for a duplicate symbol and ignore.
3343         (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
3344         Pass new argument to riscv_relax_delete_bytes.
3345         (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise.  Remove
3346         ATTRIBUTE_UNUSED from link_info parameter.
3347
3348 2018-02-02  Alan Modra  <amodra@gmail.com>
3349
3350         * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
3351         emitted for toc sequence optimization.  Set and use "howto" later.
3352
3353 2018-02-01  Simon Marchi  <simon.marchi@ericsson.com>
3354
3355         * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
3356         arithmetic on NULL pointer.
3357         * elflink.c (_bfd_elf_archive_symbol_lookup,
3358         elf_link_add_archive_symbols): Likewise.
3359
3360 2018-01-31  Michael Matz  <matz@suse.de>
3361
3362         * elflink.c (bfd_elf_define_start_stop): Fix check of
3363         def_dynamic.
3364
3365 2018-01-31  H.J. Lu  <hongjiu.lu@intel.com>
3366
3367         PR ld/21964
3368         * elflink.c (bfd_elf_define_start_stop): Check if __start and
3369         __stop symbols are referenced by shared objects.
3370
3371 2018-01-30  Alan Modra  <amodra@gmail.com>
3372
3373         PR 22758
3374         * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
3375         segment when demand paged with lma on the same page.  Test this
3376         before load/non-load, executable/non-executable,
3377         writable/non-writable tests and simplify.  Delete bogus relro
3378         condition in writable/non-writable test.  Delete outdated
3379         comment.  Formatting.
3380
3381 2018-01-30  Alan Modra  <amodra@gmail.com>
3382
3383         * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
3384         symbols dynamic.
3385
3386 2018-01-29  Alan Modra  <amodra@gmail.com>
3387
3388         PR 22741
3389         * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
3390         range before converting to a symbol table pointer.
3391
3392 2018-01-27  Nick Clifton  <nickc@redhat.com>
3393
3394         * po/ru.po: Updated Russian translation.
3395
3396 2018-01-26  Alan Modra  <amodra@gmail.com>
3397
3398         * elflink.c (bfd_elf_define_start_stop): Override symbols when
3399         they are defined dynamically.
3400
3401 2018-01-26  Alan Modra  <amodra@gmail.com>
3402
3403         * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
3404         .branch_lt changes size.
3405
3406 2018-01-25  Alan Modra  <amodra@gmail.com>
3407
3408         PR 22746
3409         * elfcode.h (elf_object_p): Avoid integer overflow.
3410
3411 2018-01-25  Eric Botcazou  <ebotcazou@adacore.com>
3412
3413         PR ld/22727
3414         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
3415         Do a mere lookup of the __tls_get_addr symbol instead of adding it.
3416
3417         Revert
3418         2017-10-19  H.J. Lu  <hongjiu.lu@intel.com>
3419
3420         PR ld/22263
3421         * elfxx-sparc.c (sparc_elf_tls_transition): Replace
3422         bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
3423         bfd_link_executable for TLS check.
3424         (_bfd_sparc_elf_check_relocs): Likewise.
3425         (allocate_dynrelocs): Likewise.
3426         (_bfd_sparc_elf_relocate_section): Likewise.
3427
3428 2018-01-24  Renlin Li  <renlin.li@arm.com>
3429
3430         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
3431         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3432         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3433         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3434         BFD_RELOC_AARCH64_MOVW_PREL_G3.
3435         * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3436         (_bfd_aarch64_elf_resolve_relocation): Likewise.
3437
3438 2018-01-24  Renlin Li  <renlin.li@arm.com>
3439
3440         * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
3441         BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
3442         BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
3443         BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
3444         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
3445         BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
3446         BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
3447         BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
3448         BFD_RELOC_AARCH64_MOVW_PREL_G3.
3449         * bfd-in2.h: Regenerate.
3450         * libbfd.h: Regenerate.
3451
3452 2018-01-23  Maciej W. Rozycki  <macro@mips.com>
3453
3454         * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
3455         `mips_elf32_section_processing' comment reference.
3456
3457 2018-01-20  H.J. Lu  <hongjiu.lu@intel.com>
3458
3459         PR ld/22721
3460         * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
3461         versioned __tls_get_addr symbol.
3462
3463 2018-01-19  Nick Clifton  <nickc@redhat.com>
3464
3465         * po/fr.po: Updated French translation.
3466
3467 2018-01-18  Alan Modra  <amodra@gmail.com>
3468
3469         * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
3470         * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
3471         (ppc64_elf_build_stubs): Likewise.
3472
3473 2018-01-17  Nick Clifton  <nickc@redhat.com>
3474
3475         * po/ru.po: Updated Russian translation.
3476         * po/uk/po: Updated Ukranian translation.
3477
3478 2018-01-17  Alan Modra  <amodra@gmail.com>
3479
3480         * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
3481
3482 2018-01-17  Alan Modra  <amodra@gmail.com>
3483
3484         * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
3485         (CRSETEQ, BEQCTRM): Define.
3486         (is_nonpic_glink_stub): Don't check bctr.
3487         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3488         (ppc_elf_relax_section): Size speculation barrier.
3489         (output_bctr): New function.
3490         (write_glink_stub): Use output_bctr.
3491         (ppc_elf_relocate_section): Use output_bctr for long branch stub.
3492         (ppc_elf_finish_dynamic_symbol): Likewise.
3493         (ppc_elf_finish_dynamic_sections): Use output_bctr.
3494         * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
3495         * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
3496         (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
3497         (size_global_entry_stubs): Handle speculation barrier sizing.
3498         (plt_stub_size): Likewise.
3499         (output_bctr): New function.
3500         (build_plt_stub, build_tls_get_addr_stub): Output speculation
3501         barrier.
3502         (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
3503         (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
3504         (build_global_entry_stubs): Output speculation barrier.
3505         (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
3506         * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
3507
3508 2018-01-17  Alan Modra  <amodra@gmail.com>
3509
3510         * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
3511         __tls_get_addr_opt, and alignment sizing.
3512         (TLS_GET_ADDR_GLINK_SIZE): Delete.
3513         (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
3514         (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
3515         or 8 insns.
3516         (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
3517         (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
3518         (ppc_elf_size_dynamic_sections): Likewise.  Size branch table
3519         by PLT reloc count.
3520         (write_glink_stub): Handle __tls_get_addr_opt stub.
3521         Pad out to size given by GLINK_ENTRY_SIZE.
3522         (ppc_elf_relocate_section): Adjust write_glink_stub call.
3523         (ppc_elf_finish_dynamic_symbol): Likewise.
3524         (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
3525         insn array since so many need rewriting.
3526         * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
3527         * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
3528         GLINK_CALL_STUB_SIZE.  Add htab param and evaluate to size without
3529         nops.  Adjust all uses.
3530         (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
3531         in glink_vma calculation.
3532         (struct ppc_link_hash_table): Add global_entry section pointer.
3533         (create_linkage_sections): Create separate section for global
3534         entry stubs.
3535         (PPC_LO, PPC_HI, PPC_HA): Move earlier.
3536         (size_global_entry_stubs): Handle sizing for aligned stubs.
3537         (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
3538         and don't stash end of glink branch table in rawsize.
3539         (ppc_build_one_stub): Rewrite stub size calculations.
3540         (build_global_entry_stubs): Use new section.
3541         (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
3542         Build lazy link stubs out to end of section.  Build global entry
3543         stubs in new section.
3544
3545 2018-01-15  Nick Clifton  <nickc@redhat.com>
3546
3547         * po/uk.po: Updated Ukranian translation.
3548
3549 2018-01-13  Nick Clifton  <nickc@redhat.com>
3550
3551         * po/bfd.pot: Regenerated.
3552
3553 2018-01-13  Nick Clifton  <nickc@redhat.com>
3554
3555         * version.m4: Bump version to 2.30.51
3556         * configure: Regenerate.
3557
3558 2018-01-13  Nick Clifton  <nickc@redhat.com>
3559
3560         2.30 branch created.
3561
3562 2018-01-12  Jens Widell  <jl@opera.com>
3563
3564         * elf.c (setup_group): Optimize search for group by remembering
3565         last found group and restarting search at that index.
3566         * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
3567
3568 2018-01-12  Gunther Nikl  <gnikl@users.sourceforge.net>
3569
3570         * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
3571         bfd_link_common_skip_none in switch.
3572
3573 2018-01-12  Alan Modra  <amodra@gmail.com>
3574
3575         PR ld/22649
3576         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
3577         references on forced local symbols.
3578
3579 2018-01-12  Vlad Ivanov  <vlad@ivanov.email>
3580
3581         * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
3582         .reginfo section has wrong size.
3583
3584 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3585
3586         PR ld/22393
3587         * elf.c (_bfd_elf_map_sections_to_segments): When generating
3588         separate code and read-only data LOAD segments, create a new
3589         LOAD segment if the previous section contains text and the
3590         current section doesn't or vice versa.  Don't put a writable
3591         section in a read-only segment if there is a RELRO segment.
3592
3593 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3594
3595         PR ld/22649
3596         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
3597         references on forced local symbols.
3598
3599 2018-01-11  H.J. Lu  <hongjiu.lu@intel.com>
3600
3601         PR ld/22677
3602         * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
3603         INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
3604
3605 2018-01-09  Kuan-Lin Chen  <kuanlinchentw@gmail.com>
3606
3607         PR 22662
3608         * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
3609
3610 2018-01-03  John Baldwin  <jhb@FreeBSD.org>
3611
3612         * elf.c (elfcore_grok_freebsd_note): Handle
3613         NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
3614         NT_FREEBSD_PROCSTAT_VMMAP.
3615
3616 2018-01-03  Alan Modra  <amodra@gmail.com>
3617
3618         Update year range in copyright notice of all files.
3619
3620 For older changes see ChangeLog-2017
3621 \f
3622 Copyright (C) 2018 Free Software Foundation, Inc.
3623
3624 Copying and distribution of this file, with or without modification,
3625 are permitted in any medium without royalty provided the copyright
3626 notice and this notice are preserved.
3627
3628 Local Variables:
3629 mode: change-log
3630 left-margin: 8
3631 fill-column: 74
3632 version-control: never
3633 End: