1 2020-05-11 Alan Modra <amodra@gmail.com>
4 * coffgen.c (coff_get_normalized_symtab): Check that buffer
5 contains required number of auxents before processing any auxent.
6 * coffswap.h (coff_swap_aux_in <C_FILE>): Only swap in extended
7 file name from auxents for PE.
9 2020-05-04 Gunther Nikl <gnikl@justmail.de>
11 * aout-cris.c (DEFAULT_ARCH): Delete define.
12 (MY_set_arch_mach): Likewise.
13 (SET_ARCH_MACH): Use bfd_set_arch_mach with an explicit architecture
15 (swap_ext_reloc_in): Add casts to r_index extraction. Mask valid bits
16 of r_type before the shift.
18 2020-05-04 Wilco Dijkstra <wdijkstr@arm.com>
21 * elfnn-aarch64.c (group_sections): Copy implementation from
24 2020-05-01 Alan Modra <amodra@gmail.com>
27 * elfnn-riscv.c (_bfd_riscv_relax_section): Check root.type before
28 accessing root.u.def of symbols. Also check root.u.def.section
29 is non-NULL. Reverse tests so as to make the logic positive.
31 2020-05-01 Alan Modra <amodra@gmail.com>
34 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Don't transfer
35 Tag_ABI_PIC or Tag_ABI_PID from dynamic objects to the output.
37 2020-05-01 Alan Modra <amodra@gmail.com>
40 * elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Add FIXME.
41 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
42 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Likewise.
43 * elf32-nds32.c (nds32_elf_merge_private_bfd_data): Likewise.
44 * elf32-score.c (s3_elf32_score_merge_private_bfd_data): Likewise.
45 * elf32-score7.c (s7_elf32_score_merge_private_bfd_data): Likewise.
46 * elf32-sh.c (sh_elf_merge_private_data): Likewise.
47 * elf32-tic6x.c (elf32_tic6x_merge_attributes): Likewise.
48 * elf64-ia64-vms.c (elf64_ia64_merge_private_bfd_data): Likewise.
49 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): Likewise.
51 2020-05-01 Alan Modra <amodra@gmail.com>
54 * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Ignore e_flags
55 from shared libraries.
57 2020-04-29 Max Filippov <jcmvbkbc@gmail.com>
59 * elf32-xtensa.c (relax_section): Don't negate diff_value for
60 XTENSA_NDIFF relocations. Don't add sign bits whe diff_value
61 equals 0. Report overflow when the result has negative sign but
62 all significant bits are zero.
64 2020-04-29 Gunther Nikl <gnikl@justmail.de>
66 * aoutx.h (swap_std_reloc_out): Special case 64 bit relocations.
67 (aout_link_reloc_link_order): Likewise. Make r_length an unsigned.
69 2020-04-28 Alan Modra <amodra@gmail.com>
71 * vms-alpha.c (_bfd_vms_slurp_etir): Correct divide by zero check.
74 2020-04-27 Tamar Christina <tamar.christina@arm.com>
76 * coff-i386.c (COFF_WITH_PE_BIGOBJ): New.
77 * coff-x86_64.c (COFF_WITH_PE_BIGOBJ): New.
78 * config.bfd (targ_selvecs): Rename x86_64_pe_be_vec
79 to x86_64_pe_big_vec as it not a big-endian format.
80 (vec i386_pe_big_vec): New.
81 * configure.ac: Likewise.
82 * targets.c: Likewise.
83 * configure: Regenerate.
84 * pe-i386.c (TARGET_SYM_BIG, TARGET_NAME_BIG,
85 COFF_WITH_PE_BIGOBJ): New.
86 * pe-x86_64.c (TARGET_SYM_BIG, TARGET_NAME_BIG):
88 (x86_64_pe_be_vec): Moved.
90 2020-04-23 Anton Kolesov <anton.kolesov@synopsys.com>
92 * elf-bfd.h (elfcore_write_arc_v2): Add prototype.
93 * elf.c (elfcore_grok_arc_v2): New function.
94 (elfcore_grok_note): Call the new function to handle the corresponding
96 (elfcore_write_arc_v2): New function.
97 (elfcore_write_register_note): Call the new function to handle the
98 corresponding pseudo-sections.
100 2020-04-22 Max Filippov <jcmvbkbc@gmail.com>
103 * bfd-in2.h: Regenerated.
104 * elf32-xtensa.c (elf_howto_table): New entries for
105 R_XTENSA_PDIFF{8,16,32} and R_XTENSA_NDIFF{8,16,32}.
106 (elf_xtensa_reloc_type_lookup, elf_xtensa_do_reloc)
107 (relax_section): Add cases for R_XTENSA_PDIFF{8,16,32} and
108 R_XTENSA_NDIFF{8,16,32}.
109 * libbfd.h (bfd_reloc_code_real_names): Add names for
110 BFD_RELOC_XTENSA_PDIFF{8,16,32} and
111 BFD_RELOC_XTENSA_NDIFF{8,16,32}.
112 * reloc.c: Add documentation for BFD_RELOC_XTENSA_PDIFF{8,16,32}
113 and BFD_RELOC_XTENSA_NDIFF{8,16,32}.
115 2020-04-21 Tamar Christina <tamar.christina@arm.com>
118 * compress.c (bfd_get_full_section_contents): Exclude sections with no
121 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
124 * elf-bfd.h (elf_backend_data): Add
125 elf_backend_strip_zero_sized_dynamic_sections.
126 (_bfd_elf_strip_zero_sized_dynamic_sections): New prototype.
127 * elf64-alpha.c (elf_backend_strip_zero_sized_dynamic_sections):
129 * elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): New
131 * elfxx-target.h (elf_backend_strip_zero_sized_dynamic_sections):
133 (elfNN_bed): Add elf_backend_strip_zero_sized_dynamic_sections.
135 2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
137 * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
139 (elf64_alpha_check_relocs): Set sec instead of reltext. Warn
141 (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
143 2020-04-21 Nick Clifton <nickc@redhat.com>
145 * po/sr.po: Updated Serbian translation.
147 2020-04-21 Alan Modra <amodra@gmail.com>
149 * elf32-sh.c (sh_elf_relocate_section): Remove STO_SH5_ISA32
152 2020-04-20 Stephen Casner <casner@acm.org>
154 * pdp11.c (N_STAB): Modify value to avoid conflict with N_EXT
155 causing globals from linker script to be treated as debug symbols.
156 (translate_symbol_table): Don't sign-extend symbol values from 16
157 to 64 bits in nm output.
159 2020-04-20 Alan Modra <amodra@gmail.com>
161 * elf64-ppc.c (ppc64_elf_size_stubs): Strip relbrlt too.
163 2020-04-18 Alan Modra <amodra@gmail.com>
165 * section.c (bfd_is_const_section): Correct test for special
167 * bfd-in2.h: Regenerate.
169 2020-04-17 Alan Modra <amodra@gmail.com>
172 * elf.c (_bfd_elf_get_symbol_version_string): Don't segfault on
175 2020-04-16 Nick Clifton <nickc@redhat.com>
178 * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Replace an
179 abort with a more helpful error message.
181 2020-04-16 Alan Modra <amodra@gmail.com>
184 * dwarf2.c (scan_unit_for_symbols): Wrap overlong lines. Don't
187 2020-04-15 Fangrui Song <maskray@google.com>
190 * coff-rs6000.c (xcoff_ppc_relocate_section): Change RM_GENERATE_ERROR
191 to RM_DIAGNOSE plus a check of warn_unresolved_syms.
192 * coff64-rs6000.c (xcoff_ppc_relocate_section): Likewise.
193 * elf-bfd.h (_bfd_elf_large_com_section): Likewise.
194 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
195 * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
196 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
197 * elf32-sh.c (sh_elf_relocate_section): Likewise.
198 * elf32-spu.c (spu_elf_relocate_section): Likewise.
199 * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
200 * elflink.c (elf_link_output_extsym): Likewise.
201 * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
203 2020-04-15 Alan Modra <amodra@gmail.com>
206 * peXXigen.c (_bfd_XXi_swap_sym_in <C_SECTION>): Don't use a
207 pointer into strings that may be freed for section name, always
208 allocate a new string.
210 2020-04-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
211 Jan W. Jagersma <jwjagersma@gmail.com>
213 * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL)
214 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
215 (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out)
216 (_bfd_go32_mkobject): New functions.
217 * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL)
218 (coff_SWAP_scnhdr_in, coff_SWAP_scnhdr_out): Define.
219 (go32exe_mkobject): Call _bfd_go32_mkobject.
220 * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define.
221 (coff_set_alignment_hook): Define function for COFF_GO32_EXE
223 (coff_write_relocs): Enable extended reloc counter code if
224 COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32.
225 (coff_write_object_contents): Likewise. Pad section headers
226 for COFF_GO32 and COFF_GO32EXE. Use bfd_coff_swap_scnhdr_out
227 instead of coff_swap_scnhdr_out.
228 * cofflink.c (_bfd_coff_final_link): Test also for obj_go32 to
229 enable extended reloc counter.
230 * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_out):
231 Declare with ATTRIBUTE_UNUSED.
232 * libcoff-in.h: (struct coff_tdata): New field go32.
234 * libcoff.h: Regenerate.
236 2020-04-14 Fangrui Song <maskray@google.com>
239 * elf.c (assign_section_numbers): Always set .stab sh_entsize to
242 2020-04-14 Stephen Casner <casner@acm.org>
245 * pdp11.c: Add implementation of --imagic option.
246 (adjust_o_magic): Fix objcopy --extract-symbol test.
247 * libaout.h (enum aout_magic): Add i_magic.
249 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
250 Nick Clifton <nickc@redhat.com>
252 * elf32-sparc.c (sparc_final_write_processing): Fix whitespace.
254 <default>: Error rather than abort.
256 2020-04-03 H.J. Lu <hongjiu.lu@intel.com>
259 * elf.c (_bfd_elf_fixup_group_sections): Remove zero-sized
260 relocation section from section group.
262 2020-04-02 Jan W. Jagersma <jwjagersma@gmail.com>
264 * bfdio.c (bfd_bread, bfd_tell, bfd_seek, bfd_mmap): Always add
265 bfd->origin to file offset.
266 * bfdwin.c (bfd_get_file_window): Likewise.
267 * bfd.c: Clarify the use of the bfd->origin field.
268 * bfd-in2.h: Regenerate.
269 * coff-i386.c: Don't include go32exe.h. Allow overriding
270 coff_write_object_contents via COFF_WRITE_CONTENTS.
271 * coff-stgo32.c (go32exe_cleanup, go32exe_mkobject)
272 (go32exe_write_object_contents): New functions.
273 (go32exe_temp_stub, go32exe_temp_stub_size): New static globals.
274 (COFF_WRITE_CONTENTS, GO32EXE_DEFAULT_STUB_SIZE): Define.
275 (create_go32_stub): Remove check for 2k size limit. Read stub
276 from go32exe_temp_stub if present.
277 (go32_stubbed_coff_bfd_copy_private_bfd_data): Allocate and
278 copy variable-length stub.
279 (go32_check_format): Read stub to go32exe_temp_stub, set
280 origin, return go32exe_cleanup.
281 (adjust_filehdr_in_post, adjust_filehdr_out_pre)
282 (adjust_filehdr_out_post, adjust_scnhdr_in_post)
283 (adjust_scnhdr_out_pre, adjust_scnhdr_out_post)
284 (adjust_aux_in_post, adjust_aux_out_pre, adjust_aux_out_post):
285 Remove functions and their associated #defines.
286 * coffcode.h (coff_mkobject_hook): Remove stub copying code.
287 * libcoff-in.h: (struct coff_tdata): New field stub_size.
288 Rename field go32stub to stub.
289 * libcoff.h: Regenerate.
290 * coff-stgo32.c (go32_check_format): Rename to...
291 (go32exe_check_format): ...this.
292 (go32_stubbed_coff_bfd_copy_private_bfd_data): Rename to...
293 (go32exe_copy_private_bfd_data): ...this.
294 (stub_bytes): Rename to...
295 (go32exe_default_stub): ...this.
296 (create_go32_stub): Rename to...
297 (go32exe_create_stub): ...this.
298 * coff-stgo32.c (go32exe_copy_private_bfd_data): Avoid realloc
301 2020-04-01 H.J. Lu <hongjiu.lu@intel.com>
305 * elf32-i386.c (elf_i386_convert_load_reloc): Convert load
306 relocation to R_386_32 for relocation against non-preemptible
308 (elf_i386_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Don't
309 allocate dynamic relocation for non-preemptible absolute symbol.
310 (elf_i386_relocate_section): Pass sec to
311 GENERATE_DYNAMIC_RELOCATION_P.
312 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): Moved.
313 (elf_x86_64_convert_load_reloc): Covert load relocation to
314 R_X86_64_32S or R_X86_64_32 for relocation against non-preemptible
315 absolute symbol. Don't convert to R_X86_64_32S nor R_X86_64_32
316 for non-preemptible absolute symbol if they overflow.
317 (elf_x86_64_check_relocs): Call _bfd_elf_x86_valid_reloc_p. Set
318 tls_type for GOT slot to GOT_ABS for non-preemptible absolute
319 symbol. Don't allocate dynamic relocation for non-preemptible
321 (elf_x86_64_relocate_section): Don't generate relative relocation
322 for GOTPCREL relocations aganst local absolute symbol. Pass sec
323 to GENERATE_DYNAMIC_RELOCATION_P.
324 * elfxx-x86.c (elf_x86_allocate_dynrelocs): No dynamic relocation
325 against non-preemptible absolute symbol.
326 (_bfd_elf_x86_valid_reloc_p): New function.
327 (_bfd_x86_elf_size_dynamic_sections): No dynamic relocation for
329 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Add an SEC
330 argument. Don't generate dynamic relocation against
331 non-preemptible absolute symbol.
333 (GENERATE_RELATIVE_RELOC_P): Don't generate relative relocation
334 against non-preemptible absolute symbol.
336 (R_X86_64_converted_reloc_bit): New. Moved from elf64-x86-64.c.
337 (_bfd_elf_x86_valid_reloc_p): New.
339 2020-04-01 Tamar Christina <tamar.christina@arm.com>
342 * elf32-arm.c (elf32_arm_populate_plt_entry): Set LSB of the PLT0
343 address in the GOT if in thumb only mode.
345 2020-04-01 Tamar Christina <tamar.christina@arm.com>
347 * elf32-arm.c (elf32_thumb2_plt_entry): Fix PC-rel offset.
349 2020-04-01 Hans-Peter Nilsson <hp@bitrange.com>
351 * mmo.c (mmo_scan): Create .text section only when needed, not
354 2020-03-31 Alan Modra <amodra@gmail.com>
356 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
359 2020-03-31 Alan Modra <amodra@gmail.com>
361 * vms-alpha.c (image_write): Check bounds for sections without
362 contents too. Error on non-zero write to section without
364 (_bfd_vms_slurp_etir): Check return of image_write* functions.
366 2020-03-31 Alan Modra <amodra@gmail.com>
368 * tekhex.c (pass_over): Check is_eof before reading buffer.
370 2020-03-30 Nick Clifton <nickc@redhat.com>
373 * libcoff-in.h (struct pe_tdata): Rename the insert_timestamp
374 field to timestamp and make it an integer.
375 * libcoff.h: Regenerate.
376 * peXXigen.c (_bfd_XXi_only_swap_filehdr_out): Test the timestamp
377 field in the pe_data structure rather than the insert_timestamp
380 2020-03-30 Alan Modra <amodra@gmail.com>
383 * elf64-ppc.c (ppc64_elf_build_stubs): Use asprintf to form
386 2020-03-26 Nick Clifton <nickc@redhat.com>
388 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): Delete.
389 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Remove
391 * libbfd.h: Regenerate.
393 2020-03-26 Alan Modra <amodra@gmail.com>
395 * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
397 2020-03-26 Alan Modra <amodra@gmail.com>
399 * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets
401 (_bfd_vms_slurp_object_records): Rename "err" to "ok".
403 2020-03-25 Nick Clifton <nickc@redhat.com>
405 * cofflink.c (bfd_coff_get_internal_extra_pe_aouthdr): New
407 * libbfd-in.h (bfd_coff_get_internal_extra_pe_aouthdr): Prototype.
408 * libbfd.h: Regenerate.
410 2020-03-25 Shahab Vahedi <shahab@synopsys.com>
412 * elf32-arc.c (PRINT_DEBUG_RELOC_INFO_BEFORE): Use the
413 correct field name in the output string.
415 2020-03-25 Alan Modra <amodra@gmail.com>
418 * elf.c (assign_file_positions_for_load_sections): Adjust offset
419 for SHT_NOBITS section if first in segment.
421 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
424 * elf-bfd.h (_bfd_elf_get_symbol_version_name): Renamed to ...
425 (_bfd_elf_get_symbol_version_string): This.
426 * elf.c (_bfd_elf_get_symbol_version_name): Renamed to ...
427 (_bfd_elf_get_symbol_version_string): This.
428 (bfd_elf_print_symbol): Pass TRUE to
429 _bfd_elf_get_symbol_version_string.
430 * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Add a
431 bfd_boolean argument.
432 * syms.c (_bfd_nosymbols_get_symbol_version_string): Likewise.
433 * targets.c (_bfd_get_symbol_version_string): Likewise.
434 (bfd_get_symbol_version_string): Likewise.
435 * bfd-in2.h: Regenerated.
437 2020-03-24 Nick Clifton <nickc@redhat.com>
438 Jaydeep Chauhan <jaydeepchauhan1494@gmail.com>
441 * bfdio.c (_bfd_real_fopen): Add code to handle long filenames on
444 2020-03-24 Nick Clifton <nickc@redhat.com>
447 * elf.c (_bfd_elf_map_sections_to_segments): When looking for a
448 segment to use for PT_GNU_RELRO, ignore empty sections in a
449 segment's current list.
451 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
454 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int.
456 2020-03-24 H.J. Lu <hongjiu.lu@intel.com>
459 * elf-bfd.h (_bfd_elf_get_symbol_version_name): New.
460 * elf.c (_bfd_elf_get_symbol_version_name): New function. Based
461 on the previous _bfd_elf_get_symbol_version_string.
462 (_bfd_elf_get_symbol_version_string): Use it.
464 2020-03-24 Alan Modra <amodra@gmail.com>
466 * archive.c (_bfd_generic_read_ar_hdr_mag): Sanity check extended
467 name size. Use bfd_malloc rather than bfd_zmalloc, clearing just
470 2020-03-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
472 * elflink.c (_bfd_elf_tls_setup): Mention .tdata in comment.
474 2020-03-23 Alan Modra <amodra@gmail.com>
476 * ecoff.c (_bfd_ecoff_slurp_armap): Sanity check parsed_size and
477 symbol count. Allocate an extra byte to ensure name strings
478 are terminated. Sanity check name offsets. Release memory on
481 2020-03-23 Alan Modra <amodra@gmail.com>
483 * i386msdos.c (msdos_object_p): Don't access e_lfanew when that
484 field hasn't been read. Remove unnecessary casts.
486 2020-03-22 Alan Modra <amodra@gmail.com>
488 * coff64-rs6000.c (xcoff64_slurp_armap): Ensure size is large
489 enough to read number of symbols.
491 2020-03-20 H.J. Lu <hongjiu.lu@intel.com>
493 * configure.ac (HAVE_EXECUTABLE_SUFFIX): Removed.
494 (EXECUTABLE_SUFFIX): Likewise.
495 * config.in: Regenerated.
496 * configure: Likewise.
497 * plugin.c (bfd_plugin_close_and_cleanup): Defined as
498 _bfd_generic_close_and_cleanup.
499 (plugin_list_entry): Remove resolution_file, resolution_option,
500 real_bfd, real_nsyms, real_syms, lto_nsyms, lto_syms, gcc,
501 lto_wrapper, gcc_env and initialized,
502 (need_lto_wrapper_p): Removed.
503 (get_lto_wrapper): Likewise.
504 (setup_lto_wrapper_env): Likewise.
505 (register_all_symbols_read): Likewise.
506 (egister_cleanup): Likewise.
507 (get_symbols): Likewise.
508 (add_input_file): Likewise.
509 (bfd_plugin_set_program_name): Remove need_lto_wrapper.
510 (add_symbols): Updated.
511 (try_claim): Likewise.
512 (try_load_plugin): Likewise.
513 (bfd_plugin_canonicalize_symtab): Likewise.
514 * plugin.h (bfd_plugin_set_program_name): Remove int argument.
515 (plugin_data_struct): Remove real_bfd, real_nsyms and real_syms.
517 2020-03-19 H.J. Lu <hongjiu.lu@intel.com>
520 * plugin.c (plugin_list_entry): Add has_symbol_type.
521 (add_symbols_v2): New function.
522 (bfd_plugin_open_input): Don't invoke LTO wrapper if LTO plugin
523 provides symbol type.
524 (try_load_plugin): Add LDPT_ADD_SYMBOLS_V2.
525 (bfd_plugin_canonicalize_symtab): Use LTO plugin symbol type if
528 2020-03-20 Alan Modra <amodra@gmail.com>
530 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Ensure size is large
531 enough to read number of symbols.
533 2020-03-20 Alan Modra <amodra@gmail.com>
535 * elf.c (_bfd_elf_setup_sections): Don't test known non-NULL
536 backend functions for NULL before calling.
537 (copy_special_section_fields, _bfd_elf_copy_private_bfd_data),
538 (bfd_section_from_shdr, assign_section_numbers): Likewise.
539 * elfcode.h (elf_write_relocs, elf_slurp_reloc_table): Likewise.
540 * elfnn-ia64.c (ignore_errors): New function.
541 (elf_backend_link_order_error_handler): Redefine as ignore_errors.
543 2020-03-19 Nick Clifton <nickc@redhat.com>
546 * dwarf2.c (struct varinfo): Add unit_offset field to record the
547 location of the varinfo in the unit's debug info data. Change the
548 type of the stack field to a boolean.
549 (lookup_var_by_offset): New function. Returns the varinfo
550 structure for the variable described at the given offset in the
552 (scan_unit_for_symbols): Add support for variables which have the
553 DW_AT_specification attribute.
555 2020-03-19 Nick Clifton <nickc@redhat.com>
558 * elf.c (bfd_elf_set_group_contents): Replace assertion with an
561 2020-03-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
563 * elfxx-riscv.c (riscv_parse_subset): Don't use C99.
565 2020-03-18 Nick Clifton <nickc@redhat.com>
568 * elf.c (_bfd_elf_write_secondary_reloc_section): Fix illegal
569 memory access when processing a corrupt secondary reloc section.
571 2020-03-18 Christophe Lyon <christophe.lyon@linaro.org>
573 * elf32-arm.c (arm_build_one_stub): Emit a fatal error message
574 instead of calling abort.
575 * elf32-csky.c (csky_build_one_stub): Likewise.
576 * elf32-hppa.c (hppa_build_one_stub): Likewise.
577 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
578 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
579 * elf32-metag.c (metag_build_one_stub): Likewise.
580 * elf32-nios2.c (nios2_build_one_stub): Likewise.
581 * elf64-ppc.c (ppc_build_one_stub): Likewise.
582 (ppc_size_one_stub): Likewise.
583 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
585 2020-03-17 Nick Clifton <nickc@redhat.com>
588 * elf.c (_bfd_elf_copy_special_section_fields): Replace assertions
591 2020-03-17 Nick Clifton <nickc@redhat.com>
594 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Remove redundant
595 free. Add free on another failure path.
597 2020-03-16 Alan Modra <amodra@gmail.com>
600 * elf.c (elf_sort_segments): Don't call bfd_octets_per_byte unless
601 we have a non-zero section count. Do lma comparison in octets.
603 2020-03-16 Alan Modra <amodra@gmail.com>
605 * vms-alpha.c (dst_restore_location): Validate index into
606 dst_ptr_offsets array before accessing. Return status.
607 (dst_retrieve_location): Similarly, making "loc" parameter a
608 pointer to return value.
609 (_bfd_vms_slurp_etir): Update calls to above functions.
611 2020-03-14 Kamil Rytarowski <n54@gmx.com>
613 * configure.ac: Include netbsd-core.lo for all NetBSD arm and mips
615 * configure: Regenerated.
617 2020-03-14 Alan Modra <amodra@gmail.com>
619 * section.c (BFD_FAKE_SECTIONS): Formatting.
620 * bfd-in2.h: Regenerate.
622 2020-03-13 Kamil Rytarowski <n54@gmx.com>
624 * elf.c (elfcore_grok_netbsd_note): Add support for
625 NT_NETBSDCORE_LWPSTATUS notes.
627 2020-03-13 Christophe Lyon <christophe.lyon@linaro.org>
629 * bfd-in2.h: Regenerate.
630 * section.c (asection): Add already_assigned field.
631 (BFD_FAKE_SECTION): Add default initializer for it.
632 * ecoff.c (bfd_debug_section): Initialize already_assigned field.
633 * elf32-arm.c (arm_build_one_stub): Add support for
634 non_contiguous_regions.
635 * elf32-csky.c (csky_build_one_stub): Likewise.
636 * elf32-hppa.c (hppa_build_one_stub): Likewise.
637 * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise.
638 * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise.
639 * elf32-metag.c (metag_build_one_stub): Likewise.
640 * elf32-nios2.c (nios2_build_one_stub): Likewise.
641 * elf64-ppc.c (ppc_build_one_stub): Likewise.
642 (ppc_size_one_stub): Likewise.
643 * elfnn-aarch64.c (aarch64_build_one_stub): Likewise.
644 * elflink.c (elf_link_input_bfd): Likewise.
646 2020-03-13 H.J. Lu <hongjiu.lu@intel.com>
649 * elf-linker-x86.h (elf_linker_x86_params): Add
650 static_before_all_inputs and has_dynamic_linker.
651 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Report
652 dynamic input objects if -static is passed at command-line
653 before all input files without --dynamic-linker unless
654 --no-dynamic-linker is used.
656 2020-03-13 Kamil Rytarowski <n54@gmx.com>
658 * elf.c (elfcore_grok_netbsd_note): Add support for aarch64.
660 2020-03-13 Christian Eggers <ceggers@gmx.de>
662 * bfd.c (bfd_record_phdr): New local "opb". Fix assignment of
664 * elfcode.h (bfd_from_remote_memory): Add units to several
665 parameters. New local "opb". Fix usage of p_align. Fix
666 calculation of "localbase" from "ehdr_vma" and "p_vaddr". Fix
667 call of target_read_memory.
668 * elflink.c (elf_fixup_link_order): Fix scope of "s" local. Fix
669 calculation of "offset" and "output_offset".
670 (bfd_elf_final_link): New local "opb". Fix calculation of "size"
671 from "offset" and fix calculation of "end" from "vma+size". Fix
672 comparison between "sh_addr" and "vma"/"output_offset".
673 (bfd_elf_discard_info): Fix calculation of "eh_alignment".
674 * elf-bfd.h (struct elf_link_hash_table): Add unit to tls_size
676 * elf.c (_bfd_elf_map_sections_to_segments): Add unit (bytes/
677 octets) to "wrap_to2 and "phdr_size" locals. Fix calculation of
678 "wrap_to" value. Add unit (bytes) to phdr_lma variable. Fix
679 assignment of p_paddr from phdr_lma. Fix comparison between
680 "lma+size" and "next->lma".
681 (elf_sort_segments): Fix assignment from p_paddr to lma.
682 (assign_file_positions_for_load_sections): Add unit (bytes) to
683 local "align". Fix calculation of local "off_adjust". Fix
684 calculation of local "filehdr_vaddr".
685 (assign_file_positions_for_non_load_sections): New local "opb".
686 Fix calculation of "end" from "p_size". Fix comparison between
687 "vma+SECTION_SIZE" and "start". Fix calculation of "p_memsz"
688 from "end" and "p_vaddr".
689 (rewrite_elf_program_header): Fix comparison between p_vaddr and
690 vma. Fix assignment to p_paddr from lma. Fix comparison between
691 p_paddr and lma. Fix assignment to p_paddr from lma.
692 * merge.c (sec_merge_emit): New local "opb". Convert
693 "alignment_power" to octets.
694 (_bfd_add_merge_section): New locals "alignment_power" and
695 "opb". Fix comparison between "alignment_power" and
697 (_bfd_merge_sections): New local "opb". Divide size by opb
698 before checking align mask.
700 2020-03-13 Christian Eggers <ceggers@gmx.de>
702 * elf.c (_bfd_elf_make_section_from_shdr): Introduce new temp
703 opb. Divide Elf_Internal_Shdr::sh_addr by opb when setting
705 (_bfd_elf_make_section_from_phdr): Similarly.
706 (elf_fake_sections): Fix calculation of
707 Elf_Internal_shdr::sh_addr from section VMA.
708 (_bfd_elf_map_sections_to_segments): Fix mixup between octets
710 (assign_file_positions_for_load_sections): Fix calculations of
711 Elf_Internal_shdr::p_vaddr and p_paddr from section LMA/VMA. Fix
712 comparison between program header address and section LMA.
713 (assign_file_positions_for_non_load_sections): Likewise.
714 (rewrite_elf_program_header): Likewise. Introduce new temp opb.
715 (IS_CONTAINED_BY_VMA): Add parameter opb.
716 (IS_CONTAINED_BY_LMA,IS_SECTION_IN_INPUT_SEGMENT,
717 INCLUDE_SECTION_IN_SEGMENT): Likewise.
718 (copy_elf_program_header): Update call to ELF_SECTION_IN_SEGMENT.
719 Fix calculations of p_addr_valid and p_vaddr_offset.
720 * elflink.c (elf_link_add_object_symbols): Multiply section VMA
721 with octets per byte when comparing against p_vaddr.
723 2020-03-11 Alan Modra <amodra@gmail.com>
725 * som.c (setup_sections): Sanity check subspace.name.
727 2020-03-11 Alan Modra <amodra@gmail.com>
729 * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
731 2020-03-10 Alan Modra <amodra@gmail.com>
734 * ihex.c (ihex_write_object_contents): Don't assume ordering of
737 2020-03-09 Alan Modra <amodra@gmail.com>
739 * wasm-module.c (wasm_scan): Sanity check file name length
740 before allocating memory. Move common section setup code. Do
741 without bfd_tell to calculate section size.
743 2020-03-06 Nick Clifton <nickc@redhat.com>
745 * elf.c (_bfd_elf_set_section_contents): Replace call to abort
746 with error messages and failure return values.
748 2020-03-05 Max Filippov <jcmvbkbc@gmail.com>
750 * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
751 relocation sections for any removed reference to a dynamic symbol.
753 2020-03-05 Nick Clifton <nickc@redhat.com>
755 * elf-bfd.h (struct elf_backend_data): Add new fields:
756 init_secondary_reloc_section, slurp_secondary_reloc_section,
757 write_secondary_reloc_section.
758 (_bfd_elf_init_secondary_reloc_section): Prototype.
759 (_bfd_elf_slurp_secondary_reloc_section): Prototype.
760 (_bfd_elf_write_secondary_reloc_section): Prototype.
761 * elf.c ( bfd_section_from_shdr): Invoke the new
762 init_secondary_reloc_section backend function, if defined, when a
763 second reloc section is encountered.
764 (swap_out_syms): Invoke the new symbol_section_index function, if
765 defined, when computing the section index of an OS/PROC specific
767 (_bfd_elf_init_secondary_reloc_section): New function.
768 (_bfd_elf_slurp_secondary_reloc_section): New function.
769 (_bfd_elf_write_secondary_reloc_section): New function.
770 (_bfd_elf_copy_special_section_fields): New function.
771 * elfcode.h (elf_write_relocs): Invoke the new
772 write_secondary_relocs function, if defined, in order to emit
774 (elf_slurp_reloc_table): Invoke the new slurp_secondary_relocs
775 function, if defined, in order to read in secondary relocs.
776 * elfxx-target.h (elf_backend_copy_special_section_fields):
777 Provide a non-NULL default definition.
778 (elf_backend_init_secondary_reloc_section): Likewise.
779 (elf_backend_slurp_secondary_reloc_section): Likewise.
780 (elf_backend_write_secondary_reloc_section): Likewise.
781 (struct elf_backend_data elfNN_bed): Add initialisers for the new
783 * configure.ac (score_elf32_[bl]e_vec): Add elf64.lo
784 * configure: Regenerate.
786 2020-03-05 Alan Modra <amodra@gmail.com>
788 * archive64.c (_bfd_archive_64_bit_slurp_armap): Check parsed_size
789 against file size before allocating memory. Use bfd_alloc rather
790 than bfd_zalloc for carsym/strings memory.
792 2020-03-04 Alan Modra <amodra@gmail.com>
794 * elf.c (elf_fake_sections): Ensure sh_addralign is such that
795 sh_addr mod sh_addalign is zero.
797 2020-03-04 Alan Modra <amodra@gmail.com>
799 * format.c (bfd_check_format_matches): Call cleanup on error exit.
801 2020-03-03 Alan Modra <amodra@gmail.com>
803 * format.c (struct bfd_preserve): Add cleanup field.
804 (bfd_preserve_save): Add cleanup param and save.
805 (bfd_preserve_restore): Return cleanup.
806 (bfd_preserve_finish): Call the cleanup for the discarded match.
807 (bfd_check_format_matches): Pass cleanup to bfd_preserve_save,
808 and clear when preserving a match. Restore cleanup too when
809 restoring that match.
811 2020-03-02 Alan Modra <amodra@gmail.com>
813 * cisco-core.c (cisco_core_file_p): Return bfd_cleanup.
814 * hpux-core.c (hpux_core_core_file_p): Update prototype.
815 * sco5-core.c (sco5_core_file_p): Return bfd_cleanup.
816 (core_sco5_vec): Correct initialisers.
818 2020-03-02 Alan Modra <amodra@gmail.com>
820 * aix386-core.c (aix386_core_file_p): Return bfd_cleanup.
821 * aix5ppc-core.c (xcoff64_core_p): Likewise.
822 * cisco-core.c (cisco_core_file_validate): Likewise.
823 * hppabsd-core.c (hppabsd_core_core_file_p): Likewise.
824 * hpux-core.c (hpux_core_core_file_p): Likewise.
825 * irix-core.c (irix_core_core_file_p): Likewise.
826 * lynx-core.c (lynx_core_file_p): Likewise.
827 * netbsd-core.c (netbsd_core_file_p): Likewise.
828 * osf-core.c (osf_core_core_file_p): Likewise.
829 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
830 * sco5-core.c (sco5_core_file_p): Likewise.
832 2020-03-02 H.J. Lu <hongjiu.lu@intel.com>
834 * trad-core.c (trad_unix_core_file_p): Return bfd_cleanup.
836 2020-03-02 Alan Modra <amodra@gmail.com>
838 * targets.c (bfd_cleanup): New typedef.
839 (struct bfd <_bfd_check_format>): Return a bfd_cleanup.
840 * libbfd-in.h (_bfd_no_cleanup): Define.
841 * format.c (bfd_reinit): Add cleanup parameter, call it.
842 (bfd_check_format_matches): Set cleanup from _bfd_check_format
843 call and pass to bfd_reinit. Delete temp, use abfd->xvec instead.
844 * aout-target.h (callback, object_p): Return bfd_cleanup.
845 * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise.
846 * archive.c (bfd_generic_archive_p): Likewise.
847 * binary.c (binary_object_p): Likewise.
848 * coff-alpha.c (alpha_ecoff_object_p): Likewise.
849 * coff-ia64.c (ia64coff_object_p): Likewise.
850 * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise.
851 * coff-sh.c (coff_small_object_p): Likewise.
852 * coff-stgo32.c (go32_check_format): Likewise.
853 * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p),
854 (xcoff64_core_p): Likewise.
855 * coffgen.c (coff_real_object_p, coff_object_p): Likewise.
856 * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p),
857 (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise.
858 * elfcode.h (elf_object_p): Likewise.
859 * elfcore.h (elf_core_file_p): Likewise.
860 * i386msdos.c (msdos_object_p): Likewise.
861 * ihex.c (ihex_object_p): Likewise.
862 * libaout.h (some_aout_object_p): Likewise.
863 * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target),
864 (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise.
865 * libbfd.c (_bfd_dummy_target): Likewise.
866 * libcoff-in.h (coff_object_p): Likewise.
867 * mach-o-aarch64.c (bfd_mach_o_arm64_object_p),
868 (bfd_mach_o_arm64_core_p): Likewise.
869 * mach-o-arm.c (bfd_mach_o_arm_object_p),
870 (bfd_mach_o_arm_core_p): Likewise.
871 * mach-o-i386.c (bfd_mach_o_i386_object_p),
872 (bfd_mach_o_i386_core_p): Likewise.
873 * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p),
874 (bfd_mach_o_x86_64_core_p): Likewise.
875 * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p),
876 (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise.
877 * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p),
878 (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise.
879 * mmo.c (mmo_object_p): Likewise.
880 * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
881 * peicode.h (coff_real_object_p, pe_ILF_object_p),
882 (pe_bfd_object_p): Likewise.
883 * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise.
884 * ppcboot.c (ppcboot_object_p): Likewise.
885 * rs6000-core.c (rs6000coff_core_p): Likewise.
886 * som.c (som_object_setup, som_object_p): Likewise.
887 * srec.c (srec_object_p, symbolsrec_object_p): Likewise.
888 * tekhex.c (tekhex_object_p): Likewise.
889 * vms-alpha.c (alpha_vms_object_p): Likewise.
890 * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p),
891 (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise.
892 * wasm-module.c (wasm_object_p): Likewise.
893 * xsym.c (bfd_sym_object_p): Likewise.
894 * xsym.h (bfd_sym_object_p): Likewise.
895 * aoutx.h (some_aout_object_p): Likewise, and callback parameter
897 * pdp11.c (some_aout_object_p): Likewise.
898 * plugin.c (register_ld_plugin_object_p): Update object_p
900 * plugin.h (register_ld_plugin_object_p): Likewise.
901 * bfd-in2.h: Regenerate.
902 * libbfd.h: Regenerate.
903 * libcoff.h: Regenerate.
905 2020-03-02 Alan Modra <amodra@gmail.com>
907 * coff-alpha.c (alpha_ecoff_le_vec): Add SEC_SMALL_DATA to
908 applicable section flags.
909 * coff-mips.c (mips_ecoff_le_vec, mips_ecoff_be_vec): Likewise.
910 (mips_ecoff_bele_vec): Likewise.
911 * coffcode.h (sec_to_styp_flags): Set SEC_SMALL_DATA for .sdata
913 * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
914 (_bfd_ecoff_styp_to_sec_flags): Likewise.
916 2020-03-02 Alan Modra <amodra@gmail.com>
918 * elf32-m32r.c (m32r_elf_section_flags): New function.
919 (elf_backend_section_flags): Define.
920 * elf32-nds32.c (nds32_elf_section_flags): New function.
921 (elf_backend_section_flags): Define.
922 * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for
923 .sbss and .sdata sections.
924 * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA
925 for SHF_V850_GPREL sections.
926 * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated
928 * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA
929 for SHF_PARISC_SHORT sections.
930 * elf64-ppc.c (ppc64_elf_section_flags): New function.
931 (elf_backend_section_flags): Define.
932 * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA
933 for SHF_MIPS_GPREL sections. Delete FIXME.
935 2020-03-02 Alan Modra <amodra@gmail.com>
937 * elf-bfd.h (elf_backend_section_flags): Remove flagword* param.
938 * elf.c (_bfd_elf_make_section_from_shdr): Set section flags before
939 calling elf_backend_section_flags with adjusted params. Use
940 newsect->flags past that point.
941 (_bfd_elf_new_section_hook): Always set sh_type and sh_flags for
943 (_bfd_elf_init_private_section_data): Allow normal sh_type sections
944 to have their type overridden, and all sh_flags but processor and
946 * elf32-arm.c (elf32_arm_section_flags): Adjust for changed params.
947 * elf32-mep.c (mep_elf_section_flags): Likewise.
948 * elf32-nios2.c (nios2_elf32_section_flags): Likewise.
949 * elf64-alpha.c (elf64_alpha_section_flags): Likewise.
950 * elf64-ia64-vms.c (elf64_ia64_section_flags): Likewise.
951 * elfnn-ia64.c (elfNN_ia64_section_flags): Likewise.
952 * elfnn-aarch64.c (elfNN_aarch64_size_stubs): Exclude the linker
953 stub BFD and non-aarch64 input files when scanning for stubs.
955 2020-03-02 Alan Modra <amodra@gmail.com>
957 * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Provide an upper
958 limit to decompressed element size.
960 2020-03-02 Alan Modra <amodra@gmail.com>
962 * vms-lib.c (vms_traverse_index): Add recur_count param and
963 update calls. Fail on excessive recursion.
965 2020-03-02 Alan Modra <amodra@gmail.com>
967 * vms-alpha.c (vms_get_remaining_object_record): Use
968 bfd_realloc_or_free rather than bfd_realloc.
969 (add_symbol_entry, vector_grow1, alpha_vms_slurp_relocs): Likewise.
970 (dst_define_location, parse_module): Likewise, and check realloc
971 return status before using memory. Return status from function
972 adjusting all callers.
974 2020-02-28 Alan Modra <amodra@gmail.com>
976 * vms-lib.c (_bfd_vms_lib_archive_p): Free memory on error paths.
978 2020-02-28 Alan Modra <amodra@gmail.com>
980 * vms-alpha.c (alpha_vms_object_p): Use _bfd_malloc_and_read.
981 Remove duplicate undersize check.
983 2020-02-27 Alan Modra <amodra@gmail.com>
986 * mmo.c (mmo_scan): Set SEC_DATA for .data.
988 2020-02-27 Alan Modra <amodra@gmail.com>
991 * syms.c (stt): Trim off all but 'e', 'i' and 'p' entries.
992 (coff_section_type): Adjust comment.
993 (decode_section_type): Likewise. Call coff_section_type before
995 (bfd_decode_symclass): Use 'c' for common sections other than
998 2020-02-27 Alan Modra <amodra@gmail.com>
1000 * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
1003 2020-02-27 Alan Modra <amodra@gmail.com>
1005 * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
1006 if file is an archive element.
1007 * bfd-in2.h: Regenerate.
1009 2020-02-26 Alan Modra <amodra@gmail.com>
1011 * archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
1012 bfd_set_error on failing test. Don't bother changing bfd_error on
1013 file read error. Check symdef_count is multiple of BSD_SYMDEF_SIZE.
1014 Check sym name is within string buffer. Use size_t for some vars.
1015 (do_slurp_coff_armap): Use size_t for some variables, fix size of
1016 int_buf. Don't change bfd_error on file read error. Use
1017 _bfd_mul_overflow when calculating carsym buffer size. Reorder
1018 calculations to catch overflows before they occur. malloc and
1019 free raw armap rather than using bfd_alloc. Read raw armap before
1020 allocating carsym+strings buffer.
1021 (_bfd_slurp_extended_name_table): Localize variables. Check
1022 name size against file size.
1024 2020-02-26 Alan Modra <amodra@gmail.com>
1026 * vms-lib.c (vms_lib_read_index): Release correct buffer.
1028 2020-02-26 Alan Modra <amodra@gmail.com>
1030 * elf32-rx.c (rx_elf_relocate_section): Use bfd_malloc rather than
1031 malloc. Check for NULL return from bfd_malloc.
1032 (rx_table_find, rx_table_map): Likewise.
1033 (rx_set_section_contents): Check bfd_alloc return.
1034 (rx_dump_symtab): Don't alloc internal_syms or external_syms.
1036 2020-02-26 Alan Modra <amodra@gmail.com>
1038 * aoutx.h: Indent labels correctly. Format error strings.
1039 * archive.c: Likewise.
1040 * archive64.c: Likewise.
1041 * coff-arm.c: Likewise.
1042 * coff-rs6000.c: Likewise.
1043 * coff-stgo32.c: Likewise.
1044 * cpu-arm.c: Likewise.
1045 * dwarf2.c: Likewise.
1046 * elf-ifunc.c: Likewise.
1047 * elf-properties.c: Likewise.
1048 * elf-s390-common.c: Likewise.
1049 * elf-strtab.c: Likewise.
1051 * elf32-arm.c: Likewise.
1052 * elf32-bfin.c: Likewise.
1053 * elf32-cr16.c: Likewise.
1054 * elf32-csky.c: Likewise.
1055 * elf32-i386.c: Likewise.
1056 * elf32-m68k.c: Likewise.
1057 * elf32-msp430.c: Likewise.
1058 * elf32-nds32.c: Likewise.
1059 * elf32-nios2.c: Likewise.
1060 * elf32-pru.c: Likewise.
1061 * elf32-xtensa.c: Likewise.
1062 * elf64-ia64-vms.c: Likewise.
1063 * elf64-x86-64.c: Likewise.
1064 * elfcode.h: Likewise.
1065 * elfcore.h: Likewise.
1066 * elflink.c: Likewise.
1067 * elfnn-aarch64.c: Likewise.
1068 * elfnn-ia64.c: Likewise.
1069 * elfnn-riscv.c: Likewise.
1070 * elfxx-mips.c: Likewise.
1071 * elfxx-sparc.c: Likewise.
1072 * elfxx-x86.c: Likewise.
1073 * i386lynx.c: Likewise.
1074 * merge.c: Likewise.
1075 * pdp11.c: Likewise.
1076 * plugin.c: Likewise.
1077 * reloc.c: Likewise.
1079 2020-02-26 Alan Modra <amodra@gmail.com>
1082 * elf-bfd.h (struct elf_link_hash_table): Rename "loaded" to
1084 (bfd_elf_add_dt_needed_tag): Declare.
1085 * elf-strtab.c (_bfd_elf_strtab_restore): Handle NULL buf.
1086 * elflink.c (bfd_elf_add_dt_needed_tag): Make global and rename
1087 from elf_add_dt_needed_tag. Remove soname and doit param.
1088 (elf_link_add_object_symbols): Don't use elf_add_dt_needed_tag
1089 to see whether as-needed lib is already loaded, use dyn_loaded
1090 list instead. When saving and restoring around as-needed lib
1091 handle possibility that dynstr has not been initialised. Don't
1092 add DT_NEEDED tags here. Limit dyn_loaded list to dynamic libs.
1093 Mark libs loaded via DT_NEEDED entries of other libs with
1094 DYN_NO_NEEDED if they should not be mentioned in DT_NEEDED of
1096 (elf_link_check_versioned_symbol): Remove now unneccesary
1097 DYNAMIC check when traversing dyn_loaded list.
1099 2020-02-26 Alan Modra <amodra@gmail.com>
1101 * bfdio.c (bfd_get_file_size): Ignore bogus archive element sizes.
1103 2020-02-25 H.J. Lu <hongjiu.lu@intel.com>
1106 * plugin.c (need_lto_wrapper_p): New.
1107 (bfd_plugin_set_program_name): Add an int argument to set
1109 (get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
1111 * plugin.h (bfd_plugin_set_program_name): Add an int argument.
1113 2020-02-24 Alan Modra <amodra@gmail.com>
1115 * vms-lib.c (_bfd_vms_lib_archive_p): Correct overflow checks.
1117 2020-02-24 Alan Modra <amodra@gmail.com>
1119 * vms-lib.c (struct carsym_mem): Add limit.
1120 (vms_add_index): Heed limit.
1121 (vms_traverse_index): Catch buffer overflows. Remove outdated fixme.
1122 (vms_lib_read_index): Set up limit. Catch 32-bit overflow.
1123 Always return actual number read.
1124 (_bfd_vms_lib_archive_p): Catch buffer overflows. Replace
1125 assertion with error exit.
1127 2020-02-22 Alan Modra <amodra@gmail.com>
1130 * elf.c (assign_file_positions_for_load_sections): Continue linking
1131 on "PHDR segment not covered by LOAD segment" errors.
1133 2020-02-21 Alan Modra <amodra@gmail.com>
1135 * mach-o.c (bfd_mach_o_canonicalize_relocs): Fix ineffective
1137 (bfd_mach_o_canonicalize_reloc): Likewise.
1138 (bfd_mach_o_canonicalize_dynamic_reloc): Likewise. Sanity check
1139 counts and offsets against file size.
1140 (bfd_mach_o_build_dysymtab): Fix ineffective overflow check.
1141 (bfd_mach_o_mangle_sections): Remove unnecessary overflow check.
1142 (bfd_mach_o_read_symtab_symbols): Sanity check count and offset
1143 against file size. Delete symbol table error message.
1144 (bfd_mach_o_read_dysymtab): Sanity check counts and offsets
1146 (bfd_mach_o_read_symtab): Likewise.
1147 (bfd_mach_o_read_command): Pass file size.
1148 (bfd_mach_o_scan): Sanity check command count against file size.
1150 2020-02-21 Alan Modra <amodra@gmail.com>
1153 * aoutx.h (adjust_o_magic, adjust_z_magic, adjust_n_magic): Use
1154 "text", "data" and "bss" section pointer vars. Don't update
1155 section size, just exec header sizes.
1156 (adjust_sizes_and_vmas): Don't update text section size. Set
1157 initial exec header a_text. Print exec headers sizes.
1158 * pdp11.c (adjust_o_magic, adjust_z_magic, adjust_n_magic),
1159 (adjust_sizes_and_vmas): Similarly. Formatting.
1160 (final_link): Correct final file extension.
1162 2020-02-20 Nick Clifton <nickc@redhat.com>
1164 * elf-bfd.h (struct elf_backend_data): Add symbol_section_index
1166 * elfxx-target.h (elf_backend_symbol_section_index): Provide
1168 (elfNN_bed): Initialise the symbol_section_index field.
1169 * elf.c (swap_out_syms): Call symbol_section_index, if defined, on
1170 OS and PROC specific section indicies. Warn if converting other
1171 reserved incidies to SHN_ABS.
1173 2020-02-19 Sergey Belyashov <sergey.belyashov@gmail.com>
1176 * cpu-z80.c: Add machine type compatibility checking.
1178 2020-02-19 H.J. Lu <hongjiu.lu@intel.com>
1181 * plugin.c (plugin_list_entry): Remove handle.
1182 (try_load_plugin): Call dlclose before return.
1184 2020-02-19 Alan Modra <amodra@gmail.com>
1186 * libbfd-in.h (_bfd_constant_p): Define.
1187 (_bfd_alloc_and_read, _bfd_malloc_and_read): Check read size against
1188 file size before allocating memory.
1189 * coffgen.c (_bfd_coff_get_external_symbols): Remove file size check.
1190 * elf.c (bfd_elf_get_str_section): Likewise.
1191 (_bfd_elf_slurp_version_tables): Likewise.
1192 * libbfd.h: Regenerate.
1194 2020-02-19 Alan Modra <amodra@gmail.com>
1196 * libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
1197 * aoutx.h (aout_get_external_symbols): Replace calls to
1198 bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
1199 (slurp_reloc_table): Likewise.
1200 * archive.c (do_slurp_bsd_armap): Likewise.
1201 (do_slurp_coff_armap): Likewise.
1202 * archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
1203 * coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
1204 * coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
1205 * coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
1206 * coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
1207 (_bfd_coff_get_external_symbols): Likewise.
1208 * ecoff.c (ecoff_slurp_symbolic_header),
1209 (_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
1210 (_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
1211 (ecoff_indirect_link_order): Likewise.
1212 * elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
1213 (_bfd_elf_slurp_version_tables): Likewise.
1214 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1215 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1216 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1217 * elf64-alpha.c (READ): Likewise.
1218 * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
1219 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
1220 * elfcode.h (elf_slurp_symbol_table),
1221 (elf_slurp_reloc_table_from_section): Likewise.
1222 * elflink.c (elf_link_add_object_symbols),
1223 (elf_link_check_versioned_symbol): Likewise.
1224 * elfxx-mips.c (READ): Likewise.
1225 * i386lynx.c (slurp_reloc_table): Likewise.
1226 * lynx-core.c (lynx_core_file_p): Likewise.
1227 * mach-o.c (bfd_mach_o_canonicalize_relocs),
1228 (bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
1229 (bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
1230 * pdp11.c (aout_get_external_symbols, slurp_reloc_table
1231 * pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
1232 (bfd_pef_parse_symbols): Likewise.
1233 * peicode.h (pe_ILF_object_p, pe_bfd_object_p
1234 * som.c (setup_sections, som_slurp_string_table),
1235 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1236 (som_bfd_fill_in_ar_symbols): Likewise.
1237 * vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
1238 (evax_bfd_print_image): Likewise.
1239 * vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
1240 * wasm-module.c (wasm_scan): Likewise.
1241 * xcofflink.c (xcoff_link_add_symbols): Likewise.
1242 * xsym.c (bfd_sym_read_name_table),
1243 (bfd_sym_print_type_information_table_entry): Likewise.
1244 * libbfd.h: Regenerate.
1246 2020-02-19 Alan Modra <amodra@gmail.com>
1248 * aoutx.h (slurp_reloc_table): Allocate reloc_cache after
1249 reading external relocs.
1250 * ecoff.c (ecoff_slurp_reloc_table): Likewise.
1251 * archive.c (_bfd_write_archive_contents): Don't twiddle bfd_error
1253 * archive64.c (_bfd_archive_64_bit_slurp_armap): Remove unnecessary
1255 * elf32-m32c.c (m32c_offset_for_reloc): Make shndx_buf a bfd_byte*.
1256 (m32c_elf_relax_section): Likewise.
1257 * elf32-rl78.c (rl78_offset_for_reloc): Likewise.
1258 (rl78_elf_relax_section): Likewise.
1259 * elf32-rx.c (rx_offset_for_reloc): Likewise.
1260 (elf32_rx_relax_section): Likewise.
1261 * mach-o.c (bfd_mach_o_alloc_and_read): Move earlier with better
1262 parameter types and use..
1263 (bfd_mach_o_read_dylinker, bfd_mach_o_read_dylib),
1264 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_str): ..in these functions.
1265 * peicode.h (pe_bfd_object_p): Don't zero the part of opthdr
1266 being read from file, just the extra.
1267 * som.c (som_slurp_symbol_table): Allocate internal symbol buffer
1268 after reading external syms. Free on failure.
1270 2020-02-19 Alan Modra <amodra@gmail.com>
1272 * coffcode.h (buy_and_read, coff_slurp_line_table),
1273 (coff_slurp_symbol_table, coff_slurp_reloc_table): Replace
1274 bfd_[z][m]alloc2 calls with _bfd_mul_overflow followed by the
1275 corresponding bfd_alloc call. Adjust variables to suit.
1276 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1277 * ecoff.c (_bfd_ecoff_slurp_symbolic_info),
1278 (_bfd_ecoff_slurp_symbol_table, READ): Likewise.
1279 * elf.c (bfd_elf_get_elf_syms, setup_group, bfd_section_from_shdr),
1280 (swap_out_syms, _bfd_elf_slurp_version_tables): Likewise.
1281 * elf32-m32c.c (m32c_elf_relax_section): Likewise.
1282 * elf32-rl78.c (rl78_elf_relax_section): Likewise.
1283 * elf32-rx.c (elf32_rx_relax_section): Likewise.
1284 * elf64-alpha.c (READ): Likewise.
1285 * elfcode.h (elf_object_p, elf_write_relocs, elf_write_shdrs_and_ehdr),
1286 (elf_slurp_symbol_table, elf_slurp_reloc_table),
1287 (bfd_from_remote_memory): Likewise.
1288 * elfcore.h (core_find_build_id): Likewise.
1289 * elfxx-mips.c (READ): Likewise.
1290 * mach-o.c (bfd_mach_o_mangle_sections),
1291 (bfd_mach_o_read_symtab_symbols, bfd_mach_o_read_thread),
1292 (bfd_mach_o_read_dysymtab, bfd_mach_o_flatten_sections),
1293 (bfd_mach_o_scan, bfd_mach_o_fat_archive_p): Likewise.
1294 * som.c (setup_sections, som_prep_for_fixups)
1295 (som_build_and_write_symbol_table, som_slurp_symbol_table),
1296 (som_slurp_reloc_table, som_bfd_count_ar_symbols),
1297 (som_bfd_fill_in_ar_symbols, som_slurp_armap),
1298 (som_bfd_ar_write_symbol_stuff): Likewise.
1299 * vms-alpha.c (vector_grow1): Likewise.
1300 * vms-lib.c (vms_add_index): Likewise.
1301 * wasm-module.c (wasm_scan_name_function_section): Likewise.
1302 * libbfd.c (bfd_malloc2, bfd_realloc2, bfd_zmalloc2): Delete.
1303 * opncls.c (bfd_alloc2, bfd_zalloc2): Delete.
1304 * libbfd-in.h (bfd_malloc2, bfd_realloc2, bfd_zmalloc2),
1305 (bfd_alloc2, bfd_zalloc2): Delete.
1306 (_bfd_mul_overflow): Define.
1307 * libbfd.h: Regenerate.
1309 2020-02-19 Alan Modra <amodra@gmail.com>
1311 * elf.c (bfd_section_from_shdr): Use bfd_zalloc rather than
1313 (assign_section_numbers): Likewise.
1314 (elf_map_symbols): Likewise, and bfd_alloc rather than bfd_alloc2.
1315 (_bfd_elf_map_sections_to_segments): Use bfd_malloc rather than
1316 bfd_malloc2, size_t amt, and unsigned tls_count.
1317 (rewrite_elf_program_header): Use bfd_malloc and size_t amt.
1318 * elflink.c (elf_create_symbuf): Use bfd_malloc.
1319 (elf_output_implib): Use bfd_alloc.
1321 2020-02-19 Alan Modra <amodra@gmail.com>
1323 * bfd.c (struct bfd): Move format and direction to other
1324 bitfields. Add "size".
1325 * bfdio.c (bfd_get_size): Cache size when not writing file.
1326 * opncls.c (bfd_get_debug_link_info_1): Allow for bfd_get_size
1327 returning zero, ie. unknown.
1328 (bfd_get_alt_debug_link_info): Likewise.
1329 * bfd-in2.h: Regenerate.
1331 2020-02-19 Alan Modra <amodra@gmail.com>
1333 * coffgen.c (_bfd_coff_get_external_symbols): Don't call
1334 bfd_get_file_size twice.
1335 (_bfd_coff_read_string_table): Allow for bfd_get_file_size
1336 zero, ie. unknown, return.
1337 * elf-attrs.c (_bfd_elf_parse_attributes): Likewise.
1338 * elfcode.h (elf_swap_shdr_in): Likewise.
1339 (elf_object_p): Don't call bfd_get_file_size twice and correct
1342 2020-02-19 Alan Modra <amodra@gmail.com>
1344 * mach-o.c (bfd_mach_o_flatten_sections): Return a bfd_boolean,
1345 FALSE if memory alloc fails. Adjust calls.
1346 * som.c (som_prep_for_fixups): Likewise.
1347 * vms-alpha.c (alpha_vms_add_fixup_lp, alpha_vms_add_fixup_ca),
1348 (alpha_vms_add_fixup_qr, alpha_vms_add_fixup_lr),
1349 (alpha_vms_add_lw_reloc, alpha_vms_add_qw_reloc): Likewise.
1350 * som.c (som_build_and_write_symbol_table): Return via error_return
1352 * vms-alpha.c (VEC_APPEND): Adjust for vector_grow1 changes.
1353 (VEC_APPEND_EL): Delete.
1354 (vector_grow1): Return pointer to element. Catch overflow.
1355 Return NULL on memory allocation failure.
1356 (alpha_vms_add_fixup_lp): Replace VEC_APPEND_EL with VEC_APPEND.
1357 (alpha_vms_add_fixup_ca): Likewise.
1358 (alpha_vms_link_add_object_symbols): Check VEC_APPEND result
1360 * elf.c (bfd_section_from_shdr): Check bfd_zalloc2 result.
1362 2020-02-19 Alan Modra <amodra@gmail.com>
1364 * aix386-core.c (aix386_core_file_p): Use size_t for "amt".
1365 * aout-target.h (object_p): Likewise.
1366 * aout-tic30.c (tic30_aout_object_p): Likewise.
1367 * aoutx.h (some_aout_object_p, mkobject, make_empty_symbol),
1368 (emit_stringtab, write_syms, link_hash_table_create),
1369 (aout_link_write_other_symbol): Likewise.
1370 * archive.c (_bfd_generic_mkarchive, bfd_generic_archive_p),
1371 (bfd_ar_hdr_from_filesystem, _bfd_write_archive_contents),
1372 (_bfd_compute_and_write_armap): Likewise.
1373 * archures.c (bfd_arch_list): Likewise.
1374 * bfd.c (bfd_record_phdr): Likewise.
1375 * binary.c (binary_canonicalize_symtab): Likewise.
1376 * cisco-core.c (cisco_core_file_validate): Likewise.
1377 * coff-arm.c (coff_arm_link_hash_table_create, find_thumb_glue),
1378 (find_arm_glue, record_arm_to_thumb_glue),
1379 (record_thumb_to_arm_glue): Likewise.
1380 * coff-ppc.c (ppc_coff_link_hash_table_create, record_toc),
1381 (ppc_allocate_toc_section): Likewise.
1382 * coff-rs6000.c (_bfd_xcoff_mkobject, _bfd_xcoff_archive_p): Likewise.
1383 * coff-sh.c (sh_relax_section): Likewise.
1384 * coff64-rs6000.c (xcoff64_archive_p): Likewise.
1385 * coffcode.h (handle_COMDAT, coff_new_section_hook),
1386 (coff_set_alignment_hook, coff_mkobject),
1387 (coff_compute_section_file_positions): Likewise.
1388 * coffgen.c (coff_make_empty_symbol, coff_bfd_make_debug_symbol),
1389 (coff_find_nearest_line_with_names),
1390 ( bfd_coff_set_symbol_class): Likewise.
1391 * cofflink.c (_bfd_coff_link_hash_table_create),
1392 (_bfd_coff_link_input_bfd): Likewise.
1393 * dwarf1.c (alloc_dwarf1_unit, alloc_dwarf1_func): Likewise.
1394 * dwarf2.c (read_abbrevs, read_attribute_value, add_line_info),
1395 (build_line_info_table, sort_line_sequences),
1396 (line_info_add_include_dir, line_info_add_file_name),
1397 (decode_line_info, scan_unit_for_symbols, parse_comp_unit),
1398 (place_sections, _bfd_dwarf2_slurp_debug_info): Likewise.
1399 * ecoff.c (_bfd_ecoff_mkobject, _bfd_ecoff_make_empty_symbol),
1400 (_bfd_ecoff_find_nearest_line),
1401 (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
1402 * ecofflink.c (bfd_ecoff_debug_init): Likewise.
1403 * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Likewise.
1404 * elf-m10300.c (mn10300_elf_relax_section),
1405 (elf32_mn10300_link_hash_table_create): Likewise.
1406 * elf-strtab.c (_bfd_elf_strtab_init): Likewise.
1407 * elf.c (make_mapping, copy_elf_program_header): Likewise.
1408 * elf32-arm.c (elf32_arm_link_hash_table_create),
1409 (elf32_arm_setup_section_lists, elf32_arm_check_relocs),
1410 (elf32_arm_new_section_hook): Likewise.
1411 * elf32-avr.c (elf_avr_new_section_hook),
1412 (elf32_avr_link_hash_table_create, get_local_syms),
1413 (elf32_avr_setup_section_lists): Likewise.
1414 * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create),
1415 (bfin_link_hash_table_create): Likewise.
1416 * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1417 * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1418 * elf32-csky.c (csky_elf_link_hash_table_create),
1419 (csky_elf_check_relocs, elf32_csky_setup_section_lists): Likewise.
1420 * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1421 * elf32-hppa.c (elf32_hppa_link_hash_table_create),
1422 (elf32_hppa_setup_section_lists, get_local_syms): Likewise.
1423 * elf32-i386.c (elf_i386_check_relocs): Likewise.
1424 * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1425 * elf32-m32r.c (m32r_elf_link_hash_table_create),
1426 (m32r_elf_check_relocs): Likewise.
1427 * elf32-m68hc1x.c (m68hc11_elf_hash_table_create),
1428 (elf32_m68hc11_setup_section_lists),
1429 (elf32_m68hc11_size_stubs): Likewise.
1430 * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1431 * elf32-metag.c (elf_metag_link_hash_table_create),
1432 (elf_metag_setup_section_lists): Likewise.
1433 * elf32-microblaze.c (microblaze_elf_link_hash_table_create),
1434 (microblaze_elf_check_relocs): Likewise.
1435 * elf32-nds32.c (nds32_elf_link_hash_table_create),
1436 (nds32_elf_check_relocs): Likewise.
1437 * elf32-nios2.c (nios2_elf32_setup_section_lists),
1438 (get_local_syms, nios2_elf32_check_relocs),
1439 (nios2_elf32_link_hash_table_create): Likewise.
1440 * elf32-or1k.c (or1k_elf_link_hash_table_create),
1441 (or1k_elf_check_relocs): Likewise.
1442 * elf32-ppc.c (ppc_elf_modify_segment_map, update_plt_info): Likewise.
1443 * elf32-pru.c (pru_elf32_link_hash_table_create): Likewise.
1444 * elf32-s390.c (elf_s390_link_hash_table_create),
1445 (elf_s390_check_relocs): Likewise.
1446 * elf32-score.c (score_elf_create_got_section),
1447 (s3_elf32_score_new_section_hook),
1448 (elf32_score_link_hash_table_create): Likewise.
1449 * elf32-score7.c (score_elf_create_got_section),
1450 (s7_elf32_score_new_section_hook): Likewise.
1451 * elf32-sh.c (sh_elf_link_hash_table_create),
1452 (sh_elf_check_relocs): Likewise.
1453 * elf32-tic6x.c (elf32_tic6x_link_hash_table_create),
1454 (elf32_tic6x_new_section_hook, elf32_tic6x_check_relocs): Likewise.
1455 * elf32-tilepro.c (tilepro_elf_link_hash_table_create),
1456 (tilepro_elf_check_relocs): Likewise.
1457 * elf32-v850.c (remember_hi16s_reloc): Likewise.
1458 * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1459 * elf32-xtensa.c (elf_xtensa_link_hash_table_create),
1460 (elf_xtensa_new_section_hook): Likewise.
1461 * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create),
1462 (get_got_entry, elf64_alpha_check_relocs): Likewise.
1463 * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1464 * elf64-ia64-vms.c (elf64_ia64_object_p): Likewise.
1465 * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
1466 * elf64-ppc.c (ppc64_elf_new_section_hook),
1467 (ppc64_elf_link_hash_table_create, update_local_sym_info),
1468 (update_plt_info, ppc64_elf_check_relocs): Likewise.
1469 * elf64-s390.c (elf_s390_link_hash_table_create),
1470 (elf_s390_check_relocs): Likewise.
1471 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1472 * elflink.c (bfd_elf_link_record_local_dynamic_symbol),
1473 (_bfd_elf_link_find_version_dependencies, elf_link_add_object_symbols),
1474 (elf_link_add_archive_symbols, compute_bucket_count),
1475 (bfd_elf_size_dynsym_hash_dynstr, _bfd_elf_link_hash_table_create),
1476 (bfd_elf_get_bfd_needed_list, elf_link_swap_symbols_out),
1477 (bfd_elf_final_link): Likewise.
1478 * elfnn-aarch64.c (elfNN_aarch64_link_hash_table_create),
1479 (elfNN_aarch64_setup_section_lists, elfNN_aarch64_check_relocs),
1480 (elfNN_aarch64_new_section_hook): Likewise.
1481 * elfnn-ia64.c (elfNN_ia64_object_p): Likewise.
1482 * elfnn-riscv.c (riscv_elf_link_hash_table_create),
1483 (riscv_elf_check_relocs): Likewise.
1484 * elfxx-mips.c (_bfd_mips_elf_new_section_hook),
1485 (_bfd_mips_elf_add_symbol_hook, _bfd_mips_elf_check_relocs),
1486 (_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_set_section_contents),
1487 (_bfd_mips_elf_link_hash_table_create): Likewise.
1488 * elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create),
1489 (_bfd_sparc_elf_check_relocs),
1490 (_bfd_sparc_elf_new_section_hook): Likewise.
1491 * elfxx-tilegx.c (tilegx_elf_link_hash_table_create),
1492 (tilegx_elf_check_relocs): Likewise.
1493 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Likewise.
1494 * format.c (bfd_check_format_matches): Likewise.
1495 * hash.c (_bfd_stringtab_init): Likewise.
1496 * ihex.c (ihex_scan): Likewise.
1497 * irix-core.c (irix_core_core_file_p): Likewise.
1498 * linker.c (bfd_wrapped_link_hash_lookup),
1499 (_bfd_generic_link_hash_table_create),
1500 (_bfd_generic_reloc_link_order): Likewise.
1501 * lynx-core.c (lynx_core_file_p): Likewise.
1502 * netbsd-core.c (netbsd_core_file_p): Likewise.
1503 * osf-core.c (osf_core_core_file_p): Likewise.
1504 * pdp11.c (some_aout_object_p, mkobject, make_empty_symbol),
1505 (link_hash_table_create, aout_link_write_other_symbol): Likewise.
1506 * peXXigen.c (_bfd_XX_bfd_copy_private_section_data): Likewise.
1507 * peicode.h (pe_mkobject): Likewise.
1508 * ppcboot.c (ppcboot_mkobject, ppcboot_canonicalize_symtab): Likewise.
1509 * ptrace-core.c (ptrace_unix_core_file_p): Likewise.
1510 * sco5-core.c (read_uarea): Likewise.
1511 * som.c (hppa_som_gen_reloc_type, som_object_p, som_prep_headers),
1512 (som_write_fixups, som_write_space_strings, som_write_symbol_strings),
1513 (som_finish_writing, som_canonicalize_symtab, som_new_section_hook),
1514 (som_bfd_copy_private_section_data, bfd_som_set_section_attributes),
1515 (bfd_som_attach_aux_hdr, som_write_armap): Likewise.
1516 * srec.c (srec_scan): Likewise.
1517 * syms.c (_bfd_generic_make_empty_symbol): Likewise.
1518 * targets.c (bfd_target_list): Likewise.
1519 * tekhex.c (first_phase, tekhex_sizeof_headers): Likewise.
1520 * trad-core.c (trad_unix_core_file_p): Likewise.
1521 * vms-alpha.c (vms_initialize, alpha_vms_bfd_link_hash_table_create),
1522 (vms_new_section_hook): Likewise.
1523 * wasm-module.c (wasm_make_empty_symbol): Likewise.
1524 * xcofflink.c (xcoff_get_section_contents),
1525 (_bfd_xcoff_bfd_link_hash_table_create, xcoff_set_import_path),
1526 (xcoff_find_function, bfd_xcoff_link_record_set, xcoff_build_ldsym),
1527 (bfd_xcoff_size_dynamic_sections, xcoff_link_input_bfd): Likewise.
1529 2020-02-19 Alan Modra <amodra@gmail.com>
1531 * elfxx-riscv.c (riscv_multi_letter_ext_valid_p): Don't use C99.
1533 2020-02-13 H.J. Lu <hongjiu.lu@intel.com>
1535 * plugin.c (try_load_plugin): Make plugin_list_iter an argument
1536 and use it if it isn't NULL. Remove has_plugin_p argument. Add
1537 a build_list_p argument. Don't search plugin_list. Short circuit
1538 when building the plugin list.
1539 (has_plugin): Renamed to has_plugin_list.
1540 (bfd_plugin_set_plugin): Don't set has_plugin.
1541 (bfd_plugin_specified_p): Check plugin_list instead.
1542 (build_plugin_list): New function.
1543 (load_plugin): Call build_plugin_list and use plugin_list.
1545 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1548 * plugin.c (try_claim): Always clean up for LTO wrapper.
1549 (try_load_plugin): Treat each object as independent. Create a
1550 copy for plugin name.
1552 2020-02-11 Nick Clifton <nickc@redhat.com>
1554 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
1555 for addresses in print statements.
1556 (msp430_elf_relax_delete_bytes): Likewise.
1557 (msp430_elf_relax_add_words): Likewise.
1558 (msp430_elf_relax_section): Likewise.
1560 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
1562 * plugin.c (add_symbols): Clear plugin_data memory.
1564 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
1567 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
1568 (EXECUTABLE_SUFFIX): Likewise.
1569 * config.in: Regenerated.
1570 * configure: Likewise.
1571 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
1572 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
1573 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
1574 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
1575 (get_lto_wrapper): New.
1576 (setup_lto_wrapper_env): Likewise.
1577 (current_plugin): Likewise.
1578 (register_all_symbols_read): Likewise.
1579 (register_cleanup): Likewise.
1580 (get_symbols): Likewise.
1581 (add_input_file): Likewise.
1582 (bfd_plugin_close_and_cleanup): Likewise.
1583 (claim_file): Removed.
1584 (register_claim_file): Set current_plugin->claim_file.
1585 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
1586 lto_syms in current_plugin.
1587 (try_claim): Use current_plugin->claim_file. Call LTO plugin
1588 all_symbols_read handler. Copy real symbols to plugin_data.
1589 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
1590 (try_load_plugin): Don't reuse the previous plugin for LTO
1591 wrapper. Set up GCC LTO wrapper if possible. Don't set
1592 plugin_list_iter->claim_file.
1593 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
1595 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
1598 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1600 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
1601 check if previous instruction matches a conditional jump inserted
1602 earlier. Invert conditional jump and delete branch in this case.
1604 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1606 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
1607 msp430_elf_relax_add_words. Support insertion of either one or two
1609 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
1610 needs to be grown. Handle insertion of branch instruction to replace
1613 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
1615 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
1616 debugging relocations.
1617 (msp430_elf_relax_delete_bytes): Likewise.
1618 (msp430_elf_relax_add_two_words): Likewise.
1619 (msp430_elf_relax_section): Likewise.
1621 2020-02-10 Alan Modra <amodra@gmail.com>
1623 * archures.c: Wrap overlong z80 comments.
1624 * bfd-in2.h: Regenerate.
1626 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
1629 * archures.c: Add GBZ80 and Z80N machine values.
1630 * reloc.c: Add BFD_RELOC_Z80_16_BE.
1631 * coff-z80.c: Add support for new reloc.
1632 * coffcode.h: Add support for new machine values.
1633 * cpu-z80.c: Add support for new machine names.
1634 * elf32-z80.c: Add support for new reloc.
1635 * bfd-in2.h: Regenerate.
1636 * libbfd.h: Regenerate.
1638 2020-02-07 Nick Clifton <nickc@redhat.com>
1641 * elf.c (rewrite_elf_program_header): Do not complain if no
1642 sections are mapped to a segment.
1644 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1647 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
1648 for garbage collection on __patchable_function_entries section
1649 without linked-to section.
1651 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
1654 * bfd-in2.h: Regenerated.
1655 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
1656 on section if gc_mark of any of its linked-to sections is set
1657 and don't set gc_mark again.
1658 * section.c (asection): Add linked_to_symbol_name to map_head
1661 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
1663 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
1664 reporting an unrecognized instruction with R_V850_LONGJUMP.
1666 2020-02-05 Alan Modra <amodra@gmail.com>
1668 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
1670 2020-02-04 Alan Modra <amodra@gmail.com>
1672 * elf32-ppc.c (ppc_elf_relocate_section): After applying
1673 R_PPC_VLE_ADDR20, goto copy_reloc.
1675 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1677 * bfd-in2.h: Regenerated.
1678 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
1680 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
1683 * bfd-in2.h: Regenerated.
1684 * ecoff.c (bfd_debug_section): Add section_id.
1685 * section.c (bfd_section): Add section_id.
1686 (SEC_ASSEMBLER_SECTION_ID): New.
1687 (BFD_FAKE_SECTION): Add section_id.
1689 2020-02-01 Nick Clifton <nickc@redhat.com>
1691 * config.bfd: Move the c30-aout and tic30-aout targets onto the
1694 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
1696 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
1697 encodings are relative to the GOT on nios2, too.
1699 2020-01-31 Alan Modra <amodra@gmail.com>
1701 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
1702 file. Use $< and $@ in rules.
1703 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
1704 (elf32-ia64.c, elf64-ia64.c): Likewise.
1705 (elf32-riscv.c, elf64-riscv.c): Likewise.
1706 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1707 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
1708 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
1709 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
1710 (peigen.c, pepigen.c, pex64igen.c): Likewise.
1711 * Makefile.in: Regenerate.
1713 2020-01-31 Alan Modra <amodra@gmail.com>
1716 * elf.c (setup_group): Don't clear entire section contents,
1717 just the padding after group flags. Release alloc'd memory
1718 after a seek or read failure.
1720 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1722 * peXXigen.c (pe_is_repro): New function.
1723 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
1724 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
1726 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1728 * peXXigen.c (debug_type_names): Add names for new debug data type
1731 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
1733 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
1734 inner loop. Fix a memory leak.
1736 2020-01-30 Alan Modra <amodra@gmail.com>
1738 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
1739 or obj_coff_keep_strings here.
1740 (coff_get_normalized_symtab): Free external syms directly.
1741 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
1744 2020-01-27 Jim Wilson <jimw@sifive.com>
1746 * cpu-riscv.c (riscv_scan): New.
1747 (N): Change bfd_default_scan to riscv_scan.
1749 2020-01-27 Andreas Schwab <schwab@suse.de>
1751 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
1752 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
1753 * Makefile.in: Regenerate.
1754 * cpu-plugin.c: Remove.
1755 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
1756 (bfd_plugin_arch): Remove declaration.
1757 * bfd-in2.h: Regenerate.
1758 * po/SRC-POTFILES.in: Regenerate.
1760 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
1761 Alan Modra <amodra@gmail.com>
1764 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
1766 2020-01-24 Jim Wilson <jimw@sifive.com>
1768 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
1769 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
1770 avoid over long line.
1772 2020-01-24 Nick Clifton <nickc@redhat.com>
1775 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
1776 syms and keep strings flags as these may have been set in order to
1777 prevent a bogus call to free.
1779 2020-01-23 Nick Clifton <nickc@redhat.com>
1781 * po/fr.po: Updated French translation.
1783 2020-01-23 Alan Modra <amodra@gmail.com>
1786 * elf.c (assign_file_positions_for_load_sections): Avoid divide
1787 by zero when p_align is zero.
1789 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
1791 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
1792 (riscv_prefix_cmp): Likewise.
1793 (riscv_non_std_ext_p): Deleted.
1794 (riscv_std_sv_ext_p): Likewise.
1795 (riscv_non_std_sv_ext_p): Likewise.
1796 (riscv_merge_non_std_and_sv_ext): Rename to...
1797 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
1798 (riscv_merge_arch_attr_info): Replace 3 calls to
1799 riscv_merge_non_std_and_sv_ext with single call to
1800 riscv_merge_multi_letter_ext.
1801 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
1802 encounter a 'z' prefix.
1803 (riscv_get_prefix_class): New function, return prefix class based
1804 on first few characters of input string.
1805 (riscv_parse_config): New structure to factor out minor differences
1806 in extension class parsing behaviour.
1807 (riscv_parse_sv_or_non_std_ext): Rename to...
1808 (riscv_parse_prefixed_ext): and parameterise with
1810 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
1811 (riscv_multi_letter_ext_valid_p): New.
1812 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
1813 (riscv_parse_subset): Delegate all non-single-letter parsing work
1814 to riscv_parse_prefixed_ext.
1815 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
1816 (riscv_get_prefix_class): Declare.
1818 2020-01-22 Alan Modra <amodra@gmail.com>
1820 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
1821 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
1822 __tls_get_addr_desc.
1823 (ppc64_elf_size_stubs): Add section for linker generated
1824 __tls_get_addr_desc wrapper function. Loop at least once if
1825 generating this function.
1826 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
1827 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
1829 2020-01-22 Alan Modra <amodra@gmail.com>
1831 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
1832 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
1834 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
1835 (STDU_R1_0R1, ADDI_R1_R1): Define.
1836 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
1837 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
1838 tga_desc_fd to opt_fd, and tga_desc to opt. Set
1839 no_tls_get_addr_regsave.
1840 (branch_reloc_hash_match): Add hash3 and hash4.
1841 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
1842 (ppc64_elf_size_dynamic_sections): Likewise.
1843 (ppc64_elf_relocate_section): Likewise.
1844 (plt_stub_size, build_plt_stub): Likewise. Size regsave
1845 __tls_get_addr stub.
1846 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
1848 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
1849 eh_frame for regsave __tls_get_addr.
1851 2020-01-22 Alan Modra <amodra@gmail.com>
1853 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
1854 which __tls_get_addr calls will be eliminated.
1856 2020-01-20 Nick Clifton <nickc@redhat.com>
1858 * po/pt.po: Updates Portuguese translation.
1859 * po/ru.po: Updated Russian translation.
1860 * po/uk.po: Updated Ukranian translation.
1862 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
1865 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
1866 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
1868 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
1869 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
1870 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
1871 "rex leal x@tlsdesc(%rip), %reg" to
1872 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
1873 "call *(%eax)" to "nopl (%rax)".
1875 2020-01-20 Alan Modra <amodra@gmail.com>
1877 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
1878 (MTLR_R11): Don't define.
1879 (LD_R0_0R3, CMPDI_R0_0): Define.
1880 (build_tls_get_addr_stub): Don't use r11 in stub.
1882 2020-01-20 Alan Modra <amodra@gmail.com>
1884 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
1885 (defined_sym_val, is_tls_get_addr): Likewise.
1887 2020-01-18 Nick Clifton <nickc@redhat.com>
1889 * version.m4 (BFD_VERSION): Set to 2.34.50.
1890 * configure: Regenerate.
1891 * po/bfd.pot: Regenerate.
1893 2020-01-18 Nick Clifton <nickc@redhat.com>
1895 Binutils 2.34 branch created.
1897 2020-01-17 Christian Biesinger <cbiesinger@google.com>
1899 * coff-arm.c: Fix spelling error (seperate).
1900 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
1902 * sysdep.h (strnlen): Fix spelling error (seperate).
1904 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
1907 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
1909 2020-01-15 Alan Modra <amodra@gmail.com>
1912 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
1913 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
1914 of function symbols unless dot symbols are present. Do warn
1915 whenever one is created, regardles of whether a PLT entry is
1916 also emitted for the function symbol.
1918 2020-01-14 Alan Modra <amodra@gmail.com>
1920 * som.c (som_bfd_count_ar_symbols): Error when file position
1921 of symbols on chains is not strictly increasing.
1923 2020-01-14 Alan Modra <amodra@gmail.com>
1925 * vms.h (VMS_DEBUG): Define as 0.
1926 * vms-alpha.c (image_write): Move debug output after bounds check.
1928 (_bfd_vms_slurp_eihd): Warning fix.
1929 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
1931 2020-01-13 Alan Modra <amodra@gmail.com>
1933 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
1934 for "ignored" records.
1936 2020-01-13 Alan Modra <amodra@gmail.com>
1938 * wasm-module.c (wasm_scan_name_function_section): Formatting.
1939 Delete asect name check. Move asect NULL check to wasm_object_p.
1940 Correct bounds check of sizes against end. Replace uses of
1941 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
1942 just one bfd_release.
1943 (wasm_scan): Don't use malloc/strdup for section names,
1944 bfd_alloc instead. Simplify code prefixing section name.
1945 Formatting. Don't attempt to free memory here..
1946 (wasm_object_p): ..do so here.
1948 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
1951 * elf32-arm.c (elf32_arm_final_link_relocate): Use
1952 UNDEFWEAK_NO_DYNAMIC_RELOC.
1953 (allocate_dynrelocs_for_symbol): Likewise.
1955 2020-01-10 Tamar Christina <tamar.christina@arm.com>
1958 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
1960 2020-01-10 Alan Modra <amodra@gmail.com>
1962 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
1964 2020-01-09 Nick Clifton <nickc@redhat.com>
1967 * bfd.c (bfd_convert_section_contents): Check for a compress
1968 header size that is larger than the actual section size.
1970 2020-01-08 Alan Modra <amodra@gmail.com>
1973 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
1974 after removing sections.
1976 2020-01-06 Jim Wilson <jimw@sifive.com>
1979 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
1980 check for !bfd_link_pic (info).
1981 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
1982 <R_RISCV_JAL>: Add comment.
1983 (_bfd_riscv_relax_section): For plt.offset check, add check for
1984 bfd_link_pic (info). Add comment.
1986 2020-01-06 Alan Modra <amodra@gmail.com>
1988 * format.c (bfd_check_format_matches): Ignore bfd_error on target
1989 match failures. Don't init to bfd_error_wrong_format before
1990 calling _bfd_check_format.
1992 2020-01-06 Alan Modra <amodra@gmail.com>
1994 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
1995 status rather than exiting on stack overflow or underflow.
1996 (_bfd_vms_slurp_etir): Adjust to suit.
1998 2020-01-06 Alan Modra <amodra@gmail.com>
2000 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
2002 2020-01-06 Alan Modra <amodra@gmail.com>
2004 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
2005 command. Check name offset is within command.
2006 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
2007 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
2008 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
2009 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
2010 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
2011 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
2012 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
2013 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
2014 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
2015 (bfd_mach_o_read_segment): Similarly.
2016 (bfd_mach_o_read_thread): Properly bound check thread struct.
2017 Don't repeat checks on second loop.
2018 (bfd_mach_o_read_command): Fail on invalid command length.
2020 2020-01-04 Alan Modra <amodra@gmail.com>
2022 * format.c (bfd_check_format_matches): Add preserve_match.
2023 Save initial bfd state in "preserve", matched bfd state in
2024 "preserve_match". Save just the first match. Release
2025 bfd_alloc memory. Restore and finish preserved state as
2026 appropriate on all function exit paths.
2028 2020-01-04 Alan Modra <amodra@gmail.com>
2030 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
2032 2020-01-04 Alan Modra <amodra@gmail.com>
2034 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
2037 2020-01-03 Nick Clifton <nickc@redhat.com>
2040 (bfd_pef_parse_function_stubs): Correct the test that ensures that
2041 there is enough data remaining in the code buffer before
2042 attempting to read a function stub.
2044 2020-01-03 Nick Clifton <nickc@redhat.com>
2047 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
2048 return value from bfd_malloc.
2049 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
2050 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
2051 (elf32_arm_filter_cmse_symbols): Likewise.
2052 (elf32_arm_write_section): Likewise.
2053 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
2054 (bfd_mach_o_follow_dsym): Likewise.
2055 * pef.c (bfd_pef_print_loader_section): Likewise.
2056 (bfd_pef_scan_start_address): Likewise.
2057 (bfd_pef_parse_function_stubs): Likewise.
2058 (bfd_pef_parse_symbols): Likewise.
2060 2020-01-03 Sergei Trofimovich <siarheit@google.com>
2062 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
2063 on binary inputs ld/PR25316.
2064 (is_ia64_elf): new helper to filter on ia64 objects.
2066 2020-01-03 Jan Beulich <jbeulich@suse.com>
2068 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
2070 (bfd_mach_o_scan): Insert underscore in two variable names.
2072 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
2074 * Makefile.am: Add z80-elf target support.
2075 * configure.ac: Likewise.
2076 * targets.c: Likewise.
2077 * Makefile.in: Regenerate.
2078 * configure: Regenerate.
2079 * config.bfd: Add z80-elf target support and new arches: ez80 and
2081 * elf32-z80.c: New file.
2082 * archures.c: Add new z80 architectures: eZ80 and Z180.
2083 * coffcode.h: Likewise.
2084 * cpu-z80.c: Likewise.
2085 * coff-z80.c: Add new relocations for Z80 target and local label
2087 * reloc.c: Add new relocs.
2088 * bfd-in2.h: Regenerate.
2089 * libbfd.h: Regenerate.
2091 2020-01-02 Tamar Christina <tamar.christina@arm.com>
2095 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
2097 2020-01-01 Alan Modra <amodra@gmail.com>
2099 Update year range in copyright notice of all files.
2101 For older changes see ChangeLog-2019
2103 Copyright (C) 2020 Free Software Foundation, Inc.
2105 Copying and distribution of this file, with or without modification,
2106 are permitted in any medium without royalty provided the copyright
2107 notice and this notice are preserved.
2113 version-control: never