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