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