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