1 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
4 * plugin.c (try_claim): Always clean up for LTO wrapper.
5 (try_load_plugin): Treat each object as independent. Create a
8 2020-02-11 Nick Clifton <nickc@redhat.com>
10 * elf32-msp430.c (msp430_final_link_relocate): Always use longs
11 for addresses in print statements.
12 (msp430_elf_relax_delete_bytes): Likewise.
13 (msp430_elf_relax_add_words): Likewise.
14 (msp430_elf_relax_section): Likewise.
16 2020-02-11 H.J. Lu <hongjiu.lu@intel.com>
18 * plugin.c (add_symbols): Clear plugin_data memory.
20 2020-02-10 H.J. Lu <hongjiu.lu@intel.com>
23 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE.
24 (EXECUTABLE_SUFFIX): Likewise.
25 * config.in: Regenerated.
26 * configure: Likewise.
27 * plugin.c (bfd_plugin_close_and_cleanup): Removed.
28 (plugin_list_entry): Add all_symbols_read, cleanup_handler,
29 gcc, lto_wrapper, resolution_file, resolution_option, gcc_env,
30 real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms.
31 (get_lto_wrapper): New.
32 (setup_lto_wrapper_env): Likewise.
33 (current_plugin): Likewise.
34 (register_all_symbols_read): Likewise.
35 (register_cleanup): Likewise.
36 (get_symbols): Likewise.
37 (add_input_file): Likewise.
38 (bfd_plugin_close_and_cleanup): Likewise.
39 (claim_file): Removed.
40 (register_claim_file): Set current_plugin->claim_file.
41 (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and
42 lto_syms in current_plugin.
43 (try_claim): Use current_plugin->claim_file. Call LTO plugin
44 all_symbols_read handler. Copy real symbols to plugin_data.
45 Call LTO plugin cleanup handler. Clean up for LTO wrapper.
46 (try_load_plugin): Don't reuse the previous plugin for LTO
47 wrapper. Set up GCC LTO wrapper if possible. Don't set
48 plugin_list_iter->claim_file.
49 (bfd_plugin_canonicalize_symtab): Use real LTO symbols if
51 * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and
54 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
56 * elf32-msp430.c (msp430_elf_relax_section): Before relaxing a branch,
57 check if previous instruction matches a conditional jump inserted
58 earlier. Invert conditional jump and delete branch in this case.
60 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
62 * elf32-msp430.c (msp430_elf_relax_add_two_words): Rename to
63 msp430_elf_relax_add_words. Support insertion of either one or two
65 (msp430_elf_relax_section): Catch opcode of 0x3c00 when relocation
66 needs to be grown. Handle insertion of branch instruction to replace
69 2020-02-10 Jozef Lawrynowicz <jozef.l@mittosystems.com>
71 * elf32-msp430.c (msp430_final_link_relocate): Add printf statements for
72 debugging relocations.
73 (msp430_elf_relax_delete_bytes): Likewise.
74 (msp430_elf_relax_add_two_words): Likewise.
75 (msp430_elf_relax_section): Likewise.
77 2020-02-10 Alan Modra <amodra@gmail.com>
79 * archures.c: Wrap overlong z80 comments.
80 * bfd-in2.h: Regenerate.
82 2020-02-07 Sergey Belyashov <sergey.belyashov@gmail.com>
85 * archures.c: Add GBZ80 and Z80N machine values.
86 * reloc.c: Add BFD_RELOC_Z80_16_BE.
87 * coff-z80.c: Add support for new reloc.
88 * coffcode.h: Add support for new machine values.
89 * cpu-z80.c: Add support for new machine names.
90 * elf32-z80.c: Add support for new reloc.
91 * bfd-in2.h: Regenerate.
92 * libbfd.h: Regenerate.
94 2020-02-07 Nick Clifton <nickc@redhat.com>
97 * elf.c (rewrite_elf_program_header): Do not complain if no
98 sections are mapped to a segment.
100 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
103 * elflink.c (_bfd_elf_gc_mark_extra_sections): Issue an error
104 for garbage collection on __patchable_function_entries section
105 without linked-to section.
107 2020-02-06 H.J. Lu <hongjiu.lu@intel.com>
110 * bfd-in2.h: Regenerated.
111 * elflink.c (_bfd_elf_gc_mark_extra_sections): Call mark_hook
112 on section if gc_mark of any of its linked-to sections is set
113 and don't set gc_mark again.
114 * section.c (asection): Add linked_to_symbol_name to map_head
117 2020-02-06 Maciej W. Rozycki <macro@wdc.com>
119 * elf32-v850.c (v850_elf_relax_section): Fix the index used for
120 reporting an unrecognized instruction with R_V850_LONGJUMP.
122 2020-02-05 Alan Modra <amodra@gmail.com>
124 * elf64-ppc.c (ppc_stub_plt_branch): Match comment with reality.
126 2020-02-04 Alan Modra <amodra@gmail.com>
128 * elf32-ppc.c (ppc_elf_relocate_section): After applying
129 R_PPC_VLE_ADDR20, goto copy_reloc.
131 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
133 * bfd-in2.h: Regenerated.
134 * section.c (SEC_ASSEMBLER_SECTION_ID): Fix a typo in comments.
136 2020-02-02 H.J. Lu <hongjiu.lu@intel.com>
139 * bfd-in2.h: Regenerated.
140 * ecoff.c (bfd_debug_section): Add section_id.
141 * section.c (bfd_section): Add section_id.
142 (SEC_ASSEMBLER_SECTION_ID): New.
143 (BFD_FAKE_SECTION): Add section_id.
145 2020-02-01 Nick Clifton <nickc@redhat.com>
147 * config.bfd: Move the c30-aout and tic30-aout targets onto the
150 2020-01-31 Sandra Loosemore <sandra@codesourcery.com>
152 * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): DW_EH_PE_datarel
153 encodings are relative to the GOT on nios2, too.
155 2020-01-31 Alan Modra <amodra@gmail.com>
157 * Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
158 file. Use $< and $@ in rules.
159 (elf32-aarch64.c, elf64-aarch64.c): Likewise.
160 (elf32-ia64.c, elf64-ia64.c): Likewise.
161 (elf32-riscv.c, elf64-riscv.c): Likewise.
162 (peigen.c, pepigen.c, pex64igen.c): Likewise.
163 (elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
164 (elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
165 (elf32-ia64.c, elf64-ia64.c): Do emit #line.
166 (peigen.c, pepigen.c, pex64igen.c): Likewise.
167 * Makefile.in: Regenerate.
169 2020-01-31 Alan Modra <amodra@gmail.com>
172 * elf.c (setup_group): Don't clear entire section contents,
173 just the padding after group flags. Release alloc'd memory
174 after a seek or read failure.
176 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
178 * peXXigen.c (pe_is_repro): New function.
179 (_bfd_XX_print_private_bfd_data_common): Note timestamp is
180 actually a build hash if PE_IMAGE_DEBUG_TYPE_REPRO is present.
182 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
184 * peXXigen.c (debug_type_names): Add names for new debug data type
187 2020-01-16 Jon Turney <jon.turney@dronecode.org.uk>
189 * peXXigen.c (pe_print_debugdata): Fix the iteration variable for
190 inner loop. Fix a memory leak.
192 2020-01-30 Alan Modra <amodra@gmail.com>
194 * coffgen.c (coff_real_object_p): Don't clear obj_coff_keep_syms
195 or obj_coff_keep_strings here.
196 (coff_get_normalized_symtab): Free external syms directly.
197 * xcofflink.c (xcoff_link_input_bfd): Restore obj_coff_keep_syms
200 2020-01-27 Jim Wilson <jimw@sifive.com>
202 * cpu-riscv.c (riscv_scan): New.
203 (N): Change bfd_default_scan to riscv_scan.
205 2020-01-27 Andreas Schwab <schwab@suse.de>
207 * Makefile.am (ALL_MACHINES): Remove cpu-plugin.lo.
208 (ALL_MACHINES_CFILES): Remove cpu-plugin.c.
209 * Makefile.in: Regenerate.
210 * cpu-plugin.c: Remove.
211 * archures.c (enum bfd_architecture): Remove bfd_arch_plugin.
212 (bfd_plugin_arch): Remove declaration.
213 * bfd-in2.h: Regenerate.
214 * po/SRC-POTFILES.in: Regenerate.
216 2020-01-27 H.J. Lu <hongjiu.lu@intel.com>
217 Alan Modra <amodra@gmail.com>
220 * elflink.c (_bfd_elf_gc_mark_rsec): Mark all weak aliases.
222 2020-01-24 Jim Wilson <jimw@sifive.com>
224 * elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
225 (riscv_parse_prefixed_ext): Fix s extension comment and reword to
226 avoid over long line.
228 2020-01-24 Nick Clifton <nickc@redhat.com>
231 * coffgen.c (_bfd_coff_close_and_cleanup): Do not clear the keep
232 syms and keep strings flags as these may have been set in order to
233 prevent a bogus call to free.
235 2020-01-23 Nick Clifton <nickc@redhat.com>
237 * po/fr.po: Updated French translation.
239 2020-01-23 Alan Modra <amodra@gmail.com>
242 * elf.c (assign_file_positions_for_load_sections): Avoid divide
243 by zero when p_align is zero.
245 2020-01-22 Maxim Blinov <maxim.blinov@embecosm.com>
247 * bfd/elfnn-riscv.c (riscv_skip_prefix): New.
248 (riscv_prefix_cmp): Likewise.
249 (riscv_non_std_ext_p): Deleted.
250 (riscv_std_sv_ext_p): Likewise.
251 (riscv_non_std_sv_ext_p): Likewise.
252 (riscv_merge_non_std_and_sv_ext): Rename to...
253 (riscv_merge_multi_letter_ext): and modified to use riscv_prefix_cmp.
254 (riscv_merge_arch_attr_info): Replace 3 calls to
255 riscv_merge_non_std_and_sv_ext with single call to
256 riscv_merge_multi_letter_ext.
257 * bfd/elfxx-riscv.c (riscv_parse_std_ext): Break if we
258 encounter a 'z' prefix.
259 (riscv_get_prefix_class): New function, return prefix class based
260 on first few characters of input string.
261 (riscv_parse_config): New structure to factor out minor differences
262 in extension class parsing behaviour.
263 (riscv_parse_sv_or_non_std_ext): Rename to...
264 (riscv_parse_prefixed_ext): and parameterise with
266 (riscv_std_z_ext_strtab, riscv_std_s_ext_strtab): New.
267 (riscv_multi_letter_ext_valid_p): New.
268 (riscv_ext_x_valid_p, riscv_ext_z_valid_p, riscv_ext_s_valid_p): New.
269 (riscv_parse_subset): Delegate all non-single-letter parsing work
270 to riscv_parse_prefixed_ext.
271 * bfd/elfxx-riscv.h (riscv_isa_ext_class): New type.
272 (riscv_get_prefix_class): Declare.
274 2020-01-22 Alan Modra <amodra@gmail.com>
276 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_group.
277 (ppc64_elf_archive_symbol_lookup): Extract __tls_get_addr_opt for
279 (ppc64_elf_size_stubs): Add section for linker generated
280 __tls_get_addr_desc wrapper function. Loop at least once if
281 generating this function.
282 (emit_tga_desc, emit_tga_desc_eh_frame): New functions.
283 (ppc64_elf_build_stubs): Generate __tls_get_addr_desc.
285 2020-01-22 Alan Modra <amodra@gmail.com>
287 * elf64-ppc.h (struct ppc64_elf_params): Add no_tls_get_addr_regsave.
288 * elf64-ppc.c (struct ppc_link_hash_table): Add tga_desc and
290 (is_tls_get_addr): Match tga_desc and tga_desc_df too.
291 (STDU_R1_0R1, ADDI_R1_R1): Define.
292 (tls_get_addr_prologue, tls_get_addr_epilogue): New functions.
293 (ppc64_elf_tls_setup): Set up tga_desc and tga_desc_fd. Indirect
294 tga_desc_fd to opt_fd, and tga_desc to opt. Set
295 no_tls_get_addr_regsave.
296 (branch_reloc_hash_match): Add hash3 and hash4.
297 (ppc64_elf_tls_optimize): Handle tga_desc_fd and tga_desc too.
298 (ppc64_elf_size_dynamic_sections): Likewise.
299 (ppc64_elf_relocate_section): Likewise.
300 (plt_stub_size, build_plt_stub): Likewise. Size regsave
302 (build_tls_get_addr_stub): Build regsave __tls_get_addr stub and
304 (ppc_size_one_stub): Handle tga_desc_fd and tga_desc too. Size
305 eh_frame for regsave __tls_get_addr.
307 2020-01-22 Alan Modra <amodra@gmail.com>
309 * elf64-ppc.c (ppc64_elf_size_stubs): Correct condition under
310 which __tls_get_addr calls will be eliminated.
312 2020-01-20 Nick Clifton <nickc@redhat.com>
314 * po/pt.po: Updates Portuguese translation.
315 * po/ru.po: Updated Russian translation.
316 * po/uk.po: Updated Ukranian translation.
318 2020-01-20 H.J. Lu <hongjiu.lu@intel.com>
321 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Support
322 "rex leal x@tlsdesc(%rip), %reg" and "call *x@tlsdesc(%eax)" in
324 (elf_x86_64_relocate_section): In x32 mode, for GDesc -> LE
325 transition, relax "rex leal x@tlsdesc(%rip), %reg" to
326 "rex movl $x@tpoff, %reg", for GDesc -> IE transition, relax
327 "rex leal x@tlsdesc(%rip), %reg" to
328 "rex movl x@gottpoff(%rip), %eax". For both transitions, relax
329 "call *(%eax)" to "nopl (%rax)".
331 2020-01-20 Alan Modra <amodra@gmail.com>
333 * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1),
334 (MTLR_R11): Don't define.
335 (LD_R0_0R3, CMPDI_R0_0): Define.
336 (build_tls_get_addr_stub): Don't use r11 in stub.
338 2020-01-20 Alan Modra <amodra@gmail.com>
340 * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file.
341 (defined_sym_val, is_tls_get_addr): Likewise.
343 2020-01-18 Nick Clifton <nickc@redhat.com>
345 * version.m4 (BFD_VERSION): Set to 2.34.50.
346 * configure: Regenerate.
347 * po/bfd.pot: Regenerate.
349 2020-01-18 Nick Clifton <nickc@redhat.com>
351 Binutils 2.34 branch created.
353 2020-01-17 Christian Biesinger <cbiesinger@google.com>
355 * coff-arm.c: Fix spelling error (seperate).
356 * elfxx-riscv.c (riscv_parse_sv_or_non_std_ext): Fix spelling
358 * sysdep.h (strnlen): Fix spelling error (seperate).
360 2020-01-15 Lars Brinkhoff <lars@nocrew.org>
363 * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
365 2020-01-15 Alan Modra <amodra@gmail.com>
368 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
369 (ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
370 of function symbols unless dot symbols are present. Do warn
371 whenever one is created, regardles of whether a PLT entry is
372 also emitted for the function symbol.
374 2020-01-14 Alan Modra <amodra@gmail.com>
376 * som.c (som_bfd_count_ar_symbols): Error when file position
377 of symbols on chains is not strictly increasing.
379 2020-01-14 Alan Modra <amodra@gmail.com>
381 * vms.h (VMS_DEBUG): Define as 0.
382 * vms-alpha.c (image_write): Move debug output after bounds check.
384 (_bfd_vms_slurp_eihd): Warning fix.
385 (_bfd_vms_slurp_etir): Init variables to avoid bogus warnings.
387 2020-01-13 Alan Modra <amodra@gmail.com>
389 * vms-alpha.c (_bfd_vms_slurp_egsd): Ensure minimum size even
390 for "ignored" records.
392 2020-01-13 Alan Modra <amodra@gmail.com>
394 * wasm-module.c (wasm_scan_name_function_section): Formatting.
395 Delete asect name check. Move asect NULL check to wasm_object_p.
396 Correct bounds check of sizes against end. Replace uses of
397 bfd_zalloc with bfd_alloc, zeroing only necessary bytes. Use
398 just one bfd_release.
399 (wasm_scan): Don't use malloc/strdup for section names,
400 bfd_alloc instead. Simplify code prefixing section name.
401 Formatting. Don't attempt to free memory here..
402 (wasm_object_p): ..do so here.
404 2020-01-10 Szabolcs Nagy <szabolcs.nagy@arm.com>
407 * elf32-arm.c (elf32_arm_final_link_relocate): Use
408 UNDEFWEAK_NO_DYNAMIC_RELOC.
409 (allocate_dynrelocs_for_symbol): Likewise.
411 2020-01-10 Tamar Christina <tamar.christina@arm.com>
414 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Remove elfclass.
416 2020-01-10 Alan Modra <amodra@gmail.com>
418 * coff-alpha.c (alpha_ecoff_object_p): Calculate size in bfd_size_type.
420 2020-01-09 Nick Clifton <nickc@redhat.com>
423 * bfd.c (bfd_convert_section_contents): Check for a compress
424 header size that is larger than the actual section size.
426 2020-01-08 Alan Modra <amodra@gmail.com>
429 * elflink.c (bfd_elf_final_link): Call _bfd_fix_excluded_sec_syms
430 after removing sections.
432 2020-01-06 Jim Wilson <jimw@sifive.com>
435 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Add
436 check for !bfd_link_pic (info).
437 <R_RISCV_CALL_PLT>: Move next to R_RISCV_CALL.
438 <R_RISCV_JAL>: Add comment.
439 (_bfd_riscv_relax_section): For plt.offset check, add check for
440 bfd_link_pic (info). Add comment.
442 2020-01-06 Alan Modra <amodra@gmail.com>
444 * format.c (bfd_check_format_matches): Ignore bfd_error on target
445 match failures. Don't init to bfd_error_wrong_format before
446 calling _bfd_check_format.
448 2020-01-06 Alan Modra <amodra@gmail.com>
450 * vms-alpha.c (_bfd_vms_push, _bfd_vms_pop): Return pass/fail
451 status rather than exiting on stack overflow or underflow.
452 (_bfd_vms_slurp_etir): Adjust to suit.
454 2020-01-06 Alan Modra <amodra@gmail.com>
456 * som.c (som_bfd_fill_in_ar_symbols): Bounds check som_dict index.
458 2020-01-06 Alan Modra <amodra@gmail.com>
460 * mach-o.c (bfd_mach_o_read_dylinker): Don't read past end of
461 command. Check name offset is within command.
462 (bfd_mach_o_read_dylib, bfd_mach_o_read_prebound_dylib),
463 (bfd_mach_o_read_prebind_cksum, bfd_mach_o_read_twolevel_hints),
464 (bfd_mach_o_read_fvmlib, bfd_mach_o_read_dysymtab),
465 (bfd_mach_o_read_symtab, bfd_mach_o_read_uuid),
466 (bfd_mach_o_read_linkedit, bfd_mach_o_read_str),
467 (bfd_mach_o_read_dyld_info, bfd_mach_o_read_version_min),
468 (bfd_mach_o_read_encryption_info, bfd_mach_o_read_source_version),
469 (bfd_mach_o_read_encryption_info_64, bfd_mach_o_read_main),
470 (bfd_mach_o_read_note, bfd_mach_o_read_build_version),
471 (bfd_mach_o_read_segment): Similarly.
472 (bfd_mach_o_read_thread): Properly bound check thread struct.
473 Don't repeat checks on second loop.
474 (bfd_mach_o_read_command): Fail on invalid command length.
476 2020-01-04 Alan Modra <amodra@gmail.com>
478 * format.c (bfd_check_format_matches): Add preserve_match.
479 Save initial bfd state in "preserve", matched bfd state in
480 "preserve_match". Save just the first match. Release
481 bfd_alloc memory. Restore and finish preserved state as
482 appropriate on all function exit paths.
484 2020-01-04 Alan Modra <amodra@gmail.com>
486 * mmo.c (mmo_mkobject): Allocate tdata with bfd_zalloc.
488 2020-01-04 Alan Modra <amodra@gmail.com>
490 * coffgen.c (coff_real_object_p): Free malloc'd memory on target
493 2020-01-03 Nick Clifton <nickc@redhat.com>
496 (bfd_pef_parse_function_stubs): Correct the test that ensures that
497 there is enough data remaining in the code buffer before
498 attempting to read a function stub.
500 2020-01-03 Nick Clifton <nickc@redhat.com>
503 * elf-properties.c (_bfd_elf_convert_gnu_properties): Check the
504 return value from bfd_malloc.
505 * elf32-arm.c (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
506 (bfd_elf32_arm_stm32l4xx_fix_veneer_locations): Likewise.
507 (elf32_arm_filter_cmse_symbols): Likewise.
508 (elf32_arm_write_section): Likewise.
509 * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
510 (bfd_mach_o_follow_dsym): Likewise.
511 * pef.c (bfd_pef_print_loader_section): Likewise.
512 (bfd_pef_scan_start_address): Likewise.
513 (bfd_pef_parse_function_stubs): Likewise.
514 (bfd_pef_parse_symbols): Likewise.
516 2020-01-03 Sergei Trofimovich <siarheit@google.com>
518 * elfnn-ia64.c (elfNN_ia64_merge_private_bfd_data): don't fail
519 on binary inputs ld/PR25316.
520 (is_ia64_elf): new helper to filter on ia64 objects.
522 2020-01-03 Jan Beulich <jbeulich@suse.com>
524 * mach-o.c (cpusubtype, bfd_mach_o_header_p): Insert underscore
526 (bfd_mach_o_scan): Insert underscore in two variable names.
528 2020-01-02 Sergey Belyashov <sergey.belyashov@gmail.com>
530 * Makefile.am: Add z80-elf target support.
531 * configure.ac: Likewise.
532 * targets.c: Likewise.
533 * Makefile.in: Regenerate.
534 * configure: Regenerate.
535 * config.bfd: Add z80-elf target support and new arches: ez80 and
537 * elf32-z80.c: New file.
538 * archures.c: Add new z80 architectures: eZ80 and Z180.
539 * coffcode.h: Likewise.
540 * cpu-z80.c: Likewise.
541 * coff-z80.c: Add new relocations for Z80 target and local label
543 * reloc.c: Add new relocs.
544 * bfd-in2.h: Regenerate.
545 * libbfd.h: Regenerate.
547 2020-01-02 Tamar Christina <tamar.christina@arm.com>
551 * elfnn-aarch64.c (_bfd_aarch64_create_stub_section): Set ELF class.
553 2020-01-01 Alan Modra <amodra@gmail.com>
555 Update year range in copyright notice of all files.
557 For older changes see ChangeLog-2019
559 Copyright (C) 2020 Free Software Foundation, Inc.
561 Copying and distribution of this file, with or without modification,
562 are permitted in any medium without royalty provided the copyright
563 notice and this notice are preserved.
569 version-control: never