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