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