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