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