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