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