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