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