Update version number to 2.32.90 for pre-release on 2.33 branch.
[external/binutils.git] / bfd / ChangeLog
1 2019-09-16  Phil Blundell  <pb@pbcl.net>
2
3         * version.m4: Set version to 2.32.90 for pre-release.
4         * Makefile.in, doc/Makefile.in, configure: Regenerated.
5
6 2019-09-09  Phil Blundell  <pb@pbcl.net>
7
8         binutils 2.33 branch created.
9
10 2019-09-06  Alan Modra  <amodra@gmail.com>
11
12         * aout-target.h (object_p): Formatting.
13         * bfd-in.h (bfd_get_filename): Don't cast to char*.
14         * corefile.c (generic_core_file_matches_executable_p): Constify
15         variables and remove cast.
16         * bfd-in2.h: Regenerate.
17
18 2019-09-05  Alan Modra  <amodra@gmail.com>
19
20         * elf64-ppc.c (ppc64_elf_check_relocs): Interpret an addend in
21         GOT_PCREL and PLT_PCREL relocs as affecting the value stored
22         in the GOT/PLT entry rather than affecting the offset to that
23         GOI/PLT entry.
24         (ppc64_elf_edit_toc, ppc64_elf_relocate_section): Likewise.
25
26 2019-09-05  Alan Modra  <amodra@gmail.com>
27
28         * elf64-ppc.c (xlate_pcrel_opt): Handle prefix loads and stores
29         in second instruction.
30         (ppc64_elf_relocate_section): Likewise.
31
32 2019-09-05  Alan Modra  <amodra@gmail.com>
33
34         PR 24955
35         * libbfd-in.h (bfd_strdup): New inline function.
36         * archive.c (_bfd_get_elt_at_filepos): Use bfd_strdup.  Close
37         bfd on error.
38         * elfcode.h (_bfd_elf_bfd_from_remote_memory): Use bfd_strdup.
39         * opncls.c (bfd_fopen): Use bfd_strdup.  Close fd and stream
40         on error.
41         (bfd_openstreamr): Use bfd_strdup.
42         (bfd_openr_iovec, bfd_openw, bfd_create): Likewise.
43         * plugin.c (try_load_plugin): Use bfd_malloc.
44         * libbfd.h: Regenerate.
45
46 2019-09-02  Alan Modra  <amodra@gmail.com>
47
48         PR 11983
49         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Free debug_filename
50         on success.  Tidy.
51         (read_alt_indirect_string): Likewise.
52         (read_alt_indirect_ref): Likewise.
53
54 2019-08-31  Jim Wilson  <jimw@sifive.com>
55
56         PR 23825
57         * elfnn-riscv.c (riscv_elf_create_dynamic_sections): Add SEC_LOAD,
58         SEC_DATA, and SEC_HAS_CONTENTS to .tdata.dyn section.
59
60 2019-08-30  Jim Wilson  <jimw@sifive.com>
61
62         * elfnn-riscv.c (riscv_elf_relocate_section): For unresolvable reloc
63         error, call bfd_set_error, set ret to FALSE, and goto out label.
64
65 2019-08-30  H.J. Lu  <hongjiu.lu@intel.com>
66
67         PR ld/24951
68         * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS,
69         BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive.
70
71 2019-08-29  Alan Modra  <amodra@gmail.com>
72
73         PR 24697
74         * elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc
75         when !bfd_link_executable for R_PPC_EMB_SDA2I16 and
76         R_PPC_EMB_SDA2REL.  Don't call bad_shared_reloc for any other
77         reloc.
78
79 2019-08-29  Alan Modra  <amodra@gmail.com>
80
81         * elf64-ppc.c (xlate_pcrel_opt): Add poff parameter.  Allow offset
82         on second insn, return it in poff.
83         (ppc64_elf_relocate_section): Add offset to paddi addend for
84         PCREL_OPT.
85
86 2019-08-28  Jim Wilson  <jimw@sifive.com>
87
88         * elfnn-riscv.c (_bfd_riscv_relax_lui): Add check to exclude abs
89         section when setting max_alignment.  Update comment.
90         (_bfd_riscv_relax_pc): Likewise.
91
92 2019-08-29  Alan Modra  <amodra@gmail.com>
93
94         PR 24891
95         * bfd.c (struct bfd): Add no_element_cache.
96         * archive.c (_bfd_get_elt_at_filepos): Don't add element to
97         archive cache when no_element_cache.
98         (bfd_generic_archive_p): Set no_element_cache when opening first
99         element to check format.  Close first element too.
100         (do_slurp_bsd_armap): Don't zero ardata->cache here.
101         * bfd-in2.h: Regenerate.
102
103 2019-08-24  Alan Modra  <amodra@gmail.com>
104
105         * elf64-ppc.c (ppc64_elf_edit_toc): Exclude undefined weak
106         symbols from GOT optimisation.
107
108 2019-08-23  Stafford Horne  <shorne@gmail.com>
109
110         * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Use correct value for
111         PLT GOT entries.
112
113 2019-08-23  Nick Clifton  <nickc@redhat.com>
114
115         PR 24456
116         * elf.c (bfd_section_from_shdr): Issue an informative warning
117         message and continue processing other sections after encountering
118         a reloc section for a section which already has other relocs
119         associated with it.
120
121 2019-08-23  Alan Modra  <amodra@gmail.com>
122
123         PR 24933
124         * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Don't exit
125         on error without freeing plts[] contents.
126
127 2019-08-22  Dennis Zhang  <dennis.zhang@arm.com>
128
129         * cpu-arm.c: New entries for Cortex-M35P, Cortex-A77, Cortex-A76AE.
130
131 2019-08-22  Nick Clifton  <nickc@redhat.com>
132
133         PR 24922
134         * pei-x86_64.c (pex64_xdata_print_uwd_codes): Add checks before
135         reading data from extra records.
136
137 2019-08-22  Tamar Christina  <tamar.christina@arm.com>
138
139         PR ld/24601
140         * elfnn-aarch64.c (aarch64_relocate): Handle weak TLS and undefined TLS.
141         Also Pass input_bfd to _bfd_aarch64_elf_resolve_relocation.
142         * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use it.
143         * elfxx-aarch64.h (_bfd_aarch64_elf_resolve_relocation): Emit warning
144         for weak TLS.
145
146 2019-08-22  Alan Modra  <amodra@gmail.com>
147
148         * elf32-arm.c (cmse_scan): Don't use ARM_GET_SYM_CMSE_SPCL,
149         instead recognize CMSE_PREFIX in symbol name.
150         (elf32_arm_gc_mark_extra_sections): Likewise.
151         (elf32_arm_filter_cmse_symbols): Don't test ARM_GET_SYM_CMSE_SPCL.
152         (elf32_arm_swap_symbol_in): Don't invoke ARM_SET_SYM_CMSE_SPCL.
153
154 2019-08-20  Dennis Zhang  <dennis.zhang@arm.com>
155
156         * cpu-aarch64.c: New entries for Cortex-A34, Cortex-A65,
157          Cortex-A77, cortex-A65AE, and Cortex-A76AE.
158
159 2019-08-20  Tamar Christina  <tamar.christina@arm.com>
160
161         * elf32-arm.c (elf32_thumb2_plt_entry, elf32_arm_plt_thumb_stub,
162         elf32_arm_stub_long_branch_v4t_thumb_thumb,
163         elf32_arm_stub_long_branch_v4t_thumb_arm,
164         elf32_arm_stub_short_branch_v4t_thumb_arm,
165         elf32_arm_stub_long_branch_v4t_thumb_arm_pic,
166         elf32_arm_stub_long_branch_v4t_thumb_thumb_pic,
167         elf32_arm_stub_long_branch_v4t_thumb_tls_pic): Change nop to branch to
168         previous instruction.
169
170 2019-08-19  Tom Tromey  <tromey@adacore.com>
171
172         * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Create hash table
173         holding symbols.
174
175 2019-08-19  Alan Modra  <amodra@gmail.com>
176
177         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename has_gotrel
178         to has_optrel.
179         (struct _ppc64_elf_section_data): Likewise.
180         (ppc64_elf_check_relocs): Set has_optrel for more relocs.
181         (ppc64_elf_edit_toc): Do ha/lo insn checks in GOT loop rather
182         than TOC loop.  Check PLT16 insns too.
183
184 2019-08-16  H.J. Lu  <hongjiu.lu@intel.com>
185
186         PR ld/24905
187         * elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for
188         PC-relative relocations back to ...
189         (elf_x86_64_relocate_section): Here.
190
191 2019-08-16  Martin Liska  <mliska@suse.cz>
192
193         PR ld/24912
194         * elflink.c: Report error only for not relocatable.
195         * linker.c (_bfd_generic_link_add_one_symbol): Do not handle
196         here lto_slim_object as it's handled in caller.
197
198 2019-08-16  Alan Modra  <amodra@gmail.com>
199
200         * elf32-ppc.c (ppc_elf_relocate_section): Optimize unaligned relocs.
201
202 2019-08-15  Jim Wilson  <jimw@sifive.com>
203
204         * elfnn-riscv.c (perform_relocation) <R_RISCV_RVC_LUI>: If
205         RISCV_CONST_HIGH_PART (value) is zero, then convert c.lui instruction
206         to c.li instruction, and use ENCODE_RVC_IMM to set value.
207
208 2019-08-15  Tom Tromey  <tromey@adacore.com>
209
210         * dwarf2.c (scan_unit_for_symbols): Check for end of CU, not end
211         of section.
212
213 2019-08-14  Alan Modra  <amodra@gmail.com>
214
215         PR 24623
216         * dwarf2.c (stash_comp_unit): New function, extracted from..
217         (_bfd_dwarf2_find_nearest_line): ..here.
218         (find_abstract_instance): Parse comp units and decode line info
219         as needed.
220
221 2019-08-14  Alan Modra  <amodra@gmail.com>
222
223         * dwarf2.c (comp_unit_maybe_decode_line_info): Declare.
224         (comp_unit_find_nearest_line): Use it here..
225         (_bfd_dwarf2_find_symbol_bias): ..and here.
226
227 2019-08-14  Alan Modra  <amodra@gmail.com>
228
229         * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove addr_size parameter.
230         * libbfd-in.h  (_bfd_dwarf2_find_nearest_line): Update prototype.
231         * coffgen.c (coff_find_nearest_line_with_names): Adjust
232         _bfd_dwarf2_find_nearest_line calls.
233         * elf.c (_bfd_elf_find_nearest_line, _bfd_elf_find_line): Likewise.
234         * elf32-arm.c (elf32_arm_find_nearest_line): Likewise.
235         * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise.
236         * elfnn-aarch64.c (elfNN_aarch64_find_nearest_line): Likewise.
237         * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise.
238         * mach-o.c (bfd_mach_o_find_nearest_line): Likewise.
239         * libbfd.h: Regenerate.
240
241 2019-08-09  Mihailo Stojanovic  <mihailo.stojanovic@rt-rk.com>
242
243         * elf-bfd.h (struct elf_backend_data): New members.
244         * elflink.c (_bfd_elf_link_create_dynamic_sections): Create
245         .gnu.hash section if necessary.
246         (struct collect_gnu_hash_codes): New member.
247         (elf_gnu_hash_process_symidx): New function name.
248         (elf_renumber_gnu_hash_syms): Ignore local and undefined
249         symbols. Record xlat location for every symbol which should have
250         a .MIPS.xhash entry.
251         (bfd_elf_size_dynamic_sections): Add DT_GNU_HASH dynamic tag to
252         dynamic section if necessary.
253         (GNU_HASH_SECTION_NAME): New define.
254         (bfd_elf_size_dynsym_hash_dynstr): Get .MIPS.xhash section.
255         Update the section size info.
256         * elfxx-mips.c (struct mips_elf_hash_sort_data): New members.
257         (struct mips_elf_link_hash_entry): New member.
258         (mips_elf_link_hash_newfunc): Initialize .MIPS.xhash translation
259         table location.
260         (mips_elf_sort_hash_table): Initialize the pointer to the
261         .MIPS.xhash section.
262         (mips_elf_sort_hash_table_f): Populate the .MIPS.xhash
263         translation table entry with the symbol dynindx.
264         (_bfd_mips_elf_section_from_shdr): Add SHT_MIPS_XHASH.
265         (_bfd_mips_elf_fake_sections): Initialize .MIPS.xhash section
266         info.
267         (_bfd_mips_elf_create_dynamic_sections): Create .MIPS.xhash
268         section.
269         (_bfd_mips_elf_size_dynamic_sections): Add DT_MIPS_XHASH tag to
270         dynamic section.
271         (_bfd_mips_elf_finish_synamic_sections): Add DT_MIPS_XHASH.
272         (_bfd_mips_elf_final_write_processing): Set .MIPS.xhash section
273         sh_link info.
274         (_bfd_mips_elf_get_target_dtag): Get DT_MIPS_XHASH tag.
275         (MIPS_LIBC_ABI_XHASH): New ABI version enum value.
276         (_bfd_mips_post_process_headers): Mark the ABI version as
277         MIPS_LIBC_ABI_XHASH if there exists a .MIPS.xhash section,
278         but not a .hash section.
279         (_bfd_mips_elf_record_xhash_symbol): New function. Record a
280         position in the translation table, associated with the hash
281         entry.
282         * elfxx-mips.h (literal_reloc_p): Define
283         elf_backend_record_xhash_symbol backend hook.
284         * elfxx-target.h: Initialize elf_backend_record_xhash_symbol
285         backend hook.
286
287 2019-08-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
288
289         * elf64-bpf.c (bpf_elf_relocate_section): New function.
290         (bpf_elf_insn_disp_reloc): Delete function.
291         (elf_backend_relocate_section): Define.
292
293 2019-08-07  Alan Modra  <amodra@gmail.com>
294
295         PR 24644
296         * archive64.c (_bfd_archive_64_bit_slurp_armap): Properly check
297         for overflow in expressions involving nsymz.
298
299 2019-08-01  Ilia Diachkov  <ilia.diachkov@optimitech.com>
300
301         * elfnn-riscv.c (_bfd_riscv_relax_lui): Set lui relax safety area to
302         two pages in relro presence.
303
304 2019-08-01  Max Filippov  <jcmvbkbc@gmail.com>
305
306         * elf32-xtensa.c (insn_num_slots, get_rsr_lend_opcode)
307         (get_wsr_lbeg_opcode): New functions.
308         (check_loop_aligned): Detect relaxed loops and adjust loop_len
309         and insn_len for the first actual instruction of the loop.
310
311 2019-07-30  Alan Modra  <amodra@gmail.com>
312
313         PR 24768
314         * bfd.c (struct bfd): Add lto_slim_object flag.
315         * bfd-in2.h: Regenerate.
316
317 2019-07-29  Martin Liska  <mliska@suse.cz>
318
319         PR 24768
320         * archive.c (_bfd_compute_and_write_armap): Come up with
321         report_plugin_err variable.
322         * bfd-in2.h (struct bfd): Add lto_slim_object flag.
323         * elf.c (struct lto_section): New.
324         (_bfd_elf_make_section_from_shdr): Parse content of
325         .gnu_lto_.lto section.
326         * elflink.c: Report error for a missing LTO plugin.
327         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
328
329 2019-07-28  Alan Modra  <amodra@gmail.com>
330
331         PR 24857
332         PR 24339
333         * elflink.c (elf_link_add_object_symbols): Report an informative
334         error on finding local symbols with index equal or greater than
335         symbol table sh_info.  Correct comment.  Allow such symbols in
336         dynamic objects.  Abort on NULL section for symbol.
337
338 2019-07-26  Alan Modra  <amodra@gmail.com>
339
340         * elf-bfd.h (struct output_elf_obj_tdata): Delete "linker" field.
341         (elf_linker): Don't define.
342         * elflink.c (bfd_elf_final_link): Don't set elf_linker.
343
344 2019-07-25  YunQiang Su  <syq@debian.org>
345
346         PR 24832
347         * elfxx-mips.c (mips_set_isa_flags): Default to MIPS 3 for 64-bit
348         mips inputs.
349
350 2019-07-24  Claudiu Zissulescu  <claziss@synopsys.com>
351
352         * elf32-arc.c (bfd_get_32_me): Add a small description, fix
353         formating.
354         (reloc_type_to_name): Fix formating.
355         (arc_elf_object_p): Likewise.
356         (debug_arc_reloc): Likewise.
357         (arc_do_relocation): Likewise.
358
359 2019-07-24  Claudiu Zissulescu  <claziss@synopsys.com>
360
361         * elf32-arc.c (bfd_get_32_me): New function.
362         (bfd_put_32_me): Likewise.
363         (arc_elf_relax_section): Likewise.
364         (bfd_elf32_bfd_relax_section): Define.
365
366 2019-07-24  Alan Modra  <amodra@gmail.com>
367
368         * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from
369         elf_backend_final_write_processing, don't pass linker arg.
370         (_bfd_elf_final_write_processing): Update prototype.
371         * elf.c (_bfd_elf_write_object_contents): Adjust call.
372         (_bfd_elf_final_write_processing): Return error on incompatible
373         OSABI and has_gnu_osabi.  Remove linker arg.
374         * elf-nacl.h (nacl_final_write_processing): Update prototype.
375         * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise.
376         * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise.
377         (_bfd_mips_elf_final_write_processing): Likewise.
378         * elf-hppa.h (elf_hppa_final_write_processing): Return status
379         and remove linker arg.
380         * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
381         * elf-nacl.c (nacl_final_write_processing): Likewise.
382         * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
383         * elf32-arc.c (arc_elf_final_write_processing): Likewise.
384         * elf32-arm.c (arm_final_write_processing): Likewise.
385         (elf32_arm_final_write_processing): Likewise.
386         (elf32_arm_nacl_final_write_processing): Likewise.
387         (elf32_arm_vxworks_final_write_processing): Likewise.
388         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
389         * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
390         * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
391         * elf32-cris.c (cris_elf_final_write_processing): Likewise.
392         * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
393         * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
394         * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
395         * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
396         * elf32-mips.c (mips_vxworks_final_write_processing): Likewise.
397         * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
398         * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
399         * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
400         * elf32-pj.c (pj_elf_final_write_processing): Likewise.
401         * elf32-ppc.c (ppc_final_write_processing): Likewise.
402         (ppc_elf_final_write_processing): Likewise.
403         (ppc_elf_vxworks_final_write_processing): Likewise.
404         * elf32-sparc.c (sparc_final_write_processing): Likewise.
405         (elf32_sparc_final_write_processing): Likewise.
406         (elf32_sparc_vxworks_final_write_processing): Likewise.
407         * elf32-v850.c (v850_elf_final_write_processing): Likewise.
408         * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
409         * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
410         * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
411         * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
412         * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise.
413         (_bfd_mips_elf_final_write_processing): Likewise.
414
415 2019-07-24  Alan Modra  <amodra@gmail.com>
416
417         * elf-vxworks.c (elf_vxworks_final_write_processing): Don't return
418         early.
419         * elf32-arc.c (arc_elf_final_write_processing): Likewise.
420         * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
421
422 2019-07-24  Alan Modra  <amodra@gmail.com>
423
424         * elf32-visium.c (visium_elf_post_process_headers): Don't set
425         EI_OSABI header byte here.
426         (ELF_OSABI): Define.
427
428 2019-07-23  Alan Modra  <amodra@gmail.com>
429
430         * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind.
431         * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind.
432         (get_program_header_size): Formatting.  Only test SH_GNU_MBIND
433         when elf_gnu_osabi_mbind is set.
434         (_bfd_elf_map_sections_to_segments): Likewise.
435         (_bfd_elf_init_private_section_data): Likewise.
436         (_bfd_elf_final_write_processing): Update comment.
437         * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry.
438         (elf_backend_special_sections): Define without .tbss for linux.
439
440 2019-07-23  Alan Modra  <amodra@gmail.com>
441
442         * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols.
443         Remove none, any, all enums.
444         (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi.
445         (_bfd_elf_final_write_processing): Declare.
446         * elf.c (_bfd_elf_write_object_contents): Unconditionally call
447         elf_backend_final_write_processing.
448         (_bfd_elf_post_process_headers): Move body of function to..
449         (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte
450         only when not already set.  Adjust for rename.
451         * elfxx-target.h (elf_backend_final_write_processing): Default to
452         _bfd_elf_final_write_processing.
453         * elf-hppa.h (elf_hppa_final_write_processing): Call
454         _bfd_elf_final_write_processing.
455         * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
456         * elf-nacl.c (nacl_final_write_processing): Likewise.
457         * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
458         * elf32-arc.c (arc_elf_final_write_processing): Likewise.
459         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
460         * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
461         * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
462         * elf32-cris.c (cris_elf_final_write_processing): Likewise.
463         * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
464         * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
465         * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
466         * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
467         * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
468         * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
469         * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
470         * elf32-pj.c (pj_elf_final_write_processing): Likewise.
471         * elf32-v850.c (v850_elf_final_write_processing): Likewise.
472         * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
473         * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
474         * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
475         * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
476         * elf32-arm.c (arm_final_write_processing): Split out from..
477         (elf32_arm_final_write_processing): ..here.  Call
478         _bfd_elf_final_write_processing.
479         (elf32_arm_nacl_final_write_processing): Adjust.
480         * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from..
481         (_bfd_mips_elf_final_write_processing): ..here.  Call
482         _bfd_elf_final_write_processing.
483         * elfxx-mips.h (_bfd_mips_final_write_processing): Declare.
484         * elf32-mips.c (mips_vxworks_final_write_processing): Adjust.
485         * elf32-ppc.c (ppc_final_write_processing): Split out from..
486         (ppc_elf_final_write_processing): ..here.  Call
487         _bfd_elf_final_write_processing.
488         (ppc_elf_vxworks_final_write_processing): Adjust.
489         * elf32-sparc.c (sparc_final_write_processing): Split out from..
490         (elf32_sparc_final_write_processing): ..here.  Call
491         _bfd_elf_final_write_processing.
492         (elf32_sparc_vxworks_final_write_processing): Adjust.
493         * elf32-d10v.c (elf_backend_final_write_processing): Don't define.
494         * elf32-d30v.c (elf_backend_final_write_processing): Don't define.
495         * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define.
496         * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define.
497         * elf32-s12z.c (elf_backend_final_write_processing): Don't define.
498         * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols.
499         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
500         * elflink.c (elf_link_add_object_symbols): Likewise.
501         (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here
502         instead.
503
504 2019-07-23  Omar Majid  <omajid@redhat.com>
505
506         * coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC,
507         I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC,
508         AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC,
509         AMD64_NETBSD_MAGIC.
510         * peXXigen.c: Add comment about source of .NET magic numbers.
511
512 2019-07-19  Alan Modra  <amodra@gmail.com>
513
514         * reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34),
515         (BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34),
516         (BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34),
517         (BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs.
518         * elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs.
519         (ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs.
520         (must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64.
521         (ppc64_elf_check_relocs): Support pcrel tls relocs.
522         (ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise.
523         * bfd-in2.h: Regenerate.
524         * libbfd.h: Regenerate.
525
526 2019-07-18  Alan Modra  <amodra@gmail.com>
527
528         * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
529         a TLS section symbol for edited relocs.  Tighten TLS symbol/reloc
530         match test.
531
532 2019-07-18  Alan Modra  <amodra@gmail.com>
533
534         * elf64-ppc.c (TLS_EXPLICIT): Define as 256.
535         (ppc64_elf_check_relocs): Don't store TLS_EXPLICIT even if char
536         is more than 8 bits.
537         (ppc64_elf_tls_optimize): Likewise.  Make tls_set, tls_clear, and
538         tls_type vars unsigned int.
539         (ppc64_elf_relocate_section): Use r_type rather than TLS_EXPLICIT
540         to select r_type edit.
541
542 2019-07-18  Alan Modra  <amodra@gmail.com>
543
544         * elf32-ppc.c (TLS_GDIE): Rename from TLS_TPRELGD throughout file.
545         Correct comment.
546         * elf64-ppc.c (TLS_GDIE): Likewise.
547
548 2019-07-18  Alan Modra  <amodra@gmail.com>
549
550         * elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed
551         range of tp-relative offsets.
552
553 2019-07-15  Alan Modra  <amodra@gmail.com>
554
555         * elflink.c (_bfd_elf_fix_symbol_flags): If the def for an
556         alias is no longer bfd_link_hash_defined, clear the alias.
557
558 2019-07-13  Alan Modra  <amodra@gmail.com>
559
560         * elflink.c (_bfd_elf_omit_section_dynsym_default): Don't keep
561         tls_sec.
562         (_bfd_elf_init_1_index_section): Prefer not using TLS sections.
563         (_bfd_elf_init_2_index_sections): Likewise.
564         * elf64-ppc.c (ppc64_elf_relocate_section): When emitting dynamic
565         relocations for local TLS symbols, use STN_UNDEF as the relocation
566         symbol.
567         * elf32-ppc.c (ppc_elf_relocate_section): Likewise, and don't
568         leave TLS symbol value in the addend.
569
570 2019-07-08  Alan Modra  <amodra@gmail.com>
571
572         PR 24785
573         * elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo
574         size before reading first word.
575
576 2019-07-02  Nick Clifton  <nickc@redhat.com>
577
578         PR 24717
579         * elf.c (is_debuginfo_file): New function.
580         (assign_file_positions_for_non_load_sections): Do not warn about
581         allocated sections outside of loadable segments if they are found
582         in a debuginfo file.
583         * elf-bfd.h (is_debuginfo_file): Prototype.
584
585 2019-07-02  Nick Clifton  <nickc@redhat.com>
586
587         PR 24753
588         * compress.c (bfd_get_full_section_contents): Do not complain
589         about linker created sections that are larger than the file size.
590
591 2019-07-02  Christophe Lyon  <christophe.lyon@linaro.org>
592
593         * bfd/elf32-arm.c (CMSE_STUB_NAME): New define.
594         (elf32_arm_get_stub_entry): Do not try to emit long-branch stubs
595         for CMSE stubs.
596         (arm_dedicated_stub_output_section_name): Use CMSE_STUB_NAME.
597
598 2019-07-02  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
599
600         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark debug
601         sections when .text section contain secure entry functions
602         is marked.
603
604 2019-07-01  Nick Clifton  <nickc@redhat.com>
605
606         PR 23839
607         * elf32-arm.c (elf32_arm_update_relocs): Do not include the
608         section VMA in the offset used to update exidx relocs.
609
610 2019-06-28  Nick Clifton  <nickc@redhat.com>
611
612         PR 24708
613         * elf.c (_bfd_elf_slurp_version_tables): Check for an excessively
614         large version reference section.
615         * compress.c (bfd_get_full_section_contents): Check for an
616         uncompressed section whose size is larger than the file size.
617
618 2019-06-28  Alan Modra  <amodra@gmail.com>
619
620         * format.c (bfd_check_format_matches): Don't match plugin target
621         if another target matches.  Expand comment.
622         * targets.c (_bfd_target_vector): Move plugin_vec after all other
623         non-corefile targets, outside !SELECT_VECS.
624         * config.bfd: Don't handle targ=plugin here.
625         * configure.ac: Don't add plugin to enable_targets or handle in
626         target loop setting selvecs and other target vars.
627         * configure: Regenerate.
628
629 2019-06-26  Nick Clifton  <nickc@redhat.com>
630
631         PR 24703
632         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add error
633         messages for failures.
634         * mach-o.c (bfd_mach_o_canonicalize_relocs): Set an bfd error code
635         if returning an error value.
636
637 2019-06-25  Jan Beulich  <jbeulich@suse.com>
638
639         * elf-properties.c (elf_find_and_remove_property): Rename last
640         parameter. Mention it in comment.
641
642 2019-06-24  Ilia Diachkov  <ilia.diachkov@optimitech.com>
643
644         * elfnn-riscv.c (_bfd_riscv_relax_lui): Delete early exit when
645         SEC_MERGE or SEC_CODE flags are set.
646         (_bfd_riscv_relax_section): New local symtype.  Set sym_sec and
647         symtype consistently.  Don't include sec_addr (sym_sec) in symval.
648         Add check for SEC_INFO_TYPE_MERGE and call _bfd_merged_section_offset.
649         Add sec_addr (sym_sec) after handling merge sections.
650
651 2019-06-24  H.J. Lu  <hongjiu.lu@intel.com>
652
653         PR ld/24721
654         * elf-properties.c (elf_merge_gnu_property_list): Remove the
655         property after reporting property removal.
656
657 2019-06-23  Alan Modra  <amodra@gmail.com>
658
659         PR 24704
660         * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel.
661         (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries.
662         Reduce range of offsets allowed for other GOT relocs.
663
664 2019-06-23  Alan Modra  <amodra@gmail.com>
665
666         PR 24689
667         * elfcode.h (elf_object_p): Warning fix.
668
669 2019-06-21  Alan Modra  <amodra@gmail.com>
670
671         PR 24689
672         * elfcode.h (elf_object_p): Check type of e_shstrndx section.
673
674 2019-06-19  Alan Modra  <amodra@gmail.com>
675
676         PR 24697
677         * elf32-ppc.c (ppc_elf_relocate_section): Don't read insn for
678         R_PPC_EMB_RELSDA.  Mask low bit of R_PPC_EMB_SDA21 r_offset.
679
680 2019-06-19  Alan Modra  <amodra@gmail.com>
681
682         * elf64-ppc.c (ppc64_elf_inline_plt): Correct st_other test for
683         functions that require r2 valid to use local entry.
684         (ppc64_elf_size_stubs, ppc64_elf_relocate_section): Likewise.
685
686 2019-06-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>
687
688         * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove.
689         (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal
690         with elfNN_aarch64_allocate_local_dynrelocs.
691
692 2019-06-14  Szabolcs Nagy  <szabolcs.nagy@arm.com>
693
694         * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32.
695
696 2019-06-14  Alan Modra  <amodra@gmail.com>
697
698         * Makefile.in: Regenerate.
699         * configure: Regenerate.
700
701 2019-06-14  Alan Modra  <amodra@gmail.com>
702
703         * elf64-ppc.c: Fix comments involving paddi.
704
705 2019-06-12  Adam Lackorzymski  <adam@os.inf.tu-dresden.de>
706
707         PR 24643
708         * elf32-arm.c (arm_elf_find_function): Fail if the symol table is
709         absent, or the bfd is not in the ELF formart.
710         * elfnn-aarch64.c (aarch64_elf_find_function): Likewise.
711
712 2019-06-10  Christos Zoulas  <christos@zoulas.com>
713
714         PR 24650
715         * elf.c (elfcore_make_auxv_note_section): New function.
716         (elfcore_grok_note): Use it.
717         (elfcore_grok_freebsd_note): Likewise.
718         (elfcore_grok_openbsd_note): Likewise.
719         (elfcore_grok_netbsd_note): Likewise.  Plus add support for
720         NT_NETBSDCORE_AUXV notes.
721
722 2019-06-06  Sudakshina Das  <sudi.das@arm.com>
723
724         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Set
725         alignment of the new gnu property section.
726
727 2019-06-06  Sudakshina Das  <sudi.das@arm.com>
728
729         * bfd-in.h: Change comment.
730         * bfd-in2.h: Regenerate.
731         * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning.
732         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties):
733         Likwise.
734
735 2019-05-28  Faraz Shahbazker  <fshahbazker@wavecomp.com>
736
737         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>:
738         Remove overflow check.
739
740 2019-05-28  Alan Modra  <amodra@gmail.com>
741
742         PR 24596
743         * cofflink.c (coff_link_check_archive_element): Don't assume
744         element is a coff object file after calling add_archive_element.
745
746 2019-05-28  Alan Modra  <amodra@gmail.com>
747
748         PR 24596
749         * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Don't
750         attempt to set sh_entsize for excluded PLT section.
751
752 2019-05-28  Alan Modra  <amodra@gmail.com>
753
754         PR 24596
755         * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt
756         to emit R_ALPHA_GOTTPREL in PIEs, for which no space is
757         allocated in alpha_dynamic_entries_for_reloc.
758
759 2019-05-28  Alan Modra  <amodra@gmail.com>
760
761         PR 24596
762         * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Don't segfault
763         on NULL output_section.
764         * elflink.c (elf_final_link_free): Don't free -1 symshndxbuf.
765
766 2019-05-28  Alan Modra  <amodra@gmail.com>
767
768         PR 24596
769         * elf32-m68k.c (elf_m68k_get_got_entry): Don't create a new
770         entry when MUST_FIND.  Abort when MUST_FIND not found.
771         (elf_m68k_get_bfd2got_entry): Likewise.
772         (elf_m68k_relocate_section): Remove now useless assert.
773
774 2019-05-28  Alan Modra  <amodra@gmail.com>
775
776         PR 24596
777         * elf64-hppa.c (elf64_hppa_finalize_dynreloc): Get the output bfd
778         from bfd_link_info, not an output section owner.
779         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd): Likewise.
780         (elf_hppa_final_link_relocate): Likewise.
781
782 2019-05-28  Alan Modra  <amodra@gmail.com>
783
784         PR 24596
785         * aout-tic30.c (MY_bfd_final_link): Don't segfault on missing
786         create_object_symbols_section, obj_textsec, obj_datasec or
787         obj_bsssec.  Fix other errors in placement.
788         * config.bfd: Obsolete tic30-aout.
789
790 2019-05-28  Alan Modra  <amodra@gmail.com>
791
792         PR 24596
793         * dwarf2.c (save_section_vma, section_vma_same): Check for NULL
794         end of section list as well as section_count.
795         * xcofflink.c (xcoff_link_add_symbols): Fix temporarily changed
796         section list before returning error.
797
798 2019-05-27  Alan Modra  <amodra@gmail.com>
799
800         * elf.c (bfd_elf_set_group_contents): Exit on zero size section.
801
802 2019-05-27  Alan Modra  <amodra@gmail.com>
803
804         PR 24596
805         * linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP.
806
807 2019-05-24  Szabolcs Nagy  <szabolcs.nagy@arm.com>
808
809         * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): New function.
810         (struct elf_aarch64_link_hash_table): Add variant_pcs member.
811         (elfNN_aarch64_allocate_dynrelocs): Update variant_pcs.
812         (elfNN_aarch64_size_dynamic_sections): Add DT_AARCH64_VARIANT_PCS.
813         (elf_backend_merge_symbol_attribute): Define.
814
815 2019-05-24  Alan Modra  <amodra@gmail.com>
816
817         * po/SRC-POTFILES.in: Regenerate.
818
819 2019-05-24  Alan Modra  <amodra@gmail.com>
820
821         * elf64-ppc.c: Comment on powerxx _notoc stub variants.
822         (LI_R11_0, LIS_R11, ORI_R11_R11_0, SLDI_R11_R11_34): Define.
823         (PADDI_R12_PC, PLD_R12_PC, D34, HA34): Define.
824         (struct ppc_link_hash_table): Add powerxx_stubs.
825         (ppc64_elf_check_relocs): Set powerxx_stubs.
826         (build_powerxx_offset, size_powerxx_offset),
827         (num_relocs_for_powerxx_offset),
828         (emit_relocs_for_powerxx_offset): New functions.
829         (plt_stub_size): Size powerxx stubs.
830         (ppc_build_one_stub): Emit powerxx stubs.
831         (ppc_size_one_stub): Size powerxx stubs.  Omit .eh_frame for
832         powerxx stubs.
833
834 2019-05-24  Alan Modra  <amodra@gmail.com>
835
836         * elf64-ppc.c (ppc64_elf_check_relocs): Set has_gotrel for
837         R_PPC64_GOT_PCREL34.
838         (xlate_pcrel_opt): New function.
839         (ppc64_elf_edit_toc): Handle R_PPC64_GOT_PCREL34.
840         (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
841         for R_PPC64_GOT_PCREL34.  Implement R_PPC64_PCREL_OPT optimisation.
842
843 2019-05-24  Alan Modra  <amodra@gmail.com>
844
845         * reloc.c (BFD_RELOC_PPC64_D34, BFD_RELOC_PPC64_D34_LO),
846         (BFD_RELOC_PPC64_D34_HI30, BFD_RELOC_PPC64_D34_HA30),
847         (BFD_RELOC_PPC64_PCREL34, BFD_RELOC_PPC64_GOT_PCREL34),
848         (BFD_RELOC_PPC64_PLT_PCREL34),
849         (BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34),
850         (BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34),
851         (BFD_RELOC_PPC64_REL16_HIGHER34, BFD_RELOC_PPC64_REL16_HIGHERA34),
852         (BFD_RELOC_PPC64_REL16_HIGHEST34, BFD_RELOC_PPC64_REL16_HIGHESTA34),
853         (BFD_RELOC_PPC64_D28, BFD_RELOC_PPC64_PCREL28): New reloc enums.
854         * elf64-ppc.c (PNOP): Define.
855         (ppc64_elf_howto_raw): Add reloc howtos for new relocations.
856         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc numbers.
857         (ppc64_elf_ha_reloc): Adjust addend for highera34 and highesta34
858         relocs.
859         (ppc64_elf_prefix_reloc): New function.
860         (struct ppc_link_hash_table): Add notoc_plt.
861         (is_branch_reloc): Add R_PPC64_PLTCALL_NOTOC.
862         (is_plt_seq_reloc): Add R_PPC64_PLT_PCREL34,
863         R_PPC64_PLT_PCREL34_NOTOC, and R_PPC64_PLTSEQ_NOTOC.
864         (ppc64_elf_check_relocs): Handle pcrel got and plt relocs.  Set
865         has_pltcall for section on seeing R_PPC64_PLTCALL_NOTOC.  Handle
866         possible need for dynamic relocs on non-pcrel powerxx relocs.
867         (dec_dynrel_count): Handle non-pcrel powerxx relocs.
868         (ppc64_elf_inline_plt): Handle R_PPC64_PLTCALL_NOTOC.
869         (toc_adjusting_stub_needed): Likewise.
870         (ppc64_elf_tls_optimize): Handle R_PPC64_PLTSEQ_NOTOC.
871         (ppc64_elf_relocate_section): Handle new powerxx relocs.
872         * bfd-in2.h: Regenerate.
873         * libbfd.h: Regenerate.
874
875 2019-05-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
876
877         * config.bfd (targ_cpu): Process bpf-*-none only if BFD64.
878         * configure.ac: Set target_size=64 for bpf_elf64_le_vec and
879         bpf_elf64_be_vec.
880         * configure: Regenerate.
881
882 2019-05-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
883
884         * configure: Regenerated.
885         * Makefile.am (ALL_MACHINES): Add cpu-bpf.lo.
886         (ALL_MACHINES_CFILES): Add cpu-bpf.c.
887         (BFD64_BACKENDS): Add elf64-bpf.lo.
888         (BFD64_BACKENDS_CFILES): Add elf64-bpf.c.
889         * Makefile.in (SOURCE_HFILES): Regenerate.
890         * config.bfd (targ_cpu): Handle bpf-*-* targets.
891         * cpu-bpf.c: New file.
892         * elf64-bpf.c: Likewise.
893         * targets.c (_bfd_target_vector): Add bpf_elf64_be_vec and
894         bpf_elf64_le_vec.
895         * archures.c: Define architecture bfd_arch_bpf and machine
896         bfd_arch_bpf.
897         * reloc.c: Define BFD relocations used by the BPF target.
898         * bfd-in2.h: Regenerated.
899         * libbfd.h: Likewise.
900
901 2019-05-22  Alan Modra  <amodra@gmail.com>
902
903         * elf32-arm.c (arm_allocate_glue_section_space): Clear section
904         contents.
905
906 2019-05-22  Alan Modra  <amodra@gmail.com>
907
908         * vms-alpha.c (_bfd_vms_write_etir): Don't attempt further
909         processing on "size error in section".
910
911 2019-05-22  Alan Modra  <amodra@gmail.com>
912
913         * som.c (som_bfd_free_cached_info): Call
914         _bfd_generic_close_and_cleanup.
915
916 2019-05-21  Faraz Shahbazker  <fshahbazker@wavecomp.com>
917
918         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Generate error
919         for TLS_TPREL_HI16(/LO16) relocations in shared library.
920
921 2019-05-21  Faraz Shahbazker  <fshahbazker@wavecomp.com>
922
923         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Add NULL pointer
924         checks.  Search the RELA table for n64 relocations.
925
926 2019-05-21  Matthew Fortune  <matthew.fortune@mips.com>
927             Faraz Shahbazker  <fshahbazker@wavecomp.com>
928
929         * elfxx-mips.c (LA25_BC): New macro.
930         (mips_elf_link_hash_table)<compact_branches>: New field.
931         (STUB_JALRC): New macro.
932         (mipsr6_o32_exec_plt0_entry_compact): New array.
933         (mipsr6_n32_exec_plt0_entry_compact): Likewise.
934         (mipsr6_n64_exec_plt0_entry_compact): Likewise.
935         (mipsr6_exec_plt_entry_compact): Likewise.
936         (mips_elf_create_la25_stub): Use BC instead of J for stubs
937         when compact_branches is true.
938         (_bfd_mips_elf_finish_dynamic_symbol): Choose the compact
939         PLT for MIPSR6 with compact_branches.  Do not reorder the
940         compact branches PLT.  Switch the lazy stub for MIPSR6
941         with compact_branches to use JALRC.
942         (mips_finish_exec_plt): Choose the compact PLT0 for MIPSR6
943         when compact_branches is true.
944         (_bfd_mips_elf_compact_branches): New function.
945         * elfxx-mips.h (_bfd_mips_elf_compact_branches): New prototype.
946
947 2019-05-21  Tamar Christina  <tamar.christina@arm.com>
948
949         PR ld/24373
950         * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub):
951         Fix print formatter.
952
953 2019-05-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>
954
955         PR 24460
956         * elf32-arm.c (get_value_helper): Remove.
957         (elf32_arm_final_link_relocate): Fix branch future relocations.
958
959 2019-05-21  Tamar Christina  <tamar.christina@arm.com>
960
961         PR ld/24373
962         * bfd-in.h (enum erratum_84319_opts): New
963         (bfd_elf64_aarch64_set_options, bfd_elf32_aarch64_set_options): Change
964         int to enum erratum_84319_opts.
965         * bfd-in2.h: Regenerate.
966         * elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Change
967         fix_erratum_843419 to use new enum, remove fix_erratum_843419_adr.
968         (_bfd_aarch64_add_stub_entry_after): Conditionally create erratum stub.
969         (aarch64_size_one_stub): Conditionally size erratum 843419 stubs.
970         (_bfd_aarch64_resize_stubs): Amend comment.
971         (elfNN_aarch64_size_stubs): Don't generate stubs when no workaround
972         requested.
973         (bfd_elfNN_aarch64_set_options): Use new fix_erratum_843419 enum.
974         (_bfd_aarch64_erratum_843419_branch_to_stub): Implement selection of
975         erratum workaround.
976         (clear_erratum_843419_entry): Update erratum conditional.
977
978 2019-05-21  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>
979
980         PR ld/24571
981         * bfd/elf32-avr.c (elf32_avr_relax_section): Adjust range check
982         when computing distance_short_enough.
983
984 2019-05-21  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>
985
986         PR ld/24564
987         * bfd/elf32-avr.c (avr_relative_distance_considering_wrap_around):
988         Wrap around even if distance equals avr_pc_wrap_around.
989
990 2019-05-20  Nick Clifton  <nickc@redhat.com>
991
992         * po/fr.po: Updated French translation.
993
994 2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
995
996         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch.
997
998 2019-05-16  Alan Modra  <amodra@gmail.com>
999
1000         * elf32-arm.c (elf32_arm_write_section): Revert last change.
1001
1002 2019-05-15  Alan Modra  <amodra@gmail.com>
1003
1004         * elf32-arm.c (elf32_arm_write_section): Don't leave
1005         error case of STM32L4XX_ERRATUM_BRANCH_TO_VENEER with
1006         unitialised section contents.
1007
1008 2019-05-14  Jamey Hicks  <jamey.hicks@gmail.com>
1009
1010         PR 19921
1011         * verilog.c: (VerilogDataWidth): New variable.
1012         (verilog_write_record): Emit bytes in VerilogDataWidth bundles.
1013
1014 2019-05-08  Nick Clifton  <nickc@redhat.com>
1015
1016         PR 24523
1017         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE
1018         rather than FALSE if encountering a non-ELF file.
1019
1020 2019-05-06  Alan Modra  <amodra@gmail.com>
1021
1022         * elf32-pj.c (pj_elf_reloc): Don't report undefined weak as an error.
1023
1024 2019-05-06  Alan Modra  <amodra@gmail.com>
1025
1026         * reloc.c (BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA),
1027         (BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA):
1028         Sort before BFD_RELOC_PPC64_DTPREL16_HIGHESTA entry.
1029         * libbfd.h: Regenerate.
1030         * bfd-in2.h: Regenerate.
1031
1032 2019-05-04  Alan Modra  <amodra@gmail.com>
1033
1034         PR 24511
1035         * syms.c (coff_section_type): Only allow '.', '$' and numeric
1036         following the standard section names.
1037         (bfd_decode_symclass): Prioritize section flag tests in
1038         decode_section_type before name tests in coff_section_type.
1039         * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section
1040         and fake_common_section using BFD_FAKE_SECTION.  Use "fake" as
1041         their names and choose standard .text section flags for
1042         fake_section.
1043
1044 2019-05-02  Nick Clifton  <nickc@redhat.com>
1045
1046         PR 24493
1047         * coffcode.h (styp_to_sec_flags): Treat .gnu.debuglink and
1048         .gnu.debugaltlink sections as debugging sections.
1049
1050 2019-04-30  Alan Modra  <amodra@gmail.com>
1051
1052         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_gotrel.
1053         (struct _ppc64_elf_section_data): Likewise.
1054         (ppc64_elf_check_relocs): Set above fields.
1055         (ppc64_elf_edit_toc): Add a pass over GOT relocs.
1056         (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
1057         when possible.
1058
1059 2019-04-26  H.J. Lu  <hongjiu.lu@intel.com>
1060
1061         PR ld/24486
1062         * elflink.c (elf_link_output_extsym): Don't complain undefined
1063         weak dynamic reference.
1064
1065 2019-04-25  Sudakshina Das  <sudi.das@arm.com>
1066
1067         * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): Remove.
1068         (PLT_BTI_TLSDESC_ENTRY_SIZE): Remove.
1069         (PLT_PAC_ENTRY_SIZE, PLT_BTI_PAC_ENTRY_SIZE): Remove.
1070         (PLT_BTI_SMALL_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): Update.
1071         (elfNN_aarch64_small_plt0_pac_entry): Remove.
1072         (elfNN_aarch64_small_plt0_bti_pac_entry): Remove.
1073         (elfNN_aarch64_small_plt0_bti_entry): Update.
1074         (elfNN_aarch64_small_plt_bti_entry): Update.
1075         (elfNN_aarch64_small_plt_pac_entry): Update.
1076         (elfNN_aarch64_tlsdesc_small_plt_bti_entry): Update.
1077         (setup_plt_values): Setup new entries.
1078         (elfNN_aarch64_finish_dynamic_sections): Remove size change.
1079         (elfNN_aarch64_plt_sym_val): Likewise.
1080
1081 2019-04-22  Jim Wilson  <jimw@sifive.com>
1082
1083         * elfnn-riscv.c (PRSTATUS_SIZE) [ARCH_SIZE==32]: Change from 0 to 204.
1084
1085 2019-04-19  Alan Modra  <amodra@gmail.com>
1086
1087         * elf32-s12z.c (elf_backend_can_gc_sections): Don't define
1088
1089 2019-04-17  H.J. Lu  <hongjiu.lu@intel.com>
1090
1091         * elf64-x86-64.c (elf_x86_64_need_pic): Suggest -fPIE when not
1092         building shared object.
1093         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise.
1094
1095 2019-04-17  H.J. Lu  <hongjiu.lu@intel.com>
1096
1097         PR ld/24458
1098         * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): Also check x86
1099         linker_def.
1100
1101 2019-04-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1102
1103         * reloc.c (BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM): New internal
1104         relocation.
1105         * bfd-in2.h: Regenerate.
1106         * libbfd.h: Likewise.
1107
1108 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1109
1110         * reloc.c (BFD_RELOC_ARM_THUMB_LOOP12): New.
1111         * bfd-in2.h: Regenerated.
1112         * libbfd.h: Regenerated.
1113
1114 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1115
1116         * reloc.c (BFD_RELOC_THUMB_PCREL_BFCSEL): New relocation.
1117         * bfd-in2.h: Regenerated.
1118         * libbfd.h: Likewise.
1119
1120 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1121
1122         * reloc.c (BFD_RELOC_ARM_THUMB_BF13): New.
1123         * bfd-in2.h: Regenerated.
1124         * libbfd.h: Regenerated.
1125         * elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF13.
1126         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF13
1127         and R_ARM_THM_BF12 together.
1128         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF13.
1129
1130 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1131
1132         * reloc.c (BFD_RELOC_ARM_THUMB_BF19): New
1133         * libbfd.h: Regenerated.
1134         * bfd-in2.h: Regenerated.
1135         * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF18.
1136         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF19
1137         and R_ARM_THM_BF18 together.
1138         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF19.
1139
1140 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1141
1142         * reloc.c (BFD_RELOC_ARM_THUMB_BF17): New enum.
1143         * bfd-in2.h: Regenerated.
1144         * libbfd.h: Regenerated.
1145         * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF16.
1146         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF17
1147         and R_ARM_THM_BF16 together.
1148         (get_value_helper): New reloc helper.
1149         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF16.
1150
1151 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
1152
1153         * reloc.c (BFD_RELOC_THUMB_PCREL_BRANCH5): New enum.
1154         * bfd-in2.h: Regenerate.
1155         * libbfd.h: Regenerate.
1156
1157 2019-04-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1158
1159         * archures.c (bfd_mach_arm_8_1M_MAIN): Define.
1160         * bfd-in2.h: Regenerate.
1161         * cpu-arm.c (arch_info_struct): Add entry for Armv8.1-M Mainline.
1162         * elf32-arm.c (using_thumb_only): Return true for Armv8.1-M Mainline
1163         and update assert.
1164         (using_thumb2): Likewise.
1165         (using_thumb2_bl): Update assert.
1166         (arch_has_arm_nop): Likewise.
1167         (bfd_arm_get_mach_from_attributes): Add case for Armv8.1-M Mainline.
1168         (tag_cpu_arch_combine): Add logic for Armv8.1-M Mainline merging.
1169
1170 2019-04-11  H.J. Lu  <hongjiu.lu@intel.com>
1171
1172         * elf-linker-x86.h (elf_x86_cet_report): New.
1173         (elf_linker_x86_params): Add cet_report.
1174         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1175         missing IBT and SHSTK properties if needed.
1176
1177 2019-04-11  H.J. Lu  <hongjiu.lu@intel.com>
1178
1179         PR ld/24436
1180         * elf-m10300.c (mn10300_elf_check_relocs): Remove BFD_ASSERT of
1181         "h != NULL".  Don't check "h != NULL" before calling.
1182         bfd_elf_gc_record_vtentry.
1183         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
1184         * elf32-bfin.c (bfin_check_relocs): Likewise.
1185         * elf32-cris.c (cris_elf_check_relocs): Likewise.
1186         * elf32-csky.c (csky_elf_check_relocs): Likewise.
1187         * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
1188         * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
1189         * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
1190         * elf32-frv.c (elf32_frv_check_relocs): Likewise.
1191         * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
1192         * elf32-i386.c (elf_i386_check_relocs): Likewise.
1193         * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
1194         * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
1195         * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
1196         * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
1197         * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
1198         * elf32-metag.c (elf_metag_check_relocs): Likewise.
1199         * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
1200         * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
1201         * elf32-s390.c (elf_s390_check_relocs): Likewise.
1202         * elf32-sh.c (sh_elf_check_relocs): Likewise.
1203         * elf32-v850.c (v850_elf_check_relocs): Likewise.
1204         * elf32-vax.c (elf_vax_check_relocs): Likewise.
1205         * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
1206         * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1207         * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
1208         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
1209         * elf64-s390.c (elf_s390_check_relocs): Likewise.
1210         * elf64-x86-64.c (elf_s390_check_relocs): Likewise.
1211         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1212         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1213         * elflink.c (bfd_elf_gc_record_vtinherit): Check for corrupt
1214         VTENTRY entry.
1215
1216 2019-04-11  Alan Modra  <amodra@gmail.com>
1217
1218         PR 24435
1219         * elflink.c (elf_link_add_object_symbols): Don't read partial
1220         dynamic entries from fuzzed objects.
1221
1222 2019-04-11  Tamar Christina  <tamar.christina@arm.com>
1223
1224         PR ld/24302
1225         * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Don't emit
1226         DT_TLSDESC_GOT and DT_TLSDESC_PLT when DF_BIND_NOW.
1227         (elfNN_aarch64_finish_dynamic_sections): Don't write PLT if DF_BIND_NOW.
1228
1229 2019-04-10  Michael Forney  <mforney@mforney.org>
1230
1231         PR 24427
1232         * doc/chew.c (free_words): Correctly free "push_text" strings.
1233
1234 2019-04-08  H.J. Lu  <hongjiu.lu@intel.com>
1235
1236         * config.bfd: Remove i[3-7]86-*-kaos* and i[3-7]86-*-chaos targets.
1237
1238 2019-04-08  Alan Modra  <amodra@gmail.com>
1239
1240         * configure.ac (elfxx_x86): Define and use.
1241         * configure: Regenerate.
1242
1243 2019-04-06  H.J. Lu  <hongjiu.lu@intel.com>
1244
1245         * elf-linker-x86.h: New file.
1246         * elf32-i386.c (elf_i386_convert_load_reloc): Use htab->params
1247         to get x86-specific linker options.
1248         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
1249         (elf_x86_64_check_relocs): Likewise.
1250         (elf_x86_64_relocate_section): Likewise.
1251         (elf_x86_64_link_setup_gnu_properties): Likewise.
1252         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Likewise.
1253         (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1254         (_bfd_elf_linker_x86_set_options): New function.
1255         * elfxx-x86.h: Include "elf-linker-x86.h".
1256         (elf_x86_link_hash_table): Add params.
1257
1258 2019-04-03  Alan Modra  <amodra@gmail.com>
1259
1260         * coff-i386.c, * coff-x86_64.c, * coffgen.c, * dwarf2.c,
1261         * elf-m10200.c, * elf.c, * elf32-arm.c, * elf32-bfin.c,
1262         * elf32-csky.c, * elf32-m32r.c, * elf32-microblaze.c, * elf32-pru.c,
1263         * elf32-rx.c, * elf32-xgate.c, * elf64-sparc.c, * elfnn-ia64.c,
1264         * elfxx-riscv.c, * elfxx-sparc.c, * linker.c, * mach-o.c,
1265         * pe-x86_64.c, * pei-x86_64.c, * plugin.c: Whitespace fixes.
1266
1267 2019-04-02  Jim Wilson  <jimw@sifive.com>
1268
1269         PR 24389
1270         * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Move read of
1271         ELF header flags to after check for ELF object file.  Loop through
1272         sections looking for code sections, if none, then skip ABI checks.
1273
1274 2019-03-30  Andrew Waterman  <andrew@sifive.com>
1275
1276         * elfnn-riscv.c (_bfd_riscv_relax_call): Only check ARCH_SIZE for
1277         rd == X_RA case.
1278
1279 2019-03-29  Max Filippov  <jcmvbkbc@gmail.com>
1280
1281         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add
1282         info->export_dynamic to the conditional.
1283
1284 2019-03-28  Alan Modra  <amodra@gmail.com>
1285
1286         PR 24392
1287         * configure.ac: Invoke AC_CHECK_SIZEOF(int).
1288         * configure: Regenerate.
1289         * coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic
1290         workaround with SIZEOF_LONG vs. SIZEOF_INT check.
1291         * elf.c (_bfd_elf_get_reloc_upper_bound): Likewise.
1292         * elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise.
1293         * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
1294
1295 2019-03-21  Jim Wilson  <jimw@sifive.com>
1296
1297         PR 24365
1298         * elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check,
1299         verify sym non-NULL before using.  Add identical check using h.
1300
1301 2019-03-21  Sudakshina Das  <sudi.das@arm.com>
1302
1303         * elf-bfd.h (struct elf_backend_data): Add argument to
1304         merge_gnu_properties.
1305         * elf-properties.c (elf_merge_gnu_properties): Add argument to
1306         itself and while calling bed->merge_gnu_properties.
1307         (elf_merge_gnu_property_list): Update the calls for
1308         elf_merge_gnu_properties.
1309         * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling
1310         of --force-bti warning and add argument.
1311         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add
1312         warning.
1313         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument.
1314         * elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in
1315         declaration.
1316
1317 2019-03-20  Sudakshina Das  <sudi.das@arm.com>
1318
1319         * elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
1320         * elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
1321         (elf_backend_fixup_gnu_properties): Define for AArch64.
1322
1323 2019-03-18  Alan Modra  <amodra@gmail.com>
1324
1325         PR 24355
1326         * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub
1327         for local iplt syms with ent->plt.offset == -1.  Remove ineffective
1328         attempt at writing glink stubs only once.
1329
1330 2019-03-16  Alan Modra  <amodra@gmail.com>
1331
1332         PR 24337
1333         * elf.c (_bfd_elf_rela_local_sym): Revert last change.
1334         (_bfd_elf_rel_local_sym): Likewise.
1335         * elflink.c (elf_link_input_bfd): Use bfd_und_section for
1336         section of symbols with unrecognized shndx.
1337
1338 2019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1339
1340         PR ld/24267
1341         * coffgen.c (_bfd_coff_section_already_linked): Skip discarded
1342         section.
1343         * cofflink.c (coff_link_add_symbols): Check for symbols defined
1344         in discarded section.
1345
1346 2019-03-15  Alan Modra  <amodra@gmail.com>
1347
1348         PR 24339
1349         * elflink.c (elf_link_add_object_symbols): Bail out on a local
1350         symbol after globals if elf_bad_symtab is not set.
1351
1352 2019-03-15  Alan Modra  <amodra@gmail.com>
1353
1354         PR 24337
1355         * elf.c (_bfd_elf_rela_local_sym): Don't segfault on NULL sec.
1356         (_bfd_elf_rel_local_sym): Likewise.
1357
1358 2019-03-15  Alan Modra  <amodra@gmail.com>
1359
1360         PR 24336
1361         * elflink.c (elf_link_read_relocs_from_section): Handle fuzzed
1362         object files with sh_size not a multiple of sh_entsize.
1363
1364 2019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1365
1366         PR ld/24338
1367         * elf64-x86-64.c (elf_x86_64_relocate_section): Check for corrupt
1368         input with bad relocation.
1369
1370 22019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
1371
1372         * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1373
1374 2019-03-14  Nick Clifton  <nickc@redhat.com>
1375
1376         PR 24334
1377         * dwarf2.c (struct dwarf2_debug): Add sec_vma_count field.
1378         (save_section_vma): Initialise field to the number of entries in
1379         the sec_vma table.
1380         (section_vma_same): Check that the number of entries in the
1381         sec_vma table matches the number of sections in the bfd.
1382
1383 2019-03-14  Nick Clifton  <nickc@redhat.com>
1384
1385         PR 24333
1386         * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL
1387         section owner pointer when adding the default symbol.
1388
1389 2019-03-14  Nick Clifton  <nickc@redhat.com>
1390
1391         PR 24332
1392         * elflink.c (elf_link_add_object_symbols): Add new local variable
1393         extversym_end.  Initialise it to point to the end of the version
1394         symbol table, if present.  Check it when initialising and updating
1395         the ever pointer.
1396
1397 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
1398
1399         * elfnn-aarch64.c (PLT_PAC_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): New.
1400         (PLT_BTI_PAC_ENTRY_SIZE, PLT_BTI_PAC_SMALL_ENTRY_SIZE): New.
1401         (setup_plt_values): Account for PAC or PAC and BTI enabled PLTs.
1402         (elfNN_aarch64_size_dynamic_sections): Add checks for PLT_BTI_PAC
1403         and PLT_PAC_PLT.
1404         (elfNN_aarch64_finish_dynamic_sections): Account for PLT_BTI_PAC.
1405         (get_plt_type): Add case for DT_AARCH64_PAC_PLT.
1406         (elfNN_aarch64_plt_sym_val): Add cases for PLT_BTI_PAC and PLT_PAC.
1407
1408 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
1409             Szabolcs Nagy  <szabolcs.nagy@arm.com>
1410
1411         * bfd-in.h (aarch64_plt_type, aarch64_enable_bti_type): New.
1412         (aarch64_bti_pac_info): New.
1413         (bfd_elf64_aarch64_set_options): Add aarch64_bti_pac_info argument.
1414         (bfd_elf32_aarch64_set_options): Likewise.
1415         * bfd-in2.h: Regenerate
1416         * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): New.
1417         (PLT_BTI_SMALL_ENTRY_SIZE, PLT_BTI_TLSDESC_ENTRY_SIZE): New.
1418         (elfNN_aarch64_small_plt0_bti_entry): New.
1419         (elfNN_aarch64_small_plt_bti_entry): New.
1420         (elfNN_aarch64_tlsdesc_small_plt_bti_entry): New.
1421         (elf_aarch64_obj_tdata): Add no_bti_warn and plt_type fields.
1422         (elf_aarch64_link_hash_table): Add plt0_entry, plt_entry and
1423         tlsdesc_plt_entry_size fields.
1424         (elfNN_aarch64_link_hash_table_create): Initialise the new fields.
1425         (setup_plt_values): New helper function.
1426         (bfd_elfNN_aarch64_set_options): Use new bp_info to set plt sizes and
1427         bti enable type.
1428         (elfNN_aarch64_allocate_dynrelocs): Use new size members instead of
1429         fixed macros.
1430         (elfNN_aarch64_size_dynamic_sections): Likewise and add checks.
1431         (elfNN_aarch64_create_small_pltn_entry): Use new generic pointers
1432         to plt stubs instead of fixed ones and update filling them according
1433         to the need for bti.
1434         (elfNN_aarch64_init_small_plt0_entry): Likewise.
1435         (elfNN_aarch64_finish_dynamic_sections): Likewise.
1436         (get_plt_type, elfNN_aarch64_get_synthetic_symtab): New.
1437         (elfNN_aarch64_plt_sym_val): Update size accordingly.
1438         (elfNN_aarch64_link_setup_gnu_properties): Set up plts if BTI GNU NOTE
1439         is set.
1440         (bfd_elfNN_get_synthetic_symtab): Define.
1441         (elfNN_aarch64_merge_gnu_properties): Give out warning with --force-bti
1442         and mising BTI NOTE SECTION.
1443
1444
1445 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
1446
1447         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Exclude
1448         linker created inputs from merge.
1449         * elfnn-aarch64.c (struct elf_aarch64_obj_tdata): Add field for
1450         GNU_PROPERTY_AARCH64_FEATURE_1_AND properties.
1451         (elfNN_aarch64_link_setup_gnu_properties): New.
1452         (elfNN_aarch64_merge_gnu_properties): New.
1453         (elf_backend_setup_gnu_properties): Define for AArch64.
1454         (elf_backend_merge_gnu_properties): Likewise.
1455         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Define.
1456         (_bfd_aarch64_elf_parse_gnu_properties): Define.
1457         (_bfd_aarch64_elf_merge_gnu_properties): Define.
1458         * elfxx-aarch64.h (_bfd_aarch64_elf_link_setup_gnu_properties): Declare.
1459         (_bfd_aarch64_elf_parse_gnu_properties): Declare.
1460         (_bfd_aarch64_elf_merge_gnu_properties): Declare.
1461         (elf_backend_parse_gnu_properties): Define for AArch64.
1462
1463 2019-03-13  H.J. Lu  <hongjiu.lu@intel.com>
1464
1465         PR ld/24322
1466         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Properly
1467         merge GNU_PROPERTY_X86_FEATURE_1_[IBT|SHSTK].
1468
1469 2019-03-12  Alan Modra  <amodra@gmail.com>
1470
1471         * coffcode.h (buy_and_read): Delete unnecessary forward decl.  Add
1472         nmemb parameter.  Use bfd_alloc2.
1473         (coff_slurp_line_table): Use bfd_alloc2.  Update buy_and_read calls.
1474         Delete assertion.
1475         (coff_slurp_symbol_table): Use bfd_alloc2 and bfd_zalloc2.
1476         (coff_slurp_reloc_table): Use bfd_alloc2.  Update buy_and_read calls.
1477         * coffgen.c (coff_get_reloc_upper_bound): Ensure size calculation
1478         doesn't overflow.
1479         * elf.c (bfd_section_from_shdr): Use bfd_zalloc2.  Style fix.
1480         (assign_section_numbers): Style fix.
1481         (swap_out_syms): Use bfd_malloc2.
1482         (_bfd_elf_get_reloc_upper_bound): Ensure size calculation doesn't
1483         overflow.
1484         (_bfd_elf_make_empty_symbol): Style fix.
1485         (elfobj_grok_stapsdt_note_1): Formatting.
1486         * elfcode.h (elf_object_p): Use bfd_alloc2.
1487         (elf_write_relocs, elf_write_shdrs_and_ehdr): Likewise.
1488         (elf_slurp_symbol_table): Use bfd_zalloc2.
1489         (elf_slurp_reloc_table): Use bfd_alloc2.
1490         (_bfd_elf_bfd_from_remote_memory): Use bfd_malloc2.
1491         * elf64-sparc (elf64_sparc_get_reloc_upper_bound): Ensure
1492         size calculation doesn't overflow.
1493         (elf64_sparc_get_dynamic_reloc_upper_bound): Likewise.
1494         * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
1495         * pdp11.c (get_reloc_upper_bound): Copy aoutx.h version.
1496
1497 2019-03-08  Alan Modra  <amodra@gmail.com>
1498
1499         PR 24311
1500         * merge.c (merge_strings): Return secinfo.  Don't pad section
1501         to alignment here.
1502         (_bfd_merge_sections): Pad section to alignment here, if input
1503         sections contributing to merged output all pad to alignment.
1504         Formatting.
1505
1506 2019-03-06  Nick Clifton  <nickc@redhat.com>
1507
1508         * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Check for a NULL symbol
1509         table pointer.
1510         * coffgen.c (coff_find_nearest_line_with_names): Do not call
1511         _bfd_dwarf2_find_symbol_bias if there is no symbol table available.
1512
1513 2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>
1514
1515         This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335.
1516         2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
1517
1518         PR 20113
1519         * elf32-s390.c (allocate_dynrelocs): Update comment.
1520
1521 2019-02-28  Tamar Christina  <tamar.christina@arm.com>
1522
1523         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.
1524
1525 2019-02-28  Nick Clifton  <nickc@redhat.com>
1526
1527         PR 24273
1528         * elf.c (bfd_elf_string_from_elf_section): Check for a string
1529         section that is not NUL terminated.
1530
1531 2019-02-27  H.J. Lu  <hongjiu.lu@intel.com>
1532
1533         PR ld/24276
1534         * elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
1535         by linker when checking copy reloc on protected symbol.
1536
1537 2019-02-24  Alan Modra  <amodra@gmail.com>
1538
1539         PR 24144
1540         * pdp11.c (set_section_contents): Revert 2015-02-24 change.
1541
1542 2019-02-20  Eric Tsai  <erictsai@cadence.com>
1543
1544         * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output
1545         sections between the call site and call destination and adjust
1546         call distance by the largest alignment.
1547
1548 2019-02-20  Alan Hayward  <alan.hayward@arm.com>
1549
1550         * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration.
1551         * elf.c (elfcore_grok_aarch_pauth): New function.
1552         (elfcore_grok_note): Check for NT_ARM_PAC_MASK.
1553         (elfcore_write_aarch_pauth): New function.
1554         (elfcore_write_register_note): Check for AArch64 pauth section.
1555
1556 2019-02-20  Alan Modra  <amodra@gmail.com>
1557
1558         PR 24225
1559         * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf
1560         return value.
1561
1562 2019-02-20  Michael Roitzsch  <reactorcontrol@icloud.com>
1563
1564         * configure.ac (SHARED_LIBADD): Add -liberty -lintl for all
1565         Darwin hosts, not just or1k.
1566         * configure: Regenerate.
1567
1568 2019-02-20  Alan Modra  <amodra@gmail.com>
1569
1570         PR 24236
1571         * archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding
1572         sentinel NUL to string buffer nearer to loop where it is used.
1573         Don't go past sentinel when scanning strings, and don't write
1574         NUL again.
1575         * archive.c (do_slurp_coff_armap): Simplify string handling to
1576         archive64.c style.
1577
1578 2019-02-19  Alan Modra  <amodra@gmail.com>
1579
1580         PR 24235
1581         * pei-x86_64.c (pex64_bfd_print_pdata_section): Correct checks
1582         attempting to prevent read past end of section.
1583
1584 2019-02-18  Alan Modra  <amodra@gmail.com>
1585
1586         PR 24225
1587         * elf32-nios2.c (nios2_elf32_relocate_section): Use asprintf and
1588         PRIx64 to generate warning messages.  Print local sym names too.
1589
1590 2019-02-09  Vineet Gupta  <vgupta@synopsys.com>
1591
1592         * elf32-arc (INIT_SYM_STRING): Delete.
1593         (FINI_SYM_STRING): Likewise.
1594         (init_str): Likewise.
1595         (fini_str): Likewise.
1596
1597 2019-02-08  Alan Modra  <amodra@gmail.com>
1598
1599         * elf32-ppc.c (ppc_elf_relocate_section): Add %X to "unsupported
1600         for bss-plt" warning to make it an error.
1601
1602 2019-02-07  Eric Botcazou  <ebotcazou@adacore.com>
1603
1604         PR ld/18841
1605         * elf32-sparc.c (elf32_sparc_reloc_type_class): Return
1606         reloc_class_ifunc for ifunc symbols.
1607         * elf64-sparc.c (elf64_sparc_reloc_type_class): Likewise.
1608
1609 2019-02-07  Eric Botcazou  <ebotcazou@adacore.com>
1610
1611         * elf32-visium.c (visium_elf_howto_parity_reloc): Minor tweak.
1612         <R_VISIUM_PC16>: Use explicit range test to detect an overflow.
1613
1614 2019-02-07  Nick Clifton  <nickc@redhat.com>
1615
1616         * config.bfd: Move the powerpc-lynxos and powerpc-windiss targets
1617         into the definitely obsolete list.
1618
1619 2019-02-05  H.J. Lu  <hongjiu.lu@intel.com>
1620
1621         PR ld/24151
1622         * elf64-x86-64.c (elf_x86_64_need_pic): Check
1623         SYMBOL_DEFINED_NON_SHARED_P instead of def_regular.
1624         (elf_x86_64_relocate_section): Move PIC check for PC-relative
1625         relocations to ...
1626         (elf_x86_64_check_relocs): Here.
1627         (elf_x86_64_finish_dynamic_symbol): Use SYMBOL_DEFINED_NON_SHARED_P
1628         to check if a symbol is defined in a non-shared object.
1629         * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): New.
1630
1631 2019-01-21  Sergio Durigan Junior  <sergiodj@redhat.com>
1632
1633         * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead
1634         of 'labs' (and fix GCC warning).
1635
1636 2019-01-25  Nick Clifton  <nickc@redhat.com>
1637
1638         * po/ru.po: Updated Russian translation.
1639
1640 2019-01-23  Nick Clifton  <nickc@redhat.com>
1641
1642         * po/fr.po: Updated French translation.
1643
1644 2019-01-21  Nick Clifton  <nickc@redhat.com>
1645
1646         * po/pt.po: Updated Portuguese translation.
1647         * po/uk.po: Updated Ukranian translation.
1648
1649 2019-01-21  Yuri Chornoivan  <yurchor@ukr.net>
1650
1651         PR 24108
1652         * elf32-nds32.c (nds32_relocate_section): Add space between words
1653         in error message.
1654         * elfnn-riscv.c (riscv_version_mismatch): Fix spelling mistake in
1655         error message.
1656         (riscv_i_or_e_p): Likewise.
1657         (riscv_merge_arch_attr_info): Likewise.
1658
1659 2019-01-19  Nick Clifton  <nickc@redhat.com>
1660
1661         * version.m4: Reset to 2.32.51
1662         * configure: Regenerate.
1663         * po/bfd.pot: Regenerate.
1664
1665 2018-06-24  Nick Clifton  <nickc@redhat.com>
1666
1667         2.32 branch created.
1668
1669 2019-01-16  Kito Cheng  <kito@andestech.com>
1670
1671         * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
1672         for OBJ_ATTR_PROC.
1673
1674 2019-01-16  Kito Cheng  <kito@andestech.com>
1675             Nelson Chu  <nelson@andestech.com>
1676
1677         * elfnn-riscv.c (in_subsets): New.
1678         (out_subsets): Likewise.
1679         (merged_subsets): Likewise.
1680         (riscv_std_ext_p): Likewise.
1681         (riscv_non_std_ext_p): Likewise.
1682         (riscv_std_sv_ext_p): Likewise.
1683         (riscv_non_std_sv_ext_p): Likewise.
1684         (riscv_version_mismatch): Likewise.
1685         (riscv_i_or_e_p): Likewise.
1686         (riscv_merge_std_ext): Likewise.
1687         (riscv_merge_non_std_and_sv_ext): Likewise.
1688         (riscv_merge_arch_attr_info): Likewise.
1689         (riscv_merge_attributes): Likewise.
1690         (_bfd_riscv_elf_merge_private_bfd_data): Merge attribute.
1691
1692         * elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New.
1693         (elf_backend_obj_attrs_vendor): Define.
1694         (elf_backend_obj_attrs_section_type): Likewise.
1695         (elf_backend_obj_attrs_section): Likewise.
1696         (elf_backend_obj_attrs_arg_type): Define as
1697         riscv_elf_obj_attrs_arg_type.
1698         * elfxx-riscv.c (riscv_estimate_digit): New.
1699         (riscv_estimate_arch_strlen1): Likewise.
1700         (riscv_estimate_arch_strlen): Likewise.
1701         (riscv_arch_str1): Likewise.
1702         (riscv_arch_str): Likewise.
1703         * elfxx-riscv.h (riscv_arch_str): Declare.
1704
1705 2019-01-14  John Darrington <john@darrington.wattle.id.au>
1706
1707         * bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc.
1708         * libbfd.h: regen.
1709         * elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero
1710         source field.  (md_apply_fix): Apply final fix
1711         to BFD_RELOC_S12Z_OPR.
1712         * reloc.c[BFD_RELOC_S12Z_OPR]: New reloc.
1713
1714 2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
1715
1716         PR 20113
1717         * elf32-s390.c (allocate_dynrelocs): Update comment.
1718
1719 2019-01-09  Andrew Paprocki  <andrew@ishiboo.com>
1720
1721         * warning.m4: Adjust egrep pattern for non-GNU compilers.
1722         * configure: Regenerate.
1723
1724 2019-01-08  Alan Modra  <amodra@gmail.com>
1725
1726         PR 23699
1727         PR 24065
1728         * ihex.c (ihex_write_object_contents): Properly check 32-bit
1729         address range.
1730
1731 2019-01-05  Yoshinori Sato <ysato@users.sourceforge.jp>
1732
1733         * bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3.
1734         * bfd/bfd-in2.h: Regenerate.
1735         * bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry.
1736         * bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support.
1737
1738 2019-01-04  Lifang Xia  <lifang_xia@c-sky.com>
1739
1740         * config.bfd (csky-*-elf* | csky-*-linux*): Modify the csky
1741         default target, little endian target is more suitable.
1742
1743 2019-01-04  Alan Modra  <amodra@gmail.com>
1744
1745         PR 24061
1746         PR 21786
1747         * coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and
1748         adjust all callers.
1749         (EQ_VALUE_IN_FIELD): Likewise.
1750         * coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise.
1751
1752 2019-01-01  Alan Modra  <amodra@gmail.com>
1753
1754         Update year range in copyright notice of all files.
1755
1756 For older changes see ChangeLog-2018
1757 \f
1758 Copyright (C) 2019 Free Software Foundation, Inc.
1759
1760 Copying and distribution of this file, with or without modification,
1761 are permitted in any medium without royalty provided the copyright
1762 notice and this notice are preserved.
1763
1764 Local Variables:
1765 mode: change-log
1766 left-margin: 8
1767 fill-column: 74
1768 version-control: never
1769 End: