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