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