Restore some windows-tdep.c code
[deliverable/binutils-gdb.git] / bfd / ChangeLog
... / ...
CommitLineData
12020-04-18 Alan Modra <amodra@gmail.com>
2
3 * section.c (bfd_is_const_section): Correct test for special
4 sections.
5 * bfd-in2.h: Regenerate.
6
72020-04-17 Alan Modra <amodra@gmail.com>
8
9 PR 25842
10 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
11 NULL nodename.
12
132020-04-16 Nick Clifton <nickc@redhat.com>
14
15 PR 25803
16 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
17 abort with a more helpful error message.
18
192020-04-16 Alan Modra <amodra@gmail.com>
20
21 PR 25827
22 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
23 strdup(0).
24
252020-04-15 Fangrui Song <maskray@google.com>
26
27 PR binutils/24613
28 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
29 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
30 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
31 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
32 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
33 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
34 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
35 * elf32-sh.c (sh_elf_relocate_section): Likewise.
36 * elf32-spu.c (spu_elf_relocate_section): Likewise.
37 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
38 * elflink.c (elf_link_output_extsym): Likewise.
39 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
40
412020-04-15 Alan Modra <amodra@gmail.com>
42
43 PR 25823
44 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
45 pointer into strings that may be freed for section name, always
46 allocate a new string.
47
482020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
49 Jan W. Jagersma <jwjagersma@gmail.com>
50
51 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
52 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
53 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
54 (_bfd_go32_mkobject): New functions.
55 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
56 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
57 (go32exe_mkobject): Call _bfd_go32_mkobject.
58 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
59 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
60 and COFF_GO32.
61 (coff_write_relocs): Enable extended reloc counter code if
62 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
63 (coff_write_object_contents): Likewise. Pad section headers
64 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
65 instead of coff_swap_scnhdr_out.
66 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
67 enable extended reloc counter.
68 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
69 Declare with ATTRIBUTE_UNUSED.
70 * libcoff-in.h: (struct coff_tdata): New field go32.
71 (obj_go32): Define.
72 * libcoff.h: Regenerate.
73
742020-04-14 Fangrui Song <maskray@google.com>
75
76 PR gas/25768
77 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
78 12.
79
802020-04-14 Stephen Casner <casner@acm.org>
81
82 PR ld/25677
83 * pdp11.c: Add implementation of --imagic option.
84 (adjust_o_magic): Fix objcopy --extract-symbol test.
85 * libaout.h (enum aout_magic): Add i_magic.
86
872020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
88 Nick Clifton <nickc@redhat.com>
89
90 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
91 <0>: Ignore.
92 <default>: Error rather than abort.
93
942020-04-03 H.J. Lu <hongjiu.lu@intel.com>
95
96 PR ld/25767
97 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
98 relocation section from section group.
99
1002020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
101
102 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
103 bfd->origin to file offset.
104 * bfdwin.c (bfd_get_file_window): Likewise.
105 * bfd.c: Clarify the use of the bfd->origin field.
106 * bfd-in2.h: Regenerate.
107 * coff-i386.c: Don't include go32exe.h. Allow overriding
108 coff_write_object_contents via COFF_WRITE_CONTENTS.
109 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
110 (go32exe_write_object_contents): New functions.
111 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
112 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
113 (create_go32_stub): Remove check for 2k size limit. Read stub
114 from go32exe_temp_stub if present.
115 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
116 copy variable-length stub.
117 (go32_check_format): Read stub to go32exe_temp_stub, set
118 origin, return go32exe_cleanup.
119 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
120 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
121 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
122 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
123 Remove functions and their associated #defines.
124 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
125 * libcoff-in.h: (struct coff_tdata): New field stub_size.
126 Rename field go32stub to stub.
127 * libcoff.h: Regenerate.
128 * coff-stgo32.c (go32_check_format): Rename to...
129 (go32exe_check_format): ...this.
130 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
131 (go32exe_copy_private_bfd_data): ...this.
132 (stub_bytes): Rename to...
133 (go32exe_default_stub): ...this.
134 (create_go32_stub): Rename to...
135 (go32exe_create_stub): ...this.
136 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
137 when possible.
138
1392020-04-01 H.J. Lu <hongjiu.lu@intel.com>
140
141 PR ld/25749
142 PR ld/25754
143 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
144 relocation to R_386_32 for relocation against non-preemptible
145 absolute symbol.
146 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
147 allocate dynamic relocation for non-preemptible absolute symbol.
148 (elf_i386_relocate_section): Pass sec to
149 GENERATE_DYNAMIC_RELOCATION_P.
150 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
151 (elf_x86_64_convert_load_reloc): Covert load relocation to
152 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
153 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
154 for non-preemptible absolute symbol if they overflow.
155 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
156 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
157 symbol. Don't allocate dynamic relocation for non-preemptible
158 absolute symbol.
159 (elf_x86_64_relocate_section): Don't generate relative relocation
160 for GOTPCREL relocations aganst local absolute symbol. Pass sec
161 to GENERATE_DYNAMIC_RELOCATION_P.
162 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
163 against non-preemptible absolute symbol.
164 (_bfd_elf_x86_valid_reloc_p): New function.
165 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
166 GOT_ABS GOT slot.
167 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
168 argument. Don't generate dynamic relocation against
169 non-preemptible absolute symbol.
170 (ABS_SYMBOL_P): New.
171 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
172 against non-preemptible absolute symbol.
173 (GOT_ABS): New.
174 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
175 (_bfd_elf_x86_valid_reloc_p): New.
176
1772020-04-01 Tamar Christina <tamar.christina@arm.com>
178
179 PR ld/16017
180 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
181 address in the GOT if in thumb only mode.
182
1832020-04-01 Tamar Christina <tamar.christina@arm.com>
184
185 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
186
1872020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
188
189 * mmo.c (mmo_scan): Create .text section only when needed, not
190 from the start.
191
1922020-03-31 Alan Modra <amodra@gmail.com>
193
194 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
195 return value check.
196
1972020-03-31 Alan Modra <amodra@gmail.com>
198
199 * vms-alpha.c (image_write): Check bounds for sections without
200 contents too. Error on non-zero write to section without
201 contents.
202 (_bfd_vms_slurp_etir): Check return of image_write* functions.
203
2042020-03-31 Alan Modra <amodra@gmail.com>
205
206 * tekhex.c (pass_over): Check is_eof before reading buffer.
207
2082020-03-30 Nick Clifton <nickc@redhat.com>
209
210 PR binutils/pr25662
211 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
212 field to timestamp and make it an integer.
213 * libcoff.h: Regenerate.
214 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
215 field in the pe_data structure rather than the insert_timestamp
216 field.
217
2182020-03-30 Alan Modra <amodra@gmail.com>
219
220 PR 25745
221 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
222 statistics message.
223
2242020-03-26 Nick Clifton <nickc@redhat.com>
225
226 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
227 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
228 prototype.
229 * libbfd.h: Regenerate.
230
2312020-03-26 Alan Modra <amodra@gmail.com>
232
233 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
234
2352020-03-26 Alan Modra <amodra@gmail.com>
236
237 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
238 array.
239 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
240
2412020-03-25 Nick Clifton <nickc@redhat.com>
242
243 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
244 function.
245 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
246 * libbfd.h: Regenerate.
247
2482020-03-25 Shahab Vahedi <shahab@synopsys.com>
249
250 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
251 correct field name in the output string.
252
2532020-03-25 Alan Modra <amodra@gmail.com>
254
255 PR 25662
256 * elf.c (assign_file_positions_for_load_sections): Adjust offset
257 for SHT_NOBITS section if first in segment.
258
2592020-03-24 H.J. Lu <hongjiu.lu@intel.com>
260
261 PR binutils/25708
262 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
263 (_bfd_elf_get_symbol_version_string): This.
264 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
265 (_bfd_elf_get_symbol_version_string): This.
266 (bfd_elf_print_symbol): Pass TRUE to
267 _bfd_elf_get_symbol_version_string.
268 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
269 bfd_boolean argument.
270 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
271 * targets.c (_bfd_get_symbol_version_string): Likewise.
272 (bfd_get_symbol_version_string): Likewise.
273 * bfd-in2.h: Regenerated.
274
2752020-03-24 Nick Clifton <nickc@redhat.com>
276 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
277
278 PR 25713
279 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
280 Win32 systems.
281
2822020-03-24 Nick Clifton <nickc@redhat.com>
283
284 PR 25681
285 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
286 segment to use for PT_GNU_RELRO, ignore empty sections in a
287 segment's current list.
288
2892020-03-24 H.J. Lu <hongjiu.lu@intel.com>
290
291 PR binutils/25717
292 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
293
2942020-03-24 H.J. Lu <hongjiu.lu@intel.com>
295
296 PR binutils/25708
297 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
298 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
299 on the previous _bfd_elf_get_symbol_version_string.
300 (_bfd_elf_get_symbol_version_string): Use it.
301
3022020-03-24 Alan Modra <amodra@gmail.com>
303
304 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
305 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
306 struct areltdata.
307
3082020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
309
310 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
311
3122020-03-23 Alan Modra <amodra@gmail.com>
313
314 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
315 symbol count. Allocate an extra byte to ensure name strings
316 are terminated. Sanity check name offsets. Release memory on
317 error return.
318
3192020-03-23 Alan Modra <amodra@gmail.com>
320
321 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
322 field hasn't been read. Remove unnecessary casts.
323
3242020-03-22 Alan Modra <amodra@gmail.com>
325
326 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
327 enough to read number of symbols.
328
3292020-03-20 H.J. Lu <hongjiu.lu@intel.com>
330
331 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
332 (EXECUTABLE_SUFFIX): Likewise.
333 * config.in: Regenerated.
334 * configure: Likewise.
335 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
336 _bfd_generic_close_and_cleanup.
337 (plugin_list_entry): Remove resolution_file, resolution_option,
338 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
339 lto_wrapper, gcc_env and initialized,
340 (need_lto_wrapper_p): Removed.
341 (get_lto_wrapper): Likewise.
342 (setup_lto_wrapper_env): Likewise.
343 (register_all_symbols_read): Likewise.
344 (egister_cleanup): Likewise.
345 (get_symbols): Likewise.
346 (add_input_file): Likewise.
347 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
348 (add_symbols): Updated.
349 (try_claim): Likewise.
350 (try_load_plugin): Likewise.
351 (bfd_plugin_canonicalize_symtab): Likewise.
352 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
353 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
354
3552020-03-19 H.J. Lu <hongjiu.lu@intel.com>
356
357 PR binutils/25640
358 * plugin.c (plugin_list_entry): Add has_symbol_type.
359 (add_symbols_v2): New function.
360 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
361 provides symbol type.
362 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
363 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
364 available.
365
3662020-03-20 Alan Modra <amodra@gmail.com>
367
368 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
369 enough to read number of symbols.
370
3712020-03-20 Alan Modra <amodra@gmail.com>
372
373 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
374 backend functions for NULL before calling.
375 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
376 (bfd_section_from_shdr, assign_section_numbers): Likewise.
377 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
378 * elfnn-ia64.c (ignore_errors): New function.
379 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
380
3812020-03-19 Nick Clifton <nickc@redhat.com>
382
383 PR 25676
384 * dwarf2.c (struct varinfo): Add unit_offset field to record the
385 location of the varinfo in the unit's debug info data. Change the
386 type of the stack field to a boolean.
387 (lookup_var_by_offset): New function. Returns the varinfo
388 structure for the variable described at the given offset in the
389 unit's debug info.
390 (scan_unit_for_symbols): Add support for variables which have the
391 DW_AT_specification attribute.
392
3932020-03-19 Nick Clifton <nickc@redhat.com>
394
395 PR 25699
396 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
397 error return.
398
3992020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
400
401 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
402
4032020-03-18 Nick Clifton <nickc@redhat.com>
404
405 PR 25673
406 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
407 memory access when processing a corrupt secondary reloc section.
408
4092020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
410
411 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
412 instead of calling abort.
413 * elf32-csky.c (csky_build_one_stub): Likewise.
414 * elf32-hppa.c (hppa_build_one_stub): Likewise.
415 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
416 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
417 * elf32-metag.c (metag_build_one_stub): Likewise.
418 * elf32-nios2.c (nios2_build_one_stub): Likewise.
419 * elf64-ppc.c (ppc_build_one_stub): Likewise.
420 (ppc_size_one_stub): Likewise.
421 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
422
4232020-03-17 Nick Clifton <nickc@redhat.com>
424
425 PR 25688
426 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
427 with error messages.
428
4292020-03-17 Nick Clifton <nickc@redhat.com>
430
431 PR 25687
432 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
433 free. Add free on another failure path.
434
4352020-03-16 Alan Modra <amodra@gmail.com>
436
437 PR 25675
438 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
439 we have a non-zero section count. Do lma comparison in octets.
440
4412020-03-16 Alan Modra <amodra@gmail.com>
442
443 * vms-alpha.c (dst_restore_location): Validate index into
444 dst_ptr_offsets array before accessing. Return status.
445 (dst_retrieve_location): Similarly, making "loc" parameter a
446 pointer to return value.
447 (_bfd_vms_slurp_etir): Update calls to above functions.
448
4492020-03-14 Kamil Rytarowski <n54@gmx.com>
450
451 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
452 targets.
453 * configure: Regenerated.
454
4552020-03-14 Alan Modra <amodra@gmail.com>
456
457 * section.c (BFD_FAKE_SECTIONS): Formatting.
458 * bfd-in2.h: Regenerate.
459
4602020-03-13 Kamil Rytarowski <n54@gmx.com>
461
462 * elf.c (elfcore_grok_netbsd_note): Add support for
463 NT_NETBSDCORE_LWPSTATUS notes.
464
4652020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
466
467 * bfd-in2.h: Regenerate.
468 * section.c (asection): Add already_assigned field.
469 (BFD_FAKE_SECTION): Add default initializer for it.
470 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
471 * elf32-arm.c (arm_build_one_stub): Add support for
472 non_contiguous_regions.
473 * elf32-csky.c (csky_build_one_stub): Likewise.
474 * elf32-hppa.c (hppa_build_one_stub): Likewise.
475 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
476 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
477 * elf32-metag.c (metag_build_one_stub): Likewise.
478 * elf32-nios2.c (nios2_build_one_stub): Likewise.
479 * elf64-ppc.c (ppc_build_one_stub): Likewise.
480 (ppc_size_one_stub): Likewise.
481 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
482 * elflink.c (elf_link_input_bfd): Likewise.
483
4842020-03-13 H.J. Lu <hongjiu.lu@intel.com>
485
486 PR ld/24920
487 * elf-linker-x86.h (elf_linker_x86_params): Add
488 static_before_all_inputs and has_dynamic_linker.
489 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
490 dynamic input objects if -static is passed at command-line
491 before all input files without --dynamic-linker unless
492 --no-dynamic-linker is used.
493
4942020-03-13 Kamil Rytarowski <n54@gmx.com>
495
496 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
497
4982020-03-13 Christian Eggers <ceggers@gmx.de>
499
500 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
501 "p_paddr" from "at".
502 * elfcode.h (bfd_from_remote_memory): Add units to several
503 parameters. New local "opb". Fix usage of p_align. Fix
504 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
505 call of target_read_memory.
506 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
507 calculation of "offset" and "output_offset".
508 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
509 from "offset" and fix calculation of "end" from "vma+size". Fix
510 comparison between "sh_addr" and "vma"/"output_offset".
511 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
512 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
513 member.
514 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
515 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
516 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
517 assignment of p_paddr from phdr_lma. Fix comparison between
518 "lma+size" and "next->lma".
519 (elf_sort_segments): Fix assignment from p_paddr to lma.
520 (assign_file_positions_for_load_sections): Add unit (bytes) to
521 local "align". Fix calculation of local "off_adjust". Fix
522 calculation of local "filehdr_vaddr".
523 (assign_file_positions_for_non_load_sections): New local "opb".
524 Fix calculation of "end" from "p_size". Fix comparison between
525 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
526 from "end" and "p_vaddr".
527 (rewrite_elf_program_header): Fix comparison between p_vaddr and
528 vma. Fix assignment to p_paddr from lma. Fix comparison between
529 p_paddr and lma. Fix assignment to p_paddr from lma.
530 * merge.c (sec_merge_emit): New local "opb". Convert
531 "alignment_power" to octets.
532 (_bfd_add_merge_section): New locals "alignment_power" and
533 "opb". Fix comparison between "alignment_power" and
534 "sizeof(align)".
535 (_bfd_merge_sections): New local "opb". Divide size by opb
536 before checking align mask.
537
5382020-03-13 Christian Eggers <ceggers@gmx.de>
539
540 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
541 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
542 section LMA/VMA.
543 (_bfd_elf_make_section_from_phdr): Similarly.
544 (elf_fake_sections): Fix calculation of
545 Elf_Internal_shdr::sh_addr from section VMA.
546 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
547 and bytes.
548 (assign_file_positions_for_load_sections): Fix calculations of
549 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
550 comparison between program header address and section LMA.
551 (assign_file_positions_for_non_load_sections): Likewise.
552 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
553 (IS_CONTAINED_BY_VMA): Add parameter opb.
554 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
555 INCLUDE_SECTION_IN_SEGMENT): Likewise.
556 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
557 Fix calculations of p_addr_valid and p_vaddr_offset.
558 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
559 with octets per byte when comparing against p_vaddr.
560
5612020-03-11 Alan Modra <amodra@gmail.com>
562
563 * som.c (setup_sections): Sanity check subspace.name.
564
5652020-03-11 Alan Modra <amodra@gmail.com>
566
567 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
568
5692020-03-10 Alan Modra <amodra@gmail.com>
570
571 PR 25648
572 * ihex.c (ihex_write_object_contents): Don't assume ordering of
573 addresses here.
574
5752020-03-09 Alan Modra <amodra@gmail.com>
576
577 * wasm-module.c (wasm_scan): Sanity check file name length
578 before allocating memory. Move common section setup code. Do
579 without bfd_tell to calculate section size.
580
5812020-03-06 Nick Clifton <nickc@redhat.com>
582
583 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
584 with error messages and failure return values.
585
5862020-03-05 Max Filippov <jcmvbkbc@gmail.com>
587
588 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
589 relocation sections for any removed reference to a dynamic symbol.
590
5912020-03-05 Nick Clifton <nickc@redhat.com>
592
593 * elf-bfd.h (struct elf_backend_data): Add new fields:
594 init_secondary_reloc_section, slurp_secondary_reloc_section,
595 write_secondary_reloc_section.
596 (_bfd_elf_init_secondary_reloc_section): Prototype.
597 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
598 (_bfd_elf_write_secondary_reloc_section): Prototype.
599 * elf.c ( bfd_section_from_shdr): Invoke the new
600 init_secondary_reloc_section backend function, if defined, when a
601 second reloc section is encountered.
602 (swap_out_syms): Invoke the new symbol_section_index function, if
603 defined, when computing the section index of an OS/PROC specific
604 symbol.
605 (_bfd_elf_init_secondary_reloc_section): New function.
606 (_bfd_elf_slurp_secondary_reloc_section): New function.
607 (_bfd_elf_write_secondary_reloc_section): New function.
608 (_bfd_elf_copy_special_section_fields): New function.
609 * elfcode.h (elf_write_relocs): Invoke the new
610 write_secondary_relocs function, if defined, in order to emit
611 secondary relocs.
612 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
613 function, if defined, in order to read in secondary relocs.
614 * elfxx-target.h (elf_backend_copy_special_section_fields):
615 Provide a non-NULL default definition.
616 (elf_backend_init_secondary_reloc_section): Likewise.
617 (elf_backend_slurp_secondary_reloc_section): Likewise.
618 (elf_backend_write_secondary_reloc_section): Likewise.
619 (struct elf_backend_data elfNN_bed): Add initialisers for the new
620 fields.
621 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
622 * configure: Regenerate.
623
6242020-03-05 Alan Modra <amodra@gmail.com>
625
626 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
627 against file size before allocating memory. Use bfd_alloc rather
628 than bfd_zalloc for carsym/strings memory.
629
6302020-03-04 Alan Modra <amodra@gmail.com>
631
632 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
633 sh_addr mod sh_addalign is zero.
634
6352020-03-04 Alan Modra <amodra@gmail.com>
636
637 * format.c (bfd_check_format_matches): Call cleanup on error exit.
638
6392020-03-03 Alan Modra <amodra@gmail.com>
640
641 * format.c (struct bfd_preserve): Add cleanup field.
642 (bfd_preserve_save): Add cleanup param and save.
643 (bfd_preserve_restore): Return cleanup.
644 (bfd_preserve_finish): Call the cleanup for the discarded match.
645 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
646 and clear when preserving a match. Restore cleanup too when
647 restoring that match.
648
6492020-03-02 Alan Modra <amodra@gmail.com>
650
651 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
652 * hpux-core.c (hpux_core_core_file_p): Update prototype.
653 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
654 (core_sco5_vec): Correct initialisers.
655
6562020-03-02 Alan Modra <amodra@gmail.com>
657
658 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
659 * aix5ppc-core.c (xcoff64_core_p): Likewise.
660 * cisco-core.c (cisco_core_file_validate): Likewise.
661 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
662 * hpux-core.c (hpux_core_core_file_p): Likewise.
663 * irix-core.c (irix_core_core_file_p): Likewise.
664 * lynx-core.c (lynx_core_file_p): Likewise.
665 * netbsd-core.c (netbsd_core_file_p): Likewise.
666 * osf-core.c (osf_core_core_file_p): Likewise.
667 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
668 * sco5-core.c (sco5_core_file_p): Likewise.
669
6702020-03-02 H.J. Lu <hongjiu.lu@intel.com>
671
672 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
673
6742020-03-02 Alan Modra <amodra@gmail.com>
675
676 * targets.c (bfd_cleanup): New typedef.
677 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
678 * libbfd-in.h (_bfd_no_cleanup): Define.
679 * format.c (bfd_reinit): Add cleanup parameter, call it.
680 (bfd_check_format_matches): Set cleanup from _bfd_check_format
681 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
682 * aout-target.h (callback, object_p): Return bfd_cleanup.
683 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
684 * archive.c (bfd_generic_archive_p): Likewise.
685 * binary.c (binary_object_p): Likewise.
686 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
687 * coff-ia64.c (ia64coff_object_p): Likewise.
688 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
689 * coff-sh.c (coff_small_object_p): Likewise.
690 * coff-stgo32.c (go32_check_format): Likewise.
691 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
692 (xcoff64_core_p): Likewise.
693 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
694 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
695 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
696 * elfcode.h (elf_object_p): Likewise.
697 * elfcore.h (elf_core_file_p): Likewise.
698 * i386msdos.c (msdos_object_p): Likewise.
699 * ihex.c (ihex_object_p): Likewise.
700 * libaout.h (some_aout_object_p): Likewise.
701 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
702 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
703 * libbfd.c (_bfd_dummy_target): Likewise.
704 * libcoff-in.h (coff_object_p): Likewise.
705 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
706 (bfd_mach_o_arm64_core_p): Likewise.
707 * mach-o-arm.c (bfd_mach_o_arm_object_p),
708 (bfd_mach_o_arm_core_p): Likewise.
709 * mach-o-i386.c (bfd_mach_o_i386_object_p),
710 (bfd_mach_o_i386_core_p): Likewise.
711 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
712 (bfd_mach_o_x86_64_core_p): Likewise.
713 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
714 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
715 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
716 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
717 * mmo.c (mmo_object_p): Likewise.
718 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
719 * peicode.h (coff_real_object_p, pe_ILF_object_p),
720 (pe_bfd_object_p): Likewise.
721 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
722 * ppcboot.c (ppcboot_object_p): Likewise.
723 * rs6000-core.c (rs6000coff_core_p): Likewise.
724 * som.c (som_object_setup, som_object_p): Likewise.
725 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
726 * tekhex.c (tekhex_object_p): Likewise.
727 * vms-alpha.c (alpha_vms_object_p): Likewise.
728 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
729 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
730 * wasm-module.c (wasm_object_p): Likewise.
731 * xsym.c (bfd_sym_object_p): Likewise.
732 * xsym.h (bfd_sym_object_p): Likewise.
733 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
734 return type.
735 * pdp11.c (some_aout_object_p): Likewise.
736 * plugin.c (register_ld_plugin_object_p): Update object_p
737 parameter type.
738 * plugin.h (register_ld_plugin_object_p): Likewise.
739 * bfd-in2.h: Regenerate.
740 * libbfd.h: Regenerate.
741 * libcoff.h: Regenerate.
742
7432020-03-02 Alan Modra <amodra@gmail.com>
744
745 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
746 applicable section flags.
747 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
748 (mips_ecoff_bele_vec): Likewise.
749 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
750 and .sbss sections.
751 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
752 (_bfd_ecoff_styp_to_sec_flags): Likewise.
753
7542020-03-02 Alan Modra <amodra@gmail.com>
755
756 * elf32-m32r.c (m32r_elf_section_flags): New function.
757 (elf_backend_section_flags): Define.
758 * elf32-nds32.c (nds32_elf_section_flags): New function.
759 (elf_backend_section_flags): Define.
760 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
761 .sbss and .sdata sections.
762 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
763 for SHF_V850_GPREL sections.
764 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
765 FIXME.
766 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
767 for SHF_PARISC_SHORT sections.
768 * elf64-ppc.c (ppc64_elf_section_flags): New function.
769 (elf_backend_section_flags): Define.
770 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
771 for SHF_MIPS_GPREL sections. Delete FIXME.
772
7732020-03-02 Alan Modra <amodra@gmail.com>
774
775 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
776 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
777 calling elf_backend_section_flags with adjusted params. Use
778 newsect->flags past that point.
779 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
780 special sections.
781 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
782 to have their type overridden, and all sh_flags but processor and
783 os specific.
784 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
785 * elf32-mep.c (mep_elf_section_flags): Likewise.
786 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
787 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
788 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
789 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
790 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
791 stub BFD and non-aarch64 input files when scanning for stubs.
792
7932020-03-02 Alan Modra <amodra@gmail.com>
794
795 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
796 limit to decompressed element size.
797
7982020-03-02 Alan Modra <amodra@gmail.com>
799
800 * vms-lib.c (vms_traverse_index): Add recur_count param and
801 update calls. Fail on excessive recursion.
802
8032020-03-02 Alan Modra <amodra@gmail.com>
804
805 * vms-alpha.c (vms_get_remaining_object_record): Use
806 bfd_realloc_or_free rather than bfd_realloc.
807 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
808 (dst_define_location, parse_module): Likewise, and check realloc
809 return status before using memory. Return status from function
810 adjusting all callers.
811
8122020-02-28 Alan Modra <amodra@gmail.com>
813
814 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
815
8162020-02-28 Alan Modra <amodra@gmail.com>
817
818 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
819 Remove duplicate undersize check.
820
8212020-02-27 Alan Modra <amodra@gmail.com>
822
823 PR 24511
824 * mmo.c (mmo_scan): Set SEC_DATA for .data.
825
8262020-02-27 Alan Modra <amodra@gmail.com>
827
828 PR 24511
829 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
830 (coff_section_type): Adjust comment.
831 (decode_section_type): Likewise. Call coff_section_type before
832 decode_section_type.
833 (bfd_decode_symclass): Use 'c' for common sections other than
834 the standard one.
835
8362020-02-27 Alan Modra <amodra@gmail.com>
837
838 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
839 malloc'd block.
840
8412020-02-27 Alan Modra <amodra@gmail.com>
842
843 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
844 if file is an archive element.
845 * bfd-in2.h: Regenerate.
846
8472020-02-26 Alan Modra <amodra@gmail.com>
848
849 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
850 bfd_set_error on failing test. Don't bother changing bfd_error on
851 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
852 Check sym name is within string buffer. Use size_t for some vars.
853 (do_slurp_coff_armap): Use size_t for some variables, fix size of
854 int_buf. Don't change bfd_error on file read error. Use
855 _bfd_mul_overflow when calculating carsym buffer size. Reorder
856 calculations to catch overflows before they occur. malloc and
857 free raw armap rather than using bfd_alloc. Read raw armap before
858 allocating carsym+strings buffer.
859 (_bfd_slurp_extended_name_table): Localize variables. Check
860 name size against file size.
861
8622020-02-26 Alan Modra <amodra@gmail.com>
863
864 * vms-lib.c (vms_lib_read_index): Release correct buffer.
865
8662020-02-26 Alan Modra <amodra@gmail.com>
867
868 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
869 malloc. Check for NULL return from bfd_malloc.
870 (rx_table_find, rx_table_map): Likewise.
871 (rx_set_section_contents): Check bfd_alloc return.
872 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
873
8742020-02-26 Alan Modra <amodra@gmail.com>
875
876 * aoutx.h: Indent labels correctly. Format error strings.
877 * archive.c: Likewise.
878 * archive64.c: Likewise.
879 * coff-arm.c: Likewise.
880 * coff-rs6000.c: Likewise.
881 * coff-stgo32.c: Likewise.
882 * cpu-arm.c: Likewise.
883 * dwarf2.c: Likewise.
884 * elf-ifunc.c: Likewise.
885 * elf-properties.c: Likewise.
886 * elf-s390-common.c: Likewise.
887 * elf-strtab.c: Likewise.
888 * elf.c: Likewise.
889 * elf32-arm.c: Likewise.
890 * elf32-bfin.c: Likewise.
891 * elf32-cr16.c: Likewise.
892 * elf32-csky.c: Likewise.
893 * elf32-i386.c: Likewise.
894 * elf32-m68k.c: Likewise.
895 * elf32-msp430.c: Likewise.
896 * elf32-nds32.c: Likewise.
897 * elf32-nios2.c: Likewise.
898 * elf32-pru.c: Likewise.
899 * elf32-xtensa.c: Likewise.
900 * elf64-ia64-vms.c: Likewise.
901 * elf64-x86-64.c: Likewise.
902 * elfcode.h: Likewise.
903 * elfcore.h: Likewise.
904 * elflink.c: Likewise.
905 * elfnn-aarch64.c: Likewise.
906 * elfnn-ia64.c: Likewise.
907 * elfnn-riscv.c: Likewise.
908 * elfxx-mips.c: Likewise.
909 * elfxx-sparc.c: Likewise.
910 * elfxx-x86.c: Likewise.
911 * i386lynx.c: Likewise.
912 * merge.c: Likewise.
913 * pdp11.c: Likewise.
914 * plugin.c: Likewise.
915 * reloc.c: Likewise.
916
9172020-02-26 Alan Modra <amodra@gmail.com>
918
919 PR 25593
920 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
921 "dyn_loaded".
922 (bfd_elf_add_dt_needed_tag): Declare.
923 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
924 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
925 from elf_add_dt_needed_tag. Remove soname and doit param.
926 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
927 to see whether as-needed lib is already loaded, use dyn_loaded
928 list instead. When saving and restoring around as-needed lib
929 handle possibility that dynstr has not been initialised. Don't
930 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
931 Mark libs loaded via DT_NEEDED entries of other libs with
932 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
933 the output.
934 (elf_link_check_versioned_symbol): Remove now unneccesary
935 DYNAMIC check when traversing dyn_loaded list.
936
9372020-02-26 Alan Modra <amodra@gmail.com>
938
939 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
940
9412020-02-25 H.J. Lu <hongjiu.lu@intel.com>
942
943 PR binutils/25584
944 * plugin.c (need_lto_wrapper_p): New.
945 (bfd_plugin_set_program_name): Add an int argument to set
946 need_lto_wrapper_p.
947 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
948 set.
949 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
950
9512020-02-24 Alan Modra <amodra@gmail.com>
952
953 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
954
9552020-02-24 Alan Modra <amodra@gmail.com>
956
957 * vms-lib.c (struct carsym_mem): Add limit.
958 (vms_add_index): Heed limit.
959 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
960 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
961 Always return actual number read.
962 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
963 assertion with error exit.
964
9652020-02-22 Alan Modra <amodra@gmail.com>
966
967 PR 25585
968 * elf.c (assign_file_positions_for_load_sections): Continue linking
969 on "PHDR segment not covered by LOAD segment" errors.
970
9712020-02-21 Alan Modra <amodra@gmail.com>
972
973 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
974 overflow check.
975 (bfd_mach_o_canonicalize_reloc): Likewise.
976 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
977 counts and offsets against file size.
978 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
979 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
980 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
981 against file size. Delete symbol table error message.
982 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
983 against file size.
984 (bfd_mach_o_read_symtab): Likewise.
985 (bfd_mach_o_read_command): Pass file size.
986 (bfd_mach_o_scan): Sanity check command count against file size.
987
9882020-02-21 Alan Modra <amodra@gmail.com>
989
990 PR 25569
991 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
992 "text", "data" and "bss" section pointer vars. Don't update
993 section size, just exec header sizes.
994 (adjust_sizes_and_vmas): Don't update text section size. Set
995 initial exec header a_text. Print exec headers sizes.
996 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
997 (adjust_sizes_and_vmas): Similarly. Formatting.
998 (final_link): Correct final file extension.
999
10002020-02-20 Nick Clifton <nickc@redhat.com>
1001
1002 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1003 callback.
1004 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1005 default definition.
1006 (elfNN_bed): Initialise the symbol_section_index field.
1007 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1008 OS and PROC specific section indicies. Warn if converting other
1009 reserved incidies to SHN_ABS.
1010
10112020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1012
1013 PR 25537
1014 * cpu-z80.c: Add machine type compatibility checking.
1015
10162020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1017
1018 PR binutils/25355
1019 * plugin.c (plugin_list_entry): Remove handle.
1020 (try_load_plugin): Call dlclose before return.
1021
10222020-02-19 Alan Modra <amodra@gmail.com>
1023
1024 * libbfd-in.h (_bfd_constant_p): Define.
1025 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1026 file size before allocating memory.
1027 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1028 * elf.c (bfd_elf_get_str_section): Likewise.
1029 (_bfd_elf_slurp_version_tables): Likewise.
1030 * libbfd.h: Regenerate.
1031
10322020-02-19 Alan Modra <amodra@gmail.com>
1033
1034 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1035 * aoutx.h (aout_get_external_symbols): Replace calls to
1036 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1037 (slurp_reloc_table): Likewise.
1038 * archive.c (do_slurp_bsd_armap): Likewise.
1039 (do_slurp_coff_armap): Likewise.
1040 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1041 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1042 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1043 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1044 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1045 (_bfd_coff_get_external_symbols): Likewise.
1046 * ecoff.c (ecoff_slurp_symbolic_header),
1047 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1048 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1049 (ecoff_indirect_link_order): Likewise.
1050 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1051 (_bfd_elf_slurp_version_tables): Likewise.
1052 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1053 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1054 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1055 * elf64-alpha.c (READ): Likewise.
1056 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1057 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1058 * elfcode.h (elf_slurp_symbol_table),
1059 (elf_slurp_reloc_table_from_section): Likewise.
1060 * elflink.c (elf_link_add_object_symbols),
1061 (elf_link_check_versioned_symbol): Likewise.
1062 * elfxx-mips.c (READ): Likewise.
1063 * i386lynx.c (slurp_reloc_table): Likewise.
1064 * lynx-core.c (lynx_core_file_p): Likewise.
1065 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1066 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1067 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1068 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1069 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1070 (bfd_pef_parse_symbols): Likewise.
1071 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1072 * som.c (setup_sections, som_slurp_string_table),
1073 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1074 (som_bfd_fill_in_ar_symbols): Likewise.
1075 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1076 (evax_bfd_print_image): Likewise.
1077 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1078 * wasm-module.c (wasm_scan): Likewise.
1079 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1080 * xsym.c (bfd_sym_read_name_table),
1081 (bfd_sym_print_type_information_table_entry): Likewise.
1082 * libbfd.h: Regenerate.
1083
10842020-02-19 Alan Modra <amodra@gmail.com>
1085
1086 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1087 reading external relocs.
1088 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1089 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1090 after bfd_bread.
1091 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1092 bfd_release.
1093 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1094 (m32c_elf_relax_section): Likewise.
1095 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1096 (rl78_elf_relax_section): Likewise.
1097 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1098 (elf32_rx_relax_section): Likewise.
1099 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1100 parameter types and use..
1101 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1102 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1103 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1104 being read from file, just the extra.
1105 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1106 after reading external syms. Free on failure.
1107
11082020-02-19 Alan Modra <amodra@gmail.com>
1109
1110 * coffcode.h (buy_and_read, coff_slurp_line_table),
1111 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1112 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1113 corresponding bfd_alloc call. Adjust variables to suit.
1114 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1115 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1116 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1117 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1118 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1119 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1120 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1121 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1122 * elf64-alpha.c (READ): Likewise.
1123 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1124 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1125 (bfd_from_remote_memory): Likewise.
1126 * elfcore.h (core_find_build_id): Likewise.
1127 * elfxx-mips.c (READ): Likewise.
1128 * mach-o.c (bfd_mach_o_mangle_sections),
1129 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1130 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1131 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1132 * som.c (setup_sections, som_prep_for_fixups)
1133 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1134 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1135 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1136 (som_bfd_ar_write_symbol_stuff): Likewise.
1137 * vms-alpha.c (vector_grow1): Likewise.
1138 * vms-lib.c (vms_add_index): Likewise.
1139 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1140 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1141 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1142 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1143 (bfd_alloc2, bfd_zalloc2): Delete.
1144 (_bfd_mul_overflow): Define.
1145 * libbfd.h: Regenerate.
1146
11472020-02-19 Alan Modra <amodra@gmail.com>
1148
1149 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1150 bfd_zalloc2.
1151 (assign_section_numbers): Likewise.
1152 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1153 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1154 bfd_malloc2, size_t amt, and unsigned tls_count.
1155 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1156 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1157 (elf_output_implib): Use bfd_alloc.
1158
11592020-02-19 Alan Modra <amodra@gmail.com>
1160
1161 * bfd.c (struct bfd): Move format and direction to other
1162 bitfields. Add "size".
1163 * bfdio.c (bfd_get_size): Cache size when not writing file.
1164 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1165 returning zero, ie. unknown.
1166 (bfd_get_alt_debug_link_info): Likewise.
1167 * bfd-in2.h: Regenerate.
1168
11692020-02-19 Alan Modra <amodra@gmail.com>
1170
1171 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1172 bfd_get_file_size twice.
1173 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1174 zero, ie. unknown, return.
1175 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1176 * elfcode.h (elf_swap_shdr_in): Likewise.
1177 (elf_object_p): Don't call bfd_get_file_size twice and correct
1178 file size check.
1179
11802020-02-19 Alan Modra <amodra@gmail.com>
1181
1182 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1183 FALSE if memory alloc fails. Adjust calls.
1184 * som.c (som_prep_for_fixups): Likewise.
1185 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1186 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1187 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1188 * som.c (som_build_and_write_symbol_table): Return via error_return
1189 on seek failure.
1190 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1191 (VEC_APPEND_EL): Delete.
1192 (vector_grow1): Return pointer to element. Catch overflow.
1193 Return NULL on memory allocation failure.
1194 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1195 (alpha_vms_add_fixup_ca): Likewise.
1196 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1197 before using.
1198 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1199
12002020-02-19 Alan Modra <amodra@gmail.com>
1201
1202 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1203 * aout-target.h (object_p): Likewise.
1204 * aout-tic30.c (tic30_aout_object_p): Likewise.
1205 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1206 (emit_stringtab, write_syms, link_hash_table_create),
1207 (aout_link_write_other_symbol): Likewise.
1208 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1209 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1210 (_bfd_compute_and_write_armap): Likewise.
1211 * archures.c (bfd_arch_list): Likewise.
1212 * bfd.c (bfd_record_phdr): Likewise.
1213 * binary.c (binary_canonicalize_symtab): Likewise.
1214 * cisco-core.c (cisco_core_file_validate): Likewise.
1215 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1216 (find_arm_glue, record_arm_to_thumb_glue),
1217 (record_thumb_to_arm_glue): Likewise.
1218 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1219 (ppc_allocate_toc_section): Likewise.
1220 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1221 * coff-sh.c (sh_relax_section): Likewise.
1222 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1223 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1224 (coff_set_alignment_hook, coff_mkobject),
1225 (coff_compute_section_file_positions): Likewise.
1226 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1227 (coff_find_nearest_line_with_names),
1228 ( bfd_coff_set_symbol_class): Likewise.
1229 * cofflink.c (_bfd_coff_link_hash_table_create),
1230 (_bfd_coff_link_input_bfd): Likewise.
1231 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1232 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1233 (build_line_info_table, sort_line_sequences),
1234 (line_info_add_include_dir, line_info_add_file_name),
1235 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1236 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1237 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1238 (_bfd_ecoff_find_nearest_line),
1239 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1240 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1241 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1242 * elf-m10300.c (mn10300_elf_relax_section),
1243 (elf32_mn10300_link_hash_table_create): Likewise.
1244 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1245 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1246 * elf32-arm.c (elf32_arm_link_hash_table_create),
1247 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1248 (elf32_arm_new_section_hook): Likewise.
1249 * elf32-avr.c (elf_avr_new_section_hook),
1250 (elf32_avr_link_hash_table_create, get_local_syms),
1251 (elf32_avr_setup_section_lists): Likewise.
1252 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1253 (bfin_link_hash_table_create): Likewise.
1254 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1255 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1256 * elf32-csky.c (csky_elf_link_hash_table_create),
1257 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1258 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1259 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1260 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1261 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1262 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1263 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1264 (m32r_elf_check_relocs): Likewise.
1265 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1266 (elf32_m68hc11_setup_section_lists),
1267 (elf32_m68hc11_size_stubs): Likewise.
1268 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1269 * elf32-metag.c (elf_metag_link_hash_table_create),
1270 (elf_metag_setup_section_lists): Likewise.
1271 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1272 (microblaze_elf_check_relocs): Likewise.
1273 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1274 (nds32_elf_check_relocs): Likewise.
1275 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1276 (get_local_syms, nios2_elf32_check_relocs),
1277 (nios2_elf32_link_hash_table_create): Likewise.
1278 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1279 (or1k_elf_check_relocs): Likewise.
1280 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1281 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1282 * elf32-s390.c (elf_s390_link_hash_table_create),
1283 (elf_s390_check_relocs): Likewise.
1284 * elf32-score.c (score_elf_create_got_section),
1285 (s3_elf32_score_new_section_hook),
1286 (elf32_score_link_hash_table_create): Likewise.
1287 * elf32-score7.c (score_elf_create_got_section),
1288 (s7_elf32_score_new_section_hook): Likewise.
1289 * elf32-sh.c (sh_elf_link_hash_table_create),
1290 (sh_elf_check_relocs): Likewise.
1291 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1292 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1293 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1294 (tilepro_elf_check_relocs): Likewise.
1295 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1296 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1297 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1298 (elf_xtensa_new_section_hook): Likewise.
1299 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1300 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1301 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1302 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1303 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1304 * elf64-ppc.c (ppc64_elf_new_section_hook),
1305 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1306 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1307 * elf64-s390.c (elf_s390_link_hash_table_create),
1308 (elf_s390_check_relocs): Likewise.
1309 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1310 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1311 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1312 (elf_link_add_archive_symbols, compute_bucket_count),
1313 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1314 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1315 (bfd_elf_final_link): Likewise.
1316 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1317 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1318 (elfNN_aarch64_new_section_hook): Likewise.
1319 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1320 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1321 (riscv_elf_check_relocs): Likewise.
1322 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1323 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1324 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1325 (_bfd_mips_elf_link_hash_table_create): Likewise.
1326 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1327 (_bfd_sparc_elf_check_relocs),
1328 (_bfd_sparc_elf_new_section_hook): Likewise.
1329 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1330 (tilegx_elf_check_relocs): Likewise.
1331 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1332 * format.c (bfd_check_format_matches): Likewise.
1333 * hash.c (_bfd_stringtab_init): Likewise.
1334 * ihex.c (ihex_scan): Likewise.
1335 * irix-core.c (irix_core_core_file_p): Likewise.
1336 * linker.c (bfd_wrapped_link_hash_lookup),
1337 (_bfd_generic_link_hash_table_create),
1338 (_bfd_generic_reloc_link_order): Likewise.
1339 * lynx-core.c (lynx_core_file_p): Likewise.
1340 * netbsd-core.c (netbsd_core_file_p): Likewise.
1341 * osf-core.c (osf_core_core_file_p): Likewise.
1342 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1343 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1344 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1345 * peicode.h (pe_mkobject): Likewise.
1346 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1347 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1348 * sco5-core.c (read_uarea): Likewise.
1349 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1350 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1351 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1352 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1353 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1354 * srec.c (srec_scan): Likewise.
1355 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1356 * targets.c (bfd_target_list): Likewise.
1357 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1358 * trad-core.c (trad_unix_core_file_p): Likewise.
1359 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1360 (vms_new_section_hook): Likewise.
1361 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1362 * xcofflink.c (xcoff_get_section_contents),
1363 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1364 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1365 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1366
13672020-02-19 Alan Modra <amodra@gmail.com>
1368
1369 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1370
13712020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1372
1373 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1374 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1375 a build_list_p argument. Don't search plugin_list. Short circuit
1376 when building the plugin list.
1377 (has_plugin): Renamed to has_plugin_list.
1378 (bfd_plugin_set_plugin): Don't set has_plugin.
1379 (bfd_plugin_specified_p): Check plugin_list instead.
1380 (build_plugin_list): New function.
1381 (load_plugin): Call build_plugin_list and use plugin_list.
1382
13832020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1384
1385 PR binutils/25355
1386 * plugin.c (try_claim): Always clean up for LTO wrapper.
1387 (try_load_plugin): Treat each object as independent. Create a
1388 copy for plugin name.
1389
13902020-02-11 Nick Clifton <nickc@redhat.com>
1391
1392 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1393 for addresses in print statements.
1394 (msp430_elf_relax_delete_bytes): Likewise.
1395 (msp430_elf_relax_add_words): Likewise.
1396 (msp430_elf_relax_section): Likewise.
1397
13982020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1399
1400 * plugin.c (add_symbols): Clear plugin_data memory.
1401
14022020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1403
1404 PR binutils/25355
1405 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1406 (EXECUTABLE_SUFFIX): Likewise.
1407 * config.in: Regenerated.
1408 * configure: Likewise.
1409 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1410 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1411 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1412 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1413 (get_lto_wrapper): New.
1414 (setup_lto_wrapper_env): Likewise.
1415 (current_plugin): Likewise.
1416 (register_all_symbols_read): Likewise.
1417 (register_cleanup): Likewise.
1418 (get_symbols): Likewise.
1419 (add_input_file): Likewise.
1420 (bfd_plugin_close_and_cleanup): Likewise.
1421 (claim_file): Removed.
1422 (register_claim_file): Set current_plugin->claim_file.
1423 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1424 lto_syms in current_plugin.
1425 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1426 all_symbols_read handler. Copy real symbols to plugin_data.
1427 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1428 (try_load_plugin): Don't reuse the previous plugin for LTO
1429 wrapper. Set up GCC LTO wrapper if possible. Don't set
1430 plugin_list_iter->claim_file.
1431 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1432 possible.
1433 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1434 real_syms.
1435
14362020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1437
1438 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1439 check if previous instruction matches a conditional jump inserted
1440 earlier. Invert conditional jump and delete branch in this case.
1441
14422020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1443
1444 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1445 msp430_elf_relax_add_words. Support insertion of either one or two
1446 words.
1447 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1448 needs to be grown. Handle insertion of branch instruction to replace
1449 jump.
1450
14512020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1452
1453 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1454 debugging relocations.
1455 (msp430_elf_relax_delete_bytes): Likewise.
1456 (msp430_elf_relax_add_two_words): Likewise.
1457 (msp430_elf_relax_section): Likewise.
1458
14592020-02-10 Alan Modra <amodra@gmail.com>
1460
1461 * archures.c: Wrap overlong z80 comments.
1462 * bfd-in2.h: Regenerate.
1463
14642020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1465
1466 PR 25469
1467 * archures.c: Add GBZ80 and Z80N machine values.
1468 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1469 * coff-z80.c: Add support for new reloc.
1470 * coffcode.h: Add support for new machine values.
1471 * cpu-z80.c: Add support for new machine names.
1472 * elf32-z80.c: Add support for new reloc.
1473 * bfd-in2.h: Regenerate.
1474 * libbfd.h: Regenerate.
1475
14762020-02-07 Nick Clifton <nickc@redhat.com>
1477
1478 PR 23932
1479 * elf.c (rewrite_elf_program_header): Do not complain if no
1480 sections are mapped to a segment.
1481
14822020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1483
1484 PR ld/25490
1485 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1486 for garbage collection on __patchable_function_entries section
1487 without linked-to section.
1488
14892020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1490
1491 PR gas/25381
1492 * bfd-in2.h: Regenerated.
1493 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1494 on section if gc_mark of any of its linked-to sections is set
1495 and don't set gc_mark again.
1496 * section.c (asection): Add linked_to_symbol_name to map_head
1497 union.
1498
14992020-02-06 Maciej W. Rozycki <macro@wdc.com>
1500
1501 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1502 reporting an unrecognized instruction with R_V850_LONGJUMP.
1503
15042020-02-05 Alan Modra <amodra@gmail.com>
1505
1506 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1507
15082020-02-04 Alan Modra <amodra@gmail.com>
1509
1510 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1511 R_PPC_VLE_ADDR20, goto copy_reloc.
1512
15132020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1514
1515 * bfd-in2.h: Regenerated.
1516 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1517
15182020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1519
1520 PR gas/25380
1521 * bfd-in2.h: Regenerated.
1522 * ecoff.c (bfd_debug_section): Add section_id.
1523 * section.c (bfd_section): Add section_id.
1524 (SEC_ASSEMBLER_SECTION_ID): New.
1525 (BFD_FAKE_SECTION): Add section_id.
1526
15272020-02-01 Nick Clifton <nickc@redhat.com>
1528
1529 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1530 obsolete list.
1531
15322020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1533
1534 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1535 encodings are relative to the GOT on nios2, too.
1536
15372020-01-31 Alan Modra <amodra@gmail.com>
1538
1539 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1540 file. Use $< and $@ in rules.
1541 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1542 (elf32-ia64.c, elf64-ia64.c): Likewise.
1543 (elf32-riscv.c, elf64-riscv.c): Likewise.
1544 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1545 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1546 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1547 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1548 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1549 * Makefile.in: Regenerate.
1550
15512020-01-31 Alan Modra <amodra@gmail.com>
1552
1553 PR 4110
1554 * elf.c (setup_group): Don't clear entire section contents,
1555 just the padding after group flags. Release alloc'd memory
1556 after a seek or read failure.
1557
15582020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1559
1560 * peXXigen.c (pe_is_repro): New function.
1561 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1562 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1563
15642020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1565
1566 * peXXigen.c (debug_type_names): Add names for new debug data type
1567 values.
1568
15692020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1570
1571 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1572 inner loop. Fix a memory leak.
1573
15742020-01-30 Alan Modra <amodra@gmail.com>
1575
1576 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1577 or obj_coff_keep_strings here.
1578 (coff_get_normalized_symtab): Free external syms directly.
1579 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1580 on error exit path.
1581
15822020-01-27 Jim Wilson <jimw@sifive.com>
1583
1584 * cpu-riscv.c (riscv_scan): New.
1585 (N): Change bfd_default_scan to riscv_scan.
1586
15872020-01-27 Andreas Schwab <schwab@suse.de>
1588
1589 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1590 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1591 * Makefile.in: Regenerate.
1592 * cpu-plugin.c: Remove.
1593 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1594 (bfd_plugin_arch): Remove declaration.
1595 * bfd-in2.h: Regenerate.
1596 * po/SRC-POTFILES.in: Regenerate.
1597
15982020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1599 Alan Modra <amodra@gmail.com>
1600
1601 PR ld/25458
1602 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1603
16042020-01-24 Jim Wilson <jimw@sifive.com>
1605
1606 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1607 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1608 avoid over long line.
1609
16102020-01-24 Nick Clifton <nickc@redhat.com>
1611
1612 PR 25447
1613 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1614 syms and keep strings flags as these may have been set in order to
1615 prevent a bogus call to free.
1616
16172020-01-23 Nick Clifton <nickc@redhat.com>
1618
1619 * po/fr.po: Updated French translation.
1620
16212020-01-23 Alan Modra <amodra@gmail.com>
1622
1623 PR 25444
1624 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1625 by zero when p_align is zero.
1626
16272020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1628
1629 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1630 (riscv_prefix_cmp): Likewise.
1631 (riscv_non_std_ext_p): Deleted.
1632 (riscv_std_sv_ext_p): Likewise.
1633 (riscv_non_std_sv_ext_p): Likewise.
1634 (riscv_merge_non_std_and_sv_ext): Rename to...
1635 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1636 (riscv_merge_arch_attr_info): Replace 3 calls to
1637 riscv_merge_non_std_and_sv_ext with single call to
1638 riscv_merge_multi_letter_ext.
1639 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1640 encounter a 'z' prefix.
1641 (riscv_get_prefix_class): New function, return prefix class based
1642 on first few characters of input string.
1643 (riscv_parse_config): New structure to factor out minor differences
1644 in extension class parsing behaviour.
1645 (riscv_parse_sv_or_non_std_ext): Rename to...
1646 (riscv_parse_prefixed_ext): and parameterise with
1647 riscv_parse_config.
1648 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1649 (riscv_multi_letter_ext_valid_p): New.
1650 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1651 (riscv_parse_subset): Delegate all non-single-letter parsing work
1652 to riscv_parse_prefixed_ext.
1653 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1654 (riscv_get_prefix_class): Declare.
1655
16562020-01-22 Alan Modra <amodra@gmail.com>
1657
1658 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1659 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1660 __tls_get_addr_desc.
1661 (ppc64_elf_size_stubs): Add section for linker generated
1662 __tls_get_addr_desc wrapper function. Loop at least once if
1663 generating this function.
1664 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1665 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1666
16672020-01-22 Alan Modra <amodra@gmail.com>
1668
1669 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1670 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1671 tga_desc_fd.
1672 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1673 (STDU_R1_0R1, ADDI_R1_R1): Define.
1674 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1675 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1676 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1677 no_tls_get_addr_regsave.
1678 (branch_reloc_hash_match): Add hash3 and hash4.
1679 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1680 (ppc64_elf_size_dynamic_sections): Likewise.
1681 (ppc64_elf_relocate_section): Likewise.
1682 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1683 __tls_get_addr stub.
1684 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1685 eh_frame.
1686 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1687 eh_frame for regsave __tls_get_addr.
1688
16892020-01-22 Alan Modra <amodra@gmail.com>
1690
1691 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1692 which __tls_get_addr calls will be eliminated.
1693
16942020-01-20 Nick Clifton <nickc@redhat.com>
1695
1696 * po/pt.po: Updates Portuguese translation.
1697 * po/ru.po: Updated Russian translation.
1698 * po/uk.po: Updated Ukranian translation.
1699
17002020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1701
1702 PR ld/25416
1703 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1704 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1705 X32 mode.
1706 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1707 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1708 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1709 "rex leal x@tlsdesc(%rip), %reg" to
1710 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1711 "call *(%eax)" to "nopl (%rax)".
1712
17132020-01-20 Alan Modra <amodra@gmail.com>
1714
1715 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1716 (MTLR_R11): Don't define.
1717 (LD_R0_0R3, CMPDI_R0_0): Define.
1718 (build_tls_get_addr_stub): Don't use r11 in stub.
1719
17202020-01-20 Alan Modra <amodra@gmail.com>
1721
1722 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1723 (defined_sym_val, is_tls_get_addr): Likewise.
1724
17252020-01-18 Nick Clifton <nickc@redhat.com>
1726
1727 * version.m4 (BFD_VERSION): Set to 2.34.50.
1728 * configure: Regenerate.
1729 * po/bfd.pot: Regenerate.
1730
17312020-01-18 Nick Clifton <nickc@redhat.com>
1732
1733 Binutils 2.34 branch created.
1734
17352020-01-17 Christian Biesinger <cbiesinger@google.com>
1736
1737 * coff-arm.c: Fix spelling error (seperate).
1738 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1739 error (seperate).
1740 * sysdep.h (strnlen): Fix spelling error (seperate).
1741
17422020-01-15 Lars Brinkhoff <lars@nocrew.org>
1743
1744 PR 20694
1745 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1746
17472020-01-15 Alan Modra <amodra@gmail.com>
1748
1749 PR 25384
1750 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1751 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1752 of function symbols unless dot symbols are present. Do warn
1753 whenever one is created, regardles of whether a PLT entry is
1754 also emitted for the function symbol.
1755
17562020-01-14 Alan Modra <amodra@gmail.com>
1757
1758 * som.c (som_bfd_count_ar_symbols): Error when file position
1759 of symbols on chains is not strictly increasing.
1760
17612020-01-14 Alan Modra <amodra@gmail.com>
1762
1763 * vms.h (VMS_DEBUG): Define as 0.
1764 * vms-alpha.c (image_write): Move debug output after bounds check.
1765 Tidy bounds check.
1766 (_bfd_vms_slurp_eihd): Warning fix.
1767 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1768
17692020-01-13 Alan Modra <amodra@gmail.com>
1770
1771 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1772 for "ignored" records.
1773
17742020-01-13 Alan Modra <amodra@gmail.com>
1775
1776 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1777 Delete asect name check. Move asect NULL check to wasm_object_p.
1778 Correct bounds check of sizes against end. Replace uses of
1779 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1780 just one bfd_release.
1781 (wasm_scan): Don't use malloc/strdup for section names,
1782 bfd_alloc instead. Simplify code prefixing section name.
1783 Formatting. Don't attempt to free memory here..
1784 (wasm_object_p): ..do so here.
1785
17862020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1787
1788 PR ld/22269
1789 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1790 UNDEFWEAK_NO_DYNAMIC_RELOC.
1791 (allocate_dynrelocs_for_symbol): Likewise.
1792
17932020-01-10 Tamar Christina <tamar.christina@arm.com>
1794
1795 PR 25210
1796 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1797
17982020-01-10 Alan Modra <amodra@gmail.com>
1799
1800 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1801
18022020-01-09 Nick Clifton <nickc@redhat.com>
1803
1804 PR 25221
1805 * bfd.c (bfd_convert_section_contents): Check for a compress
1806 header size that is larger than the actual section size.
1807
18082020-01-08 Alan Modra <amodra@gmail.com>
1809
1810 PR 25351
1811 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1812 after removing sections.
1813
18142020-01-06 Jim Wilson <jimw@sifive.com>
1815
1816 PR 25205
1817 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1818 check for !bfd_link_pic (info).
1819 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1820 <R_RISCV_JAL>: Add comment.
1821 (_bfd_riscv_relax_section): For plt.offset check, add check for
1822 bfd_link_pic (info). Add comment.
1823
18242020-01-06 Alan Modra <amodra@gmail.com>
1825
1826 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1827 match failures. Don't init to bfd_error_wrong_format before
1828 calling _bfd_check_format.
1829
18302020-01-06 Alan Modra <amodra@gmail.com>
1831
1832 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1833 status rather than exiting on stack overflow or underflow.
1834 (_bfd_vms_slurp_etir): Adjust to suit.
1835
18362020-01-06 Alan Modra <amodra@gmail.com>
1837
1838 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
1839
18402020-01-06 Alan Modra <amodra@gmail.com>
1841
1842 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
1843 command. Check name offset is within command.
1844 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
1845 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
1846 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
1847 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
1848 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
1849 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
1850 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
1851 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
1852 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
1853 (bfd_mach_o_read_segment): Similarly.
1854 (bfd_mach_o_read_thread): Properly bound check thread struct.
1855 Don't repeat checks on second loop.
1856 (bfd_mach_o_read_command): Fail on invalid command length.
1857
18582020-01-04 Alan Modra <amodra@gmail.com>
1859
1860 * format.c (bfd_check_format_matches): Add preserve_match.
1861 Save initial bfd state in "preserve", matched bfd state in
1862 "preserve_match". Save just the first match. Release
1863 bfd_alloc memory. Restore and finish preserved state as
1864 appropriate on all function exit paths.
1865
18662020-01-04 Alan Modra <amodra@gmail.com>
1867
1868 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
1869
18702020-01-04 Alan Modra <amodra@gmail.com>
1871
1872 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
1873 match too.
1874
18752020-01-03 Nick Clifton <nickc@redhat.com>
1876
1877 PR 25307
1878 (bfd_pef_parse_function_stubs): Correct the test that ensures that
1879 there is enough data remaining in the code buffer before
1880 attempting to read a function stub.
1881
18822020-01-03 Nick Clifton <nickc@redhat.com>
1883
1884 PR 25308
1885 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
1886 return value from bfd_malloc.
1887 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
1888 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
1889 (elf32_arm_filter_cmse_symbols): Likewise.
1890 (elf32_arm_write_section): Likewise.
1891 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
1892 (bfd_mach_o_follow_dsym): Likewise.
1893 * pef.c (bfd_pef_print_loader_section): Likewise.
1894 (bfd_pef_scan_start_address): Likewise.
1895 (bfd_pef_parse_function_stubs): Likewise.
1896 (bfd_pef_parse_symbols): Likewise.
1897
18982020-01-03 Sergei Trofimovich <siarheit@google.com>
1899
1900 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
1901 on binary inputs ld/PR25316.
1902 (is_ia64_elf): new helper to filter on ia64 objects.
1903
19042020-01-03 Jan Beulich <jbeulich@suse.com>
1905
1906 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
1907 in parameter names.
1908 (bfd_mach_o_scan): Insert underscore in two variable names.
1909
19102020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
1911
1912 * Makefile.am: Add z80-elf target support.
1913 * configure.ac: Likewise.
1914 * targets.c: Likewise.
1915 * Makefile.in: Regenerate.
1916 * configure: Regenerate.
1917 * config.bfd: Add z80-elf target support and new arches: ez80 and
1918 z180.
1919 * elf32-z80.c: New file.
1920 * archures.c: Add new z80 architectures: eZ80 and Z180.
1921 * coffcode.h: Likewise.
1922 * cpu-z80.c: Likewise.
1923 * coff-z80.c: Add new relocations for Z80 target and local label
1924 check.
1925 * reloc.c: Add new relocs.
1926 * bfd-in2.h: Regenerate.
1927 * libbfd.h: Regenerate.
1928
19292020-01-02 Tamar Christina <tamar.christina@arm.com>
1930
1931 PR 25210
1932 PR 24753
1933 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
1934
19352020-01-01 Alan Modra <amodra@gmail.com>
1936
1937 Update year range in copyright notice of all files.
1938
1939For older changes see ChangeLog-2019
1940\f
1941Copyright (C) 2020 Free Software Foundation, Inc.
1942
1943Copying and distribution of this file, with or without modification,
1944are permitted in any medium without royalty provided the copyright
1945notice and this notice are preserved.
1946
1947Local Variables:
1948mode: change-log
1949left-margin: 8
1950fill-column: 74
1951version-control: never
1952End:
This page took 0.054158 seconds and 4 git commands to generate.