Automatic date update in version.in
[deliverable/binutils-gdb.git] / bfd / ChangeLog
CommitLineData
190eb1dd
L
12020-06-01 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/26067
4 * elf-bfd.h (elf_link_hash_entry): Add dyn_relocs after size.
5 * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs):
6 Updated.
7 * elf32-arc.c (elf_arc_link_hash_entry): Remove dyn_relocs.
8 (elf_arc_link_hash_newfunc): Updated.
9 * elf32-arm.c (elf32_arm_link_hash_entry): Remove dyn_relocs.
10 (elf32_arm_link_hash_newfunc): Updated.
11 (elf32_arm_copy_indirect_symbol): Likewise.
12 (elf32_arm_check_relocs): Likewise.
13 (readonly_dynrelocs): Likewise.
14 (allocate_dynrelocs_for_symbol): Likewise.
15 * elf32-csky.c (csky_elf_link_hash_entry): Remove dyn_relocs.
16 (csky_elf_link_hash_newfunc): Updated.
17 (csky_allocate_dynrelocs): Likewise.
18 (readonly_dynrelocs): Likewise.
19 (csky_elf_copy_indirect_symbol): Likewise.
20 * elf32-hppa.c (elf32_hppa_link_hash_entry): Remove dyn_relocs.
21 (hppa_link_hash_newfunc): Updated.
22 (elf32_hppa_copy_indirect_symbol): Likewise.
23 (elf32_hppa_hide_symbol): Likewise.
24 (elf32_hppa_adjust_dynamic_symbol): Likewise.
25 (allocate_dynrelocs): Likewise.
26 (elf32_hppa_relocate_section): Likewise.
27 * elf32-i386.c (elf_i386_check_relocs): Likewise.
28 * elf32-lm32.c (elf_lm32_link_hash_entry): Removed.
29 (lm32_elf_link_hash_newfunc): Likewise.
30 (lm32_elf_link_hash_table_create): Updated.
31 (readonly_dynrelocs): Likewise.
32 (allocate_dynrelocs): Likewise.
33 (lm32_elf_copy_indirect_symbol): Likewise.
34 * elf32-m32r.c (elf_m32r_link_hash_entry): Removed.
35 (m32r_elf_link_hash_newfunc): Likewise.
36 (m32r_elf_link_hash_table_create): Updated.
37 (m32r_elf_copy_indirect_symbol): Likewise.
38 (allocate_dynrelocs): Likewise.
39 * elf32-metag.c (elf_metag_link_hash_entry): Remove dyn_relocs.
40 (metag_link_hash_newfunc): Updated.
41 (elf_metag_copy_indirect_symbol): Likewise.
42 (readonly_dynrelocs): Likewise.
43 (allocate_dynrelocs): Likewise.
44 * elf32-microblaze.c (elf32_mb_link_hash_entry): Remove
45 dyn_relocs.
46 (link_hash_newfunc): Updated.
47 (microblaze_elf_check_relocs): Likewise.
48 (microblaze_elf_copy_indirect_symbol): Likewise.
49 (readonly_dynrelocs): Likewise.
50 (allocate_dynrelocs): Likewise.
51 * elf32-nds32.c (elf_nds32_link_hash_entry): Remove dyn_relocs.
52 (nds32_elf_link_hash_newfunc): Updated.
53 (nds32_elf_copy_indirect_symbol): Likewise.
54 (readonly_dynrelocs): Likewise.
55 (allocate_dynrelocs): Likewise.
56 (nds32_elf_check_relocs): Likewise.
57 * elf32-nios2.c (elf32_nios2_link_hash_entry): Remove dyn_relocs.
58 (link_hash_newfunc): Updated.
59 (nios2_elf32_copy_indirect_symbol): Likewise.
60 (nios2_elf32_check_relocs): Likewise.
61 (allocate_dynrelocs): Likewise.
62 * elf32-or1k.c (elf_or1k_link_hash_entry): Remove dyn_relocs.
63 (or1k_elf_link_hash_newfunc): Updated.
64 (readonly_dynrelocs): Likewise.
65 (allocate_dynrelocs): Likewise.
66 (or1k_elf_copy_indirect_symbol): Likewise.
67 * elf32-ppc.c (ppc_elf_link_hash_entry): Remove dyn_relocs.
68 (ppc_elf_link_hash_newfunc): Updated.
69 (ppc_elf_copy_indirect_symbol): Likewise.
70 (ppc_elf_check_relocs): Likewise.
71 (readonly_dynrelocs): Likewise.
72 (ppc_elf_adjust_dynamic_symbol): Likewise.
73 (allocate_dynrelocs): Likewise.
74 (ppc_elf_relocate_section): Likewise.
75 * elf32-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
76 (link_hash_newfunc): Updated.
77 (elf_s390_copy_indirect_symbol): Likewise.
78 (readonly_dynrelocs): Likewise.
79 (elf_s390_adjust_dynamic_symbol): Likewise.
80 (allocate_dynrelocs): Likewise.
81 * elf32-sh.c (elf_sh_link_hash_entry): Remove dyn_relocs.
82 (sh_elf_link_hash_newfunc): Updated.
83 (readonly_dynrelocs): Likewise.
84 (allocate_dynrelocs): Likewise.
85 (sh_elf_copy_indirect_symbol): Likewise.
86 (sh_elf_check_relocs): Likewise.
87 * elf32-tic6x.c (elf32_tic6x_link_hash_entry): Removed.
88 (elf32_tic6x_link_hash_newfunc): Likewise.
89 (elf32_tic6x_link_hash_table_create): Updated.
90 (readonly_dynrelocs): Likewise.
91 (elf32_tic6x_check_relocs): Likewise.
92 (elf32_tic6x_allocate_dynrelocs): Likewise.
93 * elf32-tilepro.c (tilepro_elf_link_hash_entry): Remove
94 dyn_relocs.
95 (link_hash_newfunc): Updated.
96 (tilepro_elf_copy_indirect_symbol): Likewise.
97 (tilepro_elf_check_relocs): Likewise.
98 (allocate_dynrelocs): Likewise.
99 * elf64-ppc.c (ppc_link_hash_entry): Remove dyn_relocs.
100 (ppc64_elf_copy_indirect_symbol): Updated.
101 (ppc64_elf_check_relocs): Likewise.
102 (readonly_dynrelocs): Likewise.
103 (ppc64_elf_adjust_dynamic_symbol): Likewise.
104 (dec_dynrel_count): Likewise.
105 (allocate_dynrelocs): Likewise.
106 (ppc64_elf_relocate_section): Likewise.
107 * elf64-s390.c (elf_s390_link_hash_entry): Remove dyn_relocs.
108 (link_hash_newfunc): Updated.
109 (elf_s390_copy_indirect_symbol): Likewise.
110 (readonly_dynrelocs): Likewise.
111 (allocate_dynrelocs): Likewise.
112 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
113 * elfnn-aarch64.c (elf_aarch64_link_hash_entry): Remove
114 dyn_relocs.
115 (elfNN_aarch64_link_hash_newfunc): Updated.
116 (elfNN_aarch64_copy_indirect_symbol): Likewise.
117 (readonly_dynrelocs): Likewise.
118 (need_copy_relocation_p): Likewise.
119 (elfNN_aarch64_allocate_dynrelocs): Likewise.
120 (elfNN_aarch64_allocate_ifunc_dynrelocs): Likewise.
121 * elfnn-riscv.c (riscv_elf_link_hash_entry): Remove dyn_relocs.
122 (link_hash_newfunc): Updated.
123 (riscv_elf_copy_indirect_symbol): Likewise.
124 (riscv_elf_check_relocs): Likewise.
125 (readonly_dynrelocs): Likewise.
126 (allocate_dynrelocs): Likewise.
127 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_entry): Remove
128 dyn_relocs.
129 (link_hash_newfunc): Updated.
130 (_bfd_sparc_elf_copy_indirect_symbol): Likewise.
131 (_bfd_sparc_elf_check_relocs): Likewise.
132 (readonly_dynrelocs): Likewise.
133 (allocate_dynrelocs): Likewise.
134 * elfxx-tilegx.c (tilegx_elf_link_hash_entry): Remove dyn_relocs.
135 (link_hash_newfunc): Updated.
136 (tilegx_elf_copy_indirect_symbol): Likewise.
137 (tilegx_elf_check_relocs): Likewise.
138 (readonly_dynrelocs): Likewise.
139 (allocate_dynrelocs): Likewise.
140 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
141 (readonly_dynrelocs): Likewise.
142 (_bfd_x86_elf_copy_indirect_symbol): Likewise.
143 * elfxx-x86.h (elf_x86_link_hash_entry): Remove dyn_relocs.
144
2fdb65f2
AM
1452020-06-01 Alan Modra <amodra@gmail.com>
146
147 * vms-alpha.c (_bfd_vms_slurp_etir): Check bound for the current
148 command against cmd_length, not the end of record. For
149 ETIR__C_STO_IMMR check size against cmd_length, mask repeat count
150 to 32-bits and break out on zero size. Add ETIR__C_STC_LP_PSB
151 cmd_length test.
152
12adf805
DF
1532020-05-28 David Faust <david.faust@oracle.com>
154
155 * elf64-bpf.c (bpf_elf_relocate_section): Fix handling of
156 R_BPF_INSN_{32,64} relocations.
157
66e3eb08
SC
1582020-05-28 Stephen Casner <casner@acm.org>
159
160 * pdp11.c: Implement BRD_RELOC_32 to relocate the low 16 bits of
161 addreses in .long (used in testsuites) and .stab values.
162
a6dbf402
L
1632020-05-27 H.J. Lu <hongjiu.lu@intel.com>
164
165 PR ld/22909
166 * elflink.c (bfd_elf_final_link): Use bfd_link_textrel_check.
167 Check bfd_link_dll when issue a DT_TEXTREL warning.
168 * elfxx-x86.c (maybe_set_textrel): Likewise.
169 (_bfd_x86_elf_size_dynamic_sections): Likewise.
170
9e7cb4c3
NC
1712020-05-26 Nick Clifton <nickc@redhat.com>
172
173 * plugin.c (try_load_plugin): Extend error message when a plugin
174 fails to open.
175
c892b447
AM
1762020-05-23 Alan Modra <amodra@gmail.com>
177
178 * bfdio.c (bfd_get_file_size): Don't segfault on NULL arch_header.
179
6f3fe02b
AM
1802020-05-22 Alan Modra <amodra@gmail.com>
181
182 PR 25882
183 * elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Don't init FP
184 attributes from shared libraries, and do not return an error if
185 they don't match.
186
0490dd41
AM
1872020-05-21 Alan Modra <amodra@gmail.com>
188
189 PR 25993
190 * opncls.c (_bfd_free_cached_info): Keep a copy of the bfd
191 filename.
192 (_bfd_delete_bfd): Free the copy.
193 (_bfd_new_bfd): Free nbfd->memory on error.
194
c9594989
AM
1952020-05-21 Alan Modra <amodra@gmail.com>
196
197 * aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout.
198 * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c,
199 * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c,
200 * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c,
201 * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c,
202 * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c,
203 * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c,
204 * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c,
205 * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c,
206 * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c,
207 * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c,
208 * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c,
209 * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c,
210 * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c
211 * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h,
212 * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c,
213 * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c,
214 * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c,
215 * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c,
216 * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
217
8f595e9b
NC
2182020-05-20 Nelson Chu <nelson.chu@sifive.com>
219
220 * elfxx-riscv.h (riscv_parse_subset_t): Add new callback function
221 get_default_version. It is used to find the default version for
222 the specific extension.
223 * elfxx-riscv.c (riscv_parsing_subset_version): Remove the parameters
224 default_major_version and default_minor_version. Add new bfd_boolean
225 parameter *use_default_version. Set it to TRUE if we need to call
226 the callback rps->get_default_version to find the default version.
227 (riscv_parse_std_ext): Call rps->get_default_version if we fail to find
228 the default version in riscv_parsing_subset_version, and then call
229 riscv_add_subset to add the subset into subset list.
230 (riscv_parse_prefixed_ext): Likewise.
231 (riscv_std_z_ext_strtab): Support Zicsr extensions.
232 * elfnn-riscv.c (riscv_merge_std_ext): Use strcasecmp to compare the
233 strings rather than characters.
234 riscv_merge_arch_attr_info): The callback function get_default_version
235 is only needed for assembler, so set it to NULL int the linker.
236 * elfxx-riscv.c (riscv_estimate_digit): Remove the static.
237 * elfxx-riscv.h: Updated.
238
7b958a48
AM
2392020-05-20 Alan Modra <amodra@gmail.com>
240
241 PR 25993
242 * archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
243 use bfd_set_filename.
244 * elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
245 * mach-o.c (bfd_mach_o_fat_member_init): Likewise.
246 * opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
247 (bfd_create): Likewise.
248 (_bfd_delete_bfd): Don't free filename.
249 (bfd_set_filename): Copy filename param to bfd_alloc'd memory,
250 return pointer to the copy or NULL on alloc fail.
251 * vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
252 result of bfd_set_filename.
253 * bfd-in2.h: Regenerate.
254
3c568b8a
AM
2552020-05-20 Alan Modra <amodra@gmail.com>
256
257 PR 26011
258 * elf.c (_bfd_elf_get_reloc_upper_bound): Sanity check reloc
259 section size against file size.
260 (_bfd_elf_get_dynamic_reloc_upper_bound): Likewise.
261
6fd1d259
GN
2622020-05-19 Gunther Nikl <gnikl@justmail.de>
263
264 PR 26005
11c0dd51
NC
265 * elf.c (bfd_section_from_shdr): Replace bfd_zmalloc with bfd_malloc
266 and memset when allocating memory for the sections_being_created
267 array.
6fd1d259 268
7e94cf6c
SH
2692020-05-19 Stafford Horne <shorne@gmail.com>
270
271 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela
272 to relgot.
273 (or1k_elf_relocate_section): Access srelgot via
274 htab->root.srelgot. Add assertions for srelgot->contents.
275 Introduce local variable for srelgot to not reuse global
276 sreloc.
277 (or1k_elf_relocate_section): Fixup dynamic symbol detection.
278 (or1k_set_got_and_rela_sizes): New function.
279 (or1k_initial_exec_offset): New function.
280 (TLS_GD, TLS_IE, TLS_LD, TLS_LE): Redefine macros as masks.
281 (or1k_elf_relocate_section): Allow for TLS to handle multiple
282 model access.
283 (or1k_elf_check_relocs): Use OR to set TLS access.
284 (allocate_dynrelocs): Use or1k_set_got_and_rela_sizes to set
285 sizes.
286 (or1k_elf_size_dynamic_sections): Use
287 or1k_set_got_and_rela_sizes to set sizes.
288 (or1k_elf_relocate_section): Fixup PCREL relocation calculation.
289 (TCB_SIZE): New macro.
290 (tpoff): Use TCB_SIZE and alignment to calculate offset.
291 (allocate_dynrelocs, readonly_dynrelocs, or1k_elf_check_relocs)
292 (or1k_elf_size_dynamic_sections): Rename p to sec_relocs.
293 (allocate_dynrelocs): Rename s to splt or sgot based on usage.
294 (tpoff): Add dynamic boolean argument.
295 (or1k_elf_relocate_section): Pass dynamic flag to tpoff.
296
7e057737
SP
2972020-05-19 Siddhesh Poyarekar <siddesh.poyarekar@arm.com>
298
299 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Club
300 BFD_RELOC_AARCH64_BRANCH19 and BFD_RELOC_AARCH64_TSTBR14
301 cases with BFD_RELOC_AARCH64_JUMP26.
302 (elfNN_aarch64_check_relocs): Likewise.
303
765cf5f6
AM
3042020-05-19 Alan Modra <amodra@gmail.com>
305
306 * aix5ppc-core.c (xcoff64_core_file_matches_executable_p): Use
307 bfd_get_filename rather than accessing bfd->filename directly.
308 * aout-target.h (MY (object_p)): Likewise.
309 * aoutx.h (aout_find_nearest_line, aout_link_write_symbols): Likewise.
310 * archive.c (find_nested_archive, _bfd_generic_read_ar_hdr_mag),
311 (_bfd_construct_extended_name_table, _bfd_bsd44_write_ar_hdr),
312 (_bfd_archive_bsd44_construct_extended_name_table),
313 (_bfd_write_archive_contents, _bfd_compute_and_write_armap),
314 (_bfd_bsd_write_armap): Likewise.
315 * bfd.c (bfd_errmsg, _bfd_doprnt): Likewise.
316 * cache.c (bfd_open_file): Likewise.
317 * ecoff.c (_bfd_ecoff_write_armap): Likewise.
318 * ecofflink.c (bfd_ecoff_debug_accumulate_other): Likewise.
319 * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
320 * elf32-frv.c (elf32_frv_relocate_section): Likewise.
321 * elf32-hppa.c (elf32_hppa_final_link): Likewise.
322 * elf32-nds32.c (nds32_elf_output_symbol_hook),
323 (patch_tls_desc_to_ie): Likewise.
324 * elf32-spu.c (sort_bfds, print_one_overlay_section),
325 (spu_elf_auto_overlay): Likewise.
326 * elf64-hppa.c (elf_hppa_final_link): Likewise.
327 * elf64-ia64-vms.c (elf64_ia64_size_dynamic_sections): Likewise.
328 * elfcore.h (elf_core_file_matches_executable_p): Likewise.
329 * elflink.c (bfd_elf_size_dynamic_sections),
330 (elf_link_input_bfd): Likewise.
331 * linker.c (_bfd_generic_link_output_symbols): Likewise.
332 * mach-o.c (bfd_mach_o_follow_dsym),
333 (bfd_mach_o_close_and_cleanup): Likewise.
334 * opncls.c (_bfd_delete_bfd, _maybe_make_executable),
335 (find_separate_debug_file, get_build_id_name): Likewise.
336 * pdp11.c (aout_find_nearest_line, aout_link_write_symbols): Likewise.
337 * plugin.c (bfd_plugin_open_input): Likewise.
338 * rs6000-core.c (rs6000coff_core_file_matches_executable_p): Likewise.
339 * som.c (som_write_armap): Likewise.
340 * srec.c (srec_write_record, srec_write_symbols): Likewise.
341 * vms-lib.c (_bfd_vms_lib_get_imagelib_file),
342 (_bfd_vms_lib_write_archive_contents): Likewise.
343 * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
344
39a1432c
AM
3452020-05-19 Alan Modra <amodra@gmail.com>
346
347 PR 25713
348 * bfdio.c (_bfd_real_fopen): Typo fix.
349
ed02cdb5
NC
3502020-05-18 Nick Clifton <nickc@redhat.com>
351
352 PR 26005
353 * elf.c (bfd_section_from_shdr): Use bfd_malloc to allocate memory
354 for the sections_being_created array.
355
7a87e9c8
AM
3562020-05-18 Alan Modra <amodra@gmail.com>
357
358 * ecoff.c (ecoff_slurp_reloc_table): Malloc external_relocs so
359 they can be freed without also freeing internal_relocs.
360
ca859a89
JC
3612020-05-18 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
362
363 PR 25713
364 * bfdio.c (_bfd_real_fopen): Convert UNIX style sirectory
365 separators into DOS style when creating a WIN32 fullpath.
366
fc46e8bd
NC
3672020-05-14 Nelson Chu <nelson.chu@sifive.com>
368
369 * elfnn-riscv.c (elfNN_riscv_mkobject): New function. We need this
370 to initialize RISC-V tdata.
371
533f049e
GN
3722020-05-12 Gunther Nikl <gnikl@justmail.de>
373
374 * aoutx.h (NAME (aout, swap_std_reloc_out)): Reject an unsupported
375 relocation size.
376
94ba9882
AM
3772020-05-11 Alan Modra <amodra@gmail.com>
378
379 * elf64-ppc.c (xlate_pcrel_opt): Handle lxvp and stxvp.
380
7c1f4227
AM
3812020-05-11 Alan Modra <amodra@gmail.com>
382
383 * elf64-ppc.c: Rename powerxx to power10 throughout.
384
4d5acb1e
AM
3852020-05-11 Alan Modra <amodra@gmail.com>
386
387 PR 25961
388 * coffgen.c (coff_get_normalized_symtab): Check that buffer
389 contains required number of auxents before processing any auxent.
390 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
391 file name from auxents for PE.
392
7242fa8a
GN
3932020-05-04 Gunther Nikl <gnikl@justmail.de>
394
395 * aout-cris.c (DEFAULT_ARCH): Delete define.
396 (MY_set_arch_mach): Likewise.
397 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
398 of bfd_arch_cris.
399 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
400 of r_type before the shift.
401
4022020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
cff69cf4
WD
403
404 PR ld/25665
405 * elfnn-aarch64.c (group_sections): Copy implementation from
406 elf32-arm.c.
407
a2714d6c
AM
4082020-05-01 Alan Modra <amodra@gmail.com>
409
410 PR 25900
411 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
412 accessing root.u.def of symbols. Also check root.u.def.section
413 is non-NULL. Reverse tests so as to make the logic positive.
414
a8acd6ee
AM
4152020-05-01 Alan Modra <amodra@gmail.com>
416
417 PR 25882
418 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
419 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
420
6b728d32
AM
4212020-05-01 Alan Modra <amodra@gmail.com>
422
423 PR 25882
424 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
425 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
426 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
427 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
428 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
429 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
430 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
431 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
432 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
433 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
434
91ed9b71
AM
4352020-05-01 Alan Modra <amodra@gmail.com>
436
437 PR 25882
438 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
439 from shared libraries.
440
d548f47d
MF
4412020-04-29 Max Filippov <jcmvbkbc@gmail.com>
442
443 * elf32-xtensa.c (relax_section): Don't negate diff_value for
444 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
445 equals 0. Report overflow when the result has negative sign but
446 all significant bits are zero.
447
dfa85db1
GN
4482020-04-29 Gunther Nikl <gnikl@justmail.de>
449
450 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
451 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
452
48e5bada
AM
4532020-04-28 Alan Modra <amodra@gmail.com>
454
455 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
456 Emit warning message.
457
251dae91
TC
4582020-04-27 Tamar Christina <tamar.christina@arm.com>
459
460 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
461 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
462 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
463 to x86_64_pe_big_vec as it not a big-endian format.
464 (vec i386_pe_big_vec): New.
465 * configure.ac: Likewise.
466 * targets.c: Likewise.
467 * configure: Regenerate.
468 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
469 COFF_WITH_PE_BIGOBJ): New.
470 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
471 New.
472 (x86_64_pe_be_vec): Moved.
473
27456742
AK
4742020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
475
476 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
477 * elf.c (elfcore_grok_arc_v2): New function.
478 (elfcore_grok_note): Call the new function to handle the corresponding
479 note.
480 (elfcore_write_arc_v2): New function.
481 (elfcore_write_register_note): Call the new function to handle the
482 corresponding pseudo-sections.
483
30ce8e47
MF
4842020-04-22 Max Filippov <jcmvbkbc@gmail.com>
485
486 PR ld/25861
487 * bfd-in2.h: Regenerated.
488 * elf32-xtensa.c (elf_howto_table): New entries for
489 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
490 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
491 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
492 R_XTENSA_NDIFF{8,16,32}.
493 * libbfd.h (bfd_reloc_code_real_names): Add names for
494 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
495 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
496 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
497 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
498
c36876fe
TC
4992020-04-21 Tamar Christina <tamar.christina@arm.com>
500
501 PR binutils/24753
502 * compress.c (bfd_get_full_section_contents): Exclude sections with no
503 content.
504
6f6fd151
L
5052020-04-21 H.J. Lu <hongjiu.lu@intel.com>
506
507 PR ld/25849
508 * elf-bfd.h (elf_backend_data): Add
509 elf_backend_strip_zero_sized_dynamic_sections.
510 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
511 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
512 New macro.
513 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
514 function.
515 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
516 New macro.
517 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
518
1f7f2abb
L
5192020-04-21 H.J. Lu <hongjiu.lu@intel.com>
520
521 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
522 sec.
523 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
524 DT_TEXTREL with -M.
525 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
526
e04f33c0
NC
5272020-04-21 Nick Clifton <nickc@redhat.com>
528
529 * po/sr.po: Updated Serbian translation.
530
fad3d2c1
AM
5312020-04-21 Alan Modra <amodra@gmail.com>
532
533 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
534 processing.
535
23c8270e
SC
5362020-04-20 Stephen Casner <casner@acm.org>
537
538 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
539 causing globals from linker script to be treated as debug symbols.
540 (translate_symbol_table): Don't sign-extend symbol values from 16
541 to 64 bits in nm output.
542
2efec98b
AM
5432020-04-20 Alan Modra <amodra@gmail.com>
544
545 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
546
18f97353
AM
5472020-04-18 Alan Modra <amodra@gmail.com>
548
549 * section.c (bfd_is_const_section): Correct test for special
550 sections.
551 * bfd-in2.h: Regenerate.
552
8d55d10a
AM
5532020-04-17 Alan Modra <amodra@gmail.com>
554
555 PR 25842
556 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
557 NULL nodename.
558
8e4979ac
NC
5592020-04-16 Nick Clifton <nickc@redhat.com>
560
561 PR 25803
562 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
563 abort with a more helpful error message.
564
aec72fda
AM
5652020-04-16 Alan Modra <amodra@gmail.com>
566
567 PR 25827
568 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
569 strdup(0).
570
95a51568
FS
5712020-04-15 Fangrui Song <maskray@google.com>
572
573 PR binutils/24613
574 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
575 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
576 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
577 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
578 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
579 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
580 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
581 * elf32-sh.c (sh_elf_relocate_section): Likewise.
582 * elf32-spu.c (spu_elf_relocate_section): Likewise.
583 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
584 * elflink.c (elf_link_output_extsym): Likewise.
585 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
586
7ecb5154
AM
5872020-04-15 Alan Modra <amodra@gmail.com>
588
589 PR 25823
590 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
591 pointer into strings that may be freed for section name, always
592 allocate a new string.
593
f717994f
JMG
5942020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
595 Jan W. Jagersma <jwjagersma@gmail.com>
596
597 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
598 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
599 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
600 (_bfd_go32_mkobject): New functions.
601 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
602 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
603 (go32exe_mkobject): Call _bfd_go32_mkobject.
604 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
605 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
606 and COFF_GO32.
607 (coff_write_relocs): Enable extended reloc counter code if
608 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
609 (coff_write_object_contents): Likewise. Pad section headers
610 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
611 instead of coff_swap_scnhdr_out.
612 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
613 enable extended reloc counter.
614 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
615 Declare with ATTRIBUTE_UNUSED.
616 * libcoff-in.h: (struct coff_tdata): New field go32.
617 (obj_go32): Define.
618 * libcoff.h: Regenerate.
619
34ca5531
FS
6202020-04-14 Fangrui Song <maskray@google.com>
621
622 PR gas/25768
623 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
624 12.
625
fa1477dc
SC
6262020-04-14 Stephen Casner <casner@acm.org>
627
628 PR ld/25677
629 * pdp11.c: Add implementation of --imagic option.
630 (adjust_o_magic): Fix objcopy --extract-symbol test.
631 * libaout.h (enum aout_magic): Add i_magic.
632
a0543b0b
RO
6332020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
634 Nick Clifton <nickc@redhat.com>
635
636 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
637 <0>: Ignore.
638 <default>: Error rather than abort.
639
3349112e
L
6402020-04-03 H.J. Lu <hongjiu.lu@intel.com>
641
642 PR ld/25767
643 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
644 relocation section from section group.
645
4d095f5b
JJ
6462020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
647
648 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
649 bfd->origin to file offset.
650 * bfdwin.c (bfd_get_file_window): Likewise.
651 * bfd.c: Clarify the use of the bfd->origin field.
652 * bfd-in2.h: Regenerate.
653 * coff-i386.c: Don't include go32exe.h. Allow overriding
654 coff_write_object_contents via COFF_WRITE_CONTENTS.
655 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
656 (go32exe_write_object_contents): New functions.
657 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
658 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
659 (create_go32_stub): Remove check for 2k size limit. Read stub
660 from go32exe_temp_stub if present.
661 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
662 copy variable-length stub.
663 (go32_check_format): Read stub to go32exe_temp_stub, set
664 origin, return go32exe_cleanup.
665 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
666 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
667 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
668 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
669 Remove functions and their associated #defines.
670 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
671 * libcoff-in.h: (struct coff_tdata): New field stub_size.
672 Rename field go32stub to stub.
673 * libcoff.h: Regenerate.
674 * coff-stgo32.c (go32_check_format): Rename to...
675 (go32exe_check_format): ...this.
676 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
677 (go32exe_copy_private_bfd_data): ...this.
678 (stub_bytes): Rename to...
679 (go32exe_default_stub): ...this.
680 (create_go32_stub): Rename to...
681 (go32exe_create_stub): ...this.
682 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
683 when possible.
684
382aae06
L
6852020-04-01 H.J. Lu <hongjiu.lu@intel.com>
686
687 PR ld/25749
688 PR ld/25754
689 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
690 relocation to R_386_32 for relocation against non-preemptible
691 absolute symbol.
692 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
693 allocate dynamic relocation for non-preemptible absolute symbol.
694 (elf_i386_relocate_section): Pass sec to
695 GENERATE_DYNAMIC_RELOCATION_P.
696 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
697 (elf_x86_64_convert_load_reloc): Covert load relocation to
698 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
699 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
700 for non-preemptible absolute symbol if they overflow.
701 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
702 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
703 symbol. Don't allocate dynamic relocation for non-preemptible
704 absolute symbol.
705 (elf_x86_64_relocate_section): Don't generate relative relocation
706 for GOTPCREL relocations aganst local absolute symbol. Pass sec
707 to GENERATE_DYNAMIC_RELOCATION_P.
708 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
709 against non-preemptible absolute symbol.
710 (_bfd_elf_x86_valid_reloc_p): New function.
711 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
712 GOT_ABS GOT slot.
713 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
714 argument. Don't generate dynamic relocation against
715 non-preemptible absolute symbol.
716 (ABS_SYMBOL_P): New.
717 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
718 against non-preemptible absolute symbol.
719 (GOT_ABS): New.
720 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
721 (_bfd_elf_x86_valid_reloc_p): New.
722
a7618269
TC
7232020-04-01 Tamar Christina <tamar.christina@arm.com>
724
725 PR ld/16017
726 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
727 address in the GOT if in thumb only mode.
728
15ccbdd7
TC
7292020-04-01 Tamar Christina <tamar.christina@arm.com>
730
731 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
732
7b948a25
HPN
7332020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
734
735 * mmo.c (mmo_scan): Create .text section only when needed, not
736 from the start.
737
89b599df
AM
7382020-03-31 Alan Modra <amodra@gmail.com>
739
740 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
741 return value check.
742
81699544
AM
7432020-03-31 Alan Modra <amodra@gmail.com>
744
745 * vms-alpha.c (image_write): Check bounds for sections without
746 contents too. Error on non-zero write to section without
747 contents.
748 (_bfd_vms_slurp_etir): Check return of image_write* functions.
749
b3b360de
AM
7502020-03-31 Alan Modra <amodra@gmail.com>
751
752 * tekhex.c (pass_over): Check is_eof before reading buffer.
753
00386881
NC
7542020-03-30 Nick Clifton <nickc@redhat.com>
755
756 PR binutils/pr25662
757 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
758 field to timestamp and make it an integer.
759 * libcoff.h: Regenerate.
760 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
761 field in the pe_data structure rather than the insert_timestamp
762 field.
763
988b7300
AM
7642020-03-30 Alan Modra <amodra@gmail.com>
765
766 PR 25745
767 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
768 statistics message.
769
aa49fc22
NC
7702020-03-26 Nick Clifton <nickc@redhat.com>
771
772 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
773 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
774 prototype.
775 * libbfd.h: Regenerate.
776
ff768510
AM
7772020-03-26 Alan Modra <amodra@gmail.com>
778
779 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
780
f75fbe8a
AM
7812020-03-26 Alan Modra <amodra@gmail.com>
782
783 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
784 array.
785 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
786
aac88046
NC
7872020-03-25 Nick Clifton <nickc@redhat.com>
788
789 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
790 function.
791 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
792 * libbfd.h: Regenerate.
793
cf2611fe
SV
7942020-03-25 Shahab Vahedi <shahab@synopsys.com>
795
796 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
797 correct field name in the output string.
798
d16e3d2e
AM
7992020-03-25 Alan Modra <amodra@gmail.com>
800
801 PR 25662
802 * elf.c (assign_file_positions_for_load_sections): Adjust offset
803 for SHT_NOBITS section if first in segment.
804
1081065c
L
8052020-03-24 H.J. Lu <hongjiu.lu@intel.com>
806
807 PR binutils/25708
808 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
809 (_bfd_elf_get_symbol_version_string): This.
810 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
811 (_bfd_elf_get_symbol_version_string): This.
812 (bfd_elf_print_symbol): Pass TRUE to
813 _bfd_elf_get_symbol_version_string.
814 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
815 bfd_boolean argument.
816 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
817 * targets.c (_bfd_get_symbol_version_string): Likewise.
818 (bfd_get_symbol_version_string): Likewise.
819 * bfd-in2.h: Regenerated.
820
0b8448af 8212020-03-24 Nick Clifton <nickc@redhat.com>
e11cd7c4 822 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
0b8448af
NC
823
824 PR 25713
825 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
826 Win32 systems.
827
ec2e748a
NC
8282020-03-24 Nick Clifton <nickc@redhat.com>
829
830 PR 25681
831 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
832 segment to use for PT_GNU_RELRO, ignore empty sections in a
833 segment's current list.
834
cda7e560
L
8352020-03-24 H.J. Lu <hongjiu.lu@intel.com>
836
837 PR binutils/25717
838 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
839
7e6e972f
L
8402020-03-24 H.J. Lu <hongjiu.lu@intel.com>
841
842 PR binutils/25708
843 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
844 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
845 on the previous _bfd_elf_get_symbol_version_string.
846 (_bfd_elf_get_symbol_version_string): Use it.
847
65109548
AM
8482020-03-24 Alan Modra <amodra@gmail.com>
849
850 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
851 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
852 struct areltdata.
853
fdde2fb6
SH
8542020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
855
856 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
857
cf28cfef
AM
8582020-03-23 Alan Modra <amodra@gmail.com>
859
860 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
861 symbol count. Allocate an extra byte to ensure name strings
862 are terminated. Sanity check name offsets. Release memory on
863 error return.
864
5e737279
AM
8652020-03-23 Alan Modra <amodra@gmail.com>
866
867 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
868 field hasn't been read. Remove unnecessary casts.
869
c15a8f17
AM
8702020-03-22 Alan Modra <amodra@gmail.com>
871
872 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
873 enough to read number of symbols.
874
3d98c460
L
8752020-03-20 H.J. Lu <hongjiu.lu@intel.com>
876
877 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
878 (EXECUTABLE_SUFFIX): Likewise.
879 * config.in: Regenerated.
880 * configure: Likewise.
881 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
882 _bfd_generic_close_and_cleanup.
883 (plugin_list_entry): Remove resolution_file, resolution_option,
884 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
885 lto_wrapper, gcc_env and initialized,
886 (need_lto_wrapper_p): Removed.
887 (get_lto_wrapper): Likewise.
888 (setup_lto_wrapper_env): Likewise.
889 (register_all_symbols_read): Likewise.
890 (egister_cleanup): Likewise.
891 (get_symbols): Likewise.
892 (add_input_file): Likewise.
893 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
894 (add_symbols): Updated.
895 (try_claim): Likewise.
896 (try_load_plugin): Likewise.
897 (bfd_plugin_canonicalize_symtab): Likewise.
898 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
899 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
900
c3a1714c
L
9012020-03-19 H.J. Lu <hongjiu.lu@intel.com>
902
903 PR binutils/25640
904 * plugin.c (plugin_list_entry): Add has_symbol_type.
905 (add_symbols_v2): New function.
906 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
907 provides symbol type.
908 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
909 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
910 available.
911
67338173
AM
9122020-03-20 Alan Modra <amodra@gmail.com>
913
914 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
915 enough to read number of symbols.
916
a859124d
AM
9172020-03-20 Alan Modra <amodra@gmail.com>
918
919 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
920 backend functions for NULL before calling.
921 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
922 (bfd_section_from_shdr, assign_section_numbers): Likewise.
923 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
924 * elfnn-ia64.c (ignore_errors): New function.
925 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
926
f3a08f77
NC
9272020-03-19 Nick Clifton <nickc@redhat.com>
928
929 PR 25676
930 * dwarf2.c (struct varinfo): Add unit_offset field to record the
931 location of the varinfo in the unit's debug info data. Change the
932 type of the stack field to a boolean.
933 (lookup_var_by_offset): New function. Returns the varinfo
934 structure for the variable described at the given offset in the
935 unit's debug info.
936 (scan_unit_for_symbols): Add support for variables which have the
937 DW_AT_specification attribute.
938
6a541707
NC
9392020-03-19 Nick Clifton <nickc@redhat.com>
940
941 PR 25699
942 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
943 error return.
944
effc14f5
SH
9452020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
946
947 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
948
ac4bf06c
NC
9492020-03-18 Nick Clifton <nickc@redhat.com>
950
951 PR 25673
952 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
953 memory access when processing a corrupt secondary reloc section.
954
53215f21
CL
9552020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
956
957 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
958 instead of calling abort.
959 * elf32-csky.c (csky_build_one_stub): Likewise.
960 * elf32-hppa.c (hppa_build_one_stub): Likewise.
961 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
962 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
963 * elf32-metag.c (metag_build_one_stub): Likewise.
964 * elf32-nios2.c (nios2_build_one_stub): Likewise.
965 * elf64-ppc.c (ppc_build_one_stub): Likewise.
966 (ppc_size_one_stub): Likewise.
967 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
968
327ef784
NC
9692020-03-17 Nick Clifton <nickc@redhat.com>
970
d3c3c542 971 PR 25688
327ef784
NC
972 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
973 with error messages.
974
ecbbbdba
NC
9752020-03-17 Nick Clifton <nickc@redhat.com>
976
977 PR 25687
978 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
979 free. Add free on another failure path.
980
4b3ecb3b
AM
9812020-03-16 Alan Modra <amodra@gmail.com>
982
983 PR 25675
984 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
985 we have a non-zero section count. Do lma comparison in octets.
986
7bac4137
AM
9872020-03-16 Alan Modra <amodra@gmail.com>
988
989 * vms-alpha.c (dst_restore_location): Validate index into
990 dst_ptr_offsets array before accessing. Return status.
991 (dst_retrieve_location): Similarly, making "loc" parameter a
992 pointer to return value.
993 (_bfd_vms_slurp_etir): Update calls to above functions.
994
8b5d0a4f
KR
9952020-03-14 Kamil Rytarowski <n54@gmx.com>
996
997 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
998 targets.
999 * configure: Regenerated.
1000
48e81d7f
AM
10012020-03-14 Alan Modra <amodra@gmail.com>
1002
1003 * section.c (BFD_FAKE_SECTIONS): Formatting.
1004 * bfd-in2.h: Regenerate.
1005
06d949ec
KR
10062020-03-13 Kamil Rytarowski <n54@gmx.com>
1007
1008 * elf.c (elfcore_grok_netbsd_note): Add support for
1009 NT_NETBSDCORE_LWPSTATUS notes.
1010
abf874aa
CL
10112020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
1012
1013 * bfd-in2.h: Regenerate.
1014 * section.c (asection): Add already_assigned field.
1015 (BFD_FAKE_SECTION): Add default initializer for it.
1016 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
1017 * elf32-arm.c (arm_build_one_stub): Add support for
1018 non_contiguous_regions.
1019 * elf32-csky.c (csky_build_one_stub): Likewise.
1020 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1021 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
1022 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
1023 * elf32-metag.c (metag_build_one_stub): Likewise.
1024 * elf32-nios2.c (nios2_build_one_stub): Likewise.
1025 * elf64-ppc.c (ppc_build_one_stub): Likewise.
1026 (ppc_size_one_stub): Likewise.
1027 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
1028 * elflink.c (elf_link_input_bfd): Likewise.
1029
74e10d17
L
10302020-03-13 H.J. Lu <hongjiu.lu@intel.com>
1031
1032 PR ld/24920
1033 * elf-linker-x86.h (elf_linker_x86_params): Add
1034 static_before_all_inputs and has_dynamic_linker.
1035 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
1036 dynamic input objects if -static is passed at command-line
1037 before all input files without --dynamic-linker unless
1038 --no-dynamic-linker is used.
1039
015ec493
KR
10402020-03-13 Kamil Rytarowski <n54@gmx.com>
1041
1042 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
1043
66631823
CE
10442020-03-13 Christian Eggers <ceggers@gmx.de>
1045
1046 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
1047 "p_paddr" from "at".
1048 * elfcode.h (bfd_from_remote_memory): Add units to several
1049 parameters. New local "opb". Fix usage of p_align. Fix
1050 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
1051 call of target_read_memory.
1052 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
1053 calculation of "offset" and "output_offset".
1054 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
1055 from "offset" and fix calculation of "end" from "vma+size". Fix
1056 comparison between "sh_addr" and "vma"/"output_offset".
1057 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
1058 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
1059 member.
1060 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
1061 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
1062 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
1063 assignment of p_paddr from phdr_lma. Fix comparison between
1064 "lma+size" and "next->lma".
1065 (elf_sort_segments): Fix assignment from p_paddr to lma.
1066 (assign_file_positions_for_load_sections): Add unit (bytes) to
1067 local "align". Fix calculation of local "off_adjust". Fix
1068 calculation of local "filehdr_vaddr".
1069 (assign_file_positions_for_non_load_sections): New local "opb".
1070 Fix calculation of "end" from "p_size". Fix comparison between
1071 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
1072 from "end" and "p_vaddr".
1073 (rewrite_elf_program_header): Fix comparison between p_vaddr and
1074 vma. Fix assignment to p_paddr from lma. Fix comparison between
1075 p_paddr and lma. Fix assignment to p_paddr from lma.
1076 * merge.c (sec_merge_emit): New local "opb". Convert
1077 "alignment_power" to octets.
1078 (_bfd_add_merge_section): New locals "alignment_power" and
1079 "opb". Fix comparison between "alignment_power" and
1080 "sizeof(align)".
1081 (_bfd_merge_sections): New local "opb". Divide size by opb
1082 before checking align mask.
1083
502794d4
CE
10842020-03-13 Christian Eggers <ceggers@gmx.de>
1085
1086 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
1087 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
1088 section LMA/VMA.
1089 (_bfd_elf_make_section_from_phdr): Similarly.
1090 (elf_fake_sections): Fix calculation of
1091 Elf_Internal_shdr::sh_addr from section VMA.
1092 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
1093 and bytes.
1094 (assign_file_positions_for_load_sections): Fix calculations of
1095 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
1096 comparison between program header address and section LMA.
1097 (assign_file_positions_for_non_load_sections): Likewise.
1098 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
1099 (IS_CONTAINED_BY_VMA): Add parameter opb.
1100 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
1101 INCLUDE_SECTION_IN_SEGMENT): Likewise.
1102 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
1103 Fix calculations of p_addr_valid and p_vaddr_offset.
1104 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
1105 with octets per byte when comparing against p_vaddr.
1106
8248d21a
AM
11072020-03-11 Alan Modra <amodra@gmail.com>
1108
1109 * som.c (setup_sections): Sanity check subspace.name.
1110
435edf0b
AM
11112020-03-11 Alan Modra <amodra@gmail.com>
1112
1113 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
1114
6b5e16ff
AM
11152020-03-10 Alan Modra <amodra@gmail.com>
1116
1117 PR 25648
1118 * ihex.c (ihex_write_object_contents): Don't assume ordering of
1119 addresses here.
1120
2f57795b
AM
11212020-03-09 Alan Modra <amodra@gmail.com>
1122
1123 * wasm-module.c (wasm_scan): Sanity check file name length
1124 before allocating memory. Move common section setup code. Do
1125 without bfd_tell to calculate section size.
1126
a0dcf297
NC
11272020-03-06 Nick Clifton <nickc@redhat.com>
1128
1129 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
1130 with error messages and failure return values.
1131
e15a8da9
MF
11322020-03-05 Max Filippov <jcmvbkbc@gmail.com>
1133
1134 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
1135 relocation sections for any removed reference to a dynamic symbol.
1136
a8e14f4c
NC
11372020-03-05 Nick Clifton <nickc@redhat.com>
1138
1139 * elf-bfd.h (struct elf_backend_data): Add new fields:
1140 init_secondary_reloc_section, slurp_secondary_reloc_section,
1141 write_secondary_reloc_section.
1142 (_bfd_elf_init_secondary_reloc_section): Prototype.
1143 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
1144 (_bfd_elf_write_secondary_reloc_section): Prototype.
1145 * elf.c ( bfd_section_from_shdr): Invoke the new
1146 init_secondary_reloc_section backend function, if defined, when a
1147 second reloc section is encountered.
1148 (swap_out_syms): Invoke the new symbol_section_index function, if
1149 defined, when computing the section index of an OS/PROC specific
1150 symbol.
1151 (_bfd_elf_init_secondary_reloc_section): New function.
1152 (_bfd_elf_slurp_secondary_reloc_section): New function.
1153 (_bfd_elf_write_secondary_reloc_section): New function.
1154 (_bfd_elf_copy_special_section_fields): New function.
1155 * elfcode.h (elf_write_relocs): Invoke the new
1156 write_secondary_relocs function, if defined, in order to emit
1157 secondary relocs.
1158 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
1159 function, if defined, in order to read in secondary relocs.
1160 * elfxx-target.h (elf_backend_copy_special_section_fields):
1161 Provide a non-NULL default definition.
1162 (elf_backend_init_secondary_reloc_section): Likewise.
1163 (elf_backend_slurp_secondary_reloc_section): Likewise.
1164 (elf_backend_write_secondary_reloc_section): Likewise.
1165 (struct elf_backend_data elfNN_bed): Add initialisers for the new
1166 fields.
1167 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
1168 * configure: Regenerate.
1169
6f8f95b4
AM
11702020-03-05 Alan Modra <amodra@gmail.com>
1171
1172 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
1173 against file size before allocating memory. Use bfd_alloc rather
1174 than bfd_zalloc for carsym/strings memory.
1175
233bf4f8
AM
11762020-03-04 Alan Modra <amodra@gmail.com>
1177
1178 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
1179 sh_addr mod sh_addalign is zero.
1180
1039fd9a
AM
11812020-03-04 Alan Modra <amodra@gmail.com>
1182
1183 * format.c (bfd_check_format_matches): Call cleanup on error exit.
1184
f5714099
AM
11852020-03-03 Alan Modra <amodra@gmail.com>
1186
1187 * format.c (struct bfd_preserve): Add cleanup field.
1188 (bfd_preserve_save): Add cleanup param and save.
1189 (bfd_preserve_restore): Return cleanup.
1190 (bfd_preserve_finish): Call the cleanup for the discarded match.
1191 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
1192 and clear when preserving a match. Restore cleanup too when
1193 restoring that match.
1194
40b35c78
AM
11952020-03-02 Alan Modra <amodra@gmail.com>
1196
1197 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
1198 * hpux-core.c (hpux_core_core_file_p): Update prototype.
1199 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
1200 (core_sco5_vec): Correct initialisers.
1201
601b73d5
AM
12022020-03-02 Alan Modra <amodra@gmail.com>
1203
1204 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
1205 * aix5ppc-core.c (xcoff64_core_p): Likewise.
1206 * cisco-core.c (cisco_core_file_validate): Likewise.
1207 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
1208 * hpux-core.c (hpux_core_core_file_p): Likewise.
1209 * irix-core.c (irix_core_core_file_p): Likewise.
1210 * lynx-core.c (lynx_core_file_p): Likewise.
1211 * netbsd-core.c (netbsd_core_file_p): Likewise.
1212 * osf-core.c (osf_core_core_file_p): Likewise.
1213 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1214 * sco5-core.c (sco5_core_file_p): Likewise.
1215
728d32c4
L
12162020-03-02 H.J. Lu <hongjiu.lu@intel.com>
1217
1218 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
1219
cb001c0d
AM
12202020-03-02 Alan Modra <amodra@gmail.com>
1221
1222 * targets.c (bfd_cleanup): New typedef.
1223 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
1224 * libbfd-in.h (_bfd_no_cleanup): Define.
1225 * format.c (bfd_reinit): Add cleanup parameter, call it.
1226 (bfd_check_format_matches): Set cleanup from _bfd_check_format
1227 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
1228 * aout-target.h (callback, object_p): Return bfd_cleanup.
1229 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
1230 * archive.c (bfd_generic_archive_p): Likewise.
1231 * binary.c (binary_object_p): Likewise.
1232 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
1233 * coff-ia64.c (ia64coff_object_p): Likewise.
1234 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
1235 * coff-sh.c (coff_small_object_p): Likewise.
1236 * coff-stgo32.c (go32_check_format): Likewise.
1237 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
1238 (xcoff64_core_p): Likewise.
1239 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
1240 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
1241 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
1242 * elfcode.h (elf_object_p): Likewise.
1243 * elfcore.h (elf_core_file_p): Likewise.
1244 * i386msdos.c (msdos_object_p): Likewise.
1245 * ihex.c (ihex_object_p): Likewise.
1246 * libaout.h (some_aout_object_p): Likewise.
1247 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
1248 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
1249 * libbfd.c (_bfd_dummy_target): Likewise.
1250 * libcoff-in.h (coff_object_p): Likewise.
1251 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
1252 (bfd_mach_o_arm64_core_p): Likewise.
1253 * mach-o-arm.c (bfd_mach_o_arm_object_p),
1254 (bfd_mach_o_arm_core_p): Likewise.
1255 * mach-o-i386.c (bfd_mach_o_i386_object_p),
1256 (bfd_mach_o_i386_core_p): Likewise.
1257 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
1258 (bfd_mach_o_x86_64_core_p): Likewise.
1259 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
1260 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
1261 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
1262 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
1263 * mmo.c (mmo_object_p): Likewise.
1264 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1265 * peicode.h (coff_real_object_p, pe_ILF_object_p),
1266 (pe_bfd_object_p): Likewise.
1267 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
1268 * ppcboot.c (ppcboot_object_p): Likewise.
1269 * rs6000-core.c (rs6000coff_core_p): Likewise.
1270 * som.c (som_object_setup, som_object_p): Likewise.
1271 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
1272 * tekhex.c (tekhex_object_p): Likewise.
1273 * vms-alpha.c (alpha_vms_object_p): Likewise.
1274 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
1275 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
1276 * wasm-module.c (wasm_object_p): Likewise.
1277 * xsym.c (bfd_sym_object_p): Likewise.
1278 * xsym.h (bfd_sym_object_p): Likewise.
1279 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
1280 return type.
1281 * pdp11.c (some_aout_object_p): Likewise.
1282 * plugin.c (register_ld_plugin_object_p): Update object_p
1283 parameter type.
1284 * plugin.h (register_ld_plugin_object_p): Likewise.
1285 * bfd-in2.h: Regenerate.
1286 * libbfd.h: Regenerate.
1287 * libcoff.h: Regenerate.
1288
a4dd6c97
AM
12892020-03-02 Alan Modra <amodra@gmail.com>
1290
1291 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
1292 applicable section flags.
1293 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
1294 (mips_ecoff_bele_vec): Likewise.
1295 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
1296 and .sbss sections.
1297 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
1298 (_bfd_ecoff_styp_to_sec_flags): Likewise.
1299
bf577467
AM
13002020-03-02 Alan Modra <amodra@gmail.com>
1301
1302 * elf32-m32r.c (m32r_elf_section_flags): New function.
1303 (elf_backend_section_flags): Define.
1304 * elf32-nds32.c (nds32_elf_section_flags): New function.
1305 (elf_backend_section_flags): Define.
1306 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
1307 .sbss and .sdata sections.
1308 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
1309 for SHF_V850_GPREL sections.
1310 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
1311 FIXME.
1312 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
1313 for SHF_PARISC_SHORT sections.
1314 * elf64-ppc.c (ppc64_elf_section_flags): New function.
1315 (elf_backend_section_flags): Define.
1316 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
1317 for SHF_MIPS_GPREL sections. Delete FIXME.
1318
8c803a2d
AM
13192020-03-02 Alan Modra <amodra@gmail.com>
1320
1321 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
1322 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
1323 calling elf_backend_section_flags with adjusted params. Use
1324 newsect->flags past that point.
1325 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
1326 special sections.
1327 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
1328 to have their type overridden, and all sh_flags but processor and
1329 os specific.
1330 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
1331 * elf32-mep.c (mep_elf_section_flags): Likewise.
1332 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
1333 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
1334 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
1335 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
1336 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
1337 stub BFD and non-aarch64 input files when scanning for stubs.
1338
7d4b2d2d
AM
13392020-03-02 Alan Modra <amodra@gmail.com>
1340
1341 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
1342 limit to decompressed element size.
1343
26f60d59
AM
13442020-03-02 Alan Modra <amodra@gmail.com>
1345
1346 * vms-lib.c (vms_traverse_index): Add recur_count param and
1347 update calls. Fail on excessive recursion.
1348
9cb56943
AM
13492020-03-02 Alan Modra <amodra@gmail.com>
1350
1351 * vms-alpha.c (vms_get_remaining_object_record): Use
1352 bfd_realloc_or_free rather than bfd_realloc.
1353 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
1354 (dst_define_location, parse_module): Likewise, and check realloc
1355 return status before using memory. Return status from function
1356 adjusting all callers.
1357
182ec670
AM
13582020-02-28 Alan Modra <amodra@gmail.com>
1359
1360 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
1361
1b088c82
AM
13622020-02-28 Alan Modra <amodra@gmail.com>
1363
1364 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
1365 Remove duplicate undersize check.
1366
5f602802
AM
13672020-02-27 Alan Modra <amodra@gmail.com>
1368
1369 PR 24511
1370 * mmo.c (mmo_scan): Set SEC_DATA for .data.
1371
49d9fd42
AM
13722020-02-27 Alan Modra <amodra@gmail.com>
1373
1374 PR 24511
1375 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
1376 (coff_section_type): Adjust comment.
1377 (decode_section_type): Likewise. Call coff_section_type before
1378 decode_section_type.
1379 (bfd_decode_symclass): Use 'c' for common sections other than
1380 the standard one.
1381
05f52dc2
AM
13822020-02-27 Alan Modra <amodra@gmail.com>
1383
1384 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1385 malloc'd block.
1386
ff69a894
AM
13872020-02-27 Alan Modra <amodra@gmail.com>
1388
1389 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1390 if file is an archive element.
1391 * bfd-in2.h: Regenerate.
1392
02f7e7ee
AM
13932020-02-26 Alan Modra <amodra@gmail.com>
1394
1395 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1396 bfd_set_error on failing test. Don't bother changing bfd_error on
1397 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1398 Check sym name is within string buffer. Use size_t for some vars.
1399 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1400 int_buf. Don't change bfd_error on file read error. Use
1401 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1402 calculations to catch overflows before they occur. malloc and
1403 free raw armap rather than using bfd_alloc. Read raw armap before
1404 allocating carsym+strings buffer.
1405 (_bfd_slurp_extended_name_table): Localize variables. Check
1406 name size against file size.
1407
cc4c4f40
AM
14082020-02-26 Alan Modra <amodra@gmail.com>
1409
1410 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1411
e0b317de
AM
14122020-02-26 Alan Modra <amodra@gmail.com>
1413
1414 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1415 malloc. Check for NULL return from bfd_malloc.
1416 (rx_table_find, rx_table_map): Likewise.
1417 (rx_set_section_contents): Check bfd_alloc return.
1418 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1419
dc1e8a47
AM
14202020-02-26 Alan Modra <amodra@gmail.com>
1421
1422 * aoutx.h: Indent labels correctly. Format error strings.
1423 * archive.c: Likewise.
1424 * archive64.c: Likewise.
1425 * coff-arm.c: Likewise.
1426 * coff-rs6000.c: Likewise.
1427 * coff-stgo32.c: Likewise.
1428 * cpu-arm.c: Likewise.
1429 * dwarf2.c: Likewise.
1430 * elf-ifunc.c: Likewise.
1431 * elf-properties.c: Likewise.
1432 * elf-s390-common.c: Likewise.
1433 * elf-strtab.c: Likewise.
1434 * elf.c: Likewise.
1435 * elf32-arm.c: Likewise.
1436 * elf32-bfin.c: Likewise.
1437 * elf32-cr16.c: Likewise.
1438 * elf32-csky.c: Likewise.
1439 * elf32-i386.c: Likewise.
1440 * elf32-m68k.c: Likewise.
1441 * elf32-msp430.c: Likewise.
1442 * elf32-nds32.c: Likewise.
1443 * elf32-nios2.c: Likewise.
1444 * elf32-pru.c: Likewise.
1445 * elf32-xtensa.c: Likewise.
1446 * elf64-ia64-vms.c: Likewise.
1447 * elf64-x86-64.c: Likewise.
1448 * elfcode.h: Likewise.
1449 * elfcore.h: Likewise.
1450 * elflink.c: Likewise.
1451 * elfnn-aarch64.c: Likewise.
1452 * elfnn-ia64.c: Likewise.
1453 * elfnn-riscv.c: Likewise.
1454 * elfxx-mips.c: Likewise.
1455 * elfxx-sparc.c: Likewise.
1456 * elfxx-x86.c: Likewise.
1457 * i386lynx.c: Likewise.
1458 * merge.c: Likewise.
1459 * pdp11.c: Likewise.
1460 * plugin.c: Likewise.
1461 * reloc.c: Likewise.
1462
e310298c
AM
14632020-02-26 Alan Modra <amodra@gmail.com>
1464
1465 PR 25593
1466 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1467 "dyn_loaded".
1468 (bfd_elf_add_dt_needed_tag): Declare.
1469 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1470 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1471 from elf_add_dt_needed_tag. Remove soname and doit param.
1472 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1473 to see whether as-needed lib is already loaded, use dyn_loaded
1474 list instead. When saving and restoring around as-needed lib
1475 handle possibility that dynstr has not been initialised. Don't
1476 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1477 Mark libs loaded via DT_NEEDED entries of other libs with
1478 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1479 the output.
1480 (elf_link_check_versioned_symbol): Remove now unneccesary
1481 DYNAMIC check when traversing dyn_loaded list.
1482
b570b954
AM
14832020-02-26 Alan Modra <amodra@gmail.com>
1484
1485 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1486
ecda9016
L
14872020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1488
1489 PR binutils/25584
1490 * plugin.c (need_lto_wrapper_p): New.
1491 (bfd_plugin_set_program_name): Add an int argument to set
1492 need_lto_wrapper_p.
1493 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1494 set.
1495 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1496
a98c743f
AM
14972020-02-24 Alan Modra <amodra@gmail.com>
1498
1499 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1500
c893ce36
AM
15012020-02-24 Alan Modra <amodra@gmail.com>
1502
1503 * vms-lib.c (struct carsym_mem): Add limit.
1504 (vms_add_index): Heed limit.
1505 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1506 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1507 Always return actual number read.
1508 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1509 assertion with error exit.
1510
7b3c2715
AM
15112020-02-22 Alan Modra <amodra@gmail.com>
1512
1513 PR 25585
1514 * elf.c (assign_file_positions_for_load_sections): Continue linking
1515 on "PHDR segment not covered by LOAD segment" errors.
1516
a4425a57
AM
15172020-02-21 Alan Modra <amodra@gmail.com>
1518
1519 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1520 overflow check.
1521 (bfd_mach_o_canonicalize_reloc): Likewise.
1522 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1523 counts and offsets against file size.
1524 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1525 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1526 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1527 against file size. Delete symbol table error message.
1528 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1529 against file size.
1530 (bfd_mach_o_read_symtab): Likewise.
1531 (bfd_mach_o_read_command): Pass file size.
1532 (bfd_mach_o_scan): Sanity check command count against file size.
1533
dda2980f
AM
15342020-02-21 Alan Modra <amodra@gmail.com>
1535
1536 PR 25569
1537 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1538 "text", "data" and "bss" section pointer vars. Don't update
1539 section size, just exec header sizes.
1540 (adjust_sizes_and_vmas): Don't update text section size. Set
1541 initial exec header a_text. Print exec headers sizes.
1542 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1543 (adjust_sizes_and_vmas): Similarly. Formatting.
1544 (final_link): Correct final file extension.
1545
00e49dff
NC
15462020-02-20 Nick Clifton <nickc@redhat.com>
1547
1548 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1549 callback.
1550 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1551 default definition.
1552 (elfNN_bed): Initialise the symbol_section_index field.
1553 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1554 OS and PROC specific section indicies. Warn if converting other
1555 reserved incidies to SHN_ABS.
1556
fcaaac0a
SB
15572020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1558
1559 PR 25537
1560 * cpu-z80.c: Add machine type compatibility checking.
1561
dcf06b89
L
15622020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1563
1564 PR binutils/25355
1565 * plugin.c (plugin_list_entry): Remove handle.
1566 (try_load_plugin): Call dlclose before return.
1567
2c7c5554
AM
15682020-02-19 Alan Modra <amodra@gmail.com>
1569
1570 * libbfd-in.h (_bfd_constant_p): Define.
1571 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1572 file size before allocating memory.
1573 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1574 * elf.c (bfd_elf_get_str_section): Likewise.
1575 (_bfd_elf_slurp_version_tables): Likewise.
1576 * libbfd.h: Regenerate.
1577
2bb3687b
AM
15782020-02-19 Alan Modra <amodra@gmail.com>
1579
1580 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1581 * aoutx.h (aout_get_external_symbols): Replace calls to
1582 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1583 (slurp_reloc_table): Likewise.
1584 * archive.c (do_slurp_bsd_armap): Likewise.
1585 (do_slurp_coff_armap): Likewise.
1586 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1587 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1588 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1589 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1590 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1591 (_bfd_coff_get_external_symbols): Likewise.
1592 * ecoff.c (ecoff_slurp_symbolic_header),
1593 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1594 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1595 (ecoff_indirect_link_order): Likewise.
1596 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1597 (_bfd_elf_slurp_version_tables): Likewise.
1598 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1599 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1600 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1601 * elf64-alpha.c (READ): Likewise.
1602 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1603 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1604 * elfcode.h (elf_slurp_symbol_table),
1605 (elf_slurp_reloc_table_from_section): Likewise.
1606 * elflink.c (elf_link_add_object_symbols),
1607 (elf_link_check_versioned_symbol): Likewise.
1608 * elfxx-mips.c (READ): Likewise.
1609 * i386lynx.c (slurp_reloc_table): Likewise.
1610 * lynx-core.c (lynx_core_file_p): Likewise.
1611 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1612 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1613 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1614 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1615 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1616 (bfd_pef_parse_symbols): Likewise.
1617 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1618 * som.c (setup_sections, som_slurp_string_table),
1619 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1620 (som_bfd_fill_in_ar_symbols): Likewise.
1621 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1622 (evax_bfd_print_image): Likewise.
1623 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1624 * wasm-module.c (wasm_scan): Likewise.
1625 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1626 * xsym.c (bfd_sym_read_name_table),
1627 (bfd_sym_print_type_information_table_entry): Likewise.
1628 * libbfd.h: Regenerate.
1629
806470a2
AM
16302020-02-19 Alan Modra <amodra@gmail.com>
1631
1632 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1633 reading external relocs.
1634 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1635 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1636 after bfd_bread.
1637 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1638 bfd_release.
1639 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1640 (m32c_elf_relax_section): Likewise.
1641 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1642 (rl78_elf_relax_section): Likewise.
1643 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1644 (elf32_rx_relax_section): Likewise.
1645 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1646 parameter types and use..
1647 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1648 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1649 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1650 being read from file, just the extra.
1651 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1652 after reading external syms. Free on failure.
1653
1f4361a7
AM
16542020-02-19 Alan Modra <amodra@gmail.com>
1655
1656 * coffcode.h (buy_and_read, coff_slurp_line_table),
1657 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1658 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1659 corresponding bfd_alloc call. Adjust variables to suit.
1660 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1661 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1662 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1663 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1664 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1665 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1666 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1667 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1668 * elf64-alpha.c (READ): Likewise.
1669 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1670 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1671 (bfd_from_remote_memory): Likewise.
1672 * elfcore.h (core_find_build_id): Likewise.
1673 * elfxx-mips.c (READ): Likewise.
1674 * mach-o.c (bfd_mach_o_mangle_sections),
1675 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1676 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1677 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1678 * som.c (setup_sections, som_prep_for_fixups)
1679 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1680 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1681 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1682 (som_bfd_ar_write_symbol_stuff): Likewise.
1683 * vms-alpha.c (vector_grow1): Likewise.
1684 * vms-lib.c (vms_add_index): Likewise.
1685 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1686 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1687 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1688 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1689 (bfd_alloc2, bfd_zalloc2): Delete.
1690 (_bfd_mul_overflow): Define.
1691 * libbfd.h: Regenerate.
1692
446f7ed5
AM
16932020-02-19 Alan Modra <amodra@gmail.com>
1694
1695 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1696 bfd_zalloc2.
1697 (assign_section_numbers): Likewise.
1698 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1699 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1700 bfd_malloc2, size_t amt, and unsigned tls_count.
1701 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1702 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1703 (elf_output_implib): Use bfd_alloc.
1704
b03202e3
AM
17052020-02-19 Alan Modra <amodra@gmail.com>
1706
1707 * bfd.c (struct bfd): Move format and direction to other
1708 bitfields. Add "size".
1709 * bfdio.c (bfd_get_size): Cache size when not writing file.
1710 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1711 returning zero, ie. unknown.
1712 (bfd_get_alt_debug_link_info): Likewise.
1713 * bfd-in2.h: Regenerate.
1714
7c5fa58e
AM
17152020-02-19 Alan Modra <amodra@gmail.com>
1716
1717 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1718 bfd_get_file_size twice.
1719 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1720 zero, ie. unknown, return.
1721 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1722 * elfcode.h (elf_swap_shdr_in): Likewise.
1723 (elf_object_p): Don't call bfd_get_file_size twice and correct
1724 file size check.
1725
96d3b80f
AM
17262020-02-19 Alan Modra <amodra@gmail.com>
1727
1728 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1729 FALSE if memory alloc fails. Adjust calls.
1730 * som.c (som_prep_for_fixups): Likewise.
1731 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1732 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1733 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1734 * som.c (som_build_and_write_symbol_table): Return via error_return
1735 on seek failure.
1736 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1737 (VEC_APPEND_EL): Delete.
1738 (vector_grow1): Return pointer to element. Catch overflow.
1739 Return NULL on memory allocation failure.
1740 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1741 (alpha_vms_add_fixup_ca): Likewise.
1742 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1743 before using.
1744 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1745
986f0783
AM
17462020-02-19 Alan Modra <amodra@gmail.com>
1747
1748 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1749 * aout-target.h (object_p): Likewise.
1750 * aout-tic30.c (tic30_aout_object_p): Likewise.
1751 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1752 (emit_stringtab, write_syms, link_hash_table_create),
1753 (aout_link_write_other_symbol): Likewise.
1754 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1755 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1756 (_bfd_compute_and_write_armap): Likewise.
1757 * archures.c (bfd_arch_list): Likewise.
1758 * bfd.c (bfd_record_phdr): Likewise.
1759 * binary.c (binary_canonicalize_symtab): Likewise.
1760 * cisco-core.c (cisco_core_file_validate): Likewise.
1761 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1762 (find_arm_glue, record_arm_to_thumb_glue),
1763 (record_thumb_to_arm_glue): Likewise.
1764 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1765 (ppc_allocate_toc_section): Likewise.
1766 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1767 * coff-sh.c (sh_relax_section): Likewise.
1768 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1769 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1770 (coff_set_alignment_hook, coff_mkobject),
1771 (coff_compute_section_file_positions): Likewise.
1772 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1773 (coff_find_nearest_line_with_names),
1774 ( bfd_coff_set_symbol_class): Likewise.
1775 * cofflink.c (_bfd_coff_link_hash_table_create),
1776 (_bfd_coff_link_input_bfd): Likewise.
1777 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1778 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1779 (build_line_info_table, sort_line_sequences),
1780 (line_info_add_include_dir, line_info_add_file_name),
1781 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1782 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1783 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1784 (_bfd_ecoff_find_nearest_line),
1785 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1786 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1787 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1788 * elf-m10300.c (mn10300_elf_relax_section),
1789 (elf32_mn10300_link_hash_table_create): Likewise.
1790 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1791 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1792 * elf32-arm.c (elf32_arm_link_hash_table_create),
1793 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1794 (elf32_arm_new_section_hook): Likewise.
1795 * elf32-avr.c (elf_avr_new_section_hook),
1796 (elf32_avr_link_hash_table_create, get_local_syms),
1797 (elf32_avr_setup_section_lists): Likewise.
1798 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1799 (bfin_link_hash_table_create): Likewise.
1800 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1801 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1802 * elf32-csky.c (csky_elf_link_hash_table_create),
1803 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1804 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1805 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1806 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1807 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1808 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1809 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1810 (m32r_elf_check_relocs): Likewise.
1811 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1812 (elf32_m68hc11_setup_section_lists),
1813 (elf32_m68hc11_size_stubs): Likewise.
1814 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1815 * elf32-metag.c (elf_metag_link_hash_table_create),
1816 (elf_metag_setup_section_lists): Likewise.
1817 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1818 (microblaze_elf_check_relocs): Likewise.
1819 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1820 (nds32_elf_check_relocs): Likewise.
1821 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1822 (get_local_syms, nios2_elf32_check_relocs),
1823 (nios2_elf32_link_hash_table_create): Likewise.
1824 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1825 (or1k_elf_check_relocs): Likewise.
1826 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1827 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1828 * elf32-s390.c (elf_s390_link_hash_table_create),
1829 (elf_s390_check_relocs): Likewise.
1830 * elf32-score.c (score_elf_create_got_section),
1831 (s3_elf32_score_new_section_hook),
1832 (elf32_score_link_hash_table_create): Likewise.
1833 * elf32-score7.c (score_elf_create_got_section),
1834 (s7_elf32_score_new_section_hook): Likewise.
1835 * elf32-sh.c (sh_elf_link_hash_table_create),
1836 (sh_elf_check_relocs): Likewise.
1837 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1838 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1839 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1840 (tilepro_elf_check_relocs): Likewise.
1841 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1842 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1843 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1844 (elf_xtensa_new_section_hook): Likewise.
1845 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1846 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1847 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1848 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1849 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1850 * elf64-ppc.c (ppc64_elf_new_section_hook),
1851 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1852 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1853 * elf64-s390.c (elf_s390_link_hash_table_create),
1854 (elf_s390_check_relocs): Likewise.
1855 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1856 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1857 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1858 (elf_link_add_archive_symbols, compute_bucket_count),
1859 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1860 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1861 (bfd_elf_final_link): Likewise.
1862 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1863 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1864 (elfNN_aarch64_new_section_hook): Likewise.
1865 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1866 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1867 (riscv_elf_check_relocs): Likewise.
1868 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1869 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1870 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1871 (_bfd_mips_elf_link_hash_table_create): Likewise.
1872 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1873 (_bfd_sparc_elf_check_relocs),
1874 (_bfd_sparc_elf_new_section_hook): Likewise.
1875 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1876 (tilegx_elf_check_relocs): Likewise.
1877 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1878 * format.c (bfd_check_format_matches): Likewise.
1879 * hash.c (_bfd_stringtab_init): Likewise.
1880 * ihex.c (ihex_scan): Likewise.
1881 * irix-core.c (irix_core_core_file_p): Likewise.
1882 * linker.c (bfd_wrapped_link_hash_lookup),
1883 (_bfd_generic_link_hash_table_create),
1884 (_bfd_generic_reloc_link_order): Likewise.
1885 * lynx-core.c (lynx_core_file_p): Likewise.
1886 * netbsd-core.c (netbsd_core_file_p): Likewise.
1887 * osf-core.c (osf_core_core_file_p): Likewise.
1888 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1889 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1890 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1891 * peicode.h (pe_mkobject): Likewise.
1892 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1893 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1894 * sco5-core.c (read_uarea): Likewise.
1895 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1896 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1897 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1898 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1899 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1900 * srec.c (srec_scan): Likewise.
1901 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1902 * targets.c (bfd_target_list): Likewise.
1903 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1904 * trad-core.c (trad_unix_core_file_p): Likewise.
1905 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1906 (vms_new_section_hook): Likewise.
1907 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1908 * xcofflink.c (xcoff_get_section_contents),
1909 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1910 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1911 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1912
2d0e1217
AM
19132020-02-19 Alan Modra <amodra@gmail.com>
1914
1915 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1916
99845b3b
L
19172020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1918
1919 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1920 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1921 a build_list_p argument. Don't search plugin_list. Short circuit
1922 when building the plugin list.
1923 (has_plugin): Renamed to has_plugin_list.
1924 (bfd_plugin_set_plugin): Don't set has_plugin.
1925 (bfd_plugin_specified_p): Check plugin_list instead.
1926 (build_plugin_list): New function.
1927 (load_plugin): Call build_plugin_list and use plugin_list.
1928
22fe7df8
L
19292020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1930
1931 PR binutils/25355
1932 * plugin.c (try_claim): Always clean up for LTO wrapper.
1933 (try_load_plugin): Treat each object as independent. Create a
1934 copy for plugin name.
1935
c675ec1e
NC
19362020-02-11 Nick Clifton <nickc@redhat.com>
1937
1938 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1939 for addresses in print statements.
1940 (msp430_elf_relax_delete_bytes): Likewise.
1941 (msp430_elf_relax_add_words): Likewise.
1942 (msp430_elf_relax_section): Likewise.
1943
1d07a805
L
19442020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1945
1946 * plugin.c (add_symbols): Clear plugin_data memory.
1947
0aa99dcd
L
19482020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1949
1950 PR binutils/25355
1951 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1952 (EXECUTABLE_SUFFIX): Likewise.
1953 * config.in: Regenerated.
1954 * configure: Likewise.
1955 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1956 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1957 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1958 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1959 (get_lto_wrapper): New.
1960 (setup_lto_wrapper_env): Likewise.
1961 (current_plugin): Likewise.
1962 (register_all_symbols_read): Likewise.
1963 (register_cleanup): Likewise.
1964 (get_symbols): Likewise.
1965 (add_input_file): Likewise.
1966 (bfd_plugin_close_and_cleanup): Likewise.
1967 (claim_file): Removed.
1968 (register_claim_file): Set current_plugin->claim_file.
1969 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1970 lto_syms in current_plugin.
1971 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1972 all_symbols_read handler. Copy real symbols to plugin_data.
1973 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1974 (try_load_plugin): Don't reuse the previous plugin for LTO
1975 wrapper. Set up GCC LTO wrapper if possible. Don't set
1976 plugin_list_iter->claim_file.
1977 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1978 possible.
1979 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1980 real_syms.
1981
ac4280da
JL
19822020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1983
1984 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1985 check if previous instruction matches a conditional jump inserted
1986 earlier. Invert conditional jump and delete branch in this case.
1987
8d6cb116
JL
19882020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1989
1990 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1991 msp430_elf_relax_add_words. Support insertion of either one or two
1992 words.
1993 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1994 needs to be grown. Handle insertion of branch instruction to replace
1995 jump.
1996
d60f5448
JL
19972020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1998
1999 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
2000 debugging relocations.
2001 (msp430_elf_relax_delete_bytes): Likewise.
2002 (msp430_elf_relax_add_two_words): Likewise.
2003 (msp430_elf_relax_section): Likewise.
2004
e1f85e11
AM
20052020-02-10 Alan Modra <amodra@gmail.com>
2006
2007 * archures.c: Wrap overlong z80 comments.
2008 * bfd-in2.h: Regenerate.
2009
9fc0b501
SB
20102020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
2011
2012 PR 25469
2013 * archures.c: Add GBZ80 and Z80N machine values.
2014 * reloc.c: Add BFD_RELOC_Z80_16_BE.
2015 * coff-z80.c: Add support for new reloc.
2016 * coffcode.h: Add support for new machine values.
2017 * cpu-z80.c: Add support for new machine names.
2018 * elf32-z80.c: Add support for new reloc.
2019 * bfd-in2.h: Regenerate.
2020 * libbfd.h: Regenerate.
2021
9984857c
NC
20222020-02-07 Nick Clifton <nickc@redhat.com>
2023
2024 PR 23932
2025 * elf.c (rewrite_elf_program_header): Do not complain if no
2026 sections are mapped to a segment.
2027
5242a0a0
L
20282020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2029
2030 PR ld/25490
2031 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
2032 for garbage collection on __patchable_function_entries section
2033 without linked-to section.
2034
b7d07216
L
20352020-02-06 H.J. Lu <hongjiu.lu@intel.com>
2036
2037 PR gas/25381
2038 * bfd-in2.h: Regenerated.
2039 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
2040 on section if gc_mark of any of its linked-to sections is set
2041 and don't set gc_mark again.
2042 * section.c (asection): Add linked_to_symbol_name to map_head
2043 union.
2044
b93a662b
MR
20452020-02-06 Maciej W. Rozycki <macro@wdc.com>
2046
2047 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
2048 reporting an unrecognized instruction with R_V850_LONGJUMP.
2049
6df4c9c2
AM
20502020-02-05 Alan Modra <amodra@gmail.com>
2051
2052 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
2053
24872cb3
AM
20542020-02-04 Alan Modra <amodra@gmail.com>
2055
2056 * elf32-ppc.c (ppc_elf_relocate_section): After applying
2057 R_PPC_VLE_ADDR20, goto copy_reloc.
2058
ef4627fa
L
20592020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2060
2061 * bfd-in2.h: Regenerated.
2062 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
2063
a8c4d40b
L
20642020-02-02 H.J. Lu <hongjiu.lu@intel.com>
2065
2066 PR gas/25380
2067 * bfd-in2.h: Regenerated.
2068 * ecoff.c (bfd_debug_section): Add section_id.
2069 * section.c (bfd_section): Add section_id.
2070 (SEC_ASSEMBLER_SECTION_ID): New.
2071 (BFD_FAKE_SECTION): Add section_id.
2072
5a9212a1
NC
20732020-02-01 Nick Clifton <nickc@redhat.com>
2074
2075 * config.bfd: Move the c30-aout and tic30-aout targets onto the
2076 obsolete list.
2077
e7cbe0c4
SL
20782020-01-31 Sandra Loosemore <sandra@codesourcery.com>
2079
2080 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
2081 encodings are relative to the GOT on nios2, too.
2082
72ebe8c5
AM
20832020-01-31 Alan Modra <amodra@gmail.com>
2084
2085 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
2086 file. Use $< and $@ in rules.
2087 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
2088 (elf32-ia64.c, elf64-ia64.c): Likewise.
2089 (elf32-riscv.c, elf64-riscv.c): Likewise.
2090 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2091 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
2092 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
2093 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
2094 (peigen.c, pepigen.c, pex64igen.c): Likewise.
2095 * Makefile.in: Regenerate.
2096
327301a4
AM
20972020-01-31 Alan Modra <amodra@gmail.com>
2098
2099 PR 4110
2100 * elf.c (setup_group): Don't clear entire section contents,
2101 just the padding after group flags. Release alloc'd memory
2102 after a seek or read failure.
2103
b5d36aaa
JT
21042020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2105
2106 * peXXigen.c (pe_is_repro): New function.
2107 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
2108 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
2109
1957ab10
JT
21102020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2111
2112 * peXXigen.c (debug_type_names): Add names for new debug data type
2113 values.
2114
87b2920f
JT
21152020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
2116
2117 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
2118 inner loop. Fix a memory leak.
2119
72913831
AM
21202020-01-30 Alan Modra <amodra@gmail.com>
2121
2122 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
2123 or obj_coff_keep_strings here.
2124 (coff_get_normalized_symtab): Free external syms directly.
2125 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
2126 on error exit path.
2127
c35d018b
JW
21282020-01-27 Jim Wilson <jimw@sifive.com>
2129
2130 * cpu-riscv.c (riscv_scan): New.
2131 (N): Change bfd_default_scan to riscv_scan.
2132
086b06f3
AS
21332020-01-27 Andreas Schwab <schwab@suse.de>
2134
2135 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
2136 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
2137 * Makefile.in: Regenerate.
2138 * cpu-plugin.c: Remove.
2139 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
2140 (bfd_plugin_arch): Remove declaration.
2141 * bfd-in2.h: Regenerate.
2142 * po/SRC-POTFILES.in: Regenerate.
2143
3024a17a
AM
21442020-01-27 H.J. Lu <hongjiu.lu@intel.com>
2145 Alan Modra <amodra@gmail.com>
2146
2147 PR ld/25458
2148 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
2149
b5f998b2
JW
21502020-01-24 Jim Wilson <jimw@sifive.com>
2151
2152 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
2153 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
2154 avoid over long line.
2155
caa31cfa
NC
21562020-01-24 Nick Clifton <nickc@redhat.com>
2157
2158 PR 25447
2159 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
2160 syms and keep strings flags as these may have been set in order to
2161 prevent a bogus call to free.
2162
24e648d4
NC
21632020-01-23 Nick Clifton <nickc@redhat.com>
2164
2165 * po/fr.po: Updated French translation.
2166
67641dd3
AM
21672020-01-23 Alan Modra <amodra@gmail.com>
2168
2169 PR 25444
2170 * elf.c (assign_file_positions_for_load_sections): Avoid divide
2171 by zero when p_align is zero.
2172
403d1bd9
JW
21732020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
2174
2175 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
2176 (riscv_prefix_cmp): Likewise.
2177 (riscv_non_std_ext_p): Deleted.
2178 (riscv_std_sv_ext_p): Likewise.
2179 (riscv_non_std_sv_ext_p): Likewise.
2180 (riscv_merge_non_std_and_sv_ext): Rename to...
2181 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
2182 (riscv_merge_arch_attr_info): Replace 3 calls to
2183 riscv_merge_non_std_and_sv_ext with single call to
2184 riscv_merge_multi_letter_ext.
2185 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
2186 encounter a 'z' prefix.
2187 (riscv_get_prefix_class): New function, return prefix class based
2188 on first few characters of input string.
2189 (riscv_parse_config): New structure to factor out minor differences
2190 in extension class parsing behaviour.
2191 (riscv_parse_sv_or_non_std_ext): Rename to...
2192 (riscv_parse_prefixed_ext): and parameterise with
2193 riscv_parse_config.
2194 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
2195 (riscv_multi_letter_ext_valid_p): New.
2196 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
2197 (riscv_parse_subset): Delegate all non-single-letter parsing work
2198 to riscv_parse_prefixed_ext.
2199 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
2200 (riscv_get_prefix_class): Declare.
2201
a804e476
AM
22022020-01-22 Alan Modra <amodra@gmail.com>
2203
2204 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
2205 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
2206 __tls_get_addr_desc.
2207 (ppc64_elf_size_stubs): Add section for linker generated
2208 __tls_get_addr_desc wrapper function. Loop at least once if
2209 generating this function.
2210 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
2211 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
2212
9e7028aa
AM
22132020-01-22 Alan Modra <amodra@gmail.com>
2214
2215 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
2216 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
2217 tga_desc_fd.
2218 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
2219 (STDU_R1_0R1, ADDI_R1_R1): Define.
2220 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
2221 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
2222 tga_desc_fd to opt_fd, and tga_desc to opt. Set
2223 no_tls_get_addr_regsave.
2224 (branch_reloc_hash_match): Add hash3 and hash4.
2225 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
2226 (ppc64_elf_size_dynamic_sections): Likewise.
2227 (ppc64_elf_relocate_section): Likewise.
2228 (plt_stub_size, build_plt_stub): Likewise. Size regsave
2229 __tls_get_addr stub.
2230 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
2231 eh_frame.
2232 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
2233 eh_frame for regsave __tls_get_addr.
2234
abc489c6
AM
22352020-01-22 Alan Modra <amodra@gmail.com>
2236
2237 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
2238 which __tls_get_addr calls will be eliminated.
2239
26916852
NC
22402020-01-20 Nick Clifton <nickc@redhat.com>
2241
2242 * po/pt.po: Updates Portuguese translation.
2243 * po/ru.po: Updated Russian translation.
2244 * po/uk.po: Updated Ukranian translation.
2245
14470f07
L
22462020-01-20 H.J. Lu <hongjiu.lu@intel.com>
2247
2248 PR ld/25416
2249 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
2250 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
2251 X32 mode.
2252 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
2253 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
2254 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
2255 "rex leal x@tlsdesc(%rip), %reg" to
2256 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
2257 "call *(%eax)" to "nopl (%rax)".
2258
b9ca1af6
AM
22592020-01-20 Alan Modra <amodra@gmail.com>
2260
2261 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
2262 (MTLR_R11): Don't define.
2263 (LD_R0_0R3, CMPDI_R0_0): Define.
2264 (build_tls_get_addr_stub): Don't use r11 in stub.
2265
ed7007c1
AM
22662020-01-20 Alan Modra <amodra@gmail.com>
2267
2268 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
2269 (defined_sym_val, is_tls_get_addr): Likewise.
2270
1b1bb2c6
NC
22712020-01-18 Nick Clifton <nickc@redhat.com>
2272
2273 * version.m4 (BFD_VERSION): Set to 2.34.50.
2274 * configure: Regenerate.
2275 * po/bfd.pot: Regenerate.
2276
ae774686
NC
22772020-01-18 Nick Clifton <nickc@redhat.com>
2278
2279 Binutils 2.34 branch created.
2280
07f1f3aa
CB
22812020-01-17 Christian Biesinger <cbiesinger@google.com>
2282
2283 * coff-arm.c: Fix spelling error (seperate).
2284 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
2285 error (seperate).
2286 * sysdep.h (strnlen): Fix spelling error (seperate).
2287
0d1cc75d
LB
22882020-01-15 Lars Brinkhoff <lars@nocrew.org>
2289
2290 PR 20694
2291 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
2292
e1c6cf61
AM
22932020-01-15 Alan Modra <amodra@gmail.com>
2294
2295 PR 25384
2296 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
2297 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
2298 of function symbols unless dot symbols are present. Do warn
2299 whenever one is created, regardles of whether a PLT entry is
2300 also emitted for the function symbol.
2301
ef4e5ba5
AM
23022020-01-14 Alan Modra <amodra@gmail.com>
2303
2304 * som.c (som_bfd_count_ar_symbols): Error when file position
2305 of symbols on chains is not strictly increasing.
2306
8ab484c2
AM
23072020-01-14 Alan Modra <amodra@gmail.com>
2308
2309 * vms.h (VMS_DEBUG): Define as 0.
2310 * vms-alpha.c (image_write): Move debug output after bounds check.
2311 Tidy bounds check.
2312 (_bfd_vms_slurp_eihd): Warning fix.
2313 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
2314
b50ef514
AM
23152020-01-13 Alan Modra <amodra@gmail.com>
2316
2317 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
2318 for "ignored" records.
2319
0c0adcc5
AM
23202020-01-13 Alan Modra <amodra@gmail.com>
2321
2322 * wasm-module.c (wasm_scan_name_function_section): Formatting.
2323 Delete asect name check. Move asect NULL check to wasm_object_p.
2324 Correct bounds check of sizes against end. Replace uses of
2325 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
2326 just one bfd_release.
2327 (wasm_scan): Don't use malloc/strdup for section names,
2328 bfd_alloc instead. Simplify code prefixing section name.
2329 Formatting. Don't attempt to free memory here..
2330 (wasm_object_p): ..do so here.
2331
7f026732
SN
23322020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
2333
2334 PR ld/22269
2335 * elf32-arm.c (elf32_arm_final_link_relocate): Use
2336 UNDEFWEAK_NO_DYNAMIC_RELOC.
2337 (allocate_dynrelocs_for_symbol): Likewise.
2338
8cd0e5e9
TC
23392020-01-10 Tamar Christina <tamar.christina@arm.com>
2340
2341 PR 25210
2342 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
2343
71780f45
AM
23442020-01-10 Alan Modra <amodra@gmail.com>
2345
2346 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
2347
b899eb3b
NC
23482020-01-09 Nick Clifton <nickc@redhat.com>
2349
2350 PR 25221
2351 * bfd.c (bfd_convert_section_contents): Check for a compress
2352 header size that is larger than the actual section size.
2353
4c6ee646
AM
23542020-01-08 Alan Modra <amodra@gmail.com>
2355
2356 PR 25351
2357 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
2358 after removing sections.
2359
85f78364
JW
23602020-01-06 Jim Wilson <jimw@sifive.com>
2361
2362 PR 25205
2363 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
2364 check for !bfd_link_pic (info).
2365 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
2366 <R_RISCV_JAL>: Add comment.
2367 (_bfd_riscv_relax_section): For plt.offset check, add check for
2368 bfd_link_pic (info). Add comment.
2369
49078ece
AM
23702020-01-06 Alan Modra <amodra@gmail.com>
2371
2372 * format.c (bfd_check_format_matches): Ignore bfd_error on target
2373 match failures. Don't init to bfd_error_wrong_format before
2374 calling _bfd_check_format.
2375
ab356be7
AM
23762020-01-06 Alan Modra <amodra@gmail.com>
2377
2378 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
2379 status rather than exiting on stack overflow or underflow.
2380 (_bfd_vms_slurp_etir): Adjust to suit.
2381
85d86817
AM
23822020-01-06 Alan Modra <amodra@gmail.com>
2383
2384 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2385
3e6aa775
AM
23862020-01-06 Alan Modra <amodra@gmail.com>
2387
2388 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2389 command. Check name offset is within command.
2390 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2391 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2392 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2393 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2394 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2395 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2396 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2397 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2398 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2399 (bfd_mach_o_read_segment): Similarly.
2400 (bfd_mach_o_read_thread): Properly bound check thread struct.
2401 Don't repeat checks on second loop.
2402 (bfd_mach_o_read_command): Fail on invalid command length.
2403
ea933f17
AM
24042020-01-04 Alan Modra <amodra@gmail.com>
2405
2406 * format.c (bfd_check_format_matches): Add preserve_match.
2407 Save initial bfd state in "preserve", matched bfd state in
2408 "preserve_match". Save just the first match. Release
2409 bfd_alloc memory. Restore and finish preserved state as
2410 appropriate on all function exit paths.
2411
f24bdec4
AM
24122020-01-04 Alan Modra <amodra@gmail.com>
2413
2414 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2415
991fb595
AM
24162020-01-04 Alan Modra <amodra@gmail.com>
2417
2418 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2419 match too.
2420
f2a3559d
NC
24212020-01-03 Nick Clifton <nickc@redhat.com>
2422
2423 PR 25307
2424 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2425 there is enough data remaining in the code buffer before
2426 attempting to read a function stub.
2427
7a0fb7be
NC
24282020-01-03 Nick Clifton <nickc@redhat.com>
2429
2430 PR 25308
2431 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2432 return value from bfd_malloc.
2433 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2434 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2435 (elf32_arm_filter_cmse_symbols): Likewise.
2436 (elf32_arm_write_section): Likewise.
2437 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2438 (bfd_mach_o_follow_dsym): Likewise.
2439 * pef.c (bfd_pef_print_loader_section): Likewise.
2440 (bfd_pef_scan_start_address): Likewise.
2441 (bfd_pef_parse_function_stubs): Likewise.
2442 (bfd_pef_parse_symbols): Likewise.
2443
b26a3d58
ST
24442020-01-03 Sergei Trofimovich <siarheit@google.com>
2445
2446 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2447 on binary inputs ld/PR25316.
2448 (is_ia64_elf): new helper to filter on ia64 objects.
2449
4bb7a87e
JB
24502020-01-03 Jan Beulich <jbeulich@suse.com>
2451
2452 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2453 in parameter names.
2454 (bfd_mach_o_scan): Insert underscore in two variable names.
2455
6655dba2
SB
24562020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2457
2458 * Makefile.am: Add z80-elf target support.
2459 * configure.ac: Likewise.
2460 * targets.c: Likewise.
2461 * Makefile.in: Regenerate.
2462 * configure: Regenerate.
2463 * config.bfd: Add z80-elf target support and new arches: ez80 and
2464 z180.
2465 * elf32-z80.c: New file.
2466 * archures.c: Add new z80 architectures: eZ80 and Z180.
2467 * coffcode.h: Likewise.
2468 * cpu-z80.c: Likewise.
2469 * coff-z80.c: Add new relocations for Z80 target and local label
2470 check.
2471 * reloc.c: Add new relocs.
2472 * bfd-in2.h: Regenerate.
2473 * libbfd.h: Regenerate.
2474
0db131fb
TC
24752020-01-02 Tamar Christina <tamar.christina@arm.com>
2476
2477 PR 25210
2478 PR 24753
2479 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2480
b14ce8bf
AM
24812020-01-01 Alan Modra <amodra@gmail.com>
2482
2483 Update year range in copyright notice of all files.
2484
0b114740 2485For older changes see ChangeLog-2019
3499769a 2486\f
0b114740 2487Copyright (C) 2020 Free Software Foundation, Inc.
3499769a
AM
2488
2489Copying and distribution of this file, with or without modification,
2490are permitted in any medium without royalty provided the copyright
2491notice and this notice are preserved.
2492
2493Local Variables:
2494mode: change-log
2495left-margin: 8
2496fill-column: 74
2497version-control: never
2498End:
This page took 0.364228 seconds and 4 git commands to generate.