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