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