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