SHF_GNU_MBIND requires ELFOSABI_GNU
[external/binutils.git] / bfd / ChangeLog
1 2019-07-23  Alan Modra  <amodra@gmail.com>
2
3         * elf-bfd.h (enum elf_gnu_osabi): Add elf_gnu_osabi_mbind.
4         * elf.c (_bfd_elf_make_section_from_shdr): Set elf_gnu_osabi_mbind.
5         (get_program_header_size): Formatting.  Only test SH_GNU_MBIND
6         when elf_gnu_osabi_mbind is set.
7         (_bfd_elf_map_sections_to_segments): Likewise.
8         (_bfd_elf_init_private_section_data): Likewise.
9         (_bfd_elf_final_write_processing): Update comment.
10         * elf64-hppa.c (elf64_hppa_special_sections): Move .tbss entry.
11         (elf_backend_special_sections): Define without .tbss for linux.
12
13 2019-07-23  Alan Modra  <amodra@gmail.com>
14
15         * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols.
16         Remove none, any, all enums.
17         (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi.
18         (_bfd_elf_final_write_processing): Declare.
19         * elf.c (_bfd_elf_write_object_contents): Unconditionally call
20         elf_backend_final_write_processing.
21         (_bfd_elf_post_process_headers): Move body of function to..
22         (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte
23         only when not already set.  Adjust for rename.
24         * elfxx-target.h (elf_backend_final_write_processing): Default to
25         _bfd_elf_final_write_processing.
26         * elf-hppa.h (elf_hppa_final_write_processing): Call
27         _bfd_elf_final_write_processing.
28         * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
29         * elf-nacl.c (nacl_final_write_processing): Likewise.
30         * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
31         * elf32-arc.c (arc_elf_final_write_processing): Likewise.
32         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
33         * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
34         * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
35         * elf32-cris.c (cris_elf_final_write_processing): Likewise.
36         * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
37         * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
38         * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
39         * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
40         * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
41         * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
42         * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
43         * elf32-pj.c (pj_elf_final_write_processing): Likewise.
44         * elf32-v850.c (v850_elf_final_write_processing): Likewise.
45         * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
46         * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
47         * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
48         * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
49         * elf32-arm.c (arm_final_write_processing): Split out from..
50         (elf32_arm_final_write_processing): ..here.  Call
51         _bfd_elf_final_write_processing.
52         (elf32_arm_nacl_final_write_processing): Adjust.
53         * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from..
54         (_bfd_mips_elf_final_write_processing): ..here.  Call
55         _bfd_elf_final_write_processing.
56         * elfxx-mips.h (_bfd_mips_final_write_processing): Declare.
57         * elf32-mips.c (mips_vxworks_final_write_processing): Adjust.
58         * elf32-ppc.c (ppc_final_write_processing): Split out from..
59         (ppc_elf_final_write_processing): ..here.  Call
60         _bfd_elf_final_write_processing.
61         (ppc_elf_vxworks_final_write_processing): Adjust.
62         * elf32-sparc.c (sparc_final_write_processing): Split out from..
63         (elf32_sparc_final_write_processing): ..here.  Call
64         _bfd_elf_final_write_processing.
65         (elf32_sparc_vxworks_final_write_processing): Adjust.
66         * elf32-d10v.c (elf_backend_final_write_processing): Don't define.
67         * elf32-d30v.c (elf_backend_final_write_processing): Don't define.
68         * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define.
69         * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define.
70         * elf32-s12z.c (elf_backend_final_write_processing): Don't define.
71         * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols.
72         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
73         * elflink.c (elf_link_add_object_symbols): Likewise.
74         (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here
75         instead.
76
77 2019-07-23  Omar Majid  <omajid@redhat.com>
78
79         * coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC,
80         I386_FREEBSD_MAGIC, I386_LINUX_MAGIC, I386_NETBSD_MAGIC,
81         AMD64_APPLE_MAGIC, AMD64_FREEBSD_MAGIC, AMD64_LINUX_MAGIC,
82         AMD64_NETBSD_MAGIC.
83         * peXXigen.c: Add comment about source of .NET magic numbers.
84
85 2019-07-19  Alan Modra  <amodra@gmail.com>
86
87         * reloc.c (BFD_RELOC_PPC64_TPREL34, BFD_RELOC_PPC64_DTPREL34),
88         (BFD_RELOC_PPC64_GOT_TLSGD34, BFD_RELOC_PPC64_GOT_TLSLD34),
89         (BFD_RELOC_PPC64_GOT_TPREL34, BFD_RELOC_PPC64_GOT_DTPREL34),
90         (BFD_RELOC_PPC64_TLS_PCREL): New pcrel tls relocs.
91         * elf64-ppc.c (ppc64_elf_howto_raw): Add howtos for pcrel tls relocs.
92         (ppc64_elf_reloc_type_lookup): Translate pcrel tls relocs.
93         (must_be_dyn_reloc, dec_dynrel_count): Add R_PPC64_TPREL64.
94         (ppc64_elf_check_relocs): Support pcrel tls relocs.
95         (ppc64_elf_tls_optimize, ppc64_elf_relocate_section): Likewise.
96         * bfd-in2.h: Regenerate.
97         * libbfd.h: Regenerate.
98
99 2019-07-18  Alan Modra  <amodra@gmail.com>
100
101         * elf64-ppc.c (ppc64_elf_relocate_section): Don't bother selecting
102         a TLS section symbol for edited relocs.  Tighten TLS symbol/reloc
103         match test.
104
105 2019-07-18  Alan Modra  <amodra@gmail.com>
106
107         * elf64-ppc.c (TLS_EXPLICIT): Define as 256.
108         (ppc64_elf_check_relocs): Don't store TLS_EXPLICIT even if char
109         is more than 8 bits.
110         (ppc64_elf_tls_optimize): Likewise.  Make tls_set, tls_clear, and
111         tls_type vars unsigned int.
112         (ppc64_elf_relocate_section): Use r_type rather than TLS_EXPLICIT
113         to select r_type edit.
114
115 2019-07-18  Alan Modra  <amodra@gmail.com>
116
117         * elf32-ppc.c (TLS_GDIE): Rename from TLS_TPRELGD throughout file.
118         Correct comment.
119         * elf64-ppc.c (TLS_GDIE): Likewise.
120
121 2019-07-18  Alan Modra  <amodra@gmail.com>
122
123         * elf64-ppc.c (ppc64_elf_tls_optimize): Correct test for allowed
124         range of tp-relative offsets.
125
126 2019-07-15  Alan Modra  <amodra@gmail.com>
127
128         * elflink.c (_bfd_elf_fix_symbol_flags): If the def for an
129         alias is no longer bfd_link_hash_defined, clear the alias.
130
131 2019-07-13  Alan Modra  <amodra@gmail.com>
132
133         * elflink.c (_bfd_elf_omit_section_dynsym_default): Don't keep
134         tls_sec.
135         (_bfd_elf_init_1_index_section): Prefer not using TLS sections.
136         (_bfd_elf_init_2_index_sections): Likewise.
137         * elf64-ppc.c (ppc64_elf_relocate_section): When emitting dynamic
138         relocations for local TLS symbols, use STN_UNDEF as the relocation
139         symbol.
140         * elf32-ppc.c (ppc_elf_relocate_section): Likewise, and don't
141         leave TLS symbol value in the addend.
142
143 2019-07-08  Alan Modra  <amodra@gmail.com>
144
145         PR 24785
146         * elf32-ppc.c (_bfd_elf_ppc_set_arch): Sanity check .PPC.EMB.apuinfo
147         size before reading first word.
148
149 2019-07-02  Nick Clifton  <nickc@redhat.com>
150
151         PR 24717
152         * elf.c (is_debuginfo_file): New function.
153         (assign_file_positions_for_non_load_sections): Do not warn about
154         allocated sections outside of loadable segments if they are found
155         in a debuginfo file.
156         * elf-bfd.h (is_debuginfo_file): Prototype.
157
158 2019-07-02  Nick Clifton  <nickc@redhat.com>
159
160         PR 24753
161         * compress.c (bfd_get_full_section_contents): Do not complain
162         about linker created sections that are larger than the file size.
163
164 2019-07-02  Christophe Lyon  <christophe.lyon@linaro.org>
165
166         * bfd/elf32-arm.c (CMSE_STUB_NAME): New define.
167         (elf32_arm_get_stub_entry): Do not try to emit long-branch stubs
168         for CMSE stubs.
169         (arm_dedicated_stub_output_section_name): Use CMSE_STUB_NAME.
170
171 2019-07-02  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
172
173         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark debug
174         sections when .text section contain secure entry functions
175         is marked.
176
177 2019-07-01  Nick Clifton  <nickc@redhat.com>
178
179         PR 23839
180         * elf32-arm.c (elf32_arm_update_relocs): Do not include the
181         section VMA in the offset used to update exidx relocs.
182
183 2019-06-28  Nick Clifton  <nickc@redhat.com>
184
185         PR 24708
186         * elf.c (_bfd_elf_slurp_version_tables): Check for an excessively
187         large version reference section.
188         * compress.c (bfd_get_full_section_contents): Check for an
189         uncompressed section whose size is larger than the file size.
190
191 2019-06-28  Alan Modra  <amodra@gmail.com>
192
193         * format.c (bfd_check_format_matches): Don't match plugin target
194         if another target matches.  Expand comment.
195         * targets.c (_bfd_target_vector): Move plugin_vec after all other
196         non-corefile targets, outside !SELECT_VECS.
197         * config.bfd: Don't handle targ=plugin here.
198         * configure.ac: Don't add plugin to enable_targets or handle in
199         target loop setting selvecs and other target vars.
200         * configure: Regenerate.
201
202 2019-06-26  Nick Clifton  <nickc@redhat.com>
203
204         PR 24703
205         * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add error
206         messages for failures.
207         * mach-o.c (bfd_mach_o_canonicalize_relocs): Set an bfd error code
208         if returning an error value.
209
210 2019-06-25  Jan Beulich  <jbeulich@suse.com>
211
212         * elf-properties.c (elf_find_and_remove_property): Rename last
213         parameter. Mention it in comment.
214
215 2019-06-24  Ilia Diachkov  <ilia.diachkov@optimitech.com>
216
217         * elfnn-riscv.c (_bfd_riscv_relax_lui): Delete early exit when
218         SEC_MERGE or SEC_CODE flags are set.
219         (_bfd_riscv_relax_section): New local symtype.  Set sym_sec and
220         symtype consistently.  Don't include sec_addr (sym_sec) in symval.
221         Add check for SEC_INFO_TYPE_MERGE and call _bfd_merged_section_offset.
222         Add sec_addr (sym_sec) after handling merge sections.
223
224 2019-06-24  H.J. Lu  <hongjiu.lu@intel.com>
225
226         PR ld/24721
227         * elf-properties.c (elf_merge_gnu_property_list): Remove the
228         property after reporting property removal.
229
230 2019-06-23  Alan Modra  <amodra@gmail.com>
231
232         PR 24704
233         * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel.
234         (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries.
235         Reduce range of offsets allowed for other GOT relocs.
236
237 2019-06-23  Alan Modra  <amodra@gmail.com>
238
239         PR 24689
240         * elfcode.h (elf_object_p): Warning fix.
241
242 2019-06-21  Alan Modra  <amodra@gmail.com>
243
244         PR 24689
245         * elfcode.h (elf_object_p): Check type of e_shstrndx section.
246
247 2019-06-19  Alan Modra  <amodra@gmail.com>
248
249         PR 24697
250         * elf32-ppc.c (ppc_elf_relocate_section): Don't read insn for
251         R_PPC_EMB_RELSDA.  Mask low bit of R_PPC_EMB_SDA21 r_offset.
252
253 2019-06-19  Alan Modra  <amodra@gmail.com>
254
255         * elf64-ppc.c (ppc64_elf_inline_plt): Correct st_other test for
256         functions that require r2 valid to use local entry.
257         (ppc64_elf_size_stubs, ppc64_elf_relocate_section): Likewise.
258
259 2019-06-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>
260
261         * elfnn-aarch64.c (elfNN_aarch64_allocate_local_dynrelocs): Remove.
262         (elfNN_aarch64_size_dynamic_sections): Remove loc_hash_table traversal
263         with elfNN_aarch64_allocate_local_dynrelocs.
264
265 2019-06-14  Szabolcs Nagy  <szabolcs.nagy@arm.com>
266
267         * elfnn-aarch64.c: Enable MOVW_PREL relocs for ELF32.
268
269 2019-06-14  Alan Modra  <amodra@gmail.com>
270
271         * Makefile.in: Regenerate.
272         * configure: Regenerate.
273
274 2019-06-14  Alan Modra  <amodra@gmail.com>
275
276         * elf64-ppc.c: Fix comments involving paddi.
277
278 2019-06-12  Adam Lackorzymski  <adam@os.inf.tu-dresden.de>
279
280         PR 24643
281         * elf32-arm.c (arm_elf_find_function): Fail if the symol table is
282         absent, or the bfd is not in the ELF formart.
283         * elfnn-aarch64.c (aarch64_elf_find_function): Likewise.
284
285 2019-06-10  Christos Zoulas  <christos@zoulas.com>
286
287         PR 24650
288         * elf.c (elfcore_make_auxv_note_section): New function.
289         (elfcore_grok_note): Use it.
290         (elfcore_grok_freebsd_note): Likewise.
291         (elfcore_grok_openbsd_note): Likewise.
292         (elfcore_grok_netbsd_note): Likewise.  Plus add support for
293         NT_NETBSDCORE_AUXV notes.
294
295 2019-06-06  Sudakshina Das  <sudi.das@arm.com>
296
297         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Set
298         alignment of the new gnu property section.
299
300 2019-06-06  Sudakshina Das  <sudi.das@arm.com>
301
302         * bfd-in.h: Change comment.
303         * bfd-in2.h: Regenerate.
304         * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning.
305         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties):
306         Likwise.
307
308 2019-05-28  Faraz Shahbazker  <fshahbazker@wavecomp.com>
309
310         * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>:
311         Remove overflow check.
312
313 2019-05-28  Alan Modra  <amodra@gmail.com>
314
315         PR 24596
316         * cofflink.c (coff_link_check_archive_element): Don't assume
317         element is a coff object file after calling add_archive_element.
318
319 2019-05-28  Alan Modra  <amodra@gmail.com>
320
321         PR 24596
322         * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Don't
323         attempt to set sh_entsize for excluded PLT section.
324
325 2019-05-28  Alan Modra  <amodra@gmail.com>
326
327         PR 24596
328         * elf64-alpha.c (elf64_alpha_relocate_section): Don't attempt
329         to emit R_ALPHA_GOTTPREL in PIEs, for which no space is
330         allocated in alpha_dynamic_entries_for_reloc.
331
332 2019-05-28  Alan Modra  <amodra@gmail.com>
333
334         PR 24596
335         * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Don't segfault
336         on NULL output_section.
337         * elflink.c (elf_final_link_free): Don't free -1 symshndxbuf.
338
339 2019-05-28  Alan Modra  <amodra@gmail.com>
340
341         PR 24596
342         * elf32-m68k.c (elf_m68k_get_got_entry): Don't create a new
343         entry when MUST_FIND.  Abort when MUST_FIND not found.
344         (elf_m68k_get_bfd2got_entry): Likewise.
345         (elf_m68k_relocate_section): Remove now useless assert.
346
347 2019-05-28  Alan Modra  <amodra@gmail.com>
348
349         PR 24596
350         * elf64-hppa.c (elf64_hppa_finalize_dynreloc): Get the output bfd
351         from bfd_link_info, not an output section owner.
352         (elf64_hppa_finish_dynamic_symbol, elf64_hppa_finalize_opd): Likewise.
353         (elf_hppa_final_link_relocate): Likewise.
354
355 2019-05-28  Alan Modra  <amodra@gmail.com>
356
357         PR 24596
358         * aout-tic30.c (MY_bfd_final_link): Don't segfault on missing
359         create_object_symbols_section, obj_textsec, obj_datasec or
360         obj_bsssec.  Fix other errors in placement.
361         * config.bfd: Obsolete tic30-aout.
362
363 2019-05-28  Alan Modra  <amodra@gmail.com>
364
365         PR 24596
366         * dwarf2.c (save_section_vma, section_vma_same): Check for NULL
367         end of section list as well as section_count.
368         * xcofflink.c (xcoff_link_add_symbols): Fix temporarily changed
369         section list before returning error.
370
371 2019-05-27  Alan Modra  <amodra@gmail.com>
372
373         * elf.c (bfd_elf_set_group_contents): Exit on zero size section.
374
375 2019-05-27  Alan Modra  <amodra@gmail.com>
376
377         PR 24596
378         * linker.c (_bfd_generic_link_output_symbols): Heed BSF_KEEP.
379
380 2019-05-24  Szabolcs Nagy  <szabolcs.nagy@arm.com>
381
382         * elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): New function.
383         (struct elf_aarch64_link_hash_table): Add variant_pcs member.
384         (elfNN_aarch64_allocate_dynrelocs): Update variant_pcs.
385         (elfNN_aarch64_size_dynamic_sections): Add DT_AARCH64_VARIANT_PCS.
386         (elf_backend_merge_symbol_attribute): Define.
387
388 2019-05-24  Alan Modra  <amodra@gmail.com>
389
390         * po/SRC-POTFILES.in: Regenerate.
391
392 2019-05-24  Alan Modra  <amodra@gmail.com>
393
394         * elf64-ppc.c: Comment on powerxx _notoc stub variants.
395         (LI_R11_0, LIS_R11, ORI_R11_R11_0, SLDI_R11_R11_34): Define.
396         (PADDI_R12_PC, PLD_R12_PC, D34, HA34): Define.
397         (struct ppc_link_hash_table): Add powerxx_stubs.
398         (ppc64_elf_check_relocs): Set powerxx_stubs.
399         (build_powerxx_offset, size_powerxx_offset),
400         (num_relocs_for_powerxx_offset),
401         (emit_relocs_for_powerxx_offset): New functions.
402         (plt_stub_size): Size powerxx stubs.
403         (ppc_build_one_stub): Emit powerxx stubs.
404         (ppc_size_one_stub): Size powerxx stubs.  Omit .eh_frame for
405         powerxx stubs.
406
407 2019-05-24  Alan Modra  <amodra@gmail.com>
408
409         * elf64-ppc.c (ppc64_elf_check_relocs): Set has_gotrel for
410         R_PPC64_GOT_PCREL34.
411         (xlate_pcrel_opt): New function.
412         (ppc64_elf_edit_toc): Handle R_PPC64_GOT_PCREL34.
413         (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
414         for R_PPC64_GOT_PCREL34.  Implement R_PPC64_PCREL_OPT optimisation.
415
416 2019-05-24  Alan Modra  <amodra@gmail.com>
417
418         * reloc.c (BFD_RELOC_PPC64_D34, BFD_RELOC_PPC64_D34_LO),
419         (BFD_RELOC_PPC64_D34_HI30, BFD_RELOC_PPC64_D34_HA30),
420         (BFD_RELOC_PPC64_PCREL34, BFD_RELOC_PPC64_GOT_PCREL34),
421         (BFD_RELOC_PPC64_PLT_PCREL34),
422         (BFD_RELOC_PPC64_ADDR16_HIGHER34, BFD_RELOC_PPC64_ADDR16_HIGHERA34),
423         (BFD_RELOC_PPC64_ADDR16_HIGHEST34, BFD_RELOC_PPC64_ADDR16_HIGHESTA34),
424         (BFD_RELOC_PPC64_REL16_HIGHER34, BFD_RELOC_PPC64_REL16_HIGHERA34),
425         (BFD_RELOC_PPC64_REL16_HIGHEST34, BFD_RELOC_PPC64_REL16_HIGHESTA34),
426         (BFD_RELOC_PPC64_D28, BFD_RELOC_PPC64_PCREL28): New reloc enums.
427         * elf64-ppc.c (PNOP): Define.
428         (ppc64_elf_howto_raw): Add reloc howtos for new relocations.
429         (ppc64_elf_reloc_type_lookup): Translate new bfd reloc numbers.
430         (ppc64_elf_ha_reloc): Adjust addend for highera34 and highesta34
431         relocs.
432         (ppc64_elf_prefix_reloc): New function.
433         (struct ppc_link_hash_table): Add notoc_plt.
434         (is_branch_reloc): Add R_PPC64_PLTCALL_NOTOC.
435         (is_plt_seq_reloc): Add R_PPC64_PLT_PCREL34,
436         R_PPC64_PLT_PCREL34_NOTOC, and R_PPC64_PLTSEQ_NOTOC.
437         (ppc64_elf_check_relocs): Handle pcrel got and plt relocs.  Set
438         has_pltcall for section on seeing R_PPC64_PLTCALL_NOTOC.  Handle
439         possible need for dynamic relocs on non-pcrel powerxx relocs.
440         (dec_dynrel_count): Handle non-pcrel powerxx relocs.
441         (ppc64_elf_inline_plt): Handle R_PPC64_PLTCALL_NOTOC.
442         (toc_adjusting_stub_needed): Likewise.
443         (ppc64_elf_tls_optimize): Handle R_PPC64_PLTSEQ_NOTOC.
444         (ppc64_elf_relocate_section): Handle new powerxx relocs.
445         * bfd-in2.h: Regenerate.
446         * libbfd.h: Regenerate.
447
448 2019-05-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
449
450         * config.bfd (targ_cpu): Process bpf-*-none only if BFD64.
451         * configure.ac: Set target_size=64 for bpf_elf64_le_vec and
452         bpf_elf64_be_vec.
453         * configure: Regenerate.
454
455 2019-05-23  Jose E. Marchesi  <jose.marchesi@oracle.com>
456
457         * configure: Regenerated.
458         * Makefile.am (ALL_MACHINES): Add cpu-bpf.lo.
459         (ALL_MACHINES_CFILES): Add cpu-bpf.c.
460         (BFD64_BACKENDS): Add elf64-bpf.lo.
461         (BFD64_BACKENDS_CFILES): Add elf64-bpf.c.
462         * Makefile.in (SOURCE_HFILES): Regenerate.
463         * config.bfd (targ_cpu): Handle bpf-*-* targets.
464         * cpu-bpf.c: New file.
465         * elf64-bpf.c: Likewise.
466         * targets.c (_bfd_target_vector): Add bpf_elf64_be_vec and
467         bpf_elf64_le_vec.
468         * archures.c: Define architecture bfd_arch_bpf and machine
469         bfd_arch_bpf.
470         * reloc.c: Define BFD relocations used by the BPF target.
471         * bfd-in2.h: Regenerated.
472         * libbfd.h: Likewise.
473
474 2019-05-22  Alan Modra  <amodra@gmail.com>
475
476         * elf32-arm.c (arm_allocate_glue_section_space): Clear section
477         contents.
478
479 2019-05-22  Alan Modra  <amodra@gmail.com>
480
481         * vms-alpha.c (_bfd_vms_write_etir): Don't attempt further
482         processing on "size error in section".
483
484 2019-05-22  Alan Modra  <amodra@gmail.com>
485
486         * som.c (som_bfd_free_cached_info): Call
487         _bfd_generic_close_and_cleanup.
488
489 2019-05-21  Faraz Shahbazker  <fshahbazker@wavecomp.com>
490
491         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Generate error
492         for TLS_TPREL_HI16(/LO16) relocations in shared library.
493
494 2019-05-21  Faraz Shahbazker  <fshahbazker@wavecomp.com>
495
496         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Add NULL pointer
497         checks.  Search the RELA table for n64 relocations.
498
499 2019-05-21  Matthew Fortune  <matthew.fortune@mips.com>
500             Faraz Shahbazker  <fshahbazker@wavecomp.com>
501
502         * elfxx-mips.c (LA25_BC): New macro.
503         (mips_elf_link_hash_table)<compact_branches>: New field.
504         (STUB_JALRC): New macro.
505         (mipsr6_o32_exec_plt0_entry_compact): New array.
506         (mipsr6_n32_exec_plt0_entry_compact): Likewise.
507         (mipsr6_n64_exec_plt0_entry_compact): Likewise.
508         (mipsr6_exec_plt_entry_compact): Likewise.
509         (mips_elf_create_la25_stub): Use BC instead of J for stubs
510         when compact_branches is true.
511         (_bfd_mips_elf_finish_dynamic_symbol): Choose the compact
512         PLT for MIPSR6 with compact_branches.  Do not reorder the
513         compact branches PLT.  Switch the lazy stub for MIPSR6
514         with compact_branches to use JALRC.
515         (mips_finish_exec_plt): Choose the compact PLT0 for MIPSR6
516         when compact_branches is true.
517         (_bfd_mips_elf_compact_branches): New function.
518         * elfxx-mips.h (_bfd_mips_elf_compact_branches): New prototype.
519
520 2019-05-21  Tamar Christina  <tamar.christina@arm.com>
521
522         PR ld/24373
523         * elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub):
524         Fix print formatter.
525
526 2019-05-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>
527
528         PR 24460
529         * elf32-arm.c (get_value_helper): Remove.
530         (elf32_arm_final_link_relocate): Fix branch future relocations.
531
532 2019-05-21  Tamar Christina  <tamar.christina@arm.com>
533
534         PR ld/24373
535         * bfd-in.h (enum erratum_84319_opts): New
536         (bfd_elf64_aarch64_set_options, bfd_elf32_aarch64_set_options): Change
537         int to enum erratum_84319_opts.
538         * bfd-in2.h: Regenerate.
539         * elfnn-aarch64.c (struct elf_aarch64_link_hash_table): Change
540         fix_erratum_843419 to use new enum, remove fix_erratum_843419_adr.
541         (_bfd_aarch64_add_stub_entry_after): Conditionally create erratum stub.
542         (aarch64_size_one_stub): Conditionally size erratum 843419 stubs.
543         (_bfd_aarch64_resize_stubs): Amend comment.
544         (elfNN_aarch64_size_stubs): Don't generate stubs when no workaround
545         requested.
546         (bfd_elfNN_aarch64_set_options): Use new fix_erratum_843419 enum.
547         (_bfd_aarch64_erratum_843419_branch_to_stub): Implement selection of
548         erratum workaround.
549         (clear_erratum_843419_entry): Update erratum conditional.
550
551 2019-05-21  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>
552
553         PR ld/24571
554         * bfd/elf32-avr.c (elf32_avr_relax_section): Adjust range check
555         when computing distance_short_enough.
556
557 2019-05-21  Senthil Kumar Selvaraj  <senthilkumar.selvaraj@microchip.com>
558
559         PR ld/24564
560         * bfd/elf32-avr.c (avr_relative_distance_considering_wrap_around):
561         Wrap around even if distance equals avr_pc_wrap_around.
562
563 2019-05-20  Nick Clifton  <nickc@redhat.com>
564
565         * po/fr.po: Updated French translation.
566
567 2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
568
569         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch.
570
571 2019-05-16  Alan Modra  <amodra@gmail.com>
572
573         * elf32-arm.c (elf32_arm_write_section): Revert last change.
574
575 2019-05-15  Alan Modra  <amodra@gmail.com>
576
577         * elf32-arm.c (elf32_arm_write_section): Don't leave
578         error case of STM32L4XX_ERRATUM_BRANCH_TO_VENEER with
579         unitialised section contents.
580
581 2019-05-14  Jamey Hicks  <jamey.hicks@gmail.com>
582
583         PR 19921
584         * verilog.c: (VerilogDataWidth): New variable.
585         (verilog_write_record): Emit bytes in VerilogDataWidth bundles.
586
587 2019-05-08  Nick Clifton  <nickc@redhat.com>
588
589         PR 24523
590         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Return TRUE
591         rather than FALSE if encountering a non-ELF file.
592
593 2019-05-06  Alan Modra  <amodra@gmail.com>
594
595         * elf32-pj.c (pj_elf_reloc): Don't report undefined weak as an error.
596
597 2019-05-06  Alan Modra  <amodra@gmail.com>
598
599         * reloc.c (BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA),
600         (BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA):
601         Sort before BFD_RELOC_PPC64_DTPREL16_HIGHESTA entry.
602         * libbfd.h: Regenerate.
603         * bfd-in2.h: Regenerate.
604
605 2019-05-04  Alan Modra  <amodra@gmail.com>
606
607         PR 24511
608         * syms.c (coff_section_type): Only allow '.', '$' and numeric
609         following the standard section names.
610         (bfd_decode_symclass): Prioritize section flag tests in
611         decode_section_type before name tests in coff_section_type.
612         * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section
613         and fake_common_section using BFD_FAKE_SECTION.  Use "fake" as
614         their names and choose standard .text section flags for
615         fake_section.
616
617 2019-05-02  Nick Clifton  <nickc@redhat.com>
618
619         PR 24493
620         * coffcode.h (styp_to_sec_flags): Treat .gnu.debuglink and
621         .gnu.debugaltlink sections as debugging sections.
622
623 2019-04-30  Alan Modra  <amodra@gmail.com>
624
625         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_gotrel.
626         (struct _ppc64_elf_section_data): Likewise.
627         (ppc64_elf_check_relocs): Set above fields.
628         (ppc64_elf_edit_toc): Add a pass over GOT relocs.
629         (ppc64_elf_relocate_section): Edit GOT indirect to GOT relative
630         when possible.
631
632 2019-04-26  H.J. Lu  <hongjiu.lu@intel.com>
633
634         PR ld/24486
635         * elflink.c (elf_link_output_extsym): Don't complain undefined
636         weak dynamic reference.
637
638 2019-04-25  Sudakshina Das  <sudi.das@arm.com>
639
640         * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): Remove.
641         (PLT_BTI_TLSDESC_ENTRY_SIZE): Remove.
642         (PLT_PAC_ENTRY_SIZE, PLT_BTI_PAC_ENTRY_SIZE): Remove.
643         (PLT_BTI_SMALL_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): Update.
644         (elfNN_aarch64_small_plt0_pac_entry): Remove.
645         (elfNN_aarch64_small_plt0_bti_pac_entry): Remove.
646         (elfNN_aarch64_small_plt0_bti_entry): Update.
647         (elfNN_aarch64_small_plt_bti_entry): Update.
648         (elfNN_aarch64_small_plt_pac_entry): Update.
649         (elfNN_aarch64_tlsdesc_small_plt_bti_entry): Update.
650         (setup_plt_values): Setup new entries.
651         (elfNN_aarch64_finish_dynamic_sections): Remove size change.
652         (elfNN_aarch64_plt_sym_val): Likewise.
653
654 2019-04-22  Jim Wilson  <jimw@sifive.com>
655
656         * elfnn-riscv.c (PRSTATUS_SIZE) [ARCH_SIZE==32]: Change from 0 to 204.
657
658 2019-04-19  Alan Modra  <amodra@gmail.com>
659
660         * elf32-s12z.c (elf_backend_can_gc_sections): Don't define
661
662 2019-04-17  H.J. Lu  <hongjiu.lu@intel.com>
663
664         * elf64-x86-64.c (elf_x86_64_need_pic): Suggest -fPIE when not
665         building shared object.
666         * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Likewise.
667
668 2019-04-17  H.J. Lu  <hongjiu.lu@intel.com>
669
670         PR ld/24458
671         * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): Also check x86
672         linker_def.
673
674 2019-04-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>
675
676         * reloc.c (BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM): New internal
677         relocation.
678         * bfd-in2.h: Regenerate.
679         * libbfd.h: Likewise.
680
681 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
682
683         * reloc.c (BFD_RELOC_ARM_THUMB_LOOP12): New.
684         * bfd-in2.h: Regenerated.
685         * libbfd.h: Regenerated.
686
687 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
688
689         * reloc.c (BFD_RELOC_THUMB_PCREL_BFCSEL): New relocation.
690         * bfd-in2.h: Regenerated.
691         * libbfd.h: Likewise.
692
693 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
694
695         * reloc.c (BFD_RELOC_ARM_THUMB_BF13): New.
696         * bfd-in2.h: Regenerated.
697         * libbfd.h: Regenerated.
698         * elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF13.
699         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF13
700         and R_ARM_THM_BF12 together.
701         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF13.
702
703 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
704
705         * reloc.c (BFD_RELOC_ARM_THUMB_BF19): New
706         * libbfd.h: Regenerated.
707         * bfd-in2.h: Regenerated.
708         * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF18.
709         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF19
710         and R_ARM_THM_BF18 together.
711         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF19.
712
713 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
714
715         * reloc.c (BFD_RELOC_ARM_THUMB_BF17): New enum.
716         * bfd-in2.h: Regenerated.
717         * libbfd.h: Regenerated.
718         * bfd-elf32-arm.c (elf32_arm_howto_table_1): New entry for R_ARM_THM_BF16.
719         (elf32_arm_reloc_map elf32_arm_reloc_map): Map BFD_RELOC_ARM_THUMB_BF17
720         and R_ARM_THM_BF16 together.
721         (get_value_helper): New reloc helper.
722         (elf32_arm_final_link_relocate): New switch case for R_ARM_THM_BF16.
723
724 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
725
726         * reloc.c (BFD_RELOC_THUMB_PCREL_BRANCH5): New enum.
727         * bfd-in2.h: Regenerate.
728         * libbfd.h: Regenerate.
729
730 2019-04-15  Thomas Preud'homme  <thomas.preudhomme@arm.com>
731
732         * archures.c (bfd_mach_arm_8_1M_MAIN): Define.
733         * bfd-in2.h: Regenerate.
734         * cpu-arm.c (arch_info_struct): Add entry for Armv8.1-M Mainline.
735         * elf32-arm.c (using_thumb_only): Return true for Armv8.1-M Mainline
736         and update assert.
737         (using_thumb2): Likewise.
738         (using_thumb2_bl): Update assert.
739         (arch_has_arm_nop): Likewise.
740         (bfd_arm_get_mach_from_attributes): Add case for Armv8.1-M Mainline.
741         (tag_cpu_arch_combine): Add logic for Armv8.1-M Mainline merging.
742
743 2019-04-11  H.J. Lu  <hongjiu.lu@intel.com>
744
745         * elf-linker-x86.h (elf_x86_cet_report): New.
746         (elf_linker_x86_params): Add cet_report.
747         * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
748         missing IBT and SHSTK properties if needed.
749
750 2019-04-11  H.J. Lu  <hongjiu.lu@intel.com>
751
752         PR ld/24436
753         * elf-m10300.c (mn10300_elf_check_relocs): Remove BFD_ASSERT of
754         "h != NULL".  Don't check "h != NULL" before calling.
755         bfd_elf_gc_record_vtentry.
756         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
757         * elf32-bfin.c (bfin_check_relocs): Likewise.
758         * elf32-cris.c (cris_elf_check_relocs): Likewise.
759         * elf32-csky.c (csky_elf_check_relocs): Likewise.
760         * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
761         * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
762         * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
763         * elf32-frv.c (elf32_frv_check_relocs): Likewise.
764         * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
765         * elf32-i386.c (elf_i386_check_relocs): Likewise.
766         * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
767         * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
768         * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
769         * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
770         * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
771         * elf32-metag.c (elf_metag_check_relocs): Likewise.
772         * elf32-or1k.c (or1k_elf_check_relocs): Likewise.
773         * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
774         * elf32-s390.c (elf_s390_check_relocs): Likewise.
775         * elf32-sh.c (sh_elf_check_relocs): Likewise.
776         * elf32-v850.c (v850_elf_check_relocs): Likewise.
777         * elf32-vax.c (elf_vax_check_relocs): Likewise.
778         * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
779         * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
780         * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
781         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
782         * elf64-s390.c (elf_s390_check_relocs): Likewise.
783         * elf64-x86-64.c (elf_s390_check_relocs): Likewise.
784         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
785         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
786         * elflink.c (bfd_elf_gc_record_vtinherit): Check for corrupt
787         VTENTRY entry.
788
789 2019-04-11  Alan Modra  <amodra@gmail.com>
790
791         PR 24435
792         * elflink.c (elf_link_add_object_symbols): Don't read partial
793         dynamic entries from fuzzed objects.
794
795 2019-04-11  Tamar Christina  <tamar.christina@arm.com>
796
797         PR ld/24302
798         * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Don't emit
799         DT_TLSDESC_GOT and DT_TLSDESC_PLT when DF_BIND_NOW.
800         (elfNN_aarch64_finish_dynamic_sections): Don't write PLT if DF_BIND_NOW.
801
802 2019-04-10  Michael Forney  <mforney@mforney.org>
803
804         PR 24427
805         * doc/chew.c (free_words): Correctly free "push_text" strings.
806
807 2019-04-08  H.J. Lu  <hongjiu.lu@intel.com>
808
809         * config.bfd: Remove i[3-7]86-*-kaos* and i[3-7]86-*-chaos targets.
810
811 2019-04-08  Alan Modra  <amodra@gmail.com>
812
813         * configure.ac (elfxx_x86): Define and use.
814         * configure: Regenerate.
815
816 2019-04-06  H.J. Lu  <hongjiu.lu@intel.com>
817
818         * elf-linker-x86.h: New file.
819         * elf32-i386.c (elf_i386_convert_load_reloc): Use htab->params
820         to get x86-specific linker options.
821         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
822         (elf_x86_64_check_relocs): Likewise.
823         (elf_x86_64_relocate_section): Likewise.
824         (elf_x86_64_link_setup_gnu_properties): Likewise.
825         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Likewise.
826         (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
827         (_bfd_elf_linker_x86_set_options): New function.
828         * elfxx-x86.h: Include "elf-linker-x86.h".
829         (elf_x86_link_hash_table): Add params.
830
831 2019-04-03  Alan Modra  <amodra@gmail.com>
832
833         * coff-i386.c, * coff-x86_64.c, * coffgen.c, * dwarf2.c,
834         * elf-m10200.c, * elf.c, * elf32-arm.c, * elf32-bfin.c,
835         * elf32-csky.c, * elf32-m32r.c, * elf32-microblaze.c, * elf32-pru.c,
836         * elf32-rx.c, * elf32-xgate.c, * elf64-sparc.c, * elfnn-ia64.c,
837         * elfxx-riscv.c, * elfxx-sparc.c, * linker.c, * mach-o.c,
838         * pe-x86_64.c, * pei-x86_64.c, * plugin.c: Whitespace fixes.
839
840 2019-04-02  Jim Wilson  <jimw@sifive.com>
841
842         PR 24389
843         * elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Move read of
844         ELF header flags to after check for ELF object file.  Loop through
845         sections looking for code sections, if none, then skip ABI checks.
846
847 2019-03-30  Andrew Waterman  <andrew@sifive.com>
848
849         * elfnn-riscv.c (_bfd_riscv_relax_call): Only check ARCH_SIZE for
850         rd == X_RA case.
851
852 2019-03-29  Max Filippov  <jcmvbkbc@gmail.com>
853
854         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add
855         info->export_dynamic to the conditional.
856
857 2019-03-28  Alan Modra  <amodra@gmail.com>
858
859         PR 24392
860         * configure.ac: Invoke AC_CHECK_SIZEOF(int).
861         * configure: Regenerate.
862         * coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic
863         workaround with SIZEOF_LONG vs. SIZEOF_INT check.
864         * elf.c (_bfd_elf_get_reloc_upper_bound): Likewise.
865         * elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise.
866         * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
867
868 2019-03-21  Jim Wilson  <jimw@sifive.com>
869
870         PR 24365
871         * elfnn-riscv.c (riscv_elf_relocate_section): For STT_SECTION check,
872         verify sym non-NULL before using.  Add identical check using h.
873
874 2019-03-21  Sudakshina Das  <sudi.das@arm.com>
875
876         * elf-bfd.h (struct elf_backend_data): Add argument to
877         merge_gnu_properties.
878         * elf-properties.c (elf_merge_gnu_properties): Add argument to
879         itself and while calling bed->merge_gnu_properties.
880         (elf_merge_gnu_property_list): Update the calls for
881         elf_merge_gnu_properties.
882         * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update handling
883         of --force-bti warning and add argument.
884         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Add
885         warning.
886         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Add argument.
887         * elfxx-x86.h (_bfd_x86_elf_merge_gnu_properties): Likewise in
888         declaration.
889
890 2019-03-20  Sudakshina Das  <sudi.das@arm.com>
891
892         * elfxx-aarch64.c (_bfd_aarch64_elf_link_fixup_gnu_properties): Define.
893         * elfxx-aarch64.h (_bfd_aarch64_elf_link_fixup_gnu_properties): Declare.
894         (elf_backend_fixup_gnu_properties): Define for AArch64.
895
896 2019-03-18  Alan Modra  <amodra@gmail.com>
897
898         PR 24355
899         * elf32-ppc.c (ppc_finish_symbols): Don't call write_glink_stub
900         for local iplt syms with ent->plt.offset == -1.  Remove ineffective
901         attempt at writing glink stubs only once.
902
903 2019-03-16  Alan Modra  <amodra@gmail.com>
904
905         PR 24337
906         * elf.c (_bfd_elf_rela_local_sym): Revert last change.
907         (_bfd_elf_rel_local_sym): Likewise.
908         * elflink.c (elf_link_input_bfd): Use bfd_und_section for
909         section of symbols with unrecognized shndx.
910
911 2019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
912
913         PR ld/24267
914         * coffgen.c (_bfd_coff_section_already_linked): Skip discarded
915         section.
916         * cofflink.c (coff_link_add_symbols): Check for symbols defined
917         in discarded section.
918
919 2019-03-15  Alan Modra  <amodra@gmail.com>
920
921         PR 24339
922         * elflink.c (elf_link_add_object_symbols): Bail out on a local
923         symbol after globals if elf_bad_symtab is not set.
924
925 2019-03-15  Alan Modra  <amodra@gmail.com>
926
927         PR 24337
928         * elf.c (_bfd_elf_rela_local_sym): Don't segfault on NULL sec.
929         (_bfd_elf_rel_local_sym): Likewise.
930
931 2019-03-15  Alan Modra  <amodra@gmail.com>
932
933         PR 24336
934         * elflink.c (elf_link_read_relocs_from_section): Handle fuzzed
935         object files with sh_size not a multiple of sh_entsize.
936
937 2019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
938
939         PR ld/24338
940         * elf64-x86-64.c (elf_x86_64_relocate_section): Check for corrupt
941         input with bad relocation.
942
943 22019-03-15  H.J. Lu  <hongjiu.lu@intel.com>
944
945         * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
946
947 2019-03-14  Nick Clifton  <nickc@redhat.com>
948
949         PR 24334
950         * dwarf2.c (struct dwarf2_debug): Add sec_vma_count field.
951         (save_section_vma): Initialise field to the number of entries in
952         the sec_vma table.
953         (section_vma_same): Check that the number of entries in the
954         sec_vma table matches the number of sections in the bfd.
955
956 2019-03-14  Nick Clifton  <nickc@redhat.com>
957
958         PR 24333
959         * elflink.c (_bfd_elf_add_default_symbol): Add a check for a NULL
960         section owner pointer when adding the default symbol.
961
962 2019-03-14  Nick Clifton  <nickc@redhat.com>
963
964         PR 24332
965         * elflink.c (elf_link_add_object_symbols): Add new local variable
966         extversym_end.  Initialise it to point to the end of the version
967         symbol table, if present.  Check it when initialising and updating
968         the ever pointer.
969
970 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
971
972         * elfnn-aarch64.c (PLT_PAC_ENTRY_SIZE, PLT_PAC_SMALL_ENTRY_SIZE): New.
973         (PLT_BTI_PAC_ENTRY_SIZE, PLT_BTI_PAC_SMALL_ENTRY_SIZE): New.
974         (setup_plt_values): Account for PAC or PAC and BTI enabled PLTs.
975         (elfNN_aarch64_size_dynamic_sections): Add checks for PLT_BTI_PAC
976         and PLT_PAC_PLT.
977         (elfNN_aarch64_finish_dynamic_sections): Account for PLT_BTI_PAC.
978         (get_plt_type): Add case for DT_AARCH64_PAC_PLT.
979         (elfNN_aarch64_plt_sym_val): Add cases for PLT_BTI_PAC and PLT_PAC.
980
981 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
982             Szabolcs Nagy  <szabolcs.nagy@arm.com>
983
984         * bfd-in.h (aarch64_plt_type, aarch64_enable_bti_type): New.
985         (aarch64_bti_pac_info): New.
986         (bfd_elf64_aarch64_set_options): Add aarch64_bti_pac_info argument.
987         (bfd_elf32_aarch64_set_options): Likewise.
988         * bfd-in2.h: Regenerate
989         * elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): New.
990         (PLT_BTI_SMALL_ENTRY_SIZE, PLT_BTI_TLSDESC_ENTRY_SIZE): New.
991         (elfNN_aarch64_small_plt0_bti_entry): New.
992         (elfNN_aarch64_small_plt_bti_entry): New.
993         (elfNN_aarch64_tlsdesc_small_plt_bti_entry): New.
994         (elf_aarch64_obj_tdata): Add no_bti_warn and plt_type fields.
995         (elf_aarch64_link_hash_table): Add plt0_entry, plt_entry and
996         tlsdesc_plt_entry_size fields.
997         (elfNN_aarch64_link_hash_table_create): Initialise the new fields.
998         (setup_plt_values): New helper function.
999         (bfd_elfNN_aarch64_set_options): Use new bp_info to set plt sizes and
1000         bti enable type.
1001         (elfNN_aarch64_allocate_dynrelocs): Use new size members instead of
1002         fixed macros.
1003         (elfNN_aarch64_size_dynamic_sections): Likewise and add checks.
1004         (elfNN_aarch64_create_small_pltn_entry): Use new generic pointers
1005         to plt stubs instead of fixed ones and update filling them according
1006         to the need for bti.
1007         (elfNN_aarch64_init_small_plt0_entry): Likewise.
1008         (elfNN_aarch64_finish_dynamic_sections): Likewise.
1009         (get_plt_type, elfNN_aarch64_get_synthetic_symtab): New.
1010         (elfNN_aarch64_plt_sym_val): Update size accordingly.
1011         (elfNN_aarch64_link_setup_gnu_properties): Set up plts if BTI GNU NOTE
1012         is set.
1013         (bfd_elfNN_get_synthetic_symtab): Define.
1014         (elfNN_aarch64_merge_gnu_properties): Give out warning with --force-bti
1015         and mising BTI NOTE SECTION.
1016
1017
1018 2019-03-13  Sudakshina Das  <sudi.das@arm.com>
1019
1020         * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Exclude
1021         linker created inputs from merge.
1022         * elfnn-aarch64.c (struct elf_aarch64_obj_tdata): Add field for
1023         GNU_PROPERTY_AARCH64_FEATURE_1_AND properties.
1024         (elfNN_aarch64_link_setup_gnu_properties): New.
1025         (elfNN_aarch64_merge_gnu_properties): New.
1026         (elf_backend_setup_gnu_properties): Define for AArch64.
1027         (elf_backend_merge_gnu_properties): Likewise.
1028         * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Define.
1029         (_bfd_aarch64_elf_parse_gnu_properties): Define.
1030         (_bfd_aarch64_elf_merge_gnu_properties): Define.
1031         * elfxx-aarch64.h (_bfd_aarch64_elf_link_setup_gnu_properties): Declare.
1032         (_bfd_aarch64_elf_parse_gnu_properties): Declare.
1033         (_bfd_aarch64_elf_merge_gnu_properties): Declare.
1034         (elf_backend_parse_gnu_properties): Define for AArch64.
1035
1036 2019-03-13  H.J. Lu  <hongjiu.lu@intel.com>
1037
1038         PR ld/24322
1039         * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Properly
1040         merge GNU_PROPERTY_X86_FEATURE_1_[IBT|SHSTK].
1041
1042 2019-03-12  Alan Modra  <amodra@gmail.com>
1043
1044         * coffcode.h (buy_and_read): Delete unnecessary forward decl.  Add
1045         nmemb parameter.  Use bfd_alloc2.
1046         (coff_slurp_line_table): Use bfd_alloc2.  Update buy_and_read calls.
1047         Delete assertion.
1048         (coff_slurp_symbol_table): Use bfd_alloc2 and bfd_zalloc2.
1049         (coff_slurp_reloc_table): Use bfd_alloc2.  Update buy_and_read calls.
1050         * coffgen.c (coff_get_reloc_upper_bound): Ensure size calculation
1051         doesn't overflow.
1052         * elf.c (bfd_section_from_shdr): Use bfd_zalloc2.  Style fix.
1053         (assign_section_numbers): Style fix.
1054         (swap_out_syms): Use bfd_malloc2.
1055         (_bfd_elf_get_reloc_upper_bound): Ensure size calculation doesn't
1056         overflow.
1057         (_bfd_elf_make_empty_symbol): Style fix.
1058         (elfobj_grok_stapsdt_note_1): Formatting.
1059         * elfcode.h (elf_object_p): Use bfd_alloc2.
1060         (elf_write_relocs, elf_write_shdrs_and_ehdr): Likewise.
1061         (elf_slurp_symbol_table): Use bfd_zalloc2.
1062         (elf_slurp_reloc_table): Use bfd_alloc2.
1063         (_bfd_elf_bfd_from_remote_memory): Use bfd_malloc2.
1064         * elf64-sparc (elf64_sparc_get_reloc_upper_bound): Ensure
1065         size calculation doesn't overflow.
1066         (elf64_sparc_get_dynamic_reloc_upper_bound): Likewise.
1067         * mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
1068         * pdp11.c (get_reloc_upper_bound): Copy aoutx.h version.
1069
1070 2019-03-08  Alan Modra  <amodra@gmail.com>
1071
1072         PR 24311
1073         * merge.c (merge_strings): Return secinfo.  Don't pad section
1074         to alignment here.
1075         (_bfd_merge_sections): Pad section to alignment here, if input
1076         sections contributing to merged output all pad to alignment.
1077         Formatting.
1078
1079 2019-03-06  Nick Clifton  <nickc@redhat.com>
1080
1081         * dwarf2.c (_bfd_dwarf2_find_symbol_bias): Check for a NULL symbol
1082         table pointer.
1083         * coffgen.c (coff_find_nearest_line_with_names): Do not call
1084         _bfd_dwarf2_find_symbol_bias if there is no symbol table available.
1085
1086 2019-03-01  Andreas Krebbel  <krebbel@linux.ibm.com>
1087
1088         This reverts commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335.
1089         2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
1090
1091         PR 20113
1092         * elf32-s390.c (allocate_dynrelocs): Update comment.
1093
1094 2019-02-28  Tamar Christina  <tamar.christina@arm.com>
1095
1096         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Correct CIE parse.
1097
1098 2019-02-28  Nick Clifton  <nickc@redhat.com>
1099
1100         PR 24273
1101         * elf.c (bfd_elf_string_from_elf_section): Check for a string
1102         section that is not NUL terminated.
1103
1104 2019-02-27  H.J. Lu  <hongjiu.lu@intel.com>
1105
1106         PR ld/24276
1107         * elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined
1108         by linker when checking copy reloc on protected symbol.
1109
1110 2019-02-24  Alan Modra  <amodra@gmail.com>
1111
1112         PR 24144
1113         * pdp11.c (set_section_contents): Revert 2015-02-24 change.
1114
1115 2019-02-20  Eric Tsai  <erictsai@cadence.com>
1116
1117         * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output
1118         sections between the call site and call destination and adjust
1119         call distance by the largest alignment.
1120
1121 2019-02-20  Alan Hayward  <alan.hayward@arm.com>
1122
1123         * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration.
1124         * elf.c (elfcore_grok_aarch_pauth): New function.
1125         (elfcore_grok_note): Check for NT_ARM_PAC_MASK.
1126         (elfcore_write_aarch_pauth): New function.
1127         (elfcore_write_register_note): Check for AArch64 pauth section.
1128
1129 2019-02-20  Alan Modra  <amodra@gmail.com>
1130
1131         PR 24225
1132         * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf
1133         return value.
1134
1135 2019-02-20  Michael Roitzsch  <reactorcontrol@icloud.com>
1136
1137         * configure.ac (SHARED_LIBADD): Add -liberty -lintl for all
1138         Darwin hosts, not just or1k.
1139         * configure: Regenerate.
1140
1141 2019-02-20  Alan Modra  <amodra@gmail.com>
1142
1143         PR 24236
1144         * archive64.c (_bfd_archive_64_bit_slurp_armap): Move code adding
1145         sentinel NUL to string buffer nearer to loop where it is used.
1146         Don't go past sentinel when scanning strings, and don't write
1147         NUL again.
1148         * archive.c (do_slurp_coff_armap): Simplify string handling to
1149         archive64.c style.
1150
1151 2019-02-19  Alan Modra  <amodra@gmail.com>
1152
1153         PR 24235
1154         * pei-x86_64.c (pex64_bfd_print_pdata_section): Correct checks
1155         attempting to prevent read past end of section.
1156
1157 2019-02-18  Alan Modra  <amodra@gmail.com>
1158
1159         PR 24225
1160         * elf32-nios2.c (nios2_elf32_relocate_section): Use asprintf and
1161         PRIx64 to generate warning messages.  Print local sym names too.
1162
1163 2019-02-09  Vineet Gupta  <vgupta@synopsys.com>
1164
1165         * elf32-arc (INIT_SYM_STRING): Delete.
1166         (FINI_SYM_STRING): Likewise.
1167         (init_str): Likewise.
1168         (fini_str): Likewise.
1169
1170 2019-02-08  Alan Modra  <amodra@gmail.com>
1171
1172         * elf32-ppc.c (ppc_elf_relocate_section): Add %X to "unsupported
1173         for bss-plt" warning to make it an error.
1174
1175 2019-02-07  Eric Botcazou  <ebotcazou@adacore.com>
1176
1177         PR ld/18841
1178         * elf32-sparc.c (elf32_sparc_reloc_type_class): Return
1179         reloc_class_ifunc for ifunc symbols.
1180         * elf64-sparc.c (elf64_sparc_reloc_type_class): Likewise.
1181
1182 2019-02-07  Eric Botcazou  <ebotcazou@adacore.com>
1183
1184         * elf32-visium.c (visium_elf_howto_parity_reloc): Minor tweak.
1185         <R_VISIUM_PC16>: Use explicit range test to detect an overflow.
1186
1187 2019-02-07  Nick Clifton  <nickc@redhat.com>
1188
1189         * config.bfd: Move the powerpc-lynxos and powerpc-windiss targets
1190         into the definitely obsolete list.
1191
1192 2019-02-05  H.J. Lu  <hongjiu.lu@intel.com>
1193
1194         PR ld/24151
1195         * elf64-x86-64.c (elf_x86_64_need_pic): Check
1196         SYMBOL_DEFINED_NON_SHARED_P instead of def_regular.
1197         (elf_x86_64_relocate_section): Move PIC check for PC-relative
1198         relocations to ...
1199         (elf_x86_64_check_relocs): Here.
1200         (elf_x86_64_finish_dynamic_symbol): Use SYMBOL_DEFINED_NON_SHARED_P
1201         to check if a symbol is defined in a non-shared object.
1202         * elfxx-x86.h (SYMBOL_DEFINED_NON_SHARED_P): New.
1203
1204 2019-01-21  Sergio Durigan Junior  <sergiodj@redhat.com>
1205
1206         * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead
1207         of 'labs' (and fix GCC warning).
1208
1209 2019-01-25  Nick Clifton  <nickc@redhat.com>
1210
1211         * po/ru.po: Updated Russian translation.
1212
1213 2019-01-23  Nick Clifton  <nickc@redhat.com>
1214
1215         * po/fr.po: Updated French translation.
1216
1217 2019-01-21  Nick Clifton  <nickc@redhat.com>
1218
1219         * po/pt.po: Updated Portuguese translation.
1220         * po/uk.po: Updated Ukranian translation.
1221
1222 2019-01-21  Yuri Chornoivan  <yurchor@ukr.net>
1223
1224         PR 24108
1225         * elf32-nds32.c (nds32_relocate_section): Add space between words
1226         in error message.
1227         * elfnn-riscv.c (riscv_version_mismatch): Fix spelling mistake in
1228         error message.
1229         (riscv_i_or_e_p): Likewise.
1230         (riscv_merge_arch_attr_info): Likewise.
1231
1232 2019-01-19  Nick Clifton  <nickc@redhat.com>
1233
1234         * version.m4: Reset to 2.32.51
1235         * configure: Regenerate.
1236         * po/bfd.pot: Regenerate.
1237
1238 2018-06-24  Nick Clifton  <nickc@redhat.com>
1239
1240         2.32 branch created.
1241
1242 2019-01-16  Kito Cheng  <kito@andestech.com>
1243
1244         * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
1245         for OBJ_ATTR_PROC.
1246
1247 2019-01-16  Kito Cheng  <kito@andestech.com>
1248             Nelson Chu  <nelson@andestech.com>
1249
1250         * elfnn-riscv.c (in_subsets): New.
1251         (out_subsets): Likewise.
1252         (merged_subsets): Likewise.
1253         (riscv_std_ext_p): Likewise.
1254         (riscv_non_std_ext_p): Likewise.
1255         (riscv_std_sv_ext_p): Likewise.
1256         (riscv_non_std_sv_ext_p): Likewise.
1257         (riscv_version_mismatch): Likewise.
1258         (riscv_i_or_e_p): Likewise.
1259         (riscv_merge_std_ext): Likewise.
1260         (riscv_merge_non_std_and_sv_ext): Likewise.
1261         (riscv_merge_arch_attr_info): Likewise.
1262         (riscv_merge_attributes): Likewise.
1263         (_bfd_riscv_elf_merge_private_bfd_data): Merge attribute.
1264
1265         * elfnn-riscv.c (riscv_elf_obj_attrs_arg_type): New.
1266         (elf_backend_obj_attrs_vendor): Define.
1267         (elf_backend_obj_attrs_section_type): Likewise.
1268         (elf_backend_obj_attrs_section): Likewise.
1269         (elf_backend_obj_attrs_arg_type): Define as
1270         riscv_elf_obj_attrs_arg_type.
1271         * elfxx-riscv.c (riscv_estimate_digit): New.
1272         (riscv_estimate_arch_strlen1): Likewise.
1273         (riscv_estimate_arch_strlen): Likewise.
1274         (riscv_arch_str1): Likewise.
1275         (riscv_arch_str): Likewise.
1276         * elfxx-riscv.h (riscv_arch_str): Declare.
1277
1278 2019-01-14  John Darrington <john@darrington.wattle.id.au>
1279
1280         * bfd-in2.h [BFD_RELOC_S12Z_OPR]: New reloc.
1281         * libbfd.h: regen.
1282         * elf32-s12z.c (eld_s12z_howto_table): R_S12Z_OPR takes non zero
1283         source field.  (md_apply_fix): Apply final fix
1284         to BFD_RELOC_S12Z_OPR.
1285         * reloc.c[BFD_RELOC_S12Z_OPR]: New reloc.
1286
1287 2019-01-14  Maamoun Tarsha  <maamountk@hotmail.com>
1288
1289         PR 20113
1290         * elf32-s390.c (allocate_dynrelocs): Update comment.
1291
1292 2019-01-09  Andrew Paprocki  <andrew@ishiboo.com>
1293
1294         * warning.m4: Adjust egrep pattern for non-GNU compilers.
1295         * configure: Regenerate.
1296
1297 2019-01-08  Alan Modra  <amodra@gmail.com>
1298
1299         PR 23699
1300         PR 24065
1301         * ihex.c (ihex_write_object_contents): Properly check 32-bit
1302         address range.
1303
1304 2019-01-05  Yoshinori Sato <ysato@users.sourceforge.jp>
1305
1306         * bfd/archures.c: Add bfd_mach_rx_v2 and bfd_mach_rx_v3.
1307         * bfd/bfd-in2.h: Regenerate.
1308         * bfd/cpu-rx.c (arch_info_struct): Add RXv2 and RXv3 entry.
1309         * bfd/elf32-rx.c (elf32_rx_machine): Add RXv2 and RXv3 support.
1310
1311 2019-01-04  Lifang Xia  <lifang_xia@c-sky.com>
1312
1313         * config.bfd (csky-*-elf* | csky-*-linux*): Modify the csky
1314         default target, little endian target is more suitable.
1315
1316 2019-01-04  Alan Modra  <amodra@gmail.com>
1317
1318         PR 24061
1319         PR 21786
1320         * coff-rs6000.c (GET_VALUE_IN_FIELD): Add base parameter and
1321         adjust all callers.
1322         (EQ_VALUE_IN_FIELD): Likewise.
1323         * coff64-rs6000.c (GET_VALUE_IN_FIELD): Likewise.
1324
1325 2019-01-01  Alan Modra  <amodra@gmail.com>
1326
1327         Update year range in copyright notice of all files.
1328
1329 For older changes see ChangeLog-2018
1330 \f
1331 Copyright (C) 2019 Free Software Foundation, Inc.
1332
1333 Copying and distribution of this file, with or without modification,
1334 are permitted in any medium without royalty provided the copyright
1335 notice and this notice are preserved.
1336
1337 Local Variables:
1338 mode: change-log
1339 left-margin: 8
1340 fill-column: 74
1341 version-control: never
1342 End: