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