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