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