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