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