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