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