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