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