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