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